Skip to content

Commit

Permalink
Editorial: avoid changing internal methods of ordinary objects
Browse files Browse the repository at this point in the history
This is a follow-up to #871.

Changing the [[SetPrototypeOf]] method of the result of OrdinaryObjectCreate goes against the intention of separating OrdinaryObjectCreate and MakeBasicObject, so this fixes that.
  • Loading branch information
ExE-Boss committed Jul 7, 2020
1 parent 79bd7e0 commit 318315c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -11288,7 +11288,17 @@ with the [{{LegacyNoInterfaceObject}}] [=extended attribute=].
then set |proto| to |realm|.\[[Intrinsics]].[[{{%Error.prototype%}}]].
1. Otherwise, set |proto| to |realm|.\[[Intrinsics]].[[{{%Object.prototype%}}]].
1. Assert: <a abstract-op>Type</a>(|proto|) is Object.
1. Let |interfaceProtoObj| be [=!=] [$OrdinaryObjectCreate$](|proto|).
1. Let |interfaceProtoObj| be null.
1. If |interface| is declared with the [{{Global}}] [=extended attribute=], or
|interface| is in the set of [=inherited interfaces=] of an interface
that is declared with the [{{Global}}] [=extended attribute=], then:
1. Set |interfaceProtoObj| to [=!=] [$MakeBasicObject$](« \[[Prototype]], \[[Extensible]] »).
1. Set |interfaceProtoObj|.\[[Prototype]] to |proto|.
1. Set the internal methods of |interfaceProtoObj|
which are specific to [=immutable prototype exotic objects=]
to the definitions specified in
[=ECMA-262 Immutable prototype exotic objects=].
1. Otherwise, set |interfaceProtoObj| to [=!=] [$OrdinaryObjectCreate$](|proto|).
1. If |interface| has any [=member=] declared with the [{{Unscopable}}] [=extended attribute=],
then:

Expand All @@ -11305,13 +11315,6 @@ with the [{{LegacyNoInterfaceObject}}] [=extended attribute=].
\[[Writable]]: <emu-val>false</emu-val>, \[[Enumerable]]: <emu-val>false</emu-val>,
\[[Configurable]]: <emu-val>true</emu-val>}.
1. Perform [=!=] <a abstract-op>DefinePropertyOrThrow</a>(|interfaceProtoObj|, {{@@unscopables}}, |desc|).
1. If |interface| is declared with the [{{Global}}] [=extended attribute=], or
|interface| is in the set of [=inherited interfaces=] of an interface
that is declared with the [{{Global}}] [=extended attribute=], then:
1. Set the internal methods of |interfaceProtoObj|
which are specific to [=immutable prototype exotic objects=]
to the definitions specified in
[=ECMA-262 Immutable prototype exotic objects=].
1. If |interface| is not declared with the [{{Global}}] [=extended attribute=], then:
1. [=Define the regular attributes=] of |interface| on |interfaceProtoObj| given |realm|.
1. [=Define the regular operations=] of |interface| on |interfaceProtoObj| given |realm|.
Expand Down

0 comments on commit 318315c

Please sign in to comment.