From 40239f09829614bd247919d0833123c392c8c917 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Fri, 8 Nov 2024 11:04:53 -0700 Subject: [PATCH 1/2] Editorial: replace Type AO with new ECMA-262 type test convention --- document/js-api/index.bs | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/document/js-api/index.bs b/document/js-api/index.bs index 6a3ae0c7..a0741b62 100644 --- a/document/js-api/index.bs +++ b/document/js-api/index.bs @@ -40,6 +40,24 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT text: ! text: ? text: Type; url: sec-ecmascript-data-types-and-values + url: sec-ecmascript-language-types-bigint-type + text: is a BigInt + text: is not a BigInt + url: sec-ecmascript-language-types-boolean-type + text: is a Boolean + text: is not a Boolean + url: sec-ecmascript-language-types-number-type + text: is a Number + text: is not a Number + url: sec-ecmascript-language-types-string-type + text: is a String + text: is not a String + url: sec-ecmascript-language-types-symbol-type + text: is a Symbol + text: is not a Symbol + url: sec-object-type + text: is an Object + text: is not an Object text: current Realm; url: current-realm text: ObjectCreate; url: sec-objectcreate text: CreateBuiltinFunction; url: sec-createbuiltinfunction @@ -446,7 +464,7 @@ To instantiate imported strings with module |module| and |importedStr 1. Let |o| be |builtinOrStringImports|[|moduleName|] 1. Else, 1. Let |o| be [=?=] [$Get$](|importObject|, |moduleName|). - 1. If [=Type=](|o|) is not Object, throw a {{TypeError}} exception. + 1. If |o| [=is not an Object=], throw a {{TypeError}} exception. 1. Let |v| be [=?=] [$Get$](|o|, |componentName|). 1. If |externtype| is of the form [=external-type/func=] |functype|, 1. If [$IsCallable$](|v|) is false, throw a {{LinkError}} exception. @@ -461,9 +479,9 @@ To instantiate imported strings with module |module| and |importedStr 1. If |v| [=implements=] {{Global}}, 1. Let |globaladdr| be |v|.\[[Global]]. 1. Otherwise, - 1. If |valtype| is [=i64=] and [=Type=](|v|) is not BigInt, + 1. If |valtype| is [=i64=] and |v| [=is not a BigInt=], 1. Throw a {{LinkError}} exception. - 1. If |valtype| is one of [=i32=], [=f32=] or [=f64=] and [=Type=](|v|) is not Number, + 1. If |valtype| is one of [=i32=], [=f32=] or [=f64=] and |v| [=is not a Number=], 1. Throw a {{LinkError}} exception. 1. If |valtype| is [=v128=], 1. Throw a {{LinkError}} exception. @@ -1814,7 +1832,7 @@ Note: The algorithms in this section refer to JS builtins defined on [=String=]. The UnwrapString(|v|) abstract operation, when invoked, performs the following steps: -1. If [=Type=](|v|) is not [=String=] +1. If |v| [=is not a String=] 1. Throw a {{RuntimeError}} exception as if a [=trap=] was executed. 1. Return |v| @@ -1856,7 +1874,7 @@ The |funcType| of this builtin is `(func (param externref) (result i32))`.
When this builtin is invoked with parameter |v|, the following steps must be run: -1. If [=Type=](|v|) is not [=String=] +1. If |v| [=is not a String=] 1. Return 0 1. Return 1 @@ -2017,9 +2035,9 @@ Note: Explicitly allow null strings to be compared for equality as that is meani When this builtin is invoked with parameters |first| and |second|, the following steps must be run: -1. If |first| is not null and [=Type=](|first|) is not [=String=] +1. If |first| is not null and |first| [=is not a String=] 1. Throw a {{RuntimeError}} exception as if a [=trap=] was executed. -1. If |second| is not null and [=Type=](|second|) is not [=String=] +1. If |second| is not null and |second| [=is not a String=] 1. Throw a {{RuntimeError}} exception as if a [=trap=] was executed. 1. If [=!=] [=IsStrictlyEqual=](|first|, |second|) is true 1. Return 1. From 7c58bed720309c73c7a59eda6112671dd5ce8851 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Fri, 8 Nov 2024 11:05:54 -0700 Subject: [PATCH 2/2] actually remove Type --- document/js-api/index.bs | 1 - 1 file changed, 1 deletion(-) diff --git a/document/js-api/index.bs b/document/js-api/index.bs index a0741b62..01dfc58e 100644 --- a/document/js-api/index.bs +++ b/document/js-api/index.bs @@ -39,7 +39,6 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT url: sec-returnifabrupt-shorthands text: ! text: ? - text: Type; url: sec-ecmascript-data-types-and-values url: sec-ecmascript-language-types-bigint-type text: is a BigInt text: is not a BigInt