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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 namespace WebCore { | 69 namespace WebCore { |
70 const WrapperTypeInfo V8TestCustomAccessors::wrapperTypeInfo = { gin::kEmbedderB
link, V8TestCustomAccessors::GetTemplate, V8TestCustomAccessors::derefObject, 0,
0, 0, V8TestCustomAccessors::installPerContextEnabledMethods, 0, WrapperTypeObj
ectPrototype }; | 70 const WrapperTypeInfo V8TestCustomAccessors::wrapperTypeInfo = { gin::kEmbedderB
link, V8TestCustomAccessors::GetTemplate, V8TestCustomAccessors::derefObject, 0,
0, 0, V8TestCustomAccessors::installPerContextEnabledMethods, 0, WrapperTypeObj
ectPrototype }; |
71 | 71 |
72 namespace TestCustomAccessorsV8Internal { | 72 namespace TestCustomAccessorsV8Internal { |
73 | 73 |
74 template <typename T> void V8_USE(T) { } | 74 template <typename T> void V8_USE(T) { } |
75 | 75 |
76 static void anotherFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 76 static void anotherFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
77 { | 77 { |
| 78 ExceptionState exceptionState(ExceptionState::ExecutionContext, "anotherFunc
tion", "TestCustomAccessors", info.Holder(), info.GetIsolate()); |
78 if (UNLIKELY(info.Length() < 1)) { | 79 if (UNLIKELY(info.Length() < 1)) { |
79 throwTypeError(ExceptionMessages::failedToExecute("anotherFunction", "Te
stCustomAccessors", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); | 80 throwTypeError(ExceptionMessages::failedToExecute("anotherFunction", "Te
stCustomAccessors", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); |
80 return; | 81 return; |
81 } | 82 } |
82 TestCustomAccessors* imp = V8TestCustomAccessors::toNative(info.Holder()); | 83 TestCustomAccessors* imp = V8TestCustomAccessors::toNative(info.Holder()); |
83 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); | 84 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
84 imp->anotherFunction(str); | 85 imp->anotherFunction(str); |
85 } | 86 } |
86 | 87 |
87 static void anotherFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 88 static void anotherFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 fromInternalPointer(object)->deref(); | 229 fromInternalPointer(object)->deref(); |
229 } | 230 } |
230 | 231 |
231 template<> | 232 template<> |
232 v8::Handle<v8::Value> toV8NoInline(TestCustomAccessors* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) | 233 v8::Handle<v8::Value> toV8NoInline(TestCustomAccessors* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) |
233 { | 234 { |
234 return toV8(impl, creationContext, isolate); | 235 return toV8(impl, creationContext, isolate); |
235 } | 236 } |
236 | 237 |
237 } // namespace WebCore | 238 } // namespace WebCore |
OLD | NEW |