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

Unified Diff: src/js/messages.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/harmony-simd.js ('k') | src/js/proxy.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/messages.js
diff --git a/src/js/messages.js b/src/js/messages.js
index d36db415966c486c52a1d32d66d59892513568dc..17b832a9fca06402bf8c6960724a9676561cda3b 100644
--- a/src/js/messages.js
+++ b/src/js/messages.js
@@ -937,7 +937,7 @@ function DefineError(global, f) {
%AddNamedProperty(f.prototype, 'constructor', f, DONT_ENUM);
%AddNamedProperty(f.prototype, 'name', name, DONT_ENUM);
%SetCode(f, function(m) {
- if (%_IsConstructCall()) {
+ if (!IS_UNDEFINED(new.target)) {
try { captureStackTrace(this, f); } catch (e) { }
// Define all the expected properties directly on the error
// object. This avoids going through getters and setters defined
« no previous file with comments | « src/js/harmony-simd.js ('k') | src/js/proxy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698