diff --git a/README.md b/README.md index f62fc47..80c536a 100644 --- a/README.md +++ b/README.md @@ -253,7 +253,7 @@ The following is a high-level list of tasks to progress through each stage of th ### Stage 2 Entrance Criteria -* [ ] [Initial specification text][Specification]. +* [x] [Initial specification text][Specification]. * [ ] [Transpiler support][Transpiler] (_Optional_). ### Stage 3 Entrance Criteria diff --git a/spec.emu b/spec.emu index efcea21..a597d41 100644 --- a/spec.emu +++ b/spec.emu @@ -15,3 +15,80 @@ contributors: Ron Buckton, Ecma International

Introduction

See the proposal repository for background material and discussion.

+ + +

ECMAScript Data Types and Values

+ +

ECMAScript Language Types

+ +

The Symbol Type

+ +

Well-Known Symbols

+ + + + + + + + + + + + + + +
+ Specification Name + + [[Description]] + + Value and Purpose +
+ @@enter + + `"Symbol.enter"` + + A method that returns a Disposable Object to ensure strict enforcement of `using`, `await using`, `DisposableStack.prototype.use`, or `AsyncDisposableStack.prototype.use`. +
+
+
+
+
+
+ + +

Abstract Operations

+ + +

Operations on Disposable Objects

+ + +

+ CreateDisposableResource ( + _V_ : an ECMAScript language value, + _hint_ : either ~sync-dispose~ or ~async-dispose~, + optional _method_ : a function object, + ): either a normal completion containing a DisposableResource Record or a throw completion +

+
+ + 1. If _method_ is not present, then + 1. If _V_ is either *null* or *undefined*, then + 1. Set _V_ to *undefined*. + 1. Set _method_ to *undefined*. + 1. Else, + 1. If _V_ is not an Object, throw a *TypeError* exception. + 1. Let _enter_ be ? GetMethod(_V_, @@enter). + 1. If _enter_ is not *undefined*, then + 1. Set _V_ to ? Call(_enter_, _V_). + 1. If _V_ is not an Object, throw a *TypeError* exception. + 1. Set _method_ to ? GetDisposeMethod(_V_, _hint_). + 1. If _method_ is *undefined*, throw a *TypeError* exception. + 1. Else, + 1. If IsCallable(_method_) is *false*, throw a *TypeError* exception. + 1. Return the DisposableResource Record { [[ResourceValue]]: _V_, [[Hint]]: _hint_, [[DisposeMethod]]: _method_ }. + +
+
+