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

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

Issue 1117333002: Fix some static member emits (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: reformat Created 5 years, 7 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 | « lib/runtime/dart/convert.js ('k') | lib/runtime/dart/typed_data.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 class Object { 4 class Object {
5 constructor() { 5 constructor() {
6 let name = this.constructor.name; 6 let name = this.constructor.name;
7 let init = this[name]; 7 let init = this[name];
8 let result = void 0; 8 let result = void 0;
9 if (init) 9 if (init)
10 result = init.apply(this, arguments); 10 result = init.apply(this, arguments);
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 onError = null; 405 onError = null;
406 return _js_helper.Primitives.parseDouble(source, onError); 406 return _js_helper.Primitives.parseDouble(source, onError);
407 } 407 }
408 } 408 }
409 double.NAN = 0.0 / 0.0; 409 double.NAN = 0.0 / 0.0;
410 double.INFINITY = 1.0 / 0.0; 410 double.INFINITY = 1.0 / 0.0;
411 double.NEGATIVE_INFINITY = -dart.notNull(double.INFINITY); 411 double.NEGATIVE_INFINITY = -dart.notNull(double.INFINITY);
412 double.MIN_POSITIVE = 5e-324; 412 double.MIN_POSITIVE = 5e-324;
413 double.MAX_FINITE = 1.7976931348623157e+308; 413 double.MAX_FINITE = 1.7976931348623157e+308;
414 let _duration = dart.JsSymbol('_duration'); 414 let _duration = dart.JsSymbol('_duration');
415 let _microseconds = dart.JsSymbol('_microseconds');
416 class Duration extends Object { 415 class Duration extends Object {
417 Duration(opts) { 416 Duration(opts) {
418 let days = opts && 'days' in opts ? opts.days : 0; 417 let days = opts && 'days' in opts ? opts.days : 0;
419 let hours = opts && 'hours' in opts ? opts.hours : 0; 418 let hours = opts && 'hours' in opts ? opts.hours : 0;
420 let minutes = opts && 'minutes' in opts ? opts.minutes : 0; 419 let minutes = opts && 'minutes' in opts ? opts.minutes : 0;
421 let seconds = opts && 'seconds' in opts ? opts.seconds : 0; 420 let seconds = opts && 'seconds' in opts ? opts.seconds : 0;
422 let milliseconds = opts && 'milliseconds' in opts ? opts.milliseconds : 0; 421 let milliseconds = opts && 'milliseconds' in opts ? opts.milliseconds : 0;
423 let microseconds = opts && 'microseconds' in opts ? opts.microseconds : 0; 422 let microseconds = opts && 'microseconds' in opts ? opts.microseconds : 0;
424 this._microseconds(dart.notNull(days) * dart.notNull(Duration.MICROSECONDS _PER_DAY) + dart.notNull(hours) * dart.notNull(Duration.MICROSECONDS_PER_HOUR) + dart.notNull(minutes) * dart.notNull(Duration.MICROSECONDS_PER_MINUTE) + dart.n otNull(seconds) * dart.notNull(Duration.MICROSECONDS_PER_SECOND) + dart.notNull( milliseconds) * dart.notNull(Duration.MICROSECONDS_PER_MILLISECOND) + dart.notNu ll(microseconds)); 423 this._microseconds(dart.notNull(days) * dart.notNull(Duration.MICROSECONDS _PER_DAY) + dart.notNull(hours) * dart.notNull(Duration.MICROSECONDS_PER_HOUR) + dart.notNull(minutes) * dart.notNull(Duration.MICROSECONDS_PER_MINUTE) + dart.n otNull(seconds) * dart.notNull(Duration.MICROSECONDS_PER_SECOND) + dart.notNull( milliseconds) * dart.notNull(Duration.MICROSECONDS_PER_MILLISECOND) + dart.notNu ll(microseconds));
425 } 424 }
426 _microseconds(duration) { 425 _microseconds(duration) {
427 this[_duration] = duration; 426 this[_duration] = duration;
428 } 427 }
429 ['+'](other) { 428 ['+'](other) {
430 return new Duration[_microseconds](dart.notNull(this[_duration]) + dart.no tNull(other[_duration])); 429 return new Duration._microseconds(dart.notNull(this[_duration]) + dart.not Null(other[_duration]));
431 } 430 }
432 ['-'](other) { 431 ['-'](other) {
433 return new Duration[_microseconds](dart.notNull(this[_duration]) - dart.no tNull(other[_duration])); 432 return new Duration._microseconds(dart.notNull(this[_duration]) - dart.not Null(other[_duration]));
434 } 433 }
435 ['*'](factor) { 434 ['*'](factor) {
436 return new Duration[_microseconds]((dart.notNull(this[_duration]) * dart.n otNull(factor)).round()); 435 return new Duration._microseconds((dart.notNull(this[_duration]) * dart.no tNull(factor)).round());
437 } 436 }
438 ['~/'](quotient) { 437 ['~/'](quotient) {
439 if (quotient == 0) 438 if (quotient == 0)
440 throw new IntegerDivisionByZeroException(); 439 throw new IntegerDivisionByZeroException();
441 return new Duration[_microseconds]((dart.notNull(this[_duration]) / dart.n otNull(quotient)).truncate()); 440 return new Duration._microseconds((dart.notNull(this[_duration]) / dart.no tNull(quotient)).truncate());
442 } 441 }
443 ['<'](other) { 442 ['<'](other) {
444 return dart.notNull(this[_duration]) < dart.notNull(other[_duration]); 443 return dart.notNull(this[_duration]) < dart.notNull(other[_duration]);
445 } 444 }
446 ['>'](other) { 445 ['>'](other) {
447 return dart.notNull(this[_duration]) > dart.notNull(other[_duration]); 446 return dart.notNull(this[_duration]) > dart.notNull(other[_duration]);
448 } 447 }
449 ['<='](other) { 448 ['<='](other) {
450 return dart.notNull(this[_duration]) <= dart.notNull(other[_duration]); 449 return dart.notNull(this[_duration]) <= dart.notNull(other[_duration]);
451 } 450 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 } 506 }
508 let twoDigitMinutes = twoDigits(this.inMinutes.remainder(Duration.MINUTES_ PER_HOUR)); 507 let twoDigitMinutes = twoDigits(this.inMinutes.remainder(Duration.MINUTES_ PER_HOUR));
509 let twoDigitSeconds = twoDigits(this.inSeconds.remainder(Duration.SECONDS_ PER_MINUTE)); 508 let twoDigitSeconds = twoDigits(this.inSeconds.remainder(Duration.SECONDS_ PER_MINUTE));
510 let sixDigitUs = sixDigits(this.inMicroseconds.remainder(Duration.MICROSEC ONDS_PER_SECOND)); 509 let sixDigitUs = sixDigits(this.inMicroseconds.remainder(Duration.MICROSEC ONDS_PER_SECOND));
511 return `${this.inHours}:${twoDigitMinutes}:${twoDigitSeconds}.${sixDigitUs }`; 510 return `${this.inHours}:${twoDigitMinutes}:${twoDigitSeconds}.${sixDigitUs }`;
512 } 511 }
513 get isNegative() { 512 get isNegative() {
514 return dart.notNull(this[_duration]) < 0; 513 return dart.notNull(this[_duration]) < 0;
515 } 514 }
516 abs() { 515 abs() {
517 return new Duration[_microseconds](this[_duration].abs()); 516 return new Duration._microseconds(this[_duration].abs());
518 } 517 }
519 ['unary-']() { 518 ['unary-']() {
520 return new Duration[_microseconds](-dart.notNull(this[_duration])); 519 return new Duration._microseconds(-dart.notNull(this[_duration]));
521 } 520 }
522 } 521 }
523 Duration[dart.implements] = () => [Comparable$(Duration)]; 522 Duration[dart.implements] = () => [Comparable$(Duration)];
524 dart.defineNamedConstructor(Duration, '_microseconds'); 523 dart.defineNamedConstructor(Duration, '_microseconds');
525 Duration.MICROSECONDS_PER_MILLISECOND = 1000; 524 Duration.MICROSECONDS_PER_MILLISECOND = 1000;
526 Duration.MILLISECONDS_PER_SECOND = 1000; 525 Duration.MILLISECONDS_PER_SECOND = 1000;
527 Duration.SECONDS_PER_MINUTE = 60; 526 Duration.SECONDS_PER_MINUTE = 60;
528 Duration.MINUTES_PER_HOUR = 60; 527 Duration.MINUTES_PER_HOUR = 60;
529 Duration.HOURS_PER_DAY = 24; 528 Duration.HOURS_PER_DAY = 24;
530 Duration.MICROSECONDS_PER_SECOND = dart.notNull(Duration.MICROSECONDS_PER_MILL ISECOND) * dart.notNull(Duration.MILLISECONDS_PER_SECOND); 529 Duration.MICROSECONDS_PER_SECOND = dart.notNull(Duration.MICROSECONDS_PER_MILL ISECOND) * dart.notNull(Duration.MILLISECONDS_PER_SECOND);
(...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 } 1998 }
2000 } 1999 }
2001 class Type extends Object {} 2000 class Type extends Object {}
2002 let _writeAuthority = dart.JsSymbol('_writeAuthority'); 2001 let _writeAuthority = dart.JsSymbol('_writeAuthority');
2003 let _userInfo = dart.JsSymbol('_userInfo'); 2002 let _userInfo = dart.JsSymbol('_userInfo');
2004 let _host = dart.JsSymbol('_host'); 2003 let _host = dart.JsSymbol('_host');
2005 let _port = dart.JsSymbol('_port'); 2004 let _port = dart.JsSymbol('_port');
2006 let _path = dart.JsSymbol('_path'); 2005 let _path = dart.JsSymbol('_path');
2007 let _query = dart.JsSymbol('_query'); 2006 let _query = dart.JsSymbol('_query');
2008 let _fragment = dart.JsSymbol('_fragment'); 2007 let _fragment = dart.JsSymbol('_fragment');
2009 let _internal$ = dart.JsSymbol('_internal');
2010 let _pathSegments = dart.JsSymbol('_pathSegments'); 2008 let _pathSegments = dart.JsSymbol('_pathSegments');
2011 let _queryParameters = dart.JsSymbol('_queryParameters'); 2009 let _queryParameters = dart.JsSymbol('_queryParameters');
2012 let _merge = dart.JsSymbol('_merge'); 2010 let _merge = dart.JsSymbol('_merge');
2013 let _hasDotSegments = dart.JsSymbol('_hasDotSegments'); 2011 let _hasDotSegments = dart.JsSymbol('_hasDotSegments');
2014 let _removeDotSegments = dart.JsSymbol('_removeDotSegments'); 2012 let _removeDotSegments = dart.JsSymbol('_removeDotSegments');
2015 let _toWindowsFilePath = dart.JsSymbol('_toWindowsFilePath'); 2013 let _toWindowsFilePath = dart.JsSymbol('_toWindowsFilePath');
2016 let _toFilePath = dart.JsSymbol('_toFilePath'); 2014 let _toFilePath = dart.JsSymbol('_toFilePath');
2017 let _isPathAbsolute = dart.JsSymbol('_isPathAbsolute'); 2015 let _isPathAbsolute = dart.JsSymbol('_isPathAbsolute');
2018 class Uri extends Object { 2016 class Uri extends Object {
2019 get authority() { 2017 get authority() {
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 let numberSignIndex = uri.indexOf('#', dart.notNull(index) + 1); 2208 let numberSignIndex = uri.indexOf('#', dart.notNull(index) + 1);
2211 if (dart.notNull(numberSignIndex) < 0) { 2209 if (dart.notNull(numberSignIndex) < 0) {
2212 query = Uri._makeQuery(uri, dart.notNull(index) + 1, uri.length, null) ; 2210 query = Uri._makeQuery(uri, dart.notNull(index) + 1, uri.length, null) ;
2213 } else { 2211 } else {
2214 query = Uri._makeQuery(uri, dart.notNull(index) + 1, numberSignIndex, null); 2212 query = Uri._makeQuery(uri, dart.notNull(index) + 1, numberSignIndex, null);
2215 fragment = Uri._makeFragment(uri, dart.notNull(numberSignIndex) + 1, u ri.length); 2213 fragment = Uri._makeFragment(uri, dart.notNull(numberSignIndex) + 1, u ri.length);
2216 } 2214 }
2217 } else if (char == Uri._NUMBER_SIGN) { 2215 } else if (char == Uri._NUMBER_SIGN) {
2218 fragment = Uri._makeFragment(uri, dart.notNull(index) + 1, uri.length); 2216 fragment = Uri._makeFragment(uri, dart.notNull(index) + 1, uri.length);
2219 } 2217 }
2220 return new Uri[_internal$](scheme, userinfo, host, port, path, query, frag ment); 2218 return new Uri._internal(scheme, userinfo, host, port, path, query, fragme nt);
2221 } 2219 }
2222 static _fail(uri, index, message) { 2220 static _fail(uri, index, message) {
2223 throw new FormatException(message, uri, index); 2221 throw new FormatException(message, uri, index);
2224 } 2222 }
2225 _internal(scheme, userInfo, host, port, path, query, fragment) { 2223 _internal(scheme, userInfo, host, port, path, query, fragment) {
2226 this.scheme = scheme; 2224 this.scheme = scheme;
2227 this[_userInfo] = userInfo; 2225 this[_userInfo] = userInfo;
2228 this[_host] = host; 2226 this[_host] = host;
2229 this[_port] = port; 2227 this[_port] = port;
2230 this[_path] = path; 2228 this[_path] = path;
(...skipping 19 matching lines...) Expand all
2250 query = null; 2248 query = null;
2251 query = Uri._makeQuery(query, 0, Uri._stringOrNullLength(query), queryPara meters); 2249 query = Uri._makeQuery(query, 0, Uri._stringOrNullLength(query), queryPara meters);
2252 fragment = Uri._makeFragment(fragment, 0, Uri._stringOrNullLength(fragment )); 2250 fragment = Uri._makeFragment(fragment, 0, Uri._stringOrNullLength(fragment ));
2253 port = Uri._makePort(port, scheme); 2251 port = Uri._makePort(port, scheme);
2254 let isFile = scheme == "file"; 2252 let isFile = scheme == "file";
2255 if (host == null && (dart.notNull(userInfo.isNotEmpty) || port != null || dart.notNull(isFile))) { 2253 if (host == null && (dart.notNull(userInfo.isNotEmpty) || port != null || dart.notNull(isFile))) {
2256 host = ""; 2254 host = "";
2257 } 2255 }
2258 let ensureLeadingSlash = host != null; 2256 let ensureLeadingSlash = host != null;
2259 path = Uri._makePath(path, 0, Uri._stringOrNullLength(path), pathSegments, ensureLeadingSlash, isFile); 2257 path = Uri._makePath(path, 0, Uri._stringOrNullLength(path), pathSegments, ensureLeadingSlash, isFile);
2260 return new Uri[_internal$](scheme, userInfo, host, port, path, query, frag ment); 2258 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme nt);
2261 } 2259 }
2262 http(authority, unencodedPath, queryParameters) { 2260 http(authority, unencodedPath, queryParameters) {
2263 if (queryParameters === void 0) 2261 if (queryParameters === void 0)
2264 queryParameters = null; 2262 queryParameters = null;
2265 return Uri._makeHttpUri("http", authority, unencodedPath, queryParameters) ; 2263 return Uri._makeHttpUri("http", authority, unencodedPath, queryParameters) ;
2266 } 2264 }
2267 https(authority, unencodedPath, queryParameters) { 2265 https(authority, unencodedPath, queryParameters) {
2268 if (queryParameters === void 0) 2266 if (queryParameters === void 0)
2269 queryParameters = null; 2267 queryParameters = null;
2270 return Uri._makeHttpUri("https", authority, unencodedPath, queryParameters ); 2268 return Uri._makeHttpUri("https", authority, unencodedPath, queryParameters );
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
2460 if (query != null || dart.notNull(queryParameters != null)) { 2458 if (query != null || dart.notNull(queryParameters != null)) {
2461 query = Uri._makeQuery(query, 0, Uri._stringOrNullLength(query), queryPa rameters); 2459 query = Uri._makeQuery(query, 0, Uri._stringOrNullLength(query), queryPa rameters);
2462 } else if (this.hasQuery) { 2460 } else if (this.hasQuery) {
2463 query = this.query; 2461 query = this.query;
2464 } 2462 }
2465 if (fragment != null) { 2463 if (fragment != null) {
2466 fragment = Uri._makeFragment(fragment, 0, fragment.length); 2464 fragment = Uri._makeFragment(fragment, 0, fragment.length);
2467 } else if (this.hasFragment) { 2465 } else if (this.hasFragment) {
2468 fragment = this.fragment; 2466 fragment = this.fragment;
2469 } 2467 }
2470 return new Uri[_internal$](scheme, userInfo, host, port, path, query, frag ment); 2468 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme nt);
2471 } 2469 }
2472 get pathSegments() { 2470 get pathSegments() {
2473 if (this[_pathSegments] == null) { 2471 if (this[_pathSegments] == null) {
2474 let pathToSplit = !dart.notNull(this.path.isEmpty) && this.path.codeUnit At(0) == Uri._SLASH ? this.path.substring(1) : this.path; 2472 let pathToSplit = !dart.notNull(this.path.isEmpty) && this.path.codeUnit At(0) == Uri._SLASH ? this.path.substring(1) : this.path;
2475 this[_pathSegments] = new collection.UnmodifiableListView(pathToSplit == "" ? dart.const(dart.setType([], List$(String))) : pathToSplit.split("/")[$map] (dart.bind(Uri, 'decodeComponent'))[$toList]({growable: false})); 2473 this[_pathSegments] = new collection.UnmodifiableListView(pathToSplit == "" ? dart.const(dart.setType([], List$(String))) : pathToSplit.split("/")[$map] (dart.bind(Uri, 'decodeComponent'))[$toList]({growable: false}));
2476 } 2474 }
2477 return this[_pathSegments]; 2475 return this[_pathSegments];
2478 } 2476 }
2479 get queryParameters() { 2477 get queryParameters() {
2480 if (this[_queryParameters] == null) { 2478 if (this[_queryParameters] == null) {
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
2894 } 2892 }
2895 if (reference.hasQuery) 2893 if (reference.hasQuery)
2896 targetQuery = reference.query; 2894 targetQuery = reference.query;
2897 } 2895 }
2898 targetUserInfo = this[_userInfo]; 2896 targetUserInfo = this[_userInfo];
2899 targetHost = this[_host]; 2897 targetHost = this[_host];
2900 targetPort = this[_port]; 2898 targetPort = this[_port];
2901 } 2899 }
2902 } 2900 }
2903 let fragment = reference.hasFragment ? reference.fragment : null; 2901 let fragment = reference.hasFragment ? reference.fragment : null;
2904 return new Uri[_internal$](targetScheme, targetUserInfo, targetHost, targe tPort, targetPath, targetQuery, fragment); 2902 return new Uri._internal(targetScheme, targetUserInfo, targetHost, targetP ort, targetPath, targetQuery, fragment);
2905 } 2903 }
2906 get hasAuthority() { 2904 get hasAuthority() {
2907 return this[_host] != null; 2905 return this[_host] != null;
2908 } 2906 }
2909 get hasPort() { 2907 get hasPort() {
2910 return this[_port] != null; 2908 return this[_port] != null;
2911 } 2909 }
2912 get hasQuery() { 2910 get hasQuery() {
2913 return this[_query] != null; 2911 return this[_query] != null;
2914 } 2912 }
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
3443 exports.StackTrace = StackTrace; 3441 exports.StackTrace = StackTrace;
3444 exports.Stopwatch = Stopwatch; 3442 exports.Stopwatch = Stopwatch;
3445 exports.String = String; 3443 exports.String = String;
3446 exports.RuneIterator = RuneIterator; 3444 exports.RuneIterator = RuneIterator;
3447 exports.StringBuffer = StringBuffer; 3445 exports.StringBuffer = StringBuffer;
3448 exports.StringSink = StringSink; 3446 exports.StringSink = StringSink;
3449 exports.Symbol = Symbol; 3447 exports.Symbol = Symbol;
3450 exports.Type = Type; 3448 exports.Type = Type;
3451 exports.Uri = Uri; 3449 exports.Uri = Uri;
3452 })(core || (core = {})); 3450 })(core || (core = {}));
OLDNEW
« no previous file with comments | « lib/runtime/dart/convert.js ('k') | lib/runtime/dart/typed_data.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698