OLD | NEW |
---|---|
1 var core; | 1 var core; |
2 (function(exports) { | 2 (function(exports) { |
3 'use strict'; | 3 'use strict'; |
4 class Object { | |
5 Object() { | |
6 var name = this.constructor.name; | |
7 var init = this[name]; | |
8 var result = void 0; | |
9 if (init) | |
10 result = init.apply(this, arguments); | |
11 return result === void 0 ? this : result; | |
12 } | |
13 ['=='](other) { | |
14 return identical(this, other); | |
15 } | |
16 get hashCode() { | |
17 return _js_helper.Primitives.objectHashCode(this); | |
18 } | |
19 toString() { | |
20 return _js_helper.Primitives.objectToString(this); | |
21 } | |
22 noSuchMethod(invocation) { | |
23 throw new NoSuchMethodError(this, invocation.memberName, invocation.positi onalArguments, invocation.namedArguments); | |
24 } | |
25 get runtimeType() { | |
26 return _js_helper.getRuntimeType(this); | |
27 } | |
28 } | |
4 class Deprecated extends Object { | 29 class Deprecated extends Object { |
5 Deprecated(expires) { | 30 Deprecated(expires) { |
6 this.expires = expires; | 31 this.expires = expires; |
7 } | 32 } |
8 toString() { | 33 toString() { |
9 return `Deprecated feature. Will be removed ${this.expires}`; | 34 return `Deprecated feature. Will be removed ${this.expires}`; |
10 } | 35 } |
11 } | 36 } |
12 class _Override extends Object { | 37 class _Override extends Object { |
13 _Override() { | 38 _Override() { |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
307 DateTime.MAY = 5; | 332 DateTime.MAY = 5; |
308 DateTime.JUNE = 6; | 333 DateTime.JUNE = 6; |
309 DateTime.JULY = 7; | 334 DateTime.JULY = 7; |
310 DateTime.AUGUST = 8; | 335 DateTime.AUGUST = 8; |
311 DateTime.SEPTEMBER = 9; | 336 DateTime.SEPTEMBER = 9; |
312 DateTime.OCTOBER = 10; | 337 DateTime.OCTOBER = 10; |
313 DateTime.NOVEMBER = 11; | 338 DateTime.NOVEMBER = 11; |
314 DateTime.DECEMBER = 12; | 339 DateTime.DECEMBER = 12; |
315 DateTime.MONTHS_PER_YEAR = 12; | 340 DateTime.MONTHS_PER_YEAR = 12; |
316 DateTime._MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000; | 341 DateTime._MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000; |
342 let _onParseErrorInt = Symbol('_onParseErrorInt'); | |
343 let _onParseErrorDouble = Symbol('_onParseErrorDouble'); | |
344 class num extends Object { | |
345 static parse(input, onError) { | |
346 if (onError === void 0) | |
347 onError = null; | |
348 let source = input.trim(); | |
349 _parseError = false; | |
350 let result = int.parse(source, {onError: _onParseErrorInt}); | |
351 if (!dart.notNull(_parseError)) | |
352 return result; | |
353 _parseError = false; | |
354 result = double.parse(source, _onParseErrorDouble); | |
355 if (!dart.notNull(_parseError)) | |
356 return result; | |
357 if (onError === null) | |
358 throw new FormatException(input); | |
359 return onError(input); | |
360 } | |
361 static [_onParseErrorInt](_) { | |
362 _parseError = true; | |
363 return 0; | |
364 } | |
365 static [_onParseErrorDouble](_) { | |
366 _parseError = true; | |
367 return 0.0; | |
368 } | |
369 } | |
370 num._parseError = false; | |
317 class double extends num { | 371 class double extends num { |
318 static parse(source, onError) { | 372 static parse(source, onError) { |
319 if (onError === void 0) | 373 if (onError === void 0) |
320 onError = null; | 374 onError = null; |
321 return _js_helper.Primitives.parseDouble(source, onError); | 375 return _js_helper.Primitives.parseDouble(source, onError); |
322 } | 376 } |
323 } | 377 } |
324 double.NAN = 0.0 / 0.0; | 378 double.NAN = 0.0 / 0.0; |
325 double.INFINITY = 1.0 / 0.0; | 379 double.INFINITY = 1.0 / 0.0; |
326 double.NEGATIVE_INFINITY = -dart.notNull(double.INFINITY); | 380 double.NEGATIVE_INFINITY = -dart.notNull(double.INFINITY); |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1068 return this; | 1122 return this; |
1069 return new _GeneratorIterable.slice(this[_start], newEnd, this[_generato r]); | 1123 return new _GeneratorIterable.slice(this[_start], newEnd, this[_generato r]); |
1070 } | 1124 } |
1071 static [_id](n) { | 1125 static [_id](n) { |
1072 return n; | 1126 return n; |
1073 } | 1127 } |
1074 } | 1128 } |
1075 dart.defineNamedConstructor(_GeneratorIterable, 'slice'); | 1129 dart.defineNamedConstructor(_GeneratorIterable, 'slice'); |
1076 return _GeneratorIterable; | 1130 return _GeneratorIterable; |
1077 }); | 1131 }); |
1078 let _GeneratorIterable = _GeneratorIterable$(dart.dynamic); | 1132 dart.defineLazyClassGeneric(exports, '_GeneratorIterable', {get: _GeneratorIte rable$}); |
1079 let _index = Symbol('_index'); | 1133 let _index = Symbol('_index'); |
1080 let _current = Symbol('_current'); | 1134 let _current = Symbol('_current'); |
1081 let _GeneratorIterator$ = dart.generic(function(E) { | 1135 let _GeneratorIterator$ = dart.generic(function(E) { |
1082 class _GeneratorIterator extends Object { | 1136 class _GeneratorIterator extends Object { |
1083 _GeneratorIterator($_index, $_end, $_generator) { | 1137 _GeneratorIterator($_index, $_end, $_generator) { |
1084 this[_index] = $_index; | 1138 this[_index] = $_index; |
1085 this[_end] = $_end; | 1139 this[_end] = $_end; |
1086 this[_generator] = $_generator; | 1140 this[_generator] = $_generator; |
1087 this[_current] = null; | 1141 this[_current] = null; |
1088 } | 1142 } |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1194 let Map = Map$(dart.dynamic, dart.dynamic); | 1248 let Map = Map$(dart.dynamic, dart.dynamic); |
1195 class Null extends Object { | 1249 class Null extends Object { |
1196 Null$_uninstantiable() { | 1250 Null$_uninstantiable() { |
1197 throw new UnsupportedError('class Null cannot be instantiated'); | 1251 throw new UnsupportedError('class Null cannot be instantiated'); |
1198 } | 1252 } |
1199 toString() { | 1253 toString() { |
1200 return "null"; | 1254 return "null"; |
1201 } | 1255 } |
1202 } | 1256 } |
1203 dart.defineNamedConstructor(Null, '_uninstantiable'); | 1257 dart.defineNamedConstructor(Null, '_uninstantiable'); |
1204 let _onParseErrorInt = Symbol('_onParseErrorInt'); | |
1205 let _onParseErrorDouble = Symbol('_onParseErrorDouble'); | |
1206 class num extends Object { | |
1207 static parse(input, onError) { | |
1208 if (onError === void 0) | |
1209 onError = null; | |
1210 let source = input.trim(); | |
1211 _parseError = false; | |
1212 let result = int.parse(source, {onError: _onParseErrorInt}); | |
1213 if (!dart.notNull(_parseError)) | |
1214 return result; | |
1215 _parseError = false; | |
1216 result = double.parse(source, _onParseErrorDouble); | |
1217 if (!dart.notNull(_parseError)) | |
1218 return result; | |
1219 if (onError === null) | |
1220 throw new FormatException(input); | |
1221 return onError(input); | |
1222 } | |
1223 static [_onParseErrorInt](_) { | |
1224 _parseError = true; | |
1225 return 0; | |
1226 } | |
1227 static [_onParseErrorDouble](_) { | |
1228 _parseError = true; | |
1229 return 0.0; | |
1230 } | |
1231 } | |
1232 num._parseError = false; | |
1233 class Object { | |
1234 Object() { | |
1235 var name = this.constructor.name; | |
1236 var init = this[name]; | |
1237 var result = void 0; | |
1238 if (init) | |
1239 result = init.apply(this, arguments); | |
1240 return result === void 0 ? this : result; | |
1241 } | |
1242 ['=='](other) { | |
1243 return identical(this, other); | |
1244 } | |
1245 get hashCode() { | |
1246 return _js_helper.Primitives.objectHashCode(this); | |
1247 } | |
1248 toString() { | |
1249 return _js_helper.Primitives.objectToString(this); | |
1250 } | |
1251 noSuchMethod(invocation) { | |
1252 throw new NoSuchMethodError(this, invocation.memberName, invocation.positi onalArguments, invocation.namedArguments); | |
1253 } | |
1254 get runtimeType() { | |
1255 return _js_helper.getRuntimeType(this); | |
1256 } | |
1257 } | |
1258 class Pattern extends Object { | 1258 class Pattern extends Object { |
1259 } | 1259 } |
1260 // Function print: (Object) → void | 1260 // Function print: (Object) → void |
1261 function print(object) { | 1261 function print(object) { |
1262 let line = `${object}`; | 1262 let line = `${object}`; |
1263 if (_internal.printToZone === null) { | 1263 if (_internal.printToZone === null) { |
1264 _internal.printToConsole(line); | 1264 _internal.printToConsole(line); |
1265 } else { | 1265 } else { |
1266 dart.dinvokef(_internal.printToZone, line); | 1266 dart.dinvokef(_internal.printToZone, line); |
1267 } | 1267 } |
(...skipping 16 matching lines...) Expand all Loading... | |
1284 return new collection.LinkedHashSet.identity(); | 1284 return new collection.LinkedHashSet.identity(); |
1285 } | 1285 } |
1286 Set$from(elements) { | 1286 Set$from(elements) { |
1287 return new collection.LinkedHashSet.from(elements); | 1287 return new collection.LinkedHashSet.from(elements); |
1288 } | 1288 } |
1289 } | 1289 } |
1290 dart.defineNamedConstructor(Set, 'identity'); | 1290 dart.defineNamedConstructor(Set, 'identity'); |
1291 dart.defineNamedConstructor(Set, 'from'); | 1291 dart.defineNamedConstructor(Set, 'from'); |
1292 return Set; | 1292 return Set; |
1293 }); | 1293 }); |
1294 let Set = Set$(dart.dynamic); | 1294 dart.defineLazyClassGeneric(exports, 'Set', {get: Set$}); |
1295 let Sink$ = dart.generic(function(T) { | 1295 let Sink$ = dart.generic(function(T) { |
1296 class Sink extends Object { | 1296 class Sink extends Object { |
1297 } | 1297 } |
1298 return Sink; | 1298 return Sink; |
1299 }); | 1299 }); |
1300 let Sink = Sink$(dart.dynamic); | 1300 let Sink = Sink$(dart.dynamic); |
1301 class StackTrace extends Object { | 1301 class StackTrace extends Object { |
1302 } | 1302 } |
1303 let _stop = Symbol('_stop'); | 1303 let _stop = Symbol('_stop'); |
1304 let _initTicker = Symbol('_initTicker'); | 1304 let _initTicker = Symbol('_initTicker'); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1417 } | 1417 } |
1418 list.add(it.current); | 1418 list.add(it.current); |
1419 } | 1419 } |
1420 } | 1420 } |
1421 return _js_helper.Primitives.stringFromCharCodes(list); | 1421 return _js_helper.Primitives.stringFromCharCodes(list); |
1422 } | 1422 } |
1423 } | 1423 } |
1424 dart.defineNamedConstructor(String, 'fromCharCodes'); | 1424 dart.defineNamedConstructor(String, 'fromCharCodes'); |
1425 dart.defineNamedConstructor(String, 'fromCharCode'); | 1425 dart.defineNamedConstructor(String, 'fromCharCode'); |
1426 dart.defineNamedConstructor(String, 'fromEnvironment'); | 1426 dart.defineNamedConstructor(String, 'fromEnvironment'); |
1427 class Runes extends collection.IterableBase$(int) { | 1427 dart.defineLazyClass(exports, { |
1428 Runes(string) { | 1428 get Runes() { |
1429 this.string = string; | 1429 return class Runes extends collection.IterableBase$(int) { |
Siggi Cherem (dart-lang)
2015/03/18 23:54:55
mmm... overall I find the generic-class pattern sl
Jennifer Messerly
2015/03/19 16:03:29
Sure thing. It's actually easier to emit that way
| |
1430 super.IterableBase(); | 1430 Runes(string) { |
1431 this.string = string; | |
1432 super.IterableBase(); | |
1433 } | |
1434 get iterator() { | |
1435 return new RuneIterator(this.string); | |
1436 } | |
1437 get last() { | |
1438 if (this.string.length === 0) { | |
1439 throw new StateError('No elements.'); | |
1440 } | |
1441 let length = this.string.length; | |
1442 let code = this.string.codeUnitAt(dart.notNull(length) - 1); | |
1443 if (dart.notNull(_isTrailSurrogate(code)) && dart.notNull(this.string. length) > 1) { | |
1444 let previousCode = this.string.codeUnitAt(dart.notNull(length) - 2); | |
1445 if (_isLeadSurrogate(previousCode)) { | |
1446 return _combineSurrogatePair(previousCode, code); | |
1447 } | |
1448 } | |
1449 return code; | |
1450 } | |
1451 }; | |
1431 } | 1452 } |
1432 get iterator() { | 1453 }); |
1433 return new RuneIterator(this.string); | |
1434 } | |
1435 get last() { | |
1436 if (this.string.length === 0) { | |
1437 throw new StateError('No elements.'); | |
1438 } | |
1439 let length = this.string.length; | |
1440 let code = this.string.codeUnitAt(dart.notNull(length) - 1); | |
1441 if (dart.notNull(_isTrailSurrogate(code)) && dart.notNull(this.string.leng th) > 1) { | |
1442 let previousCode = this.string.codeUnitAt(dart.notNull(length) - 2); | |
1443 if (_isLeadSurrogate(previousCode)) { | |
1444 return _combineSurrogatePair(previousCode, code); | |
1445 } | |
1446 } | |
1447 return code; | |
1448 } | |
1449 } | |
1450 // Function _isLeadSurrogate: (int) → bool | 1454 // Function _isLeadSurrogate: (int) → bool |
1451 function _isLeadSurrogate(code) { | 1455 function _isLeadSurrogate(code) { |
1452 return (dart.notNull(code) & 64512) === 55296; | 1456 return (dart.notNull(code) & 64512) === 55296; |
1453 } | 1457 } |
1454 // Function _isTrailSurrogate: (int) → bool | 1458 // Function _isTrailSurrogate: (int) → bool |
1455 function _isTrailSurrogate(code) { | 1459 function _isTrailSurrogate(code) { |
1456 return (dart.notNull(code) & 64512) === 56320; | 1460 return (dart.notNull(code) & 64512) === 56320; |
1457 } | 1461 } |
1458 // Function _combineSurrogatePair: (int, int) → int | 1462 // Function _combineSurrogatePair: (int, int) → int |
1459 function _combineSurrogatePair(start, end) { | 1463 function _combineSurrogatePair(start, end) { |
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2961 // Function _symbolMapToStringMap: (Map<Symbol, dynamic>) → dynamic | 2965 // Function _symbolMapToStringMap: (Map<Symbol, dynamic>) → dynamic |
2962 function _symbolMapToStringMap(map) { | 2966 function _symbolMapToStringMap(map) { |
2963 if (map === null) | 2967 if (map === null) |
2964 return null; | 2968 return null; |
2965 let result = new Map(); | 2969 let result = new Map(); |
2966 map.forEach((key, value) => { | 2970 map.forEach((key, value) => { |
2967 result.set(_symbolToString(key), value); | 2971 result.set(_symbolToString(key), value); |
2968 }); | 2972 }); |
2969 return result; | 2973 return result; |
2970 } | 2974 } |
2971 class _ListConstructorSentinel extends _interceptors.JSInt { | 2975 dart.defineLazyClass(exports, { |
2972 _ListConstructorSentinel() { | 2976 get _ListConstructorSentinel() { |
2973 super.JSInt(); | 2977 return class _ListConstructorSentinel extends _interceptors.JSInt { |
2978 _ListConstructorSentinel() { | |
2979 super.JSInt(); | |
2980 } | |
2981 }; | |
2974 } | 2982 } |
2975 } | 2983 }); |
2976 // Exports: | 2984 // Exports: |
2977 exports.Deprecated = Deprecated; | 2985 exports.Deprecated = Deprecated; |
2986 exports.Object = Object; | |
2978 exports.deprecated = deprecated; | 2987 exports.deprecated = deprecated; |
2979 exports.override = override; | 2988 exports.override = override; |
2980 exports.proxy = proxy; | 2989 exports.proxy = proxy; |
2981 exports.bool = bool; | 2990 exports.bool = bool; |
2982 exports.Comparable = Comparable; | 2991 exports.Comparable = Comparable; |
2983 exports.Comparable$ = Comparable$; | 2992 exports.Comparable$ = Comparable$; |
2984 exports.DateTime = DateTime; | 2993 exports.DateTime = DateTime; |
2985 exports.double = double; | 2994 exports.double = double; |
2995 exports.num = num; | |
2986 exports.Duration = Duration; | 2996 exports.Duration = Duration; |
2987 exports.Error = Error; | 2997 exports.Error = Error; |
2988 exports.AssertionError = AssertionError; | 2998 exports.AssertionError = AssertionError; |
2989 exports.TypeError = TypeError; | 2999 exports.TypeError = TypeError; |
2990 exports.CastError = CastError; | 3000 exports.CastError = CastError; |
2991 exports.NullThrownError = NullThrownError; | 3001 exports.NullThrownError = NullThrownError; |
2992 exports.ArgumentError = ArgumentError; | 3002 exports.ArgumentError = ArgumentError; |
2993 exports.RangeError = RangeError; | 3003 exports.RangeError = RangeError; |
2994 exports.IndexError = IndexError; | 3004 exports.IndexError = IndexError; |
2995 exports.FallThroughError = FallThroughError; | 3005 exports.FallThroughError = FallThroughError; |
(...skipping 20 matching lines...) Expand all Loading... | |
3016 exports.Iterable$ = Iterable$; | 3026 exports.Iterable$ = Iterable$; |
3017 exports.BidirectionalIterator = BidirectionalIterator; | 3027 exports.BidirectionalIterator = BidirectionalIterator; |
3018 exports.BidirectionalIterator$ = BidirectionalIterator$; | 3028 exports.BidirectionalIterator$ = BidirectionalIterator$; |
3019 exports.Iterator = Iterator; | 3029 exports.Iterator = Iterator; |
3020 exports.Iterator$ = Iterator$; | 3030 exports.Iterator$ = Iterator$; |
3021 exports.List = List; | 3031 exports.List = List; |
3022 exports.List$ = List$; | 3032 exports.List$ = List$; |
3023 exports.Map = Map; | 3033 exports.Map = Map; |
3024 exports.Map$ = Map$; | 3034 exports.Map$ = Map$; |
3025 exports.Null = Null; | 3035 exports.Null = Null; |
3026 exports.num = num; | |
3027 exports.Object = Object; | |
3028 exports.Pattern = Pattern; | 3036 exports.Pattern = Pattern; |
3029 exports.print = print; | 3037 exports.print = print; |
3030 exports.Match = Match; | 3038 exports.Match = Match; |
3031 exports.RegExp = RegExp; | 3039 exports.RegExp = RegExp; |
3032 exports.Set = Set; | 3040 exports.Set = Set; |
3033 exports.Set$ = Set$; | 3041 exports.Set$ = Set$; |
3034 exports.Sink = Sink; | 3042 exports.Sink = Sink; |
3035 exports.Sink$ = Sink$; | 3043 exports.Sink$ = Sink$; |
3036 exports.StackTrace = StackTrace; | 3044 exports.StackTrace = StackTrace; |
3037 exports.Stopwatch = Stopwatch; | 3045 exports.Stopwatch = Stopwatch; |
3038 exports.String = String; | 3046 exports.String = String; |
3039 exports.Runes = Runes; | 3047 exports.Runes = Runes; |
3040 exports.RuneIterator = RuneIterator; | 3048 exports.RuneIterator = RuneIterator; |
3041 exports.StringBuffer = StringBuffer; | 3049 exports.StringBuffer = StringBuffer; |
3042 exports.StringSink = StringSink; | 3050 exports.StringSink = StringSink; |
3043 exports.Symbol = Symbol; | 3051 exports.Symbol = Symbol; |
3044 exports.Type = Type; | 3052 exports.Type = Type; |
3045 exports.Uri = Uri; | 3053 exports.Uri = Uri; |
3046 })(core || (core = {})); | 3054 })(core || (core = {})); |
OLD | NEW |