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

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

Issue 1121993004: Inference through conditional expressions (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Rebase 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/src/checker/rules.dart » ('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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 dart.defineNamedConstructor(RangeError, 'index'); 725 dart.defineNamedConstructor(RangeError, 'index');
726 class IndexError extends ArgumentError { 726 class IndexError extends ArgumentError {
727 IndexError(invalidValue, indexable, name, message, length) { 727 IndexError(invalidValue, indexable, name, message, length) {
728 if (name === void 0) 728 if (name === void 0)
729 name = null; 729 name = null;
730 if (message === void 0) 730 if (message === void 0)
731 message = null; 731 message = null;
732 if (length === void 0) 732 if (length === void 0)
733 length = null; 733 length = null;
734 this.indexable = indexable; 734 this.indexable = indexable;
735 this.length = dart.as(length != null ? length : dart.dload(indexable, 'len gth'), int); 735 this.length = length != null ? length : dart.as(dart.dload(indexable, 'len gth'), int);
736 super.value(invalidValue, name, message != null ? message : "Index out of range"); 736 super.value(invalidValue, name, message != null ? message : "Index out of range");
737 } 737 }
738 get start() { 738 get start() {
739 return 0; 739 return 0;
740 } 740 }
741 get end() { 741 get end() {
742 return dart.notNull(this.length) - 1; 742 return dart.notNull(this.length) - 1;
743 } 743 }
744 toString() { 744 toString() {
745 dart.assert(this[_hasValue]); 745 dart.assert(this[_hasValue]);
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 Expando(name) { 1023 Expando(name) {
1024 if (name === void 0) 1024 if (name === void 0)
1025 name = null; 1025 name = null;
1026 this.name = name; 1026 this.name = name;
1027 } 1027 }
1028 toString() { 1028 toString() {
1029 return `Expando:${this.name}`; 1029 return `Expando:${this.name}`;
1030 } 1030 }
1031 get(object) { 1031 get(object) {
1032 let values = _js_helper.Primitives.getProperty(object, Expando._EXPANDO_ PROPERTY_NAME); 1032 let values = _js_helper.Primitives.getProperty(object, Expando._EXPANDO_ PROPERTY_NAME);
1033 return dart.as(values == null ? null : _js_helper.Primitives.getProperty (values, this[_getKey]()), T); 1033 return values == null ? null : dart.as(_js_helper.Primitives.getProperty (values, this[_getKey]()), T);
1034 } 1034 }
1035 set(object, value) { 1035 set(object, value) {
1036 dart.as(value, T); 1036 dart.as(value, T);
1037 let values = _js_helper.Primitives.getProperty(object, Expando._EXPANDO_ PROPERTY_NAME); 1037 let values = _js_helper.Primitives.getProperty(object, Expando._EXPANDO_ PROPERTY_NAME);
1038 if (values == null) { 1038 if (values == null) {
1039 values = new Object(); 1039 values = new Object();
1040 _js_helper.Primitives.setProperty(object, Expando._EXPANDO_PROPERTY_NA ME, values); 1040 _js_helper.Primitives.setProperty(object, Expando._EXPANDO_PROPERTY_NA ME, values);
1041 } 1041 }
1042 _js_helper.Primitives.setProperty(values, this[_getKey](), value); 1042 _js_helper.Primitives.setProperty(values, this[_getKey](), value);
1043 } 1043 }
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after
2346 break; 2346 break;
2347 } 2347 }
2348 } 2348 }
2349 host = authority.substring(hostStart, hostEnd); 2349 host = authority.substring(hostStart, hostEnd);
2350 } 2350 }
2351 return new Uri({scheme: scheme, userInfo: userInfo, host: dart.as(host, St ring), port: dart.as(port, int), pathSegments: unencodedPath.split("/"), queryPa rameters: queryParameters}); 2351 return new Uri({scheme: scheme, userInfo: userInfo, host: dart.as(host, St ring), port: dart.as(port, int), pathSegments: unencodedPath.split("/"), queryPa rameters: queryParameters});
2352 } 2352 }
2353 file(path, opts) { 2353 file(path, opts) {
2354 let windows = opts && 'windows' in opts ? opts.windows : null; 2354 let windows = opts && 'windows' in opts ? opts.windows : null;
2355 windows = windows == null ? Uri._isWindows : windows; 2355 windows = windows == null ? Uri._isWindows : windows;
2356 return dart.as(windows ? Uri._makeWindowsFileUrl(path) : Uri._makeFileUri( path), Uri); 2356 return windows ? dart.as(Uri._makeWindowsFileUrl(path), Uri) : dart.as(Uri ._makeFileUri(path), Uri);
2357 } 2357 }
2358 static get base() { 2358 static get base() {
2359 let uri = _js_helper.Primitives.currentUri(); 2359 let uri = _js_helper.Primitives.currentUri();
2360 if (uri != null) 2360 if (uri != null)
2361 return Uri.parse(uri); 2361 return Uri.parse(uri);
2362 throw new UnsupportedError("'Uri.base' is not supported"); 2362 throw new UnsupportedError("'Uri.base' is not supported");
2363 } 2363 }
2364 static get _isWindows() { 2364 static get _isWindows() {
2365 return false; 2365 return false;
2366 } 2366 }
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
3481 exports.StackTrace = StackTrace; 3481 exports.StackTrace = StackTrace;
3482 exports.Stopwatch = Stopwatch; 3482 exports.Stopwatch = Stopwatch;
3483 exports.String = String; 3483 exports.String = String;
3484 exports.RuneIterator = RuneIterator; 3484 exports.RuneIterator = RuneIterator;
3485 exports.StringBuffer = StringBuffer; 3485 exports.StringBuffer = StringBuffer;
3486 exports.StringSink = StringSink; 3486 exports.StringSink = StringSink;
3487 exports.Symbol = Symbol; 3487 exports.Symbol = Symbol;
3488 exports.Type = Type; 3488 exports.Type = Type;
3489 exports.Uri = Uri; 3489 exports.Uri = Uri;
3490 })(core || (core = {})); 3490 })(core || (core = {}));
OLDNEW
« no previous file with comments | « lib/runtime/dart/convert.js ('k') | lib/src/checker/rules.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698