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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 class Uint32; | 93 class Uint32; |
94 class External; | 94 class External; |
95 class Primitive; | 95 class Primitive; |
96 class Boolean; | 96 class Boolean; |
97 class BooleanObject; | 97 class BooleanObject; |
98 class Integer; | 98 class Integer; |
99 class Function; | 99 class Function; |
100 class Date; | 100 class Date; |
101 class ImplementationUtilities; | 101 class ImplementationUtilities; |
102 class Signature; | 102 class Signature; |
103 class AccessorSignature; | |
103 template <class T> class Handle; | 104 template <class T> class Handle; |
104 template <class T> class Local; | 105 template <class T> class Local; |
105 template <class T> class Persistent; | 106 template <class T> class Persistent; |
106 class FunctionTemplate; | 107 class FunctionTemplate; |
107 class ObjectTemplate; | 108 class ObjectTemplate; |
108 class Data; | 109 class Data; |
109 class AccessorInfo; | 110 class AccessorInfo; |
110 class StackTrace; | 111 class StackTrace; |
111 class StackFrame; | 112 class StackFrame; |
112 class Isolate; | 113 class Isolate; |
(...skipping 2169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2282 */ | 2283 */ |
2283 bool HasInstance(Handle<Value> object); | 2284 bool HasInstance(Handle<Value> object); |
2284 | 2285 |
2285 private: | 2286 private: |
2286 FunctionTemplate(); | 2287 FunctionTemplate(); |
2287 void AddInstancePropertyAccessor(Handle<String> name, | 2288 void AddInstancePropertyAccessor(Handle<String> name, |
2288 AccessorGetter getter, | 2289 AccessorGetter getter, |
2289 AccessorSetter setter, | 2290 AccessorSetter setter, |
2290 Handle<Value> data, | 2291 Handle<Value> data, |
2291 AccessControl settings, | 2292 AccessControl settings, |
2292 PropertyAttribute attributes); | 2293 PropertyAttribute attributes, |
2294 Handle<AccessorSignature> signature); | |
2293 void SetNamedInstancePropertyHandler(NamedPropertyGetter getter, | 2295 void SetNamedInstancePropertyHandler(NamedPropertyGetter getter, |
2294 NamedPropertySetter setter, | 2296 NamedPropertySetter setter, |
2295 NamedPropertyQuery query, | 2297 NamedPropertyQuery query, |
2296 NamedPropertyDeleter remover, | 2298 NamedPropertyDeleter remover, |
2297 NamedPropertyEnumerator enumerator, | 2299 NamedPropertyEnumerator enumerator, |
2298 Handle<Value> data); | 2300 Handle<Value> data); |
2299 void SetIndexedInstancePropertyHandler(IndexedPropertyGetter getter, | 2301 void SetIndexedInstancePropertyHandler(IndexedPropertyGetter getter, |
2300 IndexedPropertySetter setter, | 2302 IndexedPropertySetter setter, |
2301 IndexedPropertyQuery query, | 2303 IndexedPropertyQuery query, |
2302 IndexedPropertyDeleter remover, | 2304 IndexedPropertyDeleter remover, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2340 * \param settings Access control settings for the accessor. This is a bit | 2342 * \param settings Access control settings for the accessor. This is a bit |
2341 * field consisting of one of more of | 2343 * field consisting of one of more of |
2342 * DEFAULT = 0, ALL_CAN_READ = 1, or ALL_CAN_WRITE = 2. | 2344 * DEFAULT = 0, ALL_CAN_READ = 1, or ALL_CAN_WRITE = 2. |
2343 * The default is to not allow cross-context access. | 2345 * The default is to not allow cross-context access. |
2344 * ALL_CAN_READ means that all cross-context reads are allowed. | 2346 * ALL_CAN_READ means that all cross-context reads are allowed. |
2345 * ALL_CAN_WRITE means that all cross-context writes are allowed. | 2347 * ALL_CAN_WRITE means that all cross-context writes are allowed. |
2346 * The combination ALL_CAN_READ | ALL_CAN_WRITE can be used to allow all | 2348 * The combination ALL_CAN_READ | ALL_CAN_WRITE can be used to allow all |
2347 * cross-context access. | 2349 * cross-context access. |
2348 * \param attribute The attributes of the property for which an accessor | 2350 * \param attribute The attributes of the property for which an accessor |
2349 * is added. | 2351 * is added. |
2352 * \param signature The signature describes valid receivers for the accessor | |
2353 * and is used to perform implicit instance checks against. If the receiver | |
danno
2012/06/06 09:32:31
nit: against them.
Michael Starzinger
2012/06/08 07:40:44
Done.
| |
2354 * is incompatible (i.e. is not an instance of the constructor as defined | |
2355 * by FunctionTemplate::HasInstance()), an implicit TypeError is thrown and | |
2356 * no callback is invoked. | |
2350 */ | 2357 */ |
2351 void SetAccessor(Handle<String> name, | 2358 void SetAccessor(Handle<String> name, |
2352 AccessorGetter getter, | 2359 AccessorGetter getter, |
2353 AccessorSetter setter = 0, | 2360 AccessorSetter setter = 0, |
2354 Handle<Value> data = Handle<Value>(), | 2361 Handle<Value> data = Handle<Value>(), |
2355 AccessControl settings = DEFAULT, | 2362 AccessControl settings = DEFAULT, |
2356 PropertyAttribute attribute = None); | 2363 PropertyAttribute attribute = None, |
2364 Handle<AccessorSignature> signature = | |
2365 Handle<AccessorSignature>()); | |
2357 | 2366 |
2358 /** | 2367 /** |
2359 * Sets a named property handler on the object template. | 2368 * Sets a named property handler on the object template. |
2360 * | 2369 * |
2361 * Whenever a named property is accessed on objects created from | 2370 * Whenever a named property is accessed on objects created from |
2362 * this object template, the provided callback is invoked instead of | 2371 * this object template, the provided callback is invoked instead of |
2363 * accessing the property directly on the JavaScript object. | 2372 * accessing the property directly on the JavaScript object. |
2364 * | 2373 * |
2365 * \param getter The callback to invoke when getting a property. | 2374 * \param getter The callback to invoke when getting a property. |
2366 * \param setter The callback to invoke when setting a property. | 2375 * \param setter The callback to invoke when setting a property. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2465 static Local<Signature> New(Handle<FunctionTemplate> receiver = | 2474 static Local<Signature> New(Handle<FunctionTemplate> receiver = |
2466 Handle<FunctionTemplate>(), | 2475 Handle<FunctionTemplate>(), |
2467 int argc = 0, | 2476 int argc = 0, |
2468 Handle<FunctionTemplate> argv[] = 0); | 2477 Handle<FunctionTemplate> argv[] = 0); |
2469 private: | 2478 private: |
2470 Signature(); | 2479 Signature(); |
2471 }; | 2480 }; |
2472 | 2481 |
2473 | 2482 |
2474 /** | 2483 /** |
2484 * An AccessorSignature specifies which receivers an accessor callback | |
2485 * can legally be called with. | |
danno
2012/06/06 09:32:31
how about: "An AccessorSignature specifies which r
Michael Starzinger
2012/06/08 07:40:44
Done. Also applied to "Signature" a few lines abov
| |
2486 */ | |
2487 class V8EXPORT AccessorSignature : public Data { | |
2488 public: | |
2489 static Local<AccessorSignature> New(Handle<FunctionTemplate> receiver = | |
2490 Handle<FunctionTemplate>()); | |
2491 private: | |
2492 AccessorSignature(); | |
2493 }; | |
2494 | |
2495 | |
2496 /** | |
2475 * A utility for determining the type of objects based on the template | 2497 * A utility for determining the type of objects based on the template |
2476 * they were constructed from. | 2498 * they were constructed from. |
2477 */ | 2499 */ |
2478 class V8EXPORT TypeSwitch : public Data { | 2500 class V8EXPORT TypeSwitch : public Data { |
2479 public: | 2501 public: |
2480 static Local<TypeSwitch> New(Handle<FunctionTemplate> type); | 2502 static Local<TypeSwitch> New(Handle<FunctionTemplate> type); |
2481 static Local<TypeSwitch> New(int argc, Handle<FunctionTemplate> types[]); | 2503 static Local<TypeSwitch> New(int argc, Handle<FunctionTemplate> types[]); |
2482 int match(Handle<Value> value); | 2504 int match(Handle<Value> value); |
2483 private: | 2505 private: |
2484 TypeSwitch(); | 2506 TypeSwitch(); |
(...skipping 1989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4474 | 4496 |
4475 | 4497 |
4476 } // namespace v8 | 4498 } // namespace v8 |
4477 | 4499 |
4478 | 4500 |
4479 #undef V8EXPORT | 4501 #undef V8EXPORT |
4480 #undef TYPE_CHECK | 4502 #undef TYPE_CHECK |
4481 | 4503 |
4482 | 4504 |
4483 #endif // V8_H_ | 4505 #endif // V8_H_ |
OLD | NEW |