Changeset 117507 in webkit
- Timestamp:
- May 17, 2012 3:35:07 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r117506 r117507 1 2012-05-17 Kentaro Hara <haraken@chromium.org> 2 3 [V8][Refactoring] Remove throwError("message", XXXError) from CodeGeneratorV8.pm 4 https://bugs.webkit.org/show_bug.cgi?id=86744 5 6 Reviewed by Adam Barth. 7 8 As commented in https://bugs.webkit.org/show_bug.cgi?id=84074#c5, 9 I am refactoring a series of confusing throwError()s. 10 11 This patch removes throwError("message", XXXError) in CodeGeneratorV8.pm 12 and replaces it with throwTypeError("message") or throwError(XXXError, "message"). 13 14 No tests. No change in behavior. 15 16 * bindings/scripts/CodeGeneratorV8.pm: 17 (GenerateParametersCheck): 18 (GenerateConstructorCallback): 19 (GenerateEventConstructorCallback): 20 (GenerateNamedConstructorCallback): 21 * bindings/scripts/test/V8/V8TestEventConstructor.cpp: 22 (WebCore::V8TestEventConstructor::constructorCallback): 23 * bindings/scripts/test/V8/V8TestInterface.cpp: 24 (WebCore::V8TestInterface::constructorCallback): 25 * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: 26 (WebCore::V8TestNamedConstructorConstructorCallback): 27 * bindings/scripts/test/V8/V8TestNode.cpp: 28 (WebCore::V8TestNode::constructorCallback): 29 * bindings/scripts/test/V8/V8TestObj.cpp: 30 (WebCore::TestObjV8Internal::optionsObjectCallback): 31 (WebCore::V8TestObj::constructorCallback): 32 * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: 33 (WebCore::TestSerializedScriptValueInterfaceV8Internal::acceptTransferListCallback): 34 (WebCore::TestSerializedScriptValueInterfaceV8Internal::multiTransferListCallback): 35 (WebCore::V8TestSerializedScriptValueInterface::constructorCallback): 36 1 37 2012-05-17 Gregg Tavares <gman@google.com> 2 38 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r117384 r117507 1624 1624 $parameterCheckString .= " if (args.Length() > $transferListIndex) {\n"; 1625 1625 $parameterCheckString .= " if (!extractTransferables(args[$transferListIndex], messagePortArray$TransferListName, arrayBufferArray$TransferListName))\n"; 1626 $parameterCheckString .= " return throwError(\"Could not extract transferables\", V8Proxy::TypeError);\n";1626 $parameterCheckString .= " return V8Proxy::throwTypeError(\"Could not extract transferables\");\n"; 1627 1627 $parameterCheckString .= " }\n"; 1628 1628 $useTransferList = 1; … … 1672 1672 $parameterCheckString .= " V8Proxy::setDOMException(ec, args.GetIsolate());\n"; 1673 1673 } 1674 $parameterCheckString .= " return throwError(\"Not an object.\", V8Proxy::TypeError);\n";1674 $parameterCheckString .= " return V8Proxy::throwTypeError(\"Not an object.\");\n"; 1675 1675 $parameterCheckString .= " }\n"; 1676 1676 } … … 1715 1715 1716 1716 if (!args.IsConstructCall()) 1717 return throwError("DOM object constructor cannot be called as a function.", V8Proxy::TypeError);1717 return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function."); 1718 1718 1719 1719 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) … … 1740 1740 ScriptExecutionContext* context = getScriptExecutionContext(); 1741 1741 if (!context) 1742 return throwError("${implClassName} constructor's associated context is not available", V8Proxy::ReferenceError);1742 return V8Proxy::throwError(V8Proxy::ReferenceError, "${implClassName} constructor's associated context is not available"); 1743 1743 END 1744 1744 } … … 1800 1800 1801 1801 if (!args.IsConstructCall()) 1802 return throwError("DOM object constructor cannot be called as a function.", V8Proxy::TypeError);1802 return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function."); 1803 1803 1804 1804 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) … … 1889 1889 1890 1890 if (!args.IsConstructCall()) 1891 return throwError("DOM object constructor cannot be called as a function.", V8Proxy::TypeError);1891 return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function."); 1892 1892 1893 1893 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) … … 1896 1896 Frame* frame = V8Proxy::retrieveFrameForCurrentContext(); 1897 1897 if (!frame) 1898 return throwError("${implClassName} constructor associated frame is unavailable", V8Proxy::ReferenceError);1898 return V8Proxy::throwError(V8Proxy::ReferenceError, "${implClassName} constructor associated frame is unavailable"); 1899 1899 1900 1900 Document* document = frame->document(); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
r115797 r117507 68 68 69 69 if (!args.IsConstructCall()) 70 return throwError("DOM object constructor cannot be called as a function.", V8Proxy::TypeError);70 return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function."); 71 71 72 72 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
r116269 r117507 209 209 210 210 if (!args.IsConstructCall()) 211 return throwError("DOM object constructor cannot be called as a function.", V8Proxy::TypeError);211 return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function."); 212 212 213 213 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) … … 222 222 ScriptExecutionContext* context = getScriptExecutionContext(); 223 223 if (!context) 224 return throwError("TestInterface constructor's associated context is not available", V8Proxy::ReferenceError);224 return V8Proxy::throwError(V8Proxy::ReferenceError, "TestInterface constructor's associated context is not available"); 225 225 226 226 RefPtr<TestInterface> impl = TestInterface::create(context, str1, str2, ec); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
r115797 r117507 49 49 50 50 if (!args.IsConstructCall()) 51 return throwError("DOM object constructor cannot be called as a function.", V8Proxy::TypeError);51 return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function."); 52 52 53 53 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) … … 56 56 Frame* frame = V8Proxy::retrieveFrameForCurrentContext(); 57 57 if (!frame) 58 return throwError("TestNamedConstructor constructor associated frame is unavailable", V8Proxy::ReferenceError);58 return V8Proxy::throwError(V8Proxy::ReferenceError, "TestNamedConstructor constructor associated frame is unavailable"); 59 59 60 60 Document* document = frame->document(); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp
r115797 r117507 46 46 47 47 if (!args.IsConstructCall()) 48 return throwError("DOM object constructor cannot be called as a function.", V8Proxy::TypeError);48 return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function."); 49 49 50 50 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
r116269 r117507 1352 1352 EXCEPTION_BLOCK(Dictionary, oo, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)); 1353 1353 if (args.Length() > 0 && !oo.isUndefinedOrNull() && !oo.isObject()) { 1354 return throwError("Not an object.", V8Proxy::TypeError);1354 return V8Proxy::throwTypeError("Not an object."); 1355 1355 } 1356 1356 if (args.Length() <= 1) { … … 1360 1360 EXCEPTION_BLOCK(Dictionary, ooo, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)); 1361 1361 if (args.Length() > 1 && !ooo.isUndefinedOrNull() && !ooo.isObject()) { 1362 return throwError("Not an object.", V8Proxy::TypeError);1362 return V8Proxy::throwTypeError("Not an object."); 1363 1363 } 1364 1364 imp->optionsObject(oo, ooo); … … 2235 2235 2236 2236 if (!args.IsConstructCall()) 2237 return throwError("DOM object constructor cannot be called as a function.", V8Proxy::TypeError);2237 return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function."); 2238 2238 2239 2239 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
r117384 r117507 131 131 if (args.Length() > 1) { 132 132 if (!extractTransferables(args[1], messagePortArrayTransferList, arrayBufferArrayTransferList)) 133 return throwError("Could not extract transferables", V8Proxy::TypeError);133 return V8Proxy::throwTypeError("Could not extract transferables"); 134 134 } 135 135 bool dataDidThrow = false; … … 157 157 if (args.Length() > 1) { 158 158 if (!extractTransferables(args[1], messagePortArrayTx, arrayBufferArrayTx)) 159 return throwError("Could not extract transferables", V8Proxy::TypeError);159 return V8Proxy::throwTypeError("Could not extract transferables"); 160 160 } 161 161 bool firstDidThrow = false; … … 175 175 if (args.Length() > 3) { 176 176 if (!extractTransferables(args[3], messagePortArrayTxx, arrayBufferArrayTxx)) 177 return throwError("Could not extract transferables", V8Proxy::TypeError);177 return V8Proxy::throwTypeError("Could not extract transferables"); 178 178 } 179 179 bool secondDidThrow = false; … … 214 214 215 215 if (!args.IsConstructCall()) 216 return throwError("DOM object constructor cannot be called as a function.", V8Proxy::TypeError);216 return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function."); 217 217 218 218 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) … … 225 225 if (args.Length() > 2) { 226 226 if (!extractTransferables(args[2], messagePortArrayTransferList, arrayBufferArrayTransferList)) 227 return throwError("Could not extract transferables", V8Proxy::TypeError);227 return V8Proxy::throwTypeError("Could not extract transferables"); 228 228 } 229 229 bool dataDidThrow = false;
Note: See TracChangeset
for help on using the changeset viewer.