WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-86576-20120516143947.patch (text/plain), 12.10 KB, created by
Kentaro Hara
on 2012-05-15 22:39:48 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Kentaro Hara
Created:
2012-05-15 22:39:48 PDT
Size:
12.10 KB
patch
obsolete
>Subversion Revision: 117218 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2645cefd14c56415536f62e3e86d05649270e2f4..ad3e40619cef564cdee5732dc9bb04351e515e1e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,44 @@ >+2012-05-15 Kentaro Hara <haraken@chromium.org> >+ >+ [V8][Refactoring] Replace throwTypeError() with throwTypeError("Type error") >+ https://bugs.webkit.org/show_bug.cgi?id=86576 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ As commented here (https://bugs.webkit.org/show_bug.cgi?id=84074#c5), >+ I am planning to refactor a series of confusing throwError()s. >+ >+ As the first step, I replace throwTypeError() with throwTypeError("Type error"). >+ Actually I think we should use a more descriptive error message than "Type error", >+ but to keep the behavior of JSC and V8 consistent, this patch just uses "Type error" for now. >+ >+ In the next step, I will replace throwError("message", TypeError) >+ with throwTypeError("message"), and replace throwError("message") >+ with throwTypeError("message"). >+ >+ No tests. No change in behavior. >+ >+ * bindings/scripts/CodeGeneratorV8.pm: >+ (GenerateNormalAttrSetter): >+ (GenerateOverloadedFunctionCallback): >+ (GenerateParametersCheck): >+ * bindings/v8/V8Proxy.cpp: >+ (WebCore::V8Proxy::throwTypeError): >+ * bindings/v8/V8Proxy.h: >+ (V8Proxy): >+ * bindings/v8/custom/V8DataViewCustom.cpp: >+ (WebCore::V8DataView::constructorCallback): >+ * bindings/v8/custom/V8SVGLengthCustom.cpp: >+ (WebCore::V8SVGLength::valueAccessorSetter): >+ * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp: >+ (WebCore::V8WebGLRenderingContext::getAttachedShadersCallback): >+ (WebCore::V8WebGLRenderingContext::getProgramParameterCallback): >+ (WebCore::V8WebGLRenderingContext::getShaderParameterCallback): >+ (WebCore::V8WebGLRenderingContext::getUniformCallback): >+ (WebCore::vertexAttribAndUniformHelperf): >+ (WebCore::uniformHelperi): >+ (WebCore::uniformMatrixHelper): >+ > 2012-05-15 Igor Oliveira <igor.o@sisa.samsung.com> > > regression(111639): Issue with simultaneous CSS animations >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >index 702ab440c56fe3e7f7e1258e7e1da22f1d34b54e..3098c4473500168ec3200a682d58078913c6e023 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >@@ -1046,7 +1046,7 @@ sub GenerateNormalAttrSetter > my $argType = GetTypeFromSignature($attribute->signature); > if (IsWrapperType($argType)) { > push(@implContentDecls, " if (!isUndefinedOrNull(value) && !V8${argType}::HasInstance(value)) {\n"); >- push(@implContentDecls, " V8Proxy::throwTypeError();\n"); >+ push(@implContentDecls, " V8Proxy::throwTypeError(\"Type error\");\n"); > push(@implContentDecls, " return;\n"); > push(@implContentDecls, " }\n"); > } >@@ -1346,7 +1346,7 @@ END > push(@implContentDecls, " return ${name}$overload->{overloadIndex}Callback(args);\n"); > } > push(@implContentDecls, <<END); >- V8Proxy::throwTypeError(); >+ V8Proxy::throwTypeError(\"Type error\"); > return notHandledByInterceptor(); > END > push(@implContentDecls, "}\n\n"); >@@ -1658,7 +1658,7 @@ sub GenerateParametersCheck > my $argType = GetTypeFromSignature($parameter); > if (IsWrapperType($argType)) { > $parameterCheckString .= " if (args.Length() > $paramIndex && !isUndefinedOrNull($argValue) && !V8${argType}::HasInstance($argValue)) {\n"; >- $parameterCheckString .= " V8Proxy::throwTypeError();\n"; >+ $parameterCheckString .= " V8Proxy::throwTypeError(\"Type error\");\n"; > $parameterCheckString .= " return notHandledByInterceptor();\n"; > $parameterCheckString .= " }\n"; > } >diff --git a/Source/WebCore/bindings/v8/V8Proxy.cpp b/Source/WebCore/bindings/v8/V8Proxy.cpp >index db733898b26fa9b34bd8751426c68f5fcd7d5c1e..d8c64b8473e2ba5e109fd671bd8260e6ebd499ed 100644 >--- a/Source/WebCore/bindings/v8/V8Proxy.cpp >+++ b/Source/WebCore/bindings/v8/V8Proxy.cpp >@@ -609,9 +609,9 @@ v8::Handle<v8::Value> V8Proxy::throwError(ErrorType type, const char* message, v > } > } > >-v8::Handle<v8::Value> V8Proxy::throwTypeError() >+v8::Handle<v8::Value> V8Proxy::throwTypeError(const char* message) > { >- return throwError(TypeError, "Type error"); >+ return throwError(TypeError, message); > } > > v8::Handle<v8::Value> V8Proxy::throwNotEnoughArgumentsError() >diff --git a/Source/WebCore/bindings/v8/V8Proxy.h b/Source/WebCore/bindings/v8/V8Proxy.h >index 601831dc27677e5fe89a6e7022bd9a40fced9a78..e7eacf4b801df10f254ce1a3b074e5136aa5aea8 100644 >--- a/Source/WebCore/bindings/v8/V8Proxy.h >+++ b/Source/WebCore/bindings/v8/V8Proxy.h >@@ -239,7 +239,7 @@ namespace WebCore { > static v8::Handle<v8::Value> throwError(ErrorType, const char* message, v8::Isolate* = 0); > > // Helpers for throwing syntax and type errors with predefined messages. >- static v8::Handle<v8::Value> throwTypeError(); >+ static v8::Handle<v8::Value> throwTypeError(const char*); > static v8::Handle<v8::Value> throwNotEnoughArgumentsError(); > > v8::Local<v8::Context> context(); >diff --git a/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp >index ba5f8c458d55aa42cf22033723b516897ff7c85c..1a9b90718990fa6b0caad676a84998a510e9847a 100755 >--- a/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp >@@ -53,7 +53,7 @@ v8::Handle<v8::Value> V8DataView::constructorCallback(const v8::Arguments& args) > return args.Holder(); > } > if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0])) >- return V8Proxy::throwTypeError(); >+ return V8Proxy::throwTypeError("Type error"); > return constructWebGLArrayWithArrayBufferArgument<DataView, char>(args, &info, v8::kExternalByteArray, false); > } > >diff --git a/Source/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp b/Source/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp >index 87e311421877b5be20bad77ebcbf0d6f733d4704..80d2c3215dd88bd36c3e4e9dd2cefc43c9a9887c 100644 >--- a/Source/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp >@@ -66,7 +66,7 @@ void V8SVGLength::valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8:: > } > > if (!isUndefinedOrNull(value) && !value->IsNumber() && !value->IsBoolean()) { >- V8Proxy::throwTypeError(); >+ V8Proxy::throwTypeError("Type error"); > return; > } > >diff --git a/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp b/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp >index 47a32e593afd8f7d6fa0aff25bf29c48afb51b3e..5f15fa74f256f0af61857de5009f8770750a8510 100644 >--- a/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp >@@ -274,7 +274,7 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getAttachedShadersCallback(const > ExceptionCode ec = 0; > WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder()); > if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0])) { >- V8Proxy::throwTypeError(); >+ V8Proxy::throwTypeError("Type error"); > return notHandledByInterceptor(); > } > WebGLProgram* program = V8WebGLProgram::HasInstance(args[0]) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0; >@@ -357,7 +357,7 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getProgramParameterCallback(const > ExceptionCode ec = 0; > WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder()); > if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0])) { >- V8Proxy::throwTypeError(); >+ V8Proxy::throwTypeError("Type error"); > return notHandledByInterceptor(); > } > WebGLProgram* program = V8WebGLProgram::HasInstance(args[0]) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0; >@@ -386,7 +386,7 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getShaderParameterCallback(const > ExceptionCode ec = 0; > WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder()); > if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLShader::HasInstance(args[0])) { >- V8Proxy::throwTypeError(); >+ V8Proxy::throwTypeError("Type error"); > return notHandledByInterceptor(); > } > WebGLShader* shader = V8WebGLShader::HasInstance(args[0]) ? V8WebGLShader::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0; >@@ -429,13 +429,13 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getUniformCallback(const v8::Argu > ExceptionCode ec = 0; > WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder()); > if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0])) { >- V8Proxy::throwTypeError(); >+ V8Proxy::throwTypeError("Type error"); > return notHandledByInterceptor(); > } > WebGLProgram* program = V8WebGLProgram::HasInstance(args[0]) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0; > > if (args.Length() > 1 && !isUndefinedOrNull(args[1]) && !V8WebGLUniformLocation::HasInstance(args[1])) { >- V8Proxy::throwTypeError(); >+ V8Proxy::throwTypeError("Type error"); > return notHandledByInterceptor(); > } > bool ok = false; >@@ -505,7 +505,7 @@ static v8::Handle<v8::Value> vertexAttribAndUniformHelperf(const v8::Arguments& > index = toInt32(args[0]); > else { > if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0])) { >- V8Proxy::throwTypeError(); >+ V8Proxy::throwTypeError("Type error"); > return notHandledByInterceptor(); > } > location = toWebGLUniformLocation(args[0], ok); >@@ -534,7 +534,7 @@ static v8::Handle<v8::Value> vertexAttribAndUniformHelperf(const v8::Arguments& > } > > if (args[1].IsEmpty() || !args[1]->IsArray()) { >- V8Proxy::throwTypeError(); >+ V8Proxy::throwTypeError("Type error"); > return notHandledByInterceptor(); > } > v8::Handle<v8::Array> array = >@@ -581,7 +581,7 @@ static v8::Handle<v8::Value> uniformHelperi(const v8::Arguments& args, > > WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder()); > if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0])) { >- V8Proxy::throwTypeError(); >+ V8Proxy::throwTypeError("Type error"); > return notHandledByInterceptor(); > } > bool ok = false; >@@ -604,7 +604,7 @@ static v8::Handle<v8::Value> uniformHelperi(const v8::Arguments& args, > } > > if (args[1].IsEmpty() || !args[1]->IsArray()) { >- V8Proxy::throwTypeError(); >+ V8Proxy::throwTypeError("Type error"); > return notHandledByInterceptor(); > } > v8::Handle<v8::Array> array = >@@ -696,7 +696,7 @@ static v8::Handle<v8::Value> uniformMatrixHelper(const v8::Arguments& args, > WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder()); > > if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0])) { >- V8Proxy::throwTypeError(); >+ V8Proxy::throwTypeError("Type error"); > return notHandledByInterceptor(); > } > bool ok = false; >@@ -719,7 +719,7 @@ static v8::Handle<v8::Value> uniformMatrixHelper(const v8::Arguments& args, > } > > if (args[2].IsEmpty() || !args[2]->IsArray()) { >- V8Proxy::throwTypeError(); >+ V8Proxy::throwTypeError("Type error"); > return notHandledByInterceptor(); > } > v8::Handle<v8::Array> array =
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 86576
:
142150
|
142464