| commit | d91b9f7d46489a9ee00f9cb415630299c76a502b | [log] [tgz] |
|---|---|---|
| author | Leon Clarke <leonclarke@google.com> | Wed Jan 27 17:25:45 2010 +0000 |
| committer | Leon Clarke <leonclarke@google.com> | Wed Jan 27 17:31:21 2010 +0000 |
| tree | 741552f95883bb7461cf7c1d36335cef68804a5b | |
| parent | eab96aab0834f21954b5d6aa6366bcfb348ed811 [diff] [blame] |
Merge from v8 at revision 3723
diff --git a/src/runtime.js b/src/runtime.js index ce2f197..c4c855e 100644 --- a/src/runtime.js +++ b/src/runtime.js
@@ -541,7 +541,9 @@ if (IS_STRING(x)) return new $String(x); if (IS_NUMBER(x)) return new $Number(x); if (IS_BOOLEAN(x)) return new $Boolean(x); - if (x == null) throw %MakeTypeError('null_to_object', []); + if (IS_NULL_OR_UNDEFINED(x) && !IS_UNDETECTABLE(x)) { + throw %MakeTypeError('null_to_object', []); + } return x; }