Skip to content
This repository has been archived by the owner on Sep 8, 2021. It is now read-only.

Update to align with stage 3 conditions #38

Merged
merged 5 commits into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
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
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ existing use cases and enable new use cases not currently handled by that propos
<!--#region:status-->
## Status

**Stage:** 2
**Stage:** 3
**Champion:** Ron Buckton (@rbuckton)

_For detailed status of this proposal see [TODO](#todo), below._
Expand Down Expand Up @@ -197,12 +197,9 @@ class C {
- A `static {}` initialization block creates a new lexical scope (e.g. `var`, `function`, and block-scoped
declarations are local to the `static {}` initialization block. This lexical scope is nested within the lexical
scope of the class body (granting privileged access to instance private state for the class).
- A class may have at most one `static {}` initialization block in its class body.
- A `static {}` initialization block is evaluated immediately after all static field initializers have been
evaluated as part of class declaration evaluation, regardless of its order within the class body
(this aligns with `constructor() {}`).
- A class may have any number of `static {}` initialization blocks in its class body.
- `static {}` initialization blocks are evaluated in document order interleaved with static field initializers.
- A `static {}` initialization block may not have decorators (instead you would decorate the class itself).
Decorators can always add a class finisher to add their own static initialization.
- When evaluated, a `static {}` initialization block's `this` receiver is the constructor object of the class
(as with static field initializers).
- It is a **Syntax Error** to reference `arguments` from within a `static {}` initialization block.
Expand Down
1,760 changes: 1,095 additions & 665 deletions docs/index.html

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ gulp.task("clean", clean);

const build = () => gulp
.src(["spec/index.html"])
.pipe(emu())
.pipe(emu({
ecma262Biblio: false
}))
.pipe(gulp.dest("docs"));
gulp.task("build", build);

Expand Down
270 changes: 180 additions & 90 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"license": "SEE LICENSE IN https://tc39.github.io/ecma262/#sec-copyright-and-software-license",
"devDependencies": {
"del": "^5.1.0",
"ecmarkup": "^4.1.2",
"ecmarkup": "^6.1.0",
"gulp": "^4.0.2",
"gulp-emu": "^1.3.2",
"gulp-live-server": "0.0.31"
Expand Down
5 changes: 5 additions & 0 deletions spec/biblio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"https://arai-a.github.io/ecma262-compare/?pr=1668&id=sec-class-definitions-static-semantics-containsarguments": [
{"type": "clause", "id": "sec-class-definitions-static-semantics-containsarguments", "aoid": "ContainsArguments", "title": "Static Semantics: ContainsArguments", "titleHTML": "Static Semantics: ContainsArguments", "namespace": "https://tc39.es/ecma262/", "number": "14.6.15", "location": "", "referencingIds": [], "key": "Static Semantics: ContainsArguments" }
]
}
1 change: 1 addition & 0 deletions spec/ecma262biblio.json

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,26 @@
<link rel="spec" href="es2015" />
<pre class="metadata">
title: ECMAScript class static initialization blocks
stage: 1
stage: 3
contributors: Ron Buckton, Ecma International
</pre>

<emu-biblio href="biblio.json"></emu-biblio>
<emu-biblio href="ecma262biblio.json"></emu-biblio>

<emu-intro id="sec-intro">
<h1>Introduction</h1>
<emu-import href="sec-introduction.html"></emu-import>
</emu-intro>

<emu-clause id="sec-executable-code-and-execution-contexts">
<h1>Executable Code and Execution Contexts</h1>
<emu-import href="sec-executable-code-and-execution-contexts-patch.html"></emu-import>
<emu-clause id="sec-ecmascript-data-types-and-values" aoid="Type">
<h1>ECMAScript Data Types and Values</h1>
<emu-import href="sec-ecmascript-specification-types-patch.html"></emu-import>
</emu-clause>

<emu-clause id="sec-abstract-operations">
<h1>Abstract Operations</h1>
<emu-import href="sec-operations-on-objects-patch.html"></emu-import>
</emu-clause>

<emu-clause id="sec-ecmascript-language-expressions">
Expand Down
205 changes: 61 additions & 144 deletions spec/sec-class-definitions-patch.html

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions spec/sec-ecmascript-specification-types-patch.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<emu-clause id="sec-ecmascript-specification-types">
<h1>ECMAScript Specification Types</h1>
<emu-clause id="sec-classstaticblockdefinition-records">
<h1><ins>ClassStaticBlockDefinition Records</ins></h1>
<p>A <dfn>ClassStaticBlockDefinition Record</dfn> is a Record value used to encapsulate the executable code for a class static initialization block.</p>
<p>ClassStaticBlockDefinition Records have the fields listed in <emu-xref href="#table-classstaticblockdefinition-record-fields"></emu-xref>.</p>
<emu-table id="table-classstaticblockdefinition-record-fields" caption="ClassStaticBlockDefinition Record Fields">
<table>
<tbody>
<tr>
<th>
Field Name
</th>
<th>
Value
</th>
<th>
Meaning
</th>
</tr>
<tr>
<td>
[[Body]]
</td>
<td>
An function object.
</td>
<td>
The function object to be called during static initialization of a class.
</td>
</tr>
</tbody>
</table>
</emu-table>
</emu-clause>
</emu-clause>
117 changes: 0 additions & 117 deletions spec/sec-executable-code-and-execution-contexts-patch.html

This file was deleted.

11 changes: 11 additions & 0 deletions spec/sec-operations-on-objects-patch.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<emu-clause id="sec-operations-on-objects">
<h1>Operations on Objects</h1>
<emu-clause id="sec-evaluatestaticblock" aoid="EvaluateStaticBlock">
<h1><ins>EvaluateStaticBlock ( _receiver_ , _blockRecord_ )</ins></h1>
<emu-alg>
1. Assert: Type(_receiver_) is Object.
1. Assert: _blockRecord_ is a ClassStaticBlockDefinition Record.
1. Perform ? Call(_blockRecord_.[[Body]], _receiver_).
</emu-alg>
</emu-clause>
</emu-clause>