Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rewrite script execution on top of ES
This brings the script execution parts of the spec up to date with the latest changes in ES. Notable changes include:

- Removed of some generalization to allow non-JavaScript scripting languages (including XML-based ones).
- Let ES track the execution context stack, and the corresponding stack of scripts; see tc39/ecma262#242. This allows us to stop tracking the stack of script settings objects, instead defining entry and incumbent settings objects with reference to ES. This is especially important since our current mechanism, of monkey-patching the SourceElement grammatical construction, no longer works since that grammar production has disappeared. Fixes #155.
- Established a direct correspondence between HTML's "script" concept and ES's Script Record/Module Record concepts. The former is stored in the [[HostDefined]] slot of the latter.
- The process of parsing and executing scripts, including handling any resulting errors, is now formalized and appropriately calls out to ES's ParseScript and ScriptEvaluation abstract operations.

Note that we do *not* use the ECMAScript ScriptEvaluationJob or job queue for our script parsing/evaluation. That setup is overengineered and does not serve the needs of HTML; we hope to remove it from ES eventually. (See tc39/ecma262#240 (comment) for details.) Instead we simply use ParseScript and EvaluateScript directly.

This almost completes https://www.w3.org/Bugs/Public/show_bug.cgi?id=25981, with the remaining work item being to integrate promise jobs and ensure they are run as microtasks.
  • Loading branch information
domenic committed Dec 21, 2015
1 parent fda5ae3 commit 4891d18
Showing 1 changed file with 208 additions and 259 deletions.

0 comments on commit 4891d18

Please sign in to comment.