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

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: Sorry 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/builtins.cc ('k') | src/objects.cc » ('j') | no next file with comments »
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 6c209b179207407623aa850d85587528c23b0a1c..37618b42fc6aa2a64f1c7d627e94f6ae3a19593f 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1865,6 +1865,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();
@@ -2324,11 +2329,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);
@@ -2517,7 +2519,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);
};
« no previous file with comments | « src/builtins.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698