OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef V8_PROPERTY_DESCRIPTOR_H_ | 5 #ifndef V8_PROPERTY_DESCRIPTOR_H_ |
6 #define V8_PROPERTY_DESCRIPTOR_H_ | 6 #define V8_PROPERTY_DESCRIPTOR_H_ |
7 | 7 |
8 | 8 |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 #include "src/property-details.h" | 10 #include "src/property-details.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // ES6 6.2.4.6 | 51 // ES6 6.2.4.6 |
52 static void CompletePropertyDescriptor(Isolate* isolate, | 52 static void CompletePropertyDescriptor(Isolate* isolate, |
53 PropertyDescriptor* desc); | 53 PropertyDescriptor* desc); |
54 | 54 |
55 bool is_empty() const { | 55 bool is_empty() const { |
56 return !has_enumerable() && !has_configurable() && !has_writable() && | 56 return !has_enumerable() && !has_configurable() && !has_writable() && |
57 !has_value() && !has_get() && !has_set(); | 57 !has_value() && !has_get() && !has_set(); |
58 } | 58 } |
59 | 59 |
| 60 bool IsRegularAccessorProperty() const { |
| 61 return has_configurable() && has_enumerable() && !has_value() && |
| 62 !has_writable() && has_get() && has_set(); |
| 63 } |
| 64 |
| 65 bool IsRegularDataProperty() const { |
| 66 return has_configurable() && has_enumerable() && has_value() && |
| 67 has_writable() && !has_get() && !has_set(); |
| 68 } |
| 69 |
60 bool enumerable() const { return enumerable_; } | 70 bool enumerable() const { return enumerable_; } |
61 void set_enumerable(bool enumerable) { | 71 void set_enumerable(bool enumerable) { |
62 enumerable_ = enumerable; | 72 enumerable_ = enumerable; |
63 has_enumerable_ = true; | 73 has_enumerable_ = true; |
64 } | 74 } |
65 bool has_enumerable() const { return has_enumerable_; } | 75 bool has_enumerable() const { return has_enumerable_; } |
66 | 76 |
67 bool configurable() const { return configurable_; } | 77 bool configurable() const { return configurable_; } |
68 void set_configurable(bool configurable) { | 78 void set_configurable(bool configurable) { |
69 configurable_ = configurable; | 79 configurable_ = configurable; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 124 |
115 // Some compilers (Xcode 5.1, ARM GCC 4.9) insist on having a copy | 125 // Some compilers (Xcode 5.1, ARM GCC 4.9) insist on having a copy |
116 // constructor for std::vector<PropertyDescriptor>, so we can't | 126 // constructor for std::vector<PropertyDescriptor>, so we can't |
117 // DISALLOW_COPY_AND_ASSIGN(PropertyDescriptor); here. | 127 // DISALLOW_COPY_AND_ASSIGN(PropertyDescriptor); here. |
118 }; | 128 }; |
119 | 129 |
120 } // namespace internal | 130 } // namespace internal |
121 } // namespace v8 | 131 } // namespace v8 |
122 | 132 |
123 #endif // V8_PROPERTY_DESCRIPTOR_H_ | 133 #endif // V8_PROPERTY_DESCRIPTOR_H_ |
OLD | NEW |