| Index: lib/runtime/dart/_interceptors.js
|
| diff --git a/lib/runtime/dart/_interceptors.js b/lib/runtime/dart/_interceptors.js
|
| index 58ebc1e15f638478016ac4d35ddcb8b61f7b6091..a89526555df23f7aff0f40a04fd2be178924ecb4 100644
|
| --- a/lib/runtime/dart/_interceptors.js
|
| +++ b/lib/runtime/dart/_interceptors.js
|
| @@ -7,6 +7,64 @@ var math = dart.import(math);
|
| (function(exports, core, _internal, _js_helper, collection, math) {
|
| 'use strict';
|
| let JSArray$ = dart.generic(function(E) {
|
| + dart.defineExtensionNames([
|
| + 'checkGrowable',
|
| + 'add',
|
| + 'removeAt',
|
| + 'insert',
|
| + 'insertAll',
|
| + 'setAll',
|
| + 'removeLast',
|
| + 'remove',
|
| + 'removeWhere',
|
| + 'retainWhere',
|
| + 'where',
|
| + 'expand',
|
| + 'addAll',
|
| + 'clear',
|
| + 'forEach',
|
| + 'map',
|
| + 'join',
|
| + 'take',
|
| + 'takeWhile',
|
| + 'skip',
|
| + 'skipWhile',
|
| + 'reduce',
|
| + 'fold',
|
| + 'firstWhere',
|
| + 'lastWhere',
|
| + 'singleWhere',
|
| + 'elementAt',
|
| + 'sublist',
|
| + 'getRange',
|
| + 'first',
|
| + 'last',
|
| + 'single',
|
| + 'removeRange',
|
| + 'setRange',
|
| + 'fillRange',
|
| + 'replaceRange',
|
| + 'any',
|
| + 'every',
|
| + 'reversed',
|
| + 'sort',
|
| + 'shuffle',
|
| + 'indexOf',
|
| + 'lastIndexOf',
|
| + 'contains',
|
| + 'isEmpty',
|
| + 'isNotEmpty',
|
| + 'toString',
|
| + 'toList',
|
| + 'toSet',
|
| + 'iterator',
|
| + 'hashCode',
|
| + 'length',
|
| + 'length',
|
| + 'get',
|
| + 'set',
|
| + 'asMap'
|
| + ]);
|
| class JSArray extends core.Object {
|
| JSArray() {
|
| }
|
| @@ -23,17 +81,17 @@ var math = dart.import(math);
|
| list.fixed$length = Array;
|
| return list;
|
| }
|
| - checkGrowable(reason) {
|
| + [dartx.checkGrowable](reason) {
|
| if (this.fixed$length) {
|
| throw new core.UnsupportedError(dart.as(reason, core.String));
|
| }
|
| }
|
| - add(value) {
|
| + [dartx.add](value) {
|
| dart.as(value, E);
|
| this[dartx.checkGrowable]('add');
|
| this.push(value);
|
| }
|
| - removeAt(index) {
|
| + [dartx.removeAt](index) {
|
| if (!(typeof index == 'number'))
|
| throw new core.ArgumentError(index);
|
| if (dart.notNull(index) < 0 || dart.notNull(index) >= dart.notNull(this.length)) {
|
| @@ -42,7 +100,7 @@ var math = dart.import(math);
|
| this[dartx.checkGrowable]('removeAt');
|
| return this.splice(index, 1)[0];
|
| }
|
| - insert(index, value) {
|
| + [dartx.insert](index, value) {
|
| dart.as(value, E);
|
| if (!(typeof index == 'number'))
|
| throw new core.ArgumentError(index);
|
| @@ -52,22 +110,22 @@ var math = dart.import(math);
|
| this[dartx.checkGrowable]('insert');
|
| this.splice(index, 0, value);
|
| }
|
| - insertAll(index, iterable) {
|
| + [dartx.insertAll](index, iterable) {
|
| dart.as(iterable, core.Iterable$(E));
|
| this[dartx.checkGrowable]('insertAll');
|
| _internal.IterableMixinWorkaround.insertAllList(this, index, iterable);
|
| }
|
| - setAll(index, iterable) {
|
| + [dartx.setAll](index, iterable) {
|
| dart.as(iterable, core.Iterable$(E));
|
| _internal.IterableMixinWorkaround.setAllList(this, index, iterable);
|
| }
|
| - removeLast() {
|
| + [dartx.removeLast]() {
|
| this[dartx.checkGrowable]('removeLast');
|
| if (this.length == 0)
|
| throw new core.RangeError.value(-1);
|
| return dart.as(this.pop(), E);
|
| }
|
| - remove(element) {
|
| + [dartx.remove](element) {
|
| this[dartx.checkGrowable]('remove');
|
| for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.notNull(i) + 1) {
|
| if (dart.equals(this[dartx.get](i), element)) {
|
| @@ -77,32 +135,32 @@ var math = dart.import(math);
|
| }
|
| return false;
|
| }
|
| - removeWhere(test) {
|
| + [dartx.removeWhere](test) {
|
| dart.as(test, dart.functionType(core.bool, [E]));
|
| _internal.IterableMixinWorkaround.removeWhereList(this, test);
|
| }
|
| - retainWhere(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]));
|
| }
|
| - where(f) {
|
| + [dartx.where](f) {
|
| dart.as(f, dart.functionType(core.bool, [E]));
|
| return new (_internal.IterableMixinWorkaround$(E))().where(this, f);
|
| }
|
| - expand(f) {
|
| + [dartx.expand](f) {
|
| dart.as(f, dart.functionType(core.Iterable, [E]));
|
| return _internal.IterableMixinWorkaround.expand(this, f);
|
| }
|
| - addAll(collection) {
|
| + [dartx.addAll](collection) {
|
| dart.as(collection, core.Iterable$(E));
|
| for (let e of collection) {
|
| this[dartx.add](e);
|
| }
|
| }
|
| - clear() {
|
| + [dartx.clear]() {
|
| this.length = 0;
|
| }
|
| - forEach(f) {
|
| + [dartx.forEach](f) {
|
| dart.as(f, dart.functionType(dart.void, [E]));
|
| let length = this.length;
|
| for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull(i) + 1) {
|
| @@ -112,11 +170,11 @@ var math = dart.import(math);
|
| }
|
| }
|
| }
|
| - map(f) {
|
| + [dartx.map](f) {
|
| dart.as(f, dart.functionType(core.Object, [E]));
|
| return _internal.IterableMixinWorkaround.mapList(this, f);
|
| }
|
| - join(separator) {
|
| + [dartx.join](separator) {
|
| if (separator === void 0)
|
| separator = "";
|
| let list = core.List.new(this.length);
|
| @@ -125,48 +183,48 @@ var math = dart.import(math);
|
| }
|
| return list.join(separator);
|
| }
|
| - take(n) {
|
| + [dartx.take](n) {
|
| return new (_internal.IterableMixinWorkaround$(E))().takeList(this, n);
|
| }
|
| - takeWhile(test) {
|
| + [dartx.takeWhile](test) {
|
| dart.as(test, dart.functionType(core.bool, [E]));
|
| return new (_internal.IterableMixinWorkaround$(E))().takeWhile(this, test);
|
| }
|
| - skip(n) {
|
| + [dartx.skip](n) {
|
| return new (_internal.IterableMixinWorkaround$(E))().skipList(this, n);
|
| }
|
| - skipWhile(test) {
|
| + [dartx.skipWhile](test) {
|
| dart.as(test, dart.functionType(core.bool, [E]));
|
| return new (_internal.IterableMixinWorkaround$(E))().skipWhile(this, test);
|
| }
|
| - reduce(combine) {
|
| + [dartx.reduce](combine) {
|
| dart.as(combine, dart.functionType(E, [E, E]));
|
| return dart.as(_internal.IterableMixinWorkaround.reduce(this, combine), E);
|
| }
|
| - fold(initialValue, combine) {
|
| + [dartx.fold](initialValue, combine) {
|
| dart.as(combine, dart.functionType(core.Object, [dart.bottom, E]));
|
| return _internal.IterableMixinWorkaround.fold(this, initialValue, combine);
|
| }
|
| - firstWhere(test, opts) {
|
| + [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);
|
| }
|
| - lastWhere(test, opts) {
|
| + [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);
|
| }
|
| - singleWhere(test) {
|
| + [dartx.singleWhere](test) {
|
| dart.as(test, dart.functionType(core.bool, [E]));
|
| return dart.as(_internal.IterableMixinWorkaround.singleWhere(this, test), E);
|
| }
|
| - elementAt(index) {
|
| + [dartx.elementAt](index) {
|
| return this[dartx.get](index);
|
| }
|
| - sublist(start, end) {
|
| + [dartx.sublist](start, end) {
|
| if (end === void 0)
|
| end = null;
|
| _js_helper.checkNull(start);
|
| @@ -188,27 +246,27 @@ var math = dart.import(math);
|
| return dart.list([], E);
|
| return JSArray$(E).typed(this.slice(start, end));
|
| }
|
| - getRange(start, end) {
|
| + [dartx.getRange](start, end) {
|
| return new (_internal.IterableMixinWorkaround$(E))().getRangeList(this, start, end);
|
| }
|
| - get first() {
|
| + get [dartx.first]() {
|
| if (dart.notNull(this.length) > 0)
|
| return this[dartx.get](0);
|
| throw new core.StateError("No elements");
|
| }
|
| - get last() {
|
| + get [dartx.last]() {
|
| if (dart.notNull(this.length) > 0)
|
| return this[dartx.get](dart.notNull(this.length) - 1);
|
| throw new core.StateError("No elements");
|
| }
|
| - get single() {
|
| + get [dartx.single]() {
|
| if (this.length == 1)
|
| return this[dartx.get](0);
|
| if (this.length == 0)
|
| throw new core.StateError("No elements");
|
| throw new core.StateError("More than one element");
|
| }
|
| - removeRange(start, end) {
|
| + [dartx.removeRange](start, end) {
|
| this[dartx.checkGrowable]('removeRange');
|
| let receiverLength = this.length;
|
| if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(receiverLength)) {
|
| @@ -220,84 +278,84 @@ var math = dart.import(math);
|
| _internal.Lists.copy(this, end, this, start, dart.notNull(receiverLength) - dart.notNull(end));
|
| this.length = dart.notNull(receiverLength) - (dart.notNull(end) - dart.notNull(start));
|
| }
|
| - setRange(start, end, iterable, skipCount) {
|
| + [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);
|
| }
|
| - fillRange(start, end, fillValue) {
|
| + [dartx.fillRange](start, end, fillValue) {
|
| if (fillValue === void 0)
|
| fillValue = null;
|
| dart.as(fillValue, E);
|
| _internal.IterableMixinWorkaround.fillRangeList(this, start, end, fillValue);
|
| }
|
| - replaceRange(start, end, iterable) {
|
| + [dartx.replaceRange](start, end, iterable) {
|
| dart.as(iterable, core.Iterable$(E));
|
| _internal.IterableMixinWorkaround.replaceRangeList(this, start, end, iterable);
|
| }
|
| - any(f) {
|
| + [dartx.any](f) {
|
| dart.as(f, dart.functionType(core.bool, [E]));
|
| return _internal.IterableMixinWorkaround.any(this, f);
|
| }
|
| - every(f) {
|
| + [dartx.every](f) {
|
| dart.as(f, dart.functionType(core.bool, [E]));
|
| return _internal.IterableMixinWorkaround.every(this, f);
|
| }
|
| - get reversed() {
|
| + get [dartx.reversed]() {
|
| return new (_internal.IterableMixinWorkaround$(E))().reversedList(this);
|
| }
|
| - sort(compare) {
|
| + [dartx.sort](compare) {
|
| if (compare === void 0)
|
| compare = null;
|
| dart.as(compare, dart.functionType(core.int, [E, E]));
|
| _internal.IterableMixinWorkaround.sortList(this, compare);
|
| }
|
| - shuffle(random) {
|
| + [dartx.shuffle](random) {
|
| if (random === void 0)
|
| random = null;
|
| _internal.IterableMixinWorkaround.shuffleList(this, random);
|
| }
|
| - indexOf(element, start) {
|
| + [dartx.indexOf](element, start) {
|
| if (start === void 0)
|
| start = 0;
|
| return _internal.IterableMixinWorkaround.indexOfList(this, element, start);
|
| }
|
| - lastIndexOf(element, start) {
|
| + [dartx.lastIndexOf](element, start) {
|
| if (start === void 0)
|
| start = null;
|
| return _internal.IterableMixinWorkaround.lastIndexOfList(this, element, start);
|
| }
|
| - contains(other) {
|
| + [dartx.contains](other) {
|
| for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.notNull(i) + 1) {
|
| if (dart.equals(this[dartx.get](i), other))
|
| return true;
|
| }
|
| return false;
|
| }
|
| - get isEmpty() {
|
| + get [dartx.isEmpty]() {
|
| return this.length == 0;
|
| }
|
| - get isNotEmpty() {
|
| + get [dartx.isNotEmpty]() {
|
| return !dart.notNull(this[dartx.isEmpty]);
|
| }
|
| - toString() {
|
| + [dartx.toString]() {
|
| return collection.ListBase.listToString(this);
|
| }
|
| - toList(opts) {
|
| + [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));
|
| return JSArray$(E).typed(list);
|
| }
|
| - toSet() {
|
| + [dartx.toSet]() {
|
| return core.Set$(E).from(this);
|
| }
|
| - get iterator() {
|
| + get [dartx.iterator]() {
|
| return new (_internal.ListIterator$(E))(this);
|
| }
|
| - get hashCode() {
|
| + get [dartx.hashCode]() {
|
| return _js_helper.Primitives.objectHashCode(this);
|
| }
|
| get length() {
|
| @@ -311,14 +369,14 @@ var math = dart.import(math);
|
| this[dartx.checkGrowable]('set length');
|
| this.length = newLength;
|
| }
|
| - get(index) {
|
| + [dartx.get](index) {
|
| if (!(typeof index == 'number'))
|
| throw new core.ArgumentError(index);
|
| if (dart.notNull(index) >= dart.notNull(this.length) || dart.notNull(index) < 0)
|
| throw new core.RangeError.value(index);
|
| return dart.as(this[index], E);
|
| }
|
| - set(index, value) {
|
| + [dartx.set](index, value) {
|
| dart.as(value, E);
|
| if (!(typeof index == 'number'))
|
| throw new core.ArgumentError(index);
|
| @@ -326,7 +384,7 @@ var math = dart.import(math);
|
| throw new core.RangeError.value(index);
|
| this[index] = value;
|
| }
|
| - asMap() {
|
| + [dartx.asMap]() {
|
| return new (_internal.IterableMixinWorkaround$(E))().asMapList(this);
|
| }
|
| }
|
| @@ -340,51 +398,51 @@ var math = dart.import(math);
|
| markGrowable: [JSArray$(E), [core.Object]]
|
| }),
|
| methods: () => ({
|
| - checkGrowable: [core.Object, [core.Object]],
|
| - add: [dart.void, [E]],
|
| - removeAt: [E, [core.int]],
|
| - insert: [dart.void, [core.int, E]],
|
| - insertAll: [dart.void, [core.int, core.Iterable$(E)]],
|
| - setAll: [dart.void, [core.int, core.Iterable$(E)]],
|
| - removeLast: [E, []],
|
| - remove: [core.bool, [core.Object]],
|
| - removeWhere: [dart.void, [dart.functionType(core.bool, [E])]],
|
| - retainWhere: [dart.void, [dart.functionType(core.bool, [E])]],
|
| - where: [core.Iterable$(E), [dart.functionType(core.bool, [E])]],
|
| - expand: [core.Iterable, [dart.functionType(core.Iterable, [E])]],
|
| - addAll: [dart.void, [core.Iterable$(E)]],
|
| - clear: [dart.void, []],
|
| - forEach: [dart.void, [dart.functionType(dart.void, [E])]],
|
| - map: [core.Iterable, [dart.functionType(core.Object, [E])]],
|
| - join: [core.String, [], [core.String]],
|
| - take: [core.Iterable$(E), [core.int]],
|
| - takeWhile: [core.Iterable$(E), [dart.functionType(core.bool, [E])]],
|
| - skip: [core.Iterable$(E), [core.int]],
|
| - skipWhile: [core.Iterable$(E), [dart.functionType(core.bool, [E])]],
|
| - reduce: [E, [dart.functionType(E, [E, E])]],
|
| - fold: [core.Object, [core.Object, dart.functionType(core.Object, [dart.bottom, E])]],
|
| - firstWhere: [E, [dart.functionType(core.bool, [E])], {orElse: dart.functionType(E, [])}],
|
| - lastWhere: [E, [dart.functionType(core.bool, [E])], {orElse: dart.functionType(E, [])}],
|
| - singleWhere: [E, [dart.functionType(core.bool, [E])]],
|
| - elementAt: [E, [core.int]],
|
| - sublist: [core.List$(E), [core.int], [core.int]],
|
| - getRange: [core.Iterable$(E), [core.int, core.int]],
|
| - removeRange: [dart.void, [core.int, core.int]],
|
| - setRange: [dart.void, [core.int, core.int, core.Iterable$(E)], [core.int]],
|
| - fillRange: [dart.void, [core.int, core.int], [E]],
|
| - replaceRange: [dart.void, [core.int, core.int, core.Iterable$(E)]],
|
| - any: [core.bool, [dart.functionType(core.bool, [E])]],
|
| - every: [core.bool, [dart.functionType(core.bool, [E])]],
|
| - sort: [dart.void, [], [dart.functionType(core.int, [E, E])]],
|
| - shuffle: [dart.void, [], [math.Random]],
|
| - indexOf: [core.int, [core.Object], [core.int]],
|
| - lastIndexOf: [core.int, [core.Object], [core.int]],
|
| - contains: [core.bool, [core.Object]],
|
| - toList: [core.List$(E), [], {growable: core.bool}],
|
| - toSet: [core.Set$(E), []],
|
| - get: [E, [core.int]],
|
| - set: [dart.void, [core.int, E]],
|
| - asMap: [core.Map$(core.int, E), []]
|
| + [dartx.checkGrowable]: [core.Object, [core.Object]],
|
| + [dartx.add]: [dart.void, [E]],
|
| + [dartx.removeAt]: [E, [core.int]],
|
| + [dartx.insert]: [dart.void, [core.int, E]],
|
| + [dartx.insertAll]: [dart.void, [core.int, core.Iterable$(E)]],
|
| + [dartx.setAll]: [dart.void, [core.int, core.Iterable$(E)]],
|
| + [dartx.removeLast]: [E, []],
|
| + [dartx.remove]: [core.bool, [core.Object]],
|
| + [dartx.removeWhere]: [dart.void, [dart.functionType(core.bool, [E])]],
|
| + [dartx.retainWhere]: [dart.void, [dart.functionType(core.bool, [E])]],
|
| + [dartx.where]: [core.Iterable$(E), [dart.functionType(core.bool, [E])]],
|
| + [dartx.expand]: [core.Iterable, [dart.functionType(core.Iterable, [E])]],
|
| + [dartx.addAll]: [dart.void, [core.Iterable$(E)]],
|
| + [dartx.clear]: [dart.void, []],
|
| + [dartx.forEach]: [dart.void, [dart.functionType(dart.void, [E])]],
|
| + [dartx.map]: [core.Iterable, [dart.functionType(core.Object, [E])]],
|
| + [dartx.join]: [core.String, [], [core.String]],
|
| + [dartx.take]: [core.Iterable$(E), [core.int]],
|
| + [dartx.takeWhile]: [core.Iterable$(E), [dart.functionType(core.bool, [E])]],
|
| + [dartx.skip]: [core.Iterable$(E), [core.int]],
|
| + [dartx.skipWhile]: [core.Iterable$(E), [dart.functionType(core.bool, [E])]],
|
| + [dartx.reduce]: [E, [dart.functionType(E, [E, E])]],
|
| + [dartx.fold]: [core.Object, [core.Object, dart.functionType(core.Object, [dart.bottom, E])]],
|
| + [dartx.firstWhere]: [E, [dart.functionType(core.bool, [E])], {orElse: dart.functionType(E, [])}],
|
| + [dartx.lastWhere]: [E, [dart.functionType(core.bool, [E])], {orElse: dart.functionType(E, [])}],
|
| + [dartx.singleWhere]: [E, [dart.functionType(core.bool, [E])]],
|
| + [dartx.elementAt]: [E, [core.int]],
|
| + [dartx.sublist]: [core.List$(E), [core.int], [core.int]],
|
| + [dartx.getRange]: [core.Iterable$(E), [core.int, core.int]],
|
| + [dartx.removeRange]: [dart.void, [core.int, core.int]],
|
| + [dartx.setRange]: [dart.void, [core.int, core.int, core.Iterable$(E)], [core.int]],
|
| + [dartx.fillRange]: [dart.void, [core.int, core.int], [E]],
|
| + [dartx.replaceRange]: [dart.void, [core.int, core.int, core.Iterable$(E)]],
|
| + [dartx.any]: [core.bool, [dart.functionType(core.bool, [E])]],
|
| + [dartx.every]: [core.bool, [dart.functionType(core.bool, [E])]],
|
| + [dartx.sort]: [dart.void, [], [dart.functionType(core.int, [E, E])]],
|
| + [dartx.shuffle]: [dart.void, [], [math.Random]],
|
| + [dartx.indexOf]: [core.int, [core.Object], [core.int]],
|
| + [dartx.lastIndexOf]: [core.int, [core.Object], [core.int]],
|
| + [dartx.contains]: [core.bool, [core.Object]],
|
| + [dartx.toList]: [core.List$(E), [], {growable: core.bool}],
|
| + [dartx.toSet]: [core.Set$(E), []],
|
| + [dartx.get]: [E, [core.int]],
|
| + [dartx.set]: [dart.void, [core.int, E]],
|
| + [dartx.asMap]: [core.Map$(core.int, E), []]
|
| }),
|
| statics: () => ({markFixedList: [core.List, [core.List]]}),
|
| names: ['markFixedList']
|
| @@ -431,7 +489,7 @@ var math = dart.import(math);
|
| JSNumber() {
|
| super.Interceptor();
|
| }
|
| - compareTo(b) {
|
| + [dartx.compareTo](b) {
|
| if (!dart.is(b, core.num))
|
| throw new core.ArgumentError(b);
|
| if (dart.notNull(this[dartx['<']](b))) {
|
| @@ -457,31 +515,31 @@ var math = dart.import(math);
|
| return -1;
|
| }
|
| }
|
| - get isNegative() {
|
| + get [dartx.isNegative]() {
|
| return dart.equals(this, 0) ? (1)[dartx['/']](this) < 0 : this[dartx['<']](0);
|
| }
|
| - get isNaN() {
|
| + get [dartx.isNaN]() {
|
| return isNaN(this);
|
| }
|
| - get isInfinite() {
|
| + get [dartx.isInfinite]() {
|
| return this == Infinity || this == -Infinity;
|
| }
|
| - get isFinite() {
|
| + get [dartx.isFinite]() {
|
| return isFinite(this);
|
| }
|
| - remainder(b) {
|
| + [dartx.remainder](b) {
|
| _js_helper.checkNull(b);
|
| if (!dart.is(b, core.num))
|
| throw new core.ArgumentError(b);
|
| return this % b;
|
| }
|
| - abs() {
|
| + [dartx.abs]() {
|
| return Math.abs(this);
|
| }
|
| - get sign() {
|
| + get [dartx.sign]() {
|
| return dart.notNull(this[dartx['>']](0)) ? 1 : dart.notNull(this[dartx['<']](0)) ? -1 : this;
|
| }
|
| - toInt() {
|
| + [dartx.toInt]() {
|
| if (dart.notNull(this[dartx['>=']](JSNumber._MIN_INT32)) && dart.notNull(this[dartx['<=']](JSNumber._MAX_INT32))) {
|
| return this | 0;
|
| }
|
| @@ -490,35 +548,35 @@ var math = dart.import(math);
|
| }
|
| throw new core.UnsupportedError('' + this);
|
| }
|
| - truncate() {
|
| + [dartx.truncate]() {
|
| return this[dartx.toInt]();
|
| }
|
| - ceil() {
|
| + [dartx.ceil]() {
|
| return this[dartx.ceilToDouble]()[dartx.toInt]();
|
| }
|
| - floor() {
|
| + [dartx.floor]() {
|
| return this[dartx.floorToDouble]()[dartx.toInt]();
|
| }
|
| - round() {
|
| + [dartx.round]() {
|
| return this[dartx.roundToDouble]()[dartx.toInt]();
|
| }
|
| - ceilToDouble() {
|
| + [dartx.ceilToDouble]() {
|
| return Math.ceil(this);
|
| }
|
| - floorToDouble() {
|
| + [dartx.floorToDouble]() {
|
| return Math.floor(this);
|
| }
|
| - roundToDouble() {
|
| + [dartx.roundToDouble]() {
|
| if (dart.notNull(this[dartx['<']](0))) {
|
| return -Math.round(-this);
|
| } else {
|
| return Math.round(this);
|
| }
|
| }
|
| - truncateToDouble() {
|
| + [dartx.truncateToDouble]() {
|
| return dart.notNull(this[dartx['<']](0)) ? this[dartx.ceilToDouble]() : this[dartx.floorToDouble]();
|
| }
|
| - clamp(lowerLimit, upperLimit) {
|
| + [dartx.clamp](lowerLimit, upperLimit) {
|
| if (!dart.is(lowerLimit, core.num))
|
| throw new core.ArgumentError(lowerLimit);
|
| if (!dart.is(upperLimit, core.num))
|
| @@ -532,10 +590,10 @@ var math = dart.import(math);
|
| return upperLimit;
|
| return this;
|
| }
|
| - toDouble() {
|
| + [dartx.toDouble]() {
|
| return this;
|
| }
|
| - toStringAsFixed(fractionDigits) {
|
| + [dartx.toStringAsFixed](fractionDigits) {
|
| _js_helper.checkInt(fractionDigits);
|
| if (dart.notNull(fractionDigits) < 0 || dart.notNull(fractionDigits) > 20) {
|
| throw new core.RangeError(fractionDigits);
|
| @@ -545,7 +603,7 @@ var math = dart.import(math);
|
| return `-${result}`;
|
| return result;
|
| }
|
| - toStringAsExponential(fractionDigits) {
|
| + [dartx.toStringAsExponential](fractionDigits) {
|
| if (fractionDigits === void 0)
|
| fractionDigits = null;
|
| let result = null;
|
| @@ -562,7 +620,7 @@ var math = dart.import(math);
|
| return `-${result}`;
|
| return result;
|
| }
|
| - toStringAsPrecision(precision) {
|
| + [dartx.toStringAsPrecision](precision) {
|
| _js_helper.checkInt(precision);
|
| if (dart.notNull(precision) < 1 || dart.notNull(precision) > 21) {
|
| throw new core.RangeError(precision);
|
| @@ -572,7 +630,7 @@ var math = dart.import(math);
|
| return `-${result}`;
|
| return result;
|
| }
|
| - toRadixString(radix) {
|
| + [dartx.toRadixString](radix) {
|
| _js_helper.checkInt(radix);
|
| if (dart.notNull(radix) < 2 || dart.notNull(radix) > 36)
|
| throw new core.RangeError(radix);
|
| @@ -596,40 +654,40 @@ var math = dart.import(math);
|
| }
|
| return dart.notNull(result) + "0"[dartx['*']](exponent);
|
| }
|
| - toString() {
|
| + [dartx.toString]() {
|
| if (dart.equals(this, 0) && 1 / this < 0) {
|
| return '-0.0';
|
| } else {
|
| return "" + this;
|
| }
|
| }
|
| - get hashCode() {
|
| + get [dartx.hashCode]() {
|
| return this & 0x1FFFFFFF;
|
| }
|
| - ['unary-']() {
|
| + [dartx['unary-']]() {
|
| return -this;
|
| }
|
| - ['+'](other) {
|
| + [dartx['+']](other) {
|
| if (!dart.is(other, core.num))
|
| throw new core.ArgumentError(other);
|
| return this + other;
|
| }
|
| - ['-'](other) {
|
| + [dartx['-']](other) {
|
| if (!dart.is(other, core.num))
|
| throw new core.ArgumentError(other);
|
| return this - other;
|
| }
|
| - ['/'](other) {
|
| + [dartx['/']](other) {
|
| if (!dart.is(other, core.num))
|
| throw new core.ArgumentError(other);
|
| return this / other;
|
| }
|
| - ['*'](other) {
|
| + [dartx['*']](other) {
|
| if (!dart.is(other, core.num))
|
| throw new core.ArgumentError(other);
|
| return this * other;
|
| }
|
| - ['%'](other) {
|
| + [dartx['%']](other) {
|
| if (!dart.is(other, core.num))
|
| throw new core.ArgumentError(other);
|
| let result = this % other;
|
| @@ -646,7 +704,7 @@ var math = dart.import(math);
|
| [_isInt32](value) {
|
| return (value | 0) === value;
|
| }
|
| - ['~/'](other) {
|
| + [dartx['~/']](other) {
|
| if (false)
|
| this[_tdivFast](other);
|
| if (dart.notNull(this[_isInt32](this)) && dart.notNull(this[_isInt32](other)) && 0 != other && -1 != other) {
|
| @@ -663,7 +721,7 @@ var math = dart.import(math);
|
| throw new core.ArgumentError(other);
|
| return (this / other)[dartx.toInt]();
|
| }
|
| - ['<<'](other) {
|
| + [dartx['<<']](other) {
|
| if (!dart.is(other, core.num))
|
| throw new core.ArgumentError(other);
|
| if (other < 0)
|
| @@ -673,7 +731,7 @@ var math = dart.import(math);
|
| [_shlPositive](other) {
|
| return other > 31 ? 0 : dart.as(this << other >>> 0, core.num);
|
| }
|
| - ['>>'](other) {
|
| + [dartx['>>']](other) {
|
| if (false)
|
| this[_shrReceiverPositive](other);
|
| if (!dart.is(other, core.num))
|
| @@ -693,42 +751,42 @@ var math = dart.import(math);
|
| [_shrBothPositive](other) {
|
| return other > 31 ? 0 : dart.as(this >>> other, core.num);
|
| }
|
| - ['&'](other) {
|
| + [dartx['&']](other) {
|
| if (!dart.is(other, core.num))
|
| throw new core.ArgumentError(other);
|
| return dart.as((this & other) >>> 0, core.num);
|
| }
|
| - ['|'](other) {
|
| + [dartx['|']](other) {
|
| if (!dart.is(other, core.num))
|
| throw new core.ArgumentError(other);
|
| return dart.as((this | other) >>> 0, core.num);
|
| }
|
| - ['^'](other) {
|
| + [dartx['^']](other) {
|
| if (!dart.is(other, core.num))
|
| throw new core.ArgumentError(other);
|
| return dart.as((this ^ other) >>> 0, core.num);
|
| }
|
| - ['<'](other) {
|
| + [dartx['<']](other) {
|
| if (!dart.is(other, core.num))
|
| throw new core.ArgumentError(other);
|
| return this < other;
|
| }
|
| - ['>'](other) {
|
| + [dartx['>']](other) {
|
| if (!dart.is(other, core.num))
|
| throw new core.ArgumentError(other);
|
| return this > other;
|
| }
|
| - ['<='](other) {
|
| + [dartx['<=']](other) {
|
| if (!dart.is(other, core.num))
|
| throw new core.ArgumentError(other);
|
| return this <= other;
|
| }
|
| - ['>='](other) {
|
| + [dartx['>=']](other) {
|
| if (!dart.is(other, core.num))
|
| throw new core.ArgumentError(other);
|
| return this >= other;
|
| }
|
| - get runtimeType() {
|
| + get [dartx.runtimeType]() {
|
| return core.num;
|
| }
|
| }
|
| @@ -736,71 +794,80 @@ var math = dart.import(math);
|
| dart.setSignature(JSNumber, {
|
| constructors: () => ({JSNumber: [JSNumber, []]}),
|
| methods: () => ({
|
| - compareTo: [core.int, [core.num]],
|
| - remainder: [core.num, [core.num]],
|
| - abs: [core.num, []],
|
| - toInt: [core.int, []],
|
| - truncate: [core.int, []],
|
| - ceil: [core.int, []],
|
| - floor: [core.int, []],
|
| - round: [core.int, []],
|
| - ceilToDouble: [core.double, []],
|
| - floorToDouble: [core.double, []],
|
| - roundToDouble: [core.double, []],
|
| - truncateToDouble: [core.double, []],
|
| - clamp: [core.num, [core.num, core.num]],
|
| - toDouble: [core.double, []],
|
| - toStringAsFixed: [core.String, [core.int]],
|
| - toStringAsExponential: [core.String, [], [core.int]],
|
| - toStringAsPrecision: [core.String, [core.int]],
|
| - toRadixString: [core.String, [core.int]],
|
| - 'unary-': [core.num, []],
|
| - '+': [core.num, [core.num]],
|
| - '-': [core.num, [core.num]],
|
| - '/': [core.double, [core.num]],
|
| - '*': [core.num, [core.num]],
|
| - '%': [core.num, [core.num]],
|
| + [dartx.compareTo]: [core.int, [core.num]],
|
| + [dartx.remainder]: [core.num, [core.num]],
|
| + [dartx.abs]: [core.num, []],
|
| + [dartx.toInt]: [core.int, []],
|
| + [dartx.truncate]: [core.int, []],
|
| + [dartx.ceil]: [core.int, []],
|
| + [dartx.floor]: [core.int, []],
|
| + [dartx.round]: [core.int, []],
|
| + [dartx.ceilToDouble]: [core.double, []],
|
| + [dartx.floorToDouble]: [core.double, []],
|
| + [dartx.roundToDouble]: [core.double, []],
|
| + [dartx.truncateToDouble]: [core.double, []],
|
| + [dartx.clamp]: [core.num, [core.num, core.num]],
|
| + [dartx.toDouble]: [core.double, []],
|
| + [dartx.toStringAsFixed]: [core.String, [core.int]],
|
| + [dartx.toStringAsExponential]: [core.String, [], [core.int]],
|
| + [dartx.toStringAsPrecision]: [core.String, [core.int]],
|
| + [dartx.toRadixString]: [core.String, [core.int]],
|
| + [dartx['unary-']]: [core.num, []],
|
| + [dartx['+']]: [core.num, [core.num]],
|
| + [dartx['-']]: [core.num, [core.num]],
|
| + [dartx['/']]: [core.double, [core.num]],
|
| + [dartx['*']]: [core.num, [core.num]],
|
| + [dartx['%']]: [core.num, [core.num]],
|
| [_isInt32]: [core.bool, [core.Object]],
|
| - '~/': [core.int, [core.num]],
|
| + [dartx['~/']]: [core.int, [core.num]],
|
| [_tdivFast]: [core.int, [core.num]],
|
| [_tdivSlow]: [core.int, [core.num]],
|
| - '<<': [core.num, [core.num]],
|
| + [dartx['<<']]: [core.num, [core.num]],
|
| [_shlPositive]: [core.num, [core.num]],
|
| - '>>': [core.num, [core.num]],
|
| + [dartx['>>']]: [core.num, [core.num]],
|
| [_shrOtherPositive]: [core.num, [core.num]],
|
| [_shrReceiverPositive]: [core.num, [core.num]],
|
| [_shrBothPositive]: [core.num, [core.num]],
|
| - '&': [core.num, [core.num]],
|
| - '|': [core.num, [core.num]],
|
| - '^': [core.num, [core.num]],
|
| - '<': [core.bool, [core.num]],
|
| - '>': [core.bool, [core.num]],
|
| - '<=': [core.bool, [core.num]],
|
| - '>=': [core.bool, [core.num]]
|
| + [dartx['&']]: [core.num, [core.num]],
|
| + [dartx['|']]: [core.num, [core.num]],
|
| + [dartx['^']]: [core.num, [core.num]],
|
| + [dartx['<']]: [core.bool, [core.num]],
|
| + [dartx['>']]: [core.bool, [core.num]],
|
| + [dartx['<=']]: [core.bool, [core.num]],
|
| + [dartx['>=']]: [core.bool, [core.num]]
|
| }),
|
| statics: () => ({_handleIEtoString: [core.String, [core.String]]}),
|
| names: ['_handleIEtoString']
|
| });
|
| JSNumber._MIN_INT32 = -2147483648;
|
| JSNumber._MAX_INT32 = 2147483647;
|
| + dart.defineExtensionNames([
|
| + 'isEven',
|
| + 'isOdd',
|
| + 'toUnsigned',
|
| + 'toSigned',
|
| + 'bitLength',
|
| + 'runtimeType',
|
| + '~'
|
| + ]);
|
| class JSInt extends JSNumber {
|
| JSInt() {
|
| super.JSNumber();
|
| }
|
| - get isEven() {
|
| + get [dartx.isEven]() {
|
| return this[dartx['&']](1) == 0;
|
| }
|
| - get isOdd() {
|
| + get [dartx.isOdd]() {
|
| return this[dartx['&']](1) == 1;
|
| }
|
| - toUnsigned(width) {
|
| + [dartx.toUnsigned](width) {
|
| return this[dartx['&']]((1 << dart.notNull(width)) - 1);
|
| }
|
| - toSigned(width) {
|
| + [dartx.toSigned](width) {
|
| let signMask = 1 << dart.notNull(width) - 1;
|
| return dart.notNull(this[dartx['&']](dart.notNull(signMask) - 1)) - dart.notNull(this[dartx['&']](signMask));
|
| }
|
| - get bitLength() {
|
| + get [dartx.bitLength]() {
|
| let nonneg = dart.notNull(this[dartx['<']](0)) ? dart.notNull(this[dartx['unary-']]()) - 1 : this;
|
| if (dart.notNull(nonneg) >= 4294967296) {
|
| nonneg = (dart.notNull(nonneg) / 4294967296).truncate();
|
| @@ -833,10 +900,10 @@ var math = dart.import(math);
|
| i = JSInt._shru(JSInt._ors(i, JSInt._shrs(i, 16)), 0);
|
| return i;
|
| }
|
| - get runtimeType() {
|
| + get [dartx.runtimeType]() {
|
| return core.int;
|
| }
|
| - ['~']() {
|
| + [dartx['~']]() {
|
| return dart.as(~this >>> 0, core.int);
|
| }
|
| }
|
| @@ -844,9 +911,9 @@ var math = dart.import(math);
|
| dart.setSignature(JSInt, {
|
| constructors: () => ({JSInt: [JSInt, []]}),
|
| methods: () => ({
|
| - toUnsigned: [core.int, [core.int]],
|
| - toSigned: [core.int, [core.int]],
|
| - '~': [core.int, []]
|
| + [dartx.toUnsigned]: [core.int, [core.int]],
|
| + [dartx.toSigned]: [core.int, [core.int]],
|
| + [dartx['~']]: [core.int, []]
|
| }),
|
| statics: () => ({
|
| _bitCount: [core.int, [core.int]],
|
| @@ -862,7 +929,7 @@ var math = dart.import(math);
|
| JSDouble() {
|
| super.JSNumber();
|
| }
|
| - get runtimeType() {
|
| + get [dartx.runtimeType]() {
|
| return core.double;
|
| }
|
| }
|
| @@ -878,11 +945,46 @@ var math = dart.import(math);
|
| class JSUInt32 extends JSPositiveInt {}
|
| class JSUInt31 extends JSUInt32 {}
|
| let _defaultSplit = Symbol('_defaultSplit');
|
| + dart.defineExtensionNames([
|
| + 'codeUnitAt',
|
| + 'allMatches',
|
| + 'matchAsPrefix',
|
| + '+',
|
| + 'endsWith',
|
| + 'replaceAll',
|
| + 'replaceAllMapped',
|
| + 'splitMapJoin',
|
| + 'replaceFirst',
|
| + 'split',
|
| + 'startsWith',
|
| + 'substring',
|
| + 'toLowerCase',
|
| + 'toUpperCase',
|
| + 'trim',
|
| + 'trimLeft',
|
| + 'trimRight',
|
| + '*',
|
| + 'padLeft',
|
| + 'padRight',
|
| + 'codeUnits',
|
| + 'runes',
|
| + 'indexOf',
|
| + 'lastIndexOf',
|
| + 'contains',
|
| + 'isEmpty',
|
| + 'isNotEmpty',
|
| + 'compareTo',
|
| + 'toString',
|
| + 'hashCode',
|
| + 'runtimeType',
|
| + 'length',
|
| + 'get'
|
| + ]);
|
| class JSString extends Interceptor {
|
| JSString() {
|
| super.Interceptor();
|
| }
|
| - codeUnitAt(index) {
|
| + [dartx.codeUnitAt](index) {
|
| if (!(typeof index == 'number'))
|
| throw new core.ArgumentError(index);
|
| if (dart.notNull(index) < 0)
|
| @@ -891,7 +993,7 @@ var math = dart.import(math);
|
| throw new core.RangeError.value(index);
|
| return dart.as(this.charCodeAt(index), core.int);
|
| }
|
| - allMatches(string, start) {
|
| + [dartx.allMatches](string, start) {
|
| if (start === void 0)
|
| start = 0;
|
| _js_helper.checkString(string);
|
| @@ -901,7 +1003,7 @@ var math = dart.import(math);
|
| }
|
| return _js_helper.allMatchesInStringUnchecked(this, string, start);
|
| }
|
| - matchAsPrefix(string, start) {
|
| + [dartx.matchAsPrefix](string, start) {
|
| if (start === void 0)
|
| start = 0;
|
| if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string.length)) {
|
| @@ -916,31 +1018,31 @@ var math = dart.import(math);
|
| }
|
| return new _js_helper.StringMatch(start, string, this);
|
| }
|
| - ['+'](other) {
|
| + [dartx['+']](other) {
|
| if (!(typeof other == 'string'))
|
| throw new core.ArgumentError(other);
|
| return this + other;
|
| }
|
| - endsWith(other) {
|
| + [dartx.endsWith](other) {
|
| _js_helper.checkString(other);
|
| let otherLength = other.length;
|
| if (dart.notNull(otherLength) > dart.notNull(this.length))
|
| return false;
|
| return other == this[dartx.substring](dart.notNull(this.length) - dart.notNull(otherLength));
|
| }
|
| - replaceAll(from, to) {
|
| + [dartx.replaceAll](from, to) {
|
| _js_helper.checkString(to);
|
| return dart.as(_js_helper.stringReplaceAllUnchecked(this, from, to), core.String);
|
| }
|
| - replaceAllMapped(from, convert) {
|
| + [dartx.replaceAllMapped](from, convert) {
|
| return this[dartx.splitMapJoin](from, {onMatch: convert});
|
| }
|
| - splitMapJoin(from, opts) {
|
| + [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);
|
| }
|
| - replaceFirst(from, to, startIndex) {
|
| + [dartx.replaceFirst](from, to, startIndex) {
|
| if (startIndex === void 0)
|
| startIndex = 0;
|
| _js_helper.checkString(to);
|
| @@ -950,7 +1052,7 @@ var math = dart.import(math);
|
| }
|
| return dart.as(_js_helper.stringReplaceFirstUnchecked(this, from, to, startIndex), core.String);
|
| }
|
| - split(pattern) {
|
| + [dartx.split](pattern) {
|
| _js_helper.checkNull(pattern);
|
| if (typeof pattern == 'string') {
|
| return dart.as(this.split(pattern), core.List$(core.String));
|
| @@ -981,7 +1083,7 @@ var math = dart.import(math);
|
| }
|
| return result;
|
| }
|
| - startsWith(pattern, index) {
|
| + [dartx.startsWith](pattern, index) {
|
| if (index === void 0)
|
| index = 0;
|
| _js_helper.checkInt(index);
|
| @@ -998,7 +1100,7 @@ var math = dart.import(math);
|
| }
|
| return pattern[dartx.matchAsPrefix](this, index) != null;
|
| }
|
| - substring(startIndex, endIndex) {
|
| + [dartx.substring](startIndex, endIndex) {
|
| if (endIndex === void 0)
|
| endIndex = null;
|
| _js_helper.checkInt(startIndex);
|
| @@ -1013,10 +1115,10 @@ var math = dart.import(math);
|
| throw new core.RangeError.value(endIndex);
|
| return this.substring(startIndex, endIndex);
|
| }
|
| - toLowerCase() {
|
| + [dartx.toLowerCase]() {
|
| return this.toLowerCase();
|
| }
|
| - toUpperCase() {
|
| + [dartx.toUpperCase]() {
|
| return this.toUpperCase();
|
| }
|
| static _isWhitespace(codeUnit) {
|
| @@ -1092,7 +1194,7 @@ var math = dart.import(math);
|
| }
|
| return index;
|
| }
|
| - trim() {
|
| + [dartx.trim]() {
|
| let NEL = 133;
|
| let result = this.trim();
|
| if (result.length == 0)
|
| @@ -1113,7 +1215,7 @@ var math = dart.import(math);
|
| return result;
|
| return result.substring(startIndex, endIndex);
|
| }
|
| - trimLeft() {
|
| + [dartx.trimLeft]() {
|
| let NEL = 133;
|
| let result = null;
|
| let startIndex = 0;
|
| @@ -1135,7 +1237,7 @@ var math = dart.import(math);
|
| return "";
|
| return result.substring(startIndex);
|
| }
|
| - trimRight() {
|
| + [dartx.trimRight]() {
|
| let NEL = 133;
|
| let result = null;
|
| let endIndex = null;
|
| @@ -1158,7 +1260,7 @@ var math = dart.import(math);
|
| return "";
|
| return result.substring(0, endIndex);
|
| }
|
| - ['*'](times) {
|
| + [dartx['*']](times) {
|
| if (0 >= dart.notNull(times))
|
| return '';
|
| if (times == 1 || this.length == 0)
|
| @@ -1178,7 +1280,7 @@ var math = dart.import(math);
|
| }
|
| return result;
|
| }
|
| - padLeft(width, padding) {
|
| + [dartx.padLeft](width, padding) {
|
| if (padding === void 0)
|
| padding = ' ';
|
| let delta = dart.notNull(width) - dart.notNull(this.length);
|
| @@ -1186,7 +1288,7 @@ var math = dart.import(math);
|
| return this;
|
| return padding[dartx['*']](delta) + this;
|
| }
|
| - padRight(width, padding) {
|
| + [dartx.padRight](width, padding) {
|
| if (padding === void 0)
|
| padding = ' ';
|
| let delta = dart.notNull(width) - dart.notNull(this.length);
|
| @@ -1194,13 +1296,13 @@ var math = dart.import(math);
|
| return this;
|
| return this[dartx['+']](padding[dartx['*']](delta));
|
| }
|
| - get codeUnits() {
|
| + get [dartx.codeUnits]() {
|
| return new _CodeUnits(this);
|
| }
|
| - get runes() {
|
| + get [dartx.runes]() {
|
| return new core.Runes(this);
|
| }
|
| - indexOf(pattern, start) {
|
| + [dartx.indexOf](pattern, start) {
|
| if (start === void 0)
|
| start = 0;
|
| _js_helper.checkNull(pattern);
|
| @@ -1223,7 +1325,7 @@ var math = dart.import(math);
|
| }
|
| return -1;
|
| }
|
| - lastIndexOf(pattern, start) {
|
| + [dartx.lastIndexOf](pattern, start) {
|
| if (start === void 0)
|
| start = null;
|
| _js_helper.checkNull(pattern);
|
| @@ -1247,7 +1349,7 @@ var math = dart.import(math);
|
| }
|
| return -1;
|
| }
|
| - contains(other, startIndex) {
|
| + [dartx.contains](other, startIndex) {
|
| if (startIndex === void 0)
|
| startIndex = 0;
|
| _js_helper.checkNull(other);
|
| @@ -1256,21 +1358,21 @@ var math = dart.import(math);
|
| }
|
| return dart.as(_js_helper.stringContainsUnchecked(this, other, startIndex), core.bool);
|
| }
|
| - get isEmpty() {
|
| + get [dartx.isEmpty]() {
|
| return this.length == 0;
|
| }
|
| - get isNotEmpty() {
|
| + get [dartx.isNotEmpty]() {
|
| return !dart.notNull(this[dartx.isEmpty]);
|
| }
|
| - compareTo(other) {
|
| + [dartx.compareTo](other) {
|
| if (!(typeof other == 'string'))
|
| throw new core.ArgumentError(other);
|
| return dart.equals(this, other) ? 0 : this < other ? -1 : 1;
|
| }
|
| - toString() {
|
| + [dartx.toString]() {
|
| return this;
|
| }
|
| - get hashCode() {
|
| + get [dartx.hashCode]() {
|
| let hash = 0;
|
| for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.notNull(i) + 1) {
|
| hash = 536870911 & dart.notNull(hash) + this.charCodeAt(i);
|
| @@ -1281,13 +1383,13 @@ var math = dart.import(math);
|
| hash = hash ^ hash >> 11;
|
| return 536870911 & dart.notNull(hash) + ((16383 & dart.notNull(hash)) << 15);
|
| }
|
| - get runtimeType() {
|
| + get [dartx.runtimeType]() {
|
| return core.String;
|
| }
|
| get length() {
|
| return this.length;
|
| }
|
| - get(index) {
|
| + [dartx.get](index) {
|
| if (!(typeof index == 'number'))
|
| throw new core.ArgumentError(index);
|
| if (dart.notNull(index) >= dart.notNull(this.length) || dart.notNull(index) < 0)
|
| @@ -1299,32 +1401,32 @@ var math = dart.import(math);
|
| dart.setSignature(JSString, {
|
| constructors: () => ({JSString: [JSString, []]}),
|
| methods: () => ({
|
| - codeUnitAt: [core.int, [core.int]],
|
| - allMatches: [core.Iterable$(core.Match), [core.String], [core.int]],
|
| - matchAsPrefix: [core.Match, [core.String], [core.int]],
|
| - '+': [core.String, [core.String]],
|
| - endsWith: [core.bool, [core.String]],
|
| - replaceAll: [core.String, [core.Pattern, core.String]],
|
| - replaceAllMapped: [core.String, [core.Pattern, dart.functionType(core.String, [core.Match])]],
|
| - splitMapJoin: [core.String, [core.Pattern], {onMatch: dart.functionType(core.String, [core.Match]), onNonMatch: dart.functionType(core.String, [core.String])}],
|
| - replaceFirst: [core.String, [core.Pattern, core.String], [core.int]],
|
| - split: [core.List$(core.String), [core.Pattern]],
|
| + [dartx.codeUnitAt]: [core.int, [core.int]],
|
| + [dartx.allMatches]: [core.Iterable$(core.Match), [core.String], [core.int]],
|
| + [dartx.matchAsPrefix]: [core.Match, [core.String], [core.int]],
|
| + [dartx['+']]: [core.String, [core.String]],
|
| + [dartx.endsWith]: [core.bool, [core.String]],
|
| + [dartx.replaceAll]: [core.String, [core.Pattern, core.String]],
|
| + [dartx.replaceAllMapped]: [core.String, [core.Pattern, dart.functionType(core.String, [core.Match])]],
|
| + [dartx.splitMapJoin]: [core.String, [core.Pattern], {onMatch: dart.functionType(core.String, [core.Match]), onNonMatch: dart.functionType(core.String, [core.String])}],
|
| + [dartx.replaceFirst]: [core.String, [core.Pattern, core.String], [core.int]],
|
| + [dartx.split]: [core.List$(core.String), [core.Pattern]],
|
| [_defaultSplit]: [core.List$(core.String), [core.Pattern]],
|
| - startsWith: [core.bool, [core.Pattern], [core.int]],
|
| - substring: [core.String, [core.int], [core.int]],
|
| - toLowerCase: [core.String, []],
|
| - toUpperCase: [core.String, []],
|
| - trim: [core.String, []],
|
| - trimLeft: [core.String, []],
|
| - trimRight: [core.String, []],
|
| - '*': [core.String, [core.int]],
|
| - padLeft: [core.String, [core.int], [core.String]],
|
| - padRight: [core.String, [core.int], [core.String]],
|
| - indexOf: [core.int, [core.Pattern], [core.int]],
|
| - lastIndexOf: [core.int, [core.Pattern], [core.int]],
|
| - contains: [core.bool, [core.Pattern], [core.int]],
|
| - compareTo: [core.int, [core.String]],
|
| - get: [core.String, [core.int]]
|
| + [dartx.startsWith]: [core.bool, [core.Pattern], [core.int]],
|
| + [dartx.substring]: [core.String, [core.int], [core.int]],
|
| + [dartx.toLowerCase]: [core.String, []],
|
| + [dartx.toUpperCase]: [core.String, []],
|
| + [dartx.trim]: [core.String, []],
|
| + [dartx.trimLeft]: [core.String, []],
|
| + [dartx.trimRight]: [core.String, []],
|
| + [dartx['*']]: [core.String, [core.int]],
|
| + [dartx.padLeft]: [core.String, [core.int], [core.String]],
|
| + [dartx.padRight]: [core.String, [core.int], [core.String]],
|
| + [dartx.indexOf]: [core.int, [core.Pattern], [core.int]],
|
| + [dartx.lastIndexOf]: [core.int, [core.Pattern], [core.int]],
|
| + [dartx.contains]: [core.bool, [core.Pattern], [core.int]],
|
| + [dartx.compareTo]: [core.int, [core.String]],
|
| + [dartx.get]: [core.String, [core.int]]
|
| }),
|
| statics: () => ({
|
| _isWhitespace: [core.bool, [core.int]],
|
| @@ -1350,21 +1452,27 @@ var math = dart.import(math);
|
| constructors: () => ({_CodeUnits: [_CodeUnits, [core.String]]}),
|
| methods: () => ({get: [core.int, [core.int]]})
|
| });
|
| + dart.defineExtensionMembers(_CodeUnits, ['get', 'length']);
|
| function getInterceptor(obj) {
|
| return obj;
|
| }
|
| dart.fn(getInterceptor);
|
| + dart.defineExtensionNames([
|
| + 'toString',
|
| + 'hashCode',
|
| + 'runtimeType'
|
| + ]);
|
| class JSBool extends Interceptor {
|
| JSBool() {
|
| super.Interceptor();
|
| }
|
| - toString() {
|
| + [dartx.toString]() {
|
| return String(this);
|
| }
|
| - get hashCode() {
|
| + get [dartx.hashCode]() {
|
| return this ? 2 * 3 * 23 * 3761 : 269 * 811;
|
| }
|
| - get runtimeType() {
|
| + get [dartx.runtimeType]() {
|
| return core.bool;
|
| }
|
| }
|
|
|