Skip to content

Commit 4553771

Browse files
michaelficarraeqrion
authored andcommitted
Editorial: replace Type AO with new ECMA-262 type test convention
1 parent ab1be32 commit 4553771

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

document/js-api/index.bs

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,24 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT
4040
text: !
4141
text: ?
4242
text: Type; url: sec-ecmascript-data-types-and-values
43+
url: sec-ecmascript-language-types-bigint-type
44+
text: is a BigInt
45+
text: is not a BigInt
46+
url: sec-ecmascript-language-types-boolean-type
47+
text: is a Boolean
48+
text: is not a Boolean
49+
url: sec-ecmascript-language-types-number-type
50+
text: is a Number
51+
text: is not a Number
52+
url: sec-ecmascript-language-types-string-type
53+
text: is a String
54+
text: is not a String
55+
url: sec-ecmascript-language-types-symbol-type
56+
text: is a Symbol
57+
text: is not a Symbol
58+
url: sec-object-type
59+
text: is an Object
60+
text: is not an Object
4361
text: current Realm; url: current-realm
4462
text: ObjectCreate; url: sec-objectcreate
4563
text: CreateBuiltinFunction; url: sec-createbuiltinfunction
@@ -446,7 +464,7 @@ To <dfn>instantiate imported strings</dfn> with module |module| and |importedStr
446464
1. Let |o| be |builtinOrStringImports|[|moduleName|]
447465
1. Else,
448466
1. Let |o| be [=?=] [$Get$](|importObject|, |moduleName|).
449-
1. If [=Type=](|o|) is not Object, throw a {{TypeError}} exception.
467+
1. If |o| [=is not an Object=], throw a {{TypeError}} exception.
450468
1. Let |v| be [=?=] [$Get$](|o|, |componentName|).
451469
1. If |externtype| is of the form [=external-type/func=] |functype|,
452470
1. If [$IsCallable$](|v|) is false, throw a {{LinkError}} exception.
@@ -461,9 +479,9 @@ To <dfn>instantiate imported strings</dfn> with module |module| and |importedStr
461479
1. If |v| [=implements=] {{Global}},
462480
1. Let |globaladdr| be |v|.\[[Global]].
463481
1. Otherwise,
464-
1. If |valtype| is [=i64=] and [=Type=](|v|) is not BigInt,
482+
1. If |valtype| is [=i64=] and |v| [=is not a BigInt=],
465483
1. Throw a {{LinkError}} exception.
466-
1. If |valtype| is one of [=i32=], [=f32=] or [=f64=] and [=Type=](|v|) is not Number,
484+
1. If |valtype| is one of [=i32=], [=f32=] or [=f64=] and |v| [=is not a Number=],
467485
1. Throw a {{LinkError}} exception.
468486
1. If |valtype| is [=v128=],
469487
1. Throw a {{LinkError}} exception.
@@ -1814,7 +1832,7 @@ Note: The algorithms in this section refer to JS builtins defined on [=String=].
18141832

18151833
The <dfn abstract-op lt="UnwrapString">UnwrapString(|v|)</dfn> abstract operation, when invoked, performs the following steps:
18161834

1817-
1. If [=Type=](|v|) is not [=String=]
1835+
1. If |v| [=is not a String=]
18181836
1. Throw a {{RuntimeError}} exception as if a [=trap=] was executed.
18191837
1. Return |v|
18201838

@@ -1856,7 +1874,7 @@ The |funcType| of this builtin is `(func (param externref) (result i32))`.
18561874
<div algorithm="js-string-test">
18571875
When this builtin is invoked with parameter |v|, the following steps must be run:
18581876

1859-
1. If [=Type=](|v|) is not [=String=]
1877+
1. If |v| [=is not a String=]
18601878
1. Return 0
18611879
1. Return 1
18621880

@@ -2017,9 +2035,9 @@ Note: Explicitly allow null strings to be compared for equality as that is meani
20172035

20182036
When this builtin is invoked with parameters |first| and |second|, the following steps must be run:
20192037

2020-
1. If |first| is not null and [=Type=](|first|) is not [=String=]
2038+
1. If |first| is not null and |first| [=is not a String=]
20212039
1. Throw a {{RuntimeError}} exception as if a [=trap=] was executed.
2022-
1. If |second| is not null and [=Type=](|second|) is not [=String=]
2040+
1. If |second| is not null and |second| [=is not a String=]
20232041
1. Throw a {{RuntimeError}} exception as if a [=trap=] was executed.
20242042
1. If [=!=] [=IsStrictlyEqual=](|first|, |second|) is true
20252043
1. Return 1.

0 commit comments

Comments
 (0)