Bug 221176 - An issue about redefining attributes
Summary: An issue about redefining attributes
Status: RESOLVED DUPLICATE of bug 38970
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-30 04:57 PST by NWU_NISL
Modified: 2021-01-30 09:23 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description NWU_NISL 2021-01-30 04:57:08 PST
#version: d940b47

#Testcase
var proto = {};
Object.defineProperty(proto, 'prop', {
    enumerable: true,
});
var Con = function() {};
Con.prototype = proto;
var obj = new Con();
Object.defineProperty(obj, 'prop', {
    enumerable: false,
});
var arr = Object.keys(obj);
for (var p in obj) {
    print(1)
}

#Command:
./webkit/WebKitBuild/Release/bin/jsc testcase.js

#Output:
1

#Expected output:


# Description
When executing this test case, the prop property of obj was redefined, and other engines (SpiderMonkey, v8, chakra, etc.) set it as the redefined property, but the property of JavascriptCore is still the property on the prototype. So I suspect this is an implementation error of JavascriptCore.
Comment 1 Alexey Shvayka 2021-01-30 09:23:00 PST
(In reply to NWU_NISL from comment #0)
> # Description
> When executing this test case, the prop property of obj was redefined, and
> other engines (SpiderMonkey, v8, chakra, etc.) set it as the redefined
> property, but the property of JavascriptCore is still the property on the
> prototype. So I suspect this is an implementation error of JavascriptCore.

Thank you for the test case!
It was a long-standing issue, but as of r270874, JSC doesn't enumerate "prop" either.

*** This bug has been marked as a duplicate of bug 38970 ***