OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Ericsson AB. All rights reserved. | 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 v8::Handle<v8::Value> throwTypeError(const String&, v8::Isolate*); | 73 v8::Handle<v8::Value> throwTypeError(const String&, v8::Isolate*); |
74 | 74 |
75 // Helpers for throwing JavaScript TypeErrors for arity mismatches. | 75 // Helpers for throwing JavaScript TypeErrors for arity mismatches. |
76 void throwArityTypeErrorForMethod(const char* method, const char* type, const ch
ar* valid, unsigned provided, v8::Isolate*); | 76 void throwArityTypeErrorForMethod(const char* method, const char* type, const ch
ar* valid, unsigned provided, v8::Isolate*); |
77 void throwArityTypeErrorForConstructor(const char* type, const char* valid, unsi
gned provided, v8::Isolate*); | 77 void throwArityTypeErrorForConstructor(const char* type, const char* valid, unsi
gned provided, v8::Isolate*); |
78 void throwArityTypeError(ExceptionState&, const char* valid, unsigned provided); | 78 void throwArityTypeError(ExceptionState&, const char* valid, unsigned provided); |
79 void throwMinimumArityTypeErrorForMethod(const char* method, const char* type, u
nsigned expected, unsigned providedLeastNumMandatoryParams, v8::Isolate*); | 79 void throwMinimumArityTypeErrorForMethod(const char* method, const char* type, u
nsigned expected, unsigned providedLeastNumMandatoryParams, v8::Isolate*); |
80 void throwMinimumArityTypeErrorForConstructor(const char* type, unsigned expecte
d, unsigned providedLeastNumMandatoryParams, v8::Isolate*); | 80 void throwMinimumArityTypeErrorForConstructor(const char* type, unsigned expecte
d, unsigned providedLeastNumMandatoryParams, v8::Isolate*); |
81 void throwMinimumArityTypeError(ExceptionState&, unsigned expected, unsigned pro
videdLeastNumMandatoryParams); | 81 void throwMinimumArityTypeError(ExceptionState&, unsigned expected, unsigned pro
videdLeastNumMandatoryParams); |
82 | 82 |
| 83 // Returns false if the callback threw an exception, true otherwise. |
| 84 bool invokeCallback(ScriptState*, v8::Local<v8::Function> callback, int argc, v8
::Handle<v8::Value> argv[]); |
| 85 bool invokeCallback(ScriptState*, v8::Local<v8::Function> callback, v8::Handle<v
8::Value> thisValue, int argc, v8::Handle<v8::Value> argv[]); |
| 86 |
83 v8::ArrayBuffer::Allocator* v8ArrayBufferAllocator(); | 87 v8::ArrayBuffer::Allocator* v8ArrayBufferAllocator(); |
84 | 88 |
85 inline v8::Handle<v8::Value> argumentOrNull(const v8::FunctionCallbackInfo<v8::V
alue>& info, int index) | 89 inline v8::Handle<v8::Value> argumentOrNull(const v8::FunctionCallbackInfo<v8::V
alue>& info, int index) |
86 { | 90 { |
87 return index >= info.Length() ? v8::Local<v8::Value>() : info[index]; | 91 return index >= info.Length() ? v8::Local<v8::Value>() : info[index]; |
88 } | 92 } |
89 | 93 |
90 template<typename CallbackInfo, typename V> | 94 template<typename CallbackInfo, typename V> |
91 inline void v8SetReturnValue(const CallbackInfo& info, V v) | 95 inline void v8SetReturnValue(const CallbackInfo& info, V v) |
92 { | 96 { |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 m_block.Reset(); | 1003 m_block.Reset(); |
1000 } | 1004 } |
1001 | 1005 |
1002 private: | 1006 private: |
1003 v8::TryCatch& m_block; | 1007 v8::TryCatch& m_block; |
1004 }; | 1008 }; |
1005 | 1009 |
1006 } // namespace WebCore | 1010 } // namespace WebCore |
1007 | 1011 |
1008 #endif // V8Binding_h | 1012 #endif // V8Binding_h |
OLD | NEW |