Closed Bug 1701904 Opened 3 years ago Closed 3 years ago

Change GetOwnPropertyDescriptor to return Maybe<PropertyDescriptor>

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: evilpie, Assigned: evilpie)

References

Details

Attachments

(6 files)

Right now we encode "undefined" PropertyDescriptors by setting the JSObject field to null. However that field should not even exists on normal PropertyDescriptor. Instead use Maybe to encode missing/undefined PropertyDescriptors.

Assignee: nobody → evilpies
Status: NEW → ASSIGNED
Severity: -- → N/A
Priority: -- → P1
Keywords: leave-open
Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/91c911c34a19
Add a new GetOwnPropertyDescriptor function that returns Maybe<PropertyDescriptor>. r=jandem
https://hg.mozilla.org/integration/autoland/rev/ab47df2d318a
Add methods directly on PropertyDescriptor. r=jandem
https://hg.mozilla.org/integration/autoland/rev/722cb95c303c
Start using the new GetOwnPropertyDescriptor overload in Object.cpp. r=jandem
Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/e6408add963c
Start using the new GetOwnPropertyDescriptor overload in a few more places. r=jandem
Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/f5106f6c193d
Use the new GetOwnPropertyDescriptor function in ScriptedProxyHandler. r=jandem

I am not super happy with having to do Rooted<PropertyDescriptor> desc(cx, *desc_); in DebuggerObject::getOwnPropertyDescriptor.
However PropertyDescriptor::value() can't be resolved properly, unlike MutableHandle<PropertyDescriptor>::value().

I wonder if Maybe could return Handle/MutableHandle as well somehow.

Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/b08a8155783d
Use Maybe<PropertyDescriptor> in DebuggerObject and a few resulting places. r=jandem
Keywords: leave-open

I started working on changing the BaseProxyHandler::getOwnPropertyDescriptor. This is going to be a pretty major change, especially in DOM code as well. Let's do it in a new bug.

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: