Closed Bug 1156077 Opened 9 years ago Closed 5 years ago

Remove the getPropertyDescriptor trap

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: evilpie, Assigned: evilpie)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

getPropertyDescriptor is one of the last non-standard traps that we should probably remove. The concept of "getPropertyDescriptor" never materialized in ES6. Just removing the trap turned out to be somewhat tricky, because Xrays seem to require them. Instead I will try a piece by piece approach.

Aside: We have JS_GetPropertyDescriptor as well, which is not a good idea either. Especially because in some places we seem to assume that calling [[GetOwnProperty]] on the whole proto-chain of an object is the same as calling [[Get]]. This however is not true in some cases like TypedArrays, where all calls to the [[Get]] trap for indexed elements end.
Depends on: 1159347
Depends on: 1160757
Depends on: 1160996
Depends on: 1242072
Blocks: 1103158
Keywords: site-compat
Depends on: 1256688
So we are now at a point where removing getPropertyDescriptor is feasible. Right now my patches actually keep getPropertyDescriptor internally on Xray/Sandbox, because those need weird behavior. Maybe this can be resolved as well.
With bug 1053271 close to landing we can finally start working on removing this code. I think without XPCWN Xrays the only small wrinkle might be the DOM Sandbox code.
Attachment #8964594 - Attachment is obsolete: true
Depends on: 1468774

With bug 1363208 landing, we should finally be able to remove this. The only real user that I am aware of is the XPC Sandbox. Just removing SandboxProxyHandler::getPropertyDescriptor might work.

I am bit surprised myself, but just removing the getPropertyDescriptor trap seems to mostly work.
The only real special case here is the XPC Sandbox, which I changed to keep using its getPropertyDescriptorImpl.

testSetPropertyIgnoringNamedGetter.cpp didn't even really need its getPropertyDescriptor implementation.

Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/46790408df7f
Remove the non-standard Proxy getPropertyDescriptor trap. r=bzbarsky,jorendorff
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: