+2012-05-22 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Replace 'throwError(); return Undefined();' with 'return throwError()'
+ https://bugs.webkit.org/show_bug.cgi?id=87079
+
+ Reviewed by Adam Barth.
+
+ This patch replaces
+
+ throwError();
+ return v8::Undefined();
+
+ with
+
+ return throwError();
+
+ No tests. No change in behavior.
+
+ * bindings/v8/DateExtension.cpp:
+ (WebCore::DateExtension::OnSleepDetected):
+ * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+ (WebCore::V8HTMLDocument::openCallback):
+ * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+ (WebCore::V8InjectedScriptHost::inspectedObjectCallback):
+ * bindings/v8/custom/V8SQLResultSetRowListCustom.cpp:
+ (WebCore::V8SQLResultSetRowList::itemCallback):
+ * 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-22 Kenneth Russell <kbr@google.com>
Must set/reset pixel unpack alignment to 1 during texSubImage2D
{
INC_STATS("DOM.SQLResultSetRowList.item()");
- if (args.Length() == 0) {
- V8Proxy::throwError(V8Proxy::SyntaxError, "Item index is required.", args.GetIsolate());
- return v8::Undefined();
- }
+ if (!args.Length())
+ return V8Proxy::throwError(V8Proxy::SyntaxError, "Item index is required.", args.GetIsolate());
- if (!args[0]->IsNumber()) {
- V8Proxy::throwTypeError("Item index must be a number.");
- return v8::Undefined();
- }
+ if (!args[0]->IsNumber())
+ return V8Proxy::throwTypeError("Item index must be a number.");
SQLResultSetRowList* rowList = V8SQLResultSetRowList::toNative(args.Holder());
unsigned long index = args[0]->IntegerValue();
- if (index >= rowList->length()) {
- V8Proxy::throwError(V8Proxy::RangeError, "Item index is out of range.", args.GetIsolate());
- return v8::Undefined();
- }
+ if (index >= rowList->length())
+ return V8Proxy::throwError(V8Proxy::RangeError, "Item index is out of range.", args.GetIsolate());
v8::Local<v8::Object> item = v8::Object::New();
unsigned numColumns = rowList->columnNames().size();
ExceptionCode ec = 0;
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
- if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0])) {
- V8Proxy::throwTypeError();
- return v8::Handle<v8::Value>();
- }
+ if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0]))
+ return V8Proxy::throwTypeError();
WebGLProgram* program = V8WebGLProgram::HasInstance(args[0]) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
Vector<RefPtr<WebGLShader> > shaders;
bool succeed = context->getAttachedShaders(program, shaders, ec);
ExceptionCode ec = 0;
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
- if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0])) {
- V8Proxy::throwTypeError();
- return v8::Handle<v8::Value>();
- }
+ if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0]))
+ return V8Proxy::throwTypeError();
WebGLProgram* program = V8WebGLProgram::HasInstance(args[0]) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
unsigned pname = toInt32(args[1]);
WebGLGetInfo info = context->getProgramParameter(program, pname, ec);
ExceptionCode ec = 0;
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
- if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLShader::HasInstance(args[0])) {
- V8Proxy::throwTypeError();
- return v8::Handle<v8::Value>();
- }
+ if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLShader::HasInstance(args[0]))
+ return V8Proxy::throwTypeError();
WebGLShader* shader = V8WebGLShader::HasInstance(args[0]) ? V8WebGLShader::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
unsigned pname = toInt32(args[1]);
WebGLGetInfo info = context->getShaderParameter(shader, pname, ec);
ExceptionCode ec = 0;
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
- if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0])) {
- V8Proxy::throwTypeError();
- return v8::Handle<v8::Value>();
- }
+ if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0]))
+ return V8Proxy::throwTypeError();
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();
- return v8::Handle<v8::Value>();
- }
+ if (args.Length() > 1 && !isUndefinedOrNull(args[1]) && !V8WebGLUniformLocation::HasInstance(args[1]))
+ return V8Proxy::throwTypeError();
bool ok = false;
WebGLUniformLocation* location = toWebGLUniformLocation(args[1], ok);
if (isFunctionToCallForAttribute(functionToCall))
index = toInt32(args[0]);
else {
- if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0])) {
- V8Proxy::throwTypeError();
- return v8::Handle<v8::Value>();
- }
+ if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0]))
+ return V8Proxy::throwTypeError();
location = toWebGLUniformLocation(args[0], ok);
}
return v8::Undefined();
}
- if (args[1].IsEmpty() || !args[1]->IsArray()) {
- V8Proxy::throwTypeError();
- return v8::Handle<v8::Value>();
- }
+ if (args[1].IsEmpty() || !args[1]->IsArray())
+ return V8Proxy::throwTypeError();
v8::Handle<v8::Array> array =
v8::Local<v8::Array>::Cast(args[1]);
uint32_t len = array->Length();
return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
- if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0])) {
- V8Proxy::throwTypeError();
- return v8::Handle<v8::Value>();
- }
+ if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0]))
+ return V8Proxy::throwTypeError();
bool ok = false;
WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok);
return v8::Undefined();
}
- if (args[1].IsEmpty() || !args[1]->IsArray()) {
- V8Proxy::throwTypeError();
- return v8::Handle<v8::Value>();
- }
+ if (args[1].IsEmpty() || !args[1]->IsArray())
+ return V8Proxy::throwTypeError();
v8::Handle<v8::Array> array =
v8::Local<v8::Array>::Cast(args[1]);
uint32_t len = array->Length();
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
- if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0])) {
- V8Proxy::throwTypeError();
- return v8::Handle<v8::Value>();
- }
+ if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0]))
+ return V8Proxy::throwTypeError();
bool ok = false;
WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok);
return v8::Undefined();
}
- if (args[2].IsEmpty() || !args[2]->IsArray()) {
- V8Proxy::throwTypeError();
- return v8::Handle<v8::Value>();
- }
+ if (args[2].IsEmpty() || !args[2]->IsArray())
+ return V8Proxy::throwTypeError();
v8::Handle<v8::Array> array =
v8::Local<v8::Array>::Cast(args[2]);
uint32_t len = array->Length();