handle @@hasInstance correctly for proxies

RESOLVED FIXED in Firefox 50

Status

()

Core
JavaScript Engine
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: mrrrgn, Assigned: evilpie)

Tracking

unspecified
mozilla50
Points:
---

Firefox Tracking Flags

(firefox50 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

2 years ago
// InstanceofOperator -> GetMethod -> GetV -> [[Get]]
// InstanceofOperator -> OrdinaryHasInstance -> Get -> [[Get]]
var get = [];
var p = new Proxy(Function(), { get: function(o, k) { get.push(k); return o[k]; }});
({}) instanceof p;
return get[0] === Symbol.hasInstance && get.slice(1) + '' === "prototype";
(Assignee)

Updated

2 years ago
Assignee: nobody → evilpies
(Assignee)

Comment 1

2 years ago
Created attachment 8761969 [details] [diff] [review]
Handle hasInstance in scripted proxies

This just forwards the hasInstance trap to the InstanceOfOperator, this basically makes the indirection through the hasInstance trap invisible.
Attachment #8761969 - Flags: review?(winter2718)
(Reporter)

Comment 2

2 years ago
Comment on attachment 8761969 [details] [diff] [review]
Handle hasInstance in scripted proxies

Oh, it looks like the patch is truncated. Could you attach it again?
(Assignee)

Comment 3

2 years ago
Created attachment 8762128 [details] [diff] [review]
v2 - Handle hasInstance in scripted proxies

Fail ..
Attachment #8761969 - Attachment is obsolete: true
Attachment #8761969 - Flags: review?(winter2718)
Attachment #8762128 - Flags: review?(winter2718)
(Reporter)

Comment 4

2 years ago
Comment on attachment 8762128 [details] [diff] [review]
v2 - Handle hasInstance in scripted proxies

Review of attachment 8762128 [details] [diff] [review]:
-----------------------------------------------------------------

Nice!
Attachment #8762128 - Flags: review?(winter2718) → review+

Comment 5

2 years ago
Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/130240034c37
Handle @@hasInstance correctly for proxies. r=mrrrgn
(Assignee)

Updated

2 years ago
Depends on: 1054906

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/130240034c37
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox50: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.