Skip to content

Commit

Permalink
Remove custom [[HasInstance]] behaviors
Browse files Browse the repository at this point in the history
This was only ever implemented in Firefox for most platform interface objects. It was added in 5982ce7. after being removed as a result of https://www.w3.org/Bugs/Public/show_bug.cgi?id=12295.

The behavior for callback interface objects was never implemented anywhere.

Closes #129.
  • Loading branch information
domenic committed May 4, 2017
1 parent c59bdcb commit d0899e9
Showing 1 changed file with 2 additions and 35 deletions.
37 changes: 2 additions & 35 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMA-262
text: 9.3.1; url: sec-built-in-function-objects-call-thisargument-argumentslist
text: ECMA-262 section 9.1.8; url: sec-ordinary-object-internal-methods-and-internal-slots-get-p-receiver
text: ECMA-262 section 19.2.2.3; url: sec-function-@@create
text: ECMA-262 section 19.2.3.8; url: sec-function.prototype-@@hasinstance
text: Array methods; url: sec-properties-of-the-array-prototype-object
text: typed arrays; url: sec-typedarray-objects
text: GetMethod; url: sec-getmethod
Expand Down Expand Up @@ -6389,9 +6388,8 @@ more of the following are redefined in accordance with the rules for exotic obje
\[[Call]],
\[[Set]],
\[[DefineOwnProperty]],
\[[GetOwnProperty]],
\[[Delete]] and
\[[HasInstance]].
\[[GetOwnProperty]], and
\[[Delete]].

Other specifications may override the definitions
of any internal method of a [=platform object=]
Expand Down Expand Up @@ -6431,7 +6429,6 @@ it has characteristics as follows:
[=%FunctionPrototype%=] unless otherwise specified.
* Its \[[Get]] internal property is set as described in [=ECMA-262 section 9.1.8=].
* Its \[[Construct]] internal property is set as described in [=ECMA-262 section 19.2.2.3=].
* Its @@hasInstance property is set as described in [=ECMA-262 section 19.2.3.8=], unless otherwise specified.

<p class="issue">
The list above needs updating for the latest ES6 draft.
Expand Down Expand Up @@ -10149,26 +10146,6 @@ the <code>typeof</code> operator will return "function" when applied to an inter
PropertyDescriptor{\[[Value]]: |proto|, \[[Writable]]: <emu-val>false</emu-val>, \[[Enumerable]]: <emu-val>false</emu-val>, \[[Configurable]]: <emu-val>false</emu-val>}).
</div>

<h5 id="es-interface-hasinstance">\[[HasInstance]]</h5>

<div algorithm="to invoke the internal [[HasInstance]] method of interface objects">

The internal \[[HasInstance]] method of every [=interface object=] |A|
must behave as follows, assuming |V| is the object argument passed to \[[HasInstance]]:

1. If Type(|V|) is not Object, return <emu-val>false</emu-val>.
1. Let |O| be [=?=] [=Get=](|A|, "prototype").
1. If Type(|O|) is not Object, [=ECMAScript/throw=] a <emu-val>TypeError</emu-val> exception.
1. If |V| is a [=platform object=] that implements the interface
for which |O| is the [=interface prototype object=],
return <emu-val>true</emu-val>.
1. Repeat:
1. Set |V| to the value of the \[[Prototype]] internal property of |V|.
1. If |V| is <emu-val>null</emu-val>, return <emu-val>false</emu-val>.
1. If |O| and |V| refer to the same object,
return <emu-val>true</emu-val>.
</div>


<h4 id="named-constructors">Named constructors</h4>

Expand Down Expand Up @@ -10360,16 +10337,6 @@ when applied to a [=legacy callback interface object=].
PropertyDescriptor{\[[Value]]: 0, \[[Writable]]: <emu-val>false</emu-val>, \[[Enumerable]]: <emu-val>false</emu-val>, \[[Configurable]]: <emu-val>true</emu-val>}).
</div>

<h5 id="es-legacy-callback-interface-object-hasinstance">\[[HasInstance]]</h5>

<div algorithm="to invoke the internal [[HasInstance]] method of legacy callback interface objects">

The internal \[[HasInstance]] method of a [=legacy callback interface object=]
must behave as follows:

1. [=ECMAScript/Throw=] a <emu-val>TypeError</emu-val> exception.
</div>


<h4 id="named-properties-object">Named properties object</h4>

Expand Down

0 comments on commit d0899e9

Please sign in to comment.