Changeset 123800 in webkit
- Timestamp:
- Jul 26, 2012 3:15:56 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r123799 r123800 1 2012-07-26 Chang Shu <cshu@webkit.org> 2 3 Support constructor-type static readonly attribute for CodeGenerator. 4 https://bugs.webkit.org/show_bug.cgi?id=92413. 5 6 Reviewed by Adam Barth. 7 8 Added support for constructor-type static readonly attribute for CodeGenerator. 9 This is achieved by putting the attribute entry in the table where static properties 10 belong to but leave the implementation same as a non-static constructor-type attribute. 11 12 Tested by running run-bindings-tests. 13 14 * bindings/scripts/CodeGeneratorJS.pm: 15 (GenerateImplementation): 16 * bindings/scripts/test/JS/JSTestInterface.cpp: 17 (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr): 18 (WebCore::jsTestInterfaceConstructorSupplementalStaticAttr): 19 * bindings/scripts/test/JS/JSTestObj.cpp: 20 (WebCore): 21 (WebCore::jsTestObjConstructorStaticReadOnlyLongAttr): 22 (WebCore::jsTestObjConstructorStaticStringAttr): 23 (WebCore::jsTestObjConstructorTestSubObj): 24 * bindings/scripts/test/JS/JSTestObj.h: 25 (WebCore): 26 * bindings/scripts/test/TestObj.idl: 27 * bindings/scripts/test/V8/V8TestObj.cpp: 28 (WebCore): 29 1 30 2012-07-26 Sadrul Habib Chowdhury <sadrul@chromium.org> 2 31 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r123546 r123800 1765 1765 push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString; 1766 1766 1767 push(@implContent, "JSValue ${getFunctionName}(ExecState* exec, JSValue"); 1768 push(@implContent, " slotBase") if !$attribute->isStatic; 1769 push(@implContent, ", PropertyName)\n"); 1767 push(@implContent, "JSValue ${getFunctionName}(ExecState* exec, JSValue slotBase, PropertyName)\n"); 1770 1768 push(@implContent, "{\n"); 1771 1769 1772 if (!$attribute->isStatic ) {1770 if (!$attribute->isStatic || $attribute->signature->type =~ /Constructor$/) { 1773 1771 push(@implContent, " ${className}* castedThis = jsCast<$className*>(asObject(slotBase));\n"); 1772 } else { 1773 push(@implContent, " UNUSED_PARAM(slotBase);\n"); 1774 1774 } 1775 1775 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
r123439 r123800 243 243 244 244 #if ENABLE(Condition11) || ENABLE(Condition12) 245 JSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(ExecState* exec, JSValue, PropertyName) 246 { 245 JSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(ExecState* exec, JSValue slotBase, PropertyName) 246 { 247 UNUSED_PARAM(slotBase); 247 248 UNUSED_PARAM(exec); 248 249 JSValue result = jsNumber(TestSupplemental::supplementalStaticReadOnlyAttr()); … … 253 254 254 255 #if ENABLE(Condition11) || ENABLE(Condition12) 255 JSValue jsTestInterfaceConstructorSupplementalStaticAttr(ExecState* exec, JSValue, PropertyName) 256 { 256 JSValue jsTestInterfaceConstructorSupplementalStaticAttr(ExecState* exec, JSValue slotBase, PropertyName) 257 { 258 UNUSED_PARAM(slotBase); 257 259 UNUSED_PARAM(exec); 258 260 JSValue result = jsString(exec, TestSupplemental::supplementalStaticAttr()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r123600 r123800 169 169 { "staticReadOnlyLongAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorStaticReadOnlyLongAttr), (intptr_t)0, NoIntrinsic }, 170 170 { "staticStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorStaticStringAttr), (intptr_t)setJSTestObjConstructorStaticStringAttr, NoIntrinsic }, 171 { "TestSubObj", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorTestSubObj), (intptr_t)0, NoIntrinsic }, 171 172 { "classMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionClassMethod), (intptr_t)0, NoIntrinsic }, 172 173 { "classMethodWithOptional", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionClassMethodWithOptional), (intptr_t)1, NoIntrinsic }, … … 414 415 415 416 416 JSValue jsTestObjConstructorStaticReadOnlyLongAttr(ExecState* exec, JSValue, PropertyName) 417 { 417 JSValue jsTestObjConstructorStaticReadOnlyLongAttr(ExecState* exec, JSValue slotBase, PropertyName) 418 { 419 UNUSED_PARAM(slotBase); 418 420 UNUSED_PARAM(exec); 419 421 JSValue result = jsNumber(TestObj::staticReadOnlyLongAttr()); … … 422 424 423 425 424 JSValue jsTestObjConstructorStaticStringAttr(ExecState* exec, JSValue, PropertyName) 425 { 426 JSValue jsTestObjConstructorStaticStringAttr(ExecState* exec, JSValue slotBase, PropertyName) 427 { 428 UNUSED_PARAM(slotBase); 426 429 UNUSED_PARAM(exec); 427 430 JSValue result = jsString(exec, TestObj::staticStringAttr()); 428 431 return result; 432 } 433 434 435 JSValue jsTestObjConstructorTestSubObj(ExecState* exec, JSValue slotBase, PropertyName) 436 { 437 JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); 438 return JSTestSubObj::getConstructor(exec, castedThis); 429 439 } 430 440 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
r123600 r123800 224 224 JSC::JSValue jsTestObjConstructorStaticStringAttr(JSC::ExecState*, JSC::JSValue, JSC::PropertyName); 225 225 void setJSTestObjConstructorStaticStringAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); 226 JSC::JSValue jsTestObjConstructorTestSubObj(JSC::ExecState*, JSC::JSValue, JSC::PropertyName); 226 227 JSC::JSValue jsTestObjShortAttr(JSC::ExecState*, JSC::JSValue, JSC::PropertyName); 227 228 void setJSTestObjShortAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); -
trunk/Source/WebCore/bindings/scripts/test/TestObj.idl
r123600 r123800 42 42 static readonly attribute long staticReadOnlyLongAttr; 43 43 static attribute DOMString staticStringAttr; 44 static readonly attribute TestSubObjConstructor TestSubObj; 44 45 #endif 45 46 attribute short shortAttr; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
r123600 r123800 49 49 #include "V8ScriptProfile.h" 50 50 #include "V8TestCallback.h" 51 #include "V8TestSubObj.h" 51 52 #include "V8a.h" 52 53 #include "V8any.h" … … 1911 1912 // Attribute 'staticStringAttr' (Type: 'attribute' ExtAttr: '') 1912 1913 {"staticStringAttr", TestObjV8Internal::staticStringAttrAttrGetter, TestObjV8Internal::staticStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 1914 // Attribute 'TestSubObj' (Type: 'readonly attribute' ExtAttr: '') 1915 {"TestSubObj", TestObjV8Internal::TestObjConstructorGetter, 0, &V8TestSubObj::info, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 1913 1916 // Attribute 'shortAttr' (Type: 'attribute' ExtAttr: '') 1914 1917 {"shortAttr", TestObjV8Internal::shortAttrAttrGetter, TestObjV8Internal::shortAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
Note: See TracChangeset
for help on using the changeset viewer.