Chromium Code Reviews| Index: lib/runtime/_operations.js |
| diff --git a/lib/runtime/_operations.js b/lib/runtime/_operations.js |
| index 6f9294edfe6a23ecfbcd9e8454f66cec48ac1458..f6012f42c6981e1aaac137ba48fcfbad006c9ed1 100644 |
| --- a/lib/runtime/_operations.js |
| +++ b/lib/runtime/_operations.js |
| @@ -269,12 +269,22 @@ dart_library.library('dart_runtime/_operations', null, /* Imports */[ |
| } |
| exports.assert = assert; |
| - function throw_(obj) { throw obj; } |
| + let _stack = Symbol('_stack'); |
| + |
| + function throw_(obj) { |
| + obj[_stack] = new Error(); |
| + throw obj; |
| + } |
| exports.throw_ = throw_; |
|
Jennifer Messerly
2015/07/13 16:39:17
btw, this should be `throw` ... all names work for
vsm
2015/07/14 13:54:48
Done.
|
| + function rethrow(obj) { |
|
Jennifer Messerly
2015/07/13 16:39:17
if this doesn't do anything, why have the helper?
vsm
2015/07/14 13:54:48
Removed
|
| + throw obj; |
| + } |
| + exports.rethrow = rethrow; |
| function stackTrace(exception) { |
| - return _js_helper.getTraceFromException(exception); |
| + var error = _stack in exception ? exception[_stack] : exception; |
| + return _js_helper.getTraceFromException(error); |
| } |
| exports.stackTrace = stackTrace; |