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

Unified Diff: src/js/v8natives.js

Issue 1474343002: Use new.target in favor of %_IsConstructCall intrinsic (2). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_js-use-new-target-1
Patch Set: Skip ignition. Created 5 years 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 | « src/js/typedarray.js ('k') | test/mjsunit/mjsunit.status » ('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 fa9ebb4c9880f39334b2bc03790cfea3b8414079..711a22fe64ca8e0a43aecf2fe8aaed46bc066d14 100644
--- a/src/js/v8natives.js
+++ b/src/js/v8natives.js
@@ -1290,7 +1290,7 @@ utils.InstallFunctions(GlobalObject, DONT_ENUM, [
function BooleanConstructor(x) {
// TODO(bmeurer): Move this to toplevel.
"use strict";
- if (%_IsConstructCall()) {
+ if (!IS_UNDEFINED(new.target)) {
%_SetValueOf(this, TO_BOOLEAN(x));
} else {
return TO_BOOLEAN(x);
@@ -1616,7 +1616,7 @@ function FunctionBind(this_arg) { // Length is 1.
"use strict";
// This function must not use any object literals (Object, Array, RegExp),
// since the literals-array is being used to store the bound data.
- if (%_IsConstructCall()) {
+ if (!IS_UNDEFINED(new.target)) {
return %NewObjectFromBound(boundFunction);
}
var bindings = %BoundFunctionGetBindings(boundFunction);
« no previous file with comments | « src/js/typedarray.js ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698