Index: src/messages.js |
diff --git a/src/messages.js b/src/messages.js |
index b9281070a7670f6d38b1e7e5ddea603d551e9cc2..75ecddc096ed7db39e429e927dfc8001bdc7efef 100644 |
--- a/src/messages.js |
+++ b/src/messages.js |
@@ -1050,13 +1050,15 @@ function captureStackTrace(obj, cons_opt) { |
$Math.__proto__ = global.Object.prototype; |
-DefineError(function Error() { }); |
-DefineError(function TypeError() { }); |
-DefineError(function RangeError() { }); |
-DefineError(function SyntaxError() { }); |
-DefineError(function ReferenceError() { }); |
-DefineError(function EvalError() { }); |
-DefineError(function URIError() { }); |
+// DefineError is a native function. Use explicit receiver. Otherwise |
+// the receiver will be 'undefined'. |
+this.DefineError(function Error() { }); |
+this.DefineError(function TypeError() { }); |
+this.DefineError(function RangeError() { }); |
+this.DefineError(function SyntaxError() { }); |
+this.DefineError(function ReferenceError() { }); |
+this.DefineError(function EvalError() { }); |
+this.DefineError(function URIError() { }); |
$Error.captureStackTrace = captureStackTrace; |