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 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1832 Handle<Object> attributes); | 1832 Handle<Object> attributes); |
1833 MUST_USE_RESULT static Object* DefineProperties(Isolate* isolate, | 1833 MUST_USE_RESULT static Object* DefineProperties(Isolate* isolate, |
1834 Handle<Object> object, | 1834 Handle<Object> object, |
1835 Handle<Object> properties); | 1835 Handle<Object> properties); |
1836 | 1836 |
1837 // "virtual" dispatcher to the correct [[DefineOwnProperty]] implementation. | 1837 // "virtual" dispatcher to the correct [[DefineOwnProperty]] implementation. |
1838 static bool DefineOwnProperty(Isolate* isolate, Handle<JSReceiver> object, | 1838 static bool DefineOwnProperty(Isolate* isolate, Handle<JSReceiver> object, |
1839 Handle<Object> key, PropertyDescriptor* desc, | 1839 Handle<Object> key, PropertyDescriptor* desc, |
1840 ShouldThrow should_throw); | 1840 ShouldThrow should_throw); |
1841 | 1841 |
1842 // "virtual" dispatcher to the correct [[CreateDataProperty]] implementation. | 1842 // ES6 7.3.4 (when passed DONT_THROW) |
1843 MUST_USE_RESULT static Maybe<bool> CreateDataProperty(LookupIterator* it, | 1843 MUST_USE_RESULT static Maybe<bool> CreateDataProperty( |
1844 Handle<Object> value); | 1844 LookupIterator* it, Handle<Object> value, ShouldThrow should_throw); |
1845 | 1845 |
1846 // ES6 9.1.6.1 | 1846 // ES6 9.1.6.1 |
1847 static bool OrdinaryDefineOwnProperty(Isolate* isolate, | 1847 static bool OrdinaryDefineOwnProperty(Isolate* isolate, |
1848 Handle<JSObject> object, | 1848 Handle<JSObject> object, |
1849 Handle<Object> key, | 1849 Handle<Object> key, |
1850 PropertyDescriptor* desc, | 1850 PropertyDescriptor* desc, |
1851 ShouldThrow should_throw); | 1851 ShouldThrow should_throw); |
1852 static bool OrdinaryDefineOwnProperty(LookupIterator* it, | 1852 static bool OrdinaryDefineOwnProperty(LookupIterator* it, |
1853 PropertyDescriptor* desc, | 1853 PropertyDescriptor* desc, |
1854 ShouldThrow should_throw); | 1854 ShouldThrow should_throw); |
(...skipping 7669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9524 | 9524 |
9525 // ES6 9.5.10 (when passed SLOPPY) | 9525 // ES6 9.5.10 (when passed SLOPPY) |
9526 MUST_USE_RESULT static Maybe<bool> DeletePropertyOrElement( | 9526 MUST_USE_RESULT static Maybe<bool> DeletePropertyOrElement( |
9527 Handle<JSProxy> proxy, Handle<Name> name, LanguageMode language_mode); | 9527 Handle<JSProxy> proxy, Handle<Name> name, LanguageMode language_mode); |
9528 | 9528 |
9529 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithHandler( | 9529 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithHandler( |
9530 Handle<JSProxy> proxy, | 9530 Handle<JSProxy> proxy, |
9531 Handle<Object> receiver, | 9531 Handle<Object> receiver, |
9532 Handle<Name> name); | 9532 Handle<Name> name); |
9533 | 9533 |
9534 // If the handler defines an accessor property with a setter, invoke it. | |
9535 // If it defines an accessor property without a setter, or a data property | |
9536 // that is read-only, fail. In all these cases set '*done' to true. | |
9537 // Otherwise set it to false, in which case the return value is not | |
9538 // meaningful. | |
9539 MUST_USE_RESULT | |
9540 static Maybe<bool> SetPropertyViaPrototypesWithHandler( | |
9541 Handle<JSProxy> proxy, Handle<Object> receiver, Handle<Name> name, | |
9542 Handle<Object> value, ShouldThrow should_throw, bool* done); | |
9543 | |
9544 MUST_USE_RESULT static Maybe<PropertyAttributes> GetPropertyAttributes( | 9534 MUST_USE_RESULT static Maybe<PropertyAttributes> GetPropertyAttributes( |
9545 LookupIterator* it); | 9535 LookupIterator* it); |
9546 | 9536 |
9547 MUST_USE_RESULT static Maybe<bool> SetPropertyWithHandler( | 9537 MUST_USE_RESULT static Maybe<bool> SetProperty(Handle<JSProxy> proxy, |
9548 Handle<JSProxy> proxy, Handle<Object> receiver, Handle<Name> name, | 9538 Handle<Name> name, |
9549 Handle<Object> value, ShouldThrow should_throw); | 9539 Handle<Object> value, |
| 9540 Handle<Object> receiver, |
| 9541 LanguageMode language_mode); |
9550 | 9542 |
9551 // Dispatched behavior. | 9543 // Dispatched behavior. |
9552 DECLARE_PRINTER(JSProxy) | 9544 DECLARE_PRINTER(JSProxy) |
9553 DECLARE_VERIFIER(JSProxy) | 9545 DECLARE_VERIFIER(JSProxy) |
9554 | 9546 |
9555 // Layout description. We add padding so that a proxy has the same | 9547 // Layout description. We add padding so that a proxy has the same |
9556 // size as a virgin JSObject. This is essential for becoming a JSObject | 9548 // size as a virgin JSObject. This is essential for becoming a JSObject |
9557 // upon freeze. | 9549 // upon freeze. |
9558 static const int kTargetOffset = HeapObject::kHeaderSize; | 9550 static const int kTargetOffset = HeapObject::kHeaderSize; |
9559 static const int kHandlerOffset = kTargetOffset + kPointerSize; | 9551 static const int kHandlerOffset = kTargetOffset + kPointerSize; |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10721 } | 10713 } |
10722 return value; | 10714 return value; |
10723 } | 10715 } |
10724 }; | 10716 }; |
10725 | 10717 |
10726 | 10718 |
10727 } // NOLINT, false-positive due to second-order macros. | 10719 } // NOLINT, false-positive due to second-order macros. |
10728 } // NOLINT, false-positive due to second-order macros. | 10720 } // NOLINT, false-positive due to second-order macros. |
10729 | 10721 |
10730 #endif // V8_OBJECTS_H_ | 10722 #endif // V8_OBJECTS_H_ |
OLD | NEW |