Skip to content

Commit 6da1275

Browse files
authored
Merge dd601fb into wasm-js-api-2-fork-js-string-builtins
2 parents ce42c52 + dd601fb commit 6da1275

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

document/js-api/index.bs

+25-8
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,24 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT
3939
url: sec-returnifabrupt-shorthands
4040
text: !
4141
text: ?
42-
text: Type; url: sec-ecmascript-data-types-and-values
42+
url: sec-ecmascript-language-types-bigint-type
43+
text: is a BigInt
44+
text: is not a BigInt
45+
url: sec-ecmascript-language-types-boolean-type
46+
text: is a Boolean
47+
text: is not a Boolean
48+
url: sec-ecmascript-language-types-number-type
49+
text: is a Number
50+
text: is not a Number
51+
url: sec-ecmascript-language-types-string-type
52+
text: is a String
53+
text: is not a String
54+
url: sec-ecmascript-language-types-symbol-type
55+
text: is a Symbol
56+
text: is not a Symbol
57+
url: sec-object-type
58+
text: is an Object
59+
text: is not an Object
4360
text: current Realm; url: current-realm
4461
text: ObjectCreate; url: sec-objectcreate
4562
text: CreateBuiltinFunction; url: sec-createbuiltinfunction
@@ -446,7 +463,7 @@ To <dfn>instantiate imported strings</dfn> with module |module| and |importedStr
446463
1. Let |o| be |builtinOrStringImports|[|moduleName|]
447464
1. Else,
448465
1. Let |o| be [=?=] [$Get$](|importObject|, |moduleName|).
449-
1. If [=Type=](|o|) is not Object, throw a {{TypeError}} exception.
466+
1. If |o| [=is not an Object=], throw a {{TypeError}} exception.
450467
1. Let |v| be [=?=] [$Get$](|o|, |componentName|).
451468
1. If |externtype| is of the form [=external-type/func=] |functype|,
452469
1. If [$IsCallable$](|v|) is false, throw a {{LinkError}} exception.
@@ -461,9 +478,9 @@ To <dfn>instantiate imported strings</dfn> with module |module| and |importedStr
461478
1. If |v| [=implements=] {{Global}},
462479
1. Let |globaladdr| be |v|.\[[Global]].
463480
1. Otherwise,
464-
1. If |valtype| is [=i64=] and [=Type=](|v|) is not BigInt,
481+
1. If |valtype| is [=i64=] and |v| [=is not a BigInt=],
465482
1. Throw a {{LinkError}} exception.
466-
1. If |valtype| is one of [=i32=], [=f32=] or [=f64=] and [=Type=](|v|) is not Number,
483+
1. If |valtype| is one of [=i32=], [=f32=] or [=f64=] and |v| [=is not a Number=],
467484
1. Throw a {{LinkError}} exception.
468485
1. If |valtype| is [=v128=],
469486
1. Throw a {{LinkError}} exception.
@@ -1814,7 +1831,7 @@ Note: The algorithms in this section refer to JS builtins defined on [=String=].
18141831

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

1817-
1. If [=Type=](|v|) is not [=String=]
1834+
1. If |v| [=is not a String=]
18181835
1. Throw a {{RuntimeError}} exception as if a [=trap=] was executed.
18191836
1. Return |v|
18201837

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

1859-
1. If [=Type=](|v|) is not [=String=]
1876+
1. If |v| [=is not a String=]
18601877
1. Return 0
18611878
1. Return 1
18621879

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

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

2020-
1. If |first| is not null and [=Type=](|first|) is not [=String=]
2037+
1. If |first| is not null and |first| [=is not a String=]
20212038
1. Throw a {{RuntimeError}} exception as if a [=trap=] was executed.
2022-
1. If |second| is not null and [=Type=](|second|) is not [=String=]
2039+
1. If |second| is not null and |second| [=is not a String=]
20232040
1. Throw a {{RuntimeError}} exception as if a [=trap=] was executed.
20242041
1. If [=!=] [=IsStrictlyEqual=](|first|, |second|) is true
20252042
1. Return 1.

0 commit comments

Comments
 (0)