OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2354 */ | 2354 */ |
2355 static Local<Array> New(int length = 0); | 2355 static Local<Array> New(int length = 0); |
2356 | 2356 |
2357 V8_INLINE(static Array* Cast(Value* obj)); | 2357 V8_INLINE(static Array* Cast(Value* obj)); |
2358 private: | 2358 private: |
2359 Array(); | 2359 Array(); |
2360 static void CheckCast(Value* obj); | 2360 static void CheckCast(Value* obj); |
2361 }; | 2361 }; |
2362 | 2362 |
2363 | 2363 |
2364 typedef void (*FunctionCallback)(const FunctionCallbackInfo<Value>& info); | |
2365 | |
2366 | |
2364 /** | 2367 /** |
2365 * A JavaScript function object (ECMA-262, 15.3). | 2368 * A JavaScript function object (ECMA-262, 15.3). |
2366 */ | 2369 */ |
2367 class V8_EXPORT Function : public Object { | 2370 class V8_EXPORT Function : public Object { |
2368 public: | 2371 public: |
2372 // Create a function in the current execution context | |
Michael Starzinger
2013/09/06 14:41:50
nit: Doxygen comment style.
| |
2373 // for a given FunctionCallback. | |
2374 static Local<Function> New(Isolate* isolate, | |
2375 FunctionCallback callback, | |
2376 Local<Value> data = Local<Value>(), | |
2377 int length = 0); | |
2378 | |
2369 Local<Object> NewInstance() const; | 2379 Local<Object> NewInstance() const; |
2370 Local<Object> NewInstance(int argc, Handle<Value> argv[]) const; | 2380 Local<Object> NewInstance(int argc, Handle<Value> argv[]) const; |
2371 Local<Value> Call(Handle<Object> recv, int argc, Handle<Value> argv[]); | 2381 Local<Value> Call(Handle<Object> recv, int argc, Handle<Value> argv[]); |
2372 void SetName(Handle<String> name); | 2382 void SetName(Handle<String> name); |
2373 Handle<Value> GetName() const; | 2383 Handle<Value> GetName() const; |
2374 | 2384 |
2375 /** | 2385 /** |
2376 * Name inferred from variable or property assignment of this function. | 2386 * Name inferred from variable or property assignment of this function. |
2377 * Used to facilitate debugging and profiling of JavaScript code written | 2387 * Used to facilitate debugging and profiling of JavaScript code written |
2378 * in an OO style, where many functions are anonymous but are assigned | 2388 * in an OO style, where many functions are anonymous but are assigned |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3133 static const int kReturnValueIndex = -3; | 3143 static const int kReturnValueIndex = -3; |
3134 static const int kReturnValueDefaultValueIndex = -4; | 3144 static const int kReturnValueDefaultValueIndex = -4; |
3135 static const int kIsolateIndex = -5; | 3145 static const int kIsolateIndex = -5; |
3136 | 3146 |
3137 V8_INLINE(PropertyCallbackInfo(internal::Object** args)) | 3147 V8_INLINE(PropertyCallbackInfo(internal::Object** args)) |
3138 : args_(args) { } | 3148 : args_(args) { } |
3139 internal::Object** args_; | 3149 internal::Object** args_; |
3140 }; | 3150 }; |
3141 | 3151 |
3142 | 3152 |
3143 typedef void (*FunctionCallback)(const FunctionCallbackInfo<Value>& info); | |
3144 | |
3145 /** | 3153 /** |
3146 * NamedProperty[Getter|Setter] are used as interceptors on object. | 3154 * NamedProperty[Getter|Setter] are used as interceptors on object. |
3147 * See ObjectTemplate::SetNamedPropertyHandler. | 3155 * See ObjectTemplate::SetNamedPropertyHandler. |
3148 */ | 3156 */ |
3149 typedef void (*NamedPropertyGetterCallback)( | 3157 typedef void (*NamedPropertyGetterCallback)( |
3150 Local<String> property, | 3158 Local<String> property, |
3151 const PropertyCallbackInfo<Value>& info); | 3159 const PropertyCallbackInfo<Value>& info); |
3152 | 3160 |
3153 | 3161 |
3154 /** | 3162 /** |
(...skipping 3345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6500 */ | 6508 */ |
6501 | 6509 |
6502 | 6510 |
6503 } // namespace v8 | 6511 } // namespace v8 |
6504 | 6512 |
6505 | 6513 |
6506 #undef TYPE_CHECK | 6514 #undef TYPE_CHECK |
6507 | 6515 |
6508 | 6516 |
6509 #endif // V8_H_ | 6517 #endif // V8_H_ |
OLD | NEW |