UNCONFIRMED 104242
Attribute ReadOnly is not applied to global object's properties set via JSObjectSetProperty
https://bugs.webkit.org/show_bug.cgi?id=104242
Summary Attribute ReadOnly is not applied to global object's properties set via JSObj...
Hojong Han
Reported 2012-12-06 01:54:08 PST
Source/JavaScriptCore/API/JSObjectRef.cpp void JSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSPropertyAttributes attributes, JSValueRef* exception) { ... skip ... jsObject->methodTable()->putDirectVirtual(jsObject, exec, name, jsValue, attributes); ... skip ... } Source/JavaScriptCore/runtime/JSGlobalObject.cpp void JSGlobalObject::putDirectVirtual(JSObject* object, ExecState* exec, PropertyName propertyName, JSValue value, unsigned attributes) { ... skip ... JSValue valueBefore = thisObject->getDirect(exec->globalData(), propertyName); PutPropertySlot slot; Base::put(thisObject, exec, propertyName, value, slot); if (!valueBefore) { JSValue valueAfter = thisObject->getDirect(exec->globalData(), propertyName); if (valueAfter) JSObject::putDirectVirtual(thisObject, exec, propertyName, valueAfter, attributes); } } putDirectVirtual called in JSObjectSetProperty calls put and then putDirectVirtual. Property is put without any attribute in function "put", but stil attribute is not updated in function "putDirectVirtual". Isn't it a bug? Plz somebody let me know the reason why the routine is written like above.
Attachments
Note You need to log in before you can comment on or make changes to this bug.