Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(719)

Unified Diff: src/objects.h

Issue 1368753003: Add C++ implementation of Object.defineProperties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: refactored Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 2f1405f57d10825a38899967a80d41ffca23d5cd..3692a1a530bc304fbb7881cf88b4b561aa4a0c6a 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;
@@ -1816,6 +1817,33 @@ class JSReceiver: public HeapObject {
Handle<JSReceiver> object, uint32_t index,
LanguageMode language_mode = SLOPPY);
+ MUST_USE_RESULT static Object* DefineProperty(Isolate* isolate,
+ Handle<Object> o,
Toon Verwaest 2015/10/06 15:55:18 Please write out o as object
Jakob Kummerow 2015/10/09 13:46:12 Done. (I was following the spec's naming.)
+ Handle<Object> name,
Toon Verwaest 2015/10/06 15:55:18 Whenever type is object, I'd rather talk about "ke
Jakob Kummerow 2015/10/09 13:46:12 Done.
+ Handle<Object> attributes);
+ MUST_USE_RESULT static Object* DefineProperties(Isolate* isolate,
+ Handle<Object> o,
+ Handle<Object> properties);
+
+ // "virtual" dispatcher to the correct [[DefineOwnProperty]] implementation.
+ static bool DefineOwnProperty(Isolate* isolate, Handle<JSObject> obj,
+ Handle<Object> name, PropertyDescriptor* desc,
+ bool should_throw);
+
+ static bool OrdinaryDefineOwnProperty(Isolate* isolate, Handle<JSObject> o,
+ Handle<Object> name,
+ PropertyDescriptor* desc,
+ bool should_throw);
Toon Verwaest 2015/10/06 15:55:18 replace bool should_throw with enum
Jakob Kummerow 2015/10/09 13:46:12 Done.
+ static bool OrdinaryDefineOwnProperty(LookupIterator* it,
+ PropertyDescriptor* desc,
+ bool should_throw);
+
+ static bool GetOwnPropertyDescriptor(Isolate* isolate, Handle<JSObject> obj,
Toon Verwaest 2015/10/06 15:55:18 obj -> object
Jakob Kummerow 2015/10/09 13:46:12 Done.
+ Handle<Object> name,
+ PropertyDescriptor* desc);
+ static bool GetOwnPropertyDescriptor(LookupIterator* it,
+ PropertyDescriptor* desc);
+
// Tests for the fast common case for property enumeration.
bool IsSimpleEnum();
@@ -2062,6 +2090,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 +10053,13 @@ 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,
+ bool should_throw);
+
+ static bool ArraySetLength(Isolate* isolate, Handle<JSArray> a,
+ PropertyDescriptor* desc, bool should_throw);
+
DECLARE_CAST(JSArray)
// Dispatched behavior.
« no previous file with comments | « src/heap/heap.h ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698