Permalink
Browse files

Add import.meta.url

This integrates with the stage 3 import.meta proposal located at
https://github.com/tc39/proposal-import-meta/. This is based on
https://github.com/tc39/proposal-import-meta/blob/f5d39bc471a5bf2791708f9a3fec943380d9e3ee/HTML%20Integration.md
although it only includes the easier part, import.meta.url.
import.meta.scriptElement is still being discussed, at #1013, and as
such is excluded for now.
  • Loading branch information...
domenic committed Oct 18, 2017
1 parent e568aaa commit 177dd9dc60df084609ff5eef8bbfa2cdb26d4bf3
Showing with 28 additions and 0 deletions.
  1. +28 −0 source
View
28 source
@@ -3070,6 +3070,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li>The <dfn data-x-href="https://tc39.github.io/proposal-dynamic-import/#sec-finishdynamicimport">FinishDynamicImport</dfn> abstract operation</li>
</ul>
<p>Users agents that support JavaScript must also implement the <cite>import.meta</cite>
proposal. The following term is defined there, and used in this specification: <ref
spec=JSIMPORTMETA></p>
<ul class="brief">
<li>The <dfn data-x="js-HostGetImportMetaProperties" data-x-href="https://tc39.github.io/proposal-import-meta/#sec-hostgetimportmetaproperties">HostGetImportMetaProperties</dfn> abstract operation</li>
</ul>
</dd>
@@ -88215,6 +88223,23 @@ import "https://example.com/foo/../module2.js";</pre>
<li><p>Return undefined.</p></li>
</ol>
<h6
id="hostgetimportmetaproperties"><dfn>HostGetImportMetaProperties</dfn>(<var>moduleRecord</var>)</h6>
<p>The <cite>import.meta</cite> proposal contains an implementation-defined <span
data-x="js-HostGetImportMetaProperties">HostGetImportMetaProperties</span> abstract operation.
User agents must use the following implementation: <ref spec=JSIMPORTMETA></p>
<ol>
<li><p>Let <var>module script</var> be <var>moduleRecord</var>.[[HostDefined]].</p></li>
<li><p>Let <var>urlString</var> be <var>module script</var>'s <span
data-x="concept-script-base-url">base URL</span>, <span
data-x="concept-url-serializer">serialized</span>.</p></li>
<li><p>Return « Record { [[Key]]: "url", [[Value]]: <var>urlString</var> } ».</p></li>
</ol>
<h5>Integration with the JavaScript agent formalism</h5>
<p>JavaScript defines the concept of an <span>agent</span>. Until such a time that this standard
@@ -119863,6 +119888,9 @@ INSERT INTERFACES HERE
<dt id="refsJSIMPORT">[JSIMPORT]</dt>
<dd><cite><a href="https://tc39.github.io/proposal-dynamic-import/">import()</a></cite>. Ecma International.</dd>
<dt id="refsJSIMPORTMETA">[JSIMPORTMETA]</dt>
<dd><cite><a href="https://tc39.github.io/proposal-import-meta/">import.meta</a></cite>. Ecma International.</dd>
<dt id="refsJSINTL">[JSINTL]</dt>
<dd><cite><a href="https://tc39.github.io/ecma402/">ECMAScript Internationalization API Specification</a></cite>. Ecma International.</dd>

0 comments on commit 177dd9d

Please sign in to comment.