Index: src/v8natives.js |
diff --git a/src/v8natives.js b/src/v8natives.js |
index 4ba546b0fbca1765dd631af96f2c7ec0ef81759a..1920b088ab381f28c4cb3b0eb463e07d6134c3bb 100644 |
--- a/src/v8natives.js |
+++ b/src/v8natives.js |
@@ -1241,9 +1241,7 @@ function ProxyFix(obj) { |
// ES5 section 15.2.3.8. |
function ObjectSealJS(obj) { |
- if (!IS_SPEC_OBJECT(obj)) { |
- throw MakeTypeError("called_on_non_object", ["Object.seal"]); |
- } |
+ if (!IS_SPEC_OBJECT(obj)) return obj; |
var isProxy = %_IsJSProxy(obj); |
if (isProxy || %HasSloppyArgumentsElements(obj) || %IsObserved(obj)) { |
if (isProxy) { |
@@ -1270,9 +1268,7 @@ function ObjectSealJS(obj) { |
// ES5 section 15.2.3.9. |
function ObjectFreezeJS(obj) { |
- if (!IS_SPEC_OBJECT(obj)) { |
- throw MakeTypeError("called_on_non_object", ["Object.freeze"]); |
- } |
+ if (!IS_SPEC_OBJECT(obj)) return obj; |
var isProxy = %_IsJSProxy(obj); |
if (isProxy || %HasSloppyArgumentsElements(obj) || %IsObserved(obj)) { |
if (isProxy) { |
@@ -1300,9 +1296,7 @@ function ObjectFreezeJS(obj) { |
// ES5 section 15.2.3.10 |
function ObjectPreventExtension(obj) { |
- if (!IS_SPEC_OBJECT(obj)) { |
- throw MakeTypeError("called_on_non_object", ["Object.preventExtension"]); |
- } |
+ if (!IS_SPEC_OBJECT(obj)) return obj; |
if (%_IsJSProxy(obj)) { |
ProxyFix(obj); |
} |
@@ -1313,9 +1307,7 @@ function ObjectPreventExtension(obj) { |
// ES5 section 15.2.3.11 |
function ObjectIsSealed(obj) { |
- if (!IS_SPEC_OBJECT(obj)) { |
- throw MakeTypeError("called_on_non_object", ["Object.isSealed"]); |
- } |
+ if (!IS_SPEC_OBJECT(obj)) return true; |
if (%_IsJSProxy(obj)) { |
return false; |
} |
@@ -1336,9 +1328,7 @@ function ObjectIsSealed(obj) { |
// ES5 section 15.2.3.12 |
function ObjectIsFrozen(obj) { |
- if (!IS_SPEC_OBJECT(obj)) { |
- throw MakeTypeError("called_on_non_object", ["Object.isFrozen"]); |
- } |
+ if (!IS_SPEC_OBJECT(obj)) return true; |
if (%_IsJSProxy(obj)) { |
return false; |
} |
@@ -1358,9 +1348,7 @@ function ObjectIsFrozen(obj) { |
// ES5 section 15.2.3.13 |
function ObjectIsExtensible(obj) { |
- if (!IS_SPEC_OBJECT(obj)) { |
- throw MakeTypeError("called_on_non_object", ["Object.isExtensible"]); |
- } |
+ if (!IS_SPEC_OBJECT(obj)) return false; |
if (%_IsJSProxy(obj)) { |
return true; |
} |