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

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

Side-by-side diff isn't available for this file because of its large size.
Issue 2621823002: Disable auto "debugger" call for tests (Closed)
Patch Set: Created 3 years, 11 months 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
« no previous file with comments | « pkg/dev_compiler/lib/js/amd/dart_sdk.js ('k') | pkg/dev_compiler/lib/js/es6/dart_sdk.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/js/common/dart_sdk.js
diff --git a/pkg/dev_compiler/lib/js/common/dart_sdk.js b/pkg/dev_compiler/lib/js/common/dart_sdk.js
index 2b4c9102703f216d5673aba0c181a263ea80cd85..7c7e31bca087e53c07ff6b2ace7ccab657e0a976 100644
--- a/pkg/dev_compiler/lib/js/common/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/common/dart_sdk.js
@@ -1687,36 +1687,47 @@
}
return true;
};
+ dart.trapRuntimeErrors = function(flag) {
+ dart._trapRuntimeErrors = flag;
+ };
dart.throwCastError = function(object, actual, type) {
- debugger;
- dart.throw(new _js_helper.CastErrorImplementation(object, dart.typeName(actual), dart.typeName(type)));
+ var found = dart.typeName(actual);
+ var expected = dart.typeName(type);
+ if (dart._trapRuntimeErrors) debugger;
+ dart.throw(new _js_helper.CastErrorImplementation(object, found, expected));
};
dart.throwTypeError = function(object, actual, type) {
- debugger;
- dart.throw(new _js_helper.TypeErrorImplementation(object, dart.typeName(actual), dart.typeName(type)));
+ var found = dart.typeName(actual);
+ var expected = dart.typeName(type);
+ if (dart._trapRuntimeErrors) debugger;
+ dart.throw(new _js_helper.TypeErrorImplementation(object, found, expected));
};
dart.throwStrongModeCastError = function(object, actual, type) {
- debugger;
- dart.throw(new _js_helper.StrongModeCastError(object, dart.typeName(actual), dart.typeName(type)));
+ var found = dart.typeName(actual);
+ var expected = dart.typeName(type);
+ if (dart._trapRuntimeErrors) debugger;
+ dart.throw(new _js_helper.StrongModeCastError(object, found, expected));
};
dart.throwStrongModeTypeError = function(object, actual, type) {
- debugger;
- dart.throw(new _js_helper.StrongModeTypeError(object, dart.typeName(actual), dart.typeName(type)));
+ var found = dart.typeName(actual);
+ var expected = dart.typeName(type);
+ if (dart._trapRuntimeErrors) debugger;
+ dart.throw(new _js_helper.StrongModeTypeError(object, found, expected));
};
dart.throwUnimplementedError = function(message) {
- debugger;
+ if (dart._trapRuntimeErrors) debugger;
dart.throw(new core.UnimplementedError(message));
};
dart.throwAssertionError = function(message) {
if (message === void 0) message = null;
return (() => {
- debugger;
+ if (dart._trapRuntimeErrors) debugger;
let error = message != null ? new _js_helper.AssertionErrorWithMessage(message()) : new core.AssertionError();
dart.throw(error);
})();
};
dart.throwNullValueError = function() {
- debugger;
+ if (dart._trapRuntimeErrors) debugger;
dart.throw(new core.NoSuchMethodError(null, new core.Symbol('<Unexpected Null Value>'), null, null, null));
};
dart.syncStar = function(gen, E, ...args) {
@@ -2248,11 +2259,11 @@
return Object.getOwnPropertySymbols(obj);
};
dart.throwStrongModeError = function(message) {
- debugger;
+ if (dart.test(dart._trapRuntimeErrors)) debugger;
throw new _js_helper.StrongModeErrorImplementation(message);
};
dart.throwInternalError = function(message) {
- debugger;
+ if (dart.test(dart._trapRuntimeErrors)) debugger;
throw Error(message);
};
dart.getOwnNamesAndSymbols = function(obj) {
@@ -2663,6 +2674,7 @@
};
dart._typeFormalCount = Symbol("_typeFormalCount");
dart.isSubtype = dart._subtypeMemo((t1, t2) => t1 === t2 || dart._isSubtype(t1, t2, true));
+ dart._trapRuntimeErrors = true;
dart._jsIterator = Symbol("_jsIterator");
dart._current = Symbol("_current");
dart._AsyncStarStreamController = class _AsyncStarStreamController {
« no previous file with comments | « pkg/dev_compiler/lib/js/amd/dart_sdk.js ('k') | pkg/dev_compiler/lib/js/es6/dart_sdk.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698