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 | |
87 v8::ArrayBuffer::Allocator* v8ArrayBufferAllocator(); | 83 v8::ArrayBuffer::Allocator* v8ArrayBufferAllocator(); |
88 | 84 |
89 inline v8::Handle<v8::Value> argumentOrNull(const v8::FunctionCallbackInfo<v8::V
alue>& info, int index) | 85 inline v8::Handle<v8::Value> argumentOrNull(const v8::FunctionCallbackInfo<v8::V
alue>& info, int index) |
90 { | 86 { |
91 return index >= info.Length() ? v8::Local<v8::Value>() : info[index]; | 87 return index >= info.Length() ? v8::Local<v8::Value>() : info[index]; |
92 } | 88 } |
93 | 89 |
94 template<typename CallbackInfo, typename V> | 90 template<typename CallbackInfo, typename V> |
95 inline void v8SetReturnValue(const CallbackInfo& info, V v) | 91 inline void v8SetReturnValue(const CallbackInfo& info, V v) |
96 { | 92 { |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 m_block.Reset(); | 999 m_block.Reset(); |
1004 } | 1000 } |
1005 | 1001 |
1006 private: | 1002 private: |
1007 v8::TryCatch& m_block; | 1003 v8::TryCatch& m_block; |
1008 }; | 1004 }; |
1009 | 1005 |
1010 } // namespace WebCore | 1006 } // namespace WebCore |
1011 | 1007 |
1012 #endif // V8Binding_h | 1008 #endif // V8Binding_h |
OLD | NEW |