Chromium Code Reviews| Index: src/js/v8natives.js |
| diff --git a/src/js/v8natives.js b/src/js/v8natives.js |
| index dae087ded436e361b2610e8d99c634d6aace27a2..8faf757adcd1977ec5465e35af79c084f538e201 100644 |
| --- a/src/js/v8natives.js |
| +++ b/src/js/v8natives.js |
| @@ -1322,14 +1322,13 @@ function ObjectSetProto(proto) { |
| } |
| +// ECMA-262, Edition 6, section 19.1.1.1 |
| function ObjectConstructor(x) { |
| - if (%_IsConstructCall()) { |
| - if (x == null) return this; |
| - return TO_OBJECT(x); |
| - } else { |
| - if (x == null) return { }; |
| - return TO_OBJECT(x); |
| + if (GlobalObject != new.target && !IS_UNDEFINED(new.target)) { |
|
Michael Starzinger
2015/10/30 11:52:26
Benedikt raised the question: Does this deal with
|
| + return this; |
| } |
| + if (IS_NULL(x) || IS_UNDEFINED(x)) return {}; |
| + return TO_OBJECT(x); |
| } |