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

Unified Diff: src/js/v8natives.js

Issue 1422853004: [es6] Fix Object built-in subclassing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@weak-subclass
Patch Set: Test updated Created 5 years, 2 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 | test/mjsunit/es6/classes-subclass-builtins.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | test/mjsunit/es6/classes-subclass-builtins.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698