| Index: src/messages.js
|
| diff --git a/src/messages.js b/src/messages.js
|
| index 0a50ae7861e5e6f1032c4673dfb4aed904db2611..a3cdba620d8bf7121d5a47d3e9d0b0a22d46ae3e 100644
|
| --- a/src/messages.js
|
| +++ b/src/messages.js
|
| @@ -1085,6 +1085,13 @@ function captureStackTrace(obj, cons_opt) {
|
| var raw_stack = %CollectStackTrace(obj,
|
| cons_opt ? cons_opt : captureStackTrace,
|
| stackTraceLimit);
|
| +
|
| + // Don't be lazy if the error stack formatting is custom (observable).
|
| + if (IS_FUNCTION($Error.prepareStackTrace)) {
|
| + obj.stack = FormatRawStackTrace(obj, raw_stack);
|
| + return;
|
| + }
|
| +
|
| // Note that 'obj' and 'this' maybe different when called on objects that
|
| // have the error object on its prototype chain. The getter replaces itself
|
| // with a data property as soon as the stack trace has been formatted.
|
| @@ -1099,6 +1106,7 @@ function captureStackTrace(obj, cons_opt) {
|
| %DefineOrRedefineDataProperty(this, 'stack', v, NONE);
|
| };
|
|
|
| + %SetNativeFlag(getter);
|
| %DefineOrRedefineAccessorProperty(obj, 'stack', getter, setter, DONT_ENUM);
|
| }
|
|
|
| @@ -1258,6 +1266,8 @@ function SetUpStackOverflowBoilerplate() {
|
| %DefineOrRedefineDataProperty(this, 'stack', v, NONE);
|
| }
|
|
|
| + %SetNativeFlag(getter);
|
| +
|
| %DefineOrRedefineAccessorProperty(
|
| boilerplate, 'stack', getter, setter, DONT_ENUM);
|
|
|
|
|