Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
| 6 * | 6 * |
| 7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
| 8 * | 8 * |
| 9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
| 10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 class Maybe; | 88 class Maybe; |
| 89 class Name; | 89 class Name; |
| 90 class Number; | 90 class Number; |
| 91 class NumberObject; | 91 class NumberObject; |
| 92 class Object; | 92 class Object; |
| 93 class ObjectOperationDescriptor; | 93 class ObjectOperationDescriptor; |
| 94 class ObjectTemplate; | 94 class ObjectTemplate; |
| 95 class Platform; | 95 class Platform; |
| 96 class Primitive; | 96 class Primitive; |
| 97 class Promise; | 97 class Promise; |
| 98 class PropertyDescriptor; | |
| 98 class Proxy; | 99 class Proxy; |
| 99 class RawOperationDescriptor; | 100 class RawOperationDescriptor; |
| 100 class Script; | 101 class Script; |
| 101 class SharedArrayBuffer; | 102 class SharedArrayBuffer; |
| 102 class Signature; | 103 class Signature; |
| 103 class StartupData; | 104 class StartupData; |
| 104 class StackFrame; | 105 class StackFrame; |
| 105 class StackTrace; | 106 class StackTrace; |
| 106 class String; | 107 class String; |
| 107 class StringObject; | 108 class StringObject; |
| (...skipping 2578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2686 // Implements DefineOwnProperty. | 2687 // Implements DefineOwnProperty. |
| 2687 // | 2688 // |
| 2688 // In general, CreateDataProperty will be faster, however, does not allow | 2689 // In general, CreateDataProperty will be faster, however, does not allow |
| 2689 // for specifying attributes. | 2690 // for specifying attributes. |
| 2690 // | 2691 // |
| 2691 // Returns true on success. | 2692 // Returns true on success. |
| 2692 V8_WARN_UNUSED_RESULT Maybe<bool> DefineOwnProperty( | 2693 V8_WARN_UNUSED_RESULT Maybe<bool> DefineOwnProperty( |
| 2693 Local<Context> context, Local<Name> key, Local<Value> value, | 2694 Local<Context> context, Local<Name> key, Local<Value> value, |
| 2694 PropertyAttribute attributes = None); | 2695 PropertyAttribute attributes = None); |
| 2695 | 2696 |
| 2697 // Implements Object.DefineProperty(O, P, Attributes) as in ecma262 19.1.2.4. | |
| 2698 // | |
| 2699 // The defineProperty function is used to add an own property and/or | |
|
Toon Verwaest
2016/08/18 07:25:39
or. You can't add 'add' and 'update' a property :)
Franzi
2016/08/18 09:56:24
Done.
| |
| 2700 // update the attributes of an existing own property of an object. | |
| 2701 // | |
| 2702 // Both data and accessor descriptors can be used. | |
| 2703 // | |
| 2704 // In general, CreateDataProperty will be faster, however, does not allow | |
|
Toon Verwaest
2016/08/18 07:25:39
is faster
Franzi
2016/08/18 09:56:24
Done.
| |
| 2705 // for specifying attributes or an accessor descriptor. | |
| 2706 // | |
| 2707 // Returns true on success. | |
| 2708 V8_WARN_UNUSED_RESULT Maybe<bool> DefineProperty( | |
| 2709 Local<Context> context, Local<Name> key, | |
| 2710 const PropertyDescriptor* descriptor); | |
|
Toon Verwaest
2016/08/18 07:25:39
Perhaps this should be a reference? We'll probably
Franzi
2016/08/18 09:56:24
Done.
| |
| 2711 | |
| 2696 // Sets an own property on this object bypassing interceptors and | 2712 // Sets an own property on this object bypassing interceptors and |
| 2697 // overriding accessors or read-only properties. | 2713 // overriding accessors or read-only properties. |
| 2698 // | 2714 // |
| 2699 // Note that if the object has an interceptor the property will be set | 2715 // Note that if the object has an interceptor the property will be set |
| 2700 // locally, but since the interceptor takes precedence the local property | 2716 // locally, but since the interceptor takes precedence the local property |
| 2701 // will only be returned if the interceptor doesn't return a value. | 2717 // will only be returned if the interceptor doesn't return a value. |
| 2702 // | 2718 // |
| 2703 // Note also that this only works for named properties. | 2719 // Note also that this only works for named properties. |
| 2704 V8_DEPRECATED("Use CreateDataProperty / DefineOwnProperty", | 2720 V8_DEPRECATED("Use CreateDataProperty / DefineOwnProperty", |
| 2705 bool ForceSet(Local<Value> key, Local<Value> value, | 2721 bool ForceSet(Local<Value> key, Local<Value> value, |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3430 */ | 3446 */ |
| 3431 bool HasHandler(); | 3447 bool HasHandler(); |
| 3432 | 3448 |
| 3433 V8_INLINE static Promise* Cast(Value* obj); | 3449 V8_INLINE static Promise* Cast(Value* obj); |
| 3434 | 3450 |
| 3435 private: | 3451 private: |
| 3436 Promise(); | 3452 Promise(); |
| 3437 static void CheckCast(Value* obj); | 3453 static void CheckCast(Value* obj); |
| 3438 }; | 3454 }; |
| 3439 | 3455 |
| 3456 /** | |
| 3457 * Property Descriptor. | |
| 3458 */ | |
| 3459 class V8_EXPORT PropertyDescriptor { | |
| 3460 public: | |
| 3461 // GenericDescriptor | |
| 3462 PropertyDescriptor(bool enumerable = false, bool has_enumerable = false, | |
| 3463 bool configurable = false, bool has_configurable = false) | |
| 3464 : enumerable_(enumerable), | |
| 3465 has_enumerable_(has_enumerable), | |
| 3466 configurable_(configurable), | |
| 3467 has_configurable_(has_configurable) {} | |
| 3468 | |
| 3469 // DataDescriptor | |
| 3470 PropertyDescriptor(Local<Value> value, bool has_value, | |
| 3471 bool enumerable = false, bool has_enumerable = false, | |
| 3472 bool configurable = false, bool has_configurable = false, | |
| 3473 bool writable = false, bool has_writable = false) | |
| 3474 : value_(value), | |
| 3475 has_value_(has_value), | |
| 3476 enumerable_(enumerable), | |
| 3477 has_enumerable_(has_enumerable), | |
| 3478 configurable_(configurable), | |
| 3479 has_configurable_(has_configurable), | |
| 3480 writable_(writable), | |
| 3481 has_writable_(has_writable) {} | |
| 3482 | |
| 3483 // AccessorDescriptor | |
| 3484 PropertyDescriptor(Local<Function> get, bool has_get = false, | |
|
Toon Verwaest
2016/08/18 07:25:39
If we can get by without has_get etc, I'd prefer t
Franzi
2016/08/18 09:56:24
We need has_x() for all fields. We need to disting
| |
| 3485 Local<Function> set = Local<Function>(), | |
| 3486 bool has_set = false, bool enumerable = false, | |
| 3487 bool has_enumerable = false, bool configurable = false, | |
| 3488 bool has_configurable = false) | |
| 3489 : get_(get), | |
| 3490 has_get_(has_get), | |
| 3491 set_(set), | |
| 3492 has_set_(has_set), | |
| 3493 enumerable_(enumerable), | |
| 3494 has_enumerable_(has_enumerable), | |
| 3495 configurable_(configurable), | |
| 3496 has_configurable_(has_configurable) {} | |
| 3497 | |
| 3498 Local<Value> value() const { return value_; } | |
| 3499 bool has_value() const { return has_value_; } | |
| 3500 | |
| 3501 Local<Function> get() const { return get_; } | |
| 3502 bool has_get() const { return has_get_; } | |
| 3503 Local<Function> set() const { return set_; } | |
| 3504 bool has_set() const { return has_set_; } | |
| 3505 | |
| 3506 bool enumerable() const { return enumerable_; } | |
| 3507 bool has_enumerable() const { return has_enumerable_; } | |
| 3508 bool configurable() const { return configurable_; } | |
| 3509 bool has_configurable() const { return has_configurable_; } | |
| 3510 bool writable() const { return writable_; } | |
| 3511 bool has_writable() const { return has_writable_; } | |
| 3512 | |
| 3513 private: | |
| 3514 Local<Value> value_; | |
| 3515 bool has_value_ = false; | |
| 3516 | |
| 3517 Local<Function> get_; | |
| 3518 bool has_get_ = false; | |
| 3519 Local<Function> set_; | |
| 3520 bool has_set_ = false; | |
| 3521 | |
| 3522 bool enumerable_ = false; | |
| 3523 bool has_enumerable_ = false; | |
| 3524 bool configurable_ = false; | |
| 3525 bool has_configurable_ = false; | |
| 3526 bool writable_ = false; | |
| 3527 bool has_writable_ = false; | |
| 3528 }; | |
| 3440 | 3529 |
| 3441 /** | 3530 /** |
| 3442 * An instance of the built-in Proxy constructor (ECMA-262, 6th Edition, | 3531 * An instance of the built-in Proxy constructor (ECMA-262, 6th Edition, |
| 3443 * 26.2.1). | 3532 * 26.2.1). |
| 3444 */ | 3533 */ |
| 3445 class V8_EXPORT Proxy : public Object { | 3534 class V8_EXPORT Proxy : public Object { |
| 3446 public: | 3535 public: |
| 3447 Local<Object> GetTarget(); | 3536 Local<Object> GetTarget(); |
| 3448 Local<Value> GetHandler(); | 3537 Local<Value> GetHandler(); |
| 3449 bool IsRevoked(); | 3538 bool IsRevoked(); |
| (...skipping 5536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8986 */ | 9075 */ |
| 8987 | 9076 |
| 8988 | 9077 |
| 8989 } // namespace v8 | 9078 } // namespace v8 |
| 8990 | 9079 |
| 8991 | 9080 |
| 8992 #undef TYPE_CHECK | 9081 #undef TYPE_CHECK |
| 8993 | 9082 |
| 8994 | 9083 |
| 8995 #endif // INCLUDE_V8_H_ | 9084 #endif // INCLUDE_V8_H_ |
| OLD | NEW |