Skip to content

Commit 6802d86

Browse files
committed
[js-api] Remove some anchor definitions
WebRef has recently added definitions for ECMAScript, which means most of the explicit anchor definitions are no longer needed. Also, some abstract operations had their names changed. This change should be entirely editorial.
1 parent 6129263 commit 6802d86

File tree

1 file changed

+22
-76
lines changed

1 file changed

+22
-76
lines changed

document/js-api/index.bs

Lines changed: 22 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -37,66 +37,12 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT
3737
url: sec-returnifabrupt-shorthands
3838
text: !
3939
text: ?
40-
text: agent cluster; url: sec-agent-clusters
41-
text: agent; url: agent
42-
text: data block; url: sec-data-blocks
43-
text: Bound Function; url: sec-bound-function-exotic-objects
44-
text: NumericLiteral; url: sec-literals-numeric-literals
45-
text: surrounding agent; url: surrounding-agent
46-
text: ToNumber; url: sec-tonumber
47-
text: ToInt32; url: sec-toint32
48-
text: ToString; url: sec-tostring
49-
url: sec-ecmascript-data-types-and-values
50-
text: Type
51-
text: Type(x)
52-
url: sec-iscallable
53-
text: IsCallable
54-
text: callable; for: ECMAScript
55-
url: sec-well-known-intrinsic-objects
56-
text: %ErrorPrototype%
57-
text: %ObjectPrototype%; url: sec-properties-of-the-object-prototype-object
58-
text: %Promise%; url: sec-promise-constructor
59-
text: Property Descriptor; url: sec-property-descriptor-specification-type
60-
text: array index; url: sec-array-exotic-objects
61-
text: OrdinaryGetOwnProperty; url: sec-ordinarygetownproperty
62-
text: OrdinaryDefineOwnProperty; url: sec-ordinarydefineownproperty
63-
text: OrdinaryPreventExtensions; url: sec-ordinarypreventextensions
64-
text: OrdinarySet; url: sec-ordinaryset
65-
text: equally close values; url: sec-ecmascript-language-types-number-type
66-
text: internal slot; url: sec-object-internal-methods-and-internal-slots
67-
text: JavaScript execution context stack; url: execution-context-stack
68-
text: running JavaScript execution context; url: running-execution-context
69-
text: GetIterator; url: sec-getiterator
70-
text: IteratorStep; url: sec-iteratorstep
71-
text: NormalCompletion; url: sec-normalcompletion
72-
text: IteratorValue; url: sec-iteratorvalue
73-
url: sec-well-known-symbols
74-
text: @@iterator
75-
text: @@toStringTag
76-
text: CreateDataProperty; url: sec-createdataproperty
77-
text: DetachArrayBuffer; url: sec-detacharraybuffer
78-
text: SetIntegrityLevel; url: sec-setintegritylevel
79-
text: Call; url: sec-call
80-
text: Get; url: sec-get-o-p
81-
text: DefinePropertyOrThrow; url: sec-definepropertyorthrow
40+
text: Type; url: sec-ecmascript-data-types-and-values
8241
text: current Realm; url: current-realm
83-
text: ObjectCreate; url: sec-objectcreate
84-
text: CreateBuiltinFunction; url: sec-createbuiltinfunction
85-
text: SetFunctionName; url: sec-setfunctionname
86-
text: SetFunctionLength; url: sec-setfunctionlength
87-
text: the Number value; url: sec-ecmascript-language-types-number-type
88-
text: NumberToRawBytes; url: sec-numbertorawbytes
8942
text: Built-in Function Objects; url: sec-built-in-function-objects
9043
text: NativeError Object Structure; url: sec-nativeerror-object-structure
91-
text: CreateArrayFromList; url: sec-createarrayfromlist
92-
text: GetMethod; url: sec-getmethod
93-
text: IterableToList; url: sec-iterabletolist
94-
text: ToBigInt64; url: #sec-tobigint64
95-
text: BigInt; url: #sec-ecmascript-language-types-bigint-type
9644
text: 𝔽; url: #𝔽
9745
text: ℤ; url: #ℤ
98-
type: abstract-op
99-
text: CreateMethodProperty; url: sec-createmethodproperty
10046
urlPrefix: https://webassembly.github.io/spec/core/; spec: WebAssembly; type: dfn
10147
url: valid/modules.html#valid-module
10248
text: valid
@@ -367,11 +313,11 @@ A {{Module}} object represents a single WebAssembly module. Each {{Module}} obje
367313
1. If |module|.[=imports=] [=list/is empty|is not empty=], and |importObject| is undefined, throw a {{TypeError}} exception.
368314
1. Let |imports| be « ».
369315
1. [=list/iterate|For each=] (|moduleName|, |componentName|, |externtype|) of [=module_imports=](|module|),
370-
1. Let |o| be [=?=] [=Get=](|importObject|, |moduleName|).
316+
1. Let |o| be [=?=] [$Get$](|importObject|, |moduleName|).
371317
1. If [=Type=](|o|) is not Object, throw a {{TypeError}} exception.
372-
1. Let |v| be [=?=] [=Get=](|o|, |componentName|).
318+
1. Let |v| be [=?=] [$Get$](|o|, |componentName|).
373319
1. If |externtype| is of the form [=func=] |functype|,
374-
1. If [=IsCallable=](|v|) is false, throw a {{LinkError}} exception.
320+
1. If [$IsCallable$](|v|) is false, throw a {{LinkError}} exception.
375321
1. If |v| has a \[[FunctionAddress]] internal slot, and therefore is an [=Exported Function=],
376322
1. Let |funcaddr| be the value of |v|'s \[[FunctionAddress]] internal slot.
377323
1. Otherwise,
@@ -415,7 +361,7 @@ The verification of WebAssembly type requirements is deferred to the
415361

416362
<div algorithm>
417363
To <dfn>create an exports object</dfn> from a WebAssembly module |module| and instance |instance|, perform the following steps:
418-
1. Let |exportsObject| be [=!=] [=ObjectCreate=](null).
364+
1. Let |exportsObject| be [=!=] [$OrdinaryObjectCreate$](null).
419365
1. [=list/iterate|For each=] (|name|, |externtype|) of [=module_exports=](|module|),
420366
1. Let |externval| be [=instance_export=](|instance|, |name|).
421367
1. Assert: |externval| is not [=error=].
@@ -439,11 +385,11 @@ The verification of WebAssembly type requirements is deferred to the
439385
1. Let [=external value|table=] |tableaddr| be |externval|.
440386
1. Let |table| be [=create a Table object|a new Table object=] created from |tableaddr|.
441387
1. Let |value| be |table|.
442-
1. Let |status| be [=!=] [=CreateDataProperty=](|exportsObject|, |name|, |value|).
388+
1. Let |status| be [=!=] [$CreateDataProperty$](|exportsObject|, |name|, |value|).
443389
1. Assert: |status| is true.
444390

445391
Note: the validity and uniqueness checks performed during [=WebAssembly module validation=] ensure that each property name is valid and no properties are defined twice.
446-
1. Perform [=!=] [=SetIntegrityLevel=](|exportsObject|, `"frozen"`).
392+
1. Perform [=!=] [$SetIntegrityLevel$](|exportsObject|, `"frozen"`).
447393
1. Return |exportsObject|.
448394
</div>
449395

@@ -706,7 +652,7 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each
706652
1. Let |map| be the [=surrounding agent=]'s associated [=Memory object cache=].
707653
1. Assert: |map|[|memaddr|] [=map/exists=].
708654
1. Let |memory| be |map|[|memaddr|].
709-
1. Perform [=!=] [=DetachArrayBuffer=](|memory|.\[[BufferObject]], "WebAssembly.Memory").
655+
1. Perform [=!=] [$DetachArrayBuffer$](|memory|.\[[BufferObject]], "WebAssembly.Memory").
710656
1. Let |buffer| be the result of [=create a memory buffer|creating a memory buffer=] from |memaddr|.
711657
1. Set |memory|.\[[BufferObject]] to |buffer|.
712658
</div>
@@ -990,13 +936,13 @@ This slot holds a [=function address=] relative to the [=surrounding agent=]'s [
990936
1. Let |store| be the [=surrounding agent=]'s [=associated store=].
991937
1. Let |funcinst| be |store|.funcs[|funcaddr|].
992938
1. If |funcinst| is of the form {type <var ignore>functype</var>, hostcode |hostfunc|},
993-
1. Assert: |hostfunc| is a JavaScript object and [=IsCallable=](|hostfunc|) is true.
939+
1. Assert: |hostfunc| is a JavaScript object and [$IsCallable$](|hostfunc|) is true.
994940
1. Let |index| be the [=index of the host function=] |funcaddr|.
995941
1. Otherwise,
996942
1. Let |moduleinst| be |funcinst|.module.
997943
1. Assert: |funcaddr| is contained in |moduleinst|.funcaddrs.
998944
1. Let |index| be the index of |moduleinst|.funcaddrs where |funcaddr| is found.
999-
1. Return [=!=] [=ToString=](|index|).
945+
1. Return [=!=] [$ToString$](|index|).
1000946
</div>
1001947

1002948
<div algorithm>
@@ -1012,7 +958,7 @@ This slot holds a [=function address=] relative to the [=surrounding agent=]'s [
1012958
1. Let [|paramTypes|][<var ignore>resultTypes</var>] be |functype|.
1013959
1. Let |arity| be |paramTypes|'s [=list/size=].
1014960
1. Let |name| be the [=name of the WebAssembly function=] |funcaddr|.
1015-
1. Let |function| be [=!=] [=CreateBuiltinFunction=](|steps|, |arity|, |name|, « \[[FunctionAddress]] », |realm|).
961+
1. Let |function| be [=!=] [$CreateBuiltinFunction$](|steps|, |arity|, |name|, « \[[FunctionAddress]] », |realm|).
1016962
1. Set |function|.\[[FunctionAddress]] to |funcaddr|.
1017963
1. [=map/Set=] |map|[|funcaddr|] to |function|.
1018964
1. Return |function|.
@@ -1044,7 +990,7 @@ This slot holds a [=function address=] relative to the [=surrounding agent=]'s [
1044990
1. Let |values| be « ».
1045991
1. [=list/iterate|For each=] |r| of |ret|,
1046992
1. [=list/Append=] [=ToJSValue=](|r|) to |values|.
1047-
1. Return [=CreateArrayFromList=](|values|).
993+
1. Return [$CreateArrayFromList$](|values|).
1048994
</div>
1049995

1050996
Note: [=call an Exported Function|Calling an Exported Function=] executes in the \[[Realm]] of the callee Exported Function, as per the definition of [=built-in function objects=].
@@ -1059,14 +1005,14 @@ Note: Exported Functions do not have a \[[Construct]] method and thus it is not
10591005
1. Let |jsArguments| be « ».
10601006
1. [=list/iterate|For each=] |arg| of |arguments|,
10611007
1. [=list/Append=] [=!=] [=ToJSValue=](|arg|) to |jsArguments|.
1062-
1. Let |ret| be [=?=] [=Call=](|func|, undefined, |jsArguments|).
1008+
1. Let |ret| be [=?=] [$Call$](|func|, undefined, |jsArguments|).
10631009
1. Let |resultsSize| be |results|'s [=list/size=].
10641010
1. If |resultsSize| is 0, return « ».
10651011
1. Otherwise, if |resultsSize| is 1, return « [=?=] [=ToWebAssemblyValue=](|ret|, |results|[0]) ».
10661012
1. Otherwise,
1067-
1. Let |method| be [=?=] [=GetMethod=](|ret|, [=@@iterator=]).
1013+
1. Let |method| be [=?=] [$GetMethod$](|ret|, {{@@iterator}}).
10681014
1. If |method| is undefined, [=throw=] a {{TypeError}}.
1069-
1. Let |values| be [=?=] [=IterableToList=](|ret|, |method|).
1015+
1. Let |values| be [=?=] [$IterableToList$](|ret|, |method|).
10701016
1. Let |wasmValues| be a new, empty [=list=].
10711017
1. If |values|'s [=list/size=] is not |resultsSize|, throw a {{TypeError}} exception.
10721018
1. For each |value| and |resultType| in |values| and |results|, paired linearly,
@@ -1077,11 +1023,11 @@ Note: Exported Functions do not have a \[[Construct]] method and thus it is not
10771023
<div algorithm>
10781024
To <dfn>create a host function</dfn> from the JavaScript object |func| and type |functype|, perform the following steps:
10791025

1080-
1. Assert: [=IsCallable=](|func|).
1026+
1. Assert: [$IsCallable$](|func|).
10811027
1. Let |stored settings| be the <a spec=HTML>incumbent settings object</a>.
10821028
1. Let |hostfunc| be a [=host function=] which performs the following steps when called with arguments |arguments|:
10831029
1. Let |realm| be |func|'s [=associated Realm=].
1084-
1. Let |relevant settings| be |realm|'s [=Realm/settings object=].
1030+
1. Let |relevant settings| be |realm|'s [=realm/settings object=].
10851031
1. [=Prepare to run script=] with |relevant settings|.
10861032
1. [=Prepare to run a callback=] with |stored settings|.
10871033
1. Let |result| be the result of [=run a host function|running a host function=] from |func|, |functype|, and |arguments|.
@@ -1116,7 +1062,7 @@ The algorithm <dfn>ToJSValue</dfn>(|w|) coerces a [=WebAssembly value=] to a Jav
11161062
1. If |w| is of the form [=ref.func=] |funcaddr|, return the result of creating [=a new Exported Function=] from |funcaddr|.
11171063
1. If |w| is of the form [=ref.extern=] |externaddr|, return the result of [=retrieving an extern value=] from |externaddr|.
11181064

1119-
Note: Number values which are equal to NaN may have various observable NaN payloads; see [=NumberToRawBytes=] for details.
1065+
Note: Number values which are equal to NaN may have various observable NaN payloads; see [$NumericToRawBytes$] for details.
11201066
</div>
11211067

11221068
<div algorithm>
@@ -1134,21 +1080,21 @@ The algorithm <dfn>ToWebAssemblyValue</dfn>(|v|, |type|) coerces a JavaScript va
11341080

11351081
1. Assert: |type| is not [=v128=].
11361082
1. If |type| is [=i64=],
1137-
1. Let |i64| be [=?=] [=ToBigInt64=](|v|).
1083+
1. Let |i64| be [=?=] [$ToBigInt64$](|v|).
11381084
1. Return [=i64.const=] |i64|.
11391085
1. If |type| is [=i32=],
1140-
1. Let |i32| be [=?=] [=ToInt32=](|v|).
1086+
1. Let |i32| be [=?=] [$ToInt32$](|v|).
11411087
1. Return [=i32.const=] |i32|.
11421088
1. If |type| is [=f32=],
1143-
1. Let |number| be [=?=] [=ToNumber=](|v|).
1089+
1. Let |number| be [=?=] [$ToNumber$](|v|).
11441090
1. If |number| is **NaN**,
11451091
1. Let |n| be an implementation-defined integer such that [=canon=]<sub>32</sub> ≤ |n| < 2<sup>[=signif=](32)</sup>.
11461092
1. Let |f32| be [=nan=](n).
11471093
1. Otherwise,
11481094
1. Let |f32| be |number| rounded to the nearest representable value using IEEE 754-2008 round to nearest, ties to even mode. [[IEEE-754]]
11491095
1. Return [=f32.const=] |f32|.
11501096
1. If |type| is [=f64=],
1151-
1. Let |number| be [=?=] [=ToNumber=](|v|).
1097+
1. Let |number| be [=?=] [$ToNumber$](|v|).
11521098
1. If |number| is **NaN**,
11531099
1. Let |n| be an implementation-defined integer such that [=canon=]<sub>64</sub> ≤ |n| < 2<sup>[=signif=](64)</sup>.
11541100
1. Let |f64| be [=nan=](n).

0 commit comments

Comments
 (0)