Closed Bug 1245024 Opened 8 years ago Closed 8 years ago

[es7] implement Object.getOwnPropertyDescriptors() proposal


(Core :: JavaScript Engine, defect)

Not set



Tracking Status
firefox50 --- fixed


(Reporter: andrea.giammarchi, Assigned: evilpie)



(Keywords: dev-doc-complete, Whiteboard: [DocArea=JS])


(3 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36

Steps to reproduce:

Apologies if this is not the best channel but it's already happening in Chrome so I've thought to file a bug/request in here too. The Chromium related issue is the following one:

Actual results:

Object.getOwnPropertyDescriptors is not defined

Expected results:

There is a stage 3 proposal waiting to be promoted to stage 4:

Expecting Object.getOwnPropertyDescriptors to be available and return a generic object with all own properties (names + Symbols) and relative descriptors as described in the proposal.

A polyfill-like version of what should happen is described in here:

Thanks in advance for considering this change or for redirecting this to the right team.

Best Regards
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
No review request yet, because I have to look into importing somehow.
Assignee: nobody → evilpies
Ever confirmed: true
This is not yet in the current spec at There is still some discussion about the case when the descriptor returned by [[GetOwnProperty]] is undefined: has now been merged unchanged. In July, we'll get committee consensus on the additional "if" check in which only applies to Proxies.
dom/plugins/test/mochitest/test_defaultValue.html is failing, I suspect we are passing a symbol to function that can't handle it. As usual, just running the test locally doesn't actually reproduce it.
Attachment #8756410 - Flags: review?(jorendorff)
I made a few changes to these tests to avoid having to import a lot of code from the test suite.
Attachment #8760090 - Flags: review?(jorendorff)
Comment on attachment 8756410 [details] [diff] [review]
Implement Object.getOwnPropertyDescriptors

Review of attachment 8756410 [details] [diff] [review]:

Seems totally fine. Can you file a followup to track the spec change that's in the works for thi stage 4 proposal? I mean the extra if, which Jordan says only affects the proxy case of returns from [[GetOwnProperty]].
Attachment #8756410 - Flags: review?(jorendorff) → review+
Comment on attachment 8760090 [details] [diff] [review]
Port tests from tests262

Review of attachment 8760090 [details] [diff] [review]:

Hmmm, I wonder about putting these in the test262 directory, which I don't think is ever run. Is there somewhere we can put them where they will be run for sure? add a bunch fo reportCompare() calls and put them in js/tests/ for example?

r=me with assurances that they are actually being run in automation.
Attachment #8760090 - Flags: review?(jorendorff) → review+
Going to merge this before landing.
Comment on attachment 8761660 [details] [diff] [review]
Add getOwnPropertyDescriptors to test_xray

Attachment #8761660 - Flags: review+
Pushed by
Implement Object.getOwnPropertyDescriptors. r=efaust,bz
Import test262 tests. r=efaust
Blocks: 1279303
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.