Closed Bug 1390068 Opened 8 years ago Closed 8 years ago

Define Symbol.toPrimitive on NPObjectMember instead of using a getProperty hook

Categories

(Core Graveyard :: Plug-ins, enhancement)

enhancement
Not set
normal

Tracking

(firefox57 fixed)

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch (obsolete) — Splinter Review
Like bug 1389949, but this one is much simpler: instead of using a getProperty hook to return a function for Symbol.toPrimitive, we should just define this property when we create the NPObjectMember object. Note that we have tests that rely on this (test_propertyAndMethod.html) and they pass with this patch.
Attachment #8896910 - Flags: review?(evilpies)
Attached patch PatchSplinter Review
Attachment #8896910 - Attachment is obsolete: true
Attachment #8896910 - Flags: review?(evilpies)
Attachment #8896911 - Flags: review?(evilpies)
Comment on attachment 8896911 [details] [diff] [review] Patch Review of attachment 8896911 [details] [diff] [review]: ----------------------------------------------------------------- Sounds sensible, using a getProperty hook for this wasn't really necessary. ::: dom/plugins/base/nsJSNPRuntime.cpp @@ +2202,5 @@ > + return false; > + > + JS::Rooted<JS::Value> val(cx, JS::ObjectValue(*JS_GetFunctionObject(fun))); > + > + if (!JS_DefinePropertyById(cx, memobj, toPrimitiveId, val, 0)) I think DefinePropertyById has an object overload.
Attachment #8896911 - Flags: review?(evilpies) → review+
Pushed by jandemooij@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/030afe238ba3 Define Symbol.toPrimitive property when creating NPObjectMember instead of using a getProperty hook. r=evilpie
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: