[Webkit-unassigned] [Bug 38639] New: Specifying attributes for an Array property causes the property not to be created
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu May 6 05:22:21 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=38639
Summary: Specifying attributes for an Array property causes the
property not to be created
Product: WebKit
Version: 528+ (Nightly build)
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: kent.hansen at nokia.com
Creating a property whose name is a valid array index, and specifying one or
more attributes for that property, doesn't work.
>From JavaScript:
./jsc
> a = [];
> Object.defineProperty(a, "0", { value: 123, writable: false });
> a[0]
undefined
With C API:
JSObjectRef myArray = JSObjectMakeArray(context, 0, 0, 0);
JSStringRef zeroStr = JSStringCreateWithUTF8CString("0");
JSValueRef num = JSValueMakeNumber(context, 123);
JSObjectSetProperty(context, myArray, zeroStr, num,
kJSPropertyAttributeReadOnly, 0);
JSValueRef ret = JSObjectGetProperty(context, myArray, zeroStr, 0); // returns
undefined
In the C API case, passing 0 as attributes works as expected, but in the JS
case, removing "writable: false" doesn't actually help.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list