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

Unified Diff: src/js/proxy.js

Issue 1477073005: Use new.target in favor of %_IsConstructCall intrinsic (1). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/messages.js ('k') | src/js/weak-collection.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/proxy.js
diff --git a/src/js/proxy.js b/src/js/proxy.js
index 3885e408add350acff7d74276a48a28f7eb8cb5c..f836adc13bca5b3a350ffa10086bca1890881bab 100644
--- a/src/js/proxy.js
+++ b/src/js/proxy.js
@@ -25,7 +25,7 @@ utils.Import(function(from) {
//----------------------------------------------------------------------------
function ProxyCreate(target, handler) {
- if (!%_IsConstructCall()) {
+ if (IS_UNDEFINED(new.target)) {
throw MakeTypeError(kConstructorNotFunction, "Proxy");
}
return %CreateJSProxy(target, handler);
@@ -66,7 +66,7 @@ function DerivedConstructTrap(callTrap) {
function DelegateCallAndConstruct(callTrap, constructTrap) {
return function() {
- return %Apply(%_IsConstructCall() ? constructTrap : callTrap,
+ return %Apply(IS_UNDEFINED(new.target) ? callTrap : constructTrap,
this, arguments, 0, %_ArgumentsLength())
}
}
« no previous file with comments | « src/js/messages.js ('k') | src/js/weak-collection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698