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

Unified Diff: src/objects.h

Issue 1489423002: [proxies] Make Object.{freeze,seal} behave correctly for proxies. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add some tests. Created 5 years 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/js/v8natives.js ('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 e39eb68b001438ab2de6a3cf2c544ba2cd6688bc..033f660956c87ee9254cf5f1f3b1799e5f83d412 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1864,8 +1864,14 @@ 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.
+ typedef PropertyAttributes IntegrityLevel;
+
+ // ES6 7.3.14 (when passed DONT_THROW)
+ // 'level' must be SEALED or FROZEN.
+ MUST_USE_RESULT static Maybe<bool> SetIntegrityLevel(
+ Handle<JSReceiver> object, IntegrityLevel lvl, ShouldThrow should_throw);
+
+ // ES6 [[PreventExtensions]] (when passed DONT_THROW)
MUST_USE_RESULT static Maybe<bool> PreventExtensions(
Handle<JSReceiver> object, ShouldThrow should_throw);
@@ -1919,6 +1925,13 @@ class JSReceiver: public HeapObject {
enum KeyCollectionType { OWN_ONLY, INCLUDE_PROTOS };
+ // ES6 [[OwnPropertyKeys]] (modulo return type)
+ MUST_USE_RESULT static MaybeHandle<FixedArray> OwnPropertyKeys(
+ Handle<JSReceiver> object) {
+ return GetKeys(object, JSReceiver::OWN_ONLY, ALL_PROPERTIES,
+ CONVERT_TO_STRING);
+ }
+
// Computes the enumerable keys for a JSObject. Used for implementing
// "for (n in object) { }".
MUST_USE_RESULT static MaybeHandle<FixedArray> GetKeys(
@@ -2357,12 +2370,6 @@ class JSObject: public JSReceiver {
static bool IsExtensible(Handle<JSObject> object);
- // ES5 Object.seal
- MUST_USE_RESULT static MaybeHandle<Object> Seal(Handle<JSObject> object);
-
- // ES5 Object.freeze
- MUST_USE_RESULT static MaybeHandle<Object> Freeze(Handle<JSObject> object);
-
// Called the first time an object is observed with ES7 Object.observe.
static void SetObserved(Handle<JSObject> object);
« no previous file with comments | « src/js/v8natives.js ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698