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

Side by Side Diff: test/codegen/expect/core/core.js

Issue 963343002: implement private members, fixes #74 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « test/codegen/expect/convert/convert.js ('k') | test/codegen/expect/isolate/isolate.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var core; 1 var core;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 // Function _symbolToString: (Symbol) → String 4 // Function _symbolToString: (Symbol) → String
5 function _symbolToString(symbol) { 5 function _symbolToString(symbol) {
6 return _internal.Symbol.getName(dart.as(symbol, _internal.Symbol)); 6 return _internal.Symbol.getName(dart.as(symbol, _internal.Symbol));
7 } 7 }
8 // Function _symbolMapToStringMap: (Map<Symbol, dynamic>) → dynamic 8 // Function _symbolMapToStringMap: (Map<Symbol, dynamic>) → dynamic
9 function _symbolMapToStringMap(map) { 9 function _symbolMapToStringMap(map) {
10 if (map === null) 10 if (map === null)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 dart.defineNamedConstructor(bool, 'fromEnvironment'); 51 dart.defineNamedConstructor(bool, 'fromEnvironment');
52 let Comparable$ = dart.generic(function(T) { 52 let Comparable$ = dart.generic(function(T) {
53 class Comparable extends dart.Object { 53 class Comparable extends dart.Object {
54 static compare(a, b) { 54 static compare(a, b) {
55 return a.compareTo(b); 55 return a.compareTo(b);
56 } 56 }
57 } 57 }
58 return Comparable; 58 return Comparable;
59 }); 59 });
60 let Comparable = Comparable$(dynamic); 60 let Comparable = Comparable$(dynamic);
61 let _fourDigits = Symbol('_fourDigits');
62 let _sixDigits = Symbol('_sixDigits');
63 let _threeDigits = Symbol('_threeDigits');
64 let _twoDigits = Symbol('_twoDigits');
65 let _brokenDownDateToMillisecondsSinceEpoch = Symbol('_brokenDownDateToMillise condsSinceEpoch');
61 class DateTime extends dart.Object { 66 class DateTime extends dart.Object {
62 DateTime(year, month, day, hour, minute, second, millisecond) { 67 DateTime(year, month, day, hour, minute, second, millisecond) {
63 if (month === void 0) 68 if (month === void 0)
64 month = 1; 69 month = 1;
65 if (day === void 0) 70 if (day === void 0)
66 day = 1; 71 day = 1;
67 if (hour === void 0) 72 if (hour === void 0)
68 hour = 0; 73 hour = 0;
69 if (minute === void 0) 74 if (minute === void 0)
70 minute = 0; 75 minute = 0;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (this.isUtc) { 181 if (this.isUtc) {
177 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpo ch, {isUtc: false}); 182 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpo ch, {isUtc: false});
178 } 183 }
179 return this; 184 return this;
180 } 185 }
181 toUtc() { 186 toUtc() {
182 if (this.isUtc) 187 if (this.isUtc)
183 return this; 188 return this;
184 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpoch , {isUtc: true}); 189 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpoch , {isUtc: true});
185 } 190 }
186 static _fourDigits(n) { 191 static [_fourDigits](n) {
187 let absN = n.abs(); 192 let absN = n.abs();
188 let sign = n < 0 ? "-" : ""; 193 let sign = n < 0 ? "-" : "";
189 if (absN >= 1000) 194 if (absN >= 1000)
190 return `${n}`; 195 return `${n}`;
191 if (absN >= 100) 196 if (absN >= 100)
192 return `${sign}0${absN}`; 197 return `${sign}0${absN}`;
193 if (absN >= 10) 198 if (absN >= 10)
194 return `${sign}00${absN}`; 199 return `${sign}00${absN}`;
195 return `${sign}000${absN}`; 200 return `${sign}000${absN}`;
196 } 201 }
197 static _sixDigits(n) { 202 static [_sixDigits](n) {
198 dart.assert(dart.notNull(n < -9999) || dart.notNull(n > 9999)); 203 dart.assert(dart.notNull(n < -9999) || dart.notNull(n > 9999));
199 let absN = n.abs(); 204 let absN = n.abs();
200 let sign = n < 0 ? "-" : "+"; 205 let sign = n < 0 ? "-" : "+";
201 if (absN >= 100000) 206 if (absN >= 100000)
202 return `${sign}${absN}`; 207 return `${sign}${absN}`;
203 return `${sign}0${absN}`; 208 return `${sign}0${absN}`;
204 } 209 }
205 static _threeDigits(n) { 210 static [_threeDigits](n) {
206 if (n >= 100) 211 if (n >= 100)
207 return `${n}`; 212 return `${n}`;
208 if (n >= 10) 213 if (n >= 10)
209 return `0${n}`; 214 return `0${n}`;
210 return `00${n}`; 215 return `00${n}`;
211 } 216 }
212 static _twoDigits(n) { 217 static [_twoDigits](n) {
213 if (n >= 10) 218 if (n >= 10)
214 return `${n}`; 219 return `${n}`;
215 return `0${n}`; 220 return `0${n}`;
216 } 221 }
217 toString() { 222 toString() {
218 let y = _fourDigits(this.year); 223 let y = _fourDigits(this.year);
219 let m = _twoDigits(this.month); 224 let m = _twoDigits(this.month);
220 let d = _twoDigits(this.day); 225 let d = _twoDigits(this.day);
221 let h = _twoDigits(this.hour); 226 let h = _twoDigits(this.hour);
222 let min = _twoDigits(this.minute); 227 let min = _twoDigits(this.minute);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 return new Duration({milliseconds: ms - otherMs}); 261 return new Duration({milliseconds: ms - otherMs});
257 } 262 }
258 DateTime$_internal(year, month, day, hour, minute, second, millisecond, isUt c) { 263 DateTime$_internal(year, month, day, hour, minute, second, millisecond, isUt c) {
259 this.isUtc = dart.as(typeof isUtc == boolean ? isUtc : dart.throw_(new Arg umentError(isUtc)), bool); 264 this.isUtc = dart.as(typeof isUtc == boolean ? isUtc : dart.throw_(new Arg umentError(isUtc)), bool);
260 this.millisecondsSinceEpoch = dart.as(_js_helper.checkInt(_js_helper.Primi tives.valueFromDecomposedDate(year, month, day, hour, minute, second, millisecon d, isUtc)), int); 265 this.millisecondsSinceEpoch = dart.as(_js_helper.checkInt(_js_helper.Primi tives.valueFromDecomposedDate(year, month, day, hour, minute, second, millisecon d, isUtc)), int);
261 } 266 }
262 DateTime$_now() { 267 DateTime$_now() {
263 this.isUtc = false; 268 this.isUtc = false;
264 this.millisecondsSinceEpoch = dart.notNull(_js_helper.Primitives.dateNow() ); 269 this.millisecondsSinceEpoch = dart.notNull(_js_helper.Primitives.dateNow() );
265 } 270 }
266 static _brokenDownDateToMillisecondsSinceEpoch(year, month, day, hour, minut e, second, millisecond, isUtc) { 271 static [_brokenDownDateToMillisecondsSinceEpoch](year, month, day, hour, min ute, second, millisecond, isUtc) {
267 return dart.as(_js_helper.Primitives.valueFromDecomposedDate(year, month, day, hour, minute, second, millisecond, isUtc), int); 272 return dart.as(_js_helper.Primitives.valueFromDecomposedDate(year, month, day, hour, minute, second, millisecond, isUtc), int);
268 } 273 }
269 get timeZoneName() { 274 get timeZoneName() {
270 if (this.isUtc) 275 if (this.isUtc)
271 return "UTC"; 276 return "UTC";
272 return _js_helper.Primitives.getTimeZoneName(this); 277 return _js_helper.Primitives.getTimeZoneName(this);
273 } 278 }
274 get timeZoneOffset() { 279 get timeZoneOffset() {
275 if (this.isUtc) 280 if (this.isUtc)
276 return new Duration(); 281 return new Duration();
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 if (onError === void 0) 338 if (onError === void 0)
334 onError = null; 339 onError = null;
335 return _js_helper.Primitives.parseDouble(source, onError); 340 return _js_helper.Primitives.parseDouble(source, onError);
336 } 341 }
337 } 342 }
338 double.NAN = 0.0 / 0.0; 343 double.NAN = 0.0 / 0.0;
339 double.INFINITY = 1.0 / 0.0; 344 double.INFINITY = 1.0 / 0.0;
340 double.NEGATIVE_INFINITY = -INFINITY; 345 double.NEGATIVE_INFINITY = -INFINITY;
341 double.MIN_POSITIVE = 5e-324; 346 double.MIN_POSITIVE = 5e-324;
342 double.MAX_FINITE = 1.7976931348623157e+308; 347 double.MAX_FINITE = 1.7976931348623157e+308;
348 let _duration = Symbol('_duration');
343 class Duration extends dart.Object { 349 class Duration extends dart.Object {
344 Duration(opt$) { 350 Duration(opt$) {
345 let days = opt$.days === void 0 ? 0 : opt$.days; 351 let days = opt$.days === void 0 ? 0 : opt$.days;
346 let hours = opt$.hours === void 0 ? 0 : opt$.hours; 352 let hours = opt$.hours === void 0 ? 0 : opt$.hours;
347 let minutes = opt$.minutes === void 0 ? 0 : opt$.minutes; 353 let minutes = opt$.minutes === void 0 ? 0 : opt$.minutes;
348 let seconds = opt$.seconds === void 0 ? 0 : opt$.seconds; 354 let seconds = opt$.seconds === void 0 ? 0 : opt$.seconds;
349 let milliseconds = opt$.milliseconds === void 0 ? 0 : opt$.milliseconds; 355 let milliseconds = opt$.milliseconds === void 0 ? 0 : opt$.milliseconds;
350 let microseconds = opt$.microseconds === void 0 ? 0 : opt$.microseconds; 356 let microseconds = opt$.microseconds === void 0 ? 0 : opt$.microseconds;
351 this.Duration$_microseconds(days * MICROSECONDS_PER_DAY + hours * MICROSEC ONDS_PER_HOUR + minutes * MICROSECONDS_PER_MINUTE + seconds * MICROSECONDS_PER_S ECOND + milliseconds * MICROSECONDS_PER_MILLISECOND + microseconds); 357 this.Duration$_microseconds(days * MICROSECONDS_PER_DAY + hours * MICROSEC ONDS_PER_HOUR + minutes * MICROSECONDS_PER_MINUTE + seconds * MICROSECONDS_PER_S ECOND + milliseconds * MICROSECONDS_PER_MILLISECOND + microseconds);
352 } 358 }
353 Duration$_microseconds(_duration) { 359 Duration$_microseconds($_duration) {
354 this._duration = _duration; 360 this[_duration] = $_duration;
355 } 361 }
356 ['+'](other) { 362 ['+'](other) {
357 return new Duration._microseconds(this._duration + other._duration); 363 return new Duration._microseconds(this[_duration] + other[_duration]);
358 } 364 }
359 ['-'](other) { 365 ['-'](other) {
360 return new Duration._microseconds(this._duration - other._duration); 366 return new Duration._microseconds(this[_duration] - other[_duration]);
361 } 367 }
362 ['*'](factor) { 368 ['*'](factor) {
363 return new Duration._microseconds((this._duration * dart.notNull(factor)). round()); 369 return new Duration._microseconds((this[_duration] * dart.notNull(factor)) .round());
364 } 370 }
365 ['~/'](quotient) { 371 ['~/'](quotient) {
366 if (quotient === 0) 372 if (quotient === 0)
367 throw new IntegerDivisionByZeroException(); 373 throw new IntegerDivisionByZeroException();
368 return new Duration._microseconds((this._duration / quotient).truncate()); 374 return new Duration._microseconds((this[_duration] / quotient).truncate()) ;
369 } 375 }
370 ['<'](other) { 376 ['<'](other) {
371 return this._duration < other._duration; 377 return this[_duration] < other[_duration];
372 } 378 }
373 ['>'](other) { 379 ['>'](other) {
374 return this._duration > other._duration; 380 return this[_duration] > other[_duration];
375 } 381 }
376 ['<='](other) { 382 ['<='](other) {
377 return this._duration <= other._duration; 383 return this[_duration] <= other[_duration];
378 } 384 }
379 ['>='](other) { 385 ['>='](other) {
380 return this._duration >= other._duration; 386 return this[_duration] >= other[_duration];
381 } 387 }
382 get inDays() { 388 get inDays() {
383 return (this._duration / Duration.MICROSECONDS_PER_DAY).truncate(); 389 return (this[_duration] / Duration.MICROSECONDS_PER_DAY).truncate();
384 } 390 }
385 get inHours() { 391 get inHours() {
386 return (this._duration / Duration.MICROSECONDS_PER_HOUR).truncate(); 392 return (this[_duration] / Duration.MICROSECONDS_PER_HOUR).truncate();
387 } 393 }
388 get inMinutes() { 394 get inMinutes() {
389 return (this._duration / Duration.MICROSECONDS_PER_MINUTE).truncate(); 395 return (this[_duration] / Duration.MICROSECONDS_PER_MINUTE).truncate();
390 } 396 }
391 get inSeconds() { 397 get inSeconds() {
392 return (this._duration / Duration.MICROSECONDS_PER_SECOND).truncate(); 398 return (this[_duration] / Duration.MICROSECONDS_PER_SECOND).truncate();
393 } 399 }
394 get inMilliseconds() { 400 get inMilliseconds() {
395 return (this._duration / Duration.MICROSECONDS_PER_MILLISECOND).truncate() ; 401 return (this[_duration] / Duration.MICROSECONDS_PER_MILLISECOND).truncate( );
396 } 402 }
397 get inMicroseconds() { 403 get inMicroseconds() {
398 return this._duration; 404 return this[_duration];
399 } 405 }
400 ['=='](other) { 406 ['=='](other) {
401 if (!dart.is(other, Duration)) 407 if (!dart.is(other, Duration))
402 return false; 408 return false;
403 return this._duration === dart.dload(other, '_duration'); 409 return this[_duration] === dart.dload(other, '_duration');
404 } 410 }
405 get hashCode() { 411 get hashCode() {
406 return this._duration.hashCode; 412 return this[_duration].hashCode;
407 } 413 }
408 compareTo(other) { 414 compareTo(other) {
409 return this._duration.compareTo(other._duration); 415 return this[_duration].compareTo(other[_duration]);
410 } 416 }
411 toString() { 417 toString() {
412 // Function sixDigits: (int) → String 418 // Function sixDigits: (int) → String
413 function sixDigits(n) { 419 function sixDigits(n) {
414 if (n >= 100000) 420 if (n >= 100000)
415 return `${n}`; 421 return `${n}`;
416 if (n >= 10000) 422 if (n >= 10000)
417 return `0${n}`; 423 return `0${n}`;
418 if (n >= 1000) 424 if (n >= 1000)
419 return `00${n}`; 425 return `00${n}`;
(...skipping 11 matching lines...) Expand all
431 } 437 }
432 if (this.inMicroseconds < 0) { 438 if (this.inMicroseconds < 0) {
433 return `-${dart.throw_("Unimplemented PrefixExpression: -this")}`; 439 return `-${dart.throw_("Unimplemented PrefixExpression: -this")}`;
434 } 440 }
435 let twoDigitMinutes = twoDigits(dart.notNull(this.inMinutes.remainder(MINU TES_PER_HOUR))); 441 let twoDigitMinutes = twoDigits(dart.notNull(this.inMinutes.remainder(MINU TES_PER_HOUR)));
436 let twoDigitSeconds = twoDigits(dart.notNull(this.inSeconds.remainder(SECO NDS_PER_MINUTE))); 442 let twoDigitSeconds = twoDigits(dart.notNull(this.inSeconds.remainder(SECO NDS_PER_MINUTE)));
437 let sixDigitUs = sixDigits(dart.notNull(this.inMicroseconds.remainder(MICR OSECONDS_PER_SECOND))); 443 let sixDigitUs = sixDigits(dart.notNull(this.inMicroseconds.remainder(MICR OSECONDS_PER_SECOND)));
438 return `${this.inHours}:${twoDigitMinutes}:${twoDigitSeconds}.${sixDigitUs }`; 444 return `${this.inHours}:${twoDigitMinutes}:${twoDigitSeconds}.${sixDigitUs }`;
439 } 445 }
440 get isNegative() { 446 get isNegative() {
441 return this._duration < 0; 447 return this[_duration] < 0;
442 } 448 }
443 abs() { 449 abs() {
444 return new Duration._microseconds(this._duration.abs()); 450 return new Duration._microseconds(this[_duration].abs());
445 } 451 }
446 ['-']() { 452 ['-']() {
447 return new Duration._microseconds(-this._duration); 453 return new Duration._microseconds(-this[_duration]);
448 } 454 }
449 } 455 }
450 dart.defineNamedConstructor(Duration, '_microseconds'); 456 dart.defineNamedConstructor(Duration, '_microseconds');
451 Duration.MICROSECONDS_PER_MILLISECOND = 1000; 457 Duration.MICROSECONDS_PER_MILLISECOND = 1000;
452 Duration.MILLISECONDS_PER_SECOND = 1000; 458 Duration.MILLISECONDS_PER_SECOND = 1000;
453 Duration.SECONDS_PER_MINUTE = 60; 459 Duration.SECONDS_PER_MINUTE = 60;
454 Duration.MINUTES_PER_HOUR = 60; 460 Duration.MINUTES_PER_HOUR = 60;
455 Duration.HOURS_PER_DAY = 24; 461 Duration.HOURS_PER_DAY = 24;
456 Duration.MICROSECONDS_PER_SECOND = MICROSECONDS_PER_MILLISECOND * MILLISECONDS _PER_SECOND; 462 Duration.MICROSECONDS_PER_SECOND = MICROSECONDS_PER_MILLISECOND * MILLISECONDS _PER_SECOND;
457 Duration.MICROSECONDS_PER_MINUTE = MICROSECONDS_PER_SECOND * SECONDS_PER_MINUT E; 463 Duration.MICROSECONDS_PER_MINUTE = MICROSECONDS_PER_SECOND * SECONDS_PER_MINUT E;
458 Duration.MICROSECONDS_PER_HOUR = MICROSECONDS_PER_MINUTE * MINUTES_PER_HOUR; 464 Duration.MICROSECONDS_PER_HOUR = MICROSECONDS_PER_MINUTE * MINUTES_PER_HOUR;
459 Duration.MICROSECONDS_PER_DAY = MICROSECONDS_PER_HOUR * HOURS_PER_DAY; 465 Duration.MICROSECONDS_PER_DAY = MICROSECONDS_PER_HOUR * HOURS_PER_DAY;
460 Duration.MILLISECONDS_PER_MINUTE = MILLISECONDS_PER_SECOND * SECONDS_PER_MINUT E; 466 Duration.MILLISECONDS_PER_MINUTE = MILLISECONDS_PER_SECOND * SECONDS_PER_MINUT E;
461 Duration.MILLISECONDS_PER_HOUR = MILLISECONDS_PER_MINUTE * MINUTES_PER_HOUR; 467 Duration.MILLISECONDS_PER_HOUR = MILLISECONDS_PER_MINUTE * MINUTES_PER_HOUR;
462 Duration.MILLISECONDS_PER_DAY = MILLISECONDS_PER_HOUR * HOURS_PER_DAY; 468 Duration.MILLISECONDS_PER_DAY = MILLISECONDS_PER_HOUR * HOURS_PER_DAY;
463 Duration.SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR; 469 Duration.SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR;
464 Duration.SECONDS_PER_DAY = SECONDS_PER_HOUR * HOURS_PER_DAY; 470 Duration.SECONDS_PER_DAY = SECONDS_PER_HOUR * HOURS_PER_DAY;
465 Duration.MINUTES_PER_DAY = MINUTES_PER_HOUR * HOURS_PER_DAY; 471 Duration.MINUTES_PER_DAY = MINUTES_PER_HOUR * HOURS_PER_DAY;
466 Duration.ZERO = new Duration({seconds: 0}); 472 Duration.ZERO = new Duration({seconds: 0});
473 let _stringToSafeString = Symbol('_stringToSafeString');
474 let _objectToString = Symbol('_objectToString');
467 class Error extends dart.Object { 475 class Error extends dart.Object {
468 Error() { 476 Error() {
469 } 477 }
470 static safeToString(object) { 478 static safeToString(object) {
471 if (dart.notNull(dart.notNull(dart.is(object, num)) || dart.notNull(typeof object == boolean)) || dart.notNull(null === object)) { 479 if (dart.notNull(dart.notNull(dart.is(object, num)) || dart.notNull(typeof object == boolean)) || dart.notNull(null === object)) {
472 return object.toString(); 480 return object.toString();
473 } 481 }
474 if (typeof object == string) { 482 if (typeof object == string) {
475 return _stringToSafeString(object); 483 return _stringToSafeString(object);
476 } 484 }
477 return _objectToString(object); 485 return _objectToString(object);
478 } 486 }
479 static _stringToSafeString(string) { 487 static [_stringToSafeString](string) {
480 return _js_helper.jsonEncodeNative(string); 488 return _js_helper.jsonEncodeNative(string);
481 } 489 }
482 static _objectToString(object) { 490 static [_objectToString](object) {
483 return _js_helper.Primitives.objectToString(object); 491 return _js_helper.Primitives.objectToString(object);
484 } 492 }
485 get stackTrace() { 493 get stackTrace() {
486 return _js_helper.Primitives.extractStackTrace(this); 494 return _js_helper.Primitives.extractStackTrace(this);
487 } 495 }
488 } 496 }
489 class AssertionError extends Error { 497 class AssertionError extends Error {
490 } 498 }
491 class TypeError extends AssertionError { 499 class TypeError extends AssertionError {
492 } 500 }
493 class CastError extends Error { 501 class CastError extends Error {
494 } 502 }
495 class NullThrownError extends Error { 503 class NullThrownError extends Error {
496 toString() { 504 toString() {
497 return "Throw of null."; 505 return "Throw of null.";
498 } 506 }
499 } 507 }
508 let _hasValue = Symbol('_hasValue');
500 class ArgumentError extends Error { 509 class ArgumentError extends Error {
501 ArgumentError(message) { 510 ArgumentError(message) {
502 if (message === void 0) 511 if (message === void 0)
503 message = null; 512 message = null;
504 this.message = message; 513 this.message = message;
505 this.invalidValue = null; 514 this.invalidValue = null;
506 this._hasValue = false; 515 this[_hasValue] = false;
507 this.name = null; 516 this.name = null;
508 super.Error(); 517 super.Error();
509 } 518 }
510 ArgumentError$value(value, name, message) { 519 ArgumentError$value(value, name, message) {
511 if (name === void 0) 520 if (name === void 0)
512 name = null; 521 name = null;
513 if (message === void 0) 522 if (message === void 0)
514 message = "Invalid argument"; 523 message = "Invalid argument";
515 this.name = name; 524 this.name = name;
516 this.message = message; 525 this.message = message;
517 this.invalidValue = value; 526 this.invalidValue = value;
518 this._hasValue = true; 527 this[_hasValue] = true;
519 super.Error(); 528 super.Error();
520 } 529 }
521 ArgumentError$notNull(name) { 530 ArgumentError$notNull(name) {
522 if (name === void 0) 531 if (name === void 0)
523 name = null; 532 name = null;
524 this.ArgumentError$value(null, name, "Must not be null"); 533 this.ArgumentError$value(null, name, "Must not be null");
525 } 534 }
526 toString() { 535 toString() {
527 if (!dart.notNull(this._hasValue)) { 536 if (!dart.notNull(this[_hasValue])) {
528 let result = "Invalid arguments(s)"; 537 let result = "Invalid arguments(s)";
529 if (this.message !== null) { 538 if (this.message !== null) {
530 result = `${result}: ${this.message}`; 539 result = `${result}: ${this.message}`;
531 } 540 }
532 return result; 541 return result;
533 } 542 }
534 let nameString = ""; 543 let nameString = "";
535 if (this.name !== null) { 544 if (this.name !== null) {
536 nameString = ` (${this.name})`; 545 nameString = ` (${this.name})`;
537 } 546 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 } 620 }
612 static checkNotNegative(value, name, message) { 621 static checkNotNegative(value, name, message) {
613 if (name === void 0) 622 if (name === void 0)
614 name = null; 623 name = null;
615 if (message === void 0) 624 if (message === void 0)
616 message = null; 625 message = null;
617 if (value < 0) 626 if (value < 0)
618 throw new RangeError.range(value, 0, dart.as(null, int), name, message); 627 throw new RangeError.range(value, 0, dart.as(null, int), name, message);
619 } 628 }
620 toString() { 629 toString() {
621 if (!dart.notNull(this._hasValue)) 630 if (!dart.notNull(this[_hasValue]))
622 return `RangeError: ${this.message}`; 631 return `RangeError: ${this.message}`;
623 let value = Error.safeToString(this.invalidValue); 632 let value = Error.safeToString(this.invalidValue);
624 let explanation = ""; 633 let explanation = "";
625 if (this.start === null) { 634 if (this.start === null) {
626 if (this.end !== null) { 635 if (this.end !== null) {
627 explanation = `: Not less than or equal to ${this.end}`; 636 explanation = `: Not less than or equal to ${this.end}`;
628 } 637 }
629 } else if (this.end === null) { 638 } else if (this.end === null) {
630 explanation = `: Not greater than or equal to ${this.start}`; 639 explanation = `: Not greater than or equal to ${this.start}`;
631 } else if (dart.notNull(this.end) > dart.notNull(this.start)) { 640 } else if (dart.notNull(this.end) > dart.notNull(this.start)) {
(...skipping 21 matching lines...) Expand all
653 this.length = dart.as(length !== null ? length : dart.dload(indexable, 'le ngth'), int); 662 this.length = dart.as(length !== null ? length : dart.dload(indexable, 'le ngth'), int);
654 super.ArgumentError$value(invalidValue, name, message !== null ? message : "Index out of range"); 663 super.ArgumentError$value(invalidValue, name, message !== null ? message : "Index out of range");
655 } 664 }
656 get start() { 665 get start() {
657 return 0; 666 return 0;
658 } 667 }
659 get end() { 668 get end() {
660 return this.length - 1; 669 return this.length - 1;
661 } 670 }
662 toString() { 671 toString() {
663 dart.assert(this._hasValue); 672 dart.assert(this[_hasValue]);
664 let target = Error.safeToString(this.indexable); 673 let target = Error.safeToString(this.indexable);
665 let explanation = `index should be less than ${this.length}`; 674 let explanation = `index should be less than ${this.length}`;
666 if (dart.dbinary(this.invalidValue, '<', 0)) { 675 if (dart.dbinary(this.invalidValue, '<', 0)) {
667 explanation = "index must not be negative"; 676 explanation = "index must not be negative";
668 } 677 }
669 return `RangeError: ${this.message} (${target}[${this.invalidValue}]): ${e xplanation}`; 678 return `RangeError: ${this.message} (${target}[${this.invalidValue}]): ${e xplanation}`;
670 } 679 }
671 } 680 }
672 class FallThroughError extends Error { 681 class FallThroughError extends Error {
673 FallThroughError() { 682 FallThroughError() {
674 super.Error(); 683 super.Error();
675 } 684 }
676 } 685 }
686 let _className = Symbol('_className');
677 class AbstractClassInstantiationError extends Error { 687 class AbstractClassInstantiationError extends Error {
678 AbstractClassInstantiationError(_className) { 688 AbstractClassInstantiationError($_className) {
679 this._className = _className; 689 this[_className] = $_className;
680 super.Error(); 690 super.Error();
681 } 691 }
682 toString() { 692 toString() {
683 return `Cannot instantiate abstract class: '${this._className}'`; 693 return `Cannot instantiate abstract class: '${this[_className]}'`;
684 } 694 }
685 } 695 }
696 let _receiver = Symbol('_receiver');
697 let _memberName = Symbol('_memberName');
698 let _arguments = Symbol('_arguments');
699 let _namedArguments = Symbol('_namedArguments');
700 let _existingArgumentNames = Symbol('_existingArgumentNames');
686 class NoSuchMethodError extends Error { 701 class NoSuchMethodError extends Error {
687 NoSuchMethodError(receiver, memberName, positionalArguments, namedArguments, existingArgumentNames) { 702 NoSuchMethodError(receiver, memberName, positionalArguments, namedArguments, existingArgumentNames) {
688 if (existingArgumentNames === void 0) 703 if (existingArgumentNames === void 0)
689 existingArgumentNames = null; 704 existingArgumentNames = null;
690 this._receiver = receiver; 705 this[_receiver] = receiver;
691 this._memberName = memberName; 706 this[_memberName] = memberName;
692 this._arguments = positionalArguments; 707 this[_arguments] = positionalArguments;
693 this._namedArguments = namedArguments; 708 this[_namedArguments] = namedArguments;
694 this._existingArgumentNames = existingArgumentNames; 709 this[_existingArgumentNames] = existingArgumentNames;
695 super.Error(); 710 super.Error();
696 } 711 }
697 toString() { 712 toString() {
698 let sb = new StringBuffer(); 713 let sb = new StringBuffer();
699 let i = 0; 714 let i = 0;
700 if (this._arguments !== null) { 715 if (this[_arguments] !== null) {
701 for (; i < this._arguments.length; i++) { 716 for (; i < this[_arguments].length; i++) {
702 if (i > 0) { 717 if (i > 0) {
703 sb.write(", "); 718 sb.write(", ");
704 } 719 }
705 sb.write(Error.safeToString(this._arguments.get(i))); 720 sb.write(Error.safeToString(this[_arguments].get(i)));
706 } 721 }
707 } 722 }
708 if (this._namedArguments !== null) { 723 if (this[_namedArguments] !== null) {
709 this._namedArguments.forEach(((key, value) => { 724 this[_namedArguments].forEach(((key, value) => {
710 if (i > 0) { 725 if (i > 0) {
711 sb.write(", "); 726 sb.write(", ");
712 } 727 }
713 sb.write(_symbolToString(key)); 728 sb.write(_symbolToString(key));
714 sb.write(": "); 729 sb.write(": ");
715 sb.write(Error.safeToString(value)); 730 sb.write(Error.safeToString(value));
716 i++; 731 i++;
717 }).bind(this)); 732 }).bind(this));
718 } 733 }
719 if (this._existingArgumentNames === null) { 734 if (this[_existingArgumentNames] === null) {
720 return `NoSuchMethodError : method not found: '${this._memberName}'\n` + `Receiver: ${Error.safeToString(this._receiver)}\n` + `Arguments: [${sb}]`; 735 return `NoSuchMethodError : method not found: '${this[_memberName]}'\n` + `Receiver: ${Error.safeToString(this[_receiver])}\n` + `Arguments: [${sb}]`;
721 } else { 736 } else {
722 let actualParameters = sb.toString(); 737 let actualParameters = sb.toString();
723 sb = new StringBuffer(); 738 sb = new StringBuffer();
724 for (let i = 0; i < this._existingArgumentNames.length; i++) { 739 for (let i = 0; i < this[_existingArgumentNames].length; i++) {
725 if (i > 0) { 740 if (i > 0) {
726 sb.write(", "); 741 sb.write(", ");
727 } 742 }
728 sb.write(this._existingArgumentNames.get(i)); 743 sb.write(this[_existingArgumentNames].get(i));
729 } 744 }
730 let formalParameters = sb.toString(); 745 let formalParameters = sb.toString();
731 return "NoSuchMethodError: incorrect number of arguments passed to " + ` method named '${this._memberName}'\n` + `Receiver: ${Error.safeToString(this._re ceiver)}\n` + `Tried calling: ${this._memberName}(${actualParameters})\n` + `Fou nd: ${this._memberName}(${formalParameters})`; 746 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})`;
732 } 747 }
733 } 748 }
734 } 749 }
735 class UnsupportedError extends Error { 750 class UnsupportedError extends Error {
736 UnsupportedError(message) { 751 UnsupportedError(message) {
737 this.message = message; 752 this.message = message;
738 super.Error(); 753 super.Error();
739 } 754 }
740 toString() { 755 toString() {
741 return `Unsupported operation: ${this.message}`; 756 return `Unsupported operation: ${this.message}`;
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 return `${report}${prefix}${slice}${postfix}\n${String['*'](" ", markOffse t)}^\n`; 928 return `${report}${prefix}${slice}${postfix}\n${String['*'](" ", markOffse t)}^\n`;
914 } 929 }
915 } 930 }
916 class IntegerDivisionByZeroException extends dart.Object { 931 class IntegerDivisionByZeroException extends dart.Object {
917 IntegerDivisionByZeroException() { 932 IntegerDivisionByZeroException() {
918 } 933 }
919 toString() { 934 toString() {
920 return "IntegerDivisionByZeroException"; 935 return "IntegerDivisionByZeroException";
921 } 936 }
922 } 937 }
938 let _getKey = Symbol('_getKey');
923 let Expando$ = dart.generic(function(T) { 939 let Expando$ = dart.generic(function(T) {
924 class Expando extends dart.Object { 940 class Expando extends dart.Object {
925 Expando(name) { 941 Expando(name) {
926 if (name === void 0) 942 if (name === void 0)
927 name = null; 943 name = null;
928 this.name = name; 944 this.name = name;
929 } 945 }
930 toString() { 946 toString() {
931 return `Expando:${this.name}`; 947 return `Expando:${this.name}`;
932 } 948 }
933 get(object) { 949 get(object) {
934 let values = _js_helper.Primitives.getProperty(object, _EXPANDO_PROPERTY _NAME); 950 let values = _js_helper.Primitives.getProperty(object, _EXPANDO_PROPERTY _NAME);
935 return dart.as(values === null ? null : _js_helper.Primitives.getPropert y(values, this._getKey()), T); 951 return dart.as(values === null ? null : _js_helper.Primitives.getPropert y(values, this[_getKey]()), T);
936 } 952 }
937 set(object, value) { 953 set(object, value) {
938 let values = _js_helper.Primitives.getProperty(object, _EXPANDO_PROPERTY _NAME); 954 let values = _js_helper.Primitives.getProperty(object, _EXPANDO_PROPERTY _NAME);
939 if (values === null) { 955 if (values === null) {
940 values = new Object(); 956 values = new Object();
941 _js_helper.Primitives.setProperty(object, _EXPANDO_PROPERTY_NAME, valu es); 957 _js_helper.Primitives.setProperty(object, _EXPANDO_PROPERTY_NAME, valu es);
942 } 958 }
943 _js_helper.Primitives.setProperty(values, this._getKey(), value); 959 _js_helper.Primitives.setProperty(values, this[_getKey](), value);
944 } 960 }
945 _getKey() { 961 [_getKey]() {
946 let key = dart.as(_js_helper.Primitives.getProperty(this, _KEY_PROPERTY_ NAME), String); 962 let key = dart.as(_js_helper.Primitives.getProperty(this, _KEY_PROPERTY_ NAME), String);
947 if (key === null) { 963 if (key === null) {
948 key = `expando$key$${_keyCount++}`; 964 key = `expando$key$${_keyCount++}`;
949 _js_helper.Primitives.setProperty(this, _KEY_PROPERTY_NAME, key); 965 _js_helper.Primitives.setProperty(this, _KEY_PROPERTY_NAME, key);
950 } 966 }
951 return key; 967 return key;
952 } 968 }
953 } 969 }
954 Expando._KEY_PROPERTY_NAME = 'expando$key'; 970 Expando._KEY_PROPERTY_NAME = 'expando$key';
955 Expando._EXPANDO_PROPERTY_NAME = 'expando$values'; 971 Expando._EXPANDO_PROPERTY_NAME = 'expando$values';
956 Expando._keyCount = 0; 972 Expando._keyCount = 0;
957 return Expando; 973 return Expando;
958 }); 974 });
959 let Expando = Expando$(dynamic); 975 let Expando = Expando$(dynamic);
976 let _toMangledNames = Symbol('_toMangledNames');
960 class Function extends dart.Object { 977 class Function extends dart.Object {
961 static apply(function, positionalArguments, namedArguments) { 978 static apply(function, positionalArguments, namedArguments) {
962 if (namedArguments === void 0) 979 if (namedArguments === void 0)
963 namedArguments = null; 980 namedArguments = null;
964 return _js_helper.Primitives.applyFunction(function, positionalArguments, dart.as(namedArguments === null ? null : _toMangledNames(namedArguments), Map$(S tring, dynamic))); 981 return _js_helper.Primitives.applyFunction(function, positionalArguments, dart.as(namedArguments === null ? null : _toMangledNames(namedArguments), Map$(S tring, dynamic)));
965 } 982 }
966 static _toMangledNames(namedArguments) { 983 static [_toMangledNames](namedArguments) {
967 let result = dart.as(dart.map(), Map$(String, dynamic)); 984 let result = dart.as(dart.map(), Map$(String, dynamic));
968 namedArguments.forEach((symbol, value) => { 985 namedArguments.forEach((symbol, value) => {
969 result.set(_symbolToString(dart.as(symbol, Symbol)), value); 986 result.set(_symbolToString(dart.as(symbol, Symbol)), value);
970 }); 987 });
971 return result; 988 return result;
972 } 989 }
973 } 990 }
974 // Function identical: (Object, Object) → bool 991 // Function identical: (Object, Object) → bool
975 function identical(a, b) { 992 function identical(a, b) {
976 return _js_helper.Primitives.identicalImplementation(a, b); 993 return _js_helper.Primitives.identicalImplementation(a, b);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 var done = iterator.moveNext(); 1038 var done = iterator.moveNext();
1022 return {done: done, current: done ? void 0 : iterator.current}; 1039 return {done: done, current: done ? void 0 : iterator.current};
1023 } 1040 }
1024 }; 1041 };
1025 } 1042 }
1026 } 1043 }
1027 dart.defineNamedConstructor(Iterable, 'generate'); 1044 dart.defineNamedConstructor(Iterable, 'generate');
1028 return Iterable; 1045 return Iterable;
1029 }); 1046 });
1030 let Iterable = Iterable$(dynamic); 1047 let Iterable = Iterable$(dynamic);
1048 let _end = Symbol('_end');
1049 let _start = Symbol('_start');
1050 let _generator = Symbol('_generator');
1051 let _id = Symbol('_id');
1031 let _GeneratorIterable$ = dart.generic(function(E) { 1052 let _GeneratorIterable$ = dart.generic(function(E) {
1032 class _GeneratorIterable extends collection.IterableBase$(E) { 1053 class _GeneratorIterable extends collection.IterableBase$(E) {
1033 _GeneratorIterable(_end, generator) { 1054 _GeneratorIterable($_end, generator) {
1034 this._end = _end; 1055 this[_end] = $_end;
1035 this._start = 0; 1056 this[_start] = 0;
1036 this._generator = dart.as(generator !== null ? generator : _id, _Generat or); 1057 this[_generator] = dart.as(generator !== null ? generator : _id, _Genera tor);
1037 super.IterableBase(); 1058 super.IterableBase();
1038 } 1059 }
1039 _GeneratorIterable$slice(_start, _end, _generator) { 1060 _GeneratorIterable$slice($_start, $_end, $_generator) {
1040 this._start = _start; 1061 this[_start] = $_start;
1041 this._end = _end; 1062 this[_end] = $_end;
1042 this._generator = _generator; 1063 this[_generator] = $_generator;
1043 super.IterableBase(); 1064 super.IterableBase();
1044 } 1065 }
1045 get iterator() { 1066 get iterator() {
1046 return new _GeneratorIterator(this._start, this._end, this._generator); 1067 return new _GeneratorIterator(this[_start], this[_end], this[_generator] );
1047 } 1068 }
1048 get length() { 1069 get length() {
1049 return this._end - this._start; 1070 return this[_end] - this[_start];
1050 } 1071 }
1051 skip(count) { 1072 skip(count) {
1052 RangeError.checkNotNegative(count, "count"); 1073 RangeError.checkNotNegative(count, "count");
1053 if (count === 0) 1074 if (count === 0)
1054 return this; 1075 return this;
1055 let newStart = this._start + count; 1076 let newStart = this[_start] + count;
1056 if (newStart >= this._end) 1077 if (newStart >= this[_end])
1057 return new _internal.EmptyIterable(); 1078 return new _internal.EmptyIterable();
1058 return new _GeneratorIterable.slice(newStart, this._end, this._generator ); 1079 return new _GeneratorIterable.slice(newStart, this[_end], this[_generato r]);
1059 } 1080 }
1060 take(count) { 1081 take(count) {
1061 RangeError.checkNotNegative(count, "count"); 1082 RangeError.checkNotNegative(count, "count");
1062 if (count === 0) 1083 if (count === 0)
1063 return new _internal.EmptyIterable(); 1084 return new _internal.EmptyIterable();
1064 let newEnd = this._start + count; 1085 let newEnd = this[_start] + count;
1065 if (newEnd >= this._end) 1086 if (newEnd >= this[_end])
1066 return this; 1087 return this;
1067 return new _GeneratorIterable.slice(this._start, newEnd, this._generator ); 1088 return new _GeneratorIterable.slice(this[_start], newEnd, this[_generato r]);
1068 } 1089 }
1069 static _id(n) { 1090 static [_id](n) {
1070 return n; 1091 return n;
1071 } 1092 }
1072 } 1093 }
1073 dart.defineNamedConstructor(_GeneratorIterable, 'slice'); 1094 dart.defineNamedConstructor(_GeneratorIterable, 'slice');
1074 return _GeneratorIterable; 1095 return _GeneratorIterable;
1075 }); 1096 });
1076 let _GeneratorIterable = _GeneratorIterable$(dynamic); 1097 let _GeneratorIterable = _GeneratorIterable$(dynamic);
1098 let _index = Symbol('_index');
1099 let _current = Symbol('_current');
1077 let _GeneratorIterator$ = dart.generic(function(E) { 1100 let _GeneratorIterator$ = dart.generic(function(E) {
1078 class _GeneratorIterator extends dart.Object { 1101 class _GeneratorIterator extends dart.Object {
1079 _GeneratorIterator(_index, _end, _generator) { 1102 _GeneratorIterator($_index, $_end, $_generator) {
1080 this._index = _index; 1103 this[_index] = $_index;
1081 this._end = _end; 1104 this[_end] = $_end;
1082 this._generator = _generator; 1105 this[_generator] = $_generator;
1083 this._current = dart.as(null, E); 1106 this[_current] = dart.as(null, E);
1084 } 1107 }
1085 moveNext() { 1108 moveNext() {
1086 if (this._index < this._end) { 1109 if (this[_index] < this[_end]) {
1087 this._current = this._generator(this._index); 1110 this[_current] = this[_generator](this[_index]);
1088 this._index++; 1111 this[_index]++;
1089 return true; 1112 return true;
1090 } else { 1113 } else {
1091 this._current = dart.as(null, E); 1114 this[_current] = dart.as(null, E);
1092 return false; 1115 return false;
1093 } 1116 }
1094 } 1117 }
1095 get current() { 1118 get current() {
1096 return this._current; 1119 return this[_current];
1097 } 1120 }
1098 } 1121 }
1099 return _GeneratorIterator; 1122 return _GeneratorIterator;
1100 }); 1123 });
1101 let _GeneratorIterator = _GeneratorIterator$(dynamic); 1124 let _GeneratorIterator = _GeneratorIterator$(dynamic);
1102 let BidirectionalIterator$ = dart.generic(function(E) { 1125 let BidirectionalIterator$ = dart.generic(function(E) {
1103 class BidirectionalIterator extends dart.Object { 1126 class BidirectionalIterator extends dart.Object {
1104 } 1127 }
1105 return BidirectionalIterator; 1128 return BidirectionalIterator;
1106 }); 1129 });
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 let Map = Map$(dynamic, dynamic); 1213 let Map = Map$(dynamic, dynamic);
1191 class Null extends dart.Object { 1214 class Null extends dart.Object {
1192 Null$_uninstantiable() { 1215 Null$_uninstantiable() {
1193 throw new UnsupportedError('class Null cannot be instantiated'); 1216 throw new UnsupportedError('class Null cannot be instantiated');
1194 } 1217 }
1195 toString() { 1218 toString() {
1196 return "null"; 1219 return "null";
1197 } 1220 }
1198 } 1221 }
1199 dart.defineNamedConstructor(Null, '_uninstantiable'); 1222 dart.defineNamedConstructor(Null, '_uninstantiable');
1223 let _onParseErrorInt = Symbol('_onParseErrorInt');
1224 let _onParseErrorDouble = Symbol('_onParseErrorDouble');
1200 class num extends dart.Object { 1225 class num extends dart.Object {
1201 static parse(input, onError) { 1226 static parse(input, onError) {
1202 if (onError === void 0) 1227 if (onError === void 0)
1203 onError = null; 1228 onError = null;
1204 let source = input.trim(); 1229 let source = input.trim();
1205 _parseError = false; 1230 _parseError = false;
1206 let result = int.parse(source, {onError: _onParseErrorInt}); 1231 let result = int.parse(source, {onError: _onParseErrorInt});
1207 if (!dart.notNull(_parseError)) 1232 if (!dart.notNull(_parseError))
1208 return result; 1233 return result;
1209 _parseError = false; 1234 _parseError = false;
1210 result = double.parse(source, _onParseErrorDouble); 1235 result = double.parse(source, _onParseErrorDouble);
1211 if (!dart.notNull(_parseError)) 1236 if (!dart.notNull(_parseError))
1212 return result; 1237 return result;
1213 if (onError === null) 1238 if (onError === null)
1214 throw new FormatException(input); 1239 throw new FormatException(input);
1215 return onError(input); 1240 return onError(input);
1216 } 1241 }
1217 static _onParseErrorInt(_) { 1242 static [_onParseErrorInt](_) {
1218 _parseError = true; 1243 _parseError = true;
1219 return 0; 1244 return 0;
1220 } 1245 }
1221 static _onParseErrorDouble(_) { 1246 static [_onParseErrorDouble](_) {
1222 _parseError = true; 1247 _parseError = true;
1223 return 0.0; 1248 return 0.0;
1224 } 1249 }
1225 } 1250 }
1226 num._parseError = false; 1251 num._parseError = false;
1227 class Object extends dart.Object { 1252 class Object extends dart.Object {
1228 Object() { 1253 Object() {
1229 } 1254 }
1230 ['=='](other) { 1255 ['=='](other) {
1231 return identical(this, other); 1256 return identical(this, other);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 }); 1306 });
1282 let Set = Set$(dynamic); 1307 let Set = Set$(dynamic);
1283 let Sink$ = dart.generic(function(T) { 1308 let Sink$ = dart.generic(function(T) {
1284 class Sink extends dart.Object { 1309 class Sink extends dart.Object {
1285 } 1310 }
1286 return Sink; 1311 return Sink;
1287 }); 1312 });
1288 let Sink = Sink$(dynamic); 1313 let Sink = Sink$(dynamic);
1289 class StackTrace extends dart.Object { 1314 class StackTrace extends dart.Object {
1290 } 1315 }
1316 let _stop = Symbol('_stop');
1317 let _initTicker = Symbol('_initTicker');
1318 let _now = Symbol('_now');
1291 class Stopwatch extends dart.Object { 1319 class Stopwatch extends dart.Object {
1292 get frequency() { 1320 get frequency() {
1293 return _frequency; 1321 return _frequency;
1294 } 1322 }
1295 Stopwatch() { 1323 Stopwatch() {
1296 this._start = null; 1324 this[_start] = null;
1297 this._stop = null; 1325 this[_stop] = null;
1298 _initTicker(); 1326 _initTicker();
1299 } 1327 }
1300 start() { 1328 start() {
1301 if (this.isRunning) 1329 if (this.isRunning)
1302 return; 1330 return;
1303 if (this._start === null) { 1331 if (this[_start] === null) {
1304 this._start = _now(); 1332 this[_start] = _now();
1305 } else { 1333 } else {
1306 this._start = _now() - dart.notNull(dart.notNull(this._stop) - dart.notN ull(this._start)); 1334 this[_start] = _now() - dart.notNull(dart.notNull(this[_stop]) - dart.no tNull(this[_start]));
1307 this._stop = null; 1335 this[_stop] = null;
1308 } 1336 }
1309 } 1337 }
1310 stop() { 1338 stop() {
1311 if (!dart.notNull(this.isRunning)) 1339 if (!dart.notNull(this.isRunning))
1312 return; 1340 return;
1313 this._stop = _now(); 1341 this[_stop] = _now();
1314 } 1342 }
1315 reset() { 1343 reset() {
1316 if (this._start === null) 1344 if (this[_start] === null)
1317 return; 1345 return;
1318 this._start = _now(); 1346 this[_start] = _now();
1319 if (this._stop !== null) { 1347 if (this[_stop] !== null) {
1320 this._stop = this._start; 1348 this[_stop] = this[_start];
1321 } 1349 }
1322 } 1350 }
1323 get elapsedTicks() { 1351 get elapsedTicks() {
1324 if (this._start === null) { 1352 if (this[_start] === null) {
1325 return 0; 1353 return 0;
1326 } 1354 }
1327 return dart.notNull(this._stop === null ? _now() - dart.notNull(this._star t) : dart.notNull(this._stop) - dart.notNull(this._start)); 1355 return dart.notNull(this[_stop] === null ? _now() - dart.notNull(this[_sta rt]) : dart.notNull(this[_stop]) - dart.notNull(this[_start]));
1328 } 1356 }
1329 get elapsed() { 1357 get elapsed() {
1330 return new Duration({microseconds: this.elapsedMicroseconds}); 1358 return new Duration({microseconds: this.elapsedMicroseconds});
1331 } 1359 }
1332 get elapsedMicroseconds() { 1360 get elapsedMicroseconds() {
1333 return (this.elapsedTicks * 1000000 / this.frequency).truncate(); 1361 return (this.elapsedTicks * 1000000 / this.frequency).truncate();
1334 } 1362 }
1335 get elapsedMilliseconds() { 1363 get elapsedMilliseconds() {
1336 return (this.elapsedTicks * 1000 / this.frequency).truncate(); 1364 return (this.elapsedTicks * 1000 / this.frequency).truncate();
1337 } 1365 }
1338 get isRunning() { 1366 get isRunning() {
1339 return dart.notNull(this._start !== null) && dart.notNull(this._stop === n ull); 1367 return dart.notNull(this[_start] !== null) && dart.notNull(this[_stop] === null);
1340 } 1368 }
1341 static _initTicker() { 1369 static [_initTicker]() {
1342 _js_helper.Primitives.initTicker(); 1370 _js_helper.Primitives.initTicker();
1343 _frequency = _js_helper.Primitives.timerFrequency; 1371 _frequency = _js_helper.Primitives.timerFrequency;
1344 } 1372 }
1345 static _now() { 1373 static [_now]() {
1346 return dart.as(dart.dinvoke(_js_helper.Primitives, 'timerTicks'), int); 1374 return dart.as(dart.dinvoke(_js_helper.Primitives, 'timerTicks'), int);
1347 } 1375 }
1348 } 1376 }
1349 Stopwatch._frequency = null; 1377 Stopwatch._frequency = null;
1378 let _stringFromIterable = Symbol('_stringFromIterable');
1350 class String extends dart.Object { 1379 class String extends dart.Object {
1351 String$fromCharCodes(charCodes, start, end) { 1380 String$fromCharCodes(charCodes, start, end) {
1352 if (start === void 0) 1381 if (start === void 0)
1353 start = 0; 1382 start = 0;
1354 if (end === void 0) 1383 if (end === void 0)
1355 end = null; 1384 end = null;
1356 if (!dart.is(charCodes, _interceptors.JSArray)) { 1385 if (!dart.is(charCodes, _interceptors.JSArray)) {
1357 return _stringFromIterable(charCodes, start, end); 1386 return _stringFromIterable(charCodes, start, end);
1358 } 1387 }
1359 let list = dart.as(charCodes, List); 1388 let list = dart.as(charCodes, List);
(...skipping 11 matching lines...) Expand all
1371 } 1400 }
1372 return _js_helper.Primitives.stringFromCharCodes(list); 1401 return _js_helper.Primitives.stringFromCharCodes(list);
1373 } 1402 }
1374 String$fromCharCode(charCode) { 1403 String$fromCharCode(charCode) {
1375 return _js_helper.Primitives.stringFromCharCode(charCode); 1404 return _js_helper.Primitives.stringFromCharCode(charCode);
1376 } 1405 }
1377 String$fromEnvironment(name, opt$) { 1406 String$fromEnvironment(name, opt$) {
1378 let defaultValue = opt$.defaultValue === void 0 ? null : opt$.defaultValue ; 1407 let defaultValue = opt$.defaultValue === void 0 ? null : opt$.defaultValue ;
1379 throw new UnsupportedError('String.fromEnvironment can only be used as a c onst constructor'); 1408 throw new UnsupportedError('String.fromEnvironment can only be used as a c onst constructor');
1380 } 1409 }
1381 static _stringFromIterable(charCodes, start, end) { 1410 static [_stringFromIterable](charCodes, start, end) {
1382 if (start < 0) 1411 if (start < 0)
1383 throw new RangeError.range(start, 0, charCodes.length); 1412 throw new RangeError.range(start, 0, charCodes.length);
1384 if (dart.notNull(end !== null) && dart.notNull(end < start)) { 1413 if (dart.notNull(end !== null) && dart.notNull(end < start)) {
1385 throw new RangeError.range(end, start, charCodes.length); 1414 throw new RangeError.range(end, start, charCodes.length);
1386 } 1415 }
1387 let it = charCodes.iterator; 1416 let it = charCodes.iterator;
1388 for (let i = 0; i < start; i++) { 1417 for (let i = 0; i < start; i++) {
1389 if (!dart.notNull(it.moveNext())) { 1418 if (!dart.notNull(it.moveNext())) {
1390 throw new RangeError.range(start, 0, i); 1419 throw new RangeError.range(start, 0, i);
1391 } 1420 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 return (code & 64512) === 55296; 1465 return (code & 64512) === 55296;
1437 } 1466 }
1438 // Function _isTrailSurrogate: (int) → bool 1467 // Function _isTrailSurrogate: (int) → bool
1439 function _isTrailSurrogate(code) { 1468 function _isTrailSurrogate(code) {
1440 return (code & 64512) === 56320; 1469 return (code & 64512) === 56320;
1441 } 1470 }
1442 // Function _combineSurrogatePair: (int, int) → int 1471 // Function _combineSurrogatePair: (int, int) → int
1443 function _combineSurrogatePair(start, end) { 1472 function _combineSurrogatePair(start, end) {
1444 return 65536 + ((start & 1023) << 10) + (end & 1023); 1473 return 65536 + ((start & 1023) << 10) + (end & 1023);
1445 } 1474 }
1475 let _position = Symbol('_position');
1476 let _nextPosition = Symbol('_nextPosition');
1477 let _currentCodePoint = Symbol('_currentCodePoint');
1478 let _checkSplitSurrogate = Symbol('_checkSplitSurrogate');
1446 class RuneIterator extends dart.Object { 1479 class RuneIterator extends dart.Object {
1447 RuneIterator(string) { 1480 RuneIterator(string) {
1448 this.string = string; 1481 this.string = string;
1449 this._position = 0; 1482 this[_position] = 0;
1450 this._nextPosition = 0; 1483 this[_nextPosition] = 0;
1451 this._currentCodePoint = null; 1484 this[_currentCodePoint] = null;
1452 } 1485 }
1453 RuneIterator$at(string, index) { 1486 RuneIterator$at(string, index) {
1454 this.string = string; 1487 this.string = string;
1455 this._position = index; 1488 this[_position] = index;
1456 this._nextPosition = index; 1489 this[_nextPosition] = index;
1457 this._currentCodePoint = null; 1490 this[_currentCodePoint] = null;
1458 RangeError.checkValueInInterval(index, 0, string.length); 1491 RangeError.checkValueInInterval(index, 0, string.length);
1459 this._checkSplitSurrogate(index); 1492 this[_checkSplitSurrogate](index);
1460 } 1493 }
1461 _checkSplitSurrogate(index) { 1494 [_checkSplitSurrogate](index) {
1462 if (dart.notNull(dart.notNull(dart.notNull(index > 0) && dart.notNull(inde x < this.string.length)) && dart.notNull(_isLeadSurrogate(this.string.codeUnitAt (index - 1)))) && dart.notNull(_isTrailSurrogate(this.string.codeUnitAt(index))) ) { 1495 if (dart.notNull(dart.notNull(dart.notNull(index > 0) && dart.notNull(inde x < this.string.length)) && dart.notNull(_isLeadSurrogate(this.string.codeUnitAt (index - 1)))) && dart.notNull(_isTrailSurrogate(this.string.codeUnitAt(index))) ) {
1463 throw new ArgumentError(`Index inside surrogate pair: ${index}`); 1496 throw new ArgumentError(`Index inside surrogate pair: ${index}`);
1464 } 1497 }
1465 } 1498 }
1466 get rawIndex() { 1499 get rawIndex() {
1467 return dart.as(this._position !== this._nextPosition ? this._position : nu ll, int); 1500 return dart.as(this[_position] !== this[_nextPosition] ? this[_position] : null, int);
1468 } 1501 }
1469 set rawIndex(rawIndex) { 1502 set rawIndex(rawIndex) {
1470 RangeError.checkValidIndex(rawIndex, this.string, "rawIndex"); 1503 RangeError.checkValidIndex(rawIndex, this.string, "rawIndex");
1471 this.reset(rawIndex); 1504 this.reset(rawIndex);
1472 this.moveNext(); 1505 this.moveNext();
1473 } 1506 }
1474 reset(rawIndex) { 1507 reset(rawIndex) {
1475 if (rawIndex === void 0) 1508 if (rawIndex === void 0)
1476 rawIndex = 0; 1509 rawIndex = 0;
1477 RangeError.checkValueInInterval(rawIndex, 0, this.string.length, "rawIndex "); 1510 RangeError.checkValueInInterval(rawIndex, 0, this.string.length, "rawIndex ");
1478 this._checkSplitSurrogate(rawIndex); 1511 this[_checkSplitSurrogate](rawIndex);
1479 this._position = this._nextPosition = rawIndex; 1512 this[_position] = this[_nextPosition] = rawIndex;
1480 this._currentCodePoint = null; 1513 this[_currentCodePoint] = null;
1481 } 1514 }
1482 get current() { 1515 get current() {
1483 return dart.notNull(this._currentCodePoint); 1516 return dart.notNull(this[_currentCodePoint]);
1484 } 1517 }
1485 get currentSize() { 1518 get currentSize() {
1486 return this._nextPosition - this._position; 1519 return this[_nextPosition] - this[_position];
1487 } 1520 }
1488 get currentAsString() { 1521 get currentAsString() {
1489 if (this._position === this._nextPosition) 1522 if (this[_position] === this[_nextPosition])
1490 return null; 1523 return null;
1491 if (this._position + 1 === this._nextPosition) 1524 if (this[_position] + 1 === this[_nextPosition])
1492 return this.string.get(this._position); 1525 return this.string.get(this[_position]);
1493 return this.string.substring(this._position, this._nextPosition); 1526 return this.string.substring(this[_position], this[_nextPosition]);
1494 } 1527 }
1495 moveNext() { 1528 moveNext() {
1496 this._position = this._nextPosition; 1529 this[_position] = this[_nextPosition];
1497 if (this._position === this.string.length) { 1530 if (this[_position] === this.string.length) {
1498 this._currentCodePoint = null; 1531 this[_currentCodePoint] = null;
1499 return false; 1532 return false;
1500 } 1533 }
1501 let codeUnit = this.string.codeUnitAt(this._position); 1534 let codeUnit = this.string.codeUnitAt(this[_position]);
1502 let nextPosition = this._position + 1; 1535 let nextPosition = this[_position] + 1;
1503 if (dart.notNull(_isLeadSurrogate(codeUnit)) && dart.notNull(nextPosition < this.string.length)) { 1536 if (dart.notNull(_isLeadSurrogate(codeUnit)) && dart.notNull(nextPosition < this.string.length)) {
1504 let nextCodeUnit = this.string.codeUnitAt(nextPosition); 1537 let nextCodeUnit = this.string.codeUnitAt(nextPosition);
1505 if (_isTrailSurrogate(nextCodeUnit)) { 1538 if (_isTrailSurrogate(nextCodeUnit)) {
1506 this._nextPosition = nextPosition + 1; 1539 this[_nextPosition] = nextPosition + 1;
1507 this._currentCodePoint = _combineSurrogatePair(codeUnit, nextCodeUnit) ; 1540 this[_currentCodePoint] = _combineSurrogatePair(codeUnit, nextCodeUnit );
1508 return true; 1541 return true;
1509 } 1542 }
1510 } 1543 }
1511 this._nextPosition = nextPosition; 1544 this[_nextPosition] = nextPosition;
1512 this._currentCodePoint = codeUnit; 1545 this[_currentCodePoint] = codeUnit;
1513 return true; 1546 return true;
1514 } 1547 }
1515 movePrevious() { 1548 movePrevious() {
1516 this._nextPosition = this._position; 1549 this[_nextPosition] = this[_position];
1517 if (this._position === 0) { 1550 if (this[_position] === 0) {
1518 this._currentCodePoint = null; 1551 this[_currentCodePoint] = null;
1519 return false; 1552 return false;
1520 } 1553 }
1521 let position = this._position - 1; 1554 let position = this[_position] - 1;
1522 let codeUnit = this.string.codeUnitAt(position); 1555 let codeUnit = this.string.codeUnitAt(position);
1523 if (dart.notNull(_isTrailSurrogate(codeUnit)) && dart.notNull(position > 0 )) { 1556 if (dart.notNull(_isTrailSurrogate(codeUnit)) && dart.notNull(position > 0 )) {
1524 let prevCodeUnit = this.string.codeUnitAt(position - 1); 1557 let prevCodeUnit = this.string.codeUnitAt(position - 1);
1525 if (_isLeadSurrogate(prevCodeUnit)) { 1558 if (_isLeadSurrogate(prevCodeUnit)) {
1526 this._position = position - 1; 1559 this[_position] = position - 1;
1527 this._currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit) ; 1560 this[_currentCodePoint] = _combineSurrogatePair(prevCodeUnit, codeUnit );
1528 return true; 1561 return true;
1529 } 1562 }
1530 } 1563 }
1531 this._position = position; 1564 this[_position] = position;
1532 this._currentCodePoint = codeUnit; 1565 this[_currentCodePoint] = codeUnit;
1533 return true; 1566 return true;
1534 } 1567 }
1535 } 1568 }
1536 dart.defineNamedConstructor(RuneIterator, 'at'); 1569 dart.defineNamedConstructor(RuneIterator, 'at');
1570 let _contents = Symbol('_contents');
1571 let _writeString = Symbol('_writeString');
1537 class StringBuffer extends dart.Object { 1572 class StringBuffer extends dart.Object {
1538 StringBuffer(content) { 1573 StringBuffer(content) {
1539 if (content === void 0) 1574 if (content === void 0)
1540 content = ""; 1575 content = "";
1541 this._contents = `${content}`; 1576 this[_contents] = `${content}`;
1542 } 1577 }
1543 get length() { 1578 get length() {
1544 return this._contents.length; 1579 return this[_contents].length;
1545 } 1580 }
1546 get isEmpty() { 1581 get isEmpty() {
1547 return this.length === 0; 1582 return this.length === 0;
1548 } 1583 }
1549 get isNotEmpty() { 1584 get isNotEmpty() {
1550 return !dart.notNull(this.isEmpty); 1585 return !dart.notNull(this.isEmpty);
1551 } 1586 }
1552 write(obj) { 1587 write(obj) {
1553 this._writeString(`${obj}`); 1588 this[_writeString](`${obj}`);
1554 } 1589 }
1555 writeCharCode(charCode) { 1590 writeCharCode(charCode) {
1556 this._writeString(new String.fromCharCode(charCode)); 1591 this[_writeString](new String.fromCharCode(charCode));
1557 } 1592 }
1558 writeAll(objects, separator) { 1593 writeAll(objects, separator) {
1559 if (separator === void 0) 1594 if (separator === void 0)
1560 separator = ""; 1595 separator = "";
1561 let iterator = objects.iterator; 1596 let iterator = objects.iterator;
1562 if (!dart.notNull(iterator.moveNext())) 1597 if (!dart.notNull(iterator.moveNext()))
1563 return; 1598 return;
1564 if (separator.isEmpty) { 1599 if (separator.isEmpty) {
1565 do { 1600 do {
1566 this.write(iterator.current); 1601 this.write(iterator.current);
1567 } while (iterator.moveNext()); 1602 } while (iterator.moveNext());
1568 } else { 1603 } else {
1569 this.write(iterator.current); 1604 this.write(iterator.current);
1570 while (iterator.moveNext()) { 1605 while (iterator.moveNext()) {
1571 this.write(separator); 1606 this.write(separator);
1572 this.write(iterator.current); 1607 this.write(iterator.current);
1573 } 1608 }
1574 } 1609 }
1575 } 1610 }
1576 writeln(obj) { 1611 writeln(obj) {
1577 if (obj === void 0) 1612 if (obj === void 0)
1578 obj = ""; 1613 obj = "";
1579 this.write(obj); 1614 this.write(obj);
1580 this.write("\n"); 1615 this.write("\n");
1581 } 1616 }
1582 clear() { 1617 clear() {
1583 this._contents = ""; 1618 this[_contents] = "";
1584 } 1619 }
1585 toString() { 1620 toString() {
1586 return _js_helper.Primitives.flattenString(this._contents); 1621 return _js_helper.Primitives.flattenString(this[_contents]);
1587 } 1622 }
1588 _writeString(str) { 1623 [_writeString](str) {
1589 this._contents = _js_helper.Primitives.stringConcatUnchecked(this._content s, dart.as(str, String)); 1624 this[_contents] = _js_helper.Primitives.stringConcatUnchecked(this[_conten ts], dart.as(str, String));
1590 } 1625 }
1591 } 1626 }
1592 class StringSink extends dart.Object { 1627 class StringSink extends dart.Object {
1593 } 1628 }
1594 class Symbol extends dart.Object { 1629 class Symbol extends dart.Object {
1595 Symbol(name) { 1630 Symbol(name) {
1596 return new _internal.Symbol(name); 1631 return new _internal.Symbol(name);
1597 } 1632 }
1598 } 1633 }
1599 class Type extends dart.Object { 1634 class Type extends dart.Object {
1600 } 1635 }
1636 let _writeAuthority = Symbol('_writeAuthority');
1637 let _userInfo = Symbol('_userInfo');
1638 let _host = Symbol('_host');
1639 let _port = Symbol('_port');
1640 let _defaultPort = Symbol('_defaultPort');
1641 let _path = Symbol('_path');
1642 let _query = Symbol('_query');
1643 let _fragment = Symbol('_fragment');
1644 let _fail = Symbol('_fail');
1645 let _pathSegments = Symbol('_pathSegments');
1646 let _queryParameters = Symbol('_queryParameters');
1647 let _makeHttpUri = Symbol('_makeHttpUri');
1648 let _isWindows = Symbol('_isWindows');
1649 let _checkNonWindowsPathReservedCharacters = Symbol('_checkNonWindowsPathReser vedCharacters');
1650 let _checkWindowsPathReservedCharacters = Symbol('_checkWindowsPathReservedCha racters');
1651 let _checkWindowsDriveLetter = Symbol('_checkWindowsDriveLetter');
1652 let _makeFileUri = Symbol('_makeFileUri');
1653 let _makeWindowsFileUrl = Symbol('_makeWindowsFileUrl');
1654 let _makePort = Symbol('_makePort');
1655 let _makeHost = Symbol('_makeHost');
1656 let _isRegNameChar = Symbol('_isRegNameChar');
1657 let _normalizeRegName = Symbol('_normalizeRegName');
1658 let _makeScheme = Symbol('_makeScheme');
1659 let _makeUserInfo = Symbol('_makeUserInfo');
1660 let _makePath = Symbol('_makePath');
1661 let _makeQuery = Symbol('_makeQuery');
1662 let _makeFragment = Symbol('_makeFragment');
1663 let _stringOrNullLength = Symbol('_stringOrNullLength');
1664 let _isHexDigit = Symbol('_isHexDigit');
1665 let _hexValue = Symbol('_hexValue');
1666 let _normalizeEscape = Symbol('_normalizeEscape');
1667 let _isUnreservedChar = Symbol('_isUnreservedChar');
1668 let _escapeChar = Symbol('_escapeChar');
1669 let _normalize = Symbol('_normalize');
1670 let _isSchemeCharacter = Symbol('_isSchemeCharacter');
1671 let _isGeneralDelimiter = Symbol('_isGeneralDelimiter');
1672 let _merge = Symbol('_merge');
1673 let _hasDotSegments = Symbol('_hasDotSegments');
1674 let _removeDotSegments = Symbol('_removeDotSegments');
1675 let _toWindowsFilePath = Symbol('_toWindowsFilePath');
1676 let _toFilePath = Symbol('_toFilePath');
1677 let _isPathAbsolute = Symbol('_isPathAbsolute');
1678 let _addIfNonEmpty = Symbol('_addIfNonEmpty');
1679 let _uriEncode = Symbol('_uriEncode');
1680 let _hexCharPairToByte = Symbol('_hexCharPairToByte');
1681 let _uriDecode = Symbol('_uriDecode');
1682 let _isAlphabeticCharacter = Symbol('_isAlphabeticCharacter');
1601 class Uri extends dart.Object { 1683 class Uri extends dart.Object {
1602 get authority() { 1684 get authority() {
1603 if (!dart.notNull(this.hasAuthority)) 1685 if (!dart.notNull(this.hasAuthority))
1604 return ""; 1686 return "";
1605 let sb = new StringBuffer(); 1687 let sb = new StringBuffer();
1606 this._writeAuthority(sb); 1688 this[_writeAuthority](sb);
1607 return sb.toString(); 1689 return sb.toString();
1608 } 1690 }
1609 get userInfo() { 1691 get userInfo() {
1610 return this._userInfo; 1692 return this[_userInfo];
1611 } 1693 }
1612 get host() { 1694 get host() {
1613 if (this._host === null) 1695 if (this[_host] === null)
1614 return ""; 1696 return "";
1615 if (this._host.startsWith('[')) { 1697 if (this[_host].startsWith('[')) {
1616 return this._host.substring(1, this._host.length - 1); 1698 return this[_host].substring(1, this[_host].length - 1);
1617 } 1699 }
1618 return this._host; 1700 return this[_host];
1619 } 1701 }
1620 get port() { 1702 get port() {
1621 if (this._port === null) 1703 if (this[_port] === null)
1622 return _defaultPort(this.scheme); 1704 return _defaultPort(this.scheme);
1623 return dart.notNull(this._port); 1705 return dart.notNull(this[_port]);
1624 } 1706 }
1625 static _defaultPort(scheme) { 1707 static [_defaultPort](scheme) {
1626 if (dart.equals(scheme, "http")) 1708 if (dart.equals(scheme, "http"))
1627 return 80; 1709 return 80;
1628 if (dart.equals(scheme, "https")) 1710 if (dart.equals(scheme, "https"))
1629 return 443; 1711 return 443;
1630 return 0; 1712 return 0;
1631 } 1713 }
1632 get path() { 1714 get path() {
1633 return this._path; 1715 return this[_path];
1634 } 1716 }
1635 get query() { 1717 get query() {
1636 return this._query === null ? "" : this._query; 1718 return this[_query] === null ? "" : this[_query];
1637 } 1719 }
1638 get fragment() { 1720 get fragment() {
1639 return this._fragment === null ? "" : this._fragment; 1721 return this[_fragment] === null ? "" : this[_fragment];
1640 } 1722 }
1641 static parse(uri) { 1723 static parse(uri) {
1642 // Function isRegName: (int) → bool 1724 // Function isRegName: (int) → bool
1643 function isRegName(ch) { 1725 function isRegName(ch) {
1644 return dart.notNull(ch < 128) && dart.notNull(!dart.equals(dart.dbinary( dart.dindex(_regNameTable, ch >> 4), '&', 1 << (ch & 15)), 0)); 1726 return dart.notNull(ch < 128) && dart.notNull(!dart.equals(dart.dbinary( dart.dindex(_regNameTable, ch >> 4), '&', 1 << (ch & 15)), 0));
1645 } 1727 }
1646 let EOI = -1; 1728 let EOI = -1;
1647 let scheme = ""; 1729 let scheme = "";
1648 let userinfo = ""; 1730 let userinfo = "";
1649 let host = null; 1731 let host = null;
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1795 query = _makeQuery(uri, index + 1, uri.length, null); 1877 query = _makeQuery(uri, index + 1, uri.length, null);
1796 } else { 1878 } else {
1797 query = _makeQuery(uri, index + 1, numberSignIndex, null); 1879 query = _makeQuery(uri, index + 1, numberSignIndex, null);
1798 fragment = _makeFragment(uri, numberSignIndex + 1, uri.length); 1880 fragment = _makeFragment(uri, numberSignIndex + 1, uri.length);
1799 } 1881 }
1800 } else if (char === _NUMBER_SIGN) { 1882 } else if (char === _NUMBER_SIGN) {
1801 fragment = _makeFragment(uri, index + 1, uri.length); 1883 fragment = _makeFragment(uri, index + 1, uri.length);
1802 } 1884 }
1803 return new Uri._internal(scheme, userinfo, host, port, path, query, fragme nt); 1885 return new Uri._internal(scheme, userinfo, host, port, path, query, fragme nt);
1804 } 1886 }
1805 static _fail(uri, index, message) { 1887 static [_fail](uri, index, message) {
1806 throw new FormatException(message, uri, index); 1888 throw new FormatException(message, uri, index);
1807 } 1889 }
1808 Uri$_internal(scheme, _userInfo, _host, _port, _path, _query, _fragment) { 1890 Uri$_internal(scheme, $_userInfo, $_host, $_port, $_path, $_query, $_fragmen t) {
1809 this.scheme = scheme; 1891 this.scheme = scheme;
1810 this._userInfo = _userInfo; 1892 this[_userInfo] = $_userInfo;
1811 this._host = _host; 1893 this[_host] = $_host;
1812 this._port = _port; 1894 this[_port] = $_port;
1813 this._path = _path; 1895 this[_path] = $_path;
1814 this._query = _query; 1896 this[_query] = $_query;
1815 this._fragment = _fragment; 1897 this[_fragment] = $_fragment;
1816 this._pathSegments = null; 1898 this[_pathSegments] = null;
1817 this._queryParameters = null; 1899 this[_queryParameters] = null;
1818 } 1900 }
1819 Uri(opt$) { 1901 Uri(opt$) {
1820 let scheme = opt$.scheme === void 0 ? "" : opt$.scheme; 1902 let scheme = opt$.scheme === void 0 ? "" : opt$.scheme;
1821 let userInfo = opt$.userInfo === void 0 ? "" : opt$.userInfo; 1903 let userInfo = opt$.userInfo === void 0 ? "" : opt$.userInfo;
1822 let host = opt$.host === void 0 ? null : opt$.host; 1904 let host = opt$.host === void 0 ? null : opt$.host;
1823 let port = opt$.port === void 0 ? null : opt$.port; 1905 let port = opt$.port === void 0 ? null : opt$.port;
1824 let path = opt$.path === void 0 ? null : opt$.path; 1906 let path = opt$.path === void 0 ? null : opt$.path;
1825 let pathSegments = opt$.pathSegments === void 0 ? null : opt$.pathSegments ; 1907 let pathSegments = opt$.pathSegments === void 0 ? null : opt$.pathSegments ;
1826 let query = opt$.query === void 0 ? null : opt$.query; 1908 let query = opt$.query === void 0 ? null : opt$.query;
1827 let queryParameters = opt$.queryParameters === void 0 ? null : opt$.queryP arameters; 1909 let queryParameters = opt$.queryParameters === void 0 ? null : opt$.queryP arameters;
(...skipping 17 matching lines...) Expand all
1845 Uri$http(authority, unencodedPath, queryParameters) { 1927 Uri$http(authority, unencodedPath, queryParameters) {
1846 if (queryParameters === void 0) 1928 if (queryParameters === void 0)
1847 queryParameters = null; 1929 queryParameters = null;
1848 return _makeHttpUri("http", authority, unencodedPath, queryParameters); 1930 return _makeHttpUri("http", authority, unencodedPath, queryParameters);
1849 } 1931 }
1850 Uri$https(authority, unencodedPath, queryParameters) { 1932 Uri$https(authority, unencodedPath, queryParameters) {
1851 if (queryParameters === void 0) 1933 if (queryParameters === void 0)
1852 queryParameters = null; 1934 queryParameters = null;
1853 return _makeHttpUri("https", authority, unencodedPath, queryParameters); 1935 return _makeHttpUri("https", authority, unencodedPath, queryParameters);
1854 } 1936 }
1855 static _makeHttpUri(scheme, authority, unencodedPath, queryParameters) { 1937 static [_makeHttpUri](scheme, authority, unencodedPath, queryParameters) {
1856 let userInfo = ""; 1938 let userInfo = "";
1857 let host = null; 1939 let host = null;
1858 let port = null; 1940 let port = null;
1859 if (dart.notNull(authority !== null) && dart.notNull(authority.isNotEmpty) ) { 1941 if (dart.notNull(authority !== null) && dart.notNull(authority.isNotEmpty) ) {
1860 let hostStart = 0; 1942 let hostStart = 0;
1861 let hasUserInfo = false; 1943 let hasUserInfo = false;
1862 for (let i = 0; i < authority.length; i++) { 1944 for (let i = 0; i < authority.length; i++) {
1863 if (authority.codeUnitAt(i) === _AT_SIGN) { 1945 if (authority.codeUnitAt(i) === _AT_SIGN) {
1864 hasUserInfo = true; 1946 hasUserInfo = true;
1865 userInfo = authority.substring(0, i); 1947 userInfo = authority.substring(0, i);
(...skipping 24 matching lines...) Expand all
1890 port = int.parse(portString); 1972 port = int.parse(portString);
1891 break; 1973 break;
1892 } 1974 }
1893 } 1975 }
1894 host = authority.substring(hostStart, hostEnd); 1976 host = authority.substring(hostStart, hostEnd);
1895 } 1977 }
1896 return new Uri({scheme: scheme, userInfo: userInfo, host: dart.as(host, St ring), port: dart.as(port, int), pathSegments: unencodedPath.split("/"), queryPa rameters: queryParameters}); 1978 return new Uri({scheme: scheme, userInfo: userInfo, host: dart.as(host, St ring), port: dart.as(port, int), pathSegments: unencodedPath.split("/"), queryPa rameters: queryParameters});
1897 } 1979 }
1898 Uri$file(path, opt$) { 1980 Uri$file(path, opt$) {
1899 let windows = opt$.windows === void 0 ? null : opt$.windows; 1981 let windows = opt$.windows === void 0 ? null : opt$.windows;
1900 windows = windows === null ? Uri._isWindows : windows; 1982 windows = windows === null ? Uri[_isWindows] : windows;
1901 return dart.as(windows ? _makeWindowsFileUrl(path) : _makeFileUri(path), U ri); 1983 return dart.as(windows ? _makeWindowsFileUrl(path) : _makeFileUri(path), U ri);
1902 } 1984 }
1903 static get base() { 1985 static get base() {
1904 let uri = _js_helper.Primitives.currentUri(); 1986 let uri = _js_helper.Primitives.currentUri();
1905 if (uri !== null) 1987 if (uri !== null)
1906 return Uri.parse(uri); 1988 return Uri.parse(uri);
1907 throw new UnsupportedError("'Uri.base' is not supported"); 1989 throw new UnsupportedError("'Uri.base' is not supported");
1908 } 1990 }
1909 static get _isWindows() { 1991 static get [_isWindows]() {
1910 return false; 1992 return false;
1911 } 1993 }
1912 static _checkNonWindowsPathReservedCharacters(segments, argumentError) { 1994 static [_checkNonWindowsPathReservedCharacters](segments, argumentError) {
1913 segments.forEach((segment) => { 1995 segments.forEach((segment) => {
1914 if (dart.dinvoke(segment, 'contains', "/")) { 1996 if (dart.dinvoke(segment, 'contains', "/")) {
1915 if (argumentError) { 1997 if (argumentError) {
1916 throw new ArgumentError(`Illegal path character ${segment}`); 1998 throw new ArgumentError(`Illegal path character ${segment}`);
1917 } else { 1999 } else {
1918 throw new UnsupportedError(`Illegal path character ${segment}`); 2000 throw new UnsupportedError(`Illegal path character ${segment}`);
1919 } 2001 }
1920 } 2002 }
1921 }); 2003 });
1922 } 2004 }
1923 static _checkWindowsPathReservedCharacters(segments, argumentError, firstSeg ment) { 2005 static [_checkWindowsPathReservedCharacters](segments, argumentError, firstS egment) {
1924 if (firstSegment === void 0) 2006 if (firstSegment === void 0)
1925 firstSegment = 0; 2007 firstSegment = 0;
1926 segments.skip(firstSegment).forEach((segment) => { 2008 segments.skip(firstSegment).forEach((segment) => {
1927 if (dart.dinvoke(segment, 'contains', new RegExp('["*/:<>?\\\\|]'))) { 2009 if (dart.dinvoke(segment, 'contains', new RegExp('["*/:<>?\\\\|]'))) {
1928 if (argumentError) { 2010 if (argumentError) {
1929 throw new ArgumentError("Illegal character in path"); 2011 throw new ArgumentError("Illegal character in path");
1930 } else { 2012 } else {
1931 throw new UnsupportedError("Illegal character in path"); 2013 throw new UnsupportedError("Illegal character in path");
1932 } 2014 }
1933 } 2015 }
1934 }); 2016 });
1935 } 2017 }
1936 static _checkWindowsDriveLetter(charCode, argumentError) { 2018 static [_checkWindowsDriveLetter](charCode, argumentError) {
1937 if (dart.notNull(dart.notNull(_UPPER_CASE_A <= charCode) && dart.notNull(c harCode <= _UPPER_CASE_Z)) || dart.notNull(dart.notNull(_LOWER_CASE_A <= charCod e) && dart.notNull(charCode <= _LOWER_CASE_Z))) { 2019 if (dart.notNull(dart.notNull(_UPPER_CASE_A <= charCode) && dart.notNull(c harCode <= _UPPER_CASE_Z)) || dart.notNull(dart.notNull(_LOWER_CASE_A <= charCod e) && dart.notNull(charCode <= _LOWER_CASE_Z))) {
1938 return; 2020 return;
1939 } 2021 }
1940 if (argumentError) { 2022 if (argumentError) {
1941 throw new ArgumentError(String['+']("Illegal drive letter ", new String. fromCharCode(charCode))); 2023 throw new ArgumentError(String['+']("Illegal drive letter ", new String. fromCharCode(charCode)));
1942 } else { 2024 } else {
1943 throw new UnsupportedError(String['+']("Illegal drive letter ", new Stri ng.fromCharCode(charCode))); 2025 throw new UnsupportedError(String['+']("Illegal drive letter ", new Stri ng.fromCharCode(charCode)));
1944 } 2026 }
1945 } 2027 }
1946 static _makeFileUri(path) { 2028 static [_makeFileUri](path) {
1947 let sep = "/"; 2029 let sep = "/";
1948 if (path.startsWith(sep)) { 2030 if (path.startsWith(sep)) {
1949 return new Uri({scheme: "file", pathSegments: path.split(sep)}); 2031 return new Uri({scheme: "file", pathSegments: path.split(sep)});
1950 } else { 2032 } else {
1951 return new Uri({pathSegments: path.split(sep)}); 2033 return new Uri({pathSegments: path.split(sep)});
1952 } 2034 }
1953 } 2035 }
1954 static _makeWindowsFileUrl(path) { 2036 static [_makeWindowsFileUrl](path) {
1955 if (path.startsWith("\\\\?\\")) { 2037 if (path.startsWith("\\\\?\\")) {
1956 if (path.startsWith("\\\\?\\UNC\\")) { 2038 if (path.startsWith("\\\\?\\UNC\\")) {
1957 path = `\\${path.substring(7)}`; 2039 path = `\\${path.substring(7)}`;
1958 } else { 2040 } else {
1959 path = path.substring(4); 2041 path = path.substring(4);
1960 if (dart.notNull(dart.notNull(path.length < 3) || dart.notNull(path.co deUnitAt(1) !== _COLON)) || dart.notNull(path.codeUnitAt(2) !== _BACKSLASH)) { 2042 if (dart.notNull(dart.notNull(path.length < 3) || dart.notNull(path.co deUnitAt(1) !== _COLON)) || dart.notNull(path.codeUnitAt(2) !== _BACKSLASH)) {
1961 throw new ArgumentError("Windows paths with \\\\?\\ prefix must be a bsolute"); 2043 throw new ArgumentError("Windows paths with \\\\?\\ prefix must be a bsolute");
1962 } 2044 }
1963 } 2045 }
1964 } else { 2046 } else {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2012 } 2094 }
2013 let isFile = dart.equals(scheme, "file"); 2095 let isFile = dart.equals(scheme, "file");
2014 if (userInfo !== null) { 2096 if (userInfo !== null) {
2015 userInfo = _makeUserInfo(userInfo, 0, userInfo.length); 2097 userInfo = _makeUserInfo(userInfo, 0, userInfo.length);
2016 } else { 2098 } else {
2017 userInfo = this.userInfo; 2099 userInfo = this.userInfo;
2018 } 2100 }
2019 if (port !== null) { 2101 if (port !== null) {
2020 port = _makePort(port, scheme); 2102 port = _makePort(port, scheme);
2021 } else { 2103 } else {
2022 port = dart.notNull(this._port); 2104 port = dart.notNull(this[_port]);
2023 if (schemeChanged) { 2105 if (schemeChanged) {
2024 port = _makePort(port, scheme); 2106 port = _makePort(port, scheme);
2025 } 2107 }
2026 } 2108 }
2027 if (host !== null) { 2109 if (host !== null) {
2028 host = _makeHost(host, 0, host.length, false); 2110 host = _makeHost(host, 0, host.length, false);
2029 } else if (this.hasAuthority) { 2111 } else if (this.hasAuthority) {
2030 host = this.host; 2112 host = this.host;
2031 } else if (dart.notNull(dart.notNull(userInfo.isNotEmpty) || dart.notNull( port !== null)) || dart.notNull(isFile)) { 2113 } else if (dart.notNull(dart.notNull(userInfo.isNotEmpty) || dart.notNull( port !== null)) || dart.notNull(isFile)) {
2032 host = ""; 2114 host = "";
(...skipping 13 matching lines...) Expand all
2046 query = this.query; 2128 query = this.query;
2047 } 2129 }
2048 if (fragment !== null) { 2130 if (fragment !== null) {
2049 fragment = _makeFragment(fragment, 0, fragment.length); 2131 fragment = _makeFragment(fragment, 0, fragment.length);
2050 } else if (this.hasFragment) { 2132 } else if (this.hasFragment) {
2051 fragment = this.fragment; 2133 fragment = this.fragment;
2052 } 2134 }
2053 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme nt); 2135 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme nt);
2054 } 2136 }
2055 get pathSegments() { 2137 get pathSegments() {
2056 if (this._pathSegments === null) { 2138 if (this[_pathSegments] === null) {
2057 let pathToSplit = dart.notNull(!dart.notNull(this.path.isEmpty)) && dart .notNull(this.path.codeUnitAt(0) === _SLASH) ? this.path.substring(1) : this.pat h; 2139 let pathToSplit = dart.notNull(!dart.notNull(this.path.isEmpty)) && dart .notNull(this.path.codeUnitAt(0) === _SLASH) ? this.path.substring(1) : this.pat h;
2058 this._pathSegments = dart.as(new collection.UnmodifiableListView(dart.eq uals(pathToSplit, "") ? /* Unimplemented const */new List.from([]) : pathToSplit .split("/").map(Uri.decodeComponent).toList({growable: false})), List$(String)); 2140 this[_pathSegments] = dart.as(new collection.UnmodifiableListView(dart.e quals(pathToSplit, "") ? /* Unimplemented const */new List.from([]) : pathToSpli t.split("/").map(Uri.decodeComponent).toList({growable: false})), List$(String)) ;
2059 } 2141 }
2060 return this._pathSegments; 2142 return this[_pathSegments];
2061 } 2143 }
2062 get queryParameters() { 2144 get queryParameters() {
2063 if (this._queryParameters === null) { 2145 if (this[_queryParameters] === null) {
2064 this._queryParameters = dart.as(new collection.UnmodifiableMapView(split QueryString(this.query)), Map$(String, String)); 2146 this[_queryParameters] = dart.as(new collection.UnmodifiableMapView(spli tQueryString(this.query)), Map$(String, String));
2065 } 2147 }
2066 return this._queryParameters; 2148 return this[_queryParameters];
2067 } 2149 }
2068 static _makePort(port, scheme) { 2150 static [_makePort](port, scheme) {
2069 if (dart.notNull(port !== null) && dart.notNull(port === _defaultPort(sche me))) 2151 if (dart.notNull(port !== null) && dart.notNull(port === _defaultPort(sche me)))
2070 return dart.as(null, int); 2152 return dart.as(null, int);
2071 return port; 2153 return port;
2072 } 2154 }
2073 static _makeHost(host, start, end, strictIPv6) { 2155 static [_makeHost](host, start, end, strictIPv6) {
2074 if (host === null) 2156 if (host === null)
2075 return null; 2157 return null;
2076 if (start === end) 2158 if (start === end)
2077 return ""; 2159 return "";
2078 if (host.codeUnitAt(start) === _LEFT_BRACKET) { 2160 if (host.codeUnitAt(start) === _LEFT_BRACKET) {
2079 if (host.codeUnitAt(end - 1) !== _RIGHT_BRACKET) { 2161 if (host.codeUnitAt(end - 1) !== _RIGHT_BRACKET) {
2080 _fail(host, start, 'Missing end `]` to match `[` in host'); 2162 _fail(host, start, 'Missing end `]` to match `[` in host');
2081 } 2163 }
2082 parseIPv6Address(host, start + 1, end - 1); 2164 parseIPv6Address(host, start + 1, end - 1);
2083 return host.substring(start, end).toLowerCase(); 2165 return host.substring(start, end).toLowerCase();
2084 } 2166 }
2085 if (!dart.notNull(strictIPv6)) { 2167 if (!dart.notNull(strictIPv6)) {
2086 for (let i = start; i < end; i++) { 2168 for (let i = start; i < end; i++) {
2087 if (host.codeUnitAt(i) === _COLON) { 2169 if (host.codeUnitAt(i) === _COLON) {
2088 parseIPv6Address(host, start, end); 2170 parseIPv6Address(host, start, end);
2089 return `[${host}]`; 2171 return `[${host}]`;
2090 } 2172 }
2091 } 2173 }
2092 } 2174 }
2093 return _normalizeRegName(host, start, end); 2175 return _normalizeRegName(host, start, end);
2094 } 2176 }
2095 static _isRegNameChar(char) { 2177 static [_isRegNameChar](char) {
2096 return dart.notNull(char < 127) && dart.notNull(!dart.equals(dart.dbinary( dart.dindex(_regNameTable, char >> 4), '&', 1 << (char & 15)), 0)); 2178 return dart.notNull(char < 127) && dart.notNull(!dart.equals(dart.dbinary( dart.dindex(_regNameTable, char >> 4), '&', 1 << (char & 15)), 0));
2097 } 2179 }
2098 static _normalizeRegName(host, start, end) { 2180 static [_normalizeRegName](host, start, end) {
2099 let buffer = null; 2181 let buffer = null;
2100 let sectionStart = start; 2182 let sectionStart = start;
2101 let index = start; 2183 let index = start;
2102 let isNormalized = true; 2184 let isNormalized = true;
2103 while (index < end) { 2185 while (index < end) {
2104 let char = host.codeUnitAt(index); 2186 let char = host.codeUnitAt(index);
2105 if (char === _PERCENT) { 2187 if (char === _PERCENT) {
2106 let replacement = _normalizeEscape(host, index, true); 2188 let replacement = _normalizeEscape(host, index, true);
2107 if (dart.notNull(replacement === null) && dart.notNull(isNormalized)) { 2189 if (dart.notNull(replacement === null) && dart.notNull(isNormalized)) {
2108 index = 3; 2190 index = 3;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
2161 if (buffer === null) 2243 if (buffer === null)
2162 return host.substring(start, end); 2244 return host.substring(start, end);
2163 if (sectionStart < end) { 2245 if (sectionStart < end) {
2164 let slice = host.substring(sectionStart, end); 2246 let slice = host.substring(sectionStart, end);
2165 if (!dart.notNull(isNormalized)) 2247 if (!dart.notNull(isNormalized))
2166 slice = slice.toLowerCase(); 2248 slice = slice.toLowerCase();
2167 buffer.write(slice); 2249 buffer.write(slice);
2168 } 2250 }
2169 return buffer.toString(); 2251 return buffer.toString();
2170 } 2252 }
2171 static _makeScheme(scheme, end) { 2253 static [_makeScheme](scheme, end) {
2172 if (end === 0) 2254 if (end === 0)
2173 return ""; 2255 return "";
2174 let firstCodeUnit = scheme.codeUnitAt(0); 2256 let firstCodeUnit = scheme.codeUnitAt(0);
2175 if (!dart.notNull(_isAlphabeticCharacter(firstCodeUnit))) { 2257 if (!dart.notNull(_isAlphabeticCharacter(firstCodeUnit))) {
2176 _fail(scheme, 0, "Scheme not starting with alphabetic character"); 2258 _fail(scheme, 0, "Scheme not starting with alphabetic character");
2177 } 2259 }
2178 let allLowercase = firstCodeUnit >= _LOWER_CASE_A; 2260 let allLowercase = firstCodeUnit >= _LOWER_CASE_A;
2179 for (let i = 0; i < end; i++) { 2261 for (let i = 0; i < end; i++) {
2180 let codeUnit = scheme.codeUnitAt(i); 2262 let codeUnit = scheme.codeUnitAt(i);
2181 if (!dart.notNull(_isSchemeCharacter(codeUnit))) { 2263 if (!dart.notNull(_isSchemeCharacter(codeUnit))) {
2182 _fail(scheme, i, "Illegal scheme character"); 2264 _fail(scheme, i, "Illegal scheme character");
2183 } 2265 }
2184 if (dart.notNull(codeUnit < _LOWER_CASE_A) || dart.notNull(codeUnit > _L OWER_CASE_Z)) { 2266 if (dart.notNull(codeUnit < _LOWER_CASE_A) || dart.notNull(codeUnit > _L OWER_CASE_Z)) {
2185 allLowercase = false; 2267 allLowercase = false;
2186 } 2268 }
2187 } 2269 }
2188 scheme = scheme.substring(0, end); 2270 scheme = scheme.substring(0, end);
2189 if (!dart.notNull(allLowercase)) 2271 if (!dart.notNull(allLowercase))
2190 scheme = scheme.toLowerCase(); 2272 scheme = scheme.toLowerCase();
2191 return scheme; 2273 return scheme;
2192 } 2274 }
2193 static _makeUserInfo(userInfo, start, end) { 2275 static [_makeUserInfo](userInfo, start, end) {
2194 if (userInfo === null) 2276 if (userInfo === null)
2195 return ""; 2277 return "";
2196 return _normalize(userInfo, start, end, dart.as(_userinfoTable, List$(int) )); 2278 return _normalize(userInfo, start, end, dart.as(_userinfoTable, List$(int) ));
2197 } 2279 }
2198 static _makePath(path, start, end, pathSegments, ensureLeadingSlash, isFile) { 2280 static [_makePath](path, start, end, pathSegments, ensureLeadingSlash, isFil e) {
2199 if (dart.notNull(path === null) && dart.notNull(pathSegments === null)) 2281 if (dart.notNull(path === null) && dart.notNull(pathSegments === null))
2200 return isFile ? "/" : ""; 2282 return isFile ? "/" : "";
2201 if (dart.notNull(path !== null) && dart.notNull(pathSegments !== null)) { 2283 if (dart.notNull(path !== null) && dart.notNull(pathSegments !== null)) {
2202 throw new ArgumentError('Both path and pathSegments specified'); 2284 throw new ArgumentError('Both path and pathSegments specified');
2203 } 2285 }
2204 let result = null; 2286 let result = null;
2205 if (path !== null) { 2287 if (path !== null) {
2206 result = _normalize(path, start, end, dart.as(_pathCharOrSlashTable, Lis t$(int))); 2288 result = _normalize(path, start, end, dart.as(_pathCharOrSlashTable, Lis t$(int)));
2207 } else { 2289 } else {
2208 result = pathSegments.map((s) => _uriEncode(dart.as(_pathCharTable, List $(int)), dart.as(s, String))).join("/"); 2290 result = pathSegments.map((s) => _uriEncode(dart.as(_pathCharTable, List $(int)), dart.as(s, String))).join("/");
2209 } 2291 }
2210 if (dart.dload(result, 'isEmpty')) { 2292 if (dart.dload(result, 'isEmpty')) {
2211 if (isFile) 2293 if (isFile)
2212 return "/"; 2294 return "/";
2213 } else if (dart.notNull(dart.notNull(isFile) || dart.notNull(ensureLeading Slash)) && dart.notNull(!dart.equals(dart.dinvoke(result, 'codeUnitAt', 0), _SLA SH))) { 2295 } else if (dart.notNull(dart.notNull(isFile) || dart.notNull(ensureLeading Slash)) && dart.notNull(!dart.equals(dart.dinvoke(result, 'codeUnitAt', 0), _SLA SH))) {
2214 return `/${result}`; 2296 return `/${result}`;
2215 } 2297 }
2216 return dart.as(result, String); 2298 return dart.as(result, String);
2217 } 2299 }
2218 static _makeQuery(query, start, end, queryParameters) { 2300 static [_makeQuery](query, start, end, queryParameters) {
2219 if (dart.notNull(query === null) && dart.notNull(queryParameters === null) ) 2301 if (dart.notNull(query === null) && dart.notNull(queryParameters === null) )
2220 return null; 2302 return null;
2221 if (dart.notNull(query !== null) && dart.notNull(queryParameters !== null) ) { 2303 if (dart.notNull(query !== null) && dart.notNull(queryParameters !== null) ) {
2222 throw new ArgumentError('Both query and queryParameters specified'); 2304 throw new ArgumentError('Both query and queryParameters specified');
2223 } 2305 }
2224 if (query !== null) 2306 if (query !== null)
2225 return _normalize(query, start, end, dart.as(_queryCharTable, List$(int) )); 2307 return _normalize(query, start, end, dart.as(_queryCharTable, List$(int) ));
2226 let result = new StringBuffer(); 2308 let result = new StringBuffer();
2227 let first = true; 2309 let first = true;
2228 queryParameters.forEach(((key, value) => { 2310 queryParameters.forEach(((key, value) => {
2229 if (!dart.notNull(first)) { 2311 if (!dart.notNull(first)) {
2230 result.write("&"); 2312 result.write("&");
2231 } 2313 }
2232 first = false; 2314 first = false;
2233 result.write(Uri.encodeQueryComponent(dart.as(key, String))); 2315 result.write(Uri.encodeQueryComponent(dart.as(key, String)));
2234 if (dart.notNull(value !== null) && dart.notNull(dart.throw_("Unimplemen ted PrefixExpression: !value.isEmpty"))) { 2316 if (dart.notNull(value !== null) && dart.notNull(dart.throw_("Unimplemen ted PrefixExpression: !value.isEmpty"))) {
2235 result.write("="); 2317 result.write("=");
2236 result.write(Uri.encodeQueryComponent(dart.as(value, String))); 2318 result.write(Uri.encodeQueryComponent(dart.as(value, String)));
2237 } 2319 }
2238 }).bind(this)); 2320 }).bind(this));
2239 return result.toString(); 2321 return result.toString();
2240 } 2322 }
2241 static _makeFragment(fragment, start, end) { 2323 static [_makeFragment](fragment, start, end) {
2242 if (fragment === null) 2324 if (fragment === null)
2243 return null; 2325 return null;
2244 return _normalize(fragment, start, end, dart.as(_queryCharTable, List$(int ))); 2326 return _normalize(fragment, start, end, dart.as(_queryCharTable, List$(int )));
2245 } 2327 }
2246 static _stringOrNullLength(s) { 2328 static [_stringOrNullLength](s) {
2247 return s === null ? 0 : s.length; 2329 return s === null ? 0 : s.length;
2248 } 2330 }
2249 static _isHexDigit(char) { 2331 static [_isHexDigit](char) {
2250 if (_NINE >= char) 2332 if (_NINE >= char)
2251 return _ZERO <= char; 2333 return _ZERO <= char;
2252 char = 32; 2334 char = 32;
2253 return dart.notNull(_LOWER_CASE_A <= char) && dart.notNull(_LOWER_CASE_F > = char); 2335 return dart.notNull(_LOWER_CASE_A <= char) && dart.notNull(_LOWER_CASE_F > = char);
2254 } 2336 }
2255 static _hexValue(char) { 2337 static [_hexValue](char) {
2256 dart.assert(_isHexDigit(char)); 2338 dart.assert(_isHexDigit(char));
2257 if (_NINE >= char) 2339 if (_NINE >= char)
2258 return char - _ZERO; 2340 return char - _ZERO;
2259 char = 32; 2341 char = 32;
2260 return char - (_LOWER_CASE_A - 10); 2342 return char - (_LOWER_CASE_A - 10);
2261 } 2343 }
2262 static _normalizeEscape(source, index, lowerCase) { 2344 static [_normalizeEscape](source, index, lowerCase) {
2263 dart.assert(source.codeUnitAt(index) === _PERCENT); 2345 dart.assert(source.codeUnitAt(index) === _PERCENT);
2264 if (index + 2 >= source.length) { 2346 if (index + 2 >= source.length) {
2265 return "%"; 2347 return "%";
2266 } 2348 }
2267 let firstDigit = source.codeUnitAt(index + 1); 2349 let firstDigit = source.codeUnitAt(index + 1);
2268 let secondDigit = source.codeUnitAt(index + 2); 2350 let secondDigit = source.codeUnitAt(index + 2);
2269 if (dart.notNull(!dart.notNull(_isHexDigit(firstDigit))) || dart.notNull(! dart.notNull(_isHexDigit(secondDigit)))) { 2351 if (dart.notNull(!dart.notNull(_isHexDigit(firstDigit))) || dart.notNull(! dart.notNull(_isHexDigit(secondDigit)))) {
2270 return "%"; 2352 return "%";
2271 } 2353 }
2272 let value = _hexValue(firstDigit) * 16 + _hexValue(secondDigit); 2354 let value = _hexValue(firstDigit) * 16 + _hexValue(secondDigit);
2273 if (_isUnreservedChar(value)) { 2355 if (_isUnreservedChar(value)) {
2274 if (dart.notNull(dart.notNull(lowerCase) && dart.notNull(_UPPER_CASE_A < = value)) && dart.notNull(_UPPER_CASE_Z >= value)) { 2356 if (dart.notNull(dart.notNull(lowerCase) && dart.notNull(_UPPER_CASE_A < = value)) && dart.notNull(_UPPER_CASE_Z >= value)) {
2275 value = 32; 2357 value = 32;
2276 } 2358 }
2277 return new String.fromCharCode(value); 2359 return new String.fromCharCode(value);
2278 } 2360 }
2279 if (dart.notNull(firstDigit >= _LOWER_CASE_A) || dart.notNull(secondDigit >= _LOWER_CASE_A)) { 2361 if (dart.notNull(firstDigit >= _LOWER_CASE_A) || dart.notNull(secondDigit >= _LOWER_CASE_A)) {
2280 return source.substring(index, index + 3).toUpperCase(); 2362 return source.substring(index, index + 3).toUpperCase();
2281 } 2363 }
2282 return null; 2364 return null;
2283 } 2365 }
2284 static _isUnreservedChar(ch) { 2366 static [_isUnreservedChar](ch) {
2285 return dart.notNull(ch < 127) && dart.notNull(!dart.equals(dart.dbinary(da rt.dindex(_unreservedTable, ch >> 4), '&', 1 << (ch & 15)), 0)); 2367 return dart.notNull(ch < 127) && dart.notNull(!dart.equals(dart.dbinary(da rt.dindex(_unreservedTable, ch >> 4), '&', 1 << (ch & 15)), 0));
2286 } 2368 }
2287 static _escapeChar(char) { 2369 static [_escapeChar](char) {
2288 dart.assert(dart.dbinary(char, '<=', 1114111)); 2370 dart.assert(dart.dbinary(char, '<=', 1114111));
2289 let hexDigits = "0123456789ABCDEF"; 2371 let hexDigits = "0123456789ABCDEF";
2290 let codeUnits = null; 2372 let codeUnits = null;
2291 if (dart.dbinary(char, '<', 128)) { 2373 if (dart.dbinary(char, '<', 128)) {
2292 codeUnits = new List(3); 2374 codeUnits = new List(3);
2293 codeUnits.set(0, _PERCENT); 2375 codeUnits.set(0, _PERCENT);
2294 codeUnits.set(1, hexDigits.codeUnitAt(dart.as(dart.dbinary(char, '>>', 4 ), int))); 2376 codeUnits.set(1, hexDigits.codeUnitAt(dart.as(dart.dbinary(char, '>>', 4 ), int)));
2295 codeUnits.set(2, hexDigits.codeUnitAt(dart.as(dart.dbinary(char, '&', 15 ), int))); 2377 codeUnits.set(2, hexDigits.codeUnitAt(dart.as(dart.dbinary(char, '&', 15 ), int)));
2296 } else { 2378 } else {
2297 let flag = 192; 2379 let flag = 192;
(...skipping 12 matching lines...) Expand all
2310 let byte = dart.as(dart.dbinary(dart.dbinary(dart.dbinary(char, '>>', 6 * encodedBytes), '&', 63), '|', flag), int); 2392 let byte = dart.as(dart.dbinary(dart.dbinary(dart.dbinary(char, '>>', 6 * encodedBytes), '&', 63), '|', flag), int);
2311 codeUnits.set(index, _PERCENT); 2393 codeUnits.set(index, _PERCENT);
2312 codeUnits.set(index + 1, hexDigits.codeUnitAt(byte >> 4)); 2394 codeUnits.set(index + 1, hexDigits.codeUnitAt(byte >> 4));
2313 codeUnits.set(index + 2, hexDigits.codeUnitAt(byte & 15)); 2395 codeUnits.set(index + 2, hexDigits.codeUnitAt(byte & 15));
2314 index = 3; 2396 index = 3;
2315 flag = 128; 2397 flag = 128;
2316 } 2398 }
2317 } 2399 }
2318 return new String.fromCharCodes(dart.as(codeUnits, Iterable$(int))); 2400 return new String.fromCharCodes(dart.as(codeUnits, Iterable$(int)));
2319 } 2401 }
2320 static _normalize(component, start, end, charTable) { 2402 static [_normalize](component, start, end, charTable) {
2321 let buffer = null; 2403 let buffer = null;
2322 let sectionStart = start; 2404 let sectionStart = start;
2323 let index = start; 2405 let index = start;
2324 while (index < end) { 2406 while (index < end) {
2325 let char = component.codeUnitAt(index); 2407 let char = component.codeUnitAt(index);
2326 if (dart.notNull(char < 127) && dart.notNull((charTable.get(char >> 4) & 1 << (char & 15)) !== 0)) { 2408 if (dart.notNull(char < 127) && dart.notNull((charTable.get(char >> 4) & 1 << (char & 15)) !== 0)) {
2327 index++; 2409 index++;
2328 } else { 2410 } else {
2329 let replacement = null; 2411 let replacement = null;
2330 let sourceLength = null; 2412 let sourceLength = null;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
2364 } 2446 }
2365 } 2447 }
2366 if (buffer === null) { 2448 if (buffer === null) {
2367 return component.substring(start, end); 2449 return component.substring(start, end);
2368 } 2450 }
2369 if (sectionStart < end) { 2451 if (sectionStart < end) {
2370 buffer.write(component.substring(sectionStart, end)); 2452 buffer.write(component.substring(sectionStart, end));
2371 } 2453 }
2372 return buffer.toString(); 2454 return buffer.toString();
2373 } 2455 }
2374 static _isSchemeCharacter(ch) { 2456 static [_isSchemeCharacter](ch) {
2375 return dart.notNull(ch < 128) && dart.notNull(!dart.equals(dart.dbinary(da rt.dindex(_schemeTable, ch >> 4), '&', 1 << (ch & 15)), 0)); 2457 return dart.notNull(ch < 128) && dart.notNull(!dart.equals(dart.dbinary(da rt.dindex(_schemeTable, ch >> 4), '&', 1 << (ch & 15)), 0));
2376 } 2458 }
2377 static _isGeneralDelimiter(ch) { 2459 static [_isGeneralDelimiter](ch) {
2378 return dart.notNull(ch <= _RIGHT_BRACKET) && dart.notNull(!dart.equals(dar t.dbinary(dart.dindex(_genDelimitersTable, ch >> 4), '&', 1 << (ch & 15)), 0)); 2460 return dart.notNull(ch <= _RIGHT_BRACKET) && dart.notNull(!dart.equals(dar t.dbinary(dart.dindex(_genDelimitersTable, ch >> 4), '&', 1 << (ch & 15)), 0));
2379 } 2461 }
2380 get isAbsolute() { 2462 get isAbsolute() {
2381 return dart.notNull(!dart.equals(this.scheme, "")) && dart.notNull(dart.eq uals(this.fragment, "")); 2463 return dart.notNull(!dart.equals(this.scheme, "")) && dart.notNull(dart.eq uals(this.fragment, ""));
2382 } 2464 }
2383 _merge(base, reference) { 2465 [_merge](base, reference) {
2384 if (base.isEmpty) 2466 if (base.isEmpty)
2385 return `/${reference}`; 2467 return `/${reference}`;
2386 let backCount = 0; 2468 let backCount = 0;
2387 let refStart = 0; 2469 let refStart = 0;
2388 while (reference.startsWith("../", refStart)) { 2470 while (reference.startsWith("../", refStart)) {
2389 refStart = 3; 2471 refStart = 3;
2390 backCount++; 2472 backCount++;
2391 } 2473 }
2392 let baseEnd = base.lastIndexOf('/'); 2474 let baseEnd = base.lastIndexOf('/');
2393 while (dart.notNull(baseEnd > 0) && dart.notNull(backCount > 0)) { 2475 while (dart.notNull(baseEnd > 0) && dart.notNull(backCount > 0)) {
2394 let newEnd = base.lastIndexOf('/', baseEnd - 1); 2476 let newEnd = base.lastIndexOf('/', baseEnd - 1);
2395 if (newEnd < 0) { 2477 if (newEnd < 0) {
2396 break; 2478 break;
2397 } 2479 }
2398 let delta = baseEnd - newEnd; 2480 let delta = baseEnd - newEnd;
2399 if (dart.notNull(dart.notNull(dart.notNull(delta === 2) || dart.notNull( delta === 3)) && dart.notNull(base.codeUnitAt(newEnd + 1) === _DOT)) && dart.not Null(dart.notNull(delta === 2) || dart.notNull(base.codeUnitAt(newEnd + 2) === _ DOT))) { 2481 if (dart.notNull(dart.notNull(dart.notNull(delta === 2) || dart.notNull( delta === 3)) && dart.notNull(base.codeUnitAt(newEnd + 1) === _DOT)) && dart.not Null(dart.notNull(delta === 2) || dart.notNull(base.codeUnitAt(newEnd + 2) === _ DOT))) {
2400 break; 2482 break;
2401 } 2483 }
2402 baseEnd = newEnd; 2484 baseEnd = newEnd;
2403 backCount--; 2485 backCount--;
2404 } 2486 }
2405 return String['+'](base.substring(0, baseEnd + 1), reference.substring(ref Start - 3 * backCount)); 2487 return String['+'](base.substring(0, baseEnd + 1), reference.substring(ref Start - 3 * backCount));
2406 } 2488 }
2407 _hasDotSegments(path) { 2489 [_hasDotSegments](path) {
2408 if (dart.notNull(path.length > 0) && dart.notNull(path.codeUnitAt(0) === _ DOT)) 2490 if (dart.notNull(path.length > 0) && dart.notNull(path.codeUnitAt(0) === _ DOT))
2409 return true; 2491 return true;
2410 let index = path.indexOf("/."); 2492 let index = path.indexOf("/.");
2411 return index !== -1; 2493 return index !== -1;
2412 } 2494 }
2413 _removeDotSegments(path) { 2495 [_removeDotSegments](path) {
2414 if (!dart.notNull(this._hasDotSegments(path))) 2496 if (!dart.notNull(this[_hasDotSegments](path)))
2415 return path; 2497 return path;
2416 let output = dart.as(new List.from([]), List$(String)); 2498 let output = dart.as(new List.from([]), List$(String));
2417 let appendSlash = false; 2499 let appendSlash = false;
2418 for (let segment of path.split("/")) { 2500 for (let segment of path.split("/")) {
2419 appendSlash = false; 2501 appendSlash = false;
2420 if (dart.equals(segment, "..")) { 2502 if (dart.equals(segment, "..")) {
2421 if (dart.notNull(!dart.notNull(output.isEmpty)) && dart.notNull(dart.n otNull(output.length !== 1) || dart.notNull(!dart.equals(output.get(0), "")))) 2503 if (dart.notNull(!dart.notNull(output.isEmpty)) && dart.notNull(dart.n otNull(output.length !== 1) || dart.notNull(!dart.equals(output.get(0), ""))))
2422 output.removeLast(); 2504 output.removeLast();
2423 appendSlash = true; 2505 appendSlash = true;
2424 } else if (dart.equals(".", segment)) { 2506 } else if (dart.equals(".", segment)) {
(...skipping 16 matching lines...) Expand all
2441 let targetPort = null; 2523 let targetPort = null;
2442 let targetPath = null; 2524 let targetPath = null;
2443 let targetQuery = null; 2525 let targetQuery = null;
2444 if (reference.scheme.isNotEmpty) { 2526 if (reference.scheme.isNotEmpty) {
2445 targetScheme = reference.scheme; 2527 targetScheme = reference.scheme;
2446 if (reference.hasAuthority) { 2528 if (reference.hasAuthority) {
2447 targetUserInfo = reference.userInfo; 2529 targetUserInfo = reference.userInfo;
2448 targetHost = reference.host; 2530 targetHost = reference.host;
2449 targetPort = dart.as(reference.hasPort ? reference.port : null, int); 2531 targetPort = dart.as(reference.hasPort ? reference.port : null, int);
2450 } 2532 }
2451 targetPath = this._removeDotSegments(reference.path); 2533 targetPath = this[_removeDotSegments](reference.path);
2452 if (reference.hasQuery) { 2534 if (reference.hasQuery) {
2453 targetQuery = reference.query; 2535 targetQuery = reference.query;
2454 } 2536 }
2455 } else { 2537 } else {
2456 targetScheme = this.scheme; 2538 targetScheme = this.scheme;
2457 if (reference.hasAuthority) { 2539 if (reference.hasAuthority) {
2458 targetUserInfo = reference.userInfo; 2540 targetUserInfo = reference.userInfo;
2459 targetHost = reference.host; 2541 targetHost = reference.host;
2460 targetPort = _makePort(dart.as(reference.hasPort ? reference.port : nu ll, int), targetScheme); 2542 targetPort = _makePort(dart.as(reference.hasPort ? reference.port : nu ll, int), targetScheme);
2461 targetPath = this._removeDotSegments(reference.path); 2543 targetPath = this[_removeDotSegments](reference.path);
2462 if (reference.hasQuery) 2544 if (reference.hasQuery)
2463 targetQuery = reference.query; 2545 targetQuery = reference.query;
2464 } else { 2546 } else {
2465 if (dart.equals(reference.path, "")) { 2547 if (dart.equals(reference.path, "")) {
2466 targetPath = this._path; 2548 targetPath = this[_path];
2467 if (reference.hasQuery) { 2549 if (reference.hasQuery) {
2468 targetQuery = reference.query; 2550 targetQuery = reference.query;
2469 } else { 2551 } else {
2470 targetQuery = this._query; 2552 targetQuery = this[_query];
2471 } 2553 }
2472 } else { 2554 } else {
2473 if (reference.path.startsWith("/")) { 2555 if (reference.path.startsWith("/")) {
2474 targetPath = this._removeDotSegments(reference.path); 2556 targetPath = this[_removeDotSegments](reference.path);
2475 } else { 2557 } else {
2476 targetPath = this._removeDotSegments(this._merge(this._path, refer ence.path)); 2558 targetPath = this[_removeDotSegments](this[_merge](this[_path], re ference.path));
2477 } 2559 }
2478 if (reference.hasQuery) 2560 if (reference.hasQuery)
2479 targetQuery = reference.query; 2561 targetQuery = reference.query;
2480 } 2562 }
2481 targetUserInfo = this._userInfo; 2563 targetUserInfo = this[_userInfo];
2482 targetHost = this._host; 2564 targetHost = this[_host];
2483 targetPort = dart.notNull(this._port); 2565 targetPort = dart.notNull(this[_port]);
2484 } 2566 }
2485 } 2567 }
2486 let fragment = dart.as(reference.hasFragment ? reference.fragment : null, String); 2568 let fragment = dart.as(reference.hasFragment ? reference.fragment : null, String);
2487 return new Uri._internal(targetScheme, targetUserInfo, targetHost, targetP ort, targetPath, targetQuery, fragment); 2569 return new Uri._internal(targetScheme, targetUserInfo, targetHost, targetP ort, targetPath, targetQuery, fragment);
2488 } 2570 }
2489 get hasAuthority() { 2571 get hasAuthority() {
2490 return this._host !== null; 2572 return this[_host] !== null;
2491 } 2573 }
2492 get hasPort() { 2574 get hasPort() {
2493 return this._port !== null; 2575 return this[_port] !== null;
2494 } 2576 }
2495 get hasQuery() { 2577 get hasQuery() {
2496 return this._query !== null; 2578 return this[_query] !== null;
2497 } 2579 }
2498 get hasFragment() { 2580 get hasFragment() {
2499 return this._fragment !== null; 2581 return this[_fragment] !== null;
2500 } 2582 }
2501 get origin() { 2583 get origin() {
2502 if (dart.notNull(dart.notNull(dart.equals(this.scheme, "")) || dart.notNul l(this._host === null)) || dart.notNull(dart.equals(this._host, ""))) { 2584 if (dart.notNull(dart.notNull(dart.equals(this.scheme, "")) || dart.notNul l(this[_host] === null)) || dart.notNull(dart.equals(this[_host], ""))) {
2503 throw new StateError(`Cannot use origin without a scheme: ${this}`); 2585 throw new StateError(`Cannot use origin without a scheme: ${this}`);
2504 } 2586 }
2505 if (dart.notNull(!dart.equals(this.scheme, "http")) && dart.notNull(!dart. equals(this.scheme, "https"))) { 2587 if (dart.notNull(!dart.equals(this.scheme, "http")) && dart.notNull(!dart. equals(this.scheme, "https"))) {
2506 throw new StateError(`Origin is only applicable schemes http and https: ${this}`); 2588 throw new StateError(`Origin is only applicable schemes http and https: ${this}`);
2507 } 2589 }
2508 if (this._port === null) 2590 if (this[_port] === null)
2509 return `${this.scheme}://${this._host}`; 2591 return `${this.scheme}://${this[_host]}`;
2510 return `${this.scheme}://${this._host}:${this._port}`; 2592 return `${this.scheme}://${this[_host]}:${this[_port]}`;
2511 } 2593 }
2512 toFilePath(opt$) { 2594 toFilePath(opt$) {
2513 let windows = opt$.windows === void 0 ? null : opt$.windows; 2595 let windows = opt$.windows === void 0 ? null : opt$.windows;
2514 if (dart.notNull(!dart.equals(this.scheme, "")) && dart.notNull(!dart.equa ls(this.scheme, "file"))) { 2596 if (dart.notNull(!dart.equals(this.scheme, "")) && dart.notNull(!dart.equa ls(this.scheme, "file"))) {
2515 throw new UnsupportedError(`Cannot extract a file path from a ${this.sch eme} URI`); 2597 throw new UnsupportedError(`Cannot extract a file path from a ${this.sch eme} URI`);
2516 } 2598 }
2517 if (!dart.equals(this.query, "")) { 2599 if (!dart.equals(this.query, "")) {
2518 throw new UnsupportedError("Cannot extract a file path from a URI with a query component"); 2600 throw new UnsupportedError("Cannot extract a file path from a URI with a query component");
2519 } 2601 }
2520 if (!dart.equals(this.fragment, "")) { 2602 if (!dart.equals(this.fragment, "")) {
2521 throw new UnsupportedError("Cannot extract a file path from a URI with a fragment component"); 2603 throw new UnsupportedError("Cannot extract a file path from a URI with a fragment component");
2522 } 2604 }
2523 if (windows === null) 2605 if (windows === null)
2524 windows = _isWindows; 2606 windows = _isWindows;
2525 return windows ? this._toWindowsFilePath() : this._toFilePath(); 2607 return windows ? this[_toWindowsFilePath]() : this[_toFilePath]();
2526 } 2608 }
2527 _toFilePath() { 2609 [_toFilePath]() {
2528 if (!dart.equals(this.host, "")) { 2610 if (!dart.equals(this.host, "")) {
2529 throw new UnsupportedError("Cannot extract a non-Windows file path from a file URI " + "with an authority"); 2611 throw new UnsupportedError("Cannot extract a non-Windows file path from a file URI " + "with an authority");
2530 } 2612 }
2531 _checkNonWindowsPathReservedCharacters(this.pathSegments, false); 2613 _checkNonWindowsPathReservedCharacters(this.pathSegments, false);
2532 let result = new StringBuffer(); 2614 let result = new StringBuffer();
2533 if (this._isPathAbsolute) 2615 if (this[_isPathAbsolute])
2534 result.write("/"); 2616 result.write("/");
2535 result.writeAll(this.pathSegments, "/"); 2617 result.writeAll(this.pathSegments, "/");
2536 return result.toString(); 2618 return result.toString();
2537 } 2619 }
2538 _toWindowsFilePath() { 2620 [_toWindowsFilePath]() {
2539 let hasDriveLetter = false; 2621 let hasDriveLetter = false;
2540 let segments = this.pathSegments; 2622 let segments = this.pathSegments;
2541 if (dart.notNull(dart.notNull(segments.length > 0) && dart.notNull(segment s.get(0).length === 2)) && dart.notNull(segments.get(0).codeUnitAt(1) === _COLON )) { 2623 if (dart.notNull(dart.notNull(segments.length > 0) && dart.notNull(segment s.get(0).length === 2)) && dart.notNull(segments.get(0).codeUnitAt(1) === _COLON )) {
2542 _checkWindowsDriveLetter(segments.get(0).codeUnitAt(0), false); 2624 _checkWindowsDriveLetter(segments.get(0).codeUnitAt(0), false);
2543 _checkWindowsPathReservedCharacters(segments, false, 1); 2625 _checkWindowsPathReservedCharacters(segments, false, 1);
2544 hasDriveLetter = true; 2626 hasDriveLetter = true;
2545 } else { 2627 } else {
2546 _checkWindowsPathReservedCharacters(segments, false); 2628 _checkWindowsPathReservedCharacters(segments, false);
2547 } 2629 }
2548 let result = new StringBuffer(); 2630 let result = new StringBuffer();
2549 if (dart.notNull(this._isPathAbsolute) && dart.notNull(!dart.notNull(hasDr iveLetter))) 2631 if (dart.notNull(this[_isPathAbsolute]) && dart.notNull(!dart.notNull(hasD riveLetter)))
2550 result.write("\\"); 2632 result.write("\\");
2551 if (!dart.equals(this.host, "")) { 2633 if (!dart.equals(this.host, "")) {
2552 result.write("\\"); 2634 result.write("\\");
2553 result.write(this.host); 2635 result.write(this.host);
2554 result.write("\\"); 2636 result.write("\\");
2555 } 2637 }
2556 result.writeAll(segments, "\\"); 2638 result.writeAll(segments, "\\");
2557 if (dart.notNull(hasDriveLetter) && dart.notNull(segments.length === 1)) 2639 if (dart.notNull(hasDriveLetter) && dart.notNull(segments.length === 1))
2558 result.write("\\"); 2640 result.write("\\");
2559 return result.toString(); 2641 return result.toString();
2560 } 2642 }
2561 get _isPathAbsolute() { 2643 get [_isPathAbsolute]() {
2562 if (dart.notNull(this.path === null) || dart.notNull(this.path.isEmpty)) 2644 if (dart.notNull(this.path === null) || dart.notNull(this.path.isEmpty))
2563 return false; 2645 return false;
2564 return this.path.startsWith('/'); 2646 return this.path.startsWith('/');
2565 } 2647 }
2566 _writeAuthority(ss) { 2648 [_writeAuthority](ss) {
2567 if (this._userInfo.isNotEmpty) { 2649 if (this[_userInfo].isNotEmpty) {
2568 ss.write(this._userInfo); 2650 ss.write(this[_userInfo]);
2569 ss.write("@"); 2651 ss.write("@");
2570 } 2652 }
2571 if (this._host !== null) 2653 if (this[_host] !== null)
2572 ss.write(this._host); 2654 ss.write(this[_host]);
2573 if (this._port !== null) { 2655 if (this[_port] !== null) {
2574 ss.write(":"); 2656 ss.write(":");
2575 ss.write(this._port); 2657 ss.write(this[_port]);
2576 } 2658 }
2577 } 2659 }
2578 toString() { 2660 toString() {
2579 let sb = new StringBuffer(); 2661 let sb = new StringBuffer();
2580 _addIfNonEmpty(sb, this.scheme, this.scheme, ':'); 2662 _addIfNonEmpty(sb, this.scheme, this.scheme, ':');
2581 if (dart.notNull(dart.notNull(this.hasAuthority) || dart.notNull(this.path .startsWith("//"))) || dart.notNull(dart.equals(this.scheme, "file"))) { 2663 if (dart.notNull(dart.notNull(this.hasAuthority) || dart.notNull(this.path .startsWith("//"))) || dart.notNull(dart.equals(this.scheme, "file"))) {
2582 sb.write("//"); 2664 sb.write("//");
2583 this._writeAuthority(sb); 2665 this[_writeAuthority](sb);
2584 } 2666 }
2585 sb.write(this.path); 2667 sb.write(this.path);
2586 if (this._query !== null) { 2668 if (this[_query] !== null) {
2587 sb.write("?"); 2669 sb.write("?");
2588 sb.write(this._query); 2670 sb.write(this[_query]);
2589 } 2671 }
2590 if (this._fragment !== null) { 2672 if (this[_fragment] !== null) {
2591 sb.write("#"); 2673 sb.write("#");
2592 sb.write(this._fragment); 2674 sb.write(this[_fragment]);
2593 } 2675 }
2594 return sb.toString(); 2676 return sb.toString();
2595 } 2677 }
2596 ['=='](other) { 2678 ['=='](other) {
2597 if (!dart.is(other, Uri)) 2679 if (!dart.is(other, Uri))
2598 return false; 2680 return false;
2599 let uri = dart.as(other, Uri); 2681 let uri = dart.as(other, Uri);
2600 return dart.notNull(dart.notNull(dart.notNull(dart.notNull(dart.notNull(da rt.notNull(dart.notNull(dart.notNull(dart.notNull(dart.equals(this.scheme, uri.s cheme)) && dart.notNull(this.hasAuthority === uri.hasAuthority)) && dart.notNull (dart.equals(this.userInfo, uri.userInfo))) && dart.notNull(dart.equals(this.hos t, uri.host))) && dart.notNull(this.port === uri.port)) && dart.notNull(dart.equ als(this.path, uri.path))) && dart.notNull(this.hasQuery === uri.hasQuery)) && d art.notNull(dart.equals(this.query, uri.query))) && dart.notNull(this.hasFragmen t === uri.hasFragment)) && dart.notNull(dart.equals(this.fragment, uri.fragment) ); 2682 return dart.notNull(dart.notNull(dart.notNull(dart.notNull(dart.notNull(da rt.notNull(dart.notNull(dart.notNull(dart.notNull(dart.equals(this.scheme, uri.s cheme)) && dart.notNull(this.hasAuthority === uri.hasAuthority)) && dart.notNull (dart.equals(this.userInfo, uri.userInfo))) && dart.notNull(dart.equals(this.hos t, uri.host))) && dart.notNull(this.port === uri.port)) && dart.notNull(dart.equ als(this.path, uri.path))) && dart.notNull(this.hasQuery === uri.hasQuery)) && d art.notNull(dart.equals(this.query, uri.query))) && dart.notNull(this.hasFragmen t === uri.hasFragment)) && dart.notNull(dart.equals(this.fragment, uri.fragment) );
2601 } 2683 }
2602 get hashCode() { 2684 get hashCode() {
2603 // Function combine: (dynamic, dynamic) → int 2685 // Function combine: (dynamic, dynamic) → int
2604 function combine(part, current) { 2686 function combine(part, current) {
2605 return dart.as(dart.dbinary(dart.dbinary(dart.dbinary(current, '*', 31), '+', dart.dload(part, 'hashCode')), '&', 1073741823), int); 2687 return dart.as(dart.dbinary(dart.dbinary(dart.dbinary(current, '*', 31), '+', dart.dload(part, 'hashCode')), '&', 1073741823), int);
2606 } 2688 }
2607 return combine(this.scheme, combine(this.userInfo, combine(this.host, comb ine(this.port, combine(this.path, combine(this.query, combine(this.fragment, 1)) ))))); 2689 return combine(this.scheme, combine(this.userInfo, combine(this.host, comb ine(this.port, combine(this.path, combine(this.query, combine(this.fragment, 1)) )))));
2608 } 2690 }
2609 static _addIfNonEmpty(sb, test, first, second) { 2691 static [_addIfNonEmpty](sb, test, first, second) {
2610 if (!dart.equals("", test)) { 2692 if (!dart.equals("", test)) {
2611 sb.write(first); 2693 sb.write(first);
2612 sb.write(second); 2694 sb.write(second);
2613 } 2695 }
2614 } 2696 }
2615 static encodeComponent(component) { 2697 static encodeComponent(component) {
2616 return _uriEncode(dart.as(_unreserved2396Table, List$(int)), component); 2698 return _uriEncode(dart.as(_unreserved2396Table, List$(int)), component);
2617 } 2699 }
2618 static encodeQueryComponent(component, opt$) { 2700 static encodeQueryComponent(component, opt$) {
2619 let encoding = opt$.encoding === void 0 ? convert.UTF8 : opt$.encoding; 2701 let encoding = opt$.encoding === void 0 ? convert.UTF8 : opt$.encoding;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
2755 index = 2; 2837 index = 2;
2756 } 2838 }
2757 } else { 2839 } else {
2758 bytes.set(index, value >> 8); 2840 bytes.set(index, value >> 8);
2759 bytes.set(index + 1, value & 255); 2841 bytes.set(index + 1, value & 255);
2760 index = 2; 2842 index = 2;
2761 } 2843 }
2762 } 2844 }
2763 return dart.as(bytes, List$(int)); 2845 return dart.as(bytes, List$(int));
2764 } 2846 }
2765 static _uriEncode(canonicalTable, text, opt$) { 2847 static [_uriEncode](canonicalTable, text, opt$) {
2766 let encoding = opt$.encoding === void 0 ? convert.UTF8 : opt$.encoding; 2848 let encoding = opt$.encoding === void 0 ? convert.UTF8 : opt$.encoding;
2767 let spaceToPlus = opt$.spaceToPlus === void 0 ? false : opt$.spaceToPlus; 2849 let spaceToPlus = opt$.spaceToPlus === void 0 ? false : opt$.spaceToPlus;
2768 // Function byteToHex: (dynamic, dynamic) → dynamic 2850 // Function byteToHex: (dynamic, dynamic) → dynamic
2769 function byteToHex(byte, buffer) { 2851 function byteToHex(byte, buffer) {
2770 let hex = '0123456789ABCDEF'; 2852 let hex = '0123456789ABCDEF';
2771 dart.dinvoke(buffer, 'writeCharCode', hex.codeUnitAt(dart.as(dart.dbinar y(byte, '>>', 4), int))); 2853 dart.dinvoke(buffer, 'writeCharCode', hex.codeUnitAt(dart.as(dart.dbinar y(byte, '>>', 4), int)));
2772 dart.dinvoke(buffer, 'writeCharCode', hex.codeUnitAt(dart.as(dart.dbinar y(byte, '&', 15), int))); 2854 dart.dinvoke(buffer, 'writeCharCode', hex.codeUnitAt(dart.as(dart.dbinar y(byte, '&', 15), int)));
2773 } 2855 }
2774 let result = new StringBuffer(); 2856 let result = new StringBuffer();
2775 let bytes = encoding.encode(text); 2857 let bytes = encoding.encode(text);
2776 for (let i = 0; i < bytes.length; i++) { 2858 for (let i = 0; i < bytes.length; i++) {
2777 let byte = bytes.get(i); 2859 let byte = bytes.get(i);
2778 if (dart.notNull(byte < 128) && dart.notNull((canonicalTable.get(byte >> 4) & 1 << (byte & 15)) !== 0)) { 2860 if (dart.notNull(byte < 128) && dart.notNull((canonicalTable.get(byte >> 4) & 1 << (byte & 15)) !== 0)) {
2779 result.writeCharCode(byte); 2861 result.writeCharCode(byte);
2780 } else if (dart.notNull(spaceToPlus) && dart.notNull(byte === _SPACE)) { 2862 } else if (dart.notNull(spaceToPlus) && dart.notNull(byte === _SPACE)) {
2781 result.writeCharCode(_PLUS); 2863 result.writeCharCode(_PLUS);
2782 } else { 2864 } else {
2783 result.writeCharCode(_PERCENT); 2865 result.writeCharCode(_PERCENT);
2784 byteToHex(byte, result); 2866 byteToHex(byte, result);
2785 } 2867 }
2786 } 2868 }
2787 return result.toString(); 2869 return result.toString();
2788 } 2870 }
2789 static _hexCharPairToByte(s, pos) { 2871 static [_hexCharPairToByte](s, pos) {
2790 let byte = 0; 2872 let byte = 0;
2791 for (let i = 0; i < 2; i++) { 2873 for (let i = 0; i < 2; i++) {
2792 let charCode = s.codeUnitAt(pos + i); 2874 let charCode = s.codeUnitAt(pos + i);
2793 if (dart.notNull(48 <= charCode) && dart.notNull(charCode <= 57)) { 2875 if (dart.notNull(48 <= charCode) && dart.notNull(charCode <= 57)) {
2794 byte = byte * 16 + charCode - 48; 2876 byte = byte * 16 + charCode - 48;
2795 } else { 2877 } else {
2796 charCode = 32; 2878 charCode = 32;
2797 if (dart.notNull(97 <= charCode) && dart.notNull(charCode <= 102)) { 2879 if (dart.notNull(97 <= charCode) && dart.notNull(charCode <= 102)) {
2798 byte = byte * 16 + charCode - 87; 2880 byte = byte * 16 + charCode - 87;
2799 } else { 2881 } else {
2800 throw new ArgumentError("Invalid URL encoding"); 2882 throw new ArgumentError("Invalid URL encoding");
2801 } 2883 }
2802 } 2884 }
2803 } 2885 }
2804 return byte; 2886 return byte;
2805 } 2887 }
2806 static _uriDecode(text, opt$) { 2888 static [_uriDecode](text, opt$) {
2807 let plusToSpace = opt$.plusToSpace === void 0 ? false : opt$.plusToSpace; 2889 let plusToSpace = opt$.plusToSpace === void 0 ? false : opt$.plusToSpace;
2808 let encoding = opt$.encoding === void 0 ? convert.UTF8 : opt$.encoding; 2890 let encoding = opt$.encoding === void 0 ? convert.UTF8 : opt$.encoding;
2809 let simple = true; 2891 let simple = true;
2810 for (let i = 0; dart.notNull(i < text.length) && dart.notNull(simple); i++ ) { 2892 for (let i = 0; dart.notNull(i < text.length) && dart.notNull(simple); i++ ) {
2811 let codeUnit = text.codeUnitAt(i); 2893 let codeUnit = text.codeUnitAt(i);
2812 simple = dart.notNull(codeUnit !== _PERCENT) && dart.notNull(codeUnit != = _PLUS); 2894 simple = dart.notNull(codeUnit !== _PERCENT) && dart.notNull(codeUnit != = _PLUS);
2813 } 2895 }
2814 let bytes = null; 2896 let bytes = null;
2815 if (simple) { 2897 if (simple) {
2816 if (dart.notNull(dart.equals(encoding, convert.UTF8)) || dart.notNull(da rt.equals(encoding, convert.LATIN1))) { 2898 if (dart.notNull(dart.equals(encoding, convert.UTF8)) || dart.notNull(da rt.equals(encoding, convert.LATIN1))) {
(...skipping 16 matching lines...) Expand all
2833 i = 2; 2915 i = 2;
2834 } else if (dart.notNull(plusToSpace) && dart.notNull(codeUnit === _PLU S)) { 2916 } else if (dart.notNull(plusToSpace) && dart.notNull(codeUnit === _PLU S)) {
2835 bytes.add(_SPACE); 2917 bytes.add(_SPACE);
2836 } else { 2918 } else {
2837 bytes.add(codeUnit); 2919 bytes.add(codeUnit);
2838 } 2920 }
2839 } 2921 }
2840 } 2922 }
2841 return encoding.decode(bytes); 2923 return encoding.decode(bytes);
2842 } 2924 }
2843 static _isAlphabeticCharacter(codeUnit) { 2925 static [_isAlphabeticCharacter](codeUnit) {
2844 return dart.notNull(dart.notNull(codeUnit >= _LOWER_CASE_A) && dart.notNul l(codeUnit <= _LOWER_CASE_Z)) || dart.notNull(dart.notNull(codeUnit >= _UPPER_CA SE_A) && dart.notNull(codeUnit <= _UPPER_CASE_Z)); 2926 return dart.notNull(dart.notNull(codeUnit >= _LOWER_CASE_A) && dart.notNul l(codeUnit <= _LOWER_CASE_Z)) || dart.notNull(dart.notNull(codeUnit >= _UPPER_CA SE_A) && dart.notNull(codeUnit <= _UPPER_CASE_Z));
2845 } 2927 }
2846 } 2928 }
2847 dart.defineNamedConstructor(Uri, '_internal'); 2929 dart.defineNamedConstructor(Uri, '_internal');
2848 dart.defineNamedConstructor(Uri, 'http'); 2930 dart.defineNamedConstructor(Uri, 'http');
2849 dart.defineNamedConstructor(Uri, 'https'); 2931 dart.defineNamedConstructor(Uri, 'https');
2850 dart.defineNamedConstructor(Uri, 'file'); 2932 dart.defineNamedConstructor(Uri, 'file');
2851 Uri._SPACE = 32; 2933 Uri._SPACE = 32;
2852 Uri._DOUBLE_QUOTE = 34; 2934 Uri._DOUBLE_QUOTE = 34;
2853 Uri._NUMBER_SIGN = 35; 2935 Uri._NUMBER_SIGN = 35;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
2949 exports.Stopwatch = Stopwatch; 3031 exports.Stopwatch = Stopwatch;
2950 exports.String = String; 3032 exports.String = String;
2951 exports.Runes = Runes; 3033 exports.Runes = Runes;
2952 exports.RuneIterator = RuneIterator; 3034 exports.RuneIterator = RuneIterator;
2953 exports.StringBuffer = StringBuffer; 3035 exports.StringBuffer = StringBuffer;
2954 exports.StringSink = StringSink; 3036 exports.StringSink = StringSink;
2955 exports.Symbol = Symbol; 3037 exports.Symbol = Symbol;
2956 exports.Type = Type; 3038 exports.Type = Type;
2957 exports.Uri = Uri; 3039 exports.Uri = Uri;
2958 })(core || (core = {})); 3040 })(core || (core = {}));
OLDNEW
« no previous file with comments | « test/codegen/expect/convert/convert.js ('k') | test/codegen/expect/isolate/isolate.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698