Closed Bug 1279366 Opened 8 years ago Closed 8 years ago

handle @@hasInstance correctly for proxies

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: mrrrgn, Assigned: evilpie)

References

Details

Attachments

(1 file, 1 obsolete file)

// 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: nobody → evilpies
This just forwards the hasInstance trap to the InstanceOfOperator, this basically makes the indirection through the hasInstance trap invisible.
Attachment #8761969 - Flags: review?(winter2718)
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?
Fail ..
Attachment #8761969 - Attachment is obsolete: true
Attachment #8761969 - Flags: review?(winter2718)
Attachment #8762128 - Flags: review?(winter2718)
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+
Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/130240034c37
Handle @@hasInstance correctly for proxies. r=mrrrgn
Depends on: 1054906
https://hg.mozilla.org/mozilla-central/rev/130240034c37
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: