Closed Bug 1812540 Opened 2 years ago Closed 1 year ago

Xray attribute doesn't have get/set prefix

Categories

(Core :: DOM: Bindings (WebIDL), defect)

defect

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(2 files)

Xray function created for WebIDL attribute uses the attribute's name as the function name,
and it lacks "get " or "set " prefix.

https://searchfox.org/mozilla-central/rev/e35e7107299a46a696b8aa8a4a5c03a39458ac21/dom/bindings/BindingUtils.cpp#1515-1520,1538-1540,1548-1549

static bool XrayResolveAttribute(
    JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<JSObject*> obj,
    JS::Handle<jsid> id, const Prefable<const JSPropertySpec>& pref,
    const JSPropertySpec& attrSpec,
    JS::MutableHandle<Maybe<JS::PropertyDescriptor>> desc,
    bool& cacheOnHolder) {
...
  JS::Rooted<JSObject*> getter(
      cx, XrayCreateFunction(cx, wrapper, attrSpec.u.accessors.getter.native, 0,
                             id));
...
    setter = XrayCreateFunction(cx, wrapper, attrSpec.u.accessors.setter.native,
                                1, id);

I'm going to use the xray function in bug 1806598 to check if given accessor is safe for eager evaluation,
but the machinery uses the function name as a map key, and the missing "get " prefix is slightly problematic (can workaround, but it would be better if the prefix is added by default)

Severity: -- → S3
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED

Also remove the workaround to add get/set prefix in debugger.

Depends on D168512

Attachment #9315308 - Attachment is obsolete: true
Attachment #9315308 - Attachment is obsolete: false
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/810ed5832764
Part 1: Add JS::ToGetterId and JS::ToSetterId. r=sfink
https://hg.mozilla.org/integration/autoland/rev/3b0e28b20def
Part 2: Add get/set prefix for Xray accessors. r=nchevobbe,peterv
Flags: needinfo?(arai.unmht)
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/e9e469586319
Part 1: Add JS::ToGetterId and JS::ToSetterId. r=sfink
https://hg.mozilla.org/integration/autoland/rev/5c2b32e98bed
Part 2: Add get/set prefix for Xray accessors. r=nchevobbe,peterv
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Flags: needinfo?(arai.unmht)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: