Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart |
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart |
index 392abf0b7fdee463d0d79b81dedd46cf8676a5ed..0e3acaf539e93fd4692da3833e2ab2b24491be9b 100644 |
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart |
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart |
@@ -552,25 +552,20 @@ assert_(condition) => JS( |
if (!$condition) $throwAssertionError(); |
})()'''); |
-final _stack = JS('', 'new WeakMap()'); |
+var _stack = null; |
@JSExportName('throw') |
throw_(obj) => JS( |
'', |
'''(() => { |
- if ($obj != null && (typeof $obj == 'object' || typeof $obj == 'function')) { |
- // TODO(jmesserly): couldn't we store the most recent stack in a single |
- // variable? There should only be one active stack trace. That would |
- // allow it to work for things like strings and numbers. |
- $_stack.set($obj, new Error()); |
- } |
- throw $obj; |
+ $_stack = new Error(); |
vsm
2016/12/02 16:50:12
DBC
How about saving the thrown obj also and sani
|
+ throw $obj; |
})()'''); |
getError(exception) => JS( |
'', |
'''(() => { |
- var stack = $_stack.get($exception); |
- return stack !== void 0 ? stack : $exception; |
+ var stack = $_stack; |
+ return stack !== null ? stack : $exception; |
})()'''); |
// This is a utility function: it is only intended to be called from dev |