From cd3ed068369c853df84643fedc78d54ed5f3f6d9 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 19 Nov 2019 22:08:40 -0500 Subject: [PATCH 1/3] Editorial: Copy RequireInternalSlot from ECMA-262 --- spec/abstract-operations.html | 14 ++++++++++++++ spec/collator.html | 6 ++---- spec/datetimeformat.html | 3 +-- spec/index.html | 1 + spec/numberformat.html | 3 +-- spec/pluralrules.html | 6 ++---- 6 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 spec/abstract-operations.html diff --git a/spec/abstract-operations.html b/spec/abstract-operations.html new file mode 100644 index 00000000..87a42dc4 --- /dev/null +++ b/spec/abstract-operations.html @@ -0,0 +1,14 @@ + +

Abstract Operations

+

Objects and interfaces of this specification exhibit many common patterns in their behavior. This section defines abstract operations supporting those common patterns.

+ + +

RequireInternalSlot ( _O_, _internalSlot_ )

+

The abstract operation RequireInternalSlot throws an exception unless _O_ is an Object and has the given internal slot.

+ + 1. If Type(_O_) is not Object, throw a *TypeError* exception. + 1. If _O_ does not have an _internalSlot_ internal slot, throw a *TypeError* exception. + +
+ +
diff --git a/spec/collator.html b/spec/collator.html index a192ca39..e35cadd0 100644 --- a/spec/collator.html +++ b/spec/collator.html @@ -181,8 +181,7 @@

get Intl.Collator.prototype.compare

1. Let _collator_ be *this* value. - 1. If Type(_collator_) is not Object, throw a *TypeError* exception. - 1. If _collator_ does not have an [[InitializedCollator]] internal slot, throw a *TypeError* exception. + 1. Perform ? RequireInternalSlot(_collator_, [[InitializedCollator]]). 1. If _collator_.[[BoundCompare]] is *undefined*, then 1. Let _F_ be a new built-in function object as defined in . 1. Set _F_.[[Collator]] to _collator_. @@ -271,8 +270,7 @@

Intl.Collator.prototype.resolvedOptions ()

1. Let _collator_ be *this* value. - 1. If Type(_collator_) is not Object, throw a *TypeError* exception. - 1. If _collator_ does not have an [[InitializedCollator]] internal slot, throw a *TypeError* exception. + 1. Perform ? RequireInternalSlot(_collator_, [[InitializedCollator]]). 1. Let _options_ be ! ObjectCreate(%ObjectPrototype%). 1. For each row of , except the header row, in table order, do 1. Let _p_ be the Property value of the current row. diff --git a/spec/datetimeformat.html b/spec/datetimeformat.html index e6441bc8..0f3b2b24 100644 --- a/spec/datetimeformat.html +++ b/spec/datetimeformat.html @@ -630,8 +630,7 @@

Intl.DateTimeFormat.prototype.formatToParts ( _date_ )

1. Let _dtf_ be *this* value. - 1. If Type(_dtf_) is not Object, throw a *TypeError* exception. - 1. If _dtf_ does not have an [[InitializedDateTimeFormat]] internal slot, throw a *TypeError* exception. + 1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]). 1. If _date_ is *undefined*, then 1. Let _x_ be Call(%Date_now%, *undefined*). 1. Else, diff --git a/spec/index.html b/spec/index.html index 0dd39794..a9ca64e4 100644 --- a/spec/index.html +++ b/spec/index.html @@ -82,6 +82,7 @@ + diff --git a/spec/numberformat.html b/spec/numberformat.html index eb00449d..e9e3425c 100644 --- a/spec/numberformat.html +++ b/spec/numberformat.html @@ -613,8 +613,7 @@

Intl.NumberFormat.prototype.formatToParts ( _value_ )

1. Let _nf_ be the *this* value. - 1. If Type(_nf_) is not Object, throw a *TypeError* exception. - 1. If _nf_ does not have an [[InitializedNumberFormat]] internal slot, throw a *TypeError* exception. + 1. Perform ? RequireInternalSlot(_nf_, [[InitializedNumberFormat]]). 1. Let _x_ be ? ToNumeric(_value_). 1. Return ? FormatNumericToParts(_nf_, _x_). diff --git a/spec/pluralrules.html b/spec/pluralrules.html index 3bccf5ca..016aba58 100644 --- a/spec/pluralrules.html +++ b/spec/pluralrules.html @@ -259,8 +259,7 @@

Intl.PluralRules.prototype.select( _value_ )

1. Let _pr_ be the *this* value. - 1. If Type(_pr_) is not Object, throw a *TypeError* exception. - 1. If _pr_ does not have an [[InitializedPluralRules]] internal slot, throw a *TypeError* exception. + 1. Perform ? RequireInternalSlot(_pr_, [[InitializedPluralRules]]). 1. Let _n_ be ? ToNumber(_value_). 1. Return ? ResolvePlural(_pr_, _n_). @@ -275,8 +274,7 @@

Intl.PluralRules.prototype.resolvedOptions ()

1. Let _pr_ be the *this* value. - 1. If Type(_pr_) is not Object, throw a *TypeError* exception. - 1. If _pr_ does not have an [[InitializedPluralRules]] internal slot, throw a *TypeError* exception. + 1. Perform ? RequireInternalSlot(_pr_, [[InitializedPluralRules]]). 1. Let _options_ be ! ObjectCreate(%ObjectPrototype%). 1. For each row of , except the header row, in table order, do 1. Let _p_ be the Property value of the current row. From 8169da196872fd41565040ad513fc35333416815 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Wed, 20 Nov 2019 14:49:21 -0500 Subject: [PATCH 2/3] Editorial: Reference ECMA-262 abstractions rather than duplicating them --- spec/abstract-operations.html | 14 -------------- spec/biblio.json | 7 +++++++ spec/index.html | 1 - 3 files changed, 7 insertions(+), 15 deletions(-) delete mode 100644 spec/abstract-operations.html diff --git a/spec/abstract-operations.html b/spec/abstract-operations.html deleted file mode 100644 index 87a42dc4..00000000 --- a/spec/abstract-operations.html +++ /dev/null @@ -1,14 +0,0 @@ - -

Abstract Operations

-

Objects and interfaces of this specification exhibit many common patterns in their behavior. This section defines abstract operations supporting those common patterns.

- - -

RequireInternalSlot ( _O_, _internalSlot_ )

-

The abstract operation RequireInternalSlot throws an exception unless _O_ is an Object and has the given internal slot.

- - 1. If Type(_O_) is not Object, throw a *TypeError* exception. - 1. If _O_ does not have an _internalSlot_ internal slot, throw a *TypeError* exception. - -
- -
diff --git a/spec/biblio.json b/spec/biblio.json index 5cb10e34..6ed481a4 100644 --- a/spec/biblio.json +++ b/spec/biblio.json @@ -1,4 +1,11 @@ { + "https://tc39.github.io/ecma262/": [ + { + "type": "op", + "aoid": "RequireInternalSlot", + "id": "sec-requireinternalslot" + } + ], "https://tc39.es/proposal-bigint/": [ { "type": "op", diff --git a/spec/index.html b/spec/index.html index a9ca64e4..0dd39794 100644 --- a/spec/index.html +++ b/spec/index.html @@ -82,7 +82,6 @@ - From e18f3bddcaea77e0001f4c2e266e60f40d555ab3 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Wed, 20 Nov 2019 14:49:42 -0500 Subject: [PATCH 3/3] Editorial: Add reference to ECMA-262 string-concatenation --- spec/biblio.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/biblio.json b/spec/biblio.json index 6ed481a4..f8400b1b 100644 --- a/spec/biblio.json +++ b/spec/biblio.json @@ -4,6 +4,12 @@ "type": "op", "aoid": "RequireInternalSlot", "id": "sec-requireinternalslot" + }, + { + "type": "term", + "term": "string-concatenation", + "refId": "sec-ecmascript-language-types-string-type", + "key": "string-concatenation" } ], "https://tc39.es/proposal-bigint/": [