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

Unified Diff: Source/bindings/tests/results/core/V8TestInterfaceConstructor2.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
Index: Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp
diff --git a/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp b/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp
index 4cbc3cbace99d8e096903fe8fb4d5fa52326997a..fa4773b24092839d75d7565ccc0c35a0c795cff0 100644
--- a/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp
+++ b/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp
@@ -52,11 +52,11 @@ static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
{
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::failedToConstruct("TestInterfaceConstructor2", "parameter 1 ('dictionaryArg') is not an object."), info.GetIsolate());
return;
}
+ TONATIVE_VOID_INTERNAL(dictionaryArg, Dictionary(info[0], info.GetIsolate()));
}
RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(dictionaryArg);
v8::Handle<v8::Object> wrapper = info.Holder();
@@ -84,12 +84,12 @@ static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info)
} else {
defaultNullStringOptionalStringArg = nullptr;
}
- TONATIVE_VOID_INTERNAL(defaultUndefinedOptionalDictionaryArg, Dictionary(info[4], info.GetIsolate()));
- if (!defaultUndefinedOptionalDictionaryArg.isUndefinedOrNull() && !defaultUndefinedOptionalDictionaryArg.isObject()) {
+ if (!isUndefinedOrNull(info[4]) && !info[4]->IsObject()) {
exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptionalDictionaryArg') is not an object.");
exceptionState.throwIfNeeded();
return;
}
+ TONATIVE_VOID_INTERNAL(defaultUndefinedOptionalDictionaryArg, Dictionary(info[4], info.GetIsolate()));
if (UNLIKELY(info.Length() <= 5)) {
RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(testInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullStringOptionalStringArg, defaultUndefinedOptionalDictionaryArg);
v8::Handle<v8::Object> wrapper = info.Holder();
« no previous file with comments | « Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp ('k') | Source/bindings/tests/results/core/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698