Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(740)

Unified Diff: pkg/dev_compiler/lib/js/es6/dart_sdk.js

Issue 2545923002: Keep only a single active stack trace, enables traces for thrown non-exceptions (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
Index: pkg/dev_compiler/lib/js/es6/dart_sdk.js
diff --git a/pkg/dev_compiler/lib/js/es6/dart_sdk.js b/pkg/dev_compiler/lib/js/es6/dart_sdk.js
index d71474d601c95219b0866dcdccce017a411e98b6..3a48f4865b4fc2b0166d7e84823d0dd6a7516b58 100644
--- a/pkg/dev_compiler/lib/js/es6/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/es6/dart_sdk.js
@@ -1897,14 +1897,12 @@ dart.assert = function(condition) {
if (!condition) dart.throwAssertionError();
};
dart.throw = function(obj) {
- if (obj != null && (typeof obj == 'object' || typeof obj == 'function')) {
- dart._stack.set(obj, new Error());
- }
+ dart._stack = new Error();
throw obj;
};
dart.getError = function(exception) {
- var stack = dart._stack.get(exception);
- return stack !== void 0 ? stack : exception;
+ var stack = dart._stack;
+ return stack !== null ? stack : exception;
};
dart.stackPrint = function(exception) {
var error = dart.getError(exception);
@@ -2662,7 +2660,7 @@ dart._ignoreTypeFailure = (() => {
return false;
});
})();
-dart._stack = new WeakMap();
+dart._stack = null;
dart._value = Symbol("_value");
dart.constants = new Map();
dart.constantLists = new Map();

Powered by Google App Engine
This is Rietveld 408576698