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 |