| 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 { | 319 { |
| 320 ExceptionState exceptionState(ExceptionState::ExecutionContext, "supplementa
lMethod2", "SupportTestInterface", info.Holder(), info.GetIsolate()); | 320 ExceptionState exceptionState(ExceptionState::ExecutionContext, "supplementa
lMethod2", "SupportTestInterface", info.Holder(), info.GetIsolate()); |
| 321 if (UNLIKELY(info.Length() < 2)) { | 321 if (UNLIKELY(info.Length() < 2)) { |
| 322 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 322 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
| 323 exceptionState.throwIfNeeded(); | 323 exceptionState.throwIfNeeded(); |
| 324 return; | 324 return; |
| 325 } | 325 } |
| 326 SupportTestInterface* imp = V8SupportTestInterface::toNative(info.Holder()); | 326 SupportTestInterface* imp = V8SupportTestInterface::toNative(info.Holder()); |
| 327 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 327 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 328 if (info.Length() <= 1 || !info[1]->IsFunction()) { | 328 if (info.Length() <= 1 || !info[1]->IsFunction()) { |
| 329 throwTypeError(ExceptionMessages::failedToExecute("supplementalMethod2",
"SupportTestInterface", "The callback provided as parameter 2 is not a function
."), info.GetIsolate()); | 329 exceptionState.throwTypeError("The callback provided as parameter 2 is n
ot a function."); |
| 330 exceptionState.throwIfNeeded(); |
| 330 return; | 331 return; |
| 331 } | 332 } |
| 332 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[1]), getExecutionContext()); | 333 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[1]), getExecutionContext()); |
| 333 ExecutionContext* scriptContext = getExecutionContext(); | 334 ExecutionContext* scriptContext = getExecutionContext(); |
| 334 RefPtr<TestObj> result = SupportTestPartialInterface::supplementalMethod2(sc
riptContext, imp, strArg, objArg.release(), exceptionState); | 335 RefPtr<TestObj> result = SupportTestPartialInterface::supplementalMethod2(sc
riptContext, imp, strArg, objArg.release(), exceptionState); |
| 335 if (exceptionState.throwIfNeeded()) | 336 if (exceptionState.throwIfNeeded()) |
| 336 return; | 337 return; |
| 337 v8SetReturnValue(info, result.release()); | 338 v8SetReturnValue(info, result.release()); |
| 338 } | 339 } |
| 339 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 340 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 fromInternalPointer(object)->deref(); | 505 fromInternalPointer(object)->deref(); |
| 505 } | 506 } |
| 506 | 507 |
| 507 template<> | 508 template<> |
| 508 v8::Handle<v8::Value> toV8NoInline(SupportTestInterface* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) | 509 v8::Handle<v8::Value> toV8NoInline(SupportTestInterface* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) |
| 509 { | 510 { |
| 510 return toV8(impl, creationContext, isolate); | 511 return toV8(impl, creationContext, isolate); |
| 511 } | 512 } |
| 512 | 513 |
| 513 } // namespace WebCore | 514 } // namespace WebCore |
| OLD | NEW |