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

Unified Diff: src/objects.h

Issue 1397853005: [es6] Partially implement Reflect.preventExtensions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: s/Object/JSObject/ 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
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 9141cb9785ab8ca49ebecce9c07a6175f1d379e7..f60c630a56b4e6a60d875865906b28a58453e990 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1859,6 +1859,11 @@ class JSReceiver: public HeapObject {
static bool GetOwnPropertyDescriptor(LookupIterator* it,
PropertyDescriptor* desc);
+ // Disallow further properties to be added to the object. This is
+ // ES6's [[PreventExtensions]] when passed DONT_THROW.
+ MUST_USE_RESULT static Maybe<bool> PreventExtensions(
+ Handle<JSReceiver> object, ShouldThrow should_throw);
+
// Tests for the fast common case for property enumeration.
bool IsSimpleEnum();
@@ -2314,11 +2319,8 @@ class JSObject: public JSReceiver {
// Check whether this object references another object
bool ReferencesObject(Object* obj);
- // Disallow further properties to be added to the oject.
- MUST_USE_RESULT static Maybe<bool> PreventExtensionsInternal(
- Handle<JSObject> object); // ES [[PreventExtensions]]
- MUST_USE_RESULT static MaybeHandle<Object> PreventExtensions(
- Handle<JSObject> object); // ES Object.preventExtensions
+ MUST_USE_RESULT static Maybe<bool> PreventExtensions(
+ Handle<JSObject> object, ShouldThrow should_throw);
static bool IsExtensible(Handle<JSObject> object);
@@ -2507,7 +2509,7 @@ class JSObject: public JSReceiver {
// attrs is one of NONE, SEALED, or FROZEN (depending on the operation).
template <PropertyAttributes attrs>
MUST_USE_RESULT static Maybe<bool> PreventExtensionsWithTransition(
- Handle<JSObject> object);
+ Handle<JSObject> object, ShouldThrow should_throw);
DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject);
};

Powered by Google App Engine
This is Rietveld 408576698