| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 Handle<Object> name() const { return name_; } | 82 Handle<Object> name() const { return name_; } |
| 83 void set_name(Handle<Object> name) { name_ = name; } | 83 void set_name(Handle<Object> name) { name_ = name; } |
| 84 | 84 |
| 85 PropertyAttributes ToAttributes() { | 85 PropertyAttributes ToAttributes() { |
| 86 return static_cast<PropertyAttributes>( | 86 return static_cast<PropertyAttributes>( |
| 87 (has_enumerable() && !enumerable() ? DONT_ENUM : NONE) | | 87 (has_enumerable() && !enumerable() ? DONT_ENUM : NONE) | |
| 88 (has_configurable() && !configurable() ? DONT_DELETE : NONE) | | 88 (has_configurable() && !configurable() ? DONT_DELETE : NONE) | |
| 89 (has_writable() && !writable() ? READ_ONLY : NONE)); | 89 (has_writable() && !writable() ? READ_ONLY : NONE)); |
| 90 } | 90 } |
| 91 | 91 |
| 92 Handle<Object> ToObject(Isolate* isolate); |
| 93 |
| 92 static bool ToPropertyDescriptor(Isolate* isolate, Handle<Object> obj, | 94 static bool ToPropertyDescriptor(Isolate* isolate, Handle<Object> obj, |
| 93 PropertyDescriptor* desc); | 95 PropertyDescriptor* desc); |
| 94 | 96 |
| 95 private: | 97 private: |
| 96 bool enumerable_ : 1; | 98 bool enumerable_ : 1; |
| 97 bool has_enumerable_ : 1; | 99 bool has_enumerable_ : 1; |
| 98 bool configurable_ : 1; | 100 bool configurable_ : 1; |
| 99 bool has_configurable_ : 1; | 101 bool has_configurable_ : 1; |
| 100 bool writable_ : 1; | 102 bool writable_ : 1; |
| 101 bool has_writable_ : 1; | 103 bool has_writable_ : 1; |
| 102 Handle<Object> value_; | 104 Handle<Object> value_; |
| 103 Handle<Object> get_; | 105 Handle<Object> get_; |
| 104 Handle<Object> set_; | 106 Handle<Object> set_; |
| 105 Handle<Object> name_; | 107 Handle<Object> name_; |
| 106 | 108 |
| 107 // Some compilers (Xcode 5.1, ARM GCC 4.9) insist on having a copy | 109 // Some compilers (Xcode 5.1, ARM GCC 4.9) insist on having a copy |
| 108 // constructor for std::vector<PropertyDescriptor>, so we can't | 110 // constructor for std::vector<PropertyDescriptor>, so we can't |
| 109 // DISALLOW_COPY_AND_ASSIGN(PropertyDescriptor); here. | 111 // DISALLOW_COPY_AND_ASSIGN(PropertyDescriptor); here. |
| 110 }; | 112 }; |
| 111 | 113 |
| 112 } // namespace internal | 114 } // namespace internal |
| 113 } // namespace v8 | 115 } // namespace v8 |
| 114 | 116 |
| 115 #endif // V8_PROPERTY_DESCRIPTOR_H_ | 117 #endif // V8_PROPERTY_DESCRIPTOR_H_ |
| OLD | NEW |