| OLD | NEW |
| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 if (UNLIKELY(info.Length() < 5)) { | 77 if (UNLIKELY(info.Length() < 5)) { |
| 78 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestIn
terfaceConstructor", ExceptionMessages::notEnoughArguments(5, info.Length())), i
nfo.GetIsolate()); | 78 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestIn
terfaceConstructor", ExceptionMessages::notEnoughArguments(5, info.Length())), i
nfo.GetIsolate()); |
| 79 return; | 79 return; |
| 80 } | 80 } |
| 81 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); | 81 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); |
| 82 V8TRYCATCH_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue(
))); | 82 V8TRYCATCH_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue(
))); |
| 83 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArg, info[1])
; | 83 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArg, info[1])
; |
| 84 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); | 84 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); |
| 85 V8TRYCATCH_VOID(Dictionary, dictionaryArg, Dictionary(info[3], info.GetIsola
te())); | 85 V8TRYCATCH_VOID(Dictionary, dictionaryArg, Dictionary(info[3], info.GetIsola
te())); |
| 86 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) { | 86 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) { |
| 87 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstr
uctor", "parameter 4 ('dictionaryArg') is not an object."), info.GetIsolate()); | 87 exceptionState.throwTypeError("parameter 4 ('dictionaryArg') is not an o
bject."); |
| 88 exceptionState.throwIfNeeded(); |
| 88 return; | 89 return; |
| 89 } | 90 } |
| 90 V8TRYCATCH_VOID(Vector<String>, sequenceStringArg, toNativeArray<String>(inf
o[4], 5, info.GetIsolate())); | 91 V8TRYCATCH_VOID(Vector<String>, sequenceStringArg, toNativeArray<String>(inf
o[4], 5, info.GetIsolate())); |
| 91 ExecutionContext* context = getExecutionContext(); | 92 ExecutionContext* context = getExecutionContext(); |
| 92 Document& document = *toDocument(getExecutionContext()); | 93 Document& document = *toDocument(getExecutionContext()); |
| 93 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con
text, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionaryArg, sequ
enceStringArg, exceptionState); | 94 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con
text, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionaryArg, sequ
enceStringArg, exceptionState); |
| 94 v8::Handle<v8::Object> wrapper = info.Holder(); | 95 v8::Handle<v8::Object> wrapper = info.Holder(); |
| 95 if (exceptionState.throwIfNeeded()) | 96 if (exceptionState.throwIfNeeded()) |
| 96 return; | 97 return; |
| 97 | 98 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 fromInternalPointer(object)->deref(); | 191 fromInternalPointer(object)->deref(); |
| 191 } | 192 } |
| 192 | 193 |
| 193 template<> | 194 template<> |
| 194 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) | 195 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) |
| 195 { | 196 { |
| 196 return toV8(impl, creationContext, isolate); | 197 return toV8(impl, creationContext, isolate); |
| 197 } | 198 } |
| 198 | 199 |
| 199 } // namespace WebCore | 200 } // namespace WebCore |
| OLD | NEW |