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

Unified Diff: lib/runtime/dart/_interceptors.js

Issue 1355893003: Rewire DDC to use the analyzer task model (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 3 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:
View side-by-side diff with in-line comments
Download patch
Index: lib/runtime/dart/_interceptors.js
diff --git a/lib/runtime/dart/_interceptors.js b/lib/runtime/dart/_interceptors.js
index 17110a9479ab79654f75abc228af994e95746d02..caa5906042a8030d402fc4c87d3233b8797c8b4f 100644
--- a/lib/runtime/dart/_interceptors.js
+++ b/lib/runtime/dart/_interceptors.js
@@ -72,10 +72,10 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
JSArray() {
}
static typed(allocation) {
- return dart.list(allocation, E);
+ return dart.as(dart.list(allocation, E), JSArray$(E));
}
static markFixed(allocation) {
- return JSArray$(E).typed(JSArray$().markFixedList(dart.as(allocation, core.List)));
+ return JSArray$(E).typed(dart.dcall(JSArray$().markFixedList, allocation));
}
static markGrowable(allocation) {
return JSArray$().typed(allocation);
@@ -85,13 +85,13 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
return list;
}
[dartx.checkGrowable](reason) {
- if (this.fixed$length) {
+ if (dart.notNull(dart.as(this.fixed$length, core.bool))) {
dart.throw(new core.UnsupportedError(dart.as(reason, core.String)));
}
}
[dartx.add](value) {
dart.as(value, E);
- this[dartx.checkGrowable]('add');
+ dart.dcall(this[dartx.checkGrowable], 'add');
this.push(value);
}
[dartx.removeAt](index) {
@@ -100,8 +100,8 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
if (dart.notNull(index) < 0 || dart.notNull(index) >= dart.notNull(this[dartx.length])) {
dart.throw(new core.RangeError.value(index));
}
- this[dartx.checkGrowable]('removeAt');
- return this.splice(index, 1)[0];
+ dart.dcall(this[dartx.checkGrowable], 'removeAt');
+ return dart.as(this.splice(index, 1)[0], E);
}
[dartx.insert](index, value) {
dart.as(value, E);
@@ -110,26 +110,26 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
if (dart.notNull(index) < 0 || dart.notNull(index) > dart.notNull(this[dartx.length])) {
dart.throw(new core.RangeError.value(index));
}
- this[dartx.checkGrowable]('insert');
+ dart.dcall(this[dartx.checkGrowable], 'insert');
this.splice(index, 0, value);
}
[dartx.insertAll](index, iterable) {
dart.as(iterable, core.Iterable$(E));
- this[dartx.checkGrowable]('insertAll');
- _internal.IterableMixinWorkaround.insertAllList(this, index, iterable);
+ dart.dcall(this[dartx.checkGrowable], 'insertAll');
+ dart.dcall(_internal.IterableMixinWorkaround.insertAllList, this, index, iterable);
}
[dartx.setAll](index, iterable) {
dart.as(iterable, core.Iterable$(E));
- _internal.IterableMixinWorkaround.setAllList(this, index, iterable);
+ dart.dcall(_internal.IterableMixinWorkaround.setAllList, this, index, iterable);
}
[dartx.removeLast]() {
- this[dartx.checkGrowable]('removeLast');
+ dart.dcall(this[dartx.checkGrowable], 'removeLast');
if (this[dartx.length] == 0)
dart.throw(new core.RangeError.value(-1));
return dart.as(this.pop(), E);
}
[dartx.remove](element) {
- this[dartx.checkGrowable]('remove');
+ dart.dcall(this[dartx.checkGrowable], 'remove');
for (let i = 0; dart.notNull(i) < dart.notNull(this[dartx.length]); i = dart.notNull(i) + 1) {
if (dart.equals(this[dartx.get](i), element)) {
this.splice(i, 1);
@@ -140,24 +140,24 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
}
[dartx.removeWhere](test) {
dart.as(test, dart.functionType(core.bool, [E]));
- _internal.IterableMixinWorkaround.removeWhereList(this, test);
+ dart.dcall(_internal.IterableMixinWorkaround.removeWhereList, this, test);
}
[dartx.retainWhere](test) {
dart.as(test, dart.functionType(core.bool, [E]));
- _internal.IterableMixinWorkaround.removeWhereList(this, dart.fn(element => !dart.notNull(test(element)), core.bool, [E]));
+ dart.dcall(_internal.IterableMixinWorkaround.removeWhereList, this, dart.fn(element => !dart.notNull(test(element)), core.bool, [E]));
}
[dartx.where](f) {
dart.as(f, dart.functionType(core.bool, [E]));
- return new (_internal.IterableMixinWorkaround$(E))().where(this, f);
+ return dart.dcall(new (_internal.IterableMixinWorkaround$(E))().where, this, f);
}
[dartx.expand](f) {
dart.as(f, dart.functionType(core.Iterable, [E]));
- return _internal.IterableMixinWorkaround.expand(this, f);
+ return dart.dcall(_internal.IterableMixinWorkaround.expand, this, f);
}
[dartx.addAll](collection) {
dart.as(collection, core.Iterable$(E));
for (let e of collection) {
- this[dartx.add](e);
+ dart.dcall(this[dartx.add], e);
}
}
[dartx.clear]() {
@@ -175,54 +175,54 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
}
[dartx.map](f) {
dart.as(f, dart.functionType(dart.dynamic, [E]));
- return _internal.IterableMixinWorkaround.mapList(this, f);
+ return dart.dcall(_internal.IterableMixinWorkaround.mapList, this, f);
}
[dartx.join](separator) {
if (separator === void 0)
separator = "";
let list = core.List.new(this[dartx.length]);
for (let i = 0; dart.notNull(i) < dart.notNull(this[dartx.length]); i = dart.notNull(i) + 1) {
- list[dartx.set](i, `${this[dartx.get](i)}`);
+ dart.dsetindex(list, i, `${this[dartx.get](i)}`);
}
- return list.join(separator);
+ return dart.as(list.join(separator), core.String);
}
[dartx.take](n) {
- return new (_internal.IterableMixinWorkaround$(E))().takeList(this, n);
+ return dart.dcall(new (_internal.IterableMixinWorkaround$(E))().takeList, this, n);
}
[dartx.takeWhile](test) {
dart.as(test, dart.functionType(core.bool, [E]));
- return new (_internal.IterableMixinWorkaround$(E))().takeWhile(this, test);
+ return dart.dcall(new (_internal.IterableMixinWorkaround$(E))().takeWhile, this, test);
}
[dartx.skip](n) {
- return new (_internal.IterableMixinWorkaround$(E))().skipList(this, n);
+ return dart.dcall(new (_internal.IterableMixinWorkaround$(E))().skipList, this, n);
}
[dartx.skipWhile](test) {
dart.as(test, dart.functionType(core.bool, [E]));
- return new (_internal.IterableMixinWorkaround$(E))().skipWhile(this, test);
+ return dart.dcall(new (_internal.IterableMixinWorkaround$(E))().skipWhile, this, test);
}
[dartx.reduce](combine) {
dart.as(combine, dart.functionType(E, [E, E]));
- return dart.as(_internal.IterableMixinWorkaround.reduce(this, combine), E);
+ return dart.as(dart.dcall(_internal.IterableMixinWorkaround.reduce, this, combine), E);
}
[dartx.fold](initialValue, combine) {
dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E]));
- return _internal.IterableMixinWorkaround.fold(this, initialValue, combine);
+ return dart.dcall(_internal.IterableMixinWorkaround.fold, this, initialValue, combine);
}
[dartx.firstWhere](test, opts) {
dart.as(test, dart.functionType(core.bool, [E]));
let orElse = opts && 'orElse' in opts ? opts.orElse : null;
dart.as(orElse, dart.functionType(E, []));
- return dart.as(_internal.IterableMixinWorkaround.firstWhere(this, test, orElse), E);
+ return dart.as(dart.dcall(_internal.IterableMixinWorkaround.firstWhere, this, test, orElse), E);
}
[dartx.lastWhere](test, opts) {
dart.as(test, dart.functionType(core.bool, [E]));
let orElse = opts && 'orElse' in opts ? opts.orElse : null;
dart.as(orElse, dart.functionType(E, []));
- return dart.as(_internal.IterableMixinWorkaround.lastWhereList(this, test, orElse), E);
+ return dart.as(dart.dcall(_internal.IterableMixinWorkaround.lastWhereList, this, test, orElse), E);
}
[dartx.singleWhere](test) {
dart.as(test, dart.functionType(core.bool, [E]));
- return dart.as(_internal.IterableMixinWorkaround.singleWhere(this, test), E);
+ return dart.as(dart.dcall(_internal.IterableMixinWorkaround.singleWhere, this, test), E);
}
[dartx.elementAt](index) {
return this[dartx.get](index);
@@ -230,7 +230,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
[dartx.sublist](start, end) {
if (end === void 0)
end = null;
- _js_helper.checkNull(start);
+ dart.dcall(_js_helper.checkNull, start);
if (!(typeof start == 'number'))
dart.throw(new core.ArgumentError(start));
if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(this[dartx.length])) {
@@ -250,7 +250,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
return JSArray$(E).typed(this.slice(start, end));
}
[dartx.getRange](start, end) {
- return new (_internal.IterableMixinWorkaround$(E))().getRangeList(this, start, end);
+ return dart.dcall(new (_internal.IterableMixinWorkaround$(E))().getRangeList, this, start, end);
}
get [dartx.first]() {
if (dart.notNull(this[dartx.length]) > 0)
@@ -270,7 +270,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
dart.throw(new core.StateError("More than one element"));
}
[dartx.removeRange](start, end) {
- this[dartx.checkGrowable]('removeRange');
+ dart.dcall(this[dartx.checkGrowable], 'removeRange');
let receiverLength = this[dartx.length];
if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(receiverLength)) {
dart.throw(new core.RangeError.range(start, 0, receiverLength));
@@ -278,56 +278,56 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dart.notNull(receiverLength)) {
dart.throw(new core.RangeError.range(end, start, receiverLength));
}
- _internal.Lists.copy(this, end, this, start, dart.notNull(receiverLength) - dart.notNull(end));
+ dart.dcall(_internal.Lists.copy, this, end, this, start, dart.notNull(receiverLength) - dart.notNull(end));
this[dartx.length] = dart.notNull(receiverLength) - (dart.notNull(end) - dart.notNull(start));
}
[dartx.setRange](start, end, iterable, skipCount) {
dart.as(iterable, core.Iterable$(E));
if (skipCount === void 0)
skipCount = 0;
- _internal.IterableMixinWorkaround.setRangeList(this, start, end, iterable, skipCount);
+ dart.dcall(_internal.IterableMixinWorkaround.setRangeList, this, start, end, iterable, skipCount);
}
[dartx.fillRange](start, end, fillValue) {
if (fillValue === void 0)
fillValue = null;
dart.as(fillValue, E);
- _internal.IterableMixinWorkaround.fillRangeList(this, start, end, fillValue);
+ dart.dcall(_internal.IterableMixinWorkaround.fillRangeList, this, start, end, fillValue);
}
[dartx.replaceRange](start, end, iterable) {
dart.as(iterable, core.Iterable$(E));
- _internal.IterableMixinWorkaround.replaceRangeList(this, start, end, iterable);
+ dart.dcall(_internal.IterableMixinWorkaround.replaceRangeList, this, start, end, iterable);
}
[dartx.any](f) {
dart.as(f, dart.functionType(core.bool, [E]));
- return _internal.IterableMixinWorkaround.any(this, f);
+ return dart.dcall(_internal.IterableMixinWorkaround.any, this, f);
}
[dartx.every](f) {
dart.as(f, dart.functionType(core.bool, [E]));
- return _internal.IterableMixinWorkaround.every(this, f);
+ return dart.dcall(_internal.IterableMixinWorkaround.every, this, f);
}
get [dartx.reversed]() {
- return new (_internal.IterableMixinWorkaround$(E))().reversedList(this);
+ return dart.dcall(new (_internal.IterableMixinWorkaround$(E))().reversedList, this);
}
[dartx.sort](compare) {
if (compare === void 0)
compare = null;
dart.as(compare, dart.functionType(core.int, [E, E]));
- _internal.IterableMixinWorkaround.sortList(this, compare);
+ dart.dcall(_internal.IterableMixinWorkaround.sortList, this, compare);
}
[dartx.shuffle](random) {
if (random === void 0)
random = null;
- _internal.IterableMixinWorkaround.shuffleList(this, random);
+ dart.dcall(_internal.IterableMixinWorkaround.shuffleList, this, random);
}
[dartx.indexOf](element, start) {
if (start === void 0)
start = 0;
- return _internal.IterableMixinWorkaround.indexOfList(this, element, start);
+ return dart.dcall(_internal.IterableMixinWorkaround.indexOfList, this, element, start);
}
[dartx.lastIndexOf](element, start) {
if (start === void 0)
start = null;
- return _internal.IterableMixinWorkaround.lastIndexOfList(this, element, start);
+ return dart.dcall(_internal.IterableMixinWorkaround.lastIndexOfList, this, element, start);
}
[dartx.contains](other) {
for (let i = 0; dart.notNull(i) < dart.notNull(this[dartx.length]); i = dart.notNull(i) + 1) {
@@ -343,13 +343,13 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
return !dart.notNull(this[dartx.isEmpty]);
}
toString() {
- return collection.ListBase.listToString(this);
+ return dart.dcall(collection.ListBase.listToString, this);
}
[dartx.toList](opts) {
let growable = opts && 'growable' in opts ? opts.growable : true;
let list = this.slice();
if (!dart.notNull(growable))
- JSArray$().markFixedList(dart.as(list, core.List));
+ dart.dcall(JSArray$().markFixedList, list);
return JSArray$(E).typed(list);
}
[dartx.toSet]() {
@@ -359,7 +359,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
return new (_internal.ListIterator$(E))(this);
}
get hashCode() {
- return _js_helper.Primitives.objectHashCode(this);
+ return dart.dcall(_js_helper.Primitives.objectHashCode, this);
}
get [dartx.length]() {
return dart.as(this.length, core.int);
@@ -369,7 +369,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
dart.throw(new core.ArgumentError(newLength));
if (dart.notNull(newLength) < 0)
dart.throw(new core.RangeError.value(newLength));
- this[dartx.checkGrowable]('set length');
+ dart.dcall(this[dartx.checkGrowable], 'set length');
this.length = newLength;
}
[dartx.get](index) {
@@ -389,7 +389,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
return value;
}
[dartx.asMap]() {
- return new (_internal.IterableMixinWorkaround$(E))().asMapList(this);
+ return dart.dcall(new (_internal.IterableMixinWorkaround$(E))().asMapList, this);
}
}
dart.setBaseClass(JSArray, dart.global.Array);
@@ -568,74 +568,74 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
return dart.equals(this, 0) ? (1)[dartx['/']](this) < 0 : this[dartx['<']](0);
}
get [dartx.isNaN]() {
- return isNaN(this);
+ return dart.as(isNaN(this), core.bool);
}
get [dartx.isInfinite]() {
- return this == Infinity || this == -Infinity;
+ return dart.notNull(dart.as(this == Infinity, core.bool)) || dart.notNull(dart.as(this == -Infinity, core.bool));
}
get [dartx.isFinite]() {
- return isFinite(this);
+ return dart.as(isFinite(this), core.bool);
}
[dartx.remainder](b) {
- _js_helper.checkNull(b);
+ dart.dcall(_js_helper.checkNull, b);
if (!dart.is(b, core.num))
dart.throw(new core.ArgumentError(b));
- return this % b;
+ return dart.as(this % b, core.num);
}
[dartx.abs]() {
- return Math.abs(this);
+ return dart.as(Math.abs(this), core.num);
}
get [dartx.sign]() {
return dart.notNull(this[dartx['>']](0)) ? 1 : dart.notNull(this[dartx['<']](0)) ? -1 : this;
}
[dartx.toInt]() {
if (dart.notNull(this[dartx['>=']](JSNumber._MIN_INT32)) && dart.notNull(this[dartx['<=']](JSNumber._MAX_INT32))) {
- return this | 0;
+ return dart.as(this | 0, core.int);
}
- if (isFinite(this)) {
- return this[dartx.truncateToDouble]() + 0;
+ if (dart.notNull(dart.as(isFinite(this), core.bool))) {
+ return dart.as(dart.dcall(this[dartx.truncateToDouble]) + 0, core.int);
}
- dart.throw(new core.UnsupportedError('' + this));
+ dart.throw(new core.UnsupportedError(dart.as('' + this, core.String)));
}
[dartx.truncate]() {
- return this[dartx.toInt]();
+ return dart.dcall(this[dartx.toInt]);
}
[dartx.ceil]() {
- return this[dartx.ceilToDouble]()[dartx.toInt]();
+ return dart.dcall(dart.dcall(this[dartx.ceilToDouble])[dartx.toInt]);
}
[dartx.floor]() {
- return this[dartx.floorToDouble]()[dartx.toInt]();
+ return dart.dcall(dart.dcall(this[dartx.floorToDouble])[dartx.toInt]);
}
[dartx.round]() {
- return this[dartx.roundToDouble]()[dartx.toInt]();
+ return dart.dcall(dart.dcall(this[dartx.roundToDouble])[dartx.toInt]);
}
[dartx.ceilToDouble]() {
- return Math.ceil(this);
+ return dart.as(Math.ceil(this), core.double);
}
[dartx.floorToDouble]() {
- return Math.floor(this);
+ return dart.as(Math.floor(this), core.double);
}
[dartx.roundToDouble]() {
if (dart.notNull(this[dartx['<']](0))) {
- return -Math.round(-this);
+ return dart.as(-Math.round(-this), core.double);
} else {
- return Math.round(this);
+ return dart.as(Math.round(this), core.double);
}
}
[dartx.truncateToDouble]() {
- return dart.notNull(this[dartx['<']](0)) ? this[dartx.ceilToDouble]() : this[dartx.floorToDouble]();
+ return dart.notNull(this[dartx['<']](0)) ? dart.dcall(this[dartx.ceilToDouble]) : dart.dcall(this[dartx.floorToDouble]);
}
[dartx.clamp](lowerLimit, upperLimit) {
if (!dart.is(lowerLimit, core.num))
dart.throw(new core.ArgumentError(lowerLimit));
if (!dart.is(upperLimit, core.num))
dart.throw(new core.ArgumentError(upperLimit));
- if (dart.notNull(lowerLimit[dartx.compareTo](upperLimit)) > 0) {
+ if (dart.notNull(dart.dcall(lowerLimit[dartx.compareTo], upperLimit)) > 0) {
dart.throw(new core.ArgumentError(lowerLimit));
}
- if (dart.notNull(this[dartx.compareTo](lowerLimit)) < 0)
+ if (dart.notNull(dart.dcall(this[dartx.compareTo], lowerLimit)) < 0)
return lowerLimit;
- if (dart.notNull(this[dartx.compareTo](upperLimit)) > 0)
+ if (dart.notNull(dart.dcall(this[dartx.compareTo], upperLimit)) > 0)
return upperLimit;
return this;
}
@@ -643,11 +643,11 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
return this;
}
[dartx.toStringAsFixed](fractionDigits) {
- _js_helper.checkInt(fractionDigits);
+ dart.dcall(_js_helper.checkInt, fractionDigits);
if (dart.notNull(fractionDigits) < 0 || dart.notNull(fractionDigits) > 20) {
dart.throw(new core.RangeError(fractionDigits));
}
- let result = this.toFixed(fractionDigits);
+ let result = dart.as(this.toFixed(fractionDigits), core.String);
if (dart.equals(this, 0) && dart.notNull(this[dartx.isNegative]))
return `-${result}`;
return result;
@@ -657,148 +657,148 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
fractionDigits = null;
let result = null;
if (fractionDigits != null) {
- _js_helper.checkInt(fractionDigits);
+ dart.dcall(_js_helper.checkInt, fractionDigits);
if (dart.notNull(fractionDigits) < 0 || dart.notNull(fractionDigits) > 20) {
dart.throw(new core.RangeError(fractionDigits));
}
- result = this.toExponential(fractionDigits);
+ result = dart.as(this.toExponential(fractionDigits), core.String);
} else {
- result = this.toExponential();
+ result = dart.as(this.toExponential(), core.String);
}
if (dart.equals(this, 0) && dart.notNull(this[dartx.isNegative]))
return `-${result}`;
return result;
}
[dartx.toStringAsPrecision](precision) {
- _js_helper.checkInt(precision);
+ dart.dcall(_js_helper.checkInt, precision);
if (dart.notNull(precision) < 1 || dart.notNull(precision) > 21) {
dart.throw(new core.RangeError(precision));
}
- let result = this.toPrecision(precision);
+ let result = dart.as(this.toPrecision(precision), core.String);
if (dart.equals(this, 0) && dart.notNull(this[dartx.isNegative]))
return `-${result}`;
return result;
}
[dartx.toRadixString](radix) {
- _js_helper.checkInt(radix);
+ dart.dcall(_js_helper.checkInt, radix);
if (dart.notNull(radix) < 2 || dart.notNull(radix) > 36)
dart.throw(new core.RangeError(radix));
- let result = this.toString(radix);
+ let result = dart.as(this.toString(radix), core.String);
let rightParenCode = 41;
- if (result[dartx.codeUnitAt](dart.notNull(result[dartx.length]) - 1) != rightParenCode) {
+ if (dart.dcall(result[dartx.codeUnitAt], dart.notNull(result[dartx.length]) - 1) != rightParenCode) {
return result;
}
- return JSNumber._handleIEtoString(result);
+ return dart.dcall(JSNumber._handleIEtoString, result);
}
static _handleIEtoString(result) {
let match = /^([\da-z]+)(?:\.([\da-z]+))?\(e\+(\d+)\)$/.exec(result);
if (match == null) {
dart.throw(new core.UnsupportedError(`Unexpected toString result: ${result}`));
}
- result = dart.dindex(match, 1);
- let exponent = +dart.dindex(match, 3);
+ result = dart.as(dart.dindex(match, 1), core.String);
+ let exponent = dart.as(+dart.dindex(match, 3), core.int);
if (dart.dindex(match, 2) != null) {
- result = result + dart.dindex(match, 2);
- exponent = dart.notNull(exponent) - dart.dindex(match, 2).length;
+ result = dart.as(result + dart.dindex(match, 2), core.String);
+ exponent = dart.notNull(exponent) - dart.notNull(dart.as(dart.dindex(match, 2).length, core.int));
}
return dart.notNull(result) + "0"[dartx['*']](exponent);
}
toString() {
- if (dart.equals(this, 0) && 1 / this < 0) {
+ if (dart.equals(this, 0) && dart.notNull(dart.as(1 / this < 0, core.bool))) {
return '-0.0';
} else {
- return "" + this;
+ return dart.as("" + this, core.String);
}
}
get hashCode() {
- return this & 0x1FFFFFFF;
+ return dart.as(this & 0x1FFFFFFF, core.int);
}
[dartx['unary-']]() {
- return -this;
+ return dart.as(-this, core.num);
}
[dartx['+']](other) {
if (!dart.is(other, core.num))
dart.throw(new core.ArgumentError(other));
- return this + other;
+ return dart.as(this + other, core.num);
}
[dartx['-']](other) {
if (!dart.is(other, core.num))
dart.throw(new core.ArgumentError(other));
- return this - other;
+ return dart.as(this - other, core.num);
}
[dartx['/']](other) {
if (!dart.is(other, core.num))
dart.throw(new core.ArgumentError(other));
- return this / other;
+ return dart.as(this / other, core.double);
}
[dartx['*']](other) {
if (!dart.is(other, core.num))
dart.throw(new core.ArgumentError(other));
- return this * other;
+ return dart.as(this * other, core.num);
}
[dartx['%']](other) {
if (!dart.is(other, core.num))
dart.throw(new core.ArgumentError(other));
- let result = this % other;
+ let result = dart.as(this % other, core.num);
if (result == 0)
return 0;
if (dart.notNull(result) > 0)
return result;
- if (other < 0) {
- return dart.notNull(result) - other;
+ if (dart.notNull(dart.as(dart.dsend(other, '<', 0), core.bool))) {
+ return dart.notNull(result) - dart.notNull(dart.as(other, core.num));
} else {
- return dart.notNull(result) + other;
+ return dart.notNull(result) + dart.notNull(dart.as(other, core.num));
}
}
[_isInt32](value) {
- return (value | 0) === value;
+ return dart.as((value | 0) === value, core.bool);
}
[dartx['~/']](other) {
if (false)
- this[_tdivFast](other);
- if (dart.notNull(this[_isInt32](this)) && dart.notNull(this[_isInt32](other)) && 0 != other && -1 != other) {
- return this / other | 0;
+ dart.dcall(this[_tdivFast], other);
+ if (dart.notNull(dart.dcall(this[_isInt32], this)) && dart.notNull(dart.dcall(this[_isInt32], other)) && 0 != other && -1 != other) {
+ return dart.as(this / other | 0, core.int);
} else {
- return this[_tdivSlow](other);
+ return dart.dcall(this[_tdivSlow], other);
}
}
[_tdivFast](other) {
- return dart.notNull(this[_isInt32](this)) ? this / other | 0 : (this / other)[dartx.toInt]();
+ return dart.notNull(dart.dcall(this[_isInt32], this)) ? dart.as(this / other | 0, core.int) : dart.as(dart.dsend(this / other, 'toInt'), core.int);
}
[_tdivSlow](other) {
if (!dart.is(other, core.num))
dart.throw(new core.ArgumentError(other));
- return (this / other)[dartx.toInt]();
+ return dart.as(dart.dsend(this / other, 'toInt'), core.int);
}
[dartx['<<']](other) {
if (!dart.is(other, core.num))
dart.throw(new core.ArgumentError(other));
- if (other < 0)
+ if (dart.notNull(dart.as(dart.dsend(other, '<', 0), core.bool)))
dart.throw(new core.ArgumentError(other));
- return this[_shlPositive](other);
+ return dart.dcall(this[_shlPositive], other);
}
[_shlPositive](other) {
- return other > 31 ? 0 : dart.as(this << other >>> 0, core.num);
+ return dart.notNull(dart.as(other > 31, core.bool)) ? 0 : dart.as(this << other >>> 0, core.num);
}
[dartx['>>']](other) {
if (false)
- this[_shrReceiverPositive](other);
+ dart.dcall(this[_shrReceiverPositive], other);
if (!dart.is(other, core.num))
dart.throw(new core.ArgumentError(other));
- if (other < 0)
+ if (dart.notNull(dart.as(dart.dsend(other, '<', 0), core.bool)))
dart.throw(new core.ArgumentError(other));
- return this[_shrOtherPositive](other);
+ return dart.dcall(this[_shrOtherPositive], other);
}
[_shrOtherPositive](other) {
- return this > 0 ? this[_shrBothPositive](other) : dart.as(this >> (dart.notNull(other) > 31 ? 31 : other) >>> 0, core.num);
+ return dart.notNull(dart.as(dart.dsend(this, '>', 0), core.bool)) ? dart.dcall(this[_shrBothPositive], other) : dart.as(this >> (dart.notNull(other) > 31 ? 31 : other) >>> 0, core.num);
}
[_shrReceiverPositive](other) {
- if (other < 0)
+ if (dart.notNull(dart.as(dart.dsend(other, '<', 0), core.bool)))
dart.throw(new core.ArgumentError(other));
- return this[_shrBothPositive](other);
+ return dart.dcall(this[_shrBothPositive], other);
}
[_shrBothPositive](other) {
- return other > 31 ? 0 : dart.as(this >>> other, core.num);
+ return dart.notNull(dart.as(other > 31, core.bool)) ? 0 : dart.as(this >>> other, core.num);
}
[dartx['&']](other) {
if (!dart.is(other, core.num))
@@ -818,22 +818,22 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
[dartx['<']](other) {
if (!dart.is(other, core.num))
dart.throw(new core.ArgumentError(other));
- return this < other;
+ return dart.as(this < other, core.bool);
}
[dartx['>']](other) {
if (!dart.is(other, core.num))
dart.throw(new core.ArgumentError(other));
- return this > other;
+ return dart.as(this > other, core.bool);
}
[dartx['<=']](other) {
if (!dart.is(other, core.num))
dart.throw(new core.ArgumentError(other));
- return this <= other;
+ return dart.as(this <= other, core.bool);
}
[dartx['>=']](other) {
if (!dart.is(other, core.num))
dart.throw(new core.ArgumentError(other));
- return this >= other;
+ return dart.as(this >= other, core.bool);
}
get runtimeType() {
return core.num;
@@ -856,7 +856,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
[dartx.roundToDouble]: [core.double, []],
[dartx.truncateToDouble]: [core.double, []],
[dartx.clamp]: [core.num, [core.num, core.num]],
- [dartx.toDouble]: [core.double, []],
+ [dartx.toDouble]: [dart.dynamic, []],
[dartx.toStringAsFixed]: [core.String, [core.int]],
[dartx.toStringAsExponential]: [core.String, [], [core.int]],
[dartx.toStringAsPrecision]: [core.String, [core.int]],
@@ -920,33 +920,33 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
let nonneg = dart.notNull(this[dartx['<']](0)) ? dart.notNull(this[dartx['unary-']]()) - 1 : this;
if (dart.notNull(nonneg) >= 4294967296) {
nonneg = (dart.notNull(nonneg) / 4294967296)[dartx.truncate]();
- return dart.notNull(JSInt._bitCount(JSInt._spread(nonneg))) + 32;
+ return dart.notNull(dart.dcall(JSInt._bitCount, dart.dcall(JSInt._spread, nonneg))) + 32;
}
- return JSInt._bitCount(JSInt._spread(nonneg));
+ return dart.dcall(JSInt._bitCount, dart.dcall(JSInt._spread, nonneg));
}
static _bitCount(i) {
- i = dart.notNull(JSInt._shru(i, 0)) - (dart.notNull(JSInt._shru(i, 1)) & 1431655765);
- i = (dart.notNull(i) & 858993459) + (dart.notNull(JSInt._shru(i, 2)) & 858993459);
- i = 252645135 & dart.notNull(i) + dart.notNull(JSInt._shru(i, 4));
- i = dart.notNull(i) + dart.notNull(JSInt._shru(i, 8));
- i = dart.notNull(i) + dart.notNull(JSInt._shru(i, 16));
+ i = dart.notNull(dart.dcall(JSInt._shru, i, 0)) - (dart.notNull(dart.dcall(JSInt._shru, i, 1)) & 1431655765);
+ i = (dart.notNull(i) & 858993459) + (dart.notNull(dart.dcall(JSInt._shru, i, 2)) & 858993459);
+ i = 252645135 & dart.notNull(i) + dart.notNull(dart.dcall(JSInt._shru, i, 4));
+ i = dart.notNull(i) + dart.notNull(dart.dcall(JSInt._shru, i, 8));
+ i = dart.notNull(i) + dart.notNull(dart.dcall(JSInt._shru, i, 16));
return dart.notNull(i) & 63;
}
static _shru(value, shift) {
- return value >>> shift;
+ return dart.as(value >>> shift, core.int);
}
static _shrs(value, shift) {
- return value >> shift;
+ return dart.as(value >> shift, core.int);
}
static _ors(a, b) {
- return a | b;
+ return dart.as(a | b, core.int);
}
static _spread(i) {
- i = JSInt._ors(i, JSInt._shrs(i, 1));
- i = JSInt._ors(i, JSInt._shrs(i, 2));
- i = JSInt._ors(i, JSInt._shrs(i, 4));
- i = JSInt._ors(i, JSInt._shrs(i, 8));
- i = JSInt._shru(JSInt._ors(i, JSInt._shrs(i, 16)), 0);
+ i = dart.dcall(JSInt._ors, i, dart.dcall(JSInt._shrs, i, 1));
+ i = dart.dcall(JSInt._ors, i, dart.dcall(JSInt._shrs, i, 2));
+ i = dart.dcall(JSInt._ors, i, dart.dcall(JSInt._shrs, i, 4));
+ i = dart.dcall(JSInt._ors, i, dart.dcall(JSInt._shrs, i, 8));
+ i = dart.dcall(JSInt._shru, dart.dcall(JSInt._ors, i, dart.dcall(JSInt._shrs, i, 16)), 0);
return i;
}
get runtimeType() {
@@ -1049,12 +1049,12 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
[dartx.allMatches](string, start) {
if (start === void 0)
start = 0;
- _js_helper.checkString(string);
- _js_helper.checkInt(start);
+ dart.dcall(_js_helper.checkString, string);
+ dart.dcall(_js_helper.checkInt, start);
if (0 > dart.notNull(start) || dart.notNull(start) > dart.notNull(string[dartx.length])) {
dart.throw(new core.RangeError.range(start, 0, string[dartx.length]));
}
- return _js_helper.allMatchesInStringUnchecked(this, string, start);
+ return dart.dcall(_js_helper.allMatchesInStringUnchecked, this, string, start);
}
[dartx.matchAsPrefix](string, start) {
if (start === void 0)
@@ -1065,7 +1065,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
if (dart.notNull(start) + dart.notNull(this[dartx.length]) > dart.notNull(string[dartx.length]))
return null;
for (let i = 0; dart.notNull(i) < dart.notNull(this[dartx.length]); i = dart.notNull(i) + 1) {
- if (string[dartx.codeUnitAt](dart.notNull(start) + dart.notNull(i)) != this[dartx.codeUnitAt](i)) {
+ if (dart.dcall(string[dartx.codeUnitAt], dart.notNull(start) + dart.notNull(i)) != dart.dcall(this[dartx.codeUnitAt], i)) {
return null;
}
}
@@ -1074,72 +1074,72 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
[dartx['+']](other) {
if (!(typeof other == 'string'))
dart.throw(new core.ArgumentError(other));
- return this + other;
+ return dart.as(this + other, core.String);
}
[dartx.endsWith](other) {
- _js_helper.checkString(other);
+ dart.dcall(_js_helper.checkString, other);
let otherLength = other[dartx.length];
if (dart.notNull(otherLength) > dart.notNull(this[dartx.length]))
return false;
- return other == this[dartx.substring](dart.notNull(this[dartx.length]) - dart.notNull(otherLength));
+ return other == dart.dcall(this[dartx.substring], dart.notNull(this[dartx.length]) - dart.notNull(otherLength));
}
[dartx.replaceAll](from, to) {
- _js_helper.checkString(to);
- return dart.as(_js_helper.stringReplaceAllUnchecked(this, from, to), core.String);
+ dart.dcall(_js_helper.checkString, to);
+ return dart.as(dart.dcall(_js_helper.stringReplaceAllUnchecked, this, from, to), core.String);
}
[dartx.replaceAllMapped](from, convert) {
- return this[dartx.splitMapJoin](from, {onMatch: convert});
+ return dart.dcall(this[dartx.splitMapJoin], from, {onMatch: convert});
}
[dartx.splitMapJoin](from, opts) {
let onMatch = opts && 'onMatch' in opts ? opts.onMatch : null;
let onNonMatch = opts && 'onNonMatch' in opts ? opts.onNonMatch : null;
- return dart.as(_js_helper.stringReplaceAllFuncUnchecked(this, from, onMatch, onNonMatch), core.String);
+ return dart.as(dart.dcall(_js_helper.stringReplaceAllFuncUnchecked, this, from, onMatch, onNonMatch), core.String);
}
[dartx.replaceFirst](from, to, startIndex) {
if (startIndex === void 0)
startIndex = 0;
- _js_helper.checkString(to);
- _js_helper.checkInt(startIndex);
+ dart.dcall(_js_helper.checkString, to);
+ dart.dcall(_js_helper.checkInt, startIndex);
if (dart.notNull(startIndex) < 0 || dart.notNull(startIndex) > dart.notNull(this[dartx.length])) {
dart.throw(new core.RangeError.range(startIndex, 0, this[dartx.length]));
}
- return dart.as(_js_helper.stringReplaceFirstUnchecked(this, from, to, startIndex), core.String);
+ return dart.as(dart.dcall(_js_helper.stringReplaceFirstUnchecked, this, from, to, startIndex), core.String);
}
[dartx.split](pattern) {
- _js_helper.checkNull(pattern);
+ dart.dcall(_js_helper.checkNull, pattern);
if (typeof pattern == 'string') {
return dart.as(this.split(pattern), core.List$(core.String));
- } else if (dart.is(pattern, _js_helper.JSSyntaxRegExp) && _js_helper.regExpCaptureCount(pattern) == 0) {
- let re = _js_helper.regExpGetNative(pattern);
+ } else if (dart.is(pattern, _js_helper.JSSyntaxRegExp) && dart.dcall(_js_helper.regExpCaptureCount, pattern) == 0) {
+ let re = dart.dcall(_js_helper.regExpGetNative, pattern);
return dart.as(this.split(re), core.List$(core.String));
} else {
- return this[_defaultSplit](pattern);
+ return dart.dcall(this[_defaultSplit], pattern);
}
}
[_defaultSplit](pattern) {
let result = dart.list([], core.String);
let start = 0;
let length = 1;
- for (let match of pattern[dartx.allMatches](this)) {
- let matchStart = match.start;
- let matchEnd = match.end;
+ for (let match of dart.dcall(pattern[dartx.allMatches], this)) {
+ let matchStart = dart.as(dart.dload(match, 'start'), core.int);
+ let matchEnd = dart.as(dart.dload(match, 'end'), core.int);
length = dart.notNull(matchEnd) - dart.notNull(matchStart);
if (length == 0 && start == matchStart) {
continue;
}
let end = matchStart;
- result[dartx.add](this[dartx.substring](start, end));
+ dart.dcall(result[dartx.add], dart.dcall(this[dartx.substring], start, end));
start = matchEnd;
}
if (dart.notNull(start) < dart.notNull(this[dartx.length]) || dart.notNull(length) > 0) {
- result[dartx.add](this[dartx.substring](start));
+ dart.dcall(result[dartx.add], dart.dcall(this[dartx.substring], start));
}
return result;
}
[dartx.startsWith](pattern, index) {
if (index === void 0)
index = 0;
- _js_helper.checkInt(index);
+ dart.dcall(_js_helper.checkInt, index);
if (dart.notNull(index) < 0 || dart.notNull(index) > dart.notNull(this[dartx.length])) {
dart.throw(new core.RangeError.range(index, 0, this[dartx.length]));
}
@@ -1149,30 +1149,30 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
let endIndex = dart.notNull(index) + dart.notNull(otherLength);
if (dart.notNull(endIndex) > dart.notNull(this[dartx.length]))
return false;
- return other == this.substring(index, endIndex);
+ return dart.equals(other, this.substring(index, endIndex));
}
- return pattern[dartx.matchAsPrefix](this, index) != null;
+ return dart.dcall(pattern[dartx.matchAsPrefix], this, index) != null;
}
[dartx.substring](startIndex, endIndex) {
if (endIndex === void 0)
endIndex = null;
- _js_helper.checkInt(startIndex);
+ dart.dcall(_js_helper.checkInt, startIndex);
if (endIndex == null)
endIndex = this[dartx.length];
- _js_helper.checkInt(endIndex);
+ dart.dcall(_js_helper.checkInt, endIndex);
if (dart.notNull(startIndex) < 0)
dart.throw(new core.RangeError.value(startIndex));
if (dart.notNull(startIndex) > dart.notNull(endIndex))
dart.throw(new core.RangeError.value(startIndex));
if (dart.notNull(endIndex) > dart.notNull(this[dartx.length]))
dart.throw(new core.RangeError.value(endIndex));
- return this.substring(startIndex, endIndex);
+ return dart.as(this.substring(startIndex, endIndex), core.String);
}
[dartx.toLowerCase]() {
- return this.toLowerCase();
+ return dart.as(this.toLowerCase(), core.String);
}
[dartx.toUpperCase]() {
- return this.toUpperCase();
+ return dart.as(this.toUpperCase(), core.String);
}
static _isWhitespace(codeUnit) {
if (dart.notNull(codeUnit) < 256) {
@@ -1227,8 +1227,8 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
let SPACE = 32;
let CARRIAGE_RETURN = 13;
while (dart.notNull(index) < dart.notNull(string[dartx.length])) {
- let codeUnit = string[dartx.codeUnitAt](index);
- if (codeUnit != SPACE && codeUnit != CARRIAGE_RETURN && !dart.notNull(JSString._isWhitespace(codeUnit))) {
+ let codeUnit = dart.dcall(string[dartx.codeUnitAt], index);
+ if (codeUnit != SPACE && codeUnit != CARRIAGE_RETURN && !dart.notNull(dart.dcall(JSString._isWhitespace, codeUnit))) {
break;
}
index = dart.notNull(index) + 1;
@@ -1239,8 +1239,8 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
let SPACE = 32;
let CARRIAGE_RETURN = 13;
while (dart.notNull(index) > 0) {
- let codeUnit = string[dartx.codeUnitAt](dart.notNull(index) - 1);
- if (codeUnit != SPACE && codeUnit != CARRIAGE_RETURN && !dart.notNull(JSString._isWhitespace(codeUnit))) {
+ let codeUnit = dart.dcall(string[dartx.codeUnitAt], dart.notNull(index) - 1);
+ if (codeUnit != SPACE && codeUnit != CARRIAGE_RETURN && !dart.notNull(dart.dcall(JSString._isWhitespace, codeUnit))) {
break;
}
index = dart.notNull(index) - 1;
@@ -1249,69 +1249,69 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
}
[dartx.trim]() {
let NEL = 133;
- let result = this.trim();
+ let result = dart.as(this.trim(), core.String);
if (result[dartx.length] == 0)
return result;
- let firstCode = result[dartx.codeUnitAt](0);
+ let firstCode = dart.dcall(result[dartx.codeUnitAt], 0);
let startIndex = 0;
if (firstCode == NEL) {
- startIndex = JSString._skipLeadingWhitespace(result, 1);
+ startIndex = dart.dcall(JSString._skipLeadingWhitespace, result, 1);
if (startIndex == result[dartx.length])
return "";
}
let endIndex = result[dartx.length];
- let lastCode = result[dartx.codeUnitAt](dart.notNull(endIndex) - 1);
+ let lastCode = dart.dcall(result[dartx.codeUnitAt], dart.notNull(endIndex) - 1);
if (lastCode == NEL) {
- endIndex = JSString._skipTrailingWhitespace(result, dart.notNull(endIndex) - 1);
+ endIndex = dart.dcall(JSString._skipTrailingWhitespace, result, dart.notNull(endIndex) - 1);
}
if (startIndex == 0 && endIndex == result[dartx.length])
return result;
- return result.substring(startIndex, endIndex);
+ return dart.as(result.substring(startIndex, endIndex), core.String);
}
[dartx.trimLeft]() {
let NEL = 133;
let result = null;
let startIndex = 0;
- if (typeof this.trimLeft != "undefined") {
- result = this.trimLeft();
+ if (dart.notNull(dart.as(typeof this.trimLeft != "undefined", core.bool))) {
+ result = dart.as(this.trimLeft(), core.String);
if (result[dartx.length] == 0)
return result;
- let firstCode = result[dartx.codeUnitAt](0);
+ let firstCode = dart.dcall(result[dartx.codeUnitAt], 0);
if (firstCode == NEL) {
- startIndex = JSString._skipLeadingWhitespace(result, 1);
+ startIndex = dart.dcall(JSString._skipLeadingWhitespace, result, 1);
}
} else {
result = this;
- startIndex = JSString._skipLeadingWhitespace(this, 0);
+ startIndex = dart.dcall(JSString._skipLeadingWhitespace, this, 0);
}
if (startIndex == 0)
return result;
if (startIndex == result[dartx.length])
return "";
- return result.substring(startIndex);
+ return dart.as(result.substring(startIndex), core.String);
}
[dartx.trimRight]() {
let NEL = 133;
let result = null;
let endIndex = null;
- if (typeof this.trimRight != "undefined") {
- result = this.trimRight();
+ if (dart.notNull(dart.as(typeof this.trimRight != "undefined", core.bool))) {
+ result = dart.as(this.trimRight(), core.String);
endIndex = result[dartx.length];
if (endIndex == 0)
return result;
- let lastCode = result[dartx.codeUnitAt](dart.notNull(endIndex) - 1);
+ let lastCode = dart.dcall(result[dartx.codeUnitAt], dart.notNull(endIndex) - 1);
if (lastCode == NEL) {
- endIndex = JSString._skipTrailingWhitespace(result, dart.notNull(endIndex) - 1);
+ endIndex = dart.dcall(JSString._skipTrailingWhitespace, result, dart.notNull(endIndex) - 1);
}
} else {
result = this;
- endIndex = JSString._skipTrailingWhitespace(this, this[dartx.length]);
+ endIndex = dart.dcall(JSString._skipTrailingWhitespace, this, this[dartx.length]);
}
if (endIndex == result[dartx.length])
return result;
if (endIndex == 0)
return "";
- return result.substring(0, endIndex);
+ return dart.as(result.substring(0, endIndex), core.String);
}
[dartx['*']](times) {
if (0 >= dart.notNull(times))
@@ -1325,13 +1325,13 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
let s = this;
while (true) {
if ((dart.notNull(times) & 1) == 1)
- result = s[dartx['+']](result);
+ result = dart.dsend(s, '+', result);
times = dart.as(times >>> 1, core.int);
if (times == 0)
break;
- s = s[dartx['+']](s);
+ s = dart.dsend(s, '+', s);
}
- return result;
+ return dart.as(result, core.String);
}
[dartx.padLeft](width, padding) {
if (padding === void 0)
@@ -1358,22 +1358,22 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
[dartx.indexOf](pattern, start) {
if (start === void 0)
start = 0;
- _js_helper.checkNull(pattern);
+ dart.dcall(_js_helper.checkNull, pattern);
if (!(typeof start == 'number'))
dart.throw(new core.ArgumentError(start));
if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(this[dartx.length])) {
dart.throw(new core.RangeError.range(start, 0, this[dartx.length]));
}
if (typeof pattern == 'string') {
- return this.indexOf(pattern, start);
+ return dart.as(this.indexOf(pattern, start), core.int);
}
if (dart.is(pattern, _js_helper.JSSyntaxRegExp)) {
let re = pattern;
- let match = _js_helper.firstMatchAfter(re, this, start);
+ let match = dart.dcall(_js_helper.firstMatchAfter, re, this, start);
return match == null ? -1 : match.start;
}
for (let i = start; dart.notNull(i) <= dart.notNull(this[dartx.length]); i = dart.notNull(i) + 1) {
- if (pattern[dartx.matchAsPrefix](this, i) != null)
+ if (dart.dcall(pattern[dartx.matchAsPrefix], this, i) != null)
return i;
}
return -1;
@@ -1381,7 +1381,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
[dartx.lastIndexOf](pattern, start) {
if (start === void 0)
start = null;
- _js_helper.checkNull(pattern);
+ dart.dcall(_js_helper.checkNull, pattern);
if (start == null) {
start = this[dartx.length];
} else if (!(typeof start == 'number')) {
@@ -1394,10 +1394,10 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
if (dart.notNull(start) + dart.notNull(other[dartx.length]) > dart.notNull(this[dartx.length])) {
start = dart.notNull(this[dartx.length]) - dart.notNull(other[dartx.length]);
}
- return dart.as(_js_helper.stringLastIndexOfUnchecked(this, other, start), core.int);
+ return dart.as(dart.dcall(_js_helper.stringLastIndexOfUnchecked, this, other, start), core.int);
}
for (let i = start; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
- if (pattern[dartx.matchAsPrefix](this, i) != null)
+ if (dart.dcall(pattern[dartx.matchAsPrefix], this, i) != null)
return i;
}
return -1;
@@ -1405,11 +1405,11 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
[dartx.contains](other, startIndex) {
if (startIndex === void 0)
startIndex = 0;
- _js_helper.checkNull(other);
+ dart.dcall(_js_helper.checkNull, other);
if (dart.notNull(startIndex) < 0 || dart.notNull(startIndex) > dart.notNull(this[dartx.length])) {
dart.throw(new core.RangeError.range(startIndex, 0, this[dartx.length]));
}
- return dart.as(_js_helper.stringContainsUnchecked(this, other, startIndex), core.bool);
+ return dart.as(dart.dcall(_js_helper.stringContainsUnchecked, this, other, startIndex), core.bool);
}
get [dartx.isEmpty]() {
return this[dartx.length] == 0;
@@ -1420,7 +1420,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
[dartx.compareTo](other) {
if (!(typeof other == 'string'))
dart.throw(new core.ArgumentError(other));
- return dart.equals(this, other) ? 0 : this < other ? -1 : 1;
+ return dart.equals(this, other) ? 0 : dart.notNull(dart.as(this < other, core.bool)) ? -1 : 1;
}
toString() {
return this;
@@ -1428,26 +1428,26 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
get hashCode() {
let hash = 0;
for (let i = 0; dart.notNull(i) < dart.notNull(this[dartx.length]); i = dart.notNull(i) + 1) {
- hash = 536870911 & dart.notNull(hash) + this.charCodeAt(i);
+ hash = 536870911 & dart.notNull(dart.notNull(hash) + dart.notNull(dart.as(this.charCodeAt(i), core.num)));
hash = 536870911 & dart.notNull(hash) + ((524287 & dart.notNull(hash)) << 10);
- hash = hash ^ hash >> 6;
+ hash = dart.as(hash ^ hash >> 6, core.int);
}
hash = 536870911 & dart.notNull(hash) + ((67108863 & dart.notNull(hash)) << 3);
- hash = hash ^ hash >> 11;
+ hash = dart.as(hash ^ hash >> 11, core.int);
return 536870911 & dart.notNull(hash) + ((16383 & dart.notNull(hash)) << 15);
}
get runtimeType() {
return core.String;
}
get [dartx.length]() {
- return this.length;
+ return dart.as(this.length, core.int);
}
[dartx.get](index) {
if (!(typeof index == 'number'))
dart.throw(new core.ArgumentError(index));
if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0)
dart.throw(new core.RangeError.value(index));
- return this[index];
+ return dart.as(this[index], core.String);
}
}
JSString[dart.implements] = () => [core.String, JSIndexable];
@@ -1499,7 +1499,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
return this[_string][dartx.length];
}
get(i) {
- return this[_string][dartx.codeUnitAt](i);
+ return dart.dcall(this[_string][dartx.codeUnitAt], i);
}
}
dart.setSignature(_CodeUnits, {
@@ -1521,7 +1521,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
super.Interceptor();
}
toString() {
- return String(this);
+ return dart.as(String(this), core.String);
}
get hashCode() {
return this ? 2 * 3 * 23 * 3761 : 269 * 811;
@@ -1567,7 +1567,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
super.JavaScriptObject();
}
toString() {
- return String(this);
+ return dart.as(String(this), core.String);
}
}
dart.setSignature(UnknownJavaScriptObject, {

Powered by Google App Engine
This is Rietveld 408576698