Skip to content

Commit

Permalink
Add import.meta.url
Browse files Browse the repository at this point in the history
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 whatwg#1013, and as
such is excluded for now.
  • Loading branch information
domenic authored and Alice Boxhall committed Jan 7, 2019
1 parent 0e6573d commit 983d9a2
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -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>


Expand Down Expand Up @@ -88230,6 +88238,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
Expand Down Expand Up @@ -119883,6 +119908,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>

Expand Down

0 comments on commit 983d9a2

Please sign in to comment.