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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceConstructor.cpp

Issue 114363002: Structured cloning: improve DataCloneError reporting. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + reset V8TestInterfaceConstructor.cpp result Created 7 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
89 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) 89 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
90 { 90 {
91 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 91 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
92 V8TRYCATCH_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue( ))); 92 V8TRYCATCH_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue( )));
93 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArg, info[1]) ; 93 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArg, info[1]) ;
94 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE mpty::hasInstance(info[2], info.GetIsolate(), worldType(info.GetIsolate())) ? V8 TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0); 94 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE mpty::hasInstance(info[2], info.GetIsolate(), worldType(info.GetIsolate())) ? V8 TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0);
95 V8TRYCATCH_VOID(Dictionary, dictionaryArg, Dictionary(info[3], info.GetIsola te())); 95 V8TRYCATCH_VOID(Dictionary, dictionaryArg, Dictionary(info[3], info.GetIsola te()));
96 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) { 96 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) {
97 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstr uctor", "parameter 4 ('dictionaryArg') is not an object."), info.GetIsolate()); 97 exceptionState.throwTypeError("parameter 4 ('dictionaryArg') is not an o bject.");
98 exceptionState.throwIfNeeded();
98 return; 99 return;
99 } 100 }
100 V8TRYCATCH_VOID(Vector<String>, sequenceStringArg, toNativeArray<String>(inf o[4], 5, info.GetIsolate())); 101 V8TRYCATCH_VOID(Vector<String>, sequenceStringArg, toNativeArray<String>(inf o[4], 5, info.GetIsolate()));
101 V8TRYCATCH_VOID(Dictionary, optionalDictionaryArg, Dictionary(info[5], info. GetIsolate())); 102 V8TRYCATCH_VOID(Dictionary, optionalDictionaryArg, Dictionary(info[5], info. GetIsolate()));
102 if (!optionalDictionaryArg.isUndefinedOrNull() && !optionalDictionaryArg.isO bject()) { 103 if (!optionalDictionaryArg.isUndefinedOrNull() && !optionalDictionaryArg.isO bject()) {
103 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstr uctor", "parameter 6 ('optionalDictionaryArg') is not an object."), info.GetIsol ate()); 104 exceptionState.throwTypeError("parameter 6 ('optionalDictionaryArg') is not an object.");
105 exceptionState.throwIfNeeded();
104 return; 106 return;
105 } 107 }
106 V8TRYCATCH_VOID(TestInterfaceEmpty*, optionalTestInterfaceEmptyArg, V8TestIn terfaceEmpty::hasInstance(info[6], info.GetIsolate(), worldType(info.GetIsolate( ))) ? V8TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[6])) : 0) ; 108 V8TRYCATCH_VOID(TestInterfaceEmpty*, optionalTestInterfaceEmptyArg, V8TestIn terfaceEmpty::hasInstance(info[6], info.GetIsolate(), worldType(info.GetIsolate( ))) ? V8TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[6])) : 0) ;
107 ExecutionContext* context = getExecutionContext(); 109 ExecutionContext* context = getExecutionContext();
108 Document& document = *toDocument(getExecutionContext()); 110 Document& document = *toDocument(getExecutionContext());
109 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con text, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionaryArg, sequ enceStringArg, optionalDictionaryArg, optionalTestInterfaceEmptyArg, exceptionSt ate); 111 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con text, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionaryArg, sequ enceStringArg, optionalDictionaryArg, optionalTestInterfaceEmptyArg, exceptionSt ate);
110 v8::Handle<v8::Object> wrapper = info.Holder(); 112 v8::Handle<v8::Object> wrapper = info.Holder();
111 if (exceptionState.throwIfNeeded()) 113 if (exceptionState.throwIfNeeded())
112 return; 114 return;
113 115
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 fromInternalPointer(object)->deref(); 221 fromInternalPointer(object)->deref();
220 } 222 }
221 223
222 template<> 224 template<>
223 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate) 225 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate)
224 { 226 {
225 return toV8(impl, creationContext, isolate); 227 return toV8(impl, creationContext, isolate);
226 } 228 }
227 229
228 } // namespace WebCore 230 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.cpp ('k') | Source/bindings/tests/results/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698