| Index: pkg/dev_compiler/lib/js/legacy/dart_sdk.js
|
| diff --git a/pkg/dev_compiler/lib/js/legacy/dart_sdk.js b/pkg/dev_compiler/lib/js/legacy/dart_sdk.js
|
| index 7820c1b69fa0357dd023703cc900986fb13b168e..df096198a51a9db335fa676574cdb98e7b8baf2b 100644
|
| --- a/pkg/dev_compiler/lib/js/legacy/dart_sdk.js
|
| +++ b/pkg/dev_compiler/lib/js/legacy/dart_sdk.js
|
| @@ -1688,36 +1688,47 @@ dart_library.library('dart_sdk', null, /* Imports */[
|
| }
|
| 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) {
|
| @@ -2249,11 +2260,11 @@ dart_library.library('dart_sdk', null, /* Imports */[
|
| 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) {
|
| @@ -2664,6 +2675,7 @@ dart_library.library('dart_sdk', null, /* Imports */[
|
| };
|
| 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 {
|
|
|