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

Unified Diff: src/js/v8natives.js

Issue 1502983002: [proxies] Make Object.{isFrozen,isSealed} behave correctly for proxies. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase 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 | « no previous file | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/v8natives.js
diff --git a/src/js/v8natives.js b/src/js/v8natives.js
index 8b9f81c04395caf3fe668cdc7f0e80598524a7dd..ec61de48de55382098f1167f1ae9e10695f77c4e 100644
--- a/src/js/v8natives.js
+++ b/src/js/v8natives.js
@@ -917,69 +917,42 @@ function ObjectDefineProperties(obj, properties) {
}
-// ES5 section 15.2.3.8.
+// ES6 19.1.2.17
function ObjectSealJS(obj) {
if (!IS_SPEC_OBJECT(obj)) return obj;
return %ObjectSeal(obj);
}
-// ES5 section 15.2.3.9.
+// ES6 19.1.2.5
function ObjectFreezeJS(obj) {
if (!IS_SPEC_OBJECT(obj)) return obj;
return %ObjectFreeze(obj);
}
-// ES5 section 15.2.3.10
+// ES6 19.1.2.15
function ObjectPreventExtension(obj) {
if (!IS_SPEC_OBJECT(obj)) return obj;
return %PreventExtensions(obj);
}
-// ES5 section 15.2.3.11
+// ES6 19.1.2.13
function ObjectIsSealed(obj) {
if (!IS_SPEC_OBJECT(obj)) return true;
- if (%_IsJSProxy(obj)) {
- return false; // TODO(neis): Must call isExtensible trap and ownKeys trap.
- }
- if (%IsExtensible(obj)) {
- return false;
- }
- var names = OwnPropertyKeys(obj);
- for (var i = 0; i < names.length; i++) {
- var name = names[i];
- var desc = GetOwnPropertyJS(obj, name);
- if (desc.isConfigurable()) {
- return false;
- }
- }
- return true;
+ return %ObjectIsSealed(obj);
}
-// ES5 section 15.2.3.12
+// ES6 19.1.2.12
function ObjectIsFrozen(obj) {
if (!IS_SPEC_OBJECT(obj)) return true;
- if (%_IsJSProxy(obj)) {
- return false; // TODO(neis): Must call isExtensible trap and ownKeys trap.
- }
- if (%IsExtensible(obj)) {
- return false;
- }
- var names = OwnPropertyKeys(obj);
- for (var i = 0; i < names.length; i++) {
- var name = names[i];
- var desc = GetOwnPropertyJS(obj, name);
- if (IsDataDescriptor(desc) && desc.isWritable()) return false;
- if (desc.isConfigurable()) return false;
- }
- return true;
+ return %ObjectIsFrozen(obj);
}
-// ES5 section 15.2.3.13
+// ES6 19.1.2.11
function ObjectIsExtensible(obj) {
if (!IS_SPEC_OBJECT(obj)) return false;
return %IsExtensible(obj);
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698