getOwnPropertyDescriptor trap can't report a configurable property as non-configurable

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
3 years ago

People

(Reporter: David Bruant, Unassigned)

Tracking

18 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 obsolete attachment)

(Reporter)

Description

5 years ago
This is a spec issue recently found, so Firefox doesn't comply. Test case: 

    var target = {};
    Object.defineProperty(target, 'x', {value:1,configurable:true});
    var proxy = Proxy(target, {
      getOwnPropertyDescriptor: function(target, name) {
        return { value: 2, configurable: false };
      }
    });
    Object.getOwnPropertyDescriptor(proxy, 'x') 


Actual result:
Doesn't throw an error and returns the incompatible property descriptor

Expected result:
throw TypeError
(Reporter)

Updated

5 years ago
Blocks: 703537
Created attachment 668698 [details] [diff] [review]
Update GetOwnProperty and DefineProperty Traps according to spec changes

Revision 1348497118 of http://wiki.ecmascript.org/doku.php?id=harmony:proxies_spec
changes the algorithm to report error on not just a non-existent property being reported as non-configurable, but also checks that if the property exists and is configurable, the handler doesn't report it as non-configurable
Attachment #668698 - Flags: review?(ejpbruel)

Comment 2

4 years ago
Can anyone fix this?
This can drive you insane when you don't know it!
Comment on attachment 668698 [details] [diff] [review]
Update GetOwnProperty and DefineProperty Traps according to spec changes

Really old patch, up for grabs if someone is willing to update.
Attachment #668698 - Attachment is obsolete: true
Attachment #668698 - Flags: review?(ejpbruel)

Updated

3 years ago
See Also: → bug 793210

Updated

3 years ago
See Also: → bug 806299
(Assignee)

Updated

3 years ago
Assignee: general → nobody
This was probably fixed in bug 806299
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.