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

Unified Diff: src/v8natives.js

Issue 12340008: Move extensibility check to the top of Object.isFrozen/Object.isSealed (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Call %IsExtensible directly Created 7 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 3978e88685156e69ec1660f1ea76d2f8b845b3b9..8563c2e8672f8f71c4f38adf28b3ee2aa2fca703 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -1240,16 +1240,16 @@ function ObjectIsSealed(obj) {
if (%IsJSProxy(obj)) {
return false;
}
+ if (%IsExtensible(obj)) {
+ return false;
+ }
var names = ObjectGetOwnPropertyNames(obj);
for (var i = 0; i < names.length; i++) {
var name = names[i];
var desc = GetOwnProperty(obj, name);
if (desc.isConfigurable()) return false;
}
- if (!ObjectIsExtensible(obj)) {
- return true;
- }
- return false;
+ return true;
}
@@ -1261,6 +1261,9 @@ function ObjectIsFrozen(obj) {
if (%IsJSProxy(obj)) {
return false;
}
+ if (%IsExtensible(obj)) {
+ return false;
+ }
var names = ObjectGetOwnPropertyNames(obj);
for (var i = 0; i < names.length; i++) {
var name = names[i];
@@ -1268,10 +1271,7 @@ function ObjectIsFrozen(obj) {
if (IsDataDescriptor(desc) && desc.isWritable()) return false;
if (desc.isConfigurable()) return false;
}
- if (!ObjectIsExtensible(obj)) {
- return true;
- }
- return false;
+ return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698