Skip to content

Commit 77f5556

Browse files
committed
refactor: Use MakeBasicObject
1 parent d5f9651 commit 77f5556

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

index.bs

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,11 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMA-262
152152
text: IsSharedArrayBuffer; url: sec-issharedarraybuffer
153153
text: IteratorStep; url: sec-iteratorstep
154154
text: IteratorValue; url: sec-iteratorvalue
155+
text: MakeBasicObject; url: sec-makebasicobject
155156
text: NewModuleEnvironment; url: sec-newmoduleenvironment
156157
text: NewPromiseCapability; url: sec-newpromisecapability
157158
text: NormalCompletion; url: sec-normalcompletion
158-
text: ObjectCreate; url: sec-objectcreate
159+
text: OrdinaryObjectCreate; url: sec-ordinaryobjectcreate
159160
text: OrdinaryDefineOwnProperty; url: sec-ordinarydefineownproperty
160161
text: OrdinaryGetOwnProperty; url: sec-ordinarygetownproperty
161162
text: OrdinaryPreventExtensions; url: sec-ordinarypreventextensions
@@ -7933,7 +7934,7 @@ up on the ECMAScript object are not necessarily the same as the object’s prope
79337934
to an ECMAScript Object value by
79347935
running the following algorithm (where |D| is the [=dictionary=]):
79357936

7936-
1. Let |O| be [=!=] <a abstract-op>ObjectCreate</a>({{%ObjectPrototype%}}).
7937+
1. Let |O| be [=!=] [$OrdinaryObjectCreate$]({{%ObjectPrototype%}}).
79377938
1. Let |dictionaries| be a list consisting of |D| and all of |D|’s [=inherited dictionaries=],
79387939
in order from least to most derived.
79397940
1. For each dictionary |dictionary| in |dictionaries|, in order:
@@ -8227,7 +8228,7 @@ ECMAScript Object values.
82278228
[=converted to an ECMAScript value|converted=]
82288229
to an ECMAScript value as follows:
82298230

8230-
1. Let |result| be [=!=] <a abstract-op>ObjectCreate</a>({{%ObjectPrototype%}}).
8231+
1. Let |result| be [=!=] [$OrdinaryObjectCreate$]({{%ObjectPrototype%}}).
82318232
1. [=map/For each=] |key| → |value| of |D|:
82328233
1. Let |esKey| be |key| [=converted to an ECMAScript value=].
82338234
1. Let |esValue| be |value| [=converted to an ECMAScript value=].
@@ -11347,7 +11348,7 @@ default interfaces do not have such steps.
1134711348
then set |constructorProto| to the [=interface object=] of |P| in |realm|.
1134811349
1. Let |F| be [=!=] <a abstract-op>CreateBuiltinFunction</a>(|steps|, « \[[Unforgeables]] »,
1134911350
|realm|, |constructorProto|).
11350-
1. Let |unforgeables| be [$ObjectCreate$](<emu-val>null</emu-val>).
11351+
1. Let |unforgeables| be [=!=] [$OrdinaryObjectCreate$](<emu-val>null</emu-val>).
1135111352
1. [=Define the unforgeable regular operations=] of |I| on |unforgeables|, given |realm|.
1135211353
1. [=Define the unforgeable regular attributes=] of |I| on |unforgeables|, given |realm|.
1135311354
1. Set |F|.\[[Unforgeables]] to |unforgeables|.
@@ -11447,15 +11448,14 @@ with the [{{NoInterfaceObject}}] [=extended attribute=].
1144711448
then set |proto| to |realm|.\[[Intrinsics]].[[{{%ErrorPrototype%}}]].
1144811449
1. Otherwise, set |proto| to |realm|.\[[Intrinsics]].[[{{%ObjectPrototype%}}]].
1144911450
1. Assert: <a abstract-op>Type</a>(|proto|) is Object.
11450-
1. Let |interfaceProtoObj| be [=!=] <a abstract-op>ObjectCreate</a>(|proto|).
11451+
1. Let |interfaceProtoObj| be [=!=] [$OrdinaryObjectCreate$](|proto|).
1145111452
1. If |interface| has any [=member=] declared with the [{{Unscopable}}] [=extended attribute=],
1145211453
then:
1145311454

1145411455
Issue: Should an {{@@unscopables}} property also be defined if |interface| is
1145511456
declared with the [{{Global}}] [=extended attribute=]?
1145611457
This is discussed in <a href="https://github.com/heycam/webidl/issues/544">issue #544</a>.
11457-
1. Let |unscopableObject| be the result of performing [=!=]
11458-
<a abstract-op>ObjectCreate</a>(<emu-val>null</emu-val>).
11458+
1. Let |unscopableObject| be [=!=] [$OrdinaryObjectCreate$](<emu-val>null</emu-val>).
1145911459
1. [=list/For each=] [=exposed=] [=member=] |member| of |interface|
1146011460
that is declared with the [{{Unscopable}}] [=extended attribute=]:
1146111461
1. Let |id| be |member|'s [=identifier=].
@@ -11547,13 +11547,13 @@ for that interface on which named properties are exposed.
1154711547
1. If |interface| is declared to inherit from another interface,
1154811548
then set |proto| to the [=interface prototype object=] in |realm| for the [=inherited interface=].
1154911549
1. Otherwise, set |proto| to |realm|.\[[Intrinsics]].[[{{%ObjectPrototype%}}]].
11550-
1. Let |obj| be a newly created object.
11551-
1. Set |obj|'s internal methods to the definitions specified in
11552-
[=ECMA-262 Ordinary object internal methods and internal slots=],
11553-
unless they are specified in the the rest of [[#named-properties-object]].
11554-
1. Set |obj|'s remaining internal methods to the definitions specified below.
11550+
1. Let |obj| be [=!=] [$MakeBasicObject$](« [[Prototype]], [[Extensible]] »).
11551+
1. Set |obj|.\[[GetOwnProperty]] as specified in [[#named-properties-object-getownproperty]].
11552+
1. Set |obj|.\[[DefineOwnProperty]] as specified in [[#named-properties-object-defineownproperty]].
11553+
1. Set |obj|.\[[Delete]] as specified in [[#named-properties-object-delete]].
11554+
1. Set |obj|.\[[SetPrototypeOf]] as specified in [[#named-properties-object-setprototypeof]].
11555+
1. Set |obj|.\[[PreventExtensions]] as specified in [[#named-properties-object-preventextensions]].
1155511556
1. Set |obj|.\[[Prototype]] to |proto|.
11556-
1. Set |obj|.\[[Extensible]] to <emu-val>true</emu-val>.
1155711557
1. Return |obj|.
1155811558
</div>
1155911559

@@ -12006,7 +12006,7 @@ The [=return type=] of the [=default toJSON operation=] must be {{object}}.
1200612006
for [=interface=] |I|.
1200712007
1. Invoke [=collect attribute values of an inheritance stack=] on <b>this</b>,
1200812008
passing it |stack| and |map| as arguments.
12009-
1. Let |result| be [=!=] <a abstract-op>ObjectCreate</a>({{%ObjectPrototype%}}).
12009+
1. Let |result| be [=!=] [$OrdinaryObjectCreate$]({{%ObjectPrototype%}}).
1201012010
1. [=map/For each=] |key| → |value| of |map|,
1201112011
1. Let |k| be |key| [=converted to an ECMAScript value=].
1201212012
1. Let |v| be |value| [=converted to an ECMAScript value=].
@@ -13194,13 +13194,11 @@ the Realm given as an argument.
1319413194
1. Set |prototype| to the [=interface prototype object=] for |interface| in
1319513195
|targetRealm|.
1319613196
1. Let |slots| be « \[[Realm]], \[[PrimaryInterface]] ».
13197-
1. Let |instance| be a newly created [=ECMAScript/object=] in |realm|
13198-
with an internal slot for each name in |slots|.
13197+
1. Let |instance| be [=!=] [$MakeBasicObject$](
13198+
« \[[Prototype]], \[[Extensible]], \[[Realm]], \[[PrimaryInterface]] »).
1319913199
1. Set |instance|.\[[Realm]] to |realm|.
1320013200
1. Set |instance|.\[[PrimaryInterface]] to |interface|.
1320113201
1. Set |instance|.\[[Prototype]] to |prototype|.
13202-
1. Set |instance|'s essential internal methods to the definitions specified in
13203-
[=ECMA-262 Ordinary object internal methods and internal slots=].
1320413202
1. Let |interfaces| be the [=inclusive inherited interfaces=] of |interface|.
1320513203
1. [=list/iterate|For every=] [=interface=] |ancestor interface| in |interfaces|:
1320613204
1. Let |unforgeables| be the value of the \[[Unforgeables]] slot of the [=interface
@@ -13716,7 +13714,8 @@ those of normal <code>Array</code> instances:
1371613714
in a [=Realm=] |realm|, given Web IDL type |T| and algorithms |setAlgorithm| and |deleteAlgorithm|:
1371713715

1371813716
1. Let |innerArray| be [=!=] [$ArrayCreate$](0).
13719-
1. Let |handler| be [$ObjectCreate$](<emu-val>null</emu-val>, « \[[Type]], \[[SetAlgorithm]], \[[DeleteAlgorithm]], \[[BackingList]] »).
13717+
1. Let |handler| be [=!=] [$OrdinaryObjectCreate$](<emu-val>null</emu-val>,
13718+
« \[[Type]], \[[SetAlgorithm]], \[[DeleteAlgorithm]], \[[BackingList]] »).
1372013719
1. Set |handler|.\[[Type]] to |T|.
1372113720
1. Set |handler|.\[[SetAlgorithm]] to |setAlgorithm|.
1372213721
1. Set |handler|.\[[DeleteAlgorithm]] to |deleteAlgorithm|.
@@ -14171,8 +14170,7 @@ The characteristics of a namespace object are described in [[#namespace-object]]
1417114170
The namespace object for a given [=namespace=] |namespace| and [=Realm=] |realm|
1417214171
is <dfn lt="create a namespace object">created</dfn> as follows:
1417314172

14174-
1. Let |namespaceObject| be
14175-
[=!=] <a abstract-op>ObjectCreate</a>(|realm|.\[[Intrinsics]].[[{{%ObjectPrototype%}}]]).
14173+
1. Let |namespaceObject| be [=!=] [$OrdinaryObjectCreate$](|realm|.\[[Intrinsics]].[[{{%ObjectPrototype%}}]]).
1417614174
1. [=Define the regular attributes=] of |namespace| on |namespaceObject| given |realm|.
1417714175
1. [=Define the regular operations=] of |namespace| on |namespaceObject| given |realm|.
1417814176
1. For each [=exposed=] [=interface=] |interface| which has the [{{LegacyNamespace}}] extended

0 commit comments

Comments
 (0)