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

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: 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
« no previous file with comments | « Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c0bdde3bfa63f11275745003b1933d902542a202 100644
--- a/Source/bindings/tests/results/core/V8TestObject.cpp
+++ b/Source/bindings/tests/results/core/V8TestObject.cpp
@@ -6618,12 +6618,12 @@ static void promiseMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
v8::TryCatch block;
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;
}
+ TONATIVE_VOID_PROMISE_INTERNAL(arg2, Dictionary(info[1], info.GetIsolate()), info);
TOSTRING_VOID_PROMISE_INTERNAL(arg3, info[2], info);
TONATIVE_VOID_PROMISE_INTERNAL(variadic, toImplArguments<String>(info, 3), info);
}
@@ -6648,11 +6648,11 @@ 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;
}
+ TONATIVE_VOID_PROMISE_INTERNAL(arg1, Dictionary(info[0], info.GetIsolate()), info);
}
v8SetReturnValue(info, impl->promiseMethodWithoutExceptionState(arg1).v8Value());
}
@@ -6701,11 +6701,11 @@ 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;
}
+ TONATIVE_VOID_INTERNAL(dictionaryArg, Dictionary(info[0], info.GetIsolate()));
}
impl->voidMethodDictionaryArg(dictionaryArg);
}
@@ -7187,11 +7187,11 @@ 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;
}
+ TONATIVE_VOID_INTERNAL(optionalDictionaryArg, Dictionary(info[0], info.GetIsolate()));
}
impl->voidMethodOptionalDictionaryArg(optionalDictionaryArg);
}
@@ -8111,6 +8111,11 @@ static void overloadedMethodJ2Method(const v8::FunctionCallbackInfo<v8::Value>&
TestDictionary* testDictionaryArg;
{
if (!info[0]->IsUndefined()) {
+ if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) {
+ exceptionState.throwTypeError("parameter 1 ('testDictionaryArg') is not an object.");
+ exceptionState.throwIfNeeded();
+ return;
+ }
TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(testDictionaryArg, V8TestDictionary::toImpl(info.GetIsolate(), info[0], exceptionState), exceptionState);
} else {
testDictionaryArg = TestDictionary::create();
« no previous file with comments | « Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698