@@ -456,22 +456,24 @@ dart_library.library('dart_sdk', null, /* Imports */[
456
456
if (obj == null) return obj;
457
457
let result = dart.strongInstanceOf(obj, type, true);
458
458
if (result) return obj;
459
+ dart._throwCastError(obj, type, result);
460
+ };
461
+ dart.test = function(obj) {
462
+ if (typeof obj == "boolean") return obj;
463
+ dart.throwCastError(dart.getReifiedType(obj), core.bool);
464
+ };
465
+ dart._throwCastError = function(obj, type, result) {
459
466
let actual = dart.getReifiedType(obj);
460
- if (result === false) dart.throwCastError(actual, type);
461
- dart.throwStrongModeError('Strong mode cast failure from ' + dart.typeName(actual) + ' to ' + dart.typeName(type));
467
+ if (result == false) dart.throwCastError(actual, type);
468
+ dart.throwStrongModeError('Strong mode cast failure from ' + dart.notNull(dart.as(dart. typeName(actual), core.String)) + ' to ' + dart.notNull(dart.as(dart. typeName(type), core.String) ));
462
469
};
463
470
dart.asInt = function(obj) {
464
- if (obj == null) {
465
- return null;
466
- }
471
+ if (obj == null) return null;
467
472
if (Math.floor(obj) != obj) {
468
473
dart.throwCastError(dart.getReifiedType(obj), core.int);
469
474
}
470
475
return obj;
471
476
};
472
- dart.arity = function(f) {
473
- return {min: f.length, max: f.length};
474
- };
475
477
dart.equals = function(x, y) {
476
478
if (x == null || y == null) return x == y;
477
479
let eq = x['=='];
@@ -6976,7 +6978,7 @@ dart_library.library('dart_sdk', null, /* Imports */[
6976
6978
if (this.doneHandlers == null) {
6977
6979
this.doneHandlers = [];
6978
6980
}
6979
- if (dart.notNull (dart.as(dart. dsend(this.doneHandlers, 'contains', responsePort), core.bool ))) return;
6981
+ if (dart.test (dart.dsend(this.doneHandlers, 'contains', responsePort))) return;
6980
6982
dart.dsend(this.doneHandlers, 'add', responsePort);
6981
6983
}
6982
6984
removeDoneListener(responsePort) {
@@ -7070,7 +7072,7 @@ dart_library.library('dart_sdk', null, /* Imports */[
7070
7072
_isolate_helper._globalState.currentContext = old;
7071
7073
if (old != null) old[_setGlobals]();
7072
7074
if (this[_scheduledControlEvents] != null) {
7073
- while (dart.notNull (dart.as(dart. dload(this[_scheduledControlEvents], 'isNotEmpty'), core.bool ))) {
7075
+ while (dart.test (dart.dload(this[_scheduledControlEvents], 'isNotEmpty'))) {
7074
7076
dart.dcall(dart.dsend(this[_scheduledControlEvents], 'removeFirst'));
7075
7077
}
7076
7078
}
@@ -9289,20 +9291,20 @@ dart_library.library('dart_sdk', null, /* Imports */[
9289
9291
_js_helper.checkBool(isUtc);
9290
9292
let jsMonth = dart.dsend(month, '-', 1);
9291
9293
let value = null;
9292
- if (dart.notNull(dart.as( isUtc, core.bool) )) {
9294
+ if (dart.test( isUtc)) {
9293
9295
value = Date.UTC(years, jsMonth, day, hours, minutes, seconds, milliseconds);
9294
9296
} else {
9295
9297
value = new Date(years, jsMonth, day, hours, minutes, seconds, milliseconds).valueOf();
9296
9298
}
9297
- if (dart.notNull (dart.as(dart. dload(value, 'isNaN'), core.bool)) || dart.notNull (dart.as(dart. dsend(value, '<', -MAX_MILLISECONDS_SINCE_EPOCH), core.bool)) || dart.notNull (dart.as(dart. dsend(value, '>', MAX_MILLISECONDS_SINCE_EPOCH), core.bool ))) {
9299
+ if (dart.test (dart.dload(value, 'isNaN')) || dart.test (dart.dsend(value, '<', -MAX_MILLISECONDS_SINCE_EPOCH)) || dart.test (dart.dsend(value, '>', MAX_MILLISECONDS_SINCE_EPOCH))) {
9298
9300
return null;
9299
9301
}
9300
- if (dart.notNull (dart.as(dart. dsend(years, '<=', 0), core.bool)) || dart.notNull (dart.as(dart. dsend(years, '<', 100), core.bool ))) return _js_helper.Primitives.patchUpY2K(value, years, isUtc);
9302
+ if (dart.test (dart.dsend(years, '<=', 0)) || dart.test (dart.dsend(years, '<', 100))) return _js_helper.Primitives.patchUpY2K(value, years, isUtc);
9301
9303
return value;
9302
9304
}
9303
9305
static patchUpY2K(value, years, isUtc) {
9304
9306
let date = new Date(value);
9305
- if (dart.notNull(dart.as( isUtc, core.bool) )) {
9307
+ if (dart.test( isUtc)) {
9306
9308
date.setUTCFullYear(years);
9307
9309
} else {
9308
9310
date.setFullYear(years);
@@ -9410,7 +9412,7 @@ dart_library.library('dart_sdk', null, /* Imports */[
9410
9412
_js_helper.diagnoseIndexError = function(indexable, index) {
9411
9413
if (!(typeof index == 'number')) return new core.ArgumentError.value(index, 'index');
9412
9414
let length = dart.as(dart.dload(indexable, 'length'), core.int);
9413
- if (dart.notNull (dart.as(dart. dsend(index, '<', 0), core.bool)) || dart.notNull (dart.as(dart. dsend(index, '>=', length), core.bool ))) {
9415
+ if (dart.test (dart.dsend(index, '<', 0)) || dart.test (dart.dsend(index, '>=', length))) {
9414
9416
return core.RangeError.index(dart.as(index, core.int), indexable, 'index', null, length);
9415
9417
}
9416
9418
return new core.RangeError.value(dart.as(index, core.num), 'index');
@@ -9420,14 +9422,14 @@ dart_library.library('dart_sdk', null, /* Imports */[
9420
9422
if (!(typeof start == 'number')) {
9421
9423
return new core.ArgumentError.value(start, 'start');
9422
9424
}
9423
- if (dart.notNull (dart.as(dart. dsend(start, '<', 0), core.bool)) || dart.notNull (dart.as(dart. dsend(start, '>', length), core.bool ))) {
9425
+ if (dart.test (dart.dsend(start, '<', 0)) || dart.test (dart.dsend(start, '>', length))) {
9424
9426
return new core.RangeError.range(dart.as(start, core.num), 0, dart.as(length, core.int), 'start');
9425
9427
}
9426
9428
if (end != null) {
9427
9429
if (!(typeof end == 'number')) {
9428
9430
return new core.ArgumentError.value(end, 'end');
9429
9431
}
9430
- if (dart.notNull (dart.as(dart. dsend(end, '<', start), core.bool)) || dart.notNull (dart.as(dart. dsend(end, '>', length), core.bool ))) {
9432
+ if (dart.test (dart.dsend(end, '<', start)) || dart.test (dart.dsend(end, '>', length))) {
9431
9433
return new core.RangeError.range(dart.as(end, core.num), dart.as(start, core.int), dart.as(length, core.int), 'end');
9432
9434
}
9433
9435
}
@@ -28799,7 +28801,7 @@ dart_library.library('dart_sdk', null, /* Imports */[
28799
28801
}
28800
28802
get [_errorExplanation]() {
28801
28803
dart.assert(this[_hasValue]);
28802
- if (dart.notNull (dart.as(dart. dsend(this.invalidValue, '<', 0), core.bool ))) {
28804
+ if (dart.test (dart.dsend(this.invalidValue, '<', 0))) {
28803
28805
return ": index must not be negative";
28804
28806
}
28805
28807
if (this.length == 0) {
@@ -30361,9 +30363,9 @@ dart_library.library('dart_sdk', null, /* Imports */[
30361
30363
} else {
30362
30364
result = pathSegments[dartx.map](core.String)(dart.fn(s => core.Uri._uriEncode(core.Uri._pathCharTable, s, convert.UTF8, false), core.String, [core.String]))[dartx.join]("/");
30363
30365
}
30364
- if (dart.notNull (dart.as(dart. dload(result, 'isEmpty'), core.bool ))) {
30366
+ if (dart.test (dart.dload(result, 'isEmpty'))) {
30365
30367
if (isFile) return "/";
30366
- } else if (ensureLeadingSlash && !dart.notNull (dart.as(dart. dsend(result, 'startsWith', '/'), core.bool ))) {
30368
+ } else if (ensureLeadingSlash && !dart.test (dart.dsend(result, 'startsWith', '/'))) {
30367
30369
result = "/" + dart.notNull(dart.as(result, core.String));
30368
30370
}
30369
30371
result = core.Uri._normalizePath(dart.as(result, core.String), scheme, hasAuthority);
@@ -31250,7 +31252,7 @@ dart_library.library('dart_sdk', null, /* Imports */[
31250
31252
let indices = dart.list([core.UriData._noScheme], core.int);
31251
31253
core.UriData._writeUri(dart.as(mimeType, core.String), null, parameters, buffer, indices);
31252
31254
indices[dartx.add](buffer.length);
31253
- if (dart.notNull(dart.as( percentEncoded, core.bool) )) {
31255
+ if (dart.test( percentEncoded)) {
31254
31256
buffer.write(',');
31255
31257
core.UriData._uriEncodeBytes(core.UriData._uricTable, bytes, buffer);
31256
31258
} else {
@@ -33225,13 +33227,13 @@ dart_library.library('dart_sdk', null, /* Imports */[
33225
33227
if (dart.notNull(html_common.isJavaScriptDate(object))) return true;
33226
33228
if (dart.is(object, core.List)) {
33227
33229
for (let i = 0; i < dart.notNull(object[dartx.length]); i++) {
33228
- if (dart.notNull(dart.as( containsDate(object[dartx.get](i)), core.bool ))) return true;
33230
+ if (dart.test( containsDate(object[dartx.get](i)))) return true;
33229
33231
}
33230
33232
}
33231
33233
return false;
33232
33234
}
33233
33235
dart.fn(containsDate);
33234
- if (dart.notNull(dart.as( containsDate(nativeKey), core.bool ))) {
33236
+ if (dart.test( containsDate(nativeKey))) {
33235
33237
dart.throw(new core.UnimplementedError('Key containing DateTime'));
33236
33238
}
33237
33239
return nativeKey;
@@ -69613,21 +69615,21 @@ dart_library.library('dart_sdk', null, /* Imports */[
69613
69615
}
69614
69616
set height(newHeight) {
69615
69617
if (dart.is(newHeight, html$.Dimension)) {
69616
- if (dart.notNull (dart.as(dart. dsend(dart.dload(newHeight, 'value'), '<', 0), core.bool ))) newHeight = new html$.Dimension.px(0);
69618
+ if (dart.test (dart.dsend(dart.dload(newHeight, 'value'), '<', 0))) newHeight = new html$.Dimension.px(0);
69617
69619
this[_element$][dartx.style][dartx.height] = dart.toString(newHeight);
69618
69620
} else if (typeof newHeight == 'number') {
69619
- if (dart.notNull (dart.as(dart. dsend(newHeight, '<', 0), core.bool ))) newHeight = 0;
69621
+ if (dart.test (dart.dsend(newHeight, '<', 0))) newHeight = 0;
69620
69622
this[_element$][dartx.style][dartx.height] = `${newHeight}px`;
69621
69623
} else {
69622
69624
dart.throw(new core.ArgumentError("newHeight is not a Dimension or num"));
69623
69625
}
69624
69626
}
69625
69627
set width(newWidth) {
69626
69628
if (dart.is(newWidth, html$.Dimension)) {
69627
- if (dart.notNull (dart.as(dart. dsend(dart.dload(newWidth, 'value'), '<', 0), core.bool ))) newWidth = new html$.Dimension.px(0);
69629
+ if (dart.test (dart.dsend(dart.dload(newWidth, 'value'), '<', 0))) newWidth = new html$.Dimension.px(0);
69628
69630
this[_element$][dartx.style][dartx.width] = dart.toString(newWidth);
69629
69631
} else if (typeof newWidth == 'number') {
69630
- if (dart.notNull (dart.as(dart. dsend(newWidth, '<', 0), core.bool ))) newWidth = 0;
69632
+ if (dart.test (dart.dsend(newWidth, '<', 0))) newWidth = 0;
69631
69633
this[_element$][dartx.style][dartx.width] = `${newWidth}px`;
69632
69634
} else {
69633
69635
dart.throw(new core.ArgumentError("newWidth is not a Dimension or num"));
0 commit comments