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 | |
70 bool enumerable() const { return enumerable_; } | 60 bool enumerable() const { return enumerable_; } |
71 void set_enumerable(bool enumerable) { | 61 void set_enumerable(bool enumerable) { |
72 enumerable_ = enumerable; | 62 enumerable_ = enumerable; |
73 has_enumerable_ = true; | 63 has_enumerable_ = true; |
74 } | 64 } |
75 bool has_enumerable() const { return has_enumerable_; } | 65 bool has_enumerable() const { return has_enumerable_; } |
76 | 66 |
77 bool configurable() const { return configurable_; } | 67 bool configurable() const { return configurable_; } |
78 void set_configurable(bool configurable) { | 68 void set_configurable(bool configurable) { |
79 configurable_ = configurable; | 69 configurable_ = configurable; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 114 |
125 // Some compilers (Xcode 5.1, ARM GCC 4.9) insist on having a copy | 115 // Some compilers (Xcode 5.1, ARM GCC 4.9) insist on having a copy |
126 // constructor for std::vector<PropertyDescriptor>, so we can't | 116 // constructor for std::vector<PropertyDescriptor>, so we can't |
127 // DISALLOW_COPY_AND_ASSIGN(PropertyDescriptor); here. | 117 // DISALLOW_COPY_AND_ASSIGN(PropertyDescriptor); here. |
128 }; | 118 }; |
129 | 119 |
130 } // namespace internal | 120 } // namespace internal |
131 } // namespace v8 | 121 } // namespace v8 |
132 | 122 |
133 #endif // V8_PROPERTY_DESCRIPTOR_H_ | 123 #endif // V8_PROPERTY_DESCRIPTOR_H_ |
OLD | NEW |