| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index 2f1405f57d10825a38899967a80d41ffca23d5cd..db3ce118d6b93abdc976bc687bede89ae070f262 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -859,6 +859,7 @@ class LookupIterator;
|
| class ObjectHashTable;
|
| class ObjectVisitor;
|
| class PropertyCell;
|
| +class PropertyDescriptor;
|
| class SafepointEntry;
|
| class SharedFunctionInfo;
|
| class StringStream;
|
| @@ -1780,6 +1781,9 @@ enum AccessorComponent {
|
| enum KeyFilter { SKIP_SYMBOLS, INCLUDE_SYMBOLS };
|
|
|
|
|
| +enum ShouldThrow { THROW_ON_ERROR, DONT_THROW };
|
| +
|
| +
|
| // JSReceiver includes types on which properties can be defined, i.e.,
|
| // JSObject and JSProxy.
|
| class JSReceiver: public HeapObject {
|
| @@ -1816,6 +1820,35 @@ class JSReceiver: public HeapObject {
|
| Handle<JSReceiver> object, uint32_t index,
|
| LanguageMode language_mode = SLOPPY);
|
|
|
| + MUST_USE_RESULT static Object* DefineProperty(Isolate* isolate,
|
| + Handle<Object> object,
|
| + Handle<Object> name,
|
| + Handle<Object> attributes);
|
| + MUST_USE_RESULT static Object* DefineProperties(Isolate* isolate,
|
| + Handle<Object> object,
|
| + Handle<Object> properties);
|
| +
|
| + // "virtual" dispatcher to the correct [[DefineOwnProperty]] implementation.
|
| + static bool DefineOwnProperty(Isolate* isolate, Handle<JSObject> object,
|
| + Handle<Object> key, PropertyDescriptor* desc,
|
| + ShouldThrow should_throw);
|
| +
|
| + static bool OrdinaryDefineOwnProperty(Isolate* isolate,
|
| + Handle<JSObject> object,
|
| + Handle<Object> key,
|
| + PropertyDescriptor* desc,
|
| + ShouldThrow should_throw);
|
| + static bool OrdinaryDefineOwnProperty(LookupIterator* it,
|
| + PropertyDescriptor* desc,
|
| + ShouldThrow should_throw);
|
| +
|
| + static bool GetOwnPropertyDescriptor(Isolate* isolate,
|
| + Handle<JSObject> object,
|
| + Handle<Object> key,
|
| + PropertyDescriptor* desc);
|
| + static bool GetOwnPropertyDescriptor(LookupIterator* it,
|
| + PropertyDescriptor* desc);
|
| +
|
| // Tests for the fast common case for property enumeration.
|
| bool IsSimpleEnum();
|
|
|
| @@ -2062,6 +2095,10 @@ class JSObject: public JSReceiver {
|
| Handle<Object> getter,
|
| Handle<Object> setter,
|
| PropertyAttributes attributes);
|
| + static MaybeHandle<Object> DefineAccessor(LookupIterator* it,
|
| + Handle<Object> getter,
|
| + Handle<Object> setter,
|
| + PropertyAttributes attributes);
|
|
|
| // Defines an AccessorInfo property on the given object.
|
| MUST_USE_RESULT static MaybeHandle<Object> SetAccessor(
|
| @@ -10021,6 +10058,14 @@ class JSArray: public JSObject {
|
| static inline void SetContent(Handle<JSArray> array,
|
| Handle<FixedArrayBase> storage);
|
|
|
| + static bool DefineOwnProperty(Isolate* isolate, Handle<JSArray> o,
|
| + Handle<Object> name, PropertyDescriptor* desc,
|
| + ShouldThrow should_throw);
|
| +
|
| + static bool ArraySetLength(Isolate* isolate, Handle<JSArray> a,
|
| + PropertyDescriptor* desc,
|
| + ShouldThrow should_throw);
|
| +
|
| DECLARE_CAST(JSArray)
|
|
|
| // Dispatched behavior.
|
|
|