From 019e30ac344d991f2b15b63a1b3e01eaccc663fd Mon Sep 17 00:00:00 2001
From: Domenic Denicola When a user agent is to jump to a code entry-point for a script s, the user agent must run the
- following steps:Calling scripts
Let result be ParseScript(s's code entry-point, s).
If result is a List of errors, report the exception given by the - first element in result for the script s, and go to the step labeled - cleanup.
If result is a List of errors, then:
+ +If the rethrow errors flag is set and s's muted errors + flag is not set, rethrow the error given by the first element of result.
If the rethrow errors flag is set and s's muted
+ errors flag is set, throw a NetworkError
exception.
If the rethrow errors flag is not set, report the exception + given by the first element in result for the script s.
In all cases, go to the step labeled cleanup.
Let status be ScriptEvaluation(result).
If status is an abrupt completion, report the exception given by - result.[[value]] for the script s.
If status is an abrupt completion, then:
+ +If the rethrow errors flag is set and s's muted errors + flag is not set, rethrow the error given by result.[[value]].
If the rethrow errors flag is set and s's muted
+ errors flag is set, throw a NetworkError
exception.
If the rethrow errors flag is not set, report the exception + given result.[[value]] for the script s.
Cleanup: Clean up after running a callback with settings.
When the specification says that a script is to be created, given some script source, a script source URL, an - environment settings object, and optionally a muted errors flag, the user - agent must run the following steps:
+ environment settings object, and optionally muted errors and rethrow + errors flag, the user agent must run the following steps:Jump to script's code - entry-point.
Create a script using source as the script source, the - URL from which source was obtained, and settings object as - the environment settings object.
+ URL from which source was obtained, settings object as + the environment settings object, and passing the rethrow errors + flag.If response is CORS-cross-origin, pass the muted errors flag to the create a script algorithm as well.
-Let the newly created script run until it either - returns, fails to parse, fails to catch an exception, or gets prematurely aborted by the - "kill a worker" or "terminate a worker" algorithms defined +
The newly created script will run until + it either returns, fails to parse, fails to catch an exception, or gets prematurely aborted + by the "kill a worker" or "terminate a worker" algorithms defined above.
-If response is CORS-cross-origin and either it failed to parse or
- an exception was thrown, then throw a NetworkError
exception and abort all these
- steps.
If it failed to parse, then throw an ECMAScript SyntaxError
exception and abort all these steps.
If an exception was thrown or if the script was prematurely aborted, then abort all these steps, letting the exception or aborting continue to be processed by the calling script.