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

Side by Side Diff: lib/runtime/dart/core.js

Issue 1153003003: fixes #40, extension methods for primitive types (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 var core = dart.defineLibrary(core, {}); 1 var core = dart.defineLibrary(core, {});
2 var _js_helper = dart.lazyImport(_js_helper); 2 var _js_helper = dart.lazyImport(_js_helper);
3 var _internal = dart.lazyImport(_internal); 3 var _internal = dart.lazyImport(_internal);
4 var collection = dart.lazyImport(collection); 4 var collection = dart.lazyImport(collection);
5 var _interceptors = dart.lazyImport(_interceptors); 5 var _interceptors = dart.lazyImport(_interceptors);
6 var math = dart.lazyImport(math);
7 var convert = dart.lazyImport(convert); 6 var convert = dart.lazyImport(convert);
8 (function(exports, _js_helper, _internal, collection, _interceptors, math, conve rt) { 7 (function(exports, _js_helper, _internal, collection, _interceptors, convert) {
9 'use strict'; 8 'use strict';
10 class Object { 9 class Object {
11 constructor() { 10 constructor() {
12 let name = this.constructor.name; 11 let name = this.constructor.name;
13 let init = this[name]; 12 let init = this[name];
14 let result = void 0; 13 let result = void 0;
15 if (init) 14 if (init)
16 result = init.apply(this, arguments); 15 result = init.apply(this, arguments);
17 return result === void 0 ? this : result; 16 return result === void 0 ? this : result;
18 } 17 }
(...skipping 14 matching lines...) Expand all
33 } 32 }
34 } 33 }
35 dart.setSignature(Object, { 34 dart.setSignature(Object, {
36 constructors: () => ({Object: [Object, []]}), 35 constructors: () => ({Object: [Object, []]}),
37 methods: () => ({ 36 methods: () => ({
38 '==': [bool, [Object]], 37 '==': [bool, [Object]],
39 toString: [String, []], 38 toString: [String, []],
40 noSuchMethod: [Object, [Invocation]] 39 noSuchMethod: [Object, [Invocation]]
41 }) 40 })
42 }); 41 });
43 class JsName extends Object {
44 JsName(opts) {
45 let name = opts && 'name' in opts ? opts.name : null;
46 this.name = name;
47 }
48 }
49 dart.setSignature(JsName, {
50 constructors: () => ({JsName: [JsName, [], {name: String}]})
51 });
52 class JsPeerInterface extends Object {
53 JsPeerInterface(opts) {
54 let name = opts && 'name' in opts ? opts.name : null;
55 this.name = name;
56 }
57 }
58 dart.setSignature(JsPeerInterface, {
59 constructors: () => ({JsPeerInterface: [JsPeerInterface, [], {name: String}] })
60 });
61 class SupportJsExtensionMethod extends Object {
62 SupportJsExtensionMethod() {
63 }
64 }
65 dart.setSignature(SupportJsExtensionMethod, {
66 constructors: () => ({SupportJsExtensionMethod: [SupportJsExtensionMethod, [ ]]})
67 });
68 class Deprecated extends Object { 42 class Deprecated extends Object {
69 Deprecated(expires) { 43 Deprecated(expires) {
70 this.expires = expires; 44 this.expires = expires;
71 } 45 }
72 toString() { 46 toString() {
73 return `Deprecated feature. Will be removed ${this.expires}`; 47 return `Deprecated feature. Will be removed ${this.expires}`;
74 } 48 }
75 } 49 }
76 dart.setSignature(Deprecated, { 50 dart.setSignature(Deprecated, {
77 constructors: () => ({Deprecated: [Deprecated, [String]]}) 51 constructors: () => ({Deprecated: [Deprecated, [String]]})
(...skipping 28 matching lines...) Expand all
106 constructors: () => ({fromEnvironment: [bool, [String], {defaultValue: bool} ]}) 80 constructors: () => ({fromEnvironment: [bool, [String], {defaultValue: bool} ]})
107 }); 81 });
108 let Comparator$ = dart.generic(function(T) { 82 let Comparator$ = dart.generic(function(T) {
109 let Comparator = dart.typedef('Comparator', () => dart.functionType(int, [T, T])); 83 let Comparator = dart.typedef('Comparator', () => dart.functionType(int, [T, T]));
110 return Comparator; 84 return Comparator;
111 }); 85 });
112 let Comparator = Comparator$(); 86 let Comparator = Comparator$();
113 let Comparable$ = dart.generic(function(T) { 87 let Comparable$ = dart.generic(function(T) {
114 class Comparable extends Object { 88 class Comparable extends Object {
115 static compare(a, b) { 89 static compare(a, b) {
116 return a.compareTo(b); 90 return a[dartx.compareTo](b);
117 } 91 }
118 } 92 }
119 dart.setSignature(Comparable, { 93 dart.setSignature(Comparable, {
120 statics: () => ({compare: [int, [Comparable$(), Comparable$()]]}), 94 statics: () => ({compare: [int, [Comparable$(), Comparable$()]]}),
121 names: ['compare'] 95 names: ['compare']
122 }); 96 });
123 return Comparable; 97 return Comparable;
124 }); 98 });
125 let Comparable = Comparable$(); 99 let Comparable = Comparable$();
126 class DateTime extends Object { 100 class DateTime extends Object {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 return double.parse(matched); 147 return double.parse(matched);
174 }; 148 };
175 dart.fn(parseDoubleOrZero, double, [String]); 149 dart.fn(parseDoubleOrZero, double, [String]);
176 let years = int.parse(match.get(1)); 150 let years = int.parse(match.get(1));
177 let month = int.parse(match.get(2)); 151 let month = int.parse(match.get(2));
178 let day = int.parse(match.get(3)); 152 let day = int.parse(match.get(3));
179 let hour = parseIntOrZero(match.get(4)); 153 let hour = parseIntOrZero(match.get(4));
180 let minute = parseIntOrZero(match.get(5)); 154 let minute = parseIntOrZero(match.get(5));
181 let second = parseIntOrZero(match.get(6)); 155 let second = parseIntOrZero(match.get(6));
182 let addOneMillisecond = false; 156 let addOneMillisecond = false;
183 let millisecond = (dart.notNull(parseDoubleOrZero(match.get(7))) * 1000) .round(); 157 let millisecond = (dart.notNull(parseDoubleOrZero(match.get(7))) * 1000) [dartx.round]();
184 if (millisecond == 1000) { 158 if (millisecond == 1000) {
185 addOneMillisecond = true; 159 addOneMillisecond = true;
186 millisecond = 999; 160 millisecond = 999;
187 } 161 }
188 let isUtc = false; 162 let isUtc = false;
189 if (match.get(8) != null) { 163 if (match.get(8) != null) {
190 isUtc = true; 164 isUtc = true;
191 if (match.get(9) != null) { 165 if (match.get(9) != null) {
192 let sign = match.get(9) == '-' ? -1 : 1; 166 let sign = match.get(9) == '-' ? -1 : 1;
193 let hourDifference = int.parse(match.get(10)); 167 let hourDifference = int.parse(match.get(10));
(...skipping 11 matching lines...) Expand all
205 } 179 }
206 return new DateTime.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, { isUtc: isUtc}); 180 return new DateTime.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, { isUtc: isUtc});
207 } else { 181 } else {
208 throw new FormatException("Invalid date format", formattedString); 182 throw new FormatException("Invalid date format", formattedString);
209 } 183 }
210 } 184 }
211 fromMillisecondsSinceEpoch(millisecondsSinceEpoch, opts) { 185 fromMillisecondsSinceEpoch(millisecondsSinceEpoch, opts) {
212 let isUtc = opts && 'isUtc' in opts ? opts.isUtc : false; 186 let isUtc = opts && 'isUtc' in opts ? opts.isUtc : false;
213 this.millisecondsSinceEpoch = millisecondsSinceEpoch; 187 this.millisecondsSinceEpoch = millisecondsSinceEpoch;
214 this.isUtc = isUtc; 188 this.isUtc = isUtc;
215 if (dart.notNull(millisecondsSinceEpoch.abs()) > dart.notNull(DateTime._MA X_MILLISECONDS_SINCE_EPOCH)) { 189 if (dart.notNull(millisecondsSinceEpoch[dartx.abs]()) > dart.notNull(DateT ime._MAX_MILLISECONDS_SINCE_EPOCH)) {
216 throw new ArgumentError(millisecondsSinceEpoch); 190 throw new ArgumentError(millisecondsSinceEpoch);
217 } 191 }
218 if (isUtc == null) 192 if (isUtc == null)
219 throw new ArgumentError(isUtc); 193 throw new ArgumentError(isUtc);
220 } 194 }
221 ['=='](other) { 195 ['=='](other) {
222 if (!dart.is(other, DateTime)) 196 if (!dart.is(other, DateTime))
223 return false; 197 return false;
224 return dart.equals(this.millisecondsSinceEpoch, dart.dload(other, 'millise condsSinceEpoch')) && dart.equals(this.isUtc, dart.dload(other, 'isUtc')); 198 return dart.equals(this.millisecondsSinceEpoch, dart.dload(other, 'millise condsSinceEpoch')) && dart.equals(this.isUtc, dart.dload(other, 'isUtc'));
225 } 199 }
226 isBefore(other) { 200 isBefore(other) {
227 return dart.notNull(this.millisecondsSinceEpoch) < dart.notNull(other.mill isecondsSinceEpoch); 201 return dart.notNull(this.millisecondsSinceEpoch) < dart.notNull(other.mill isecondsSinceEpoch);
228 } 202 }
229 isAfter(other) { 203 isAfter(other) {
230 return dart.notNull(this.millisecondsSinceEpoch) > dart.notNull(other.mill isecondsSinceEpoch); 204 return dart.notNull(this.millisecondsSinceEpoch) > dart.notNull(other.mill isecondsSinceEpoch);
231 } 205 }
232 isAtSameMomentAs(other) { 206 isAtSameMomentAs(other) {
233 return this.millisecondsSinceEpoch == other.millisecondsSinceEpoch; 207 return this.millisecondsSinceEpoch == other.millisecondsSinceEpoch;
234 } 208 }
235 compareTo(other) { 209 compareTo(other) {
236 return this.millisecondsSinceEpoch.compareTo(other.millisecondsSinceEpoch) ; 210 return this.millisecondsSinceEpoch[dartx.compareTo](other.millisecondsSinc eEpoch);
237 } 211 }
238 get hashCode() { 212 get hashCode() {
239 return this.millisecondsSinceEpoch; 213 return this.millisecondsSinceEpoch;
240 } 214 }
241 toLocal() { 215 toLocal() {
242 if (this.isUtc) { 216 if (this.isUtc) {
243 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpo ch, {isUtc: false}); 217 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpo ch, {isUtc: false});
244 } 218 }
245 return this; 219 return this;
246 } 220 }
247 toUtc() { 221 toUtc() {
248 if (this.isUtc) 222 if (this.isUtc)
249 return this; 223 return this;
250 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpoch , {isUtc: true}); 224 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpoch , {isUtc: true});
251 } 225 }
252 static _fourDigits(n) { 226 static _fourDigits(n) {
253 let absN = n.abs(); 227 let absN = n[dartx.abs]();
254 let sign = dart.notNull(n) < 0 ? "-" : ""; 228 let sign = dart.notNull(n) < 0 ? "-" : "";
255 if (dart.notNull(absN) >= 1000) 229 if (dart.notNull(absN) >= 1000)
256 return `${n}`; 230 return `${n}`;
257 if (dart.notNull(absN) >= 100) 231 if (dart.notNull(absN) >= 100)
258 return `${sign}0${absN}`; 232 return `${sign}0${absN}`;
259 if (dart.notNull(absN) >= 10) 233 if (dart.notNull(absN) >= 10)
260 return `${sign}00${absN}`; 234 return `${sign}00${absN}`;
261 return `${sign}000${absN}`; 235 return `${sign}000${absN}`;
262 } 236 }
263 static _sixDigits(n) { 237 static _sixDigits(n) {
264 dart.assert(dart.notNull(n) < -9999 || dart.notNull(n) > 9999); 238 dart.assert(dart.notNull(n) < -9999 || dart.notNull(n) > 9999);
265 let absN = n.abs(); 239 let absN = n[dartx.abs]();
266 let sign = dart.notNull(n) < 0 ? "-" : "+"; 240 let sign = dart.notNull(n) < 0 ? "-" : "+";
267 if (dart.notNull(absN) >= 100000) 241 if (dart.notNull(absN) >= 100000)
268 return `${sign}${absN}`; 242 return `${sign}${absN}`;
269 return `${sign}0${absN}`; 243 return `${sign}0${absN}`;
270 } 244 }
271 static _threeDigits(n) { 245 static _threeDigits(n) {
272 if (dart.notNull(n) >= 100) 246 if (dart.notNull(n) >= 100)
273 return `${n}`; 247 return `${n}`;
274 if (dart.notNull(n) >= 10) 248 if (dart.notNull(n) >= 10)
275 return `0${n}`; 249 return `0${n}`;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 return dart.as(_js_helper.Primitives.getSeconds(this), int); 335 return dart.as(_js_helper.Primitives.getSeconds(this), int);
362 } 336 }
363 get millisecond() { 337 get millisecond() {
364 return dart.as(_js_helper.Primitives.getMilliseconds(this), int); 338 return dart.as(_js_helper.Primitives.getMilliseconds(this), int);
365 } 339 }
366 get weekday() { 340 get weekday() {
367 return dart.as(_js_helper.Primitives.getWeekday(this), int); 341 return dart.as(_js_helper.Primitives.getWeekday(this), int);
368 } 342 }
369 } 343 }
370 DateTime[dart.implements] = () => [Comparable]; 344 DateTime[dart.implements] = () => [Comparable];
345 dart.implementExtension(DateTime, () => [Comparable]);
371 dart.defineNamedConstructor(DateTime, 'utc'); 346 dart.defineNamedConstructor(DateTime, 'utc');
372 dart.defineNamedConstructor(DateTime, 'now'); 347 dart.defineNamedConstructor(DateTime, 'now');
373 dart.defineNamedConstructor(DateTime, 'fromMillisecondsSinceEpoch'); 348 dart.defineNamedConstructor(DateTime, 'fromMillisecondsSinceEpoch');
374 dart.defineNamedConstructor(DateTime, '_internal'); 349 dart.defineNamedConstructor(DateTime, '_internal');
375 dart.defineNamedConstructor(DateTime, '_now'); 350 dart.defineNamedConstructor(DateTime, '_now');
376 dart.setSignature(DateTime, { 351 dart.setSignature(DateTime, {
377 constructors: () => ({ 352 constructors: () => ({
378 DateTime: [DateTime, [int], [int, int, int, int, int, int]], 353 DateTime: [DateTime, [int], [int, int, int, int, int, int]],
379 utc: [DateTime, [int], [int, int, int, int, int, int]], 354 utc: [DateTime, [int], [int, int, int, int, int, int]],
380 now: [DateTime, []], 355 now: [DateTime, []],
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 DateTime.SEPTEMBER = 9; 398 DateTime.SEPTEMBER = 9;
424 DateTime.OCTOBER = 10; 399 DateTime.OCTOBER = 10;
425 DateTime.NOVEMBER = 11; 400 DateTime.NOVEMBER = 11;
426 DateTime.DECEMBER = 12; 401 DateTime.DECEMBER = 12;
427 DateTime.MONTHS_PER_YEAR = 12; 402 DateTime.MONTHS_PER_YEAR = 12;
428 DateTime._MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000; 403 DateTime._MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000;
429 class num extends Object { 404 class num extends Object {
430 static parse(input, onError) { 405 static parse(input, onError) {
431 if (onError === void 0) 406 if (onError === void 0)
432 onError = null; 407 onError = null;
433 let source = input.trim(); 408 let source = input[dartx.trim]();
434 num._parseError = false; 409 num._parseError = false;
435 let result = int.parse(source, {onError: num._onParseErrorInt}); 410 let result = int.parse(source, {onError: num._onParseErrorInt});
436 if (!dart.notNull(num._parseError)) 411 if (!dart.notNull(num._parseError))
437 return result; 412 return result;
438 num._parseError = false; 413 num._parseError = false;
439 result = double.parse(source, num._onParseErrorDouble); 414 result = double.parse(source, num._onParseErrorDouble);
440 if (!dart.notNull(num._parseError)) 415 if (!dart.notNull(num._parseError))
441 return result; 416 return result;
442 if (onError == null) 417 if (onError == null)
443 throw new FormatException(input); 418 throw new FormatException(input);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 _microseconds(duration) { 466 _microseconds(duration) {
492 this[_duration] = duration; 467 this[_duration] = duration;
493 } 468 }
494 ['+'](other) { 469 ['+'](other) {
495 return new Duration._microseconds(dart.notNull(this[_duration]) + dart.not Null(other[_duration])); 470 return new Duration._microseconds(dart.notNull(this[_duration]) + dart.not Null(other[_duration]));
496 } 471 }
497 ['-'](other) { 472 ['-'](other) {
498 return new Duration._microseconds(dart.notNull(this[_duration]) - dart.not Null(other[_duration])); 473 return new Duration._microseconds(dart.notNull(this[_duration]) - dart.not Null(other[_duration]));
499 } 474 }
500 ['*'](factor) { 475 ['*'](factor) {
501 return new Duration._microseconds((dart.notNull(this[_duration]) * dart.no tNull(factor)).round()); 476 return new Duration._microseconds((dart.notNull(this[_duration]) * dart.no tNull(factor))[dartx.round]());
502 } 477 }
503 ['~/'](quotient) { 478 ['~/'](quotient) {
504 if (quotient == 0) 479 if (quotient == 0)
505 throw new IntegerDivisionByZeroException(); 480 throw new IntegerDivisionByZeroException();
506 return new Duration._microseconds((dart.notNull(this[_duration]) / dart.no tNull(quotient)).truncate()); 481 return new Duration._microseconds((dart.notNull(this[_duration]) / dart.no tNull(quotient)).truncate());
507 } 482 }
508 ['<'](other) { 483 ['<'](other) {
509 return dart.notNull(this[_duration]) < dart.notNull(other[_duration]); 484 return dart.notNull(this[_duration]) < dart.notNull(other[_duration]);
510 } 485 }
511 ['>'](other) { 486 ['>'](other) {
(...skipping 22 matching lines...) Expand all
534 } 509 }
535 get inMicroseconds() { 510 get inMicroseconds() {
536 return this[_duration]; 511 return this[_duration];
537 } 512 }
538 ['=='](other) { 513 ['=='](other) {
539 if (!dart.is(other, Duration)) 514 if (!dart.is(other, Duration))
540 return false; 515 return false;
541 return dart.equals(this[_duration], dart.dload(other, _duration)); 516 return dart.equals(this[_duration], dart.dload(other, _duration));
542 } 517 }
543 get hashCode() { 518 get hashCode() {
544 return dart.hashCode(this[_duration]); 519 return dart[dartx.hashCode](this[_duration]);
545 } 520 }
546 compareTo(other) { 521 compareTo(other) {
547 return this[_duration].compareTo(other[_duration]); 522 return this[_duration][dartx.compareTo](other[_duration]);
548 } 523 }
549 toString() { 524 toString() {
550 let sixDigits = n => { 525 let sixDigits = n => {
551 if (dart.notNull(n) >= 100000) 526 if (dart.notNull(n) >= 100000)
552 return `${n}`; 527 return `${n}`;
553 if (dart.notNull(n) >= 10000) 528 if (dart.notNull(n) >= 10000)
554 return `0${n}`; 529 return `0${n}`;
555 if (dart.notNull(n) >= 1000) 530 if (dart.notNull(n) >= 1000)
556 return `00${n}`; 531 return `00${n}`;
557 if (dart.notNull(n) >= 100) 532 if (dart.notNull(n) >= 100)
558 return `000${n}`; 533 return `000${n}`;
559 if (dart.notNull(n) >= 10) 534 if (dart.notNull(n) >= 10)
560 return `0000${n}`; 535 return `0000${n}`;
561 return `00000${n}`; 536 return `00000${n}`;
562 }; 537 };
563 dart.fn(sixDigits, String, [int]); 538 dart.fn(sixDigits, String, [int]);
564 let twoDigits = n => { 539 let twoDigits = n => {
565 if (dart.notNull(n) >= 10) 540 if (dart.notNull(n) >= 10)
566 return `${n}`; 541 return `${n}`;
567 return `0${n}`; 542 return `0${n}`;
568 }; 543 };
569 dart.fn(twoDigits, String, [int]); 544 dart.fn(twoDigits, String, [int]);
570 if (dart.notNull(this.inMicroseconds) < 0) { 545 if (dart.notNull(this.inMicroseconds) < 0) {
571 return `-${this['unary-']()}`; 546 return `-${this['unary-']()}`;
572 } 547 }
573 let twoDigitMinutes = twoDigits(this.inMinutes.remainder(Duration.MINUTES_ PER_HOUR)); 548 let twoDigitMinutes = twoDigits(this.inMinutes[dartx.remainder](Duration.M INUTES_PER_HOUR));
574 let twoDigitSeconds = twoDigits(this.inSeconds.remainder(Duration.SECONDS_ PER_MINUTE)); 549 let twoDigitSeconds = twoDigits(this.inSeconds[dartx.remainder](Duration.S ECONDS_PER_MINUTE));
575 let sixDigitUs = sixDigits(this.inMicroseconds.remainder(Duration.MICROSEC ONDS_PER_SECOND)); 550 let sixDigitUs = sixDigits(this.inMicroseconds[dartx.remainder](Duration.M ICROSECONDS_PER_SECOND));
576 return `${this.inHours}:${twoDigitMinutes}:${twoDigitSeconds}.${sixDigitUs }`; 551 return `${this.inHours}:${twoDigitMinutes}:${twoDigitSeconds}.${sixDigitUs }`;
577 } 552 }
578 get isNegative() { 553 get isNegative() {
579 return dart.notNull(this[_duration]) < 0; 554 return dart.notNull(this[_duration]) < 0;
580 } 555 }
581 abs() { 556 abs() {
582 return new Duration._microseconds(this[_duration].abs()); 557 return new Duration._microseconds(this[_duration][dartx.abs]());
583 } 558 }
584 ['unary-']() { 559 ['unary-']() {
585 return new Duration._microseconds(-dart.notNull(this[_duration])); 560 return new Duration._microseconds(-dart.notNull(this[_duration]));
586 } 561 }
587 } 562 }
588 Duration[dart.implements] = () => [Comparable$(Duration)]; 563 Duration[dart.implements] = () => [Comparable$(Duration)];
564 dart.implementExtension(Duration, () => [Comparable]);
589 dart.defineNamedConstructor(Duration, '_microseconds'); 565 dart.defineNamedConstructor(Duration, '_microseconds');
590 dart.setSignature(Duration, { 566 dart.setSignature(Duration, {
591 constructors: () => ({ 567 constructors: () => ({
592 Duration: [Duration, [], {days: int, hours: int, minutes: int, seconds: in t, milliseconds: int, microseconds: int}], 568 Duration: [Duration, [], {days: int, hours: int, minutes: int, seconds: in t, milliseconds: int, microseconds: int}],
593 _microseconds: [Duration, [int]] 569 _microseconds: [Duration, [int]]
594 }), 570 }),
595 methods: () => ({ 571 methods: () => ({
596 '+': [Duration, [Duration]], 572 '+': [Duration, [Duration]],
597 '-': [Duration, [Duration]], 573 '-': [Duration, [Duration]],
598 '*': [Duration, [num]], 574 '*': [Duration, [num]],
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 } 865 }
890 } 866 }
891 dart.setSignature(AbstractClassInstantiationError, { 867 dart.setSignature(AbstractClassInstantiationError, {
892 constructors: () => ({AbstractClassInstantiationError: [AbstractClassInstant iationError, [String]]}) 868 constructors: () => ({AbstractClassInstantiationError: [AbstractClassInstant iationError, [String]]})
893 }); 869 });
894 let _receiver = dart.JsSymbol('_receiver'); 870 let _receiver = dart.JsSymbol('_receiver');
895 let _memberName = dart.JsSymbol('_memberName'); 871 let _memberName = dart.JsSymbol('_memberName');
896 let _arguments = dart.JsSymbol('_arguments'); 872 let _arguments = dart.JsSymbol('_arguments');
897 let _namedArguments = dart.JsSymbol('_namedArguments'); 873 let _namedArguments = dart.JsSymbol('_namedArguments');
898 let _existingArgumentNames = dart.JsSymbol('_existingArgumentNames'); 874 let _existingArgumentNames = dart.JsSymbol('_existingArgumentNames');
899 let $length = dart.JsSymbol('$length');
900 let $get = dart.JsSymbol('$get');
901 class NoSuchMethodError extends Error { 875 class NoSuchMethodError extends Error {
902 NoSuchMethodError(receiver, memberName, positionalArguments, namedArguments, existingArgumentNames) { 876 NoSuchMethodError(receiver, memberName, positionalArguments, namedArguments, existingArgumentNames) {
903 if (existingArgumentNames === void 0) 877 if (existingArgumentNames === void 0)
904 existingArgumentNames = null; 878 existingArgumentNames = null;
905 this[_receiver] = receiver; 879 this[_receiver] = receiver;
906 this[_memberName] = memberName; 880 this[_memberName] = memberName;
907 this[_arguments] = positionalArguments; 881 this[_arguments] = positionalArguments;
908 this[_namedArguments] = namedArguments; 882 this[_namedArguments] = namedArguments;
909 this[_existingArgumentNames] = existingArgumentNames; 883 this[_existingArgumentNames] = existingArgumentNames;
910 super.Error(); 884 super.Error();
911 } 885 }
912 toString() { 886 toString() {
913 let sb = new StringBuffer(); 887 let sb = new StringBuffer();
914 let i = 0; 888 let i = 0;
915 if (this[_arguments] != null) { 889 if (this[_arguments] != null) {
916 for (; dart.notNull(i) < dart.notNull(this[_arguments][$length]); i = da rt.notNull(i) + 1) { 890 for (; dart.notNull(i) < dart.notNull(this[_arguments].length); i = dart .notNull(i) + 1) {
917 if (dart.notNull(i) > 0) { 891 if (dart.notNull(i) > 0) {
918 sb.write(", "); 892 sb.write(", ");
919 } 893 }
920 sb.write(Error.safeToString(this[_arguments][$get](i))); 894 sb.write(Error.safeToString(this[_arguments][dartx.get](i)));
921 } 895 }
922 } 896 }
923 if (this[_namedArguments] != null) { 897 if (this[_namedArguments] != null) {
924 this[_namedArguments].forEach(dart.fn((key, value) => { 898 this[_namedArguments].forEach(dart.fn((key, value) => {
925 if (dart.notNull(i) > 0) { 899 if (dart.notNull(i) > 0) {
926 sb.write(", "); 900 sb.write(", ");
927 } 901 }
928 sb.write(_symbolToString(key)); 902 sb.write(_symbolToString(key));
929 sb.write(": "); 903 sb.write(": ");
930 sb.write(Error.safeToString(value)); 904 sb.write(Error.safeToString(value));
931 i = dart.notNull(i) + 1; 905 i = dart.notNull(i) + 1;
932 }, Object, [Symbol, Object])); 906 }, Object, [Symbol, Object]));
933 } 907 }
934 if (this[_existingArgumentNames] == null) { 908 if (this[_existingArgumentNames] == null) {
935 return `NoSuchMethodError : method not found: '${this[_memberName]}'\n` + `Receiver: ${Error.safeToString(this[_receiver])}\n` + `Arguments: [${sb}]`; 909 return `NoSuchMethodError : method not found: '${this[_memberName]}'\n` + `Receiver: ${Error.safeToString(this[_receiver])}\n` + `Arguments: [${sb}]`;
936 } else { 910 } else {
937 let actualParameters = dart.toString(sb); 911 let actualParameters = dart.toString(sb);
938 sb = new StringBuffer(); 912 sb = new StringBuffer();
939 for (let i = 0; dart.notNull(i) < dart.notNull(this[_existingArgumentNam es][$length]); i = dart.notNull(i) + 1) { 913 for (let i = 0; dart.notNull(i) < dart.notNull(this[_existingArgumentNam es].length); i = dart.notNull(i) + 1) {
940 if (dart.notNull(i) > 0) { 914 if (dart.notNull(i) > 0) {
941 sb.write(", "); 915 sb.write(", ");
942 } 916 }
943 sb.write(this[_existingArgumentNames][$get](i)); 917 sb.write(this[_existingArgumentNames][dartx.get](i));
944 } 918 }
945 let formalParameters = dart.toString(sb); 919 let formalParameters = dart.toString(sb);
946 return "NoSuchMethodError: incorrect number of arguments passed to " + ` method named '${this[_memberName]}'\n` + `Receiver: ${Error.safeToString(this[_r eceiver])}\n` + `Tried calling: ${this[_memberName]}(${actualParameters})\n` + ` Found: ${this[_memberName]}(${formalParameters})`; 920 return "NoSuchMethodError: incorrect number of arguments passed to " + ` method named '${this[_memberName]}'\n` + `Receiver: ${Error.safeToString(this[_r eceiver])}\n` + `Tried calling: ${this[_memberName]}(${actualParameters})\n` + ` Found: ${this[_memberName]}(${formalParameters})`;
947 } 921 }
948 } 922 }
949 } 923 }
950 dart.setSignature(NoSuchMethodError, { 924 dart.setSignature(NoSuchMethodError, {
951 constructors: () => ({NoSuchMethodError: [NoSuchMethodError, [Object, Symbol , List, Map$(Symbol, Object)], [List]]}) 925 constructors: () => ({NoSuchMethodError: [NoSuchMethodError, [Object, Symbol , List, Map$(Symbol, Object)], [List]]})
952 }); 926 });
953 class UnsupportedError extends Error { 927 class UnsupportedError extends Error {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 report = dart.notNull(report) + ` (at offset ${offset})`; 1071 report = dart.notNull(report) + ` (at offset ${offset})`;
1098 } 1072 }
1099 return report; 1073 return report;
1100 } 1074 }
1101 if (offset != -1 && (dart.notNull(offset) < 0 || dart.notNull(offset) > da rt.notNull(dart.as(dart.dload(this.source, 'length'), num)))) { 1075 if (offset != -1 && (dart.notNull(offset) < 0 || dart.notNull(offset) > da rt.notNull(dart.as(dart.dload(this.source, 'length'), num)))) {
1102 offset = -1; 1076 offset = -1;
1103 } 1077 }
1104 if (offset == -1) { 1078 if (offset == -1) {
1105 let source = dart.as(this.source, String); 1079 let source = dart.as(this.source, String);
1106 if (dart.notNull(source.length) > 78) { 1080 if (dart.notNull(source.length) > 78) {
1107 source = dart.notNull(source.substring(0, 75)) + "..."; 1081 source = dart.notNull(source[dartx.substring](0, 75)) + "...";
1108 } 1082 }
1109 return `${report}\n${source}`; 1083 return `${report}\n${source}`;
1110 } 1084 }
1111 let lineNum = 1; 1085 let lineNum = 1;
1112 let lineStart = 0; 1086 let lineStart = 0;
1113 let lastWasCR = null; 1087 let lastWasCR = null;
1114 for (let i = 0; dart.notNull(i) < dart.notNull(offset); i = dart.notNull(i ) + 1) { 1088 for (let i = 0; dart.notNull(i) < dart.notNull(offset); i = dart.notNull(i ) + 1) {
1115 let char = dart.as(dart.dsend(this.source, 'codeUnitAt', i), int); 1089 let char = dart.as(dart.dsend(this.source, 'codeUnitAt', i), int);
1116 if (char == 10) { 1090 if (char == 10) {
1117 if (lineStart != i || !dart.notNull(lastWasCR)) { 1091 if (lineStart != i || !dart.notNull(lastWasCR)) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 start = dart.notNull(end) - 75; 1126 start = dart.notNull(end) - 75;
1153 prefix = "..."; 1127 prefix = "...";
1154 } else { 1128 } else {
1155 start = dart.notNull(offset) - 36; 1129 start = dart.notNull(offset) - 36;
1156 end = dart.notNull(offset) + 36; 1130 end = dart.notNull(offset) + 36;
1157 prefix = postfix = "..."; 1131 prefix = postfix = "...";
1158 } 1132 }
1159 } 1133 }
1160 let slice = dart.as(dart.dsend(this.source, 'substring', start, end), Stri ng); 1134 let slice = dart.as(dart.dsend(this.source, 'substring', start, end), Stri ng);
1161 let markOffset = dart.notNull(offset) - dart.notNull(start) + dart.notNull (prefix.length); 1135 let markOffset = dart.notNull(offset) - dart.notNull(start) + dart.notNull (prefix.length);
1162 return `${report}${prefix}${slice}${postfix}\n${" "['*'](markOffset)}^\n`; 1136 return `${report}${prefix}${slice}${postfix}\n${" "[dartx['*']](markOffset )}^\n`;
1163 } 1137 }
1164 } 1138 }
1165 FormatException[dart.implements] = () => [Exception]; 1139 FormatException[dart.implements] = () => [Exception];
1166 dart.setSignature(FormatException, { 1140 dart.setSignature(FormatException, {
1167 constructors: () => ({FormatException: [FormatException, [], [String, Object , int]]}) 1141 constructors: () => ({FormatException: [FormatException, [], [String, Object , int]]})
1168 }); 1142 });
1169 class IntegerDivisionByZeroException extends Object { 1143 class IntegerDivisionByZeroException extends Object {
1170 IntegerDivisionByZeroException() { 1144 IntegerDivisionByZeroException() {
1171 } 1145 }
1172 toString() { 1146 toString() {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 dart.setSignature(int, { 1245 dart.setSignature(int, {
1272 constructors: () => ({fromEnvironment: [int, [String], {defaultValue: int}]} ), 1246 constructors: () => ({fromEnvironment: [int, [String], {defaultValue: int}]} ),
1273 statics: () => ({parse: [int, [String], {radix: int, onError: dart.functionT ype(int, [String])}]}), 1247 statics: () => ({parse: [int, [String], {radix: int, onError: dart.functionT ype(int, [String])}]}),
1274 names: ['parse'] 1248 names: ['parse']
1275 }); 1249 });
1276 class Invocation extends Object { 1250 class Invocation extends Object {
1277 get isAccessor() { 1251 get isAccessor() {
1278 return dart.notNull(this.isGetter) || dart.notNull(this.isSetter); 1252 return dart.notNull(this.isGetter) || dart.notNull(this.isSetter);
1279 } 1253 }
1280 } 1254 }
1281 let $iterator = dart.JsSymbol('$iterator');
1282 let $join = dart.JsSymbol('$join');
1283 let Iterable$ = dart.generic(function(E) { 1255 let Iterable$ = dart.generic(function(E) {
1284 class Iterable extends Object { 1256 class Iterable extends Object {
1285 Iterable() { 1257 Iterable() {
1286 } 1258 }
1287 static generate(count, generator) { 1259 static generate(count, generator) {
1288 if (generator === void 0) 1260 if (generator === void 0)
1289 generator = null; 1261 generator = null;
1290 if (dart.notNull(count) <= 0) 1262 if (dart.notNull(count) <= 0)
1291 return new (_internal.EmptyIterable$(E))(); 1263 return new (_internal.EmptyIterable$(E))();
1292 return new (exports._GeneratorIterable$(E))(count, generator); 1264 return new (exports._GeneratorIterable$(E))(count, generator);
1293 } 1265 }
1294 [dart.JsSymbol.iterator]() { 1266 [dart.JsSymbol.iterator]() {
1295 return new dart.JsIterator(this[$iterator]); 1267 return new dart.JsIterator(this[dartx.iterator]);
1296 } 1268 }
1297 [$join](separator) { 1269 join(separator) {
1298 if (separator === void 0) 1270 if (separator === void 0)
1299 separator = ""; 1271 separator = "";
1300 let buffer = new StringBuffer(); 1272 let buffer = new StringBuffer();
1301 buffer.writeAll(this, separator); 1273 buffer.writeAll(this, separator);
1302 return dart.toString(buffer); 1274 return dart.toString(buffer);
1303 } 1275 }
1304 } 1276 }
1305 dart.setSignature(Iterable, { 1277 dart.setSignature(Iterable, {
1306 constructors: () => ({ 1278 constructors: () => ({
1307 Iterable: [Iterable$(E), []], 1279 Iterable: [Iterable$(E), []],
1308 generate: [Iterable$(E), [int], [dart.functionType(E, [int])]] 1280 generate: [Iterable$(E), [int], [dart.functionType(E, [int])]]
1309 }), 1281 }),
1310 methods: () => ({[$join]: [String, [], [String]]}) 1282 methods: () => ({join: [String, [], [String]]})
1311 }); 1283 });
1312 return Iterable; 1284 return Iterable;
1313 }); 1285 });
1314 let Iterable = Iterable$(); 1286 let Iterable = Iterable$();
1315 let _Generator$ = dart.generic(function(E) { 1287 let _Generator$ = dart.generic(function(E) {
1316 let _Generator = dart.typedef('_Generator', () => dart.functionType(E, [int] )); 1288 let _Generator = dart.typedef('_Generator', () => dart.functionType(E, [int] ));
1317 return _Generator; 1289 return _Generator;
1318 }); 1290 });
1319 let _Generator = _Generator$(); 1291 let _Generator = _Generator$();
1320 let _end = dart.JsSymbol('_end'); 1292 let _end = dart.JsSymbol('_end');
1321 let _start = dart.JsSymbol('_start'); 1293 let _start = dart.JsSymbol('_start');
1322 let _generator = dart.JsSymbol('_generator'); 1294 let _generator = dart.JsSymbol('_generator');
1323 let $skip = dart.JsSymbol('$skip');
1324 let $take = dart.JsSymbol('$take');
1325 let _GeneratorIterable$ = dart.generic(function(E) { 1295 let _GeneratorIterable$ = dart.generic(function(E) {
1326 class _GeneratorIterable extends collection.IterableBase$(E) { 1296 class _GeneratorIterable extends collection.IterableBase$(E) {
1327 _GeneratorIterable(end, generator) { 1297 _GeneratorIterable(end, generator) {
1328 this[_end] = end; 1298 this[_end] = end;
1329 this[_start] = 0; 1299 this[_start] = 0;
1330 this[_generator] = dart.as(generator != null ? generator : exports._Gene ratorIterable$()._id, _Generator$(E)); 1300 this[_generator] = dart.as(generator != null ? generator : exports._Gene ratorIterable$()._id, _Generator$(E));
1331 super.IterableBase(); 1301 super.IterableBase();
1332 } 1302 }
1333 slice(start, end, generator) { 1303 slice(start, end, generator) {
1334 this[_start] = start; 1304 this[_start] = start;
1335 this[_end] = end; 1305 this[_end] = end;
1336 this[_generator] = generator; 1306 this[_generator] = generator;
1337 super.IterableBase(); 1307 super.IterableBase();
1338 } 1308 }
1339 get [$iterator]() { 1309 get iterator() {
1340 return new (_GeneratorIterator$(E))(this[_start], this[_end], this[_gene rator]); 1310 return new (_GeneratorIterator$(E))(this[_start], this[_end], this[_gene rator]);
1341 } 1311 }
1342 get [$length]() { 1312 get length() {
1343 return dart.notNull(this[_end]) - dart.notNull(this[_start]); 1313 return dart.notNull(this[_end]) - dart.notNull(this[_start]);
1344 } 1314 }
1345 [$skip](count) { 1315 skip(count) {
1346 RangeError.checkNotNegative(count, "count"); 1316 RangeError.checkNotNegative(count, "count");
1347 if (count == 0) 1317 if (count == 0)
1348 return this; 1318 return this;
1349 let newStart = dart.notNull(this[_start]) + dart.notNull(count); 1319 let newStart = dart.notNull(this[_start]) + dart.notNull(count);
1350 if (dart.notNull(newStart) >= dart.notNull(this[_end])) 1320 if (dart.notNull(newStart) >= dart.notNull(this[_end]))
1351 return new (_internal.EmptyIterable$(E))(); 1321 return new (_internal.EmptyIterable$(E))();
1352 return new (exports._GeneratorIterable$(E)).slice(newStart, this[_end], this[_generator]); 1322 return new (exports._GeneratorIterable$(E)).slice(newStart, this[_end], this[_generator]);
1353 } 1323 }
1354 [$take](count) { 1324 take(count) {
1355 RangeError.checkNotNegative(count, "count"); 1325 RangeError.checkNotNegative(count, "count");
1356 if (count == 0) 1326 if (count == 0)
1357 return new (_internal.EmptyIterable$(E))(); 1327 return new (_internal.EmptyIterable$(E))();
1358 let newEnd = dart.notNull(this[_start]) + dart.notNull(count); 1328 let newEnd = dart.notNull(this[_start]) + dart.notNull(count);
1359 if (dart.notNull(newEnd) >= dart.notNull(this[_end])) 1329 if (dart.notNull(newEnd) >= dart.notNull(this[_end]))
1360 return this; 1330 return this;
1361 return new (exports._GeneratorIterable$(E)).slice(this[_start], newEnd, this[_generator]); 1331 return new (exports._GeneratorIterable$(E)).slice(this[_start], newEnd, this[_generator]);
1362 } 1332 }
1363 static _id(n) { 1333 static _id(n) {
1364 return n; 1334 return n;
1365 } 1335 }
1366 } 1336 }
1367 _GeneratorIterable[dart.implements] = () => [_internal.EfficientLength]; 1337 _GeneratorIterable[dart.implements] = () => [_internal.EfficientLength];
1338 dart.implementExtension(_GeneratorIterable, () => [Iterable]);
1368 dart.defineNamedConstructor(_GeneratorIterable, 'slice'); 1339 dart.defineNamedConstructor(_GeneratorIterable, 'slice');
1369 dart.setSignature(_GeneratorIterable, { 1340 dart.setSignature(_GeneratorIterable, {
1370 constructors: () => ({ 1341 constructors: () => ({
1371 _GeneratorIterable: [exports._GeneratorIterable$(E), [int, dart.function Type(E, [int])]], 1342 _GeneratorIterable: [exports._GeneratorIterable$(E), [int, dart.function Type(E, [int])]],
1372 slice: [exports._GeneratorIterable$(E), [int, int, _Generator$(E)]] 1343 slice: [exports._GeneratorIterable$(E), [int, int, _Generator$(E)]]
1373 }), 1344 }),
1374 methods: () => ({ 1345 methods: () => ({
1375 [$skip]: [Iterable$(E), [int]], 1346 skip: [Iterable$(E), [int]],
1376 [$take]: [Iterable$(E), [int]] 1347 take: [Iterable$(E), [int]]
1377 }), 1348 }),
1378 statics: () => ({_id: [int, [int]]}), 1349 statics: () => ({_id: [int, [int]]}),
1379 names: ['_id'] 1350 names: ['_id']
1380 }); 1351 });
1381 return _GeneratorIterable; 1352 return _GeneratorIterable;
1382 }); 1353 });
1383 dart.defineLazyClassGeneric(exports, '_GeneratorIterable', {get: _GeneratorIte rable$}); 1354 dart.defineLazyClassGeneric(exports, '_GeneratorIterable', {get: _GeneratorIte rable$});
1384 let _index = dart.JsSymbol('_index'); 1355 let _index = dart.JsSymbol('_index');
1385 let _current = dart.JsSymbol('_current'); 1356 let _current = dart.JsSymbol('_current');
1386 let _GeneratorIterator$ = dart.generic(function(E) { 1357 let _GeneratorIterator$ = dart.generic(function(E) {
(...skipping 30 matching lines...) Expand all
1417 class BidirectionalIterator extends Object {} 1388 class BidirectionalIterator extends Object {}
1418 BidirectionalIterator[dart.implements] = () => [Iterator$(E)]; 1389 BidirectionalIterator[dart.implements] = () => [Iterator$(E)];
1419 return BidirectionalIterator; 1390 return BidirectionalIterator;
1420 }); 1391 });
1421 let BidirectionalIterator = BidirectionalIterator$(); 1392 let BidirectionalIterator = BidirectionalIterator$();
1422 let Iterator$ = dart.generic(function(E) { 1393 let Iterator$ = dart.generic(function(E) {
1423 class Iterator extends Object {} 1394 class Iterator extends Object {}
1424 return Iterator; 1395 return Iterator;
1425 }); 1396 });
1426 let Iterator = Iterator$(); 1397 let Iterator = Iterator$();
1427 let $set = dart.JsSymbol('$set');
1428 let $add = dart.JsSymbol('$add');
1429 let $checkMutable = dart.JsSymbol('$checkMutable');
1430 let $checkGrowable = dart.JsSymbol('$checkGrowable');
1431 let $where = dart.JsSymbol('$where');
1432 let $expand = dart.JsSymbol('$expand');
1433 let $forEach = dart.JsSymbol('$forEach');
1434 let $map = dart.JsSymbol('$map');
1435 let $takeWhile = dart.JsSymbol('$takeWhile');
1436 let $skipWhile = dart.JsSymbol('$skipWhile');
1437 let $reduce = dart.JsSymbol('$reduce');
1438 let $fold = dart.JsSymbol('$fold');
1439 let $firstWhere = dart.JsSymbol('$firstWhere');
1440 let $lastWhere = dart.JsSymbol('$lastWhere');
1441 let $singleWhere = dart.JsSymbol('$singleWhere');
1442 let $elementAt = dart.JsSymbol('$elementAt');
1443 let $first = dart.JsSymbol('$first');
1444 let $last = dart.JsSymbol('$last');
1445 let $single = dart.JsSymbol('$single');
1446 let $any = dart.JsSymbol('$any');
1447 let $every = dart.JsSymbol('$every');
1448 let $contains = dart.JsSymbol('$contains');
1449 let $isEmpty = dart.JsSymbol('$isEmpty');
1450 let $isNotEmpty = dart.JsSymbol('$isNotEmpty');
1451 let $toString = dart.JsSymbol('$toString');
1452 let $toList = dart.JsSymbol('$toList');
1453 let $toSet = dart.JsSymbol('$toSet');
1454 let $hashCode = dart.JsSymbol('$hashCode');
1455 let $addAll = dart.JsSymbol('$addAll');
1456 let $reversed = dart.JsSymbol('$reversed');
1457 let $sort = dart.JsSymbol('$sort');
1458 let $shuffle = dart.JsSymbol('$shuffle');
1459 let $indexOf = dart.JsSymbol('$indexOf');
1460 let $lastIndexOf = dart.JsSymbol('$lastIndexOf');
1461 let $clear = dart.JsSymbol('$clear');
1462 let $insert = dart.JsSymbol('$insert');
1463 let $insertAll = dart.JsSymbol('$insertAll');
1464 let $setAll = dart.JsSymbol('$setAll');
1465 let $remove = dart.JsSymbol('$remove');
1466 let $removeAt = dart.JsSymbol('$removeAt');
1467 let $removeLast = dart.JsSymbol('$removeLast');
1468 let $removeWhere = dart.JsSymbol('$removeWhere');
1469 let $retainWhere = dart.JsSymbol('$retainWhere');
1470 let $sublist = dart.JsSymbol('$sublist');
1471 let $getRange = dart.JsSymbol('$getRange');
1472 let $setRange = dart.JsSymbol('$setRange');
1473 let $removeRange = dart.JsSymbol('$removeRange');
1474 let $fillRange = dart.JsSymbol('$fillRange');
1475 let $replaceRange = dart.JsSymbol('$replaceRange');
1476 let $asMap = dart.JsSymbol('$asMap');
1477 let List$ = dart.generic(function(E) { 1398 let List$ = dart.generic(function(E) {
1478 class List extends Object { 1399 class List extends Object {
1479 static new(length) { 1400 static new(length) {
1480 if (length === void 0) 1401 if (length === void 0)
1481 length = null; 1402 length = null;
1482 let list = null; 1403 let list = null;
1483 if (length == null) { 1404 if (length == null) {
1484 list = []; 1405 list = [];
1485 } else { 1406 } else {
1486 if (!(typeof length == 'number') || dart.notNull(length) < 0) { 1407 if (!(typeof length == 'number') || dart.notNull(length) < 0) {
1487 throw new ArgumentError(`Length must be a non-negative integer: ${le ngth}`); 1408 throw new ArgumentError(`Length must be a non-negative integer: ${le ngth}`);
1488 } 1409 }
1489 list = new Array(length); 1410 list = _interceptors.JSArray.markFixedList(dart.as(new Array(length), List$()));
1490 list.fixed$length = Array;
1491 } 1411 }
1492 dart.setType(list, List$(E)); 1412 return _interceptors.JSArray$(E).typed(list);
1493 return dart.as(list, List$(E));
1494 } 1413 }
1495 static filled(length, fill) { 1414 static filled(length, fill) {
1496 let result = List$(E).new(length); 1415 let result = List$(E).new(length);
1497 if (length != 0 && dart.notNull(fill != null)) { 1416 if (length != 0 && dart.notNull(fill != null)) {
1498 for (let i = 0; dart.notNull(i) < dart.notNull(result[$length]); i = d art.notNull(i) + 1) { 1417 for (let i = 0; dart.notNull(i) < dart.notNull(result.length); i = dar t.notNull(i) + 1) {
1499 result[$set](i, fill); 1418 result[dartx.set](i, fill);
1500 } 1419 }
1501 } 1420 }
1502 return result; 1421 return result;
1503 } 1422 }
1504 static from(elements, opts) { 1423 static from(elements, opts) {
1505 let growable = opts && 'growable' in opts ? opts.growable : true; 1424 let growable = opts && 'growable' in opts ? opts.growable : true;
1506 let list = List$(E).new(); 1425 let list = List$(E).new();
1507 for (let e of elements) { 1426 for (let e of elements) {
1508 list[$add](dart.as(e, E)); 1427 list[dartx.add](dart.as(e, E));
1509 } 1428 }
1510 if (growable) 1429 if (growable)
1511 return list; 1430 return list;
1512 return dart.as(_internal.makeListFixedLength(list), List$(E)); 1431 return dart.as(_internal.makeListFixedLength(list), List$(E));
1513 } 1432 }
1514 static generate(length, generator, opts) { 1433 static generate(length, generator, opts) {
1515 let growable = opts && 'growable' in opts ? opts.growable : true; 1434 let growable = opts && 'growable' in opts ? opts.growable : true;
1516 let result = null; 1435 let result = null;
1517 if (growable) { 1436 if (growable) {
1518 result = dart.setType([], List$(E)); 1437 result = dart.list([], E);
1519 result[$length] = length; 1438 result.length = length;
1520 } else { 1439 } else {
1521 result = List$(E).new(length); 1440 result = List$(E).new(length);
1522 } 1441 }
1523 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1442 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1524 result[$set](i, generator(i)); 1443 result[dartx.set](i, generator(i));
1525 } 1444 }
1526 return result; 1445 return result;
1527 } 1446 }
1528 [$checkMutable](reason) {} 1447 [dart.JsSymbol.iterator]() {
1529 [$checkGrowable](reason) {} 1448 return new dart.JsIterator(this[dartx.iterator]);
1530 [$where](f) {
1531 dart.as(f, dart.functionType(bool, [E]));
1532 return new (_internal.IterableMixinWorkaround$(E))().where(this, f);
1533 }
1534 [$expand](f) {
1535 dart.as(f, dart.functionType(Iterable, [E]));
1536 return _internal.IterableMixinWorkaround.expand(this, f);
1537 }
1538 [$forEach](f) {
1539 dart.as(f, dart.functionType(dart.void, [E]));
1540 let length = this[$length];
1541 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1542 f(dart.as(this[i], E));
1543 if (length != this[$length]) {
1544 throw new ConcurrentModificationError(this);
1545 }
1546 }
1547 }
1548 [$map](f) {
1549 dart.as(f, dart.functionType(Object, [E]));
1550 return _internal.IterableMixinWorkaround.mapList(this, f);
1551 }
1552 [$join](separator) {
1553 if (separator === void 0)
1554 separator = "";
1555 let list = List$().new(this[$length]);
1556 for (let i = 0; dart.notNull(i) < dart.notNull(this[$length]); i = dart. notNull(i) + 1) {
1557 list[$set](i, `${this[$get](i)}`);
1558 }
1559 return list.join(separator);
1560 }
1561 [$take](n) {
1562 return new (_internal.IterableMixinWorkaround$(E))().takeList(this, n);
1563 }
1564 [$takeWhile](test) {
1565 dart.as(test, dart.functionType(bool, [E]));
1566 return new (_internal.IterableMixinWorkaround$(E))().takeWhile(this, tes t);
1567 }
1568 [$skip](n) {
1569 return new (_internal.IterableMixinWorkaround$(E))().skipList(this, n);
1570 }
1571 [$skipWhile](test) {
1572 dart.as(test, dart.functionType(bool, [E]));
1573 return new (_internal.IterableMixinWorkaround$(E))().skipWhile(this, tes t);
1574 }
1575 [$reduce](combine) {
1576 dart.as(combine, dart.functionType(E, [E, E]));
1577 return dart.as(_internal.IterableMixinWorkaround.reduce(this, combine), E);
1578 }
1579 [$fold](initialValue, combine) {
1580 dart.as(combine, dart.functionType(Object, [dart.bottom, E]));
1581 return _internal.IterableMixinWorkaround.fold(this, initialValue, combin e);
1582 }
1583 [$firstWhere](test, opts) {
1584 dart.as(test, dart.functionType(bool, [E]));
1585 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
1586 dart.as(orElse, dart.functionType(E, []));
1587 return dart.as(_internal.IterableMixinWorkaround.firstWhere(this, test, orElse), E);
1588 }
1589 [$lastWhere](test, opts) {
1590 dart.as(test, dart.functionType(bool, [E]));
1591 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
1592 dart.as(orElse, dart.functionType(E, []));
1593 return dart.as(_internal.IterableMixinWorkaround.lastWhereList(this, tes t, orElse), E);
1594 }
1595 [$singleWhere](test) {
1596 dart.as(test, dart.functionType(bool, [E]));
1597 return dart.as(_internal.IterableMixinWorkaround.singleWhere(this, test) , E);
1598 }
1599 [$elementAt](index) {
1600 return this[$get](index);
1601 }
1602 get [$first]() {
1603 if (dart.notNull(this[$length]) > 0)
1604 return this[$get](0);
1605 throw new StateError("No elements");
1606 }
1607 get [$last]() {
1608 if (dart.notNull(this[$length]) > 0)
1609 return this[$get](dart.notNull(this[$length]) - 1);
1610 throw new StateError("No elements");
1611 }
1612 get [$single]() {
1613 if (this[$length] == 1)
1614 return this[$get](0);
1615 if (this[$length] == 0)
1616 throw new StateError("No elements");
1617 throw new StateError("More than one element");
1618 }
1619 [$any](f) {
1620 dart.as(f, dart.functionType(bool, [E]));
1621 return _internal.IterableMixinWorkaround.any(this, f);
1622 }
1623 [$every](f) {
1624 dart.as(f, dart.functionType(bool, [E]));
1625 return _internal.IterableMixinWorkaround.every(this, f);
1626 }
1627 [$contains](other) {
1628 for (let i = 0; dart.notNull(i) < dart.notNull(this[$length]); i = dart. notNull(i) + 1) {
1629 if (dart.equals(this[$get](i), other))
1630 return true;
1631 }
1632 return false;
1633 }
1634 get [$isEmpty]() {
1635 return this[$length] == 0;
1636 }
1637 get [$isNotEmpty]() {
1638 return !dart.notNull(this[$isEmpty]);
1639 }
1640 [$toString]() {
1641 return collection.ListBase.listToString(this);
1642 }
1643 [$toList](opts) {
1644 let growable = opts && 'growable' in opts ? opts.growable : true;
1645 return dart.as(dart.setType(this.slice(), core.List$(E)), List$(E));
1646 }
1647 [$toSet]() {
1648 return exports.Set$(E).from(this);
1649 }
1650 get [$iterator]() {
1651 return new (_internal.ListIterator$(E))(this);
1652 }
1653 get [$hashCode]() {
1654 return _js_helper.Primitives.objectHashCode(this);
1655 }
1656 [$get](index) {
1657 if (!(typeof index == 'number'))
1658 throw new ArgumentError(index);
1659 if (dart.notNull(index) >= dart.notNull(this[$length]) || dart.notNull(i ndex) < 0)
1660 throw new RangeError.value(index);
1661 return dart.as(this[index], E);
1662 }
1663 [$set](index, value) {
1664 dart.as(value, E);
1665 this[$checkMutable]('indexed set');
1666 if (!(typeof index == 'number'))
1667 throw new ArgumentError(index);
1668 if (dart.notNull(index) >= dart.notNull(this[$length]) || dart.notNull(i ndex) < 0)
1669 throw new RangeError.value(index);
1670 this[index] = value;
1671 }
1672 get [$length]() {
1673 return dart.as(this.length, int);
1674 }
1675 set [$length](newLength) {
1676 if (!(typeof newLength == 'number'))
1677 throw new ArgumentError(newLength);
1678 if (dart.notNull(newLength) < 0)
1679 throw new RangeError.value(newLength);
1680 this[$checkGrowable]('set length');
1681 this.length = newLength;
1682 }
1683 [$add](value) {
1684 dart.as(value, E);
1685 this[$checkGrowable]('add');
1686 this.push(value);
1687 }
1688 [$addAll](iterable) {
1689 dart.as(iterable, Iterable$(E));
1690 for (let e of iterable) {
1691 this[$add](e);
1692 }
1693 }
1694 get [$reversed]() {
1695 return new (_internal.IterableMixinWorkaround$(E))().reversedList(this);
1696 }
1697 [$sort](compare) {
1698 if (compare === void 0)
1699 compare = null;
1700 dart.as(compare, dart.functionType(int, [E, E]));
1701 this[$checkMutable]('sort');
1702 _internal.IterableMixinWorkaround.sortList(this, compare);
1703 }
1704 [$shuffle](random) {
1705 if (random === void 0)
1706 random = null;
1707 _internal.IterableMixinWorkaround.shuffleList(this, random);
1708 }
1709 [$indexOf](element, start) {
1710 dart.as(element, E);
1711 if (start === void 0)
1712 start = 0;
1713 return _internal.IterableMixinWorkaround.indexOfList(this, element, star t);
1714 }
1715 [$lastIndexOf](element, start) {
1716 dart.as(element, E);
1717 if (start === void 0)
1718 start = null;
1719 return _internal.IterableMixinWorkaround.lastIndexOfList(this, element, start);
1720 }
1721 [$clear]() {
1722 this[$length] = 0;
1723 }
1724 [$insert](index, element) {
1725 dart.as(element, E);
1726 if (!(typeof index == 'number'))
1727 throw new ArgumentError(index);
1728 if (dart.notNull(index) < 0 || dart.notNull(index) > dart.notNull(this[$ length])) {
1729 throw new RangeError.value(index);
1730 }
1731 this[$checkGrowable]('insert');
1732 this.splice(index, 0, element);
1733 }
1734 [$insertAll](index, iterable) {
1735 dart.as(iterable, Iterable$(E));
1736 this[$checkGrowable]('insertAll');
1737 _internal.IterableMixinWorkaround.insertAllList(this, index, iterable);
1738 }
1739 [$setAll](index, iterable) {
1740 dart.as(iterable, Iterable$(E));
1741 this[$checkMutable]('setAll');
1742 _internal.IterableMixinWorkaround.setAllList(this, index, iterable);
1743 }
1744 [$remove](element) {
1745 this[$checkGrowable]('remove');
1746 for (let i = 0; dart.notNull(i) < dart.notNull(this[$length]); i = dart. notNull(i) + 1) {
1747 if (dart.equals(this[$get](i), /* Unimplemented unknown name */value)) {
1748 this.splice(i, 1);
1749 return true;
1750 }
1751 }
1752 return false;
1753 }
1754 [$removeAt](index) {
1755 if (!(typeof index == 'number'))
1756 throw new ArgumentError(index);
1757 if (dart.notNull(index) < 0 || dart.notNull(index) >= dart.notNull(this[ $length])) {
1758 throw new RangeError.value(index);
1759 }
1760 this[$checkGrowable]('removeAt');
1761 return dart.as(this.splice(index, 1)[0], E);
1762 }
1763 [$removeLast]() {
1764 this[$checkGrowable]('removeLast');
1765 if (this[$length] == 0)
1766 throw new RangeError.value(-1);
1767 return dart.as(this.pop(), E);
1768 }
1769 [$removeWhere](test) {
1770 dart.as(test, dart.functionType(bool, [E]));
1771 _internal.IterableMixinWorkaround.removeWhereList(this, test);
1772 }
1773 [$retainWhere](test) {
1774 dart.as(test, dart.functionType(bool, [E]));
1775 _internal.IterableMixinWorkaround.removeWhereList(this, dart.fn(element => !dart.notNull(test(element)), bool, [E]));
1776 }
1777 [$sublist](start, end) {
1778 if (end === void 0)
1779 end = null;
1780 dart.dcall(/* Unimplemented unknown name */checkNull, start);
1781 if (!(typeof start == 'number'))
1782 throw new ArgumentError(start);
1783 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(this[$ length])) {
1784 throw new RangeError.range(start, 0, this[$length]);
1785 }
1786 if (end == null) {
1787 end = this[$length];
1788 } else {
1789 if (!(typeof end == 'number'))
1790 throw new ArgumentError(end);
1791 if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dar t.notNull(this[$length])) {
1792 throw new RangeError.range(end, start, this[$length]);
1793 }
1794 }
1795 if (start == end)
1796 return dart.setType([], List$(E));
1797 return _interceptors.JSArray$(E).markGrowable(this.slice(start, end));
1798 }
1799 [$getRange](start, end) {
1800 return new (_internal.IterableMixinWorkaround$(E))().getRangeList(this, start, end);
1801 }
1802 [$setRange](start, end, iterable, skipCount) {
1803 dart.as(iterable, Iterable$(E));
1804 if (skipCount === void 0)
1805 skipCount = 0;
1806 this[$checkMutable]('set range');
1807 _internal.IterableMixinWorkaround.setRangeList(this, start, end, iterabl e, skipCount);
1808 }
1809 [$removeRange](start, end) {
1810 this[$checkGrowable]('removeRange');
1811 let receiverLength = this[$length];
1812 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(receiv erLength)) {
1813 throw new RangeError.range(start, 0, receiverLength);
1814 }
1815 if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dart. notNull(receiverLength)) {
1816 throw new RangeError.range(end, start, receiverLength);
1817 }
1818 _internal.Lists.copy(this, end, this, start, dart.notNull(receiverLength ) - dart.notNull(end));
1819 this[$length] = dart.notNull(receiverLength) - (dart.notNull(end) - dart .notNull(start));
1820 }
1821 [$fillRange](start, end, fillValue) {
1822 if (fillValue === void 0)
1823 fillValue = null;
1824 dart.as(fillValue, E);
1825 this[$checkMutable]('fill range');
1826 _internal.IterableMixinWorkaround.fillRangeList(this, start, end, fillVa lue);
1827 }
1828 [$replaceRange](start, end, replacement) {
1829 dart.as(replacement, Iterable$(E));
1830 this[$checkGrowable]('removeRange');
1831 _internal.IterableMixinWorkaround.replaceRangeList(this, start, end, rep lacement);
1832 }
1833 [$asMap]() {
1834 return new (_internal.IterableMixinWorkaround$(E))().asMapList(this);
1835 } 1449 }
1836 } 1450 }
1837 dart.setBaseClass(List, dart.global.Array); 1451 List[dart.implements] = () => [Iterable$(E)];
1838 List[dart.implements] = () => [Iterable$(E), _internal.EfficientLength];
1839 dart.setSignature(List, { 1452 dart.setSignature(List, {
1840 constructors: () => ({ 1453 constructors: () => ({
1841 new: [List$(E), [], [int]], 1454 new: [List$(E), [], [int]],
1842 filled: [List$(E), [int, E]], 1455 filled: [List$(E), [int, E]],
1843 from: [List$(E), [Iterable], {growable: bool}], 1456 from: [List$(E), [Iterable], {growable: bool}],
1844 generate: [List$(E), [int, dart.functionType(E, [int])], {growable: bool }] 1457 generate: [List$(E), [int, dart.functionType(E, [int])], {growable: bool }]
1845 }),
1846 methods: () => ({
1847 [$checkMutable]: [Object, [Object]],
1848 [$checkGrowable]: [Object, [Object]],
1849 [$where]: [Iterable$(E), [dart.functionType(bool, [E])]],
1850 [$expand]: [Iterable, [dart.functionType(Iterable, [E])]],
1851 [$forEach]: [dart.void, [dart.functionType(dart.void, [E])]],
1852 [$map]: [Iterable, [dart.functionType(Object, [E])]],
1853 [$join]: [String, [], [String]],
1854 [$take]: [Iterable$(E), [int]],
1855 [$takeWhile]: [Iterable$(E), [dart.functionType(bool, [E])]],
1856 [$skip]: [Iterable$(E), [int]],
1857 [$skipWhile]: [Iterable$(E), [dart.functionType(bool, [E])]],
1858 [$reduce]: [E, [dart.functionType(E, [E, E])]],
1859 [$fold]: [Object, [Object, dart.functionType(Object, [dart.bottom, E])]] ,
1860 [$firstWhere]: [E, [dart.functionType(bool, [E])], {orElse: dart.functio nType(E, [])}],
1861 [$lastWhere]: [E, [dart.functionType(bool, [E])], {orElse: dart.function Type(E, [])}],
1862 [$singleWhere]: [E, [dart.functionType(bool, [E])]],
1863 [$elementAt]: [E, [int]],
1864 [$any]: [bool, [dart.functionType(bool, [E])]],
1865 [$every]: [bool, [dart.functionType(bool, [E])]],
1866 [$contains]: [bool, [Object]],
1867 [$toList]: [List$(E), [], {growable: bool}],
1868 [$toSet]: [exports.Set$(E), []],
1869 [$get]: [E, [int]],
1870 [$set]: [dart.void, [int, E]],
1871 [$add]: [dart.void, [E]],
1872 [$addAll]: [dart.void, [Iterable$(E)]],
1873 [$sort]: [dart.void, [], [dart.functionType(int, [E, E])]],
1874 [$shuffle]: [dart.void, [], [math.Random]],
1875 [$indexOf]: [int, [E], [int]],
1876 [$lastIndexOf]: [int, [E], [int]],
1877 [$clear]: [dart.void, []],
1878 [$insert]: [dart.void, [int, E]],
1879 [$insertAll]: [dart.void, [int, Iterable$(E)]],
1880 [$setAll]: [dart.void, [int, Iterable$(E)]],
1881 [$remove]: [bool, [Object]],
1882 [$removeAt]: [E, [int]],
1883 [$removeLast]: [E, []],
1884 [$removeWhere]: [dart.void, [dart.functionType(bool, [E])]],
1885 [$retainWhere]: [dart.void, [dart.functionType(bool, [E])]],
1886 [$sublist]: [List$(E), [int], [int]],
1887 [$getRange]: [Iterable$(E), [int, int]],
1888 [$setRange]: [dart.void, [int, int, Iterable$(E)], [int]],
1889 [$removeRange]: [dart.void, [int, int]],
1890 [$fillRange]: [dart.void, [int, int], [E]],
1891 [$replaceRange]: [dart.void, [int, int, Iterable$(E)]],
1892 [$asMap]: [Map$(int, E), []]
1893 }) 1458 })
1894 }); 1459 });
1895 return List; 1460 return List;
1896 }); 1461 });
1897 let List = List$(); 1462 let List = List$();
1898 dart.registerExtension(dart.global.Array, List);
1899 let Map$ = dart.generic(function(K, V) { 1463 let Map$ = dart.generic(function(K, V) {
1900 class Map extends Object { 1464 class Map extends Object {
1901 static new() { 1465 static new() {
1902 return collection.LinkedHashMap$(K, V).new(); 1466 return collection.LinkedHashMap$(K, V).new();
1903 } 1467 }
1904 static from(other) { 1468 static from(other) {
1905 return collection.LinkedHashMap$(K, V).from(other); 1469 return collection.LinkedHashMap$(K, V).from(other);
1906 } 1470 }
1907 static identity() { 1471 static identity() {
1908 return collection.LinkedHashMap$(K, V).identity(); 1472 return collection.LinkedHashMap$(K, V).identity();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1950 dart.fn(print, dart.void, [Object]); 1514 dart.fn(print, dart.void, [Object]);
1951 class Match extends Object {} 1515 class Match extends Object {}
1952 class RegExp extends Object { 1516 class RegExp extends Object {
1953 static new(source, opts) { 1517 static new(source, opts) {
1954 let multiLine = opts && 'multiLine' in opts ? opts.multiLine : false; 1518 let multiLine = opts && 'multiLine' in opts ? opts.multiLine : false;
1955 let caseSensitive = opts && 'caseSensitive' in opts ? opts.caseSensitive : true; 1519 let caseSensitive = opts && 'caseSensitive' in opts ? opts.caseSensitive : true;
1956 return new _js_helper.JSSyntaxRegExp(source, {multiLine: multiLine, caseSe nsitive: caseSensitive}); 1520 return new _js_helper.JSSyntaxRegExp(source, {multiLine: multiLine, caseSe nsitive: caseSensitive});
1957 } 1521 }
1958 } 1522 }
1959 RegExp[dart.implements] = () => [Pattern]; 1523 RegExp[dart.implements] = () => [Pattern];
1524 dart.implementExtension(RegExp, () => [Pattern]);
1960 dart.setSignature(RegExp, { 1525 dart.setSignature(RegExp, {
1961 constructors: () => ({new: [RegExp, [String], {multiLine: bool, caseSensitiv e: bool}]}) 1526 constructors: () => ({new: [RegExp, [String], {multiLine: bool, caseSensitiv e: bool}]})
1962 }); 1527 });
1963 let Set$ = dart.generic(function(E) { 1528 let Set$ = dart.generic(function(E) {
1964 class Set extends collection.IterableBase$(E) { 1529 class Set extends collection.IterableBase$(E) {
1965 static new() { 1530 static new() {
1966 return collection.LinkedHashSet$(E).new(); 1531 return collection.LinkedHashSet$(E).new();
1967 } 1532 }
1968 static identity() { 1533 static identity() {
1969 return collection.LinkedHashSet$(E).identity(); 1534 return collection.LinkedHashSet$(E).identity();
1970 } 1535 }
1971 static from(elements) { 1536 static from(elements) {
1972 return collection.LinkedHashSet$(E).from(elements); 1537 return collection.LinkedHashSet$(E).from(elements);
1973 } 1538 }
1974 } 1539 }
1975 Set[dart.implements] = () => [_internal.EfficientLength]; 1540 Set[dart.implements] = () => [_internal.EfficientLength];
1541 dart.implementExtension(Set, () => [Iterable]);
1976 dart.setSignature(Set, { 1542 dart.setSignature(Set, {
1977 constructors: () => ({ 1543 constructors: () => ({
1978 new: [exports.Set$(E), []], 1544 new: [exports.Set$(E), []],
1979 identity: [exports.Set$(E), []], 1545 identity: [exports.Set$(E), []],
1980 from: [exports.Set$(E), [Iterable]] 1546 from: [exports.Set$(E), [Iterable]]
1981 }) 1547 })
1982 }); 1548 });
1983 return Set; 1549 return Set;
1984 }); 1550 });
1985 dart.defineLazyClassGeneric(exports, 'Set', {get: Set$}); 1551 dart.defineLazyClassGeneric(exports, 'Set', {get: Set$});
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
2065 class String extends Object { 1631 class String extends Object {
2066 static fromCharCodes(charCodes, start, end) { 1632 static fromCharCodes(charCodes, start, end) {
2067 if (start === void 0) 1633 if (start === void 0)
2068 start = 0; 1634 start = 0;
2069 if (end === void 0) 1635 if (end === void 0)
2070 end = null; 1636 end = null;
2071 if (!dart.is(charCodes, _interceptors.JSArray)) { 1637 if (!dart.is(charCodes, _interceptors.JSArray)) {
2072 return String._stringFromIterable(charCodes, start, end); 1638 return String._stringFromIterable(charCodes, start, end);
2073 } 1639 }
2074 let list = dart.as(charCodes, List); 1640 let list = dart.as(charCodes, List);
2075 let len = list[$length]; 1641 let len = list.length;
2076 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(len)) { 1642 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(len)) {
2077 throw new RangeError.range(start, 0, len); 1643 throw new RangeError.range(start, 0, len);
2078 } 1644 }
2079 if (end == null) { 1645 if (end == null) {
2080 end = len; 1646 end = len;
2081 } else if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dart.notNull(len)) { 1647 } else if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dart.notNull(len)) {
2082 throw new RangeError.range(end, start, len); 1648 throw new RangeError.range(end, start, len);
2083 } 1649 }
2084 if (dart.notNull(start) > 0 || dart.notNull(end) < dart.notNull(len)) { 1650 if (dart.notNull(start) > 0 || dart.notNull(end) < dart.notNull(len)) {
2085 list = list[$sublist](start, end); 1651 list = list[dartx.sublist](start, end);
2086 } 1652 }
2087 return _js_helper.Primitives.stringFromCharCodes(list); 1653 return _js_helper.Primitives.stringFromCharCodes(list);
2088 } 1654 }
2089 static fromCharCode(charCode) { 1655 static fromCharCode(charCode) {
2090 return _js_helper.Primitives.stringFromCharCode(charCode); 1656 return _js_helper.Primitives.stringFromCharCode(charCode);
2091 } 1657 }
2092 static fromEnvironment(name, opts) { 1658 static fromEnvironment(name, opts) {
2093 let defaultValue = opts && 'defaultValue' in opts ? opts.defaultValue : nu ll; 1659 let defaultValue = opts && 'defaultValue' in opts ? opts.defaultValue : nu ll;
2094 throw new UnsupportedError('String.fromEnvironment can only be used as a c onst constructor'); 1660 throw new UnsupportedError('String.fromEnvironment can only be used as a c onst constructor');
2095 } 1661 }
2096 static _stringFromIterable(charCodes, start, end) { 1662 static _stringFromIterable(charCodes, start, end) {
2097 if (dart.notNull(start) < 0) 1663 if (dart.notNull(start) < 0)
2098 throw new RangeError.range(start, 0, charCodes[$length]); 1664 throw new RangeError.range(start, 0, charCodes.length);
2099 if (end != null && dart.notNull(end) < dart.notNull(start)) { 1665 if (end != null && dart.notNull(end) < dart.notNull(start)) {
2100 throw new RangeError.range(end, start, charCodes[$length]); 1666 throw new RangeError.range(end, start, charCodes.length);
2101 } 1667 }
2102 let it = charCodes[$iterator]; 1668 let it = charCodes[dartx.iterator];
2103 for (let i = 0; dart.notNull(i) < dart.notNull(start); i = dart.notNull(i) + 1) { 1669 for (let i = 0; dart.notNull(i) < dart.notNull(start); i = dart.notNull(i) + 1) {
2104 if (!dart.notNull(it.moveNext())) { 1670 if (!dart.notNull(it.moveNext())) {
2105 throw new RangeError.range(start, 0, i); 1671 throw new RangeError.range(start, 0, i);
2106 } 1672 }
2107 } 1673 }
2108 let list = []; 1674 let list = [];
2109 if (end == null) { 1675 if (end == null) {
2110 while (it.moveNext()) 1676 while (it.moveNext())
2111 list[$add](it.current); 1677 list[dartx.add](it.current);
2112 } else { 1678 } else {
2113 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul l(i) + 1) { 1679 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul l(i) + 1) {
2114 if (!dart.notNull(it.moveNext())) { 1680 if (!dart.notNull(it.moveNext())) {
2115 throw new RangeError.range(end, start, i); 1681 throw new RangeError.range(end, start, i);
2116 } 1682 }
2117 list[$add](it.current); 1683 list[dartx.add](it.current);
2118 } 1684 }
2119 } 1685 }
2120 return _js_helper.Primitives.stringFromCharCodes(list); 1686 return _js_helper.Primitives.stringFromCharCodes(list);
2121 } 1687 }
2122 } 1688 }
2123 String[dart.implements] = () => [Comparable$(String), Pattern]; 1689 String[dart.implements] = () => [Comparable$(String), Pattern];
2124 dart.setSignature(String, { 1690 dart.setSignature(String, {
2125 constructors: () => ({ 1691 constructors: () => ({
2126 fromCharCodes: [String, [Iterable$(int)], [int, int]], 1692 fromCharCodes: [String, [Iterable$(int)], [int, int]],
2127 fromCharCode: [String, [int]], 1693 fromCharCode: [String, [int]],
2128 fromEnvironment: [String, [String], {defaultValue: String}] 1694 fromEnvironment: [String, [String], {defaultValue: String}]
2129 }), 1695 }),
2130 statics: () => ({_stringFromIterable: [String, [Iterable$(int), int, int]]}) , 1696 statics: () => ({_stringFromIterable: [String, [Iterable$(int), int, int]]}) ,
2131 names: ['_stringFromIterable'] 1697 names: ['_stringFromIterable']
2132 }); 1698 });
2133 dart.defineLazyClass(exports, { 1699 dart.defineLazyClass(exports, {
2134 get Runes() { 1700 get Runes() {
2135 class Runes extends collection.IterableBase$(int) { 1701 class Runes extends collection.IterableBase$(int) {
2136 Runes(string) { 1702 Runes(string) {
2137 this.string = string; 1703 this.string = string;
2138 super.IterableBase(); 1704 super.IterableBase();
2139 } 1705 }
2140 get [$iterator]() { 1706 get iterator() {
2141 return new RuneIterator(this.string); 1707 return new RuneIterator(this.string);
2142 } 1708 }
2143 get [$last]() { 1709 get last() {
2144 if (this.string.length == 0) { 1710 if (this.string.length == 0) {
2145 throw new StateError('No elements.'); 1711 throw new StateError('No elements.');
2146 } 1712 }
2147 let length = this.string.length; 1713 let length = this.string.length;
2148 let code = this.string.codeUnitAt(dart.notNull(length) - 1); 1714 let code = this.string[dartx.codeUnitAt](dart.notNull(length) - 1);
2149 if (dart.notNull(_isTrailSurrogate(code)) && dart.notNull(this.string. length) > 1) { 1715 if (dart.notNull(_isTrailSurrogate(code)) && dart.notNull(this.string. length) > 1) {
2150 let previousCode = this.string.codeUnitAt(dart.notNull(length) - 2); 1716 let previousCode = this.string[dartx.codeUnitAt](dart.notNull(length ) - 2);
2151 if (_isLeadSurrogate(previousCode)) { 1717 if (_isLeadSurrogate(previousCode)) {
2152 return _combineSurrogatePair(previousCode, code); 1718 return _combineSurrogatePair(previousCode, code);
2153 } 1719 }
2154 } 1720 }
2155 return code; 1721 return code;
2156 } 1722 }
2157 } 1723 }
2158 dart.setSignature(Runes, { 1724 dart.setSignature(Runes, {
2159 constructors: () => ({Runes: [exports.Runes, [String]]}) 1725 constructors: () => ({Runes: [exports.Runes, [String]]})
2160 }); 1726 });
(...skipping 25 matching lines...) Expand all
2186 } 1752 }
2187 at(string, index) { 1753 at(string, index) {
2188 this.string = string; 1754 this.string = string;
2189 this[_position] = index; 1755 this[_position] = index;
2190 this[_nextPosition] = index; 1756 this[_nextPosition] = index;
2191 this[_currentCodePoint] = null; 1757 this[_currentCodePoint] = null;
2192 RangeError.checkValueInInterval(index, 0, string.length); 1758 RangeError.checkValueInInterval(index, 0, string.length);
2193 this[_checkSplitSurrogate](index); 1759 this[_checkSplitSurrogate](index);
2194 } 1760 }
2195 [_checkSplitSurrogate](index) { 1761 [_checkSplitSurrogate](index) {
2196 if (dart.notNull(index) > 0 && dart.notNull(index) < dart.notNull(this.str ing.length) && dart.notNull(_isLeadSurrogate(this.string.codeUnitAt(dart.notNull (index) - 1))) && dart.notNull(_isTrailSurrogate(this.string.codeUnitAt(index))) ) { 1762 if (dart.notNull(index) > 0 && dart.notNull(index) < dart.notNull(this.str ing.length) && dart.notNull(_isLeadSurrogate(this.string[dartx.codeUnitAt](dart. notNull(index) - 1))) && dart.notNull(_isTrailSurrogate(this.string[dartx.codeUn itAt](index)))) {
2197 throw new ArgumentError(`Index inside surrogate pair: ${index}`); 1763 throw new ArgumentError(`Index inside surrogate pair: ${index}`);
2198 } 1764 }
2199 } 1765 }
2200 get rawIndex() { 1766 get rawIndex() {
2201 return this[_position] != this[_nextPosition] ? this[_position] : null; 1767 return this[_position] != this[_nextPosition] ? this[_position] : null;
2202 } 1768 }
2203 set rawIndex(rawIndex) { 1769 set rawIndex(rawIndex) {
2204 RangeError.checkValidIndex(rawIndex, this.string, "rawIndex"); 1770 RangeError.checkValidIndex(rawIndex, this.string, "rawIndex");
2205 this.reset(rawIndex); 1771 this.reset(rawIndex);
2206 this.moveNext(); 1772 this.moveNext();
2207 } 1773 }
2208 reset(rawIndex) { 1774 reset(rawIndex) {
2209 if (rawIndex === void 0) 1775 if (rawIndex === void 0)
2210 rawIndex = 0; 1776 rawIndex = 0;
2211 RangeError.checkValueInInterval(rawIndex, 0, this.string.length, "rawIndex "); 1777 RangeError.checkValueInInterval(rawIndex, 0, this.string.length, "rawIndex ");
2212 this[_checkSplitSurrogate](rawIndex); 1778 this[_checkSplitSurrogate](rawIndex);
2213 this[_position] = this[_nextPosition] = rawIndex; 1779 this[_position] = this[_nextPosition] = rawIndex;
2214 this[_currentCodePoint] = null; 1780 this[_currentCodePoint] = null;
2215 } 1781 }
2216 get current() { 1782 get current() {
2217 return this[_currentCodePoint]; 1783 return this[_currentCodePoint];
2218 } 1784 }
2219 get currentSize() { 1785 get currentSize() {
2220 return dart.notNull(this[_nextPosition]) - dart.notNull(this[_position]); 1786 return dart.notNull(this[_nextPosition]) - dart.notNull(this[_position]);
2221 } 1787 }
2222 get currentAsString() { 1788 get currentAsString() {
2223 if (this[_position] == this[_nextPosition]) 1789 if (this[_position] == this[_nextPosition])
2224 return null; 1790 return null;
2225 if (dart.notNull(this[_position]) + 1 == this[_nextPosition]) 1791 if (dart.notNull(this[_position]) + 1 == this[_nextPosition])
2226 return this.string.get(this[_position]); 1792 return this.string[dartx.get](this[_position]);
2227 return this.string.substring(this[_position], this[_nextPosition]); 1793 return this.string[dartx.substring](this[_position], this[_nextPosition]);
2228 } 1794 }
2229 moveNext() { 1795 moveNext() {
2230 this[_position] = this[_nextPosition]; 1796 this[_position] = this[_nextPosition];
2231 if (this[_position] == this.string.length) { 1797 if (this[_position] == this.string.length) {
2232 this[_currentCodePoint] = null; 1798 this[_currentCodePoint] = null;
2233 return false; 1799 return false;
2234 } 1800 }
2235 let codeUnit = this.string.codeUnitAt(this[_position]); 1801 let codeUnit = this.string[dartx.codeUnitAt](this[_position]);
2236 let nextPosition = dart.notNull(this[_position]) + 1; 1802 let nextPosition = dart.notNull(this[_position]) + 1;
2237 if (dart.notNull(_isLeadSurrogate(codeUnit)) && dart.notNull(nextPosition) < dart.notNull(this.string.length)) { 1803 if (dart.notNull(_isLeadSurrogate(codeUnit)) && dart.notNull(nextPosition) < dart.notNull(this.string.length)) {
2238 let nextCodeUnit = this.string.codeUnitAt(nextPosition); 1804 let nextCodeUnit = this.string[dartx.codeUnitAt](nextPosition);
2239 if (_isTrailSurrogate(nextCodeUnit)) { 1805 if (_isTrailSurrogate(nextCodeUnit)) {
2240 this[_nextPosition] = dart.notNull(nextPosition) + 1; 1806 this[_nextPosition] = dart.notNull(nextPosition) + 1;
2241 this[_currentCodePoint] = _combineSurrogatePair(codeUnit, nextCodeUnit ); 1807 this[_currentCodePoint] = _combineSurrogatePair(codeUnit, nextCodeUnit );
2242 return true; 1808 return true;
2243 } 1809 }
2244 } 1810 }
2245 this[_nextPosition] = nextPosition; 1811 this[_nextPosition] = nextPosition;
2246 this[_currentCodePoint] = codeUnit; 1812 this[_currentCodePoint] = codeUnit;
2247 return true; 1813 return true;
2248 } 1814 }
2249 movePrevious() { 1815 movePrevious() {
2250 this[_nextPosition] = this[_position]; 1816 this[_nextPosition] = this[_position];
2251 if (this[_position] == 0) { 1817 if (this[_position] == 0) {
2252 this[_currentCodePoint] = null; 1818 this[_currentCodePoint] = null;
2253 return false; 1819 return false;
2254 } 1820 }
2255 let position = dart.notNull(this[_position]) - 1; 1821 let position = dart.notNull(this[_position]) - 1;
2256 let codeUnit = this.string.codeUnitAt(position); 1822 let codeUnit = this.string[dartx.codeUnitAt](position);
2257 if (dart.notNull(_isTrailSurrogate(codeUnit)) && dart.notNull(position) > 0) { 1823 if (dart.notNull(_isTrailSurrogate(codeUnit)) && dart.notNull(position) > 0) {
2258 let prevCodeUnit = this.string.codeUnitAt(dart.notNull(position) - 1); 1824 let prevCodeUnit = this.string[dartx.codeUnitAt](dart.notNull(position) - 1);
2259 if (_isLeadSurrogate(prevCodeUnit)) { 1825 if (_isLeadSurrogate(prevCodeUnit)) {
2260 this[_position] = dart.notNull(position) - 1; 1826 this[_position] = dart.notNull(position) - 1;
2261 this[_currentCodePoint] = _combineSurrogatePair(prevCodeUnit, codeUnit ); 1827 this[_currentCodePoint] = _combineSurrogatePair(prevCodeUnit, codeUnit );
2262 return true; 1828 return true;
2263 } 1829 }
2264 } 1830 }
2265 this[_position] = position; 1831 this[_position] = position;
2266 this[_currentCodePoint] = codeUnit; 1832 this[_currentCodePoint] = codeUnit;
2267 return true; 1833 return true;
2268 } 1834 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
2300 } 1866 }
2301 write(obj) { 1867 write(obj) {
2302 this[_writeString](`${obj}`); 1868 this[_writeString](`${obj}`);
2303 } 1869 }
2304 writeCharCode(charCode) { 1870 writeCharCode(charCode) {
2305 this[_writeString](String.fromCharCode(charCode)); 1871 this[_writeString](String.fromCharCode(charCode));
2306 } 1872 }
2307 writeAll(objects, separator) { 1873 writeAll(objects, separator) {
2308 if (separator === void 0) 1874 if (separator === void 0)
2309 separator = ""; 1875 separator = "";
2310 let iterator = objects[$iterator]; 1876 let iterator = objects[dartx.iterator];
2311 if (!dart.notNull(iterator.moveNext())) 1877 if (!dart.notNull(iterator.moveNext()))
2312 return; 1878 return;
2313 if (separator.isEmpty) { 1879 if (separator[dartx.isEmpty]) {
2314 do { 1880 do {
2315 this.write(iterator.current); 1881 this.write(iterator.current);
2316 } while (iterator.moveNext()); 1882 } while (iterator.moveNext());
2317 } else { 1883 } else {
2318 this.write(iterator.current); 1884 this.write(iterator.current);
2319 while (iterator.moveNext()) { 1885 while (iterator.moveNext()) {
2320 this.write(separator); 1886 this.write(separator);
2321 this.write(iterator.current); 1887 this.write(iterator.current);
2322 } 1888 }
2323 } 1889 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
2382 let sb = new StringBuffer(); 1948 let sb = new StringBuffer();
2383 this[_writeAuthority](sb); 1949 this[_writeAuthority](sb);
2384 return dart.toString(sb); 1950 return dart.toString(sb);
2385 } 1951 }
2386 get userInfo() { 1952 get userInfo() {
2387 return this[_userInfo]; 1953 return this[_userInfo];
2388 } 1954 }
2389 get host() { 1955 get host() {
2390 if (this[_host] == null) 1956 if (this[_host] == null)
2391 return ""; 1957 return "";
2392 if (this[_host].startsWith('[')) { 1958 if (this[_host][dartx.startsWith]('[')) {
2393 return this[_host].substring(1, dart.notNull(this[_host].length) - 1); 1959 return this[_host][dartx.substring](1, dart.notNull(this[_host].length) - 1);
2394 } 1960 }
2395 return this[_host]; 1961 return this[_host];
2396 } 1962 }
2397 get port() { 1963 get port() {
2398 if (this[_port] == null) 1964 if (this[_port] == null)
2399 return Uri._defaultPort(this.scheme); 1965 return Uri._defaultPort(this.scheme);
2400 return this[_port]; 1966 return this[_port];
2401 } 1967 }
2402 static _defaultPort(scheme) { 1968 static _defaultPort(scheme) {
2403 if (scheme == "http") 1969 if (scheme == "http")
2404 return 80; 1970 return 80;
2405 if (scheme == "https") 1971 if (scheme == "https")
2406 return 443; 1972 return 443;
2407 return 0; 1973 return 0;
2408 } 1974 }
2409 get path() { 1975 get path() {
2410 return this[_path]; 1976 return this[_path];
2411 } 1977 }
2412 get query() { 1978 get query() {
2413 return this[_query] == null ? "" : this[_query]; 1979 return this[_query] == null ? "" : this[_query];
2414 } 1980 }
2415 get fragment() { 1981 get fragment() {
2416 return this[_fragment] == null ? "" : this[_fragment]; 1982 return this[_fragment] == null ? "" : this[_fragment];
2417 } 1983 }
2418 static parse(uri) { 1984 static parse(uri) {
2419 let isRegName = ch => { 1985 let isRegName = ch => {
2420 return dart.notNull(ch) < 128 && dart.notNull(!dart.equals(dart.dsend(Ur i._regNameTable[$get](dart.notNull(ch) >> 4), '&', 1 << (dart.notNull(ch) & 15)) , 0)); 1986 return dart.notNull(ch) < 128 && dart.notNull(!dart.equals(dart.dsend(Ur i._regNameTable[dartx.get](dart.notNull(ch) >> 4), '&', 1 << (dart.notNull(ch) & 15)), 0));
2421 }; 1987 };
2422 dart.fn(isRegName, bool, [int]); 1988 dart.fn(isRegName, bool, [int]);
2423 let EOI = -1; 1989 let EOI = -1;
2424 let scheme = ""; 1990 let scheme = "";
2425 let userinfo = ""; 1991 let userinfo = "";
2426 let host = null; 1992 let host = null;
2427 let port = null; 1993 let port = null;
2428 let path = null; 1994 let path = null;
2429 let query = null; 1995 let query = null;
2430 let fragment = null; 1996 let fragment = null;
2431 let index = 0; 1997 let index = 0;
2432 let pathStart = 0; 1998 let pathStart = 0;
2433 let char = EOI; 1999 let char = EOI;
2434 let parseAuth = () => { 2000 let parseAuth = () => {
2435 if (index == uri.length) { 2001 if (index == uri.length) {
2436 char = EOI; 2002 char = EOI;
2437 return; 2003 return;
2438 } 2004 }
2439 let authStart = index; 2005 let authStart = index;
2440 let lastColon = -1; 2006 let lastColon = -1;
2441 let lastAt = -1; 2007 let lastAt = -1;
2442 char = uri.codeUnitAt(index); 2008 char = uri[dartx.codeUnitAt](index);
2443 while (dart.notNull(index) < dart.notNull(uri.length)) { 2009 while (dart.notNull(index) < dart.notNull(uri.length)) {
2444 char = uri.codeUnitAt(index); 2010 char = uri[dartx.codeUnitAt](index);
2445 if (char == Uri._SLASH || char == Uri._QUESTION || char == Uri._NUMBER _SIGN) { 2011 if (char == Uri._SLASH || char == Uri._QUESTION || char == Uri._NUMBER _SIGN) {
2446 break; 2012 break;
2447 } 2013 }
2448 if (char == Uri._AT_SIGN) { 2014 if (char == Uri._AT_SIGN) {
2449 lastAt = index; 2015 lastAt = index;
2450 lastColon = -1; 2016 lastColon = -1;
2451 } else if (char == Uri._COLON) { 2017 } else if (char == Uri._COLON) {
2452 lastColon = index; 2018 lastColon = index;
2453 } else if (char == Uri._LEFT_BRACKET) { 2019 } else if (char == Uri._LEFT_BRACKET) {
2454 lastColon = -1; 2020 lastColon = -1;
2455 let endBracket = uri.indexOf(']', dart.notNull(index) + 1); 2021 let endBracket = uri[dartx.indexOf](']', dart.notNull(index) + 1);
2456 if (endBracket == -1) { 2022 if (endBracket == -1) {
2457 index = uri.length; 2023 index = uri.length;
2458 char = EOI; 2024 char = EOI;
2459 break; 2025 break;
2460 } else { 2026 } else {
2461 index = endBracket; 2027 index = endBracket;
2462 } 2028 }
2463 } 2029 }
2464 index = dart.notNull(index) + 1; 2030 index = dart.notNull(index) + 1;
2465 char = EOI; 2031 char = EOI;
2466 } 2032 }
2467 let hostStart = authStart; 2033 let hostStart = authStart;
2468 let hostEnd = index; 2034 let hostEnd = index;
2469 if (dart.notNull(lastAt) >= 0) { 2035 if (dart.notNull(lastAt) >= 0) {
2470 userinfo = Uri._makeUserInfo(uri, authStart, lastAt); 2036 userinfo = Uri._makeUserInfo(uri, authStart, lastAt);
2471 hostStart = dart.notNull(lastAt) + 1; 2037 hostStart = dart.notNull(lastAt) + 1;
2472 } 2038 }
2473 if (dart.notNull(lastColon) >= 0) { 2039 if (dart.notNull(lastColon) >= 0) {
2474 let portNumber = null; 2040 let portNumber = null;
2475 if (dart.notNull(lastColon) + 1 < dart.notNull(index)) { 2041 if (dart.notNull(lastColon) + 1 < dart.notNull(index)) {
2476 portNumber = 0; 2042 portNumber = 0;
2477 for (let i = dart.notNull(lastColon) + 1; dart.notNull(i) < dart.not Null(index); i = dart.notNull(i) + 1) { 2043 for (let i = dart.notNull(lastColon) + 1; dart.notNull(i) < dart.not Null(index); i = dart.notNull(i) + 1) {
2478 let digit = uri.codeUnitAt(i); 2044 let digit = uri[dartx.codeUnitAt](i);
2479 if (dart.notNull(Uri._ZERO) > dart.notNull(digit) || dart.notNull( Uri._NINE) < dart.notNull(digit)) { 2045 if (dart.notNull(Uri._ZERO) > dart.notNull(digit) || dart.notNull( Uri._NINE) < dart.notNull(digit)) {
2480 Uri._fail(uri, i, "Invalid port number"); 2046 Uri._fail(uri, i, "Invalid port number");
2481 } 2047 }
2482 portNumber = dart.notNull(portNumber) * 10 + (dart.notNull(digit) - dart.notNull(Uri._ZERO)); 2048 portNumber = dart.notNull(portNumber) * 10 + (dart.notNull(digit) - dart.notNull(Uri._ZERO));
2483 } 2049 }
2484 } 2050 }
2485 port = Uri._makePort(portNumber, scheme); 2051 port = Uri._makePort(portNumber, scheme);
2486 hostEnd = lastColon; 2052 hostEnd = lastColon;
2487 } 2053 }
2488 host = Uri._makeHost(uri, hostStart, hostEnd, true); 2054 host = Uri._makeHost(uri, hostStart, hostEnd, true);
2489 if (dart.notNull(index) < dart.notNull(uri.length)) { 2055 if (dart.notNull(index) < dart.notNull(uri.length)) {
2490 char = uri.codeUnitAt(index); 2056 char = uri[dartx.codeUnitAt](index);
2491 } 2057 }
2492 }; 2058 };
2493 dart.fn(parseAuth, dart.void, []); 2059 dart.fn(parseAuth, dart.void, []);
2494 let NOT_IN_PATH = 0; 2060 let NOT_IN_PATH = 0;
2495 let IN_PATH = 1; 2061 let IN_PATH = 1;
2496 let ALLOW_AUTH = 2; 2062 let ALLOW_AUTH = 2;
2497 let state = NOT_IN_PATH; 2063 let state = NOT_IN_PATH;
2498 let i = index; 2064 let i = index;
2499 while (dart.notNull(i) < dart.notNull(uri.length)) { 2065 while (dart.notNull(i) < dart.notNull(uri.length)) {
2500 char = uri.codeUnitAt(i); 2066 char = uri[dartx.codeUnitAt](i);
2501 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN) { 2067 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN) {
2502 state = NOT_IN_PATH; 2068 state = NOT_IN_PATH;
2503 break; 2069 break;
2504 } 2070 }
2505 if (char == Uri._SLASH) { 2071 if (char == Uri._SLASH) {
2506 state = i == 0 ? ALLOW_AUTH : IN_PATH; 2072 state = i == 0 ? ALLOW_AUTH : IN_PATH;
2507 break; 2073 break;
2508 } 2074 }
2509 if (char == Uri._COLON) { 2075 if (char == Uri._COLON) {
2510 if (i == 0) 2076 if (i == 0)
2511 Uri._fail(uri, 0, "Invalid empty scheme"); 2077 Uri._fail(uri, 0, "Invalid empty scheme");
2512 scheme = Uri._makeScheme(uri, i); 2078 scheme = Uri._makeScheme(uri, i);
2513 i = dart.notNull(i) + 1; 2079 i = dart.notNull(i) + 1;
2514 pathStart = i; 2080 pathStart = i;
2515 if (i == uri.length) { 2081 if (i == uri.length) {
2516 char = EOI; 2082 char = EOI;
2517 state = NOT_IN_PATH; 2083 state = NOT_IN_PATH;
2518 } else { 2084 } else {
2519 char = uri.codeUnitAt(i); 2085 char = uri[dartx.codeUnitAt](i);
2520 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN) { 2086 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN) {
2521 state = NOT_IN_PATH; 2087 state = NOT_IN_PATH;
2522 } else if (char == Uri._SLASH) { 2088 } else if (char == Uri._SLASH) {
2523 state = ALLOW_AUTH; 2089 state = ALLOW_AUTH;
2524 } else { 2090 } else {
2525 state = IN_PATH; 2091 state = IN_PATH;
2526 } 2092 }
2527 } 2093 }
2528 break; 2094 break;
2529 } 2095 }
2530 i = dart.notNull(i) + 1; 2096 i = dart.notNull(i) + 1;
2531 char = EOI; 2097 char = EOI;
2532 } 2098 }
2533 index = i; 2099 index = i;
2534 if (state == ALLOW_AUTH) { 2100 if (state == ALLOW_AUTH) {
2535 dart.assert(char == Uri._SLASH); 2101 dart.assert(char == Uri._SLASH);
2536 index = dart.notNull(index) + 1; 2102 index = dart.notNull(index) + 1;
2537 if (index == uri.length) { 2103 if (index == uri.length) {
2538 char = EOI; 2104 char = EOI;
2539 state = NOT_IN_PATH; 2105 state = NOT_IN_PATH;
2540 } else { 2106 } else {
2541 char = uri.codeUnitAt(index); 2107 char = uri[dartx.codeUnitAt](index);
2542 if (char == Uri._SLASH) { 2108 if (char == Uri._SLASH) {
2543 index = dart.notNull(index) + 1; 2109 index = dart.notNull(index) + 1;
2544 parseAuth(); 2110 parseAuth();
2545 pathStart = index; 2111 pathStart = index;
2546 } 2112 }
2547 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN || char == EOI) { 2113 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN || char == EOI) {
2548 state = NOT_IN_PATH; 2114 state = NOT_IN_PATH;
2549 } else { 2115 } else {
2550 state = IN_PATH; 2116 state = IN_PATH;
2551 } 2117 }
2552 } 2118 }
2553 } 2119 }
2554 dart.assert(state == IN_PATH || state == NOT_IN_PATH); 2120 dart.assert(state == IN_PATH || state == NOT_IN_PATH);
2555 if (state == IN_PATH) { 2121 if (state == IN_PATH) {
2556 while ((index = dart.notNull(index) + 1) < dart.notNull(uri.length)) { 2122 while ((index = dart.notNull(index) + 1) < dart.notNull(uri.length)) {
2557 char = uri.codeUnitAt(index); 2123 char = uri[dartx.codeUnitAt](index);
2558 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN) { 2124 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN) {
2559 break; 2125 break;
2560 } 2126 }
2561 char = EOI; 2127 char = EOI;
2562 } 2128 }
2563 state = NOT_IN_PATH; 2129 state = NOT_IN_PATH;
2564 } 2130 }
2565 dart.assert(state == NOT_IN_PATH); 2131 dart.assert(state == NOT_IN_PATH);
2566 let isFile = scheme == "file"; 2132 let isFile = scheme == "file";
2567 let ensureLeadingSlash = host != null; 2133 let ensureLeadingSlash = host != null;
2568 path = Uri._makePath(uri, pathStart, index, null, ensureLeadingSlash, isFi le); 2134 path = Uri._makePath(uri, pathStart, index, null, ensureLeadingSlash, isFi le);
2569 if (char == Uri._QUESTION) { 2135 if (char == Uri._QUESTION) {
2570 let numberSignIndex = uri.indexOf('#', dart.notNull(index) + 1); 2136 let numberSignIndex = uri[dartx.indexOf]('#', dart.notNull(index) + 1);
2571 if (dart.notNull(numberSignIndex) < 0) { 2137 if (dart.notNull(numberSignIndex) < 0) {
2572 query = Uri._makeQuery(uri, dart.notNull(index) + 1, uri.length, null) ; 2138 query = Uri._makeQuery(uri, dart.notNull(index) + 1, uri.length, null) ;
2573 } else { 2139 } else {
2574 query = Uri._makeQuery(uri, dart.notNull(index) + 1, numberSignIndex, null); 2140 query = Uri._makeQuery(uri, dart.notNull(index) + 1, numberSignIndex, null);
2575 fragment = Uri._makeFragment(uri, dart.notNull(numberSignIndex) + 1, u ri.length); 2141 fragment = Uri._makeFragment(uri, dart.notNull(numberSignIndex) + 1, u ri.length);
2576 } 2142 }
2577 } else if (char == Uri._NUMBER_SIGN) { 2143 } else if (char == Uri._NUMBER_SIGN) {
2578 fragment = Uri._makeFragment(uri, dart.notNull(index) + 1, uri.length); 2144 fragment = Uri._makeFragment(uri, dart.notNull(index) + 1, uri.length);
2579 } 2145 }
2580 return new Uri._internal(scheme, userinfo, host, port, path, query, fragme nt); 2146 return new Uri._internal(scheme, userinfo, host, port, path, query, fragme nt);
(...skipping 24 matching lines...) Expand all
2605 let fragment = opts && 'fragment' in opts ? opts.fragment : null; 2171 let fragment = opts && 'fragment' in opts ? opts.fragment : null;
2606 scheme = Uri._makeScheme(scheme, Uri._stringOrNullLength(scheme)); 2172 scheme = Uri._makeScheme(scheme, Uri._stringOrNullLength(scheme));
2607 userInfo = Uri._makeUserInfo(userInfo, 0, Uri._stringOrNullLength(userInfo )); 2173 userInfo = Uri._makeUserInfo(userInfo, 0, Uri._stringOrNullLength(userInfo ));
2608 host = Uri._makeHost(host, 0, Uri._stringOrNullLength(host), false); 2174 host = Uri._makeHost(host, 0, Uri._stringOrNullLength(host), false);
2609 if (query == "") 2175 if (query == "")
2610 query = null; 2176 query = null;
2611 query = Uri._makeQuery(query, 0, Uri._stringOrNullLength(query), queryPara meters); 2177 query = Uri._makeQuery(query, 0, Uri._stringOrNullLength(query), queryPara meters);
2612 fragment = Uri._makeFragment(fragment, 0, Uri._stringOrNullLength(fragment )); 2178 fragment = Uri._makeFragment(fragment, 0, Uri._stringOrNullLength(fragment ));
2613 port = Uri._makePort(port, scheme); 2179 port = Uri._makePort(port, scheme);
2614 let isFile = scheme == "file"; 2180 let isFile = scheme == "file";
2615 if (host == null && (dart.notNull(userInfo.isNotEmpty) || port != null || dart.notNull(isFile))) { 2181 if (host == null && (dart.notNull(userInfo[dartx.isNotEmpty]) || port != n ull || dart.notNull(isFile))) {
2616 host = ""; 2182 host = "";
2617 } 2183 }
2618 let ensureLeadingSlash = host != null; 2184 let ensureLeadingSlash = host != null;
2619 path = Uri._makePath(path, 0, Uri._stringOrNullLength(path), pathSegments, ensureLeadingSlash, isFile); 2185 path = Uri._makePath(path, 0, Uri._stringOrNullLength(path), pathSegments, ensureLeadingSlash, isFile);
2620 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme nt); 2186 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme nt);
2621 } 2187 }
2622 static http(authority, unencodedPath, queryParameters) { 2188 static http(authority, unencodedPath, queryParameters) {
2623 if (queryParameters === void 0) 2189 if (queryParameters === void 0)
2624 queryParameters = null; 2190 queryParameters = null;
2625 return Uri._makeHttpUri("http", authority, unencodedPath, queryParameters) ; 2191 return Uri._makeHttpUri("http", authority, unencodedPath, queryParameters) ;
2626 } 2192 }
2627 static https(authority, unencodedPath, queryParameters) { 2193 static https(authority, unencodedPath, queryParameters) {
2628 if (queryParameters === void 0) 2194 if (queryParameters === void 0)
2629 queryParameters = null; 2195 queryParameters = null;
2630 return Uri._makeHttpUri("https", authority, unencodedPath, queryParameters ); 2196 return Uri._makeHttpUri("https", authority, unencodedPath, queryParameters );
2631 } 2197 }
2632 static _makeHttpUri(scheme, authority, unencodedPath, queryParameters) { 2198 static _makeHttpUri(scheme, authority, unencodedPath, queryParameters) {
2633 let userInfo = ""; 2199 let userInfo = "";
2634 let host = null; 2200 let host = null;
2635 let port = null; 2201 let port = null;
2636 if (authority != null && dart.notNull(authority.isNotEmpty)) { 2202 if (authority != null && dart.notNull(authority[dartx.isNotEmpty])) {
2637 let hostStart = 0; 2203 let hostStart = 0;
2638 let hasUserInfo = false; 2204 let hasUserInfo = false;
2639 for (let i = 0; dart.notNull(i) < dart.notNull(authority.length); i = da rt.notNull(i) + 1) { 2205 for (let i = 0; dart.notNull(i) < dart.notNull(authority.length); i = da rt.notNull(i) + 1) {
2640 if (authority.codeUnitAt(i) == Uri._AT_SIGN) { 2206 if (authority[dartx.codeUnitAt](i) == Uri._AT_SIGN) {
2641 hasUserInfo = true; 2207 hasUserInfo = true;
2642 userInfo = authority.substring(0, i); 2208 userInfo = authority[dartx.substring](0, i);
2643 hostStart = dart.notNull(i) + 1; 2209 hostStart = dart.notNull(i) + 1;
2644 break; 2210 break;
2645 } 2211 }
2646 } 2212 }
2647 let hostEnd = hostStart; 2213 let hostEnd = hostStart;
2648 if (dart.notNull(hostStart) < dart.notNull(authority.length) && authorit y.codeUnitAt(hostStart) == Uri._LEFT_BRACKET) { 2214 if (dart.notNull(hostStart) < dart.notNull(authority.length) && authorit y[dartx.codeUnitAt](hostStart) == Uri._LEFT_BRACKET) {
2649 for (; dart.notNull(hostEnd) < dart.notNull(authority.length); hostEnd = dart.notNull(hostEnd) + 1) { 2215 for (; dart.notNull(hostEnd) < dart.notNull(authority.length); hostEnd = dart.notNull(hostEnd) + 1) {
2650 if (authority.codeUnitAt(hostEnd) == Uri._RIGHT_BRACKET) 2216 if (authority[dartx.codeUnitAt](hostEnd) == Uri._RIGHT_BRACKET)
2651 break; 2217 break;
2652 } 2218 }
2653 if (hostEnd == authority.length) { 2219 if (hostEnd == authority.length) {
2654 throw new FormatException("Invalid IPv6 host entry.", authority, hos tStart); 2220 throw new FormatException("Invalid IPv6 host entry.", authority, hos tStart);
2655 } 2221 }
2656 Uri.parseIPv6Address(authority, dart.notNull(hostStart) + 1, hostEnd); 2222 Uri.parseIPv6Address(authority, dart.notNull(hostStart) + 1, hostEnd);
2657 hostEnd = dart.notNull(hostEnd) + 1; 2223 hostEnd = dart.notNull(hostEnd) + 1;
2658 if (hostEnd != authority.length && authority.codeUnitAt(hostEnd) != Ur i._COLON) { 2224 if (hostEnd != authority.length && authority[dartx.codeUnitAt](hostEnd ) != Uri._COLON) {
2659 throw new FormatException("Invalid end of authority", authority, hos tEnd); 2225 throw new FormatException("Invalid end of authority", authority, hos tEnd);
2660 } 2226 }
2661 } 2227 }
2662 let hasPort = false; 2228 let hasPort = false;
2663 for (; dart.notNull(hostEnd) < dart.notNull(authority.length); hostEnd = dart.notNull(hostEnd) + 1) { 2229 for (; dart.notNull(hostEnd) < dart.notNull(authority.length); hostEnd = dart.notNull(hostEnd) + 1) {
2664 if (authority.codeUnitAt(hostEnd) == Uri._COLON) { 2230 if (authority[dartx.codeUnitAt](hostEnd) == Uri._COLON) {
2665 let portString = authority.substring(dart.notNull(hostEnd) + 1); 2231 let portString = authority[dartx.substring](dart.notNull(hostEnd) + 1);
2666 if (portString.isNotEmpty) 2232 if (portString[dartx.isNotEmpty])
2667 port = int.parse(portString); 2233 port = int.parse(portString);
2668 break; 2234 break;
2669 } 2235 }
2670 } 2236 }
2671 host = authority.substring(hostStart, hostEnd); 2237 host = authority[dartx.substring](hostStart, hostEnd);
2672 } 2238 }
2673 return Uri.new({scheme: scheme, userInfo: userInfo, host: dart.as(host, St ring), port: dart.as(port, int), pathSegments: unencodedPath.split("/"), queryPa rameters: queryParameters}); 2239 return Uri.new({scheme: scheme, userInfo: userInfo, host: dart.as(host, St ring), port: dart.as(port, int), pathSegments: unencodedPath[dartx.split]("/"), queryParameters: queryParameters});
2674 } 2240 }
2675 static file(path, opts) { 2241 static file(path, opts) {
2676 let windows = opts && 'windows' in opts ? opts.windows : null; 2242 let windows = opts && 'windows' in opts ? opts.windows : null;
2677 windows = windows == null ? Uri._isWindows : windows; 2243 windows = windows == null ? Uri._isWindows : windows;
2678 return windows ? dart.as(Uri._makeWindowsFileUrl(path), Uri) : dart.as(Uri ._makeFileUri(path), Uri); 2244 return windows ? dart.as(Uri._makeWindowsFileUrl(path), Uri) : dart.as(Uri ._makeFileUri(path), Uri);
2679 } 2245 }
2680 static get base() { 2246 static get base() {
2681 let uri = _js_helper.Primitives.currentUri(); 2247 let uri = _js_helper.Primitives.currentUri();
2682 if (uri != null) 2248 if (uri != null)
2683 return Uri.parse(uri); 2249 return Uri.parse(uri);
2684 throw new UnsupportedError("'Uri.base' is not supported"); 2250 throw new UnsupportedError("'Uri.base' is not supported");
2685 } 2251 }
2686 static get _isWindows() { 2252 static get _isWindows() {
2687 return false; 2253 return false;
2688 } 2254 }
2689 static _checkNonWindowsPathReservedCharacters(segments, argumentError) { 2255 static _checkNonWindowsPathReservedCharacters(segments, argumentError) {
2690 segments[$forEach](dart.fn(segment => { 2256 segments[dartx.forEach](dart.fn(segment => {
2691 if (dart.dsend(segment, 'contains', "/")) { 2257 if (dart.dsend(segment, 'contains', "/")) {
2692 if (argumentError) { 2258 if (argumentError) {
2693 throw new ArgumentError(`Illegal path character ${segment}`); 2259 throw new ArgumentError(`Illegal path character ${segment}`);
2694 } else { 2260 } else {
2695 throw new UnsupportedError(`Illegal path character ${segment}`); 2261 throw new UnsupportedError(`Illegal path character ${segment}`);
2696 } 2262 }
2697 } 2263 }
2698 })); 2264 }));
2699 } 2265 }
2700 static _checkWindowsPathReservedCharacters(segments, argumentError, firstSeg ment) { 2266 static _checkWindowsPathReservedCharacters(segments, argumentError, firstSeg ment) {
2701 if (firstSegment === void 0) 2267 if (firstSegment === void 0)
2702 firstSegment = 0; 2268 firstSegment = 0;
2703 segments[$skip](firstSegment)[$forEach](dart.fn(segment => { 2269 segments[dartx.skip](firstSegment)[dartx.forEach](dart.fn(segment => {
2704 if (dart.dsend(segment, 'contains', RegExp.new('["*/:<>?\\\\|]'))) { 2270 if (dart.dsend(segment, 'contains', RegExp.new('["*/:<>?\\\\|]'))) {
2705 if (argumentError) { 2271 if (argumentError) {
2706 throw new ArgumentError("Illegal character in path"); 2272 throw new ArgumentError("Illegal character in path");
2707 } else { 2273 } else {
2708 throw new UnsupportedError("Illegal character in path"); 2274 throw new UnsupportedError("Illegal character in path");
2709 } 2275 }
2710 } 2276 }
2711 })); 2277 }));
2712 } 2278 }
2713 static _checkWindowsDriveLetter(charCode, argumentError) { 2279 static _checkWindowsDriveLetter(charCode, argumentError) {
2714 if (dart.notNull(Uri._UPPER_CASE_A) <= dart.notNull(charCode) && dart.notN ull(charCode) <= dart.notNull(Uri._UPPER_CASE_Z) || dart.notNull(Uri._LOWER_CASE _A) <= dart.notNull(charCode) && dart.notNull(charCode) <= dart.notNull(Uri._LOW ER_CASE_Z)) { 2280 if (dart.notNull(Uri._UPPER_CASE_A) <= dart.notNull(charCode) && dart.notN ull(charCode) <= dart.notNull(Uri._UPPER_CASE_Z) || dart.notNull(Uri._LOWER_CASE _A) <= dart.notNull(charCode) && dart.notNull(charCode) <= dart.notNull(Uri._LOW ER_CASE_Z)) {
2715 return; 2281 return;
2716 } 2282 }
2717 if (argumentError) { 2283 if (argumentError) {
2718 throw new ArgumentError("Illegal drive letter " + dart.notNull(String.fr omCharCode(charCode))); 2284 throw new ArgumentError("Illegal drive letter " + dart.notNull(String.fr omCharCode(charCode)));
2719 } else { 2285 } else {
2720 throw new UnsupportedError("Illegal drive letter " + dart.notNull(String .fromCharCode(charCode))); 2286 throw new UnsupportedError("Illegal drive letter " + dart.notNull(String .fromCharCode(charCode)));
2721 } 2287 }
2722 } 2288 }
2723 static _makeFileUri(path) { 2289 static _makeFileUri(path) {
2724 let sep = "/"; 2290 let sep = "/";
2725 if (path.startsWith(sep)) { 2291 if (path[dartx.startsWith](sep)) {
2726 return Uri.new({scheme: "file", pathSegments: path.split(sep)}); 2292 return Uri.new({scheme: "file", pathSegments: path[dartx.split](sep)});
2727 } else { 2293 } else {
2728 return Uri.new({pathSegments: path.split(sep)}); 2294 return Uri.new({pathSegments: path[dartx.split](sep)});
2729 } 2295 }
2730 } 2296 }
2731 static _makeWindowsFileUrl(path) { 2297 static _makeWindowsFileUrl(path) {
2732 if (path.startsWith("\\\\?\\")) { 2298 if (path[dartx.startsWith]("\\\\?\\")) {
2733 if (path.startsWith("\\\\?\\UNC\\")) { 2299 if (path[dartx.startsWith]("\\\\?\\UNC\\")) {
2734 path = `\\${path.substring(7)}`; 2300 path = `\\${path[dartx.substring](7)}`;
2735 } else { 2301 } else {
2736 path = path.substring(4); 2302 path = path[dartx.substring](4);
2737 if (dart.notNull(path.length) < 3 || path.codeUnitAt(1) != Uri._COLON || path.codeUnitAt(2) != Uri._BACKSLASH) { 2303 if (dart.notNull(path.length) < 3 || path[dartx.codeUnitAt](1) != Uri. _COLON || path[dartx.codeUnitAt](2) != Uri._BACKSLASH) {
2738 throw new ArgumentError("Windows paths with \\\\?\\ prefix must be a bsolute"); 2304 throw new ArgumentError("Windows paths with \\\\?\\ prefix must be a bsolute");
2739 } 2305 }
2740 } 2306 }
2741 } else { 2307 } else {
2742 path = path.replaceAll("/", "\\"); 2308 path = path[dartx.replaceAll]("/", "\\");
2743 } 2309 }
2744 let sep = "\\"; 2310 let sep = "\\";
2745 if (dart.notNull(path.length) > 1 && path.get(1) == ":") { 2311 if (dart.notNull(path.length) > 1 && path[dartx.get](1) == ":") {
2746 Uri._checkWindowsDriveLetter(path.codeUnitAt(0), true); 2312 Uri._checkWindowsDriveLetter(path[dartx.codeUnitAt](0), true);
2747 if (path.length == 2 || path.codeUnitAt(2) != Uri._BACKSLASH) { 2313 if (path.length == 2 || path[dartx.codeUnitAt](2) != Uri._BACKSLASH) {
2748 throw new ArgumentError("Windows paths with drive letter must be absol ute"); 2314 throw new ArgumentError("Windows paths with drive letter must be absol ute");
2749 } 2315 }
2750 let pathSegments = path.split(sep); 2316 let pathSegments = path[dartx.split](sep);
2751 Uri._checkWindowsPathReservedCharacters(pathSegments, true, 1); 2317 Uri._checkWindowsPathReservedCharacters(pathSegments, true, 1);
2752 return Uri.new({scheme: "file", pathSegments: pathSegments}); 2318 return Uri.new({scheme: "file", pathSegments: pathSegments});
2753 } 2319 }
2754 if (dart.notNull(path.length) > 0 && path.get(0) == sep) { 2320 if (dart.notNull(path.length) > 0 && path[dartx.get](0) == sep) {
2755 if (dart.notNull(path.length) > 1 && path.get(1) == sep) { 2321 if (dart.notNull(path.length) > 1 && path[dartx.get](1) == sep) {
2756 let pathStart = path.indexOf("\\", 2); 2322 let pathStart = path[dartx.indexOf]("\\", 2);
2757 let hostPart = pathStart == -1 ? path.substring(2) : path.substring(2, pathStart); 2323 let hostPart = pathStart == -1 ? path[dartx.substring](2) : path[dartx .substring](2, pathStart);
2758 let pathPart = pathStart == -1 ? "" : path.substring(dart.notNull(path Start) + 1); 2324 let pathPart = pathStart == -1 ? "" : path[dartx.substring](dart.notNu ll(pathStart) + 1);
2759 let pathSegments = pathPart.split(sep); 2325 let pathSegments = pathPart[dartx.split](sep);
2760 Uri._checkWindowsPathReservedCharacters(pathSegments, true); 2326 Uri._checkWindowsPathReservedCharacters(pathSegments, true);
2761 return Uri.new({scheme: "file", host: hostPart, pathSegments: pathSegm ents}); 2327 return Uri.new({scheme: "file", host: hostPart, pathSegments: pathSegm ents});
2762 } else { 2328 } else {
2763 let pathSegments = path.split(sep); 2329 let pathSegments = path[dartx.split](sep);
2764 Uri._checkWindowsPathReservedCharacters(pathSegments, true); 2330 Uri._checkWindowsPathReservedCharacters(pathSegments, true);
2765 return Uri.new({scheme: "file", pathSegments: pathSegments}); 2331 return Uri.new({scheme: "file", pathSegments: pathSegments});
2766 } 2332 }
2767 } else { 2333 } else {
2768 let pathSegments = path.split(sep); 2334 let pathSegments = path[dartx.split](sep);
2769 Uri._checkWindowsPathReservedCharacters(pathSegments, true); 2335 Uri._checkWindowsPathReservedCharacters(pathSegments, true);
2770 return Uri.new({pathSegments: pathSegments}); 2336 return Uri.new({pathSegments: pathSegments});
2771 } 2337 }
2772 } 2338 }
2773 replace(opts) { 2339 replace(opts) {
2774 let scheme = opts && 'scheme' in opts ? opts.scheme : null; 2340 let scheme = opts && 'scheme' in opts ? opts.scheme : null;
2775 let userInfo = opts && 'userInfo' in opts ? opts.userInfo : null; 2341 let userInfo = opts && 'userInfo' in opts ? opts.userInfo : null;
2776 let host = opts && 'host' in opts ? opts.host : null; 2342 let host = opts && 'host' in opts ? opts.host : null;
2777 let port = opts && 'port' in opts ? opts.port : null; 2343 let port = opts && 'port' in opts ? opts.port : null;
2778 let path = opts && 'path' in opts ? opts.path : null; 2344 let path = opts && 'path' in opts ? opts.path : null;
(...skipping 19 matching lines...) Expand all
2798 } else { 2364 } else {
2799 port = this[_port]; 2365 port = this[_port];
2800 if (schemeChanged) { 2366 if (schemeChanged) {
2801 port = Uri._makePort(port, scheme); 2367 port = Uri._makePort(port, scheme);
2802 } 2368 }
2803 } 2369 }
2804 if (host != null) { 2370 if (host != null) {
2805 host = Uri._makeHost(host, 0, host.length, false); 2371 host = Uri._makeHost(host, 0, host.length, false);
2806 } else if (this.hasAuthority) { 2372 } else if (this.hasAuthority) {
2807 host = this.host; 2373 host = this.host;
2808 } else if (dart.notNull(userInfo.isNotEmpty) || port != null || dart.notNu ll(isFile)) { 2374 } else if (dart.notNull(userInfo[dartx.isNotEmpty]) || port != null || dar t.notNull(isFile)) {
2809 host = ""; 2375 host = "";
2810 } 2376 }
2811 let ensureLeadingSlash = host != null; 2377 let ensureLeadingSlash = host != null;
2812 if (path != null || dart.notNull(pathSegments != null)) { 2378 if (path != null || dart.notNull(pathSegments != null)) {
2813 path = Uri._makePath(path, 0, Uri._stringOrNullLength(path), pathSegment s, ensureLeadingSlash, isFile); 2379 path = Uri._makePath(path, 0, Uri._stringOrNullLength(path), pathSegment s, ensureLeadingSlash, isFile);
2814 } else { 2380 } else {
2815 path = this.path; 2381 path = this.path;
2816 if ((dart.notNull(isFile) || dart.notNull(ensureLeadingSlash) && !dart.n otNull(path.isEmpty)) && !dart.notNull(path.startsWith('/'))) { 2382 if ((dart.notNull(isFile) || dart.notNull(ensureLeadingSlash) && !dart.n otNull(path[dartx.isEmpty])) && !dart.notNull(path[dartx.startsWith]('/'))) {
2817 path = `/${path}`; 2383 path = `/${path}`;
2818 } 2384 }
2819 } 2385 }
2820 if (query != null || dart.notNull(queryParameters != null)) { 2386 if (query != null || dart.notNull(queryParameters != null)) {
2821 query = Uri._makeQuery(query, 0, Uri._stringOrNullLength(query), queryPa rameters); 2387 query = Uri._makeQuery(query, 0, Uri._stringOrNullLength(query), queryPa rameters);
2822 } else if (this.hasQuery) { 2388 } else if (this.hasQuery) {
2823 query = this.query; 2389 query = this.query;
2824 } 2390 }
2825 if (fragment != null) { 2391 if (fragment != null) {
2826 fragment = Uri._makeFragment(fragment, 0, fragment.length); 2392 fragment = Uri._makeFragment(fragment, 0, fragment.length);
2827 } else if (this.hasFragment) { 2393 } else if (this.hasFragment) {
2828 fragment = this.fragment; 2394 fragment = this.fragment;
2829 } 2395 }
2830 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme nt); 2396 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme nt);
2831 } 2397 }
2832 get pathSegments() { 2398 get pathSegments() {
2833 if (this[_pathSegments] == null) { 2399 if (this[_pathSegments] == null) {
2834 let pathToSplit = !dart.notNull(this.path.isEmpty) && this.path.codeUnit At(0) == Uri._SLASH ? this.path.substring(1) : this.path; 2400 let pathToSplit = !dart.notNull(this.path[dartx.isEmpty]) && this.path[d artx.codeUnitAt](0) == Uri._SLASH ? this.path[dartx.substring](1) : this.path;
2835 this[_pathSegments] = new (collection.UnmodifiableListView$(String))(pat hToSplit == "" ? dart.const(dart.setType([], List$(String))) : List$(String).fro m(pathToSplit.split("/")[$map](Uri.decodeComponent), {growable: false})); 2401 this[_pathSegments] = new (collection.UnmodifiableListView$(String))(pat hToSplit == "" ? dart.const(dart.list([], String)) : List$(String).from(pathToSp lit[dartx.split]("/")[dartx.map](Uri.decodeComponent), {growable: false}));
2836 } 2402 }
2837 return this[_pathSegments]; 2403 return this[_pathSegments];
2838 } 2404 }
2839 get queryParameters() { 2405 get queryParameters() {
2840 if (this[_queryParameters] == null) { 2406 if (this[_queryParameters] == null) {
2841 this[_queryParameters] = new (collection.UnmodifiableMapView$(String, St ring))(Uri.splitQueryString(this.query)); 2407 this[_queryParameters] = new (collection.UnmodifiableMapView$(String, St ring))(Uri.splitQueryString(this.query));
2842 } 2408 }
2843 return this[_queryParameters]; 2409 return this[_queryParameters];
2844 } 2410 }
2845 static _makePort(port, scheme) { 2411 static _makePort(port, scheme) {
2846 if (port != null && port == Uri._defaultPort(scheme)) 2412 if (port != null && port == Uri._defaultPort(scheme))
2847 return null; 2413 return null;
2848 return port; 2414 return port;
2849 } 2415 }
2850 static _makeHost(host, start, end, strictIPv6) { 2416 static _makeHost(host, start, end, strictIPv6) {
2851 if (host == null) 2417 if (host == null)
2852 return null; 2418 return null;
2853 if (start == end) 2419 if (start == end)
2854 return ""; 2420 return "";
2855 if (host.codeUnitAt(start) == Uri._LEFT_BRACKET) { 2421 if (host[dartx.codeUnitAt](start) == Uri._LEFT_BRACKET) {
2856 if (host.codeUnitAt(dart.notNull(end) - 1) != Uri._RIGHT_BRACKET) { 2422 if (host[dartx.codeUnitAt](dart.notNull(end) - 1) != Uri._RIGHT_BRACKET) {
2857 Uri._fail(host, start, 'Missing end `]` to match `[` in host'); 2423 Uri._fail(host, start, 'Missing end `]` to match `[` in host');
2858 } 2424 }
2859 Uri.parseIPv6Address(host, dart.notNull(start) + 1, dart.notNull(end) - 1); 2425 Uri.parseIPv6Address(host, dart.notNull(start) + 1, dart.notNull(end) - 1);
2860 return host.substring(start, end).toLowerCase(); 2426 return host[dartx.substring](start, end)[dartx.toLowerCase]();
2861 } 2427 }
2862 if (!dart.notNull(strictIPv6)) { 2428 if (!dart.notNull(strictIPv6)) {
2863 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul l(i) + 1) { 2429 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul l(i) + 1) {
2864 if (host.codeUnitAt(i) == Uri._COLON) { 2430 if (host[dartx.codeUnitAt](i) == Uri._COLON) {
2865 Uri.parseIPv6Address(host, start, end); 2431 Uri.parseIPv6Address(host, start, end);
2866 return `[${host}]`; 2432 return `[${host}]`;
2867 } 2433 }
2868 } 2434 }
2869 } 2435 }
2870 return Uri._normalizeRegName(host, start, end); 2436 return Uri._normalizeRegName(host, start, end);
2871 } 2437 }
2872 static _isRegNameChar(char) { 2438 static _isRegNameChar(char) {
2873 return dart.notNull(char) < 127 && dart.notNull(!dart.equals(dart.dsend(Ur i._regNameTable[$get](dart.notNull(char) >> 4), '&', 1 << (dart.notNull(char) & 15)), 0)); 2439 return dart.notNull(char) < 127 && dart.notNull(!dart.equals(dart.dsend(Ur i._regNameTable[dartx.get](dart.notNull(char) >> 4), '&', 1 << (dart.notNull(cha r) & 15)), 0));
2874 } 2440 }
2875 static _normalizeRegName(host, start, end) { 2441 static _normalizeRegName(host, start, end) {
2876 let buffer = null; 2442 let buffer = null;
2877 let sectionStart = start; 2443 let sectionStart = start;
2878 let index = start; 2444 let index = start;
2879 let isNormalized = true; 2445 let isNormalized = true;
2880 while (dart.notNull(index) < dart.notNull(end)) { 2446 while (dart.notNull(index) < dart.notNull(end)) {
2881 let char = host.codeUnitAt(index); 2447 let char = host[dartx.codeUnitAt](index);
2882 if (char == Uri._PERCENT) { 2448 if (char == Uri._PERCENT) {
2883 let replacement = Uri._normalizeEscape(host, index, true); 2449 let replacement = Uri._normalizeEscape(host, index, true);
2884 if (replacement == null && dart.notNull(isNormalized)) { 2450 if (replacement == null && dart.notNull(isNormalized)) {
2885 index = dart.notNull(index) + 3; 2451 index = dart.notNull(index) + 3;
2886 continue; 2452 continue;
2887 } 2453 }
2888 if (buffer == null) 2454 if (buffer == null)
2889 buffer = new StringBuffer(); 2455 buffer = new StringBuffer();
2890 let slice = host.substring(sectionStart, index); 2456 let slice = host[dartx.substring](sectionStart, index);
2891 if (!dart.notNull(isNormalized)) 2457 if (!dart.notNull(isNormalized))
2892 slice = slice.toLowerCase(); 2458 slice = slice[dartx.toLowerCase]();
2893 buffer.write(slice); 2459 buffer.write(slice);
2894 let sourceLength = 3; 2460 let sourceLength = 3;
2895 if (replacement == null) { 2461 if (replacement == null) {
2896 replacement = host.substring(index, dart.notNull(index) + 3); 2462 replacement = host[dartx.substring](index, dart.notNull(index) + 3);
2897 } else if (replacement == "%") { 2463 } else if (replacement == "%") {
2898 replacement = "%25"; 2464 replacement = "%25";
2899 sourceLength = 1; 2465 sourceLength = 1;
2900 } 2466 }
2901 buffer.write(replacement); 2467 buffer.write(replacement);
2902 index = dart.notNull(index) + dart.notNull(sourceLength); 2468 index = dart.notNull(index) + dart.notNull(sourceLength);
2903 sectionStart = index; 2469 sectionStart = index;
2904 isNormalized = true; 2470 isNormalized = true;
2905 } else if (Uri._isRegNameChar(char)) { 2471 } else if (Uri._isRegNameChar(char)) {
2906 if (dart.notNull(isNormalized) && dart.notNull(Uri._UPPER_CASE_A) <= d art.notNull(char) && dart.notNull(Uri._UPPER_CASE_Z) >= dart.notNull(char)) { 2472 if (dart.notNull(isNormalized) && dart.notNull(Uri._UPPER_CASE_A) <= d art.notNull(char) && dart.notNull(Uri._UPPER_CASE_Z) >= dart.notNull(char)) {
2907 if (buffer == null) 2473 if (buffer == null)
2908 buffer = new StringBuffer(); 2474 buffer = new StringBuffer();
2909 if (dart.notNull(sectionStart) < dart.notNull(index)) { 2475 if (dart.notNull(sectionStart) < dart.notNull(index)) {
2910 buffer.write(host.substring(sectionStart, index)); 2476 buffer.write(host[dartx.substring](sectionStart, index));
2911 sectionStart = index; 2477 sectionStart = index;
2912 } 2478 }
2913 isNormalized = false; 2479 isNormalized = false;
2914 } 2480 }
2915 index = dart.notNull(index) + 1; 2481 index = dart.notNull(index) + 1;
2916 } else if (Uri._isGeneralDelimiter(char)) { 2482 } else if (Uri._isGeneralDelimiter(char)) {
2917 Uri._fail(host, index, "Invalid character"); 2483 Uri._fail(host, index, "Invalid character");
2918 } else { 2484 } else {
2919 let sourceLength = 1; 2485 let sourceLength = 1;
2920 if ((dart.notNull(char) & 64512) == 55296 && dart.notNull(index) + 1 < dart.notNull(end)) { 2486 if ((dart.notNull(char) & 64512) == 55296 && dart.notNull(index) + 1 < dart.notNull(end)) {
2921 let tail = host.codeUnitAt(dart.notNull(index) + 1); 2487 let tail = host[dartx.codeUnitAt](dart.notNull(index) + 1);
2922 if ((dart.notNull(tail) & 64512) == 56320) { 2488 if ((dart.notNull(tail) & 64512) == 56320) {
2923 char = 65536 | (dart.notNull(char) & 1023) << 10 | dart.notNull(ta il) & 1023; 2489 char = 65536 | (dart.notNull(char) & 1023) << 10 | dart.notNull(ta il) & 1023;
2924 sourceLength = 2; 2490 sourceLength = 2;
2925 } 2491 }
2926 } 2492 }
2927 if (buffer == null) 2493 if (buffer == null)
2928 buffer = new StringBuffer(); 2494 buffer = new StringBuffer();
2929 let slice = host.substring(sectionStart, index); 2495 let slice = host[dartx.substring](sectionStart, index);
2930 if (!dart.notNull(isNormalized)) 2496 if (!dart.notNull(isNormalized))
2931 slice = slice.toLowerCase(); 2497 slice = slice[dartx.toLowerCase]();
2932 buffer.write(slice); 2498 buffer.write(slice);
2933 buffer.write(Uri._escapeChar(char)); 2499 buffer.write(Uri._escapeChar(char));
2934 index = dart.notNull(index) + dart.notNull(sourceLength); 2500 index = dart.notNull(index) + dart.notNull(sourceLength);
2935 sectionStart = index; 2501 sectionStart = index;
2936 } 2502 }
2937 } 2503 }
2938 if (buffer == null) 2504 if (buffer == null)
2939 return host.substring(start, end); 2505 return host[dartx.substring](start, end);
2940 if (dart.notNull(sectionStart) < dart.notNull(end)) { 2506 if (dart.notNull(sectionStart) < dart.notNull(end)) {
2941 let slice = host.substring(sectionStart, end); 2507 let slice = host[dartx.substring](sectionStart, end);
2942 if (!dart.notNull(isNormalized)) 2508 if (!dart.notNull(isNormalized))
2943 slice = slice.toLowerCase(); 2509 slice = slice[dartx.toLowerCase]();
2944 buffer.write(slice); 2510 buffer.write(slice);
2945 } 2511 }
2946 return dart.toString(buffer); 2512 return dart.toString(buffer);
2947 } 2513 }
2948 static _makeScheme(scheme, end) { 2514 static _makeScheme(scheme, end) {
2949 if (end == 0) 2515 if (end == 0)
2950 return ""; 2516 return "";
2951 let firstCodeUnit = scheme.codeUnitAt(0); 2517 let firstCodeUnit = scheme[dartx.codeUnitAt](0);
2952 if (!dart.notNull(Uri._isAlphabeticCharacter(firstCodeUnit))) { 2518 if (!dart.notNull(Uri._isAlphabeticCharacter(firstCodeUnit))) {
2953 Uri._fail(scheme, 0, "Scheme not starting with alphabetic character"); 2519 Uri._fail(scheme, 0, "Scheme not starting with alphabetic character");
2954 } 2520 }
2955 let allLowercase = dart.notNull(firstCodeUnit) >= dart.notNull(Uri._LOWER_ CASE_A); 2521 let allLowercase = dart.notNull(firstCodeUnit) >= dart.notNull(Uri._LOWER_ CASE_A);
2956 for (let i = 0; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) { 2522 for (let i = 0; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
2957 let codeUnit = scheme.codeUnitAt(i); 2523 let codeUnit = scheme[dartx.codeUnitAt](i);
2958 if (!dart.notNull(Uri._isSchemeCharacter(codeUnit))) { 2524 if (!dart.notNull(Uri._isSchemeCharacter(codeUnit))) {
2959 Uri._fail(scheme, i, "Illegal scheme character"); 2525 Uri._fail(scheme, i, "Illegal scheme character");
2960 } 2526 }
2961 if (dart.notNull(codeUnit) < dart.notNull(Uri._LOWER_CASE_A) || dart.not Null(codeUnit) > dart.notNull(Uri._LOWER_CASE_Z)) { 2527 if (dart.notNull(codeUnit) < dart.notNull(Uri._LOWER_CASE_A) || dart.not Null(codeUnit) > dart.notNull(Uri._LOWER_CASE_Z)) {
2962 allLowercase = false; 2528 allLowercase = false;
2963 } 2529 }
2964 } 2530 }
2965 scheme = scheme.substring(0, end); 2531 scheme = scheme[dartx.substring](0, end);
2966 if (!dart.notNull(allLowercase)) 2532 if (!dart.notNull(allLowercase))
2967 scheme = scheme.toLowerCase(); 2533 scheme = scheme[dartx.toLowerCase]();
2968 return scheme; 2534 return scheme;
2969 } 2535 }
2970 static _makeUserInfo(userInfo, start, end) { 2536 static _makeUserInfo(userInfo, start, end) {
2971 if (userInfo == null) 2537 if (userInfo == null)
2972 return ""; 2538 return "";
2973 return Uri._normalize(userInfo, start, end, dart.as(Uri._userinfoTable, Li st$(int))); 2539 return Uri._normalize(userInfo, start, end, dart.as(Uri._userinfoTable, Li st$(int)));
2974 } 2540 }
2975 static _makePath(path, start, end, pathSegments, ensureLeadingSlash, isFile) { 2541 static _makePath(path, start, end, pathSegments, ensureLeadingSlash, isFile) {
2976 if (path == null && dart.notNull(pathSegments == null)) 2542 if (path == null && dart.notNull(pathSegments == null))
2977 return isFile ? "/" : ""; 2543 return isFile ? "/" : "";
2978 if (path != null && dart.notNull(pathSegments != null)) { 2544 if (path != null && dart.notNull(pathSegments != null)) {
2979 throw new ArgumentError('Both path and pathSegments specified'); 2545 throw new ArgumentError('Both path and pathSegments specified');
2980 } 2546 }
2981 let result = null; 2547 let result = null;
2982 if (path != null) { 2548 if (path != null) {
2983 result = Uri._normalize(path, start, end, dart.as(Uri._pathCharOrSlashTa ble, List$(int))); 2549 result = Uri._normalize(path, start, end, dart.as(Uri._pathCharOrSlashTa ble, List$(int)));
2984 } else { 2550 } else {
2985 result = pathSegments[$map](dart.fn(s => Uri._uriEncode(dart.as(Uri._pat hCharTable, List$(int)), dart.as(s, String)), String, [Object]))[$join]("/"); 2551 result = pathSegments[dartx.map](dart.fn(s => Uri._uriEncode(dart.as(Uri ._pathCharTable, List$(int)), dart.as(s, String)), String, [Object]))[dartx.join ]("/");
2986 } 2552 }
2987 if (dart.dload(result, 'isEmpty')) { 2553 if (dart.dload(result, 'isEmpty')) {
2988 if (isFile) 2554 if (isFile)
2989 return "/"; 2555 return "/";
2990 } else if ((dart.notNull(isFile) || dart.notNull(ensureLeadingSlash)) && d art.notNull(!dart.equals(dart.dsend(result, 'codeUnitAt', 0), Uri._SLASH))) { 2556 } else if ((dart.notNull(isFile) || dart.notNull(ensureLeadingSlash)) && d art.notNull(!dart.equals(dart.dsend(result, 'codeUnitAt', 0), Uri._SLASH))) {
2991 return `/${result}`; 2557 return `/${result}`;
2992 } 2558 }
2993 return dart.as(result, String); 2559 return dart.as(result, String);
2994 } 2560 }
2995 static _makeQuery(query, start, end, queryParameters) { 2561 static _makeQuery(query, start, end, queryParameters) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
3030 return dart.notNull(Uri._LOWER_CASE_A) <= dart.notNull(char) && dart.notNu ll(Uri._LOWER_CASE_F) >= dart.notNull(char); 2596 return dart.notNull(Uri._LOWER_CASE_A) <= dart.notNull(char) && dart.notNu ll(Uri._LOWER_CASE_F) >= dart.notNull(char);
3031 } 2597 }
3032 static _hexValue(char) { 2598 static _hexValue(char) {
3033 dart.assert(Uri._isHexDigit(char)); 2599 dart.assert(Uri._isHexDigit(char));
3034 if (dart.notNull(Uri._NINE) >= dart.notNull(char)) 2600 if (dart.notNull(Uri._NINE) >= dart.notNull(char))
3035 return dart.notNull(char) - dart.notNull(Uri._ZERO); 2601 return dart.notNull(char) - dart.notNull(Uri._ZERO);
3036 char = dart.notNull(char) | 32; 2602 char = dart.notNull(char) | 32;
3037 return dart.notNull(char) - (dart.notNull(Uri._LOWER_CASE_A) - 10); 2603 return dart.notNull(char) - (dart.notNull(Uri._LOWER_CASE_A) - 10);
3038 } 2604 }
3039 static _normalizeEscape(source, index, lowerCase) { 2605 static _normalizeEscape(source, index, lowerCase) {
3040 dart.assert(source.codeUnitAt(index) == Uri._PERCENT); 2606 dart.assert(source[dartx.codeUnitAt](index) == Uri._PERCENT);
3041 if (dart.notNull(index) + 2 >= dart.notNull(source.length)) { 2607 if (dart.notNull(index) + 2 >= dart.notNull(source.length)) {
3042 return "%"; 2608 return "%";
3043 } 2609 }
3044 let firstDigit = source.codeUnitAt(dart.notNull(index) + 1); 2610 let firstDigit = source[dartx.codeUnitAt](dart.notNull(index) + 1);
3045 let secondDigit = source.codeUnitAt(dart.notNull(index) + 2); 2611 let secondDigit = source[dartx.codeUnitAt](dart.notNull(index) + 2);
3046 if (!dart.notNull(Uri._isHexDigit(firstDigit)) || !dart.notNull(Uri._isHex Digit(secondDigit))) { 2612 if (!dart.notNull(Uri._isHexDigit(firstDigit)) || !dart.notNull(Uri._isHex Digit(secondDigit))) {
3047 return "%"; 2613 return "%";
3048 } 2614 }
3049 let value = dart.notNull(Uri._hexValue(firstDigit)) * 16 + dart.notNull(Ur i._hexValue(secondDigit)); 2615 let value = dart.notNull(Uri._hexValue(firstDigit)) * 16 + dart.notNull(Ur i._hexValue(secondDigit));
3050 if (Uri._isUnreservedChar(value)) { 2616 if (Uri._isUnreservedChar(value)) {
3051 if (dart.notNull(lowerCase) && dart.notNull(Uri._UPPER_CASE_A) <= dart.n otNull(value) && dart.notNull(Uri._UPPER_CASE_Z) >= dart.notNull(value)) { 2617 if (dart.notNull(lowerCase) && dart.notNull(Uri._UPPER_CASE_A) <= dart.n otNull(value) && dart.notNull(Uri._UPPER_CASE_Z) >= dart.notNull(value)) {
3052 value = dart.notNull(value) | 32; 2618 value = dart.notNull(value) | 32;
3053 } 2619 }
3054 return String.fromCharCode(value); 2620 return String.fromCharCode(value);
3055 } 2621 }
3056 if (dart.notNull(firstDigit) >= dart.notNull(Uri._LOWER_CASE_A) || dart.no tNull(secondDigit) >= dart.notNull(Uri._LOWER_CASE_A)) { 2622 if (dart.notNull(firstDigit) >= dart.notNull(Uri._LOWER_CASE_A) || dart.no tNull(secondDigit) >= dart.notNull(Uri._LOWER_CASE_A)) {
3057 return source.substring(index, dart.notNull(index) + 3).toUpperCase(); 2623 return source[dartx.substring](index, dart.notNull(index) + 3)[dartx.toU pperCase]();
3058 } 2624 }
3059 return null; 2625 return null;
3060 } 2626 }
3061 static _isUnreservedChar(ch) { 2627 static _isUnreservedChar(ch) {
3062 return dart.notNull(ch) < 127 && dart.notNull(!dart.equals(dart.dsend(Uri. _unreservedTable[$get](dart.notNull(ch) >> 4), '&', 1 << (dart.notNull(ch) & 15) ), 0)); 2628 return dart.notNull(ch) < 127 && dart.notNull(!dart.equals(dart.dsend(Uri. _unreservedTable[dartx.get](dart.notNull(ch) >> 4), '&', 1 << (dart.notNull(ch) & 15)), 0));
3063 } 2629 }
3064 static _escapeChar(char) { 2630 static _escapeChar(char) {
3065 dart.assert(dart.dsend(char, '<=', 1114111)); 2631 dart.assert(dart.dsend(char, '<=', 1114111));
3066 let hexDigits = "0123456789ABCDEF"; 2632 let hexDigits = "0123456789ABCDEF";
3067 let codeUnits = null; 2633 let codeUnits = null;
3068 if (dart.dsend(char, '<', 128)) { 2634 if (dart.dsend(char, '<', 128)) {
3069 codeUnits = List.new(3); 2635 codeUnits = List.new(3);
3070 codeUnits[$set](0, Uri._PERCENT); 2636 codeUnits[dartx.set](0, Uri._PERCENT);
3071 codeUnits[$set](1, hexDigits.codeUnitAt(dart.as(dart.dsend(char, '>>', 4 ), int))); 2637 codeUnits[dartx.set](1, hexDigits[dartx.codeUnitAt](dart.as(dart.dsend(c har, '>>', 4), int)));
3072 codeUnits[$set](2, hexDigits.codeUnitAt(dart.as(dart.dsend(char, '&', 15 ), int))); 2638 codeUnits[dartx.set](2, hexDigits[dartx.codeUnitAt](dart.as(dart.dsend(c har, '&', 15), int)));
3073 } else { 2639 } else {
3074 let flag = 192; 2640 let flag = 192;
3075 let encodedBytes = 2; 2641 let encodedBytes = 2;
3076 if (dart.dsend(char, '>', 2047)) { 2642 if (dart.dsend(char, '>', 2047)) {
3077 flag = 224; 2643 flag = 224;
3078 encodedBytes = 3; 2644 encodedBytes = 3;
3079 if (dart.dsend(char, '>', 65535)) { 2645 if (dart.dsend(char, '>', 65535)) {
3080 encodedBytes = 4; 2646 encodedBytes = 4;
3081 flag = 240; 2647 flag = 240;
3082 } 2648 }
3083 } 2649 }
3084 codeUnits = List.new(3 * dart.notNull(encodedBytes)); 2650 codeUnits = List.new(3 * dart.notNull(encodedBytes));
3085 let index = 0; 2651 let index = 0;
3086 while ((encodedBytes = dart.notNull(encodedBytes) - 1) >= 0) { 2652 while ((encodedBytes = dart.notNull(encodedBytes) - 1) >= 0) {
3087 let byte = dart.as(dart.dsend(dart.dsend(dart.dsend(char, '>>', 6 * da rt.notNull(encodedBytes)), '&', 63), '|', flag), int); 2653 let byte = dart.as(dart.dsend(dart.dsend(dart.dsend(char, '>>', 6 * da rt.notNull(encodedBytes)), '&', 63), '|', flag), int);
3088 codeUnits[$set](index, Uri._PERCENT); 2654 codeUnits[dartx.set](index, Uri._PERCENT);
3089 codeUnits[$set](dart.notNull(index) + 1, hexDigits.codeUnitAt(dart.not Null(byte) >> 4)); 2655 codeUnits[dartx.set](dart.notNull(index) + 1, hexDigits[dartx.codeUnit At](dart.notNull(byte) >> 4));
3090 codeUnits[$set](dart.notNull(index) + 2, hexDigits.codeUnitAt(dart.not Null(byte) & 15)); 2656 codeUnits[dartx.set](dart.notNull(index) + 2, hexDigits[dartx.codeUnit At](dart.notNull(byte) & 15));
3091 index = dart.notNull(index) + 3; 2657 index = dart.notNull(index) + 3;
3092 flag = 128; 2658 flag = 128;
3093 } 2659 }
3094 } 2660 }
3095 return String.fromCharCodes(dart.as(codeUnits, Iterable$(int))); 2661 return String.fromCharCodes(dart.as(codeUnits, Iterable$(int)));
3096 } 2662 }
3097 static _normalize(component, start, end, charTable) { 2663 static _normalize(component, start, end, charTable) {
3098 let buffer = null; 2664 let buffer = null;
3099 let sectionStart = start; 2665 let sectionStart = start;
3100 let index = start; 2666 let index = start;
3101 while (dart.notNull(index) < dart.notNull(end)) { 2667 while (dart.notNull(index) < dart.notNull(end)) {
3102 let char = component.codeUnitAt(index); 2668 let char = component[dartx.codeUnitAt](index);
3103 if (dart.notNull(char) < 127 && (dart.notNull(charTable[$get](dart.notNu ll(char) >> 4)) & 1 << (dart.notNull(char) & 15)) != 0) { 2669 if (dart.notNull(char) < 127 && (dart.notNull(charTable[dartx.get](dart. notNull(char) >> 4)) & 1 << (dart.notNull(char) & 15)) != 0) {
3104 index = dart.notNull(index) + 1; 2670 index = dart.notNull(index) + 1;
3105 } else { 2671 } else {
3106 let replacement = null; 2672 let replacement = null;
3107 let sourceLength = null; 2673 let sourceLength = null;
3108 if (char == Uri._PERCENT) { 2674 if (char == Uri._PERCENT) {
3109 replacement = Uri._normalizeEscape(component, index, false); 2675 replacement = Uri._normalizeEscape(component, index, false);
3110 if (replacement == null) { 2676 if (replacement == null) {
3111 index = dart.notNull(index) + 3; 2677 index = dart.notNull(index) + 3;
3112 continue; 2678 continue;
3113 } 2679 }
3114 if ("%" == replacement) { 2680 if ("%" == replacement) {
3115 replacement = "%25"; 2681 replacement = "%25";
3116 sourceLength = 1; 2682 sourceLength = 1;
3117 } else { 2683 } else {
3118 sourceLength = 3; 2684 sourceLength = 3;
3119 } 2685 }
3120 } else if (Uri._isGeneralDelimiter(char)) { 2686 } else if (Uri._isGeneralDelimiter(char)) {
3121 Uri._fail(component, index, "Invalid character"); 2687 Uri._fail(component, index, "Invalid character");
3122 } else { 2688 } else {
3123 sourceLength = 1; 2689 sourceLength = 1;
3124 if ((dart.notNull(char) & 64512) == 55296) { 2690 if ((dart.notNull(char) & 64512) == 55296) {
3125 if (dart.notNull(index) + 1 < dart.notNull(end)) { 2691 if (dart.notNull(index) + 1 < dart.notNull(end)) {
3126 let tail = component.codeUnitAt(dart.notNull(index) + 1); 2692 let tail = component[dartx.codeUnitAt](dart.notNull(index) + 1);
3127 if ((dart.notNull(tail) & 64512) == 56320) { 2693 if ((dart.notNull(tail) & 64512) == 56320) {
3128 sourceLength = 2; 2694 sourceLength = 2;
3129 char = 65536 | (dart.notNull(char) & 1023) << 10 | dart.notNul l(tail) & 1023; 2695 char = 65536 | (dart.notNull(char) & 1023) << 10 | dart.notNul l(tail) & 1023;
3130 } 2696 }
3131 } 2697 }
3132 } 2698 }
3133 replacement = Uri._escapeChar(char); 2699 replacement = Uri._escapeChar(char);
3134 } 2700 }
3135 if (buffer == null) 2701 if (buffer == null)
3136 buffer = new StringBuffer(); 2702 buffer = new StringBuffer();
3137 buffer.write(component.substring(sectionStart, index)); 2703 buffer.write(component[dartx.substring](sectionStart, index));
3138 buffer.write(replacement); 2704 buffer.write(replacement);
3139 index = dart.notNull(index) + dart.notNull(sourceLength); 2705 index = dart.notNull(index) + dart.notNull(sourceLength);
3140 sectionStart = index; 2706 sectionStart = index;
3141 } 2707 }
3142 } 2708 }
3143 if (buffer == null) { 2709 if (buffer == null) {
3144 return component.substring(start, end); 2710 return component[dartx.substring](start, end);
3145 } 2711 }
3146 if (dart.notNull(sectionStart) < dart.notNull(end)) { 2712 if (dart.notNull(sectionStart) < dart.notNull(end)) {
3147 buffer.write(component.substring(sectionStart, end)); 2713 buffer.write(component[dartx.substring](sectionStart, end));
3148 } 2714 }
3149 return dart.toString(buffer); 2715 return dart.toString(buffer);
3150 } 2716 }
3151 static _isSchemeCharacter(ch) { 2717 static _isSchemeCharacter(ch) {
3152 return dart.notNull(ch) < 128 && dart.notNull(!dart.equals(dart.dsend(Uri. _schemeTable[$get](dart.notNull(ch) >> 4), '&', 1 << (dart.notNull(ch) & 15)), 0 )); 2718 return dart.notNull(ch) < 128 && dart.notNull(!dart.equals(dart.dsend(Uri. _schemeTable[dartx.get](dart.notNull(ch) >> 4), '&', 1 << (dart.notNull(ch) & 15 )), 0));
3153 } 2719 }
3154 static _isGeneralDelimiter(ch) { 2720 static _isGeneralDelimiter(ch) {
3155 return dart.notNull(ch) <= dart.notNull(Uri._RIGHT_BRACKET) && dart.notNul l(!dart.equals(dart.dsend(Uri._genDelimitersTable[$get](dart.notNull(ch) >> 4), '&', 1 << (dart.notNull(ch) & 15)), 0)); 2721 return dart.notNull(ch) <= dart.notNull(Uri._RIGHT_BRACKET) && dart.notNul l(!dart.equals(dart.dsend(Uri._genDelimitersTable[dartx.get](dart.notNull(ch) >> 4), '&', 1 << (dart.notNull(ch) & 15)), 0));
3156 } 2722 }
3157 get isAbsolute() { 2723 get isAbsolute() {
3158 return this.scheme != "" && this.fragment == ""; 2724 return this.scheme != "" && this.fragment == "";
3159 } 2725 }
3160 [_merge](base, reference) { 2726 [_merge](base, reference) {
3161 if (base.isEmpty) 2727 if (base[dartx.isEmpty])
3162 return `/${reference}`; 2728 return `/${reference}`;
3163 let backCount = 0; 2729 let backCount = 0;
3164 let refStart = 0; 2730 let refStart = 0;
3165 while (reference.startsWith("../", refStart)) { 2731 while (reference[dartx.startsWith]("../", refStart)) {
3166 refStart = dart.notNull(refStart) + 3; 2732 refStart = dart.notNull(refStart) + 3;
3167 backCount = dart.notNull(backCount) + 1; 2733 backCount = dart.notNull(backCount) + 1;
3168 } 2734 }
3169 let baseEnd = base.lastIndexOf('/'); 2735 let baseEnd = base[dartx.lastIndexOf]('/');
3170 while (dart.notNull(baseEnd) > 0 && dart.notNull(backCount) > 0) { 2736 while (dart.notNull(baseEnd) > 0 && dart.notNull(backCount) > 0) {
3171 let newEnd = base.lastIndexOf('/', dart.notNull(baseEnd) - 1); 2737 let newEnd = base[dartx.lastIndexOf]('/', dart.notNull(baseEnd) - 1);
3172 if (dart.notNull(newEnd) < 0) { 2738 if (dart.notNull(newEnd) < 0) {
3173 break; 2739 break;
3174 } 2740 }
3175 let delta = dart.notNull(baseEnd) - dart.notNull(newEnd); 2741 let delta = dart.notNull(baseEnd) - dart.notNull(newEnd);
3176 if ((delta == 2 || delta == 3) && base.codeUnitAt(dart.notNull(newEnd) + 1) == Uri._DOT && (delta == 2 || base.codeUnitAt(dart.notNull(newEnd) + 2) == U ri._DOT)) { 2742 if ((delta == 2 || delta == 3) && base[dartx.codeUnitAt](dart.notNull(ne wEnd) + 1) == Uri._DOT && (delta == 2 || base[dartx.codeUnitAt](dart.notNull(new End) + 2) == Uri._DOT)) {
3177 break; 2743 break;
3178 } 2744 }
3179 baseEnd = newEnd; 2745 baseEnd = newEnd;
3180 backCount = dart.notNull(backCount) - 1; 2746 backCount = dart.notNull(backCount) - 1;
3181 } 2747 }
3182 return dart.notNull(base.substring(0, dart.notNull(baseEnd) + 1)) + dart.n otNull(reference.substring(dart.notNull(refStart) - 3 * dart.notNull(backCount)) ); 2748 return dart.notNull(base[dartx.substring](0, dart.notNull(baseEnd) + 1)) + dart.notNull(reference[dartx.substring](dart.notNull(refStart) - 3 * dart.notNu ll(backCount)));
3183 } 2749 }
3184 [_hasDotSegments](path) { 2750 [_hasDotSegments](path) {
3185 if (dart.notNull(path.length) > 0 && path.codeUnitAt(0) == Uri._DOT) 2751 if (dart.notNull(path.length) > 0 && path[dartx.codeUnitAt](0) == Uri._DOT )
3186 return true; 2752 return true;
3187 let index = path.indexOf("/."); 2753 let index = path[dartx.indexOf]("/.");
3188 return index != -1; 2754 return index != -1;
3189 } 2755 }
3190 [_removeDotSegments](path) { 2756 [_removeDotSegments](path) {
3191 if (!dart.notNull(this[_hasDotSegments](path))) 2757 if (!dart.notNull(this[_hasDotSegments](path)))
3192 return path; 2758 return path;
3193 let output = dart.setType([], List$(String)); 2759 let output = dart.list([], String);
3194 let appendSlash = false; 2760 let appendSlash = false;
3195 for (let segment of path.split("/")) { 2761 for (let segment of path[dartx.split]("/")) {
3196 appendSlash = false; 2762 appendSlash = false;
3197 if (segment == "..") { 2763 if (segment == "..") {
3198 if (!dart.notNull(output[$isEmpty]) && (output[$length] != 1 || output [$get](0) != "")) 2764 if (!dart.notNull(output[dartx.isEmpty]) && (output.length != 1 || out put[dartx.get](0) != ""))
3199 output[$removeLast](); 2765 output[dartx.removeLast]();
3200 appendSlash = true; 2766 appendSlash = true;
3201 } else if ("." == segment) { 2767 } else if ("." == segment) {
3202 appendSlash = true; 2768 appendSlash = true;
3203 } else { 2769 } else {
3204 output[$add](segment); 2770 output[dartx.add](segment);
3205 } 2771 }
3206 } 2772 }
3207 if (appendSlash) 2773 if (appendSlash)
3208 output[$add](""); 2774 output[dartx.add]("");
3209 return output[$join]("/"); 2775 return output[dartx.join]("/");
3210 } 2776 }
3211 resolve(reference) { 2777 resolve(reference) {
3212 return this.resolveUri(Uri.parse(reference)); 2778 return this.resolveUri(Uri.parse(reference));
3213 } 2779 }
3214 resolveUri(reference) { 2780 resolveUri(reference) {
3215 let targetScheme = null; 2781 let targetScheme = null;
3216 let targetUserInfo = ""; 2782 let targetUserInfo = "";
3217 let targetHost = null; 2783 let targetHost = null;
3218 let targetPort = null; 2784 let targetPort = null;
3219 let targetPath = null; 2785 let targetPath = null;
3220 let targetQuery = null; 2786 let targetQuery = null;
3221 if (reference.scheme.isNotEmpty) { 2787 if (reference.scheme[dartx.isNotEmpty]) {
3222 targetScheme = reference.scheme; 2788 targetScheme = reference.scheme;
3223 if (reference.hasAuthority) { 2789 if (reference.hasAuthority) {
3224 targetUserInfo = reference.userInfo; 2790 targetUserInfo = reference.userInfo;
3225 targetHost = reference.host; 2791 targetHost = reference.host;
3226 targetPort = reference.hasPort ? reference.port : null; 2792 targetPort = reference.hasPort ? reference.port : null;
3227 } 2793 }
3228 targetPath = this[_removeDotSegments](reference.path); 2794 targetPath = this[_removeDotSegments](reference.path);
3229 if (reference.hasQuery) { 2795 if (reference.hasQuery) {
3230 targetQuery = reference.query; 2796 targetQuery = reference.query;
3231 } 2797 }
3232 } else { 2798 } else {
3233 targetScheme = this.scheme; 2799 targetScheme = this.scheme;
3234 if (reference.hasAuthority) { 2800 if (reference.hasAuthority) {
3235 targetUserInfo = reference.userInfo; 2801 targetUserInfo = reference.userInfo;
3236 targetHost = reference.host; 2802 targetHost = reference.host;
3237 targetPort = Uri._makePort(reference.hasPort ? reference.port : null, targetScheme); 2803 targetPort = Uri._makePort(reference.hasPort ? reference.port : null, targetScheme);
3238 targetPath = this[_removeDotSegments](reference.path); 2804 targetPath = this[_removeDotSegments](reference.path);
3239 if (reference.hasQuery) 2805 if (reference.hasQuery)
3240 targetQuery = reference.query; 2806 targetQuery = reference.query;
3241 } else { 2807 } else {
3242 if (reference.path == "") { 2808 if (reference.path == "") {
3243 targetPath = this[_path]; 2809 targetPath = this[_path];
3244 if (reference.hasQuery) { 2810 if (reference.hasQuery) {
3245 targetQuery = reference.query; 2811 targetQuery = reference.query;
3246 } else { 2812 } else {
3247 targetQuery = this[_query]; 2813 targetQuery = this[_query];
3248 } 2814 }
3249 } else { 2815 } else {
3250 if (reference.path.startsWith("/")) { 2816 if (reference.path[dartx.startsWith]("/")) {
3251 targetPath = this[_removeDotSegments](reference.path); 2817 targetPath = this[_removeDotSegments](reference.path);
3252 } else { 2818 } else {
3253 targetPath = this[_removeDotSegments](this[_merge](this[_path], re ference.path)); 2819 targetPath = this[_removeDotSegments](this[_merge](this[_path], re ference.path));
3254 } 2820 }
3255 if (reference.hasQuery) 2821 if (reference.hasQuery)
3256 targetQuery = reference.query; 2822 targetQuery = reference.query;
3257 } 2823 }
3258 targetUserInfo = this[_userInfo]; 2824 targetUserInfo = this[_userInfo];
3259 targetHost = this[_host]; 2825 targetHost = this[_host];
3260 targetPort = this[_port]; 2826 targetPort = this[_port];
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
3308 Uri._checkNonWindowsPathReservedCharacters(this.pathSegments, false); 2874 Uri._checkNonWindowsPathReservedCharacters(this.pathSegments, false);
3309 let result = new StringBuffer(); 2875 let result = new StringBuffer();
3310 if (this[_isPathAbsolute]) 2876 if (this[_isPathAbsolute])
3311 result.write("/"); 2877 result.write("/");
3312 result.writeAll(this.pathSegments, "/"); 2878 result.writeAll(this.pathSegments, "/");
3313 return dart.toString(result); 2879 return dart.toString(result);
3314 } 2880 }
3315 [_toWindowsFilePath]() { 2881 [_toWindowsFilePath]() {
3316 let hasDriveLetter = false; 2882 let hasDriveLetter = false;
3317 let segments = this.pathSegments; 2883 let segments = this.pathSegments;
3318 if (dart.notNull(segments[$length]) > 0 && segments[$get](0).length == 2 & & segments[$get](0).codeUnitAt(1) == Uri._COLON) { 2884 if (dart.notNull(segments.length) > 0 && segments[dartx.get](0).length == 2 && segments[dartx.get](0)[dartx.codeUnitAt](1) == Uri._COLON) {
3319 Uri._checkWindowsDriveLetter(segments[$get](0).codeUnitAt(0), false); 2885 Uri._checkWindowsDriveLetter(segments[dartx.get](0)[dartx.codeUnitAt](0) , false);
3320 Uri._checkWindowsPathReservedCharacters(segments, false, 1); 2886 Uri._checkWindowsPathReservedCharacters(segments, false, 1);
3321 hasDriveLetter = true; 2887 hasDriveLetter = true;
3322 } else { 2888 } else {
3323 Uri._checkWindowsPathReservedCharacters(segments, false); 2889 Uri._checkWindowsPathReservedCharacters(segments, false);
3324 } 2890 }
3325 let result = new StringBuffer(); 2891 let result = new StringBuffer();
3326 if (dart.notNull(this[_isPathAbsolute]) && !dart.notNull(hasDriveLetter)) 2892 if (dart.notNull(this[_isPathAbsolute]) && !dart.notNull(hasDriveLetter))
3327 result.write("\\"); 2893 result.write("\\");
3328 if (this.host != "") { 2894 if (this.host != "") {
3329 result.write("\\"); 2895 result.write("\\");
3330 result.write(this.host); 2896 result.write(this.host);
3331 result.write("\\"); 2897 result.write("\\");
3332 } 2898 }
3333 result.writeAll(segments, "\\"); 2899 result.writeAll(segments, "\\");
3334 if (dart.notNull(hasDriveLetter) && segments[$length] == 1) 2900 if (dart.notNull(hasDriveLetter) && segments.length == 1)
3335 result.write("\\"); 2901 result.write("\\");
3336 return dart.toString(result); 2902 return dart.toString(result);
3337 } 2903 }
3338 get [_isPathAbsolute]() { 2904 get [_isPathAbsolute]() {
3339 if (this.path == null || dart.notNull(this.path.isEmpty)) 2905 if (this.path == null || dart.notNull(this.path[dartx.isEmpty]))
3340 return false; 2906 return false;
3341 return this.path.startsWith('/'); 2907 return this.path[dartx.startsWith]('/');
3342 } 2908 }
3343 [_writeAuthority](ss) { 2909 [_writeAuthority](ss) {
3344 if (this[_userInfo].isNotEmpty) { 2910 if (this[_userInfo][dartx.isNotEmpty]) {
3345 ss.write(this[_userInfo]); 2911 ss.write(this[_userInfo]);
3346 ss.write("@"); 2912 ss.write("@");
3347 } 2913 }
3348 if (this[_host] != null) 2914 if (this[_host] != null)
3349 ss.write(this[_host]); 2915 ss.write(this[_host]);
3350 if (this[_port] != null) { 2916 if (this[_port] != null) {
3351 ss.write(":"); 2917 ss.write(":");
3352 ss.write(this[_port]); 2918 ss.write(this[_port]);
3353 } 2919 }
3354 } 2920 }
3355 toString() { 2921 toString() {
3356 let sb = new StringBuffer(); 2922 let sb = new StringBuffer();
3357 Uri._addIfNonEmpty(sb, this.scheme, this.scheme, ':'); 2923 Uri._addIfNonEmpty(sb, this.scheme, this.scheme, ':');
3358 if (dart.notNull(this.hasAuthority) || dart.notNull(this.path.startsWith(" //")) || this.scheme == "file") { 2924 if (dart.notNull(this.hasAuthority) || dart.notNull(this.path[dartx.starts With]("//")) || this.scheme == "file") {
3359 sb.write("//"); 2925 sb.write("//");
3360 this[_writeAuthority](sb); 2926 this[_writeAuthority](sb);
3361 } 2927 }
3362 sb.write(this.path); 2928 sb.write(this.path);
3363 if (this[_query] != null) { 2929 if (this[_query] != null) {
3364 sb.write("?"); 2930 sb.write("?");
3365 sb.write(this[_query]); 2931 sb.write(this[_query]);
3366 } 2932 }
3367 if (this[_fragment] != null) { 2933 if (this[_fragment] != null) {
3368 sb.write("#"); 2934 sb.write("#");
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3404 return Uri._uriDecode(encodedComponent, {plusToSpace: true, encoding: enco ding}); 2970 return Uri._uriDecode(encodedComponent, {plusToSpace: true, encoding: enco ding});
3405 } 2971 }
3406 static encodeFull(uri) { 2972 static encodeFull(uri) {
3407 return Uri._uriEncode(dart.as(Uri._encodeFullTable, List$(int)), uri); 2973 return Uri._uriEncode(dart.as(Uri._encodeFullTable, List$(int)), uri);
3408 } 2974 }
3409 static decodeFull(uri) { 2975 static decodeFull(uri) {
3410 return Uri._uriDecode(uri); 2976 return Uri._uriDecode(uri);
3411 } 2977 }
3412 static splitQueryString(query, opts) { 2978 static splitQueryString(query, opts) {
3413 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8; 2979 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8;
3414 return dart.as(query.split("&")[$fold](dart.map(), dart.fn((map, element) => { 2980 return dart.as(query[dartx.split]("&")[dartx.fold](dart.map(), dart.fn((ma p, element) => {
3415 let index = dart.as(dart.dsend(element, 'indexOf', "="), int); 2981 let index = dart.as(dart.dsend(element, 'indexOf', "="), int);
3416 if (index == -1) { 2982 if (index == -1) {
3417 if (!dart.equals(element, "")) { 2983 if (!dart.equals(element, "")) {
3418 dart.dsetindex(map, Uri.decodeQueryComponent(dart.as(element, String ), {encoding: encoding}), ""); 2984 dart.dsetindex(map, Uri.decodeQueryComponent(dart.as(element, String ), {encoding: encoding}), "");
3419 } 2985 }
3420 } else if (index != 0) { 2986 } else if (index != 0) {
3421 let key = dart.dsend(element, 'substring', 0, index); 2987 let key = dart.dsend(element, 'substring', 0, index);
3422 let value = dart.dsend(element, 'substring', dart.notNull(index) + 1); 2988 let value = dart.dsend(element, 'substring', dart.notNull(index) + 1);
3423 dart.dsetindex(map, Uri.decodeQueryComponent(dart.as(key, String), {en coding: encoding}), Uri.decodeQueryComponent(dart.as(value, String), {encoding: encoding})); 2989 dart.dsetindex(map, Uri.decodeQueryComponent(dart.as(key, String), {en coding: encoding}), Uri.decodeQueryComponent(dart.as(value, String), {encoding: encoding}));
3424 } 2990 }
3425 return map; 2991 return map;
3426 })), Map$(String, String)); 2992 })), Map$(String, String));
3427 } 2993 }
3428 static parseIPv4Address(host) { 2994 static parseIPv4Address(host) {
3429 let error = msg => { 2995 let error = msg => {
3430 throw new FormatException(`Illegal IPv4 address, ${msg}`); 2996 throw new FormatException(`Illegal IPv4 address, ${msg}`);
3431 }; 2997 };
3432 dart.fn(error, dart.void, [String]); 2998 dart.fn(error, dart.void, [String]);
3433 let bytes = host.split('.'); 2999 let bytes = host[dartx.split]('.');
3434 if (bytes[$length] != 4) { 3000 if (bytes.length != 4) {
3435 error('IPv4 address should contain exactly 4 parts'); 3001 error('IPv4 address should contain exactly 4 parts');
3436 } 3002 }
3437 return dart.as(bytes[$map](dart.fn(byteString => { 3003 return dart.as(bytes[dartx.map](dart.fn(byteString => {
3438 let byte = int.parse(dart.as(byteString, String)); 3004 let byte = int.parse(dart.as(byteString, String));
3439 if (dart.notNull(byte) < 0 || dart.notNull(byte) > 255) { 3005 if (dart.notNull(byte) < 0 || dart.notNull(byte) > 255) {
3440 error('each part must be in the range of `0..255`'); 3006 error('each part must be in the range of `0..255`');
3441 } 3007 }
3442 return byte; 3008 return byte;
3443 }))[$toList](), List$(int)); 3009 }))[dartx.toList](), List$(int));
3444 } 3010 }
3445 static parseIPv6Address(host, start, end) { 3011 static parseIPv6Address(host, start, end) {
3446 if (start === void 0) 3012 if (start === void 0)
3447 start = 0; 3013 start = 0;
3448 if (end === void 0) 3014 if (end === void 0)
3449 end = null; 3015 end = null;
3450 if (end == null) 3016 if (end == null)
3451 end = host.length; 3017 end = host.length;
3452 let error = (msg, position) => { 3018 let error = (msg, position) => {
3453 if (position === void 0) 3019 if (position === void 0)
3454 position = null; 3020 position = null;
3455 throw new FormatException(`Illegal IPv6 address, ${msg}`, host, dart.as( position, int)); 3021 throw new FormatException(`Illegal IPv6 address, ${msg}`, host, dart.as( position, int));
3456 }; 3022 };
3457 dart.fn(error, dart.void, [String], [Object]); 3023 dart.fn(error, dart.void, [String], [Object]);
3458 let parseHex = (start, end) => { 3024 let parseHex = (start, end) => {
3459 if (dart.notNull(end) - dart.notNull(start) > 4) { 3025 if (dart.notNull(end) - dart.notNull(start) > 4) {
3460 error('an IPv6 part can only contain a maximum of 4 hex digits', start ); 3026 error('an IPv6 part can only contain a maximum of 4 hex digits', start );
3461 } 3027 }
3462 let value = int.parse(host.substring(start, end), {radix: 16}); 3028 let value = int.parse(host[dartx.substring](start, end), {radix: 16});
3463 if (dart.notNull(value) < 0 || dart.notNull(value) > (1 << 16) - 1) { 3029 if (dart.notNull(value) < 0 || dart.notNull(value) > (1 << 16) - 1) {
3464 error('each part must be in the range of `0x0..0xFFFF`', start); 3030 error('each part must be in the range of `0x0..0xFFFF`', start);
3465 } 3031 }
3466 return value; 3032 return value;
3467 }; 3033 };
3468 dart.fn(parseHex, int, [int, int]); 3034 dart.fn(parseHex, int, [int, int]);
3469 if (dart.notNull(host.length) < 2) 3035 if (dart.notNull(host.length) < 2)
3470 error('address is too short'); 3036 error('address is too short');
3471 let parts = dart.setType([], List$(int)); 3037 let parts = dart.list([], int);
3472 let wildcardSeen = false; 3038 let wildcardSeen = false;
3473 let partStart = start; 3039 let partStart = start;
3474 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) { 3040 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) {
3475 if (host.codeUnitAt(i) == Uri._COLON) { 3041 if (host[dartx.codeUnitAt](i) == Uri._COLON) {
3476 if (i == start) { 3042 if (i == start) {
3477 i = dart.notNull(i) + 1; 3043 i = dart.notNull(i) + 1;
3478 if (host.codeUnitAt(i) != Uri._COLON) { 3044 if (host[dartx.codeUnitAt](i) != Uri._COLON) {
3479 error('invalid start colon.', i); 3045 error('invalid start colon.', i);
3480 } 3046 }
3481 partStart = i; 3047 partStart = i;
3482 } 3048 }
3483 if (i == partStart) { 3049 if (i == partStart) {
3484 if (wildcardSeen) { 3050 if (wildcardSeen) {
3485 error('only one wildcard `::` is allowed', i); 3051 error('only one wildcard `::` is allowed', i);
3486 } 3052 }
3487 wildcardSeen = true; 3053 wildcardSeen = true;
3488 parts[$add](-1); 3054 parts[dartx.add](-1);
3489 } else { 3055 } else {
3490 parts[$add](parseHex(partStart, i)); 3056 parts[dartx.add](parseHex(partStart, i));
3491 } 3057 }
3492 partStart = dart.notNull(i) + 1; 3058 partStart = dart.notNull(i) + 1;
3493 } 3059 }
3494 } 3060 }
3495 if (parts[$length] == 0) 3061 if (parts.length == 0)
3496 error('too few parts'); 3062 error('too few parts');
3497 let atEnd = partStart == end; 3063 let atEnd = partStart == end;
3498 let isLastWildcard = parts[$last] == -1; 3064 let isLastWildcard = parts[dartx.last] == -1;
3499 if (dart.notNull(atEnd) && !dart.notNull(isLastWildcard)) { 3065 if (dart.notNull(atEnd) && !dart.notNull(isLastWildcard)) {
3500 error('expected a part after last `:`', end); 3066 error('expected a part after last `:`', end);
3501 } 3067 }
3502 if (!dart.notNull(atEnd)) { 3068 if (!dart.notNull(atEnd)) {
3503 try { 3069 try {
3504 parts[$add](parseHex(partStart, end)); 3070 parts[dartx.add](parseHex(partStart, end));
3505 } catch (e) { 3071 } catch (e) {
3506 try { 3072 try {
3507 let last = Uri.parseIPv4Address(host.substring(partStart, end)); 3073 let last = Uri.parseIPv4Address(host[dartx.substring](partStart, end ));
3508 parts[$add](dart.notNull(last[$get](0)) << 8 | dart.notNull(last[$ge t](1))); 3074 parts[dartx.add](dart.notNull(last[dartx.get](0)) << 8 | dart.notNul l(last[dartx.get](1)));
3509 parts[$add](dart.notNull(last[$get](2)) << 8 | dart.notNull(last[$ge t](3))); 3075 parts[dartx.add](dart.notNull(last[dartx.get](2)) << 8 | dart.notNul l(last[dartx.get](3)));
3510 } catch (e) { 3076 } catch (e) {
3511 error('invalid end of IPv6 address.', partStart); 3077 error('invalid end of IPv6 address.', partStart);
3512 } 3078 }
3513 3079
3514 } 3080 }
3515 3081
3516 } 3082 }
3517 if (wildcardSeen) { 3083 if (wildcardSeen) {
3518 if (dart.notNull(parts[$length]) > 7) { 3084 if (dart.notNull(parts.length) > 7) {
3519 error('an address with a wildcard must have less than 7 parts'); 3085 error('an address with a wildcard must have less than 7 parts');
3520 } 3086 }
3521 } else if (parts[$length] != 8) { 3087 } else if (parts.length != 8) {
3522 error('an address without a wildcard must contain exactly 8 parts'); 3088 error('an address without a wildcard must contain exactly 8 parts');
3523 } 3089 }
3524 let bytes = List$(int).new(16); 3090 let bytes = List$(int).new(16);
3525 for (let i = 0, index = 0; dart.notNull(i) < dart.notNull(parts[$length]); i = dart.notNull(i) + 1) { 3091 for (let i = 0, index = 0; dart.notNull(i) < dart.notNull(parts.length); i = dart.notNull(i) + 1) {
3526 let value = parts[$get](i); 3092 let value = parts[dartx.get](i);
3527 if (value == -1) { 3093 if (value == -1) {
3528 let wildCardLength = 9 - dart.notNull(parts[$length]); 3094 let wildCardLength = 9 - dart.notNull(parts.length);
3529 for (let j = 0; dart.notNull(j) < dart.notNull(wildCardLength); j = da rt.notNull(j) + 1) { 3095 for (let j = 0; dart.notNull(j) < dart.notNull(wildCardLength); j = da rt.notNull(j) + 1) {
3530 bytes[$set](index, 0); 3096 bytes[dartx.set](index, 0);
3531 bytes[$set](dart.notNull(index) + 1, 0); 3097 bytes[dartx.set](dart.notNull(index) + 1, 0);
3532 index = dart.notNull(index) + 2; 3098 index = dart.notNull(index) + 2;
3533 } 3099 }
3534 } else { 3100 } else {
3535 bytes[$set](index, dart.notNull(value) >> 8); 3101 bytes[dartx.set](index, dart.notNull(value) >> 8);
3536 bytes[$set](dart.notNull(index) + 1, dart.notNull(value) & 255); 3102 bytes[dartx.set](dart.notNull(index) + 1, dart.notNull(value) & 255);
3537 index = dart.notNull(index) + 2; 3103 index = dart.notNull(index) + 2;
3538 } 3104 }
3539 } 3105 }
3540 return dart.as(bytes, List$(int)); 3106 return dart.as(bytes, List$(int));
3541 } 3107 }
3542 static _uriEncode(canonicalTable, text, opts) { 3108 static _uriEncode(canonicalTable, text, opts) {
3543 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8; 3109 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8;
3544 let spaceToPlus = opts && 'spaceToPlus' in opts ? opts.spaceToPlus : false ; 3110 let spaceToPlus = opts && 'spaceToPlus' in opts ? opts.spaceToPlus : false ;
3545 let byteToHex = (byte, buffer) => { 3111 let byteToHex = (byte, buffer) => {
3546 let hex = '0123456789ABCDEF'; 3112 let hex = '0123456789ABCDEF';
3547 dart.dsend(buffer, 'writeCharCode', hex.codeUnitAt(dart.as(dart.dsend(by te, '>>', 4), int))); 3113 dart.dsend(buffer, 'writeCharCode', hex[dartx.codeUnitAt](dart.as(dart.d send(byte, '>>', 4), int)));
3548 dart.dsend(buffer, 'writeCharCode', hex.codeUnitAt(dart.as(dart.dsend(by te, '&', 15), int))); 3114 dart.dsend(buffer, 'writeCharCode', hex[dartx.codeUnitAt](dart.as(dart.d send(byte, '&', 15), int)));
3549 }; 3115 };
3550 dart.fn(byteToHex); 3116 dart.fn(byteToHex);
3551 let result = new StringBuffer(); 3117 let result = new StringBuffer();
3552 let bytes = encoding.encode(text); 3118 let bytes = encoding.encode(text);
3553 for (let i = 0; dart.notNull(i) < dart.notNull(bytes[$length]); i = dart.n otNull(i) + 1) { 3119 for (let i = 0; dart.notNull(i) < dart.notNull(bytes.length); i = dart.not Null(i) + 1) {
3554 let byte = bytes[$get](i); 3120 let byte = bytes[dartx.get](i);
3555 if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[$get](dart. notNull(byte) >> 4)) & 1 << (dart.notNull(byte) & 15)) != 0) { 3121 if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx.get]( dart.notNull(byte) >> 4)) & 1 << (dart.notNull(byte) & 15)) != 0) {
3556 result.writeCharCode(byte); 3122 result.writeCharCode(byte);
3557 } else if (dart.notNull(spaceToPlus) && byte == Uri._SPACE) { 3123 } else if (dart.notNull(spaceToPlus) && byte == Uri._SPACE) {
3558 result.writeCharCode(Uri._PLUS); 3124 result.writeCharCode(Uri._PLUS);
3559 } else { 3125 } else {
3560 result.writeCharCode(Uri._PERCENT); 3126 result.writeCharCode(Uri._PERCENT);
3561 byteToHex(byte, result); 3127 byteToHex(byte, result);
3562 } 3128 }
3563 } 3129 }
3564 return dart.toString(result); 3130 return dart.toString(result);
3565 } 3131 }
3566 static _hexCharPairToByte(s, pos) { 3132 static _hexCharPairToByte(s, pos) {
3567 let byte = 0; 3133 let byte = 0;
3568 for (let i = 0; dart.notNull(i) < 2; i = dart.notNull(i) + 1) { 3134 for (let i = 0; dart.notNull(i) < 2; i = dart.notNull(i) + 1) {
3569 let charCode = s.codeUnitAt(dart.notNull(pos) + dart.notNull(i)); 3135 let charCode = s[dartx.codeUnitAt](dart.notNull(pos) + dart.notNull(i));
3570 if (48 <= dart.notNull(charCode) && dart.notNull(charCode) <= 57) { 3136 if (48 <= dart.notNull(charCode) && dart.notNull(charCode) <= 57) {
3571 byte = dart.notNull(byte) * 16 + dart.notNull(charCode) - 48; 3137 byte = dart.notNull(byte) * 16 + dart.notNull(charCode) - 48;
3572 } else { 3138 } else {
3573 charCode = dart.notNull(charCode) | 32; 3139 charCode = dart.notNull(charCode) | 32;
3574 if (97 <= dart.notNull(charCode) && dart.notNull(charCode) <= 102) { 3140 if (97 <= dart.notNull(charCode) && dart.notNull(charCode) <= 102) {
3575 byte = dart.notNull(byte) * 16 + dart.notNull(charCode) - 87; 3141 byte = dart.notNull(byte) * 16 + dart.notNull(charCode) - 87;
3576 } else { 3142 } else {
3577 throw new ArgumentError("Invalid URL encoding"); 3143 throw new ArgumentError("Invalid URL encoding");
3578 } 3144 }
3579 } 3145 }
3580 } 3146 }
3581 return byte; 3147 return byte;
3582 } 3148 }
3583 static _uriDecode(text, opts) { 3149 static _uriDecode(text, opts) {
3584 let plusToSpace = opts && 'plusToSpace' in opts ? opts.plusToSpace : false ; 3150 let plusToSpace = opts && 'plusToSpace' in opts ? opts.plusToSpace : false ;
3585 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8; 3151 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8;
3586 let simple = true; 3152 let simple = true;
3587 for (let i = 0; dart.notNull(i) < dart.notNull(text.length) && dart.notNul l(simple); i = dart.notNull(i) + 1) { 3153 for (let i = 0; dart.notNull(i) < dart.notNull(text.length) && dart.notNul l(simple); i = dart.notNull(i) + 1) {
3588 let codeUnit = text.codeUnitAt(i); 3154 let codeUnit = text[dartx.codeUnitAt](i);
3589 simple = codeUnit != Uri._PERCENT && codeUnit != Uri._PLUS; 3155 simple = codeUnit != Uri._PERCENT && codeUnit != Uri._PLUS;
3590 } 3156 }
3591 let bytes = null; 3157 let bytes = null;
3592 if (simple) { 3158 if (simple) {
3593 if (dart.notNull(dart.equals(encoding, convert.UTF8)) || dart.notNull(da rt.equals(encoding, convert.LATIN1))) { 3159 if (dart.notNull(dart.equals(encoding, convert.UTF8)) || dart.notNull(da rt.equals(encoding, convert.LATIN1))) {
3594 return text; 3160 return text;
3595 } else { 3161 } else {
3596 bytes = text.codeUnits; 3162 bytes = text[dartx.codeUnits];
3597 } 3163 }
3598 } else { 3164 } else {
3599 bytes = List$(int).new(); 3165 bytes = List$(int).new();
3600 for (let i = 0; dart.notNull(i) < dart.notNull(text.length); i = dart.no tNull(i) + 1) { 3166 for (let i = 0; dart.notNull(i) < dart.notNull(text.length); i = dart.no tNull(i) + 1) {
3601 let codeUnit = text.codeUnitAt(i); 3167 let codeUnit = text[dartx.codeUnitAt](i);
3602 if (dart.notNull(codeUnit) > 127) { 3168 if (dart.notNull(codeUnit) > 127) {
3603 throw new ArgumentError("Illegal percent encoding in URI"); 3169 throw new ArgumentError("Illegal percent encoding in URI");
3604 } 3170 }
3605 if (codeUnit == Uri._PERCENT) { 3171 if (codeUnit == Uri._PERCENT) {
3606 if (dart.notNull(i) + 3 > dart.notNull(text.length)) { 3172 if (dart.notNull(i) + 3 > dart.notNull(text.length)) {
3607 throw new ArgumentError('Truncated URI'); 3173 throw new ArgumentError('Truncated URI');
3608 } 3174 }
3609 bytes[$add](Uri._hexCharPairToByte(text, dart.notNull(i) + 1)); 3175 bytes[dartx.add](Uri._hexCharPairToByte(text, dart.notNull(i) + 1));
3610 i = dart.notNull(i) + 2; 3176 i = dart.notNull(i) + 2;
3611 } else if (dart.notNull(plusToSpace) && codeUnit == Uri._PLUS) { 3177 } else if (dart.notNull(plusToSpace) && codeUnit == Uri._PLUS) {
3612 bytes[$add](Uri._SPACE); 3178 bytes[dartx.add](Uri._SPACE);
3613 } else { 3179 } else {
3614 bytes[$add](codeUnit); 3180 bytes[dartx.add](codeUnit);
3615 } 3181 }
3616 } 3182 }
3617 } 3183 }
3618 return encoding.decode(bytes); 3184 return encoding.decode(bytes);
3619 } 3185 }
3620 static _isAlphabeticCharacter(codeUnit) { 3186 static _isAlphabeticCharacter(codeUnit) {
3621 return dart.notNull(codeUnit) >= dart.notNull(Uri._LOWER_CASE_A) && dart.n otNull(codeUnit) <= dart.notNull(Uri._LOWER_CASE_Z) || dart.notNull(codeUnit) >= dart.notNull(Uri._UPPER_CASE_A) && dart.notNull(codeUnit) <= dart.notNull(Uri._ UPPER_CASE_Z); 3187 return dart.notNull(codeUnit) >= dart.notNull(Uri._LOWER_CASE_A) && dart.n otNull(codeUnit) <= dart.notNull(Uri._LOWER_CASE_Z) || dart.notNull(codeUnit) >= dart.notNull(Uri._UPPER_CASE_A) && dart.notNull(codeUnit) <= dart.notNull(Uri._ UPPER_CASE_Z);
3622 } 3188 }
3623 } 3189 }
3624 dart.defineNamedConstructor(Uri, '_internal'); 3190 dart.defineNamedConstructor(Uri, '_internal');
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
3721 Uri._genDelimitersTable = dart.const([0, 0, 32776, 33792, 1, 10240, 0, 0]); 3287 Uri._genDelimitersTable = dart.const([0, 0, 32776, 33792, 1, 10240, 0, 0]);
3722 Uri._userinfoTable = dart.const([0, 0, 32722, 12287, 65534, 34815, 65534, 1843 1]); 3288 Uri._userinfoTable = dart.const([0, 0, 32722, 12287, 65534, 34815, 65534, 1843 1]);
3723 Uri._regNameTable = dart.const([0, 0, 32754, 11263, 65534, 34815, 65534, 18431 ]); 3289 Uri._regNameTable = dart.const([0, 0, 32754, 11263, 65534, 34815, 65534, 18431 ]);
3724 Uri._pathCharTable = dart.const([0, 0, 32722, 12287, 65535, 34815, 65534, 1843 1]); 3290 Uri._pathCharTable = dart.const([0, 0, 32722, 12287, 65535, 34815, 65534, 1843 1]);
3725 Uri._pathCharOrSlashTable = dart.const([0, 0, 65490, 12287, 65535, 34815, 6553 4, 18431]); 3291 Uri._pathCharOrSlashTable = dart.const([0, 0, 65490, 12287, 65535, 34815, 6553 4, 18431]);
3726 Uri._queryCharTable = dart.const([0, 0, 65490, 45055, 65535, 34815, 65534, 184 31]); 3292 Uri._queryCharTable = dart.const([0, 0, 65490, 45055, 65535, 34815, 65534, 184 31]);
3727 function _symbolToString(symbol) { 3293 function _symbolToString(symbol) {
3728 return _internal.Symbol.getName(dart.as(symbol, _internal.Symbol)); 3294 return _internal.Symbol.getName(dart.as(symbol, _internal.Symbol));
3729 } 3295 }
3730 dart.fn(_symbolToString, String, [Symbol]); 3296 dart.fn(_symbolToString, String, [Symbol]);
3731 function _symbolMapToStringMap(map) {
3732 if (map == null)
3733 return null;
3734 let result = Map$(String, Object).new();
3735 map.forEach(dart.fn((key, value) => {
3736 result.set(_symbolToString(key), value);
3737 }, Object, [Symbol, Object]));
3738 return result;
3739 }
3740 dart.fn(_symbolMapToStringMap, Object, [Map$(Symbol, Object)]);
3741 class SupportJsExtensionMethods extends Object {
3742 SupportJsExtensionMethods() {
3743 }
3744 }
3745 dart.setSignature(SupportJsExtensionMethods, {
3746 constructors: () => ({SupportJsExtensionMethods: [SupportJsExtensionMethods, []]})
3747 });
3748 class _ListConstructorSentinel extends Object {
3749 _ListConstructorSentinel() {
3750 }
3751 }
3752 dart.setSignature(_ListConstructorSentinel, {
3753 constructors: () => ({_ListConstructorSentinel: [_ListConstructorSentinel, [ ]]})
3754 });
3755 // Exports: 3297 // Exports:
3756 exports.Object = Object; 3298 exports.Object = Object;
3757 exports.JsName = JsName;
3758 exports.JsPeerInterface = JsPeerInterface;
3759 exports.SupportJsExtensionMethod = SupportJsExtensionMethod;
3760 exports.Deprecated = Deprecated; 3299 exports.Deprecated = Deprecated;
3761 exports.deprecated = deprecated; 3300 exports.deprecated = deprecated;
3762 exports.override = override; 3301 exports.override = override;
3763 exports.proxy = proxy; 3302 exports.proxy = proxy;
3764 exports.bool = bool; 3303 exports.bool = bool;
3765 exports.Comparator$ = Comparator$; 3304 exports.Comparator$ = Comparator$;
3766 exports.Comparator = Comparator; 3305 exports.Comparator = Comparator;
3767 exports.Comparable$ = Comparable$; 3306 exports.Comparable$ = Comparable$;
3768 exports.Comparable = Comparable; 3307 exports.Comparable = Comparable;
3769 exports.DateTime = DateTime; 3308 exports.DateTime = DateTime;
3770 exports.num = num; 3309 exports.num = num;
3771 exports.double = double; 3310 exports.double = double;
3772 exports.Duration = Duration; 3311 exports.Duration = Duration;
3773 exports.Error = Error; 3312 exports.Error = Error;
3774 exports.AssertionError = AssertionError; 3313 exports.AssertionError = AssertionError;
3775 exports.TypeError = TypeError; 3314 exports.TypeError = TypeError;
3776 exports.CastError = CastError; 3315 exports.CastError = CastError;
3777 exports.NullThrownError = NullThrownError; 3316 exports.NullThrownError = NullThrownError;
3778 exports.ArgumentError = ArgumentError; 3317 exports.ArgumentError = ArgumentError;
3779 exports.RangeError = RangeError; 3318 exports.RangeError = RangeError;
3780 exports.IndexError = IndexError; 3319 exports.IndexError = IndexError;
3781 exports.FallThroughError = FallThroughError; 3320 exports.FallThroughError = FallThroughError;
3782 exports.AbstractClassInstantiationError = AbstractClassInstantiationError; 3321 exports.AbstractClassInstantiationError = AbstractClassInstantiationError;
3783 exports.$length = $length;
3784 exports.$get = $get;
3785 exports.NoSuchMethodError = NoSuchMethodError; 3322 exports.NoSuchMethodError = NoSuchMethodError;
3786 exports.UnsupportedError = UnsupportedError; 3323 exports.UnsupportedError = UnsupportedError;
3787 exports.UnimplementedError = UnimplementedError; 3324 exports.UnimplementedError = UnimplementedError;
3788 exports.StateError = StateError; 3325 exports.StateError = StateError;
3789 exports.ConcurrentModificationError = ConcurrentModificationError; 3326 exports.ConcurrentModificationError = ConcurrentModificationError;
3790 exports.OutOfMemoryError = OutOfMemoryError; 3327 exports.OutOfMemoryError = OutOfMemoryError;
3791 exports.StackOverflowError = StackOverflowError; 3328 exports.StackOverflowError = StackOverflowError;
3792 exports.CyclicInitializationError = CyclicInitializationError; 3329 exports.CyclicInitializationError = CyclicInitializationError;
3793 exports.Exception = Exception; 3330 exports.Exception = Exception;
3794 exports.FormatException = FormatException; 3331 exports.FormatException = FormatException;
3795 exports.IntegerDivisionByZeroException = IntegerDivisionByZeroException; 3332 exports.IntegerDivisionByZeroException = IntegerDivisionByZeroException;
3796 exports.Expando$ = Expando$; 3333 exports.Expando$ = Expando$;
3797 exports.Expando = Expando; 3334 exports.Expando = Expando;
3798 exports.Function = Function; 3335 exports.Function = Function;
3799 exports.identical = identical; 3336 exports.identical = identical;
3800 exports.identityHashCode = identityHashCode; 3337 exports.identityHashCode = identityHashCode;
3801 exports.int = int; 3338 exports.int = int;
3802 exports.Invocation = Invocation; 3339 exports.Invocation = Invocation;
3803 exports.$iterator = $iterator;
3804 exports.$join = $join;
3805 exports.Iterable$ = Iterable$; 3340 exports.Iterable$ = Iterable$;
3806 exports.Iterable = Iterable; 3341 exports.Iterable = Iterable;
3807 exports.$skip = $skip;
3808 exports.$take = $take;
3809 exports.BidirectionalIterator$ = BidirectionalIterator$; 3342 exports.BidirectionalIterator$ = BidirectionalIterator$;
3810 exports.BidirectionalIterator = BidirectionalIterator; 3343 exports.BidirectionalIterator = BidirectionalIterator;
3811 exports.Iterator$ = Iterator$; 3344 exports.Iterator$ = Iterator$;
3812 exports.Iterator = Iterator; 3345 exports.Iterator = Iterator;
3813 exports.$set = $set;
3814 exports.$add = $add;
3815 exports.$checkMutable = $checkMutable;
3816 exports.$checkGrowable = $checkGrowable;
3817 exports.$where = $where;
3818 exports.$expand = $expand;
3819 exports.$forEach = $forEach;
3820 exports.$map = $map;
3821 exports.$takeWhile = $takeWhile;
3822 exports.$skipWhile = $skipWhile;
3823 exports.$reduce = $reduce;
3824 exports.$fold = $fold;
3825 exports.$firstWhere = $firstWhere;
3826 exports.$lastWhere = $lastWhere;
3827 exports.$singleWhere = $singleWhere;
3828 exports.$elementAt = $elementAt;
3829 exports.$first = $first;
3830 exports.$last = $last;
3831 exports.$single = $single;
3832 exports.$any = $any;
3833 exports.$every = $every;
3834 exports.$contains = $contains;
3835 exports.$isEmpty = $isEmpty;
3836 exports.$isNotEmpty = $isNotEmpty;
3837 exports.$toString = $toString;
3838 exports.$toList = $toList;
3839 exports.$toSet = $toSet;
3840 exports.$hashCode = $hashCode;
3841 exports.$addAll = $addAll;
3842 exports.$reversed = $reversed;
3843 exports.$sort = $sort;
3844 exports.$shuffle = $shuffle;
3845 exports.$indexOf = $indexOf;
3846 exports.$lastIndexOf = $lastIndexOf;
3847 exports.$clear = $clear;
3848 exports.$insert = $insert;
3849 exports.$insertAll = $insertAll;
3850 exports.$setAll = $setAll;
3851 exports.$remove = $remove;
3852 exports.$removeAt = $removeAt;
3853 exports.$removeLast = $removeLast;
3854 exports.$removeWhere = $removeWhere;
3855 exports.$retainWhere = $retainWhere;
3856 exports.$sublist = $sublist;
3857 exports.$getRange = $getRange;
3858 exports.$setRange = $setRange;
3859 exports.$removeRange = $removeRange;
3860 exports.$fillRange = $fillRange;
3861 exports.$replaceRange = $replaceRange;
3862 exports.$asMap = $asMap;
3863 exports.List$ = List$; 3346 exports.List$ = List$;
3864 exports.List = List; 3347 exports.List = List;
3865 exports.Map$ = Map$; 3348 exports.Map$ = Map$;
3866 exports.Map = Map; 3349 exports.Map = Map;
3867 exports.Null = Null; 3350 exports.Null = Null;
3868 exports.Pattern = Pattern; 3351 exports.Pattern = Pattern;
3869 exports.print = print; 3352 exports.print = print;
3870 exports.Match = Match; 3353 exports.Match = Match;
3871 exports.RegExp = RegExp; 3354 exports.RegExp = RegExp;
3872 exports.Set$ = Set$; 3355 exports.Set$ = Set$;
3873 exports.Sink$ = Sink$; 3356 exports.Sink$ = Sink$;
3874 exports.Sink = Sink; 3357 exports.Sink = Sink;
3875 exports.StackTrace = StackTrace; 3358 exports.StackTrace = StackTrace;
3876 exports.Stopwatch = Stopwatch; 3359 exports.Stopwatch = Stopwatch;
3877 exports.String = String; 3360 exports.String = String;
3878 exports.RuneIterator = RuneIterator; 3361 exports.RuneIterator = RuneIterator;
3879 exports.StringBuffer = StringBuffer; 3362 exports.StringBuffer = StringBuffer;
3880 exports.StringSink = StringSink; 3363 exports.StringSink = StringSink;
3881 exports.Symbol = Symbol; 3364 exports.Symbol = Symbol;
3882 exports.Type = Type; 3365 exports.Type = Type;
3883 exports.Uri = Uri; 3366 exports.Uri = Uri;
3884 exports.SupportJsExtensionMethods = SupportJsExtensionMethods; 3367 })(core, _js_helper, _internal, collection, _interceptors, convert);
3885 })(core, _js_helper, _internal, collection, _interceptors, math, convert);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698