Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide standalone ParseScript wrapper #7969

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -94269,14 +94269,8 @@ document.querySelector("button").addEventListener("click", bound);
<li><p>Set <var>script</var>'s <span data-x="concept-script-parse-error">parse error</span> and
<span data-x="concept-script-error-to-rethrow">error to rethrow</span> to null.</p></li>

<li>
<p>Let <var>result</var> be <span data-x="js-ParseScript">ParseScript</span>(<var>source</var>,
<var>settings</var>'s <span data-x="environment settings object's Realm">Realm</span>,
<var>script</var>).</p>

<p class="note">Passing <var>script</var> as the last parameter here ensures
<var>result</var>.[[HostDefined]] will be <var>script</var>.</p>
</li>
<li><p>Let <var>result</var> be the result of <span>parsing a classic script</span> given
<var>source</var> and <var>script</var>.</p></li>

<li>
<p>If <var>result</var> is a <span>list</span> of errors, then:
Expand All @@ -94296,6 +94290,26 @@ document.querySelector("button").addEventListener("click", bound);
<li><p>Return <var>script</var>.</p></li>
</ol>

<p>To <dfn export data-x="parsing a classic script">parse a classic script</dfn>, given a
<span>string</span> <var>source</var> and an optional <span>classic script</span>
<var>script</var>:</p>

<ol>
<li><p>Let <var>realm</var> be undefined.</p></li>

<li><p>Let <var>hostDefined</var> be empty.</p></li>

<li><p>If <var>script</var> is given, then set <var>realm</var> to <var>script</var>'s
<span>settings object</span>'s <span data-x="environment settings object's Realm">Realm</span>
and <var>hostDefined</var> to <var>script</var>.</p></li>

<li><p>Return <span data-x="js-ParseScript">ParseScript</span>(<var>source</var>,
<var>realm</var>, <var>hostDefined</var>).</p></li>
</ol>

<p class="note"><cite>Fetch</cite> uses <span>parsing a classic script</span> as part of
opaque-response blocking. <ref spec=FETCH></p>

<p>To <dfn data-x="creating a JavaScript module script">create a JavaScript module script</dfn>,
given a <span>string</span> <var>source</var>, an <span>environment settings
object</span> <var>settings</var>, a <span>URL</span> <var>baseURL</var>, and some <span>script
Expand Down