Changeset 117933 in webkit
- Timestamp:
- May 22, 2012 1:38:34 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r117929 r117933 1 2012-05-22 Kentaro Hara <haraken@chromium.org> 2 3 [V8] Add an optional 'isolate' argument to throwTypeError() 4 https://bugs.webkit.org/show_bug.cgi?id=87070 5 6 Reviewed by Adam Barth. 7 8 The objective is to pass Isolate around in V8 bindings. 9 This patch adds an optional 'isolate' argument to throwTypeError(), 10 and passes Isolate to throwTypeError()s. In a following patch, 11 I'll pass Isolate to all throwTypeError("message")s. 12 13 No tests. No change in behavior. 14 15 * bindings/scripts/CodeGeneratorV8.pm: 16 (GenerateNormalAttrSetter): 17 (GenerateOverloadedFunctionCallback): 18 (GenerateParametersCheck): 19 * bindings/scripts/test/V8/V8TestObj.cpp: 20 (WebCore::TestObjV8Internal::overloadedMethodCallback): 21 (WebCore::TestObjV8Internal::overloadedMethod1Callback): 22 * bindings/v8/V8Proxy.cpp: 23 (WebCore::V8Proxy::throwTypeError): 24 * bindings/v8/V8Proxy.h: 25 (V8Proxy): 26 * bindings/v8/custom/V8ArrayBufferViewCustom.h: 27 (WebCore::constructWebGLArray): 28 * bindings/v8/custom/V8DataViewCustom.cpp: 29 (WebCore::V8DataView::constructorCallback): 30 * bindings/v8/custom/V8SVGLengthCustom.cpp: 31 (WebCore::V8SVGLength::valueAccessorSetter): 32 * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp: 33 (WebCore::V8WebGLRenderingContext::getAttachedShadersCallback): 34 (WebCore::V8WebGLRenderingContext::getProgramParameterCallback): 35 (WebCore::V8WebGLRenderingContext::getShaderParameterCallback): 36 (WebCore::V8WebGLRenderingContext::getUniformCallback): 37 (WebCore::vertexAttribAndUniformHelperf): 38 (WebCore::uniformHelperi): 39 (WebCore::uniformMatrixHelper): 40 1 41 2012-05-22 Yoshifumi Inoue <yosin@chromium.org> 2 42 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r117926 r117933 1055 1055 if (IsWrapperType($argType)) { 1056 1056 push(@implContentDecls, " if (!isUndefinedOrNull(value) && !V8${argType}::HasInstance(value)) {\n"); 1057 push(@implContentDecls, " V8Proxy::throwTypeError( );\n");1057 push(@implContentDecls, " V8Proxy::throwTypeError(0, info.GetIsolate());\n"); 1058 1058 push(@implContentDecls, " return;\n"); 1059 1059 push(@implContentDecls, " }\n"); … … 1355 1355 } 1356 1356 push(@implContentDecls, <<END); 1357 V8Proxy::throwTypeError( );1357 V8Proxy::throwTypeError(0, args.GetIsolate()); 1358 1358 return v8::Handle<v8::Value>(); 1359 1359 END … … 1664 1664 if (IsWrapperType($argType)) { 1665 1665 $parameterCheckString .= " if (args.Length() > $paramIndex && !isUndefinedOrNull($argValue) && !V8${argType}::HasInstance($argValue)) {\n"; 1666 $parameterCheckString .= " V8Proxy::throwTypeError( );\n";1666 $parameterCheckString .= " V8Proxy::throwTypeError(0, args.GetIsolate());\n"; 1667 1667 $parameterCheckString .= " return v8::Handle<v8::Value>();\n"; 1668 1668 $parameterCheckString .= " }\n"; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
r117926 r117933 1814 1814 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsArray()))) 1815 1815 return overloadedMethod7Callback(args); 1816 V8Proxy::throwTypeError( );1816 V8Proxy::throwTypeError(0, args.GetIsolate()); 1817 1817 return v8::Handle<v8::Value>(); 1818 1818 } … … 1872 1872 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || args[0]->IsString() || args[0]->IsObject()))) 1873 1873 return overloadedMethod12Callback(args); 1874 V8Proxy::throwTypeError( );1874 V8Proxy::throwTypeError(0, args.GetIsolate()); 1875 1875 return v8::Handle<v8::Value>(); 1876 1876 } -
trunk/Source/WebCore/bindings/v8/V8Proxy.cpp
r117926 r117933 632 632 } 633 633 634 v8::Handle<v8::Value> V8Proxy::throwTypeError(const char* message )635 { 636 return throwError(TypeError, (message ? message : "Type error") );634 v8::Handle<v8::Value> V8Proxy::throwTypeError(const char* message, v8::Isolate* isolate) 635 { 636 return throwError(TypeError, (message ? message : "Type error"), isolate); 637 637 } 638 638 -
trunk/Source/WebCore/bindings/v8/V8Proxy.h
r117926 r117933 241 241 242 242 // Helpers for throwing syntax and type errors with predefined messages. 243 static v8::Handle<v8::Value> throwTypeError(const char* = 0 );243 static v8::Handle<v8::Value> throwTypeError(const char* = 0, v8::Isolate* = 0); 244 244 static v8::Handle<v8::Value> throwNotEnoughArgumentsError(v8::Isolate*); 245 245 -
trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h
r117873 r117933 139 139 if (args[0]->IsNull()) { 140 140 // Invalid first argument 141 // FIXME: use forthcoming V8Proxy::throwTypeError(). 142 return V8Proxy::throwTypeError(); 141 return V8Proxy::throwTypeError(0, args.GetIsolate()); 143 142 } 144 143 -
trunk/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp
r117736 r117933 54 54 } 55 55 if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0])) 56 return V8Proxy::throwTypeError( );56 return V8Proxy::throwTypeError(0, args.GetIsolate()); 57 57 return constructWebGLArrayWithArrayBufferArgument<DataView, char>(args, &info, v8::kExternalByteArray, false); 58 58 } -
trunk/Source/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
r117736 r117933 67 67 68 68 if (!isUndefinedOrNull(value) && !value->IsNumber() && !value->IsBoolean()) { 69 V8Proxy::throwTypeError( );69 V8Proxy::throwTypeError(0, info.GetIsolate()); 70 70 return; 71 71 } -
trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
r117923 r117933 275 275 WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder()); 276 276 if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0])) 277 return V8Proxy::throwTypeError( );277 return V8Proxy::throwTypeError(0, args.GetIsolate()); 278 278 WebGLProgram* program = V8WebGLProgram::HasInstance(args[0]) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0; 279 279 Vector<RefPtr<WebGLShader> > shaders; … … 356 356 WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder()); 357 357 if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0])) 358 return V8Proxy::throwTypeError( );358 return V8Proxy::throwTypeError(0, args.GetIsolate()); 359 359 WebGLProgram* program = V8WebGLProgram::HasInstance(args[0]) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0; 360 360 unsigned pname = toInt32(args[1]); … … 383 383 WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder()); 384 384 if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLShader::HasInstance(args[0])) 385 return V8Proxy::throwTypeError( );385 return V8Proxy::throwTypeError(0, args.GetIsolate()); 386 386 WebGLShader* shader = V8WebGLShader::HasInstance(args[0]) ? V8WebGLShader::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0; 387 387 unsigned pname = toInt32(args[1]); … … 424 424 WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder()); 425 425 if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0])) 426 return V8Proxy::throwTypeError( );426 return V8Proxy::throwTypeError(0, args.GetIsolate()); 427 427 WebGLProgram* program = V8WebGLProgram::HasInstance(args[0]) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0; 428 428 429 429 if (args.Length() > 1 && !isUndefinedOrNull(args[1]) && !V8WebGLUniformLocation::HasInstance(args[1])) 430 return V8Proxy::throwTypeError( );430 return V8Proxy::throwTypeError(0, args.GetIsolate()); 431 431 bool ok = false; 432 432 WebGLUniformLocation* location = toWebGLUniformLocation(args[1], ok); … … 496 496 else { 497 497 if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0])) 498 return V8Proxy::throwTypeError( );498 return V8Proxy::throwTypeError(0, args.GetIsolate()); 499 499 location = toWebGLUniformLocation(args[0], ok); 500 500 } … … 523 523 524 524 if (args[1].IsEmpty() || !args[1]->IsArray()) 525 return V8Proxy::throwTypeError( );525 return V8Proxy::throwTypeError(0, args.GetIsolate()); 526 526 v8::Handle<v8::Array> array = 527 527 v8::Local<v8::Array>::Cast(args[1]); … … 568 568 WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder()); 569 569 if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0])) 570 return V8Proxy::throwTypeError( );570 return V8Proxy::throwTypeError(0, args.GetIsolate()); 571 571 bool ok = false; 572 572 WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok); … … 589 589 590 590 if (args[1].IsEmpty() || !args[1]->IsArray()) 591 return V8Proxy::throwTypeError( );591 return V8Proxy::throwTypeError(0, args.GetIsolate()); 592 592 v8::Handle<v8::Array> array = 593 593 v8::Local<v8::Array>::Cast(args[1]); … … 679 679 680 680 if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0])) 681 return V8Proxy::throwTypeError( );681 return V8Proxy::throwTypeError(0, args.GetIsolate()); 682 682 bool ok = false; 683 683 WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok); … … 700 700 701 701 if (args[2].IsEmpty() || !args[2]->IsArray()) 702 return V8Proxy::throwTypeError( );702 return V8Proxy::throwTypeError(0, args.GetIsolate()); 703 703 v8::Handle<v8::Array> array = 704 704 v8::Local<v8::Array>::Cast(args[2]);
Note: See TracChangeset
for help on using the changeset viewer.