Skip to content

Commit

Permalink
Editorial: replace CreateMethodProperty with DefineMethodProperty
Browse files Browse the repository at this point in the history
Aligns with JavaScript which no longer defines CreateMethodProperty.

Fixes #1389.
  • Loading branch information
ljharb committed Mar 11, 2024
1 parent 400ce04 commit 5a2802b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -12328,8 +12328,8 @@ then there must exist a property with the following characteristics:
of [=interface=] |definition| on |target|, given [=realm=] |realm|, run the following steps:

1. If |definition| has an [=indexed property getter=], then:
1. Perform [$CreateMethodProperty$](|target|, {{@@iterator}},
{{%Array.prototype.values%}}).
1. Perform [$DefineMethodProperty$](|target|, {{@@iterator}},
{{%Array.prototype.values%}}, false).
1. If |definition| has a [=value iterator=], then:
1. Perform [=!=] [$CreateDataPropertyOrThrow$](|target|, "<code>entries</code>",
{{%Array.prototype.entries%}}).
Expand All @@ -12354,7 +12354,7 @@ then there must exist a property with the following characteristics:
1. Let |F| be [$CreateBuiltinFunction$](|steps|, « », |realm|).
1. Perform [$SetFunctionName$](|F|, "<code>entries</code>").
1. Perform [$SetFunctionLength$](|F|, 0).
1. Perform [$CreateMethodProperty$](|target|, {{@@iterator}}, |F|).
1. Perform [$DefineMethodProperty$](|target|, {{@@iterator}}, |F|, false).
1. Perform [=!=] [$CreateDataPropertyOrThrow$](|target|, "<code>entries</code>", |F|).
1. Define the <code class="idl">keys</code> method:
1. Let |steps| be the following series of steps:
Expand Down Expand Up @@ -12546,7 +12546,7 @@ and the string "<code> Iterator</code>".
1. Let |F| be [$CreateBuiltinFunction$](|steps|, « », |realm|).
1. Perform [$SetFunctionName$](|F|, "<code>entries</code>").
1. Perform [$SetFunctionLength$](|F|, 0).
1. Perform [$CreateMethodProperty$](|target|, {{@@asyncIterator}}, |F|).
1. Perform [$DefineMethodProperty$](|target|, {{@@asyncIterator}}, |F|, false).
1. Perform [=!=] [$CreateDataPropertyOrThrow$](|target|, "<code>entries</code>", |F|).
1. If |definition| has a [=pair asynchronously iterable declaration=], then define the
<code class="idl">keys</code> method:
Expand Down Expand Up @@ -12596,7 +12596,7 @@ and the string "<code> Iterator</code>".
1. Perform [$SetFunctionLength$](|F|, 0).
1. Perform [=!=] [$CreateDataPropertyOrThrow$](|target|, "<code>values</code>", |F|).
1. If |definition| has a [=value asynchronously iterable declaration=], then perform [=!=]
[$CreateMethodProperty$](|target|, {{@@asyncIterator}}, |F|).
[$DefineMethodProperty$](|target|, {{@@asyncIterator}}, |F|, false).
</div>

<div algorithm>
Expand Down Expand Up @@ -13508,31 +13508,31 @@ the realm given as an argument.
1. Let |id| be |interface|'s [=identifier=].
1. Let |interfaceObject| be the result of [=create an interface object|creating
an interface object=] for |interface| with |id| in |realm|.
1. Perform [$CreateMethodProperty$](|target|, |id|, |interfaceObject|).
1. Perform [$DefineMethodProperty$](|target|, |id|, |interfaceObject|, false).
1. If the |interface| is declared with a [{{LegacyWindowAlias}}] [=extended attribute=],
and |target| implements the {{Window}} [=interface=], then:
1. [=list/iterate|For every=] [=LegacyWindowAlias identifier|identifier=] |id| in
[{{LegacyWindowAlias}}]'s [=LegacyWindowAlias identifier|identifiers=]:
1. Perform [$CreateMethodProperty$](|target|, |id|, |interfaceObject|).
1. Perform [$DefineMethodProperty$](|target|, |id|, |interfaceObject|, false).
1. If the |interface| is declared with a [{{LegacyFactoryFunction}}] [=extended attribute=],
then:
1. [=list/iterate|For every=] [=LegacyFactoryFunction identifier|identifier=] |id| in
[{{LegacyFactoryFunction}}]'s [=LegacyFactoryFunction identifier|identifiers=]:
1. Let |legacyFactoryFunction| be the result of
[=create a legacy factory function|creating a legacy factory function=] with
|id| for |interface| in |realm|.
1. Perform [$CreateMethodProperty$](|target|, |id|, |legacyFactoryFunction|).
1. Perform [$DefineMethodProperty$](|target|, |id|, |legacyFactoryFunction|, false).
1. [=list/iterate|For every=] [=callback interface=] |interface| that is [=exposed=] in
|realm| and on which [=constants=] are defined:
1. Let |id| be |interface|'s [=identifier=].
1. Let |interfaceObject| be the result of [=create a legacy callback interface
object|creating a legacy callback interface object=] for |interface| with |id| in |realm|.
1. Perform [$CreateMethodProperty$](|target|, |id|, |interfaceObject|).
1. Perform [$DefineMethodProperty$](|target|, |id|, |interfaceObject|, false).
1. [=list/iterate|For every=] [=namespace=] |namespace| that is [=exposed=] in
|realm|:
1. Let |id| be |namespace|'s [=identifier=].
1. Let |namespaceObject| be the result of [=create a namespace object|creating a namespace object=] for |namespace| in |realm|.
1. Perform [$CreateMethodProperty$](|target|, |id|, |namespaceObject|).
1. Perform [$DefineMethodProperty$](|target|, |id|, |namespaceObject|, false).
</div>

<div class="note">
Expand Down Expand Up @@ -14443,7 +14443,7 @@ The characteristics of a namespace object are described in [[#namespace-object]]
1. Let |id| be |interface|'s [=identifier=].
1. Let |interfaceObject| be the result of [=create an interface object|creating an
interface object=] for |interface| with |id| in |realm|.
1. Perform [$CreateMethodProperty$](|namespaceObject|, |id|, |interfaceObject|).
1. Perform [$DefineMethodProperty$](|namespaceObject|, |id|, |interfaceObject|, false).
1. Return |namespaceObject|.
</div>

Expand Down

0 comments on commit 5a2802b

Please sign in to comment.