Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: Source/bindings/tests/results/core/V8TestObject.cpp

Issue 568703002: IDL: Values for dictionaries should be a object, null or undefined (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove assertion and added a guard Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/tests/results/core/V8TestObject.cpp
diff --git a/Source/bindings/tests/results/core/V8TestObject.cpp b/Source/bindings/tests/results/core/V8TestObject.cpp
index c6898b1a458f067c0f20d2435d3e959da1ca108b..1eab975a68a54b1de54163f7f3fe07fff03bda39 100644
--- a/Source/bindings/tests/results/core/V8TestObject.cpp
+++ b/Source/bindings/tests/results/core/V8TestObject.cpp
@@ -6619,7 +6619,7 @@ static void promiseMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
V8RethrowTryCatchScope rethrow(block);
TONATIVE_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(arg1, toInt32(info[0], exceptionState), exceptionState, info, ScriptState::current(info.GetIsolate()));
TONATIVE_VOID_PROMISE_INTERNAL(arg2, Dictionary(info[1], info.GetIsolate()), info);
- if (!arg2.isUndefinedOrNull() && !arg2.isObject()) {
+ if (!isUndefinedOrNull(info[1]) && !info[1]->IsObject()) {
exceptionState.throwTypeError("parameter 2 ('arg2') is not an object.");
v8SetReturnValue(info, exceptionState.reject(ScriptState::current(info.GetIsolate())).v8Value());
return;
@@ -6649,7 +6649,7 @@ static void promiseMethodWithoutExceptionStateMethod(const v8::FunctionCallbackI
v8::TryCatch block;
V8RethrowTryCatchScope rethrow(block);
TONATIVE_VOID_PROMISE_INTERNAL(arg1, Dictionary(info[0], info.GetIsolate()), info);
- if (!arg1.isUndefinedOrNull() && !arg1.isObject()) {
+ if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) {
v8SetReturnValue(info, ScriptPromise::rejectRaw(info.GetIsolate(), V8ThrowException::createTypeError(ExceptionMessages::failedToExecute("promiseMethodWithoutExceptionState", "TestObject", "parameter 1 ('arg1') is not an object."), info.GetIsolate())));
return;
}
@@ -6702,7 +6702,7 @@ static void voidMethodDictionaryArgMethod(const v8::FunctionCallbackInfo<v8::Val
v8::TryCatch block;
V8RethrowTryCatchScope rethrow(block);
TONATIVE_VOID_INTERNAL(dictionaryArg, Dictionary(info[0], info.GetIsolate()));
- if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) {
+ if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) {
V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodDictionaryArg", "TestObject", "parameter 1 ('dictionaryArg') is not an object."), info.GetIsolate());
return;
}
@@ -7188,7 +7188,7 @@ static void voidMethodOptionalDictionaryArgMethod(const v8::FunctionCallbackInfo
v8::TryCatch block;
V8RethrowTryCatchScope rethrow(block);
TONATIVE_VOID_INTERNAL(optionalDictionaryArg, Dictionary(info[0], info.GetIsolate()));
- if (!optionalDictionaryArg.isUndefinedOrNull() && !optionalDictionaryArg.isObject()) {
+ if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) {
V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodOptionalDictionaryArg", "TestObject", "parameter 1 ('optionalDictionaryArg') is not an object."), info.GetIsolate());
return;
}
@@ -8112,6 +8112,11 @@ static void overloadedMethodJ2Method(const v8::FunctionCallbackInfo<v8::Value>&
{
if (!info[0]->IsUndefined()) {
TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(testDictionaryArg, V8TestDictionary::toImpl(info.GetIsolate(), info[0], exceptionState), exceptionState);
+ if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) {
+ exceptionState.throwTypeError("parameter 1 ('testDictionaryArg') is not an object.");
+ exceptionState.throwIfNeeded();
+ return;
+ }
} else {
testDictionaryArg = TestDictionary::create();
}

Powered by Google App Engine
This is Rietveld 408576698