This speeds up isFrozen/isSealed checks on "normal" objects without
slowing down checks on frozen/sealed objects.
Though this ordering is not what ES5 specifies, the difference is not
observable (especially since the code bails out if the passed-in object
is a proxy).
Review URL: https://codereview.chromium.org/
12340008
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13726
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
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;
}
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];
if (IsDataDescriptor(desc) && desc.isWritable()) return false;
if (desc.isConfigurable()) return false;
}
- if (!ObjectIsExtensible(obj)) {
- return true;
- }
- return false;
+ return true;
}