| 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 18df1635520c40e0785b9a992c4a902ea3d0151d..fc9d6c9ac41357365abcd664756603c010b98c3d 100644
|
| --- a/pkg/dev_compiler/lib/js/es6/dart_sdk.js
|
| +++ b/pkg/dev_compiler/lib/js/es6/dart_sdk.js
|
| @@ -1530,9 +1530,13 @@ dart.throwUnimplementedError = function(message) {
|
| debugger;
|
| dart.throw(new core.UnimplementedError(message));
|
| };
|
| -dart.throwAssertionError = function() {
|
| - debugger;
|
| - dart.throw(new core.AssertionError());
|
| +dart.throwAssertionError = function(message) {
|
| + if (message === void 0) message = null;
|
| + return (() => {
|
| + debugger;
|
| + let error = message != null ? new _js_helper.AssertionErrorWithMessage(message()) : new core.AssertionError();
|
| + dart.throw(error);
|
| + })();
|
| };
|
| dart.throwNullValueError = function() {
|
| debugger;
|
| @@ -1893,8 +1897,11 @@ dart.map = function(values, K, V) {
|
| return map;
|
| })();
|
| };
|
| -dart.assert = function(condition) {
|
| - if (!condition) dart.throwAssertionError();
|
| +dart.assert = function(condition, message) {
|
| + if (message === void 0) message = null;
|
| + return (() => {
|
| + if (!condition) dart.throwAssertionError(message);
|
| + })();
|
| };
|
| dart.throw = function(obj) {
|
| dart._stack = new Error();
|
| @@ -11877,6 +11884,30 @@ dart.setSignature(_js_helper.RuntimeError, {
|
| constructors: () => ({new: dart.definiteFunctionType(_js_helper.RuntimeError, [dart.dynamic])}),
|
| fields: () => ({message: dart.dynamic})
|
| });
|
| +core.AssertionError = class AssertionError extends core.Error {
|
| + new() {
|
| + super.new();
|
| + }
|
| + toString() {
|
| + return "Assertion failed";
|
| + }
|
| +};
|
| +dart.setSignature(core.AssertionError, {
|
| + constructors: () => ({new: dart.definiteFunctionType(core.AssertionError, [])})
|
| +});
|
| +_js_helper.AssertionErrorWithMessage = class AssertionErrorWithMessage extends core.AssertionError {
|
| + new(message) {
|
| + this[_message] = message;
|
| + super.new();
|
| + }
|
| + toString() {
|
| + return dart.str`Assertion failed: ${this[_message]}`;
|
| + }
|
| +};
|
| +dart.setSignature(_js_helper.AssertionErrorWithMessage, {
|
| + constructors: () => ({new: dart.definiteFunctionType(_js_helper.AssertionErrorWithMessage, [core.Object])}),
|
| + fields: () => ({[_message]: core.Object})
|
| +});
|
| _js_helper.random64 = function() {
|
| let int32a = Math.random() * 0x100000000 >>> 0;
|
| let int32b = Math.random() * 0x100000000 >>> 0;
|
| @@ -12007,17 +12038,6 @@ _js_helper.SyncIterable$ = dart.generic(E => {
|
| return SyncIterable;
|
| });
|
| _js_helper.SyncIterable = SyncIterable();
|
| -core.AssertionError = class AssertionError extends core.Error {
|
| - new() {
|
| - super.new();
|
| - }
|
| - toString() {
|
| - return "Assertion failed";
|
| - }
|
| -};
|
| -dart.setSignature(core.AssertionError, {
|
| - constructors: () => ({new: dart.definiteFunctionType(core.AssertionError, [])})
|
| -});
|
| _js_helper.BooleanConversionAssertionError = class BooleanConversionAssertionError extends core.AssertionError {
|
| new() {
|
| super.new();
|
|
|