Skip to content

Remove custom [[HasInstance]] behavior from interface objects #356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 2 additions & 35 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,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 @@ -6384,9 +6383,8 @@ more of the following are redefined in accordance with the rules for exotic obje
\[[Call]],
\[[Set]],
\[[DefineOwnProperty]],
\[[GetOwnProperty]],
\[[Delete]] and
\[[HasInstance]].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're still modifying [[HasInstance]] for legacy callback interfaces, so you might want to keep it listed here.

\[[GetOwnProperty]], and
\[[Delete]].

Other specifications may override the definitions
of any internal method of a [=platform object=]
Expand Down Expand Up @@ -6426,7 +6424,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 @@ -10096,26 +10093,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 @@ -10307,16 +10284,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