| OLD | NEW |
| 1 var _interceptors; | 1 var _interceptors; |
| 2 (function(exports) { | 2 (function(exports) { |
| 3 'use strict'; | 3 'use strict'; |
| 4 class Interceptor extends core.Object { | 4 class Interceptor extends core.Object { |
| 5 Interceptor() { | 5 Interceptor() { |
| 6 } | 6 } |
| 7 ['=='](other) { | 7 ['=='](other) { |
| 8 return core.identical(this, other); | 8 return core.identical(this, other); |
| 9 } | 9 } |
| 10 get hashCode() { | 10 get hashCode() { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 insertAll(index, iterable) { | 88 insertAll(index, iterable) { |
| 89 this.checkGrowable('insertAll'); | 89 this.checkGrowable('insertAll'); |
| 90 _internal.IterableMixinWorkaround.insertAllList(this, index, iterable); | 90 _internal.IterableMixinWorkaround.insertAllList(this, index, iterable); |
| 91 } | 91 } |
| 92 setAll(index, iterable) { | 92 setAll(index, iterable) { |
| 93 this.checkMutable('setAll'); | 93 this.checkMutable('setAll'); |
| 94 _internal.IterableMixinWorkaround.setAllList(this, index, iterable); | 94 _internal.IterableMixinWorkaround.setAllList(this, index, iterable); |
| 95 } | 95 } |
| 96 removeLast() { | 96 removeLast() { |
| 97 this.checkGrowable('removeLast'); | 97 this.checkGrowable('removeLast'); |
| 98 if (this.length === 0) | 98 if (this.length == 0) |
| 99 throw new core.RangeError.value(-1); | 99 throw new core.RangeError.value(-1); |
| 100 return dart.as(this.pop(), E); | 100 return dart.as(this.pop(), E); |
| 101 } | 101 } |
| 102 remove(element) { | 102 remove(element) { |
| 103 this.checkGrowable('remove'); | 103 this.checkGrowable('remove'); |
| 104 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no
tNull(i) + 1) { | 104 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no
tNull(i) + 1) { |
| 105 if (dart.equals(this.get(i), element)) { | 105 if (dart.equals(this.get(i), element)) { |
| 106 this.splice(i, 1); | 106 this.splice(i, 1); |
| 107 return true; | 107 return true; |
| 108 } | 108 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 126 this.add(e); | 126 this.add(e); |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 clear() { | 129 clear() { |
| 130 this.length = 0; | 130 this.length = 0; |
| 131 } | 131 } |
| 132 forEach(f) { | 132 forEach(f) { |
| 133 let length = this.length; | 133 let length = this.length; |
| 134 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | 134 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 135 f(dart.as(this[i], E)); | 135 f(dart.as(this[i], E)); |
| 136 if (length !== this.length) { | 136 if (length != this.length) { |
| 137 throw new core.ConcurrentModificationError(this); | 137 throw new core.ConcurrentModificationError(this); |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 map(f) { | 141 map(f) { |
| 142 return _internal.IterableMixinWorkaround.mapList(this, f); | 142 return _internal.IterableMixinWorkaround.mapList(this, f); |
| 143 } | 143 } |
| 144 join(separator) { | 144 join(separator) { |
| 145 if (separator === void 0) | 145 if (separator === void 0) |
| 146 separator = ""; | 146 separator = ""; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } | 184 } |
| 185 sublist(start, end) { | 185 sublist(start, end) { |
| 186 if (end === void 0) | 186 if (end === void 0) |
| 187 end = null; | 187 end = null; |
| 188 _js_helper.checkNull(start); | 188 _js_helper.checkNull(start); |
| 189 if (!(typeof start == 'number')) | 189 if (!(typeof start == 'number')) |
| 190 throw new core.ArgumentError(start); | 190 throw new core.ArgumentError(start); |
| 191 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(this.l
ength)) { | 191 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(this.l
ength)) { |
| 192 throw new core.RangeError.range(start, 0, this.length); | 192 throw new core.RangeError.range(start, 0, this.length); |
| 193 } | 193 } |
| 194 if (end === null) { | 194 if (end == null) { |
| 195 end = this.length; | 195 end = this.length; |
| 196 } else { | 196 } else { |
| 197 if (!(typeof end == 'number')) | 197 if (!(typeof end == 'number')) |
| 198 throw new core.ArgumentError(end); | 198 throw new core.ArgumentError(end); |
| 199 if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dar
t.notNull(this.length)) { | 199 if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dar
t.notNull(this.length)) { |
| 200 throw new core.RangeError.range(end, start, this.length); | 200 throw new core.RangeError.range(end, start, this.length); |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 if (start === end) | 203 if (start == end) |
| 204 return new core.List$(E).from([]); | 204 return new core.List$(E).from([]); |
| 205 return new JSArray.markGrowable(this.slice(start, end)); | 205 return new JSArray.markGrowable(this.slice(start, end)); |
| 206 } | 206 } |
| 207 getRange(start, end) { | 207 getRange(start, end) { |
| 208 return new _internal.IterableMixinWorkaround().getRangeList(this, start,
end); | 208 return new _internal.IterableMixinWorkaround().getRangeList(this, start,
end); |
| 209 } | 209 } |
| 210 get first() { | 210 get first() { |
| 211 if (dart.notNull(this.length) > 0) | 211 if (dart.notNull(this.length) > 0) |
| 212 return this.get(0); | 212 return this.get(0); |
| 213 throw new core.StateError("No elements"); | 213 throw new core.StateError("No elements"); |
| 214 } | 214 } |
| 215 get last() { | 215 get last() { |
| 216 if (dart.notNull(this.length) > 0) | 216 if (dart.notNull(this.length) > 0) |
| 217 return this.get(dart.notNull(this.length) - 1); | 217 return this.get(dart.notNull(this.length) - 1); |
| 218 throw new core.StateError("No elements"); | 218 throw new core.StateError("No elements"); |
| 219 } | 219 } |
| 220 get single() { | 220 get single() { |
| 221 if (this.length === 1) | 221 if (this.length == 1) |
| 222 return this.get(0); | 222 return this.get(0); |
| 223 if (this.length === 0) | 223 if (this.length == 0) |
| 224 throw new core.StateError("No elements"); | 224 throw new core.StateError("No elements"); |
| 225 throw new core.StateError("More than one element"); | 225 throw new core.StateError("More than one element"); |
| 226 } | 226 } |
| 227 removeRange(start, end) { | 227 removeRange(start, end) { |
| 228 this.checkGrowable('removeRange'); | 228 this.checkGrowable('removeRange'); |
| 229 let receiverLength = this.length; | 229 let receiverLength = this.length; |
| 230 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(receiv
erLength)) { | 230 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(receiv
erLength)) { |
| 231 throw new core.RangeError.range(start, 0, receiverLength); | 231 throw new core.RangeError.range(start, 0, receiverLength); |
| 232 } | 232 } |
| 233 if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dart.
notNull(receiverLength)) { | 233 if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dart.
notNull(receiverLength)) { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 return _internal.IterableMixinWorkaround.lastIndexOfList(this, element,
start); | 283 return _internal.IterableMixinWorkaround.lastIndexOfList(this, element,
start); |
| 284 } | 284 } |
| 285 contains(other) { | 285 contains(other) { |
| 286 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no
tNull(i) + 1) { | 286 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no
tNull(i) + 1) { |
| 287 if (dart.equals(this.get(i), other)) | 287 if (dart.equals(this.get(i), other)) |
| 288 return true; | 288 return true; |
| 289 } | 289 } |
| 290 return false; | 290 return false; |
| 291 } | 291 } |
| 292 get isEmpty() { | 292 get isEmpty() { |
| 293 return this.length === 0; | 293 return this.length == 0; |
| 294 } | 294 } |
| 295 get isNotEmpty() { | 295 get isNotEmpty() { |
| 296 return !dart.notNull(this.isEmpty); | 296 return !dart.notNull(this.isEmpty); |
| 297 } | 297 } |
| 298 toString() { | 298 toString() { |
| 299 return collection.ListBase.listToString(this); | 299 return collection.ListBase.listToString(this); |
| 300 } | 300 } |
| 301 toList(opts) { | 301 toList(opts) { |
| 302 let growable = opts && 'growable' in opts ? opts.growable : true; | 302 let growable = opts && 'growable' in opts ? opts.growable : true; |
| 303 if (growable) { | 303 if (growable) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 compareTo(b) { | 389 compareTo(b) { |
| 390 if (!dart.is(b, core.num)) | 390 if (!dart.is(b, core.num)) |
| 391 throw new core.ArgumentError(b); | 391 throw new core.ArgumentError(b); |
| 392 if (this['<'](b)) { | 392 if (this['<'](b)) { |
| 393 return -1; | 393 return -1; |
| 394 } else if (this['>'](b)) { | 394 } else if (this['>'](b)) { |
| 395 return 1; | 395 return 1; |
| 396 } else if (dart.equals(this, b)) { | 396 } else if (dart.equals(this, b)) { |
| 397 if (dart.equals(this, 0)) { | 397 if (dart.equals(this, 0)) { |
| 398 let bIsNegative = b.isNegative; | 398 let bIsNegative = b.isNegative; |
| 399 if (this.isNegative === bIsNegative) | 399 if (this.isNegative == bIsNegative) |
| 400 return 0; | 400 return 0; |
| 401 if (this.isNegative) | 401 if (this.isNegative) |
| 402 return -1; | 402 return -1; |
| 403 return 1; | 403 return 1; |
| 404 } | 404 } |
| 405 return 0; | 405 return 0; |
| 406 } else if (this.isNaN) { | 406 } else if (this.isNaN) { |
| 407 if (b.isNaN) { | 407 if (b.isNaN) { |
| 408 return 0; | 408 return 0; |
| 409 } | 409 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 } | 497 } |
| 498 let result = this.toFixed(fractionDigits); | 498 let result = this.toFixed(fractionDigits); |
| 499 if (dart.notNull(dart.equals(this, 0)) && dart.notNull(this.isNegative)) | 499 if (dart.notNull(dart.equals(this, 0)) && dart.notNull(this.isNegative)) |
| 500 return `-${result}`; | 500 return `-${result}`; |
| 501 return result; | 501 return result; |
| 502 } | 502 } |
| 503 toStringAsExponential(fractionDigits) { | 503 toStringAsExponential(fractionDigits) { |
| 504 if (fractionDigits === void 0) | 504 if (fractionDigits === void 0) |
| 505 fractionDigits = null; | 505 fractionDigits = null; |
| 506 let result = null; | 506 let result = null; |
| 507 if (fractionDigits !== null) { | 507 if (fractionDigits != null) { |
| 508 _js_helper.checkInt(fractionDigits); | 508 _js_helper.checkInt(fractionDigits); |
| 509 if (dart.notNull(fractionDigits) < 0 || dart.notNull(fractionDigits) > 2
0) { | 509 if (dart.notNull(fractionDigits) < 0 || dart.notNull(fractionDigits) > 2
0) { |
| 510 throw new core.RangeError(fractionDigits); | 510 throw new core.RangeError(fractionDigits); |
| 511 } | 511 } |
| 512 result = this.toExponential(fractionDigits); | 512 result = this.toExponential(fractionDigits); |
| 513 } else { | 513 } else { |
| 514 result = this.toExponential(); | 514 result = this.toExponential(); |
| 515 } | 515 } |
| 516 if (dart.notNull(dart.equals(this, 0)) && dart.notNull(this.isNegative)) | 516 if (dart.notNull(dart.equals(this, 0)) && dart.notNull(this.isNegative)) |
| 517 return `-${result}`; | 517 return `-${result}`; |
| 518 return result; | 518 return result; |
| 519 } | 519 } |
| 520 toStringAsPrecision(precision) { | 520 toStringAsPrecision(precision) { |
| 521 _js_helper.checkInt(precision); | 521 _js_helper.checkInt(precision); |
| 522 if (dart.notNull(precision) < 1 || dart.notNull(precision) > 21) { | 522 if (dart.notNull(precision) < 1 || dart.notNull(precision) > 21) { |
| 523 throw new core.RangeError(precision); | 523 throw new core.RangeError(precision); |
| 524 } | 524 } |
| 525 let result = this.toPrecision(precision); | 525 let result = this.toPrecision(precision); |
| 526 if (dart.notNull(dart.equals(this, 0)) && dart.notNull(this.isNegative)) | 526 if (dart.notNull(dart.equals(this, 0)) && dart.notNull(this.isNegative)) |
| 527 return `-${result}`; | 527 return `-${result}`; |
| 528 return result; | 528 return result; |
| 529 } | 529 } |
| 530 toRadixString(radix) { | 530 toRadixString(radix) { |
| 531 _js_helper.checkInt(radix); | 531 _js_helper.checkInt(radix); |
| 532 if (dart.notNull(radix) < 2 || dart.notNull(radix) > 36) | 532 if (dart.notNull(radix) < 2 || dart.notNull(radix) > 36) |
| 533 throw new core.RangeError(radix); | 533 throw new core.RangeError(radix); |
| 534 let result = this.toString(radix); | 534 let result = this.toString(radix); |
| 535 let rightParenCode = 41; | 535 let rightParenCode = 41; |
| 536 if (result.codeUnitAt(dart.notNull(result.length) - 1) !== rightParenCode)
{ | 536 if (result.codeUnitAt(dart.notNull(result.length) - 1) != rightParenCode)
{ |
| 537 return result; | 537 return result; |
| 538 } | 538 } |
| 539 return JSNumber[_handleIEtoString](result); | 539 return JSNumber[_handleIEtoString](result); |
| 540 } | 540 } |
| 541 static [_handleIEtoString](result) { | 541 static [_handleIEtoString](result) { |
| 542 let match = /^([\da-z]+)(?:\.([\da-z]+))?\(e\+(\d+)\)$/.exec(result); | 542 let match = /^([\da-z]+)(?:\.([\da-z]+))?\(e\+(\d+)\)$/.exec(result); |
| 543 if (match === null) { | 543 if (match == null) { |
| 544 throw new core.UnsupportedError(`Unexpected toString result: ${result}`)
; | 544 throw new core.UnsupportedError(`Unexpected toString result: ${result}`)
; |
| 545 } | 545 } |
| 546 let result = dart.dindex(match, 1); | 546 let result = dart.dindex(match, 1); |
| 547 let exponent = +dart.dindex(match, 3); | 547 let exponent = +dart.dindex(match, 3); |
| 548 if (dart.dindex(match, 2) !== null) { | 548 if (dart.dindex(match, 2) != null) { |
| 549 result = result + dart.dindex(match, 2); | 549 result = result + dart.dindex(match, 2); |
| 550 exponent = dart.dindex(match, 2).length; | 550 exponent = dart.dindex(match, 2).length; |
| 551 } | 551 } |
| 552 return core.String['+'](result, core.String['*']("0", exponent)); | 552 return core.String['+'](result, core.String['*']("0", exponent)); |
| 553 } | 553 } |
| 554 toString() { | 554 toString() { |
| 555 if (dart.notNull(dart.equals(this, 0)) && 1 / this < 0) { | 555 if (dart.notNull(dart.equals(this, 0)) && 1 / this < 0) { |
| 556 return '-0.0'; | 556 return '-0.0'; |
| 557 } else { | 557 } else { |
| 558 return "" + this; | 558 return "" + this; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 581 } | 581 } |
| 582 ['*'](other) { | 582 ['*'](other) { |
| 583 if (!dart.is(other, core.num)) | 583 if (!dart.is(other, core.num)) |
| 584 throw new core.ArgumentError(other); | 584 throw new core.ArgumentError(other); |
| 585 return this * other; | 585 return this * other; |
| 586 } | 586 } |
| 587 ['%'](other) { | 587 ['%'](other) { |
| 588 if (!dart.is(other, core.num)) | 588 if (!dart.is(other, core.num)) |
| 589 throw new core.ArgumentError(other); | 589 throw new core.ArgumentError(other); |
| 590 let result = this % other; | 590 let result = this % other; |
| 591 if (result === 0) | 591 if (result == 0) |
| 592 return 0; | 592 return 0; |
| 593 if (dart.notNull(result) > 0) | 593 if (dart.notNull(result) > 0) |
| 594 return result; | 594 return result; |
| 595 if (other < 0) { | 595 if (other < 0) { |
| 596 return dart.notNull(result) - other; | 596 return dart.notNull(result) - other; |
| 597 } else { | 597 } else { |
| 598 return dart.notNull(result) + other; | 598 return dart.notNull(result) + other; |
| 599 } | 599 } |
| 600 } | 600 } |
| 601 [_isInt32](value) { | 601 [_isInt32](value) { |
| 602 return (value | 0) === value; | 602 return (value | 0) === value; |
| 603 } | 603 } |
| 604 ['~/'](other) { | 604 ['~/'](other) { |
| 605 if (false) | 605 if (false) |
| 606 this[_tdivFast](other); | 606 this[_tdivFast](other); |
| 607 if (dart.notNull(this[_isInt32](this)) && dart.notNull(this[_isInt32](othe
r)) && 0 !== other && -1 !== other) { | 607 if (dart.notNull(this[_isInt32](this)) && dart.notNull(this[_isInt32](othe
r)) && 0 != other && -1 != other) { |
| 608 return this / other | 0; | 608 return this / other | 0; |
| 609 } else { | 609 } else { |
| 610 return this[_tdivSlow](other); | 610 return this[_tdivSlow](other); |
| 611 } | 611 } |
| 612 } | 612 } |
| 613 [_tdivFast](other) { | 613 [_tdivFast](other) { |
| 614 return this[_isInt32](this) ? this / other | 0 : (this / other).toInt(); | 614 return this[_isInt32](this) ? this / other | 0 : (this / other).toInt(); |
| 615 } | 615 } |
| 616 [_tdivSlow](other) { | 616 [_tdivSlow](other) { |
| 617 if (!dart.is(other, core.num)) | 617 if (!dart.is(other, core.num)) |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 let _bitCount = Symbol('_bitCount'); | 692 let _bitCount = Symbol('_bitCount'); |
| 693 let _spread = Symbol('_spread'); | 693 let _spread = Symbol('_spread'); |
| 694 let _shru = Symbol('_shru'); | 694 let _shru = Symbol('_shru'); |
| 695 let _shrs = Symbol('_shrs'); | 695 let _shrs = Symbol('_shrs'); |
| 696 let _ors = Symbol('_ors'); | 696 let _ors = Symbol('_ors'); |
| 697 class JSInt extends JSNumber { | 697 class JSInt extends JSNumber { |
| 698 JSInt() { | 698 JSInt() { |
| 699 super.JSNumber(); | 699 super.JSNumber(); |
| 700 } | 700 } |
| 701 get isEven() { | 701 get isEven() { |
| 702 return this['&'](1) === 0; | 702 return this['&'](1) == 0; |
| 703 } | 703 } |
| 704 get isOdd() { | 704 get isOdd() { |
| 705 return this['&'](1) === 1; | 705 return this['&'](1) == 1; |
| 706 } | 706 } |
| 707 toUnsigned(width) { | 707 toUnsigned(width) { |
| 708 return this['&']((1 << dart.notNull(width)) - 1); | 708 return this['&']((1 << dart.notNull(width)) - 1); |
| 709 } | 709 } |
| 710 toSigned(width) { | 710 toSigned(width) { |
| 711 let signMask = 1 << dart.notNull(width) - 1; | 711 let signMask = 1 << dart.notNull(width) - 1; |
| 712 return dart.notNull(this['&'](dart.notNull(signMask) - 1)) - dart.notNull(
this['&'](signMask)); | 712 return dart.notNull(this['&'](dart.notNull(signMask) - 1)) - dart.notNull(
this['&'](signMask)); |
| 713 } | 713 } |
| 714 get bitLength() { | 714 get bitLength() { |
| 715 let nonneg = this['<'](0) ? dart.notNull(this['unary-']()) - 1 : this; | 715 let nonneg = this['<'](0) ? dart.notNull(this['unary-']()) - 1 : this; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 } | 794 } |
| 795 matchAsPrefix(string, start) { | 795 matchAsPrefix(string, start) { |
| 796 if (start === void 0) | 796 if (start === void 0) |
| 797 start = 0; | 797 start = 0; |
| 798 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string.l
ength)) { | 798 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string.l
ength)) { |
| 799 throw new core.RangeError.range(start, 0, string.length); | 799 throw new core.RangeError.range(start, 0, string.length); |
| 800 } | 800 } |
| 801 if (dart.notNull(start) + dart.notNull(this.length) > dart.notNull(string.
length)) | 801 if (dart.notNull(start) + dart.notNull(this.length) > dart.notNull(string.
length)) |
| 802 return null; | 802 return null; |
| 803 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.notN
ull(i) + 1) { | 803 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.notN
ull(i) + 1) { |
| 804 if (string.codeUnitAt(dart.notNull(start) + dart.notNull(i)) !== this.co
deUnitAt(i)) { | 804 if (string.codeUnitAt(dart.notNull(start) + dart.notNull(i)) != this.cod
eUnitAt(i)) { |
| 805 return null; | 805 return null; |
| 806 } | 806 } |
| 807 } | 807 } |
| 808 return new _js_helper.StringMatch(start, string, this); | 808 return new _js_helper.StringMatch(start, string, this); |
| 809 } | 809 } |
| 810 ['+'](other) { | 810 ['+'](other) { |
| 811 if (!(typeof other == 'string')) | 811 if (!(typeof other == 'string')) |
| 812 throw new core.ArgumentError(other); | 812 throw new core.ArgumentError(other); |
| 813 return this + other; | 813 return this + other; |
| 814 } | 814 } |
| 815 endsWith(other) { | 815 endsWith(other) { |
| 816 _js_helper.checkString(other); | 816 _js_helper.checkString(other); |
| 817 let otherLength = other.length; | 817 let otherLength = other.length; |
| 818 if (dart.notNull(otherLength) > dart.notNull(this.length)) | 818 if (dart.notNull(otherLength) > dart.notNull(this.length)) |
| 819 return false; | 819 return false; |
| 820 return dart.equals(other, this.substring(dart.notNull(this.length) - dart.
notNull(otherLength))); | 820 return other == this.substring(dart.notNull(this.length) - dart.notNull(ot
herLength)); |
| 821 } | 821 } |
| 822 replaceAll(from, to) { | 822 replaceAll(from, to) { |
| 823 _js_helper.checkString(to); | 823 _js_helper.checkString(to); |
| 824 return dart.as(_js_helper.stringReplaceAllUnchecked(this, from, to), core.
String); | 824 return dart.as(_js_helper.stringReplaceAllUnchecked(this, from, to), core.
String); |
| 825 } | 825 } |
| 826 replaceAllMapped(from, convert) { | 826 replaceAllMapped(from, convert) { |
| 827 return this.splitMapJoin(from, {onMatch: convert}); | 827 return this.splitMapJoin(from, {onMatch: convert}); |
| 828 } | 828 } |
| 829 splitMapJoin(from, opts) { | 829 splitMapJoin(from, opts) { |
| 830 let onMatch = opts && 'onMatch' in opts ? opts.onMatch : null; | 830 let onMatch = opts && 'onMatch' in opts ? opts.onMatch : null; |
| 831 let onNonMatch = opts && 'onNonMatch' in opts ? opts.onNonMatch : null; | 831 let onNonMatch = opts && 'onNonMatch' in opts ? opts.onNonMatch : null; |
| 832 return dart.as(_js_helper.stringReplaceAllFuncUnchecked(this, from, onMatc
h, onNonMatch), core.String); | 832 return dart.as(_js_helper.stringReplaceAllFuncUnchecked(this, from, onMatc
h, onNonMatch), core.String); |
| 833 } | 833 } |
| 834 replaceFirst(from, to, startIndex) { | 834 replaceFirst(from, to, startIndex) { |
| 835 if (startIndex === void 0) | 835 if (startIndex === void 0) |
| 836 startIndex = 0; | 836 startIndex = 0; |
| 837 _js_helper.checkString(to); | 837 _js_helper.checkString(to); |
| 838 _js_helper.checkInt(startIndex); | 838 _js_helper.checkInt(startIndex); |
| 839 if (dart.notNull(startIndex) < 0 || dart.notNull(startIndex) > dart.notNul
l(this.length)) { | 839 if (dart.notNull(startIndex) < 0 || dart.notNull(startIndex) > dart.notNul
l(this.length)) { |
| 840 throw new core.RangeError.range(startIndex, 0, this.length); | 840 throw new core.RangeError.range(startIndex, 0, this.length); |
| 841 } | 841 } |
| 842 return dart.as(_js_helper.stringReplaceFirstUnchecked(this, from, to, star
tIndex), core.String); | 842 return dart.as(_js_helper.stringReplaceFirstUnchecked(this, from, to, star
tIndex), core.String); |
| 843 } | 843 } |
| 844 split(pattern) { | 844 split(pattern) { |
| 845 _js_helper.checkNull(pattern); | 845 _js_helper.checkNull(pattern); |
| 846 if (typeof pattern == 'string') { | 846 if (typeof pattern == 'string') { |
| 847 return dart.as(this.split(pattern), core.List$(core.String)); | 847 return dart.as(this.split(pattern), core.List$(core.String)); |
| 848 } else if (dart.notNull(dart.is(pattern, _js_helper.JSSyntaxRegExp)) && _j
s_helper.regExpCaptureCount(pattern) === 0) { | 848 } else if (dart.notNull(dart.is(pattern, _js_helper.JSSyntaxRegExp)) && _j
s_helper.regExpCaptureCount(pattern) == 0) { |
| 849 let re = _js_helper.regExpGetNative(pattern); | 849 let re = _js_helper.regExpGetNative(pattern); |
| 850 return dart.as(this.split(re), core.List$(core.String)); | 850 return dart.as(this.split(re), core.List$(core.String)); |
| 851 } else { | 851 } else { |
| 852 return this[_defaultSplit](pattern); | 852 return this[_defaultSplit](pattern); |
| 853 } | 853 } |
| 854 } | 854 } |
| 855 [_defaultSplit](pattern) { | 855 [_defaultSplit](pattern) { |
| 856 let result = new core.List$(core.String).from([]); | 856 let result = new core.List$(core.String).from([]); |
| 857 let start = 0; | 857 let start = 0; |
| 858 let length = 1; | 858 let length = 1; |
| 859 for (let match of pattern.allMatches(this)) { | 859 for (let match of pattern.allMatches(this)) { |
| 860 let matchStart = dart.as(dart.dload(match, 'start'), core.int); | 860 let matchStart = dart.as(dart.dload(match, 'start'), core.int); |
| 861 let matchEnd = dart.as(dart.dload(match, 'end'), core.int); | 861 let matchEnd = dart.as(dart.dload(match, 'end'), core.int); |
| 862 length = dart.notNull(matchEnd) - dart.notNull(matchStart); | 862 length = dart.notNull(matchEnd) - dart.notNull(matchStart); |
| 863 if (length === 0 && start === matchStart) { | 863 if (length == 0 && start == matchStart) { |
| 864 continue; | 864 continue; |
| 865 } | 865 } |
| 866 let end = matchStart; | 866 let end = matchStart; |
| 867 result.add(this.substring(start, end)); | 867 result.add(this.substring(start, end)); |
| 868 start = matchEnd; | 868 start = matchEnd; |
| 869 } | 869 } |
| 870 if (dart.notNull(start) < dart.notNull(this.length) || dart.notNull(length
) > 0) { | 870 if (dart.notNull(start) < dart.notNull(this.length) || dart.notNull(length
) > 0) { |
| 871 result.add(this.substring(start)); | 871 result.add(this.substring(start)); |
| 872 } | 872 } |
| 873 return result; | 873 return result; |
| 874 } | 874 } |
| 875 startsWith(pattern, index) { | 875 startsWith(pattern, index) { |
| 876 if (index === void 0) | 876 if (index === void 0) |
| 877 index = 0; | 877 index = 0; |
| 878 _js_helper.checkInt(index); | 878 _js_helper.checkInt(index); |
| 879 if (dart.notNull(index) < 0 || dart.notNull(index) > dart.notNull(this.len
gth)) { | 879 if (dart.notNull(index) < 0 || dart.notNull(index) > dart.notNull(this.len
gth)) { |
| 880 throw new core.RangeError.range(index, 0, this.length); | 880 throw new core.RangeError.range(index, 0, this.length); |
| 881 } | 881 } |
| 882 if (typeof pattern == 'string') { | 882 if (typeof pattern == 'string') { |
| 883 let other = pattern; | 883 let other = pattern; |
| 884 let otherLength = other.length; | 884 let otherLength = other.length; |
| 885 let endIndex = dart.notNull(index) + dart.notNull(otherLength); | 885 let endIndex = dart.notNull(index) + dart.notNull(otherLength); |
| 886 if (dart.notNull(endIndex) > dart.notNull(this.length)) | 886 if (dart.notNull(endIndex) > dart.notNull(this.length)) |
| 887 return false; | 887 return false; |
| 888 return dart.equals(other, this.substring(index, endIndex)); | 888 return other == this.substring(index, endIndex); |
| 889 } | 889 } |
| 890 return pattern.matchAsPrefix(this, index) !== null; | 890 return pattern.matchAsPrefix(this, index) != null; |
| 891 } | 891 } |
| 892 substring(startIndex, endIndex) { | 892 substring(startIndex, endIndex) { |
| 893 if (endIndex === void 0) | 893 if (endIndex === void 0) |
| 894 endIndex = null; | 894 endIndex = null; |
| 895 _js_helper.checkInt(startIndex); | 895 _js_helper.checkInt(startIndex); |
| 896 if (endIndex === null) | 896 if (endIndex == null) |
| 897 endIndex = this.length; | 897 endIndex = this.length; |
| 898 _js_helper.checkInt(endIndex); | 898 _js_helper.checkInt(endIndex); |
| 899 if (dart.notNull(startIndex) < 0) | 899 if (dart.notNull(startIndex) < 0) |
| 900 throw new core.RangeError.value(startIndex); | 900 throw new core.RangeError.value(startIndex); |
| 901 if (dart.notNull(startIndex) > dart.notNull(endIndex)) | 901 if (dart.notNull(startIndex) > dart.notNull(endIndex)) |
| 902 throw new core.RangeError.value(startIndex); | 902 throw new core.RangeError.value(startIndex); |
| 903 if (dart.notNull(endIndex) > dart.notNull(this.length)) | 903 if (dart.notNull(endIndex) > dart.notNull(this.length)) |
| 904 throw new core.RangeError.value(endIndex); | 904 throw new core.RangeError.value(endIndex); |
| 905 return this.substring(startIndex, endIndex); | 905 return this.substring(startIndex, endIndex); |
| 906 } | 906 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 { | 957 { |
| 958 return false; | 958 return false; |
| 959 } | 959 } |
| 960 } | 960 } |
| 961 } | 961 } |
| 962 static [_skipLeadingWhitespace](string, index) { | 962 static [_skipLeadingWhitespace](string, index) { |
| 963 let SPACE = 32; | 963 let SPACE = 32; |
| 964 let CARRIAGE_RETURN = 13; | 964 let CARRIAGE_RETURN = 13; |
| 965 while (dart.notNull(index) < dart.notNull(string.length)) { | 965 while (dart.notNull(index) < dart.notNull(string.length)) { |
| 966 let codeUnit = string.codeUnitAt(index); | 966 let codeUnit = string.codeUnitAt(index); |
| 967 if (codeUnit !== SPACE && codeUnit !== CARRIAGE_RETURN && !dart.notNull(
JSString[_isWhitespace](codeUnit))) { | 967 if (codeUnit != SPACE && codeUnit != CARRIAGE_RETURN && !dart.notNull(JS
String[_isWhitespace](codeUnit))) { |
| 968 break; | 968 break; |
| 969 } | 969 } |
| 970 index = dart.notNull(index) + 1; | 970 index = dart.notNull(index) + 1; |
| 971 } | 971 } |
| 972 return index; | 972 return index; |
| 973 } | 973 } |
| 974 static [_skipTrailingWhitespace](string, index) { | 974 static [_skipTrailingWhitespace](string, index) { |
| 975 let SPACE = 32; | 975 let SPACE = 32; |
| 976 let CARRIAGE_RETURN = 13; | 976 let CARRIAGE_RETURN = 13; |
| 977 while (dart.notNull(index) > 0) { | 977 while (dart.notNull(index) > 0) { |
| 978 let codeUnit = string.codeUnitAt(dart.notNull(index) - 1); | 978 let codeUnit = string.codeUnitAt(dart.notNull(index) - 1); |
| 979 if (codeUnit !== SPACE && codeUnit !== CARRIAGE_RETURN && !dart.notNull(
JSString[_isWhitespace](codeUnit))) { | 979 if (codeUnit != SPACE && codeUnit != CARRIAGE_RETURN && !dart.notNull(JS
String[_isWhitespace](codeUnit))) { |
| 980 break; | 980 break; |
| 981 } | 981 } |
| 982 index = dart.notNull(index) - 1; | 982 index = dart.notNull(index) - 1; |
| 983 } | 983 } |
| 984 return index; | 984 return index; |
| 985 } | 985 } |
| 986 trim() { | 986 trim() { |
| 987 let NEL = 133; | 987 let NEL = 133; |
| 988 let result = this.trim(); | 988 let result = this.trim(); |
| 989 if (result.length === 0) | 989 if (result.length == 0) |
| 990 return result; | 990 return result; |
| 991 let firstCode = result.codeUnitAt(0); | 991 let firstCode = result.codeUnitAt(0); |
| 992 let startIndex = 0; | 992 let startIndex = 0; |
| 993 if (firstCode === NEL) { | 993 if (firstCode == NEL) { |
| 994 startIndex = JSString[_skipLeadingWhitespace](result, 1); | 994 startIndex = JSString[_skipLeadingWhitespace](result, 1); |
| 995 if (startIndex === result.length) | 995 if (startIndex == result.length) |
| 996 return ""; | 996 return ""; |
| 997 } | 997 } |
| 998 let endIndex = result.length; | 998 let endIndex = result.length; |
| 999 let lastCode = result.codeUnitAt(dart.notNull(endIndex) - 1); | 999 let lastCode = result.codeUnitAt(dart.notNull(endIndex) - 1); |
| 1000 if (lastCode === NEL) { | 1000 if (lastCode == NEL) { |
| 1001 endIndex = JSString[_skipTrailingWhitespace](result, dart.notNull(endInd
ex) - 1); | 1001 endIndex = JSString[_skipTrailingWhitespace](result, dart.notNull(endInd
ex) - 1); |
| 1002 } | 1002 } |
| 1003 if (startIndex === 0 && endIndex === result.length) | 1003 if (startIndex == 0 && endIndex == result.length) |
| 1004 return result; | 1004 return result; |
| 1005 return result.substring(startIndex, endIndex); | 1005 return result.substring(startIndex, endIndex); |
| 1006 } | 1006 } |
| 1007 trimLeft() { | 1007 trimLeft() { |
| 1008 let NEL = 133; | 1008 let NEL = 133; |
| 1009 let result = null; | 1009 let result = null; |
| 1010 let startIndex = 0; | 1010 let startIndex = 0; |
| 1011 if (typeof this.trimLeft != "undefined") { | 1011 if (typeof this.trimLeft != "undefined") { |
| 1012 result = this.trimLeft(); | 1012 result = this.trimLeft(); |
| 1013 if (result.length === 0) | 1013 if (result.length == 0) |
| 1014 return result; | 1014 return result; |
| 1015 let firstCode = result.codeUnitAt(0); | 1015 let firstCode = result.codeUnitAt(0); |
| 1016 if (firstCode === NEL) { | 1016 if (firstCode == NEL) { |
| 1017 startIndex = JSString[_skipLeadingWhitespace](result, 1); | 1017 startIndex = JSString[_skipLeadingWhitespace](result, 1); |
| 1018 } | 1018 } |
| 1019 } else { | 1019 } else { |
| 1020 result = this; | 1020 result = this; |
| 1021 startIndex = JSString[_skipLeadingWhitespace](this, 0); | 1021 startIndex = JSString[_skipLeadingWhitespace](this, 0); |
| 1022 } | 1022 } |
| 1023 if (startIndex === 0) | 1023 if (startIndex == 0) |
| 1024 return result; | 1024 return result; |
| 1025 if (startIndex === result.length) | 1025 if (startIndex == result.length) |
| 1026 return ""; | 1026 return ""; |
| 1027 return result.substring(startIndex); | 1027 return result.substring(startIndex); |
| 1028 } | 1028 } |
| 1029 trimRight() { | 1029 trimRight() { |
| 1030 let NEL = 133; | 1030 let NEL = 133; |
| 1031 let result = null; | 1031 let result = null; |
| 1032 let endIndex = null; | 1032 let endIndex = null; |
| 1033 if (typeof this.trimRight != "undefined") { | 1033 if (typeof this.trimRight != "undefined") { |
| 1034 result = this.trimRight(); | 1034 result = this.trimRight(); |
| 1035 endIndex = result.length; | 1035 endIndex = result.length; |
| 1036 if (endIndex === 0) | 1036 if (endIndex == 0) |
| 1037 return result; | 1037 return result; |
| 1038 let lastCode = result.codeUnitAt(dart.notNull(endIndex) - 1); | 1038 let lastCode = result.codeUnitAt(dart.notNull(endIndex) - 1); |
| 1039 if (lastCode === NEL) { | 1039 if (lastCode == NEL) { |
| 1040 endIndex = JSString[_skipTrailingWhitespace](result, dart.notNull(endI
ndex) - 1); | 1040 endIndex = JSString[_skipTrailingWhitespace](result, dart.notNull(endI
ndex) - 1); |
| 1041 } | 1041 } |
| 1042 } else { | 1042 } else { |
| 1043 result = this; | 1043 result = this; |
| 1044 endIndex = JSString[_skipTrailingWhitespace](this, this.length); | 1044 endIndex = JSString[_skipTrailingWhitespace](this, this.length); |
| 1045 } | 1045 } |
| 1046 if (endIndex === result.length) | 1046 if (endIndex == result.length) |
| 1047 return result; | 1047 return result; |
| 1048 if (endIndex === 0) | 1048 if (endIndex == 0) |
| 1049 return ""; | 1049 return ""; |
| 1050 return result.substring(0, endIndex); | 1050 return result.substring(0, endIndex); |
| 1051 } | 1051 } |
| 1052 ['*'](times) { | 1052 ['*'](times) { |
| 1053 if (0 >= dart.notNull(times)) | 1053 if (0 >= dart.notNull(times)) |
| 1054 return ''; | 1054 return ''; |
| 1055 if (times === 1 || this.length === 0) | 1055 if (times == 1 || this.length == 0) |
| 1056 return this; | 1056 return this; |
| 1057 if (times !== times >>> 0) { | 1057 if (!dart.equals(times, times >>> 0)) { |
| 1058 throw new core.OutOfMemoryError(); | 1058 throw new core.OutOfMemoryError(); |
| 1059 } | 1059 } |
| 1060 let result = ''; | 1060 let result = ''; |
| 1061 let s = this; | 1061 let s = this; |
| 1062 while (true) { | 1062 while (true) { |
| 1063 if ((dart.notNull(times) & 1) === 1) | 1063 if ((dart.notNull(times) & 1) == 1) |
| 1064 result = s['+'](result); | 1064 result = s['+'](result); |
| 1065 times = dart.as(times >>> 1, core.int); | 1065 times = dart.as(times >>> 1, core.int); |
| 1066 if (times === 0) | 1066 if (times == 0) |
| 1067 break; | 1067 break; |
| 1068 s = s; | 1068 s = s; |
| 1069 } | 1069 } |
| 1070 return result; | 1070 return result; |
| 1071 } | 1071 } |
| 1072 padLeft(width, padding) { | 1072 padLeft(width, padding) { |
| 1073 if (padding === void 0) | 1073 if (padding === void 0) |
| 1074 padding = ' '; | 1074 padding = ' '; |
| 1075 let delta = dart.notNull(width) - dart.notNull(this.length); | 1075 let delta = dart.notNull(width) - dart.notNull(this.length); |
| 1076 if (dart.notNull(delta) <= 0) | 1076 if (dart.notNull(delta) <= 0) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1099 throw new core.ArgumentError(start); | 1099 throw new core.ArgumentError(start); |
| 1100 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(this.len
gth)) { | 1100 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(this.len
gth)) { |
| 1101 throw new core.RangeError.range(start, 0, this.length); | 1101 throw new core.RangeError.range(start, 0, this.length); |
| 1102 } | 1102 } |
| 1103 if (typeof pattern == 'string') { | 1103 if (typeof pattern == 'string') { |
| 1104 return this.indexOf(pattern, start); | 1104 return this.indexOf(pattern, start); |
| 1105 } | 1105 } |
| 1106 if (dart.is(pattern, _js_helper.JSSyntaxRegExp)) { | 1106 if (dart.is(pattern, _js_helper.JSSyntaxRegExp)) { |
| 1107 let re = pattern; | 1107 let re = pattern; |
| 1108 let match = _js_helper.firstMatchAfter(re, this, start); | 1108 let match = _js_helper.firstMatchAfter(re, this, start); |
| 1109 return match === null ? -1 : match.start; | 1109 return match == null ? -1 : match.start; |
| 1110 } | 1110 } |
| 1111 for (let i = start; dart.notNull(i) <= dart.notNull(this.length); i = dart
.notNull(i) + 1) { | 1111 for (let i = start; dart.notNull(i) <= dart.notNull(this.length); i = dart
.notNull(i) + 1) { |
| 1112 if (pattern.matchAsPrefix(this, i) !== null) | 1112 if (pattern.matchAsPrefix(this, i) != null) |
| 1113 return i; | 1113 return i; |
| 1114 } | 1114 } |
| 1115 return -1; | 1115 return -1; |
| 1116 } | 1116 } |
| 1117 lastIndexOf(pattern, start) { | 1117 lastIndexOf(pattern, start) { |
| 1118 if (start === void 0) | 1118 if (start === void 0) |
| 1119 start = null; | 1119 start = null; |
| 1120 _js_helper.checkNull(pattern); | 1120 _js_helper.checkNull(pattern); |
| 1121 if (start === null) { | 1121 if (start == null) { |
| 1122 start = this.length; | 1122 start = this.length; |
| 1123 } else if (!(typeof start == 'number')) { | 1123 } else if (!(typeof start == 'number')) { |
| 1124 throw new core.ArgumentError(start); | 1124 throw new core.ArgumentError(start); |
| 1125 } else if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(t
his.length)) { | 1125 } else if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(t
his.length)) { |
| 1126 throw new core.RangeError.range(start, 0, this.length); | 1126 throw new core.RangeError.range(start, 0, this.length); |
| 1127 } | 1127 } |
| 1128 if (typeof pattern == 'string') { | 1128 if (typeof pattern == 'string') { |
| 1129 let other = pattern; | 1129 let other = pattern; |
| 1130 if (dart.notNull(start) + dart.notNull(other.length) > dart.notNull(this
.length)) { | 1130 if (dart.notNull(start) + dart.notNull(other.length) > dart.notNull(this
.length)) { |
| 1131 start = dart.notNull(this.length) - dart.notNull(other.length); | 1131 start = dart.notNull(this.length) - dart.notNull(other.length); |
| 1132 } | 1132 } |
| 1133 return dart.as(_js_helper.stringLastIndexOfUnchecked(this, other, start)
, core.int); | 1133 return dart.as(_js_helper.stringLastIndexOfUnchecked(this, other, start)
, core.int); |
| 1134 } | 1134 } |
| 1135 for (let i = start; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) { | 1135 for (let i = start; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) { |
| 1136 if (pattern.matchAsPrefix(this, i) !== null) | 1136 if (pattern.matchAsPrefix(this, i) != null) |
| 1137 return i; | 1137 return i; |
| 1138 } | 1138 } |
| 1139 return -1; | 1139 return -1; |
| 1140 } | 1140 } |
| 1141 contains(other, startIndex) { | 1141 contains(other, startIndex) { |
| 1142 if (startIndex === void 0) | 1142 if (startIndex === void 0) |
| 1143 startIndex = 0; | 1143 startIndex = 0; |
| 1144 _js_helper.checkNull(other); | 1144 _js_helper.checkNull(other); |
| 1145 if (dart.notNull(startIndex) < 0 || dart.notNull(startIndex) > dart.notNul
l(this.length)) { | 1145 if (dart.notNull(startIndex) < 0 || dart.notNull(startIndex) > dart.notNul
l(this.length)) { |
| 1146 throw new core.RangeError.range(startIndex, 0, this.length); | 1146 throw new core.RangeError.range(startIndex, 0, this.length); |
| 1147 } | 1147 } |
| 1148 return dart.as(_js_helper.stringContainsUnchecked(this, other, startIndex)
, core.bool); | 1148 return dart.as(_js_helper.stringContainsUnchecked(this, other, startIndex)
, core.bool); |
| 1149 } | 1149 } |
| 1150 get isEmpty() { | 1150 get isEmpty() { |
| 1151 return this.length === 0; | 1151 return this.length == 0; |
| 1152 } | 1152 } |
| 1153 get isNotEmpty() { | 1153 get isNotEmpty() { |
| 1154 return !dart.notNull(this.isEmpty); | 1154 return !dart.notNull(this.isEmpty); |
| 1155 } | 1155 } |
| 1156 compareTo(other) { | 1156 compareTo(other) { |
| 1157 if (!(typeof other == 'string')) | 1157 if (!(typeof other == 'string')) |
| 1158 throw new core.ArgumentError(other); | 1158 throw new core.ArgumentError(other); |
| 1159 return dart.equals(this, other) ? 0 : this < other ? -1 : 1; | 1159 return dart.equals(this, other) ? 0 : this < other ? -1 : 1; |
| 1160 } | 1160 } |
| 1161 toString() { | 1161 toString() { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1198 get(i) { | 1198 get(i) { |
| 1199 return this[_string].codeUnitAt(i); | 1199 return this[_string].codeUnitAt(i); |
| 1200 } | 1200 } |
| 1201 } | 1201 } |
| 1202 // Function _symbolToString: (Symbol) → String | 1202 // Function _symbolToString: (Symbol) → String |
| 1203 function _symbolToString(symbol) { | 1203 function _symbolToString(symbol) { |
| 1204 return _internal.Symbol.getName(dart.as(symbol, _internal.Symbol)); | 1204 return _internal.Symbol.getName(dart.as(symbol, _internal.Symbol)); |
| 1205 } | 1205 } |
| 1206 // Function _symbolMapToStringMap: (Map<Symbol, dynamic>) → dynamic | 1206 // Function _symbolMapToStringMap: (Map<Symbol, dynamic>) → dynamic |
| 1207 function _symbolMapToStringMap(map) { | 1207 function _symbolMapToStringMap(map) { |
| 1208 if (map === null) | 1208 if (map == null) |
| 1209 return null; | 1209 return null; |
| 1210 let result = new core.Map(); | 1210 let result = new core.Map(); |
| 1211 map.forEach((key, value) => { | 1211 map.forEach((key, value) => { |
| 1212 result.set(_symbolToString(key), value); | 1212 result.set(_symbolToString(key), value); |
| 1213 }); | 1213 }); |
| 1214 return result; | 1214 return result; |
| 1215 } | 1215 } |
| 1216 // Function getInterceptor: (dynamic) → dynamic | 1216 // Function getInterceptor: (dynamic) → dynamic |
| 1217 function getInterceptor(object) { | 1217 function getInterceptor(object) { |
| 1218 return void 0; | 1218 return void 0; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1241 function dispatchRecordExtension(record) { | 1241 function dispatchRecordExtension(record) { |
| 1242 return record.e; | 1242 return record.e; |
| 1243 } | 1243 } |
| 1244 // Function dispatchRecordIndexability: (dynamic) → dynamic | 1244 // Function dispatchRecordIndexability: (dynamic) → dynamic |
| 1245 function dispatchRecordIndexability(record) { | 1245 function dispatchRecordIndexability(record) { |
| 1246 return record.x; | 1246 return record.x; |
| 1247 } | 1247 } |
| 1248 // Function getNativeInterceptor: (dynamic) → dynamic | 1248 // Function getNativeInterceptor: (dynamic) → dynamic |
| 1249 function getNativeInterceptor(object) { | 1249 function getNativeInterceptor(object) { |
| 1250 let record = getDispatchProperty(object); | 1250 let record = getDispatchProperty(object); |
| 1251 if (record === null) { | 1251 if (record == null) { |
| 1252 if (_js_helper.initNativeDispatchFlag === null) { | 1252 if (_js_helper.initNativeDispatchFlag == null) { |
| 1253 _js_helper.initNativeDispatch(); | 1253 _js_helper.initNativeDispatch(); |
| 1254 record = getDispatchProperty(object); | 1254 record = getDispatchProperty(object); |
| 1255 } | 1255 } |
| 1256 } | 1256 } |
| 1257 if (record !== null) { | 1257 if (record != null) { |
| 1258 let proto = dispatchRecordProto(record); | 1258 let proto = dispatchRecordProto(record); |
| 1259 if (false === proto) | 1259 if (dart.equals(false, proto)) |
| 1260 return dispatchRecordInterceptor(record); | 1260 return dispatchRecordInterceptor(record); |
| 1261 if (true === proto) | 1261 if (dart.equals(true, proto)) |
| 1262 return object; | 1262 return object; |
| 1263 let objectProto = Object.getPrototypeOf(object); | 1263 let objectProto = Object.getPrototypeOf(object); |
| 1264 if (proto === objectProto) { | 1264 if (proto === objectProto) { |
| 1265 return dispatchRecordInterceptor(record); | 1265 return dispatchRecordInterceptor(record); |
| 1266 } | 1266 } |
| 1267 let extension = dispatchRecordExtension(record); | 1267 let extension = dispatchRecordExtension(record); |
| 1268 if (extension === objectProto) { | 1268 if (extension === objectProto) { |
| 1269 let discriminatedTag = proto(object, record); | 1269 let discriminatedTag = proto(object, record); |
| 1270 throw new core.UnimplementedError(`Return interceptor for ${discriminate
dTag}`); | 1270 throw new core.UnimplementedError(`Return interceptor for ${discriminate
dTag}`); |
| 1271 } | 1271 } |
| 1272 } | 1272 } |
| 1273 let interceptor = _js_helper.lookupAndCacheInterceptor(object); | 1273 let interceptor = _js_helper.lookupAndCacheInterceptor(object); |
| 1274 if (interceptor === null) { | 1274 if (interceptor == null) { |
| 1275 let proto = Object.getPrototypeOf(object); | 1275 let proto = Object.getPrototypeOf(object); |
| 1276 if (proto == null || proto === Object.prototype) { | 1276 if (proto == null || proto === Object.prototype) { |
| 1277 return _foreign_helper.JS_INTERCEPTOR_CONSTANT(PlainJavaScriptObject); | 1277 return _foreign_helper.JS_INTERCEPTOR_CONSTANT(PlainJavaScriptObject); |
| 1278 } else { | 1278 } else { |
| 1279 return _foreign_helper.JS_INTERCEPTOR_CONSTANT(UnknownJavaScriptObject); | 1279 return _foreign_helper.JS_INTERCEPTOR_CONSTANT(UnknownJavaScriptObject); |
| 1280 } | 1280 } |
| 1281 } | 1281 } |
| 1282 return interceptor; | 1282 return interceptor; |
| 1283 } | 1283 } |
| 1284 dart.copyProperties(exports, { | 1284 dart.copyProperties(exports, { |
| 1285 get mapTypeToInterceptor() { | 1285 get mapTypeToInterceptor() { |
| 1286 return _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.MAP_TYPE_
TO_INTERCEPTOR); | 1286 return _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.MAP_TYPE_
TO_INTERCEPTOR); |
| 1287 } | 1287 } |
| 1288 }); | 1288 }); |
| 1289 // Function findIndexForNativeSubclassType: (Type) → int | 1289 // Function findIndexForNativeSubclassType: (Type) → int |
| 1290 function findIndexForNativeSubclassType(type) { | 1290 function findIndexForNativeSubclassType(type) { |
| 1291 if (exports.mapTypeToInterceptor == null) | 1291 if (exports.mapTypeToInterceptor == null) |
| 1292 return null; | 1292 return null; |
| 1293 let map = dart.as(exports.mapTypeToInterceptor, core.List); | 1293 let map = dart.as(exports.mapTypeToInterceptor, core.List); |
| 1294 for (let i = 0; dart.notNull(i) + 1 < dart.notNull(map.length); i = 3) { | 1294 for (let i = 0; dart.notNull(i) + 1 < dart.notNull(map.length); i = 3) { |
| 1295 if (dart.equals(type, map.get(i))) { | 1295 if (dart.equals(type, map.get(i))) { |
| 1296 return i; | 1296 return i; |
| 1297 } | 1297 } |
| 1298 } | 1298 } |
| 1299 return null; | 1299 return null; |
| 1300 } | 1300 } |
| 1301 // Function findInterceptorConstructorForType: (Type) → dynamic | 1301 // Function findInterceptorConstructorForType: (Type) → dynamic |
| 1302 function findInterceptorConstructorForType(type) { | 1302 function findInterceptorConstructorForType(type) { |
| 1303 let index = findIndexForNativeSubclassType(type); | 1303 let index = findIndexForNativeSubclassType(type); |
| 1304 if (index === null) | 1304 if (index == null) |
| 1305 return null; | 1305 return null; |
| 1306 let map = dart.as(exports.mapTypeToInterceptor, core.List); | 1306 let map = dart.as(exports.mapTypeToInterceptor, core.List); |
| 1307 return map.get(dart.notNull(index) + 1); | 1307 return map.get(dart.notNull(index) + 1); |
| 1308 } | 1308 } |
| 1309 // Function findConstructorForNativeSubclassType: (Type, String) → dynamic | 1309 // Function findConstructorForNativeSubclassType: (Type, String) → dynamic |
| 1310 function findConstructorForNativeSubclassType(type, name) { | 1310 function findConstructorForNativeSubclassType(type, name) { |
| 1311 let index = findIndexForNativeSubclassType(type); | 1311 let index = findIndexForNativeSubclassType(type); |
| 1312 if (index === null) | 1312 if (index == null) |
| 1313 return null; | 1313 return null; |
| 1314 let map = dart.as(exports.mapTypeToInterceptor, core.List); | 1314 let map = dart.as(exports.mapTypeToInterceptor, core.List); |
| 1315 let constructorMap = map.get(dart.notNull(index) + 2); | 1315 let constructorMap = map.get(dart.notNull(index) + 2); |
| 1316 let constructorFn = constructorMap[name]; | 1316 let constructorFn = constructorMap[name]; |
| 1317 return constructorFn; | 1317 return constructorFn; |
| 1318 } | 1318 } |
| 1319 // Function findInterceptorForType: (Type) → dynamic | 1319 // Function findInterceptorForType: (Type) → dynamic |
| 1320 function findInterceptorForType(type) { | 1320 function findInterceptorForType(type) { |
| 1321 let constructor = findInterceptorConstructorForType(type); | 1321 let constructor = findInterceptorConstructorForType(type); |
| 1322 if (constructor === null) | 1322 if (constructor == null) |
| 1323 return null; | 1323 return null; |
| 1324 return constructor.prototype; | 1324 return constructor.prototype; |
| 1325 } | 1325 } |
| 1326 class JSBool extends Interceptor { | 1326 class JSBool extends Interceptor { |
| 1327 JSBool() { | 1327 JSBool() { |
| 1328 super.Interceptor(); | 1328 super.Interceptor(); |
| 1329 } | 1329 } |
| 1330 toString() { | 1330 toString() { |
| 1331 return String(this); | 1331 return String(this); |
| 1332 } | 1332 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1419 exports.findInterceptorForType = findInterceptorForType; | 1419 exports.findInterceptorForType = findInterceptorForType; |
| 1420 exports.JSBool = JSBool; | 1420 exports.JSBool = JSBool; |
| 1421 exports.JSNull = JSNull; | 1421 exports.JSNull = JSNull; |
| 1422 exports.JSIndexable = JSIndexable; | 1422 exports.JSIndexable = JSIndexable; |
| 1423 exports.JSMutableIndexable = JSMutableIndexable; | 1423 exports.JSMutableIndexable = JSMutableIndexable; |
| 1424 exports.JSObject = JSObject; | 1424 exports.JSObject = JSObject; |
| 1425 exports.JavaScriptObject = JavaScriptObject; | 1425 exports.JavaScriptObject = JavaScriptObject; |
| 1426 exports.PlainJavaScriptObject = PlainJavaScriptObject; | 1426 exports.PlainJavaScriptObject = PlainJavaScriptObject; |
| 1427 exports.UnknownJavaScriptObject = UnknownJavaScriptObject; | 1427 exports.UnknownJavaScriptObject = UnknownJavaScriptObject; |
| 1428 })(_interceptors || (_interceptors = {})); | 1428 })(_interceptors || (_interceptors = {})); |
| OLD | NEW |