Chromium Code Reviews

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

Issue 949383003: use js_ast instead of strings to generate JS (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: add redirecting ctor test Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « test/codegen/expect/convert/convert.js ('k') | test/codegen/expect/dom/dom.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 (core) { 2 (function(core) {
3 'use strict'; 3 'use strict';
4 // Function _symbolToString: (Symbol) → String 4 // Function _symbolToString: (Symbol) → String
5 function _symbolToString(symbol) { return _internal.Symbol.getName(dart.as(sym bol, _internal.Symbol)); } 5 function _symbolToString(symbol) {
6 6 return _internal.Symbol.getName(dart.as(symbol, _internal.Symbol));
7 }
7 // Function _symbolMapToStringMap: (Map<Symbol, dynamic>) → dynamic 8 // Function _symbolMapToStringMap: (Map<Symbol, dynamic>) → dynamic
8 function _symbolMapToStringMap(map) { 9 function _symbolMapToStringMap(map) {
9 if (map === null) return null; 10 if (map === null)
11 return null;
10 let result = new Map(); 12 let result = new Map();
11 map.forEach((key, value) => { 13 map.forEach((key, value) => {
12 result.set(_symbolToString(key), value); 14 result.set(_symbolToString(key), value);
13 }); 15 });
14 return result; 16 return result;
15 } 17 }
16 18 class _ListConstructorSentinel extends dynamic {
17 class _ListConstructorSentinel extends JSInt {
18 _ListConstructorSentinel() { 19 _ListConstructorSentinel() {
19 } 20 }
20 } 21 }
21
22 class Deprecated extends dart.Object { 22 class Deprecated extends dart.Object {
23 Deprecated(expires) { 23 Deprecated(expires) {
24 this.expires = expires; 24 this.expires = expires;
25 } 25 }
26 toString() { return `Deprecated feature. Will be removed ${this.expires}`; } 26 toString() {
27 return `Deprecated feature. Will be removed ${this.expires}`;
28 }
27 } 29 }
28
29 class _Override extends dart.Object { 30 class _Override extends dart.Object {
30 _Override() { 31 _Override() {
31 } 32 }
32 } 33 }
33
34 let deprecated = new Deprecated("next release"); 34 let deprecated = new Deprecated("next release");
35 let override = new _Override(); 35 let override = new _Override();
36 class _Proxy extends dart.Object { 36 class _Proxy extends dart.Object {
37 _Proxy() { 37 _Proxy() {
38 } 38 }
39 } 39 }
40
41 let proxy = new _Proxy(); 40 let proxy = new _Proxy();
42 class bool extends dart.Object { 41 class bool extends dart.Object {
43 bool$fromEnvironment(name, opt$) { 42 bool$fromEnvironment(name, opt$) {
44 let defaultValue = opt$.defaultValue === undefined ? false : opt$.defaultV alue; 43 let defaultValue = opt$.defaultValue === void 0 ? false : opt$.defaultValu e;
45 throw new UnsupportedError('bool.fromEnvironment can only be used as a con st constructor'); 44 throw new UnsupportedError('bool.fromEnvironment can only be used as a con st constructor');
46 } 45 }
47 toString() { 46 toString() {
48 return this ? "true" : "false"; 47 return this ? "true" : "false";
49 } 48 }
50 } 49 }
51 dart.defineNamedConstructor(bool, "fromEnvironment"); 50 dart.defineNamedConstructor(bool, 'fromEnvironment');
52
53 let Comparable$ = dart.generic(function(T) { 51 let Comparable$ = dart.generic(function(T) {
54 class Comparable extends dart.Object { 52 class Comparable extends dart.Object {
55 static compare(a, b) { return a.compareTo(b); } 53 static compare(a, b) {
54 return a.compareTo(b);
55 }
56 } 56 }
57 return Comparable; 57 return Comparable;
58 }); 58 });
59 let Comparable = Comparable$(dynamic); 59 let Comparable = Comparable$(dynamic);
60
61 class DateTime extends dart.Object { 60 class DateTime extends dart.Object {
62 DateTime(year, month, day, hour, minute, second, millisecond) { 61 DateTime(year, month, day, hour, minute, second, millisecond) {
63 if (month === undefined) month = 1; 62 if (month === void 0)
64 if (day === undefined) day = 1; 63 month = 1;
65 if (hour === undefined) hour = 0; 64 if (day === void 0)
66 if (minute === undefined) minute = 0; 65 day = 1;
67 if (second === undefined) second = 0; 66 if (hour === void 0)
68 if (millisecond === undefined) millisecond = 0; 67 hour = 0;
69 DateTime.call(this, year, month, day, hour, minute, second, millisecond, f alse); 68 if (minute === void 0)
69 minute = 0;
70 if (second === void 0)
71 second = 0;
72 if (millisecond === void 0)
73 millisecond = 0;
74 this.DateTime$_internal(year, month, day, hour, minute, second, millisecon d, false);
70 } 75 }
71 DateTime$utc(year, month, day, hour, minute, second, millisecond) { 76 DateTime$utc(year, month, day, hour, minute, second, millisecond) {
72 if (month === undefined) month = 1; 77 if (month === void 0)
73 if (day === undefined) day = 1; 78 month = 1;
74 if (hour === undefined) hour = 0; 79 if (day === void 0)
75 if (minute === undefined) minute = 0; 80 day = 1;
76 if (second === undefined) second = 0; 81 if (hour === void 0)
77 if (millisecond === undefined) millisecond = 0; 82 hour = 0;
78 utc.call(this, year, month, day, hour, minute, second, millisecond, true); 83 if (minute === void 0)
84 minute = 0;
85 if (second === void 0)
86 second = 0;
87 if (millisecond === void 0)
88 millisecond = 0;
89 this.DateTime$_internal(year, month, day, hour, minute, second, millisecon d, true);
79 } 90 }
80 DateTime$now() { 91 DateTime$now() {
81 now.call(this); 92 this.DateTime$_now();
82 } 93 }
83 static parse(formattedString) { 94 static parse(formattedString) {
84 let re = new RegExp('^([+-]?\\d{4,6})-?(\\d\\d)-?(\\d\\d)' + 95 let re = new RegExp('^([+-]?\\d{4,6})-?(\\d\\d)-?(\\d\\d)' + '(?:[ T](\\d\ \d)(?::?(\\d\\d)(?::?(\\d\\d)(.\\d{1,6})?)?)?' + '( ?[zZ]| ?([-+])(\\d\\d)(?::?( \\d\\d))?)?)?$');
85 '(?:[ T](\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(.\\d{1,6})?)?)?' +
86 '( ?[zZ]| ?([-+])(\\d\\d)(?::?(\\d\\d))?)?)?$');
87 let match = re.firstMatch(formattedString); 96 let match = re.firstMatch(formattedString);
88 if (match !== null) { 97 if (match !== null) {
89 // Function parseIntOrZero: (String) → int 98 // Function parseIntOrZero: (String) → int
90 function parseIntOrZero(matched) { 99 function parseIntOrZero(matched) {
91 if (matched === null) return 0; 100 if (matched === null)
101 return 0;
92 return int.parse(matched); 102 return int.parse(matched);
93 } 103 }
94 // Function parseDoubleOrZero: (String) → double 104 // Function parseDoubleOrZero: (String) → double
95 function parseDoubleOrZero(matched) { 105 function parseDoubleOrZero(matched) {
96 if (matched === null) return 0.0; 106 if (matched === null)
107 return 0.0;
97 return double.parse(matched); 108 return double.parse(matched);
98 } 109 }
99 let years = int.parse(match.get(1)); 110 let years = int.parse(match.get(1));
100 let month = int.parse(match.get(2)); 111 let month = int.parse(match.get(2));
101 let day = int.parse(match.get(3)); 112 let day = int.parse(match.get(3));
102 let hour = parseIntOrZero(match.get(4)); 113 let hour = parseIntOrZero(match.get(4));
103 let minute = parseIntOrZero(match.get(5)); 114 let minute = parseIntOrZero(match.get(5));
104 let second = parseIntOrZero(match.get(6)); 115 let second = parseIntOrZero(match.get(6));
105 let addOneMillisecond = false; 116 let addOneMillisecond = false;
106 let millisecond = (parseDoubleOrZero(match.get(7)) * 1000).round(); 117 let millisecond = (parseDoubleOrZero(match.get(7)) * 1000).round();
107 if (millisecond === 1000) { 118 if (millisecond === 1000) {
108 addOneMillisecond = true; 119 addOneMillisecond = true;
109 millisecond = 999; 120 millisecond = 999;
110 } 121 }
111 let isUtc = false; 122 let isUtc = false;
112 if (match.get(8) !== null) { 123 if (match.get(8) !== null) {
113 isUtc = true; 124 isUtc = true;
114 if (match.get(9) !== null) { 125 if (match.get(9) !== null) {
115 let sign = (dart.equals(match.get(9), '-')) ? -1 : 1; 126 let sign = dart.equals(match.get(9), '-') ? -1 : 1;
116 let hourDifference = int.parse(match.get(10)); 127 let hourDifference = int.parse(match.get(10));
117 let minuteDifference = parseIntOrZero(match.get(11)); 128 let minuteDifference = parseIntOrZero(match.get(11));
118 minuteDifference = 60 * hourDifference; 129 minuteDifference = 60 * hourDifference;
119 minute = sign * minuteDifference; 130 minute = sign * minuteDifference;
120 } 131 }
121 } 132 }
122 let millisecondsSinceEpoch = _brokenDownDateToMillisecondsSinceEpoch(yea rs, month, day, hour, minute, second, millisecond, isUtc); 133 let millisecondsSinceEpoch = _brokenDownDateToMillisecondsSinceEpoch(yea rs, month, day, hour, minute, second, millisecond, isUtc);
123 if (millisecondsSinceEpoch === null) { 134 if (millisecondsSinceEpoch === null) {
124 throw new FormatException("Time out of range", formattedString); 135 throw new FormatException("Time out of range", formattedString);
125 } 136 }
126 if (addOneMillisecond) millisecondsSinceEpoch++; 137 if (addOneMillisecond)
138 millisecondsSinceEpoch++;
127 return new DateTime.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, { isUtc: isUtc}); 139 return new DateTime.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, { isUtc: isUtc});
128 } else { 140 } else {
129 throw new FormatException("Invalid date format", formattedString); 141 throw new FormatException("Invalid date format", formattedString);
130 } 142 }
131 } 143 }
132 DateTime$fromMillisecondsSinceEpoch(millisecondsSinceEpoch, opt$) { 144 DateTime$fromMillisecondsSinceEpoch(millisecondsSinceEpoch, opt$) {
133 let isUtc = opt$.isUtc === undefined ? false : opt$.isUtc; 145 let isUtc = opt$.isUtc === void 0 ? false : opt$.isUtc;
134 this.millisecondsSinceEpoch = millisecondsSinceEpoch; 146 this.millisecondsSinceEpoch = millisecondsSinceEpoch;
135 this.isUtc = isUtc; 147 this.isUtc = isUtc;
136 if (millisecondsSinceEpoch.abs() > _MAX_MILLISECONDS_SINCE_EPOCH) { 148 if (millisecondsSinceEpoch.abs() > _MAX_MILLISECONDS_SINCE_EPOCH) {
137 throw new ArgumentError(millisecondsSinceEpoch); 149 throw new ArgumentError(millisecondsSinceEpoch);
138 } 150 }
139 if (isUtc === null) throw new ArgumentError(isUtc); 151 if (isUtc === null)
152 throw new ArgumentError(isUtc);
140 } 153 }
141 ['=='](other) { 154 ['=='](other) {
142 if (!dart.notNull((dart.is(other, DateTime)))) return false; 155 if (!dart.notNull(dart.is(other, DateTime)))
143 return (dart.notNull(this.millisecondsSinceEpoch === dart.dload(other, "mi llisecondsSinceEpoch")) && dart.notNull(this.isUtc === dart.dload(other, "isUtc" ))); 156 return false;
157 return dart.notNull(this.millisecondsSinceEpoch === dart.dload(other, 'mil lisecondsSinceEpoch')) && dart.notNull(this.isUtc === dart.dload(other, 'isUtc') );
144 } 158 }
145 isBefore(other) { 159 isBefore(other) {
146 return this.millisecondsSinceEpoch < other.millisecondsSinceEpoch; 160 return this.millisecondsSinceEpoch < other.millisecondsSinceEpoch;
147 } 161 }
148 isAfter(other) { 162 isAfter(other) {
149 return this.millisecondsSinceEpoch > other.millisecondsSinceEpoch; 163 return this.millisecondsSinceEpoch > other.millisecondsSinceEpoch;
150 } 164 }
151 isAtSameMomentAs(other) { 165 isAtSameMomentAs(other) {
152 return this.millisecondsSinceEpoch === other.millisecondsSinceEpoch; 166 return this.millisecondsSinceEpoch === other.millisecondsSinceEpoch;
153 } 167 }
154 compareTo(other) { return this.millisecondsSinceEpoch.compareTo(other.millis econdsSinceEpoch); } 168 compareTo(other) {
155 get hashCode() { return this.millisecondsSinceEpoch; } 169 return this.millisecondsSinceEpoch.compareTo(other.millisecondsSinceEpoch) ;
170 }
171 get hashCode() {
172 return this.millisecondsSinceEpoch;
173 }
156 toLocal() { 174 toLocal() {
157 if (this.isUtc) { 175 if (this.isUtc) {
158 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpo ch, {isUtc: false}); 176 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpo ch, {isUtc: false});
159 } 177 }
160 return this; 178 return this;
161 } 179 }
162 toUtc() { 180 toUtc() {
163 if (this.isUtc) return this; 181 if (this.isUtc)
182 return this;
164 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpoch , {isUtc: true}); 183 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpoch , {isUtc: true});
165 } 184 }
166 static _fourDigits(n) { 185 static _fourDigits(n) {
167 let absN = n.abs(); 186 let absN = n.abs();
168 let sign = n < 0 ? "-" : ""; 187 let sign = n < 0 ? "-" : "";
169 if (absN >= 1000) return `${n}`; 188 if (absN >= 1000)
170 if (absN >= 100) return `${sign}0${absN}`; 189 return `${n}`;
171 if (absN >= 10) return `${sign}00${absN}`; 190 if (absN >= 100)
191 return `${sign}0${absN}`;
192 if (absN >= 10)
193 return `${sign}00${absN}`;
172 return `${sign}000${absN}`; 194 return `${sign}000${absN}`;
173 } 195 }
174 static _sixDigits(n) { 196 static _sixDigits(n) {
175 dart.assert(dart.notNull(n < -9999) || dart.notNull(n > 9999)); 197 dart.assert(dart.notNull(n < -9999) || dart.notNull(n > 9999));
176 let absN = n.abs(); 198 let absN = n.abs();
177 let sign = n < 0 ? "-" : "+"; 199 let sign = n < 0 ? "-" : "+";
178 if (absN >= 100000) return `${sign}${absN}`; 200 if (absN >= 100000)
201 return `${sign}${absN}`;
179 return `${sign}0${absN}`; 202 return `${sign}0${absN}`;
180 } 203 }
181 static _threeDigits(n) { 204 static _threeDigits(n) {
182 if (n >= 100) return `${n}`; 205 if (n >= 100)
183 if (n >= 10) return `0${n}`; 206 return `${n}`;
207 if (n >= 10)
208 return `0${n}`;
184 return `00${n}`; 209 return `00${n}`;
185 } 210 }
186 static _twoDigits(n) { 211 static _twoDigits(n) {
187 if (n >= 10) return `${n}`; 212 if (n >= 10)
213 return `${n}`;
188 return `0${n}`; 214 return `0${n}`;
189 } 215 }
190 toString() { 216 toString() {
191 let y = _fourDigits(this.year); 217 let y = _fourDigits(this.year);
192 let m = _twoDigits(this.month); 218 let m = _twoDigits(this.month);
193 let d = _twoDigits(this.day); 219 let d = _twoDigits(this.day);
194 let h = _twoDigits(this.hour); 220 let h = _twoDigits(this.hour);
195 let min = _twoDigits(this.minute); 221 let min = _twoDigits(this.minute);
196 let sec = _twoDigits(this.second); 222 let sec = _twoDigits(this.second);
197 let ms = _threeDigits(this.millisecond); 223 let ms = _threeDigits(this.millisecond);
198 if (this.isUtc) { 224 if (this.isUtc) {
199 return `${y}-${m}-${d} ${h}:${min}:${sec}.${ms}Z`; 225 return `${y}-${m}-${d} ${h}:${min}:${sec}.${ms}Z`;
200 } else { 226 } else {
201 return `${y}-${m}-${d} ${h}:${min}:${sec}.${ms}`; 227 return `${y}-${m}-${d} ${h}:${min}:${sec}.${ms}`;
202 } 228 }
203 } 229 }
204 toIso8601String() { 230 toIso8601String() {
205 let y = (dart.notNull(this.year >= -9999) && dart.notNull(this.year <= 999 9)) ? _fourDigits(this.year) : _sixDigits(this.year); 231 let y = dart.notNull(this.year >= -9999) && dart.notNull(this.year <= 9999 ) ? _fourDigits(this.year) : _sixDigits(this.year);
206 let m = _twoDigits(this.month); 232 let m = _twoDigits(this.month);
207 let d = _twoDigits(this.day); 233 let d = _twoDigits(this.day);
208 let h = _twoDigits(this.hour); 234 let h = _twoDigits(this.hour);
209 let min = _twoDigits(this.minute); 235 let min = _twoDigits(this.minute);
210 let sec = _twoDigits(this.second); 236 let sec = _twoDigits(this.second);
211 let ms = _threeDigits(this.millisecond); 237 let ms = _threeDigits(this.millisecond);
212 if (this.isUtc) { 238 if (this.isUtc) {
213 return `${y}-${m}-${d}T${h}:${min}:${sec}.${ms}Z`; 239 return `${y}-${m}-${d}T${h}:${min}:${sec}.${ms}Z`;
214 } else { 240 } else {
215 return `${y}-${m}-${d}T${h}:${min}:${sec}.${ms}`; 241 return `${y}-${m}-${d}T${h}:${min}:${sec}.${ms}`;
216 } 242 }
217 } 243 }
218 add(duration) { 244 add(duration) {
219 let ms = this.millisecondsSinceEpoch; 245 let ms = this.millisecondsSinceEpoch;
220 return new DateTime.fromMillisecondsSinceEpoch(ms + duration.inMillisecond s, {isUtc: this.isUtc}); 246 return new DateTime.fromMillisecondsSinceEpoch(ms + duration.inMillisecond s, {isUtc: this.isUtc});
221 } 247 }
222 subtract(duration) { 248 subtract(duration) {
223 let ms = this.millisecondsSinceEpoch; 249 let ms = this.millisecondsSinceEpoch;
224 return new DateTime.fromMillisecondsSinceEpoch(ms - duration.inMillisecond s, {isUtc: this.isUtc}); 250 return new DateTime.fromMillisecondsSinceEpoch(ms - duration.inMillisecond s, {isUtc: this.isUtc});
225 } 251 }
226 difference(other) { 252 difference(other) {
227 let ms = this.millisecondsSinceEpoch; 253 let ms = this.millisecondsSinceEpoch;
228 let otherMs = other.millisecondsSinceEpoch; 254 let otherMs = other.millisecondsSinceEpoch;
229 return new Duration({milliseconds: ms - otherMs}); 255 return new Duration({milliseconds: ms - otherMs});
230 } 256 }
231 DateTime$_internal(year, month, day, hour, minute, second, millisecond, isUt c) { 257 DateTime$_internal(year, month, day, hour, minute, second, millisecond, isUt c) {
232 this.isUtc = typeof isUtc == "boolean" ? isUtc : (function(e) { throw e }( new ArgumentError(isUtc)); 258 this.isUtc = typeof isUtc == boolean ? isUtc : dart.throw_(new ArgumentErr or(isUtc));
233 this.millisecondsSinceEpoch = dart.dinvokef(/* Unimplemented unknown name */checkInt, dart.dinvoke(/* Unimplemented unknown name */Primitives, "valueFromD ecomposedDate", year, month, day, hour, minute, second, millisecond, isUtc)); 259 this.millisecondsSinceEpoch = dart.dinvokef(/* Unimplemented unknown name */checkInt, dart.dinvoke(/* Unimplemented unknown name */Primitives, 'valueFromD ecomposedDate', year, month, day, hour, minute, second, millisecond, isUtc));
234 } 260 }
235 DateTime$_now() { 261 DateTime$_now() {
236 this.isUtc = false; 262 this.isUtc = false;
237 this.millisecondsSinceEpoch = dart.dinvoke(/* Unimplemented unknown name * /Primitives, "dateNow"); 263 this.millisecondsSinceEpoch = dart.dinvoke(/* Unimplemented unknown name * /Primitives, 'dateNow');
238 } 264 }
239 static _brokenDownDateToMillisecondsSinceEpoch(year, month, day, hour, minut e, second, millisecond, isUtc) { 265 static _brokenDownDateToMillisecondsSinceEpoch(year, month, day, hour, minut e, second, millisecond, isUtc) {
240 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, "v alueFromDecomposedDate", year, month, day, hour, minute, second, millisecond, is Utc), int); 266 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'v alueFromDecomposedDate', year, month, day, hour, minute, second, millisecond, is Utc), int);
241 } 267 }
242 get timeZoneName() { 268 get timeZoneName() {
243 if (this.isUtc) return "UTC"; 269 if (this.isUtc)
244 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, "g etTimeZoneName", this), String); 270 return "UTC";
271 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'g etTimeZoneName', this), String);
245 } 272 }
246 get timeZoneOffset() { 273 get timeZoneOffset() {
247 if (this.isUtc) return new Duration(); 274 if (this.isUtc)
248 return new Duration({minutes: dart.dinvoke(/* Unimplemented unknown name * /Primitives, "getTimeZoneOffsetInMinutes", this)}); 275 return new Duration();
276 return new Duration({minutes: dart.dinvoke(/* Unimplemented unknown name * /Primitives, 'getTimeZoneOffsetInMinutes', this)});
249 } 277 }
250 get year() { return dart.as(dart.dinvoke(/* Unimplemented unknown name */Pri mitives, "getYear", this), int); } 278 get year() {
251 get month() { return dart.as(dart.dinvoke(/* Unimplemented unknown name */Pr imitives, "getMonth", this), int); } 279 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'g etYear', this), int);
252 get day() { return dart.as(dart.dinvoke(/* Unimplemented unknown name */Prim itives, "getDay", this), int); } 280 }
253 get hour() { return dart.as(dart.dinvoke(/* Unimplemented unknown name */Pri mitives, "getHours", this), int); } 281 get month() {
254 get minute() { return dart.as(dart.dinvoke(/* Unimplemented unknown name */P rimitives, "getMinutes", this), int); } 282 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'g etMonth', this), int);
255 get second() { return dart.as(dart.dinvoke(/* Unimplemented unknown name */P rimitives, "getSeconds", this), int); } 283 }
256 get millisecond() { return dart.as(dart.dinvoke(/* Unimplemented unknown nam e */Primitives, "getMilliseconds", this), int); } 284 get day() {
257 get weekday() { return dart.as(dart.dinvoke(/* Unimplemented unknown name */ Primitives, "getWeekday", this), int); } 285 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'g etDay', this), int);
286 }
287 get hour() {
288 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'g etHours', this), int);
289 }
290 get minute() {
291 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'g etMinutes', this), int);
292 }
293 get second() {
294 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'g etSeconds', this), int);
295 }
296 get millisecond() {
297 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'g etMilliseconds', this), int);
298 }
299 get weekday() {
300 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'g etWeekday', this), int);
301 }
258 } 302 }
259 dart.defineNamedConstructor(DateTime, "utc"); 303 dart.defineNamedConstructor(DateTime, 'utc');
260 dart.defineNamedConstructor(DateTime, "now"); 304 dart.defineNamedConstructor(DateTime, 'now');
261 dart.defineNamedConstructor(DateTime, "fromMillisecondsSinceEpoch"); 305 dart.defineNamedConstructor(DateTime, 'fromMillisecondsSinceEpoch');
262 dart.defineNamedConstructor(DateTime, "_internal"); 306 dart.defineNamedConstructor(DateTime, '_internal');
263 dart.defineNamedConstructor(DateTime, "_now"); 307 dart.defineNamedConstructor(DateTime, '_now');
264 DateTime.MONDAY = 1; 308 DateTime.MONDAY = 1;
265 DateTime.TUESDAY = 2; 309 DateTime.TUESDAY = 2;
266 DateTime.WEDNESDAY = 3; 310 DateTime.WEDNESDAY = 3;
267 DateTime.THURSDAY = 4; 311 DateTime.THURSDAY = 4;
268 DateTime.FRIDAY = 5; 312 DateTime.FRIDAY = 5;
269 DateTime.SATURDAY = 6; 313 DateTime.SATURDAY = 6;
270 DateTime.SUNDAY = 7; 314 DateTime.SUNDAY = 7;
271 DateTime.DAYS_PER_WEEK = 7; 315 DateTime.DAYS_PER_WEEK = 7;
272 DateTime.JANUARY = 1; 316 DateTime.JANUARY = 1;
273 DateTime.FEBRUARY = 2; 317 DateTime.FEBRUARY = 2;
274 DateTime.MARCH = 3; 318 DateTime.MARCH = 3;
275 DateTime.APRIL = 4; 319 DateTime.APRIL = 4;
276 DateTime.MAY = 5; 320 DateTime.MAY = 5;
277 DateTime.JUNE = 6; 321 DateTime.JUNE = 6;
278 DateTime.JULY = 7; 322 DateTime.JULY = 7;
279 DateTime.AUGUST = 8; 323 DateTime.AUGUST = 8;
280 DateTime.SEPTEMBER = 9; 324 DateTime.SEPTEMBER = 9;
281 DateTime.OCTOBER = 10; 325 DateTime.OCTOBER = 10;
282 DateTime.NOVEMBER = 11; 326 DateTime.NOVEMBER = 11;
283 DateTime.DECEMBER = 12; 327 DateTime.DECEMBER = 12;
284 DateTime.MONTHS_PER_YEAR = 12; 328 DateTime.MONTHS_PER_YEAR = 12;
285 DateTime._MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000; 329 DateTime._MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000;
286
287 class double extends num { 330 class double extends num {
288 static parse(source, onError) { 331 static parse(source, onError) {
289 if (onError === undefined) onError = null; 332 if (onError === void 0)
290 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, "p arseDouble", source, onError), double); 333 onError = null;
334 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'p arseDouble', source, onError), double);
291 } 335 }
292 } 336 }
293 double.NAN = 0.0 / 0.0; 337 double.NAN = 0.0 / 0.0;
294 double.INFINITY = 1.0 / 0.0; 338 double.INFINITY = 1.0 / 0.0;
295 double.NEGATIVE_INFINITY = -INFINITY; 339 double.NEGATIVE_INFINITY = -INFINITY;
296 double.MIN_POSITIVE = 5e-324; 340 double.MIN_POSITIVE = 5e-324;
297 double.MAX_FINITE = 1.7976931348623157e+308; 341 double.MAX_FINITE = 1.7976931348623157e+308;
298
299 class Duration extends dart.Object { 342 class Duration extends dart.Object {
300 Duration(opt$) { 343 Duration(opt$) {
301 let days = opt$.days === undefined ? 0 : opt$.days; 344 let days = opt$.days === void 0 ? 0 : opt$.days;
302 let hours = opt$.hours === undefined ? 0 : opt$.hours; 345 let hours = opt$.hours === void 0 ? 0 : opt$.hours;
303 let minutes = opt$.minutes === undefined ? 0 : opt$.minutes; 346 let minutes = opt$.minutes === void 0 ? 0 : opt$.minutes;
304 let seconds = opt$.seconds === undefined ? 0 : opt$.seconds; 347 let seconds = opt$.seconds === void 0 ? 0 : opt$.seconds;
305 let milliseconds = opt$.milliseconds === undefined ? 0 : opt$.milliseconds ; 348 let milliseconds = opt$.milliseconds === void 0 ? 0 : opt$.milliseconds;
306 let microseconds = opt$.microseconds === undefined ? 0 : opt$.microseconds ; 349 let microseconds = opt$.microseconds === void 0 ? 0 : opt$.microseconds;
307 Duration.call(this, days * MICROSECONDS_PER_DAY + hours * MICROSECONDS_PER _HOUR + minutes * MICROSECONDS_PER_MINUTE + seconds * MICROSECONDS_PER_SECOND + milliseconds * MICROSECONDS_PER_MILLISECOND + microseconds); 350 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);
308 } 351 }
309 Duration$_microseconds(_duration) { 352 Duration$_microseconds(_duration) {
310 this._duration = _duration; 353 this._duration = _duration;
311 } 354 }
312 ['+'](other) { 355 ['+'](other) {
313 return new Duration._microseconds(this._duration + other._duration); 356 return new Duration._microseconds(this._duration + other._duration);
314 } 357 }
315 ['-'](other) { 358 ['-'](other) {
316 return new Duration._microseconds(this._duration - other._duration); 359 return new Duration._microseconds(this._duration - other._duration);
317 } 360 }
318 ['*'](factor) { 361 ['*'](factor) {
319 return new Duration._microseconds((this._duration * dart.notNull(factor)). round()); 362 return new Duration._microseconds((this._duration * dart.notNull(factor)). round());
320 } 363 }
321 ['~/'](quotient) { 364 ['~/'](quotient) {
322 if (quotient === 0) throw new IntegerDivisionByZeroException(); 365 if (quotient === 0)
366 throw new IntegerDivisionByZeroException();
323 return new Duration._microseconds((this._duration / quotient).truncate()); 367 return new Duration._microseconds((this._duration / quotient).truncate());
324 } 368 }
325 ['<'](other) { return this._duration < other._duration; } 369 ['<'](other) {
326 ['>'](other) { return this._duration > other._duration; } 370 return this._duration < other._duration;
327 ['<='](other) { return this._duration <= other._duration; } 371 }
328 ['>='](other) { return this._duration >= other._duration; } 372 ['>'](other) {
329 get inDays() { return (this._duration / Duration.MICROSECONDS_PER_DAY).trunc ate(); } 373 return this._duration > other._duration;
330 get inHours() { return (this._duration / Duration.MICROSECONDS_PER_HOUR).tru ncate(); } 374 }
331 get inMinutes() { return (this._duration / Duration.MICROSECONDS_PER_MINUTE) .truncate(); } 375 ['<='](other) {
332 get inSeconds() { return (this._duration / Duration.MICROSECONDS_PER_SECOND) .truncate(); } 376 return this._duration <= other._duration;
333 get inMilliseconds() { return (this._duration / Duration.MICROSECONDS_PER_MI LLISECOND).truncate(); } 377 }
334 get inMicroseconds() { return this._duration; } 378 ['>='](other) {
379 return this._duration >= other._duration;
380 }
381 get inDays() {
382 return (this._duration / Duration.MICROSECONDS_PER_DAY).truncate();
383 }
384 get inHours() {
385 return (this._duration / Duration.MICROSECONDS_PER_HOUR).truncate();
386 }
387 get inMinutes() {
388 return (this._duration / Duration.MICROSECONDS_PER_MINUTE).truncate();
389 }
390 get inSeconds() {
391 return (this._duration / Duration.MICROSECONDS_PER_SECOND).truncate();
392 }
393 get inMilliseconds() {
394 return (this._duration / Duration.MICROSECONDS_PER_MILLISECOND).truncate() ;
395 }
396 get inMicroseconds() {
397 return this._duration;
398 }
335 ['=='](other) { 399 ['=='](other) {
336 if (!dart.is(other, Duration)) return false; 400 if (!dart.is(other, Duration))
337 return this._duration === dart.dload(other, "_duration"); 401 return false;
402 return this._duration === dart.dload(other, '_duration');
338 } 403 }
339 get hashCode() { return this._duration.hashCode; } 404 get hashCode() {
340 compareTo(other) { return this._duration.compareTo(other._duration); } 405 return this._duration.hashCode;
406 }
407 compareTo(other) {
408 return this._duration.compareTo(other._duration);
409 }
341 toString() { 410 toString() {
342 // Function sixDigits: (int) → String 411 // Function sixDigits: (int) → String
343 function sixDigits(n) { 412 function sixDigits(n) {
344 if (n >= 100000) return `${n}`; 413 if (n >= 100000)
345 if (n >= 10000) return `0${n}`; 414 return `${n}`;
346 if (n >= 1000) return `00${n}`; 415 if (n >= 10000)
347 if (n >= 100) return `000${n}`; 416 return `0${n}`;
348 if (n >= 10) return `0000${n}`; 417 if (n >= 1000)
418 return `00${n}`;
419 if (n >= 100)
420 return `000${n}`;
421 if (n >= 10)
422 return `0000${n}`;
349 return `00000${n}`; 423 return `00000${n}`;
350 } 424 }
351 // Function twoDigits: (int) → String 425 // Function twoDigits: (int) → String
352 function twoDigits(n) { 426 function twoDigits(n) {
353 if (n >= 10) return `${n}`; 427 if (n >= 10)
428 return `${n}`;
354 return `0${n}`; 429 return `0${n}`;
355 } 430 }
356 if (this.inMicroseconds < 0) { 431 if (this.inMicroseconds < 0) {
357 return `-${/* Unimplemented postfix operator: -this */}`; 432 return `-${dart.throw_("Unimplemented PrefixExpression: -this")}`;
358 } 433 }
359 let twoDigitMinutes = twoDigits(dart.notNull(this.inMinutes.remainder(MINU TES_PER_HOUR))); 434 let twoDigitMinutes = twoDigits(dart.notNull(this.inMinutes.remainder(MINU TES_PER_HOUR)));
360 let twoDigitSeconds = twoDigits(dart.notNull(this.inSeconds.remainder(SECO NDS_PER_MINUTE))); 435 let twoDigitSeconds = twoDigits(dart.notNull(this.inSeconds.remainder(SECO NDS_PER_MINUTE)));
361 let sixDigitUs = sixDigits(dart.notNull(this.inMicroseconds.remainder(MICR OSECONDS_PER_SECOND))); 436 let sixDigitUs = sixDigits(dart.notNull(this.inMicroseconds.remainder(MICR OSECONDS_PER_SECOND)));
362 return `${this.inHours}:${twoDigitMinutes}:${twoDigitSeconds}.${sixDigitUs }`; 437 return `${this.inHours}:${twoDigitMinutes}:${twoDigitSeconds}.${sixDigitUs }`;
363 } 438 }
364 get isNegative() { return this._duration < 0; } 439 get isNegative() {
365 abs() { return new Duration._microseconds(this._duration.abs()); } 440 return this._duration < 0;
366 ['-']() { return new Duration._microseconds(-this._duration); } 441 }
442 abs() {
443 return new Duration._microseconds(this._duration.abs());
444 }
445 ['-']() {
446 return new Duration._microseconds(-this._duration);
447 }
367 } 448 }
368 dart.defineNamedConstructor(Duration, "_microseconds"); 449 dart.defineNamedConstructor(Duration, '_microseconds');
369 Duration.MICROSECONDS_PER_MILLISECOND = 1000; 450 Duration.MICROSECONDS_PER_MILLISECOND = 1000;
370 Duration.MILLISECONDS_PER_SECOND = 1000; 451 Duration.MILLISECONDS_PER_SECOND = 1000;
371 Duration.SECONDS_PER_MINUTE = 60; 452 Duration.SECONDS_PER_MINUTE = 60;
372 Duration.MINUTES_PER_HOUR = 60; 453 Duration.MINUTES_PER_HOUR = 60;
373 Duration.HOURS_PER_DAY = 24; 454 Duration.HOURS_PER_DAY = 24;
374 Duration.MICROSECONDS_PER_SECOND = MICROSECONDS_PER_MILLISECOND * MILLISECONDS _PER_SECOND; 455 Duration.MICROSECONDS_PER_SECOND = MICROSECONDS_PER_MILLISECOND * MILLISECONDS _PER_SECOND;
375 Duration.MICROSECONDS_PER_MINUTE = MICROSECONDS_PER_SECOND * SECONDS_PER_MINUT E; 456 Duration.MICROSECONDS_PER_MINUTE = MICROSECONDS_PER_SECOND * SECONDS_PER_MINUT E;
376 Duration.MICROSECONDS_PER_HOUR = MICROSECONDS_PER_MINUTE * MINUTES_PER_HOUR; 457 Duration.MICROSECONDS_PER_HOUR = MICROSECONDS_PER_MINUTE * MINUTES_PER_HOUR;
377 Duration.MICROSECONDS_PER_DAY = MICROSECONDS_PER_HOUR * HOURS_PER_DAY; 458 Duration.MICROSECONDS_PER_DAY = MICROSECONDS_PER_HOUR * HOURS_PER_DAY;
378 Duration.MILLISECONDS_PER_MINUTE = MILLISECONDS_PER_SECOND * SECONDS_PER_MINUT E; 459 Duration.MILLISECONDS_PER_MINUTE = MILLISECONDS_PER_SECOND * SECONDS_PER_MINUT E;
379 Duration.MILLISECONDS_PER_HOUR = MILLISECONDS_PER_MINUTE * MINUTES_PER_HOUR; 460 Duration.MILLISECONDS_PER_HOUR = MILLISECONDS_PER_MINUTE * MINUTES_PER_HOUR;
380 Duration.MILLISECONDS_PER_DAY = MILLISECONDS_PER_HOUR * HOURS_PER_DAY; 461 Duration.MILLISECONDS_PER_DAY = MILLISECONDS_PER_HOUR * HOURS_PER_DAY;
381 Duration.SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR; 462 Duration.SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR;
382 Duration.SECONDS_PER_DAY = SECONDS_PER_HOUR * HOURS_PER_DAY; 463 Duration.SECONDS_PER_DAY = SECONDS_PER_HOUR * HOURS_PER_DAY;
383 Duration.MINUTES_PER_DAY = MINUTES_PER_HOUR * HOURS_PER_DAY; 464 Duration.MINUTES_PER_DAY = MINUTES_PER_HOUR * HOURS_PER_DAY;
384 Duration.ZERO = new Duration({seconds: 0}); 465 Duration.ZERO = new Duration({seconds: 0});
385
386 class Error extends dart.Object { 466 class Error extends dart.Object {
387 Error() { 467 Error() {
388 } 468 }
389 static safeToString(object) { 469 static safeToString(object) {
390 if (dart.notNull(dart.notNull(dart.is(object, num)) || dart.notNull(typeof object == "boolean")) || dart.notNull(null === object)) { 470 if (dart.notNull(dart.notNull(dart.is(object, num)) || dart.notNull(typeof object == boolean)) || dart.notNull(null === object)) {
391 return object.toString(); 471 return object.toString();
392 } 472 }
393 if (typeof object == "string") { 473 if (typeof object == string) {
394 return _stringToSafeString(object); 474 return _stringToSafeString(object);
395 } 475 }
396 return _objectToString(object); 476 return _objectToString(object);
397 } 477 }
398 static _stringToSafeString(string) { 478 static _stringToSafeString(string) {
399 return dart.as(dart.dinvokef(/* Unimplemented unknown name */jsonEncodeNat ive, string), String); 479 return dart.as(dart.dinvokef(/* Unimplemented unknown name */jsonEncodeNat ive, string), String);
400 } 480 }
401 static _objectToString(object) { 481 static _objectToString(object) {
402 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, "o bjectToString", object), String); 482 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'o bjectToString', object), String);
403 } 483 }
404 get stackTrace() { return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, "extractStackTrace", this), StackTrace); } 484 get stackTrace() {
485 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'e xtractStackTrace', this), StackTrace);
486 }
405 } 487 }
406
407 class AssertionError extends Error { 488 class AssertionError extends Error {
408 } 489 }
409
410 class TypeError extends AssertionError { 490 class TypeError extends AssertionError {
411 } 491 }
412
413 class CastError extends Error { 492 class CastError extends Error {
414 } 493 }
415
416 class NullThrownError extends Error { 494 class NullThrownError extends Error {
417 toString() { return "Throw of null."; } 495 toString() {
496 return "Throw of null.";
497 }
418 } 498 }
419
420 class ArgumentError extends Error { 499 class ArgumentError extends Error {
421 ArgumentError(message) { 500 ArgumentError(message) {
422 if (message === undefined) message = null; 501 if (message === void 0)
502 message = null;
423 this.message = message; 503 this.message = message;
424 this.invalidValue = null; 504 this.invalidValue = null;
425 this._hasValue = false; 505 this._hasValue = false;
426 this.name = null; 506 this.name = null;
427 super.Error(); 507 super.Error();
428 } 508 }
429 ArgumentError$value(value, name, message) { 509 ArgumentError$value(value, name, message) {
430 if (name === undefined) name = null; 510 if (name === void 0)
431 if (message === undefined) message = "Invalid argument"; 511 name = null;
512 if (message === void 0)
513 message = "Invalid argument";
432 this.name = name; 514 this.name = name;
433 this.message = message; 515 this.message = message;
434 this.invalidValue = value; 516 this.invalidValue = value;
435 this._hasValue = true; 517 this._hasValue = true;
436 super.Error(); 518 super.Error();
437 } 519 }
438 ArgumentError$notNull(name) { 520 ArgumentError$notNull(name) {
439 if (name === undefined) name = null; 521 if (name === void 0)
440 notNull.call(this, null, name, "Must not be null"); 522 name = null;
523 this.ArgumentError$value(null, name, "Must not be null");
441 } 524 }
442 toString() { 525 toString() {
443 if (!dart.notNull(this._hasValue)) { 526 if (!dart.notNull(this._hasValue)) {
444 let result = "Invalid arguments(s)"; 527 let result = "Invalid arguments(s)";
445 if (this.message !== null) { 528 if (this.message !== null) {
446 result = `${result}: ${this.message}`; 529 result = `${result}: ${this.message}`;
447 } 530 }
448 return result; 531 return result;
449 } 532 }
450 let nameString = ""; 533 let nameString = "";
451 if (this.name !== null) { 534 if (this.name !== null) {
452 nameString = ` (${this.name})`; 535 nameString = ` (${this.name})`;
453 } 536 }
454 return `${this.message}${nameString}: ${Error.safeToString(this.invalidVal ue)}`; 537 return `${this.message}${nameString}: ${Error.safeToString(this.invalidVal ue)}`;
455 } 538 }
456 } 539 }
457 dart.defineNamedConstructor(ArgumentError, "value"); 540 dart.defineNamedConstructor(ArgumentError, 'value');
458 dart.defineNamedConstructor(ArgumentError, "notNull"); 541 dart.defineNamedConstructor(ArgumentError, 'notNull');
459
460 class RangeError extends ArgumentError { 542 class RangeError extends ArgumentError {
461 RangeError(message) { 543 RangeError(message) {
462 this.start = null; 544 this.start = null;
463 this.end = null; 545 this.end = null;
464 super.ArgumentError(message); 546 super.ArgumentError(message);
465 } 547 }
466 RangeError$value(value, name, message) { 548 RangeError$value(value, name, message) {
467 if (name === undefined) name = null; 549 if (name === void 0)
468 if (message === undefined) message = null; 550 name = null;
551 if (message === void 0)
552 message = null;
469 this.start = null; 553 this.start = null;
470 this.end = null; 554 this.end = null;
471 super.ArgumentError$value(value, name, (message !== null) ? message : "Val ue not in range"); 555 super.ArgumentError$value(value, name, message !== null ? message : "Value not in range");
472 } 556 }
473 RangeError$range(invalidValue, minValue, maxValue, name, message) { 557 RangeError$range(invalidValue, minValue, maxValue, name, message) {
474 if (name === undefined) name = null; 558 if (name === void 0)
475 if (message === undefined) message = null; 559 name = null;
560 if (message === void 0)
561 message = null;
476 this.start = minValue; 562 this.start = minValue;
477 this.end = maxValue; 563 this.end = maxValue;
478 super.ArgumentError$value(invalidValue, name, (message !== null) ? message : "Invalid value"); 564 super.ArgumentError$value(invalidValue, name, message !== null ? message : "Invalid value");
479 } 565 }
480 RangeError$index(index, indexable, name, message, length) { 566 RangeError$index(index, indexable, name, message, length) {
481 return new IndexError(index, indexable, name, message, length); 567 return new IndexError(index, indexable, name, message, length);
482 } 568 }
483 static checkValueInInterval(value, minValue, maxValue, name, message) { 569 static checkValueInInterval(value, minValue, maxValue, name, message) {
484 if (name === undefined) name = null; 570 if (name === void 0)
485 if (message === undefined) message = null; 571 name = null;
572 if (message === void 0)
573 message = null;
486 if (dart.notNull(value < minValue) || dart.notNull(value > maxValue)) { 574 if (dart.notNull(value < minValue) || dart.notNull(value > maxValue)) {
487 throw new RangeError.range(value, minValue, maxValue, name, message); 575 throw new RangeError.range(value, minValue, maxValue, name, message);
488 } 576 }
489 } 577 }
490 static checkValidIndex(index, indexable, name, length, message) { 578 static checkValidIndex(index, indexable, name, length, message) {
491 if (name === undefined) name = null; 579 if (name === void 0)
492 if (length === undefined) length = null; 580 name = null;
493 if (message === undefined) message = null; 581 if (length === void 0)
494 if (length === null) length = dart.as(dart.dload(indexable, "length"), int ); 582 length = null;
583 if (message === void 0)
584 message = null;
585 if (length === null)
586 length = dart.as(dart.dload(indexable, 'length'), int);
495 if (dart.notNull(index < 0) || dart.notNull(index >= length)) { 587 if (dart.notNull(index < 0) || dart.notNull(index >= length)) {
496 if (name === null) name = "index"; 588 if (name === null)
589 name = "index";
497 throw new RangeError.index(index, indexable, name, message, length); 590 throw new RangeError.index(index, indexable, name, message, length);
498 } 591 }
499 } 592 }
500 static checkValidRange(start, end, length, startName, endName, message) { 593 static checkValidRange(start, end, length, startName, endName, message) {
501 if (startName === undefined) startName = null; 594 if (startName === void 0)
502 if (endName === undefined) endName = null; 595 startName = null;
503 if (message === undefined) message = null; 596 if (endName === void 0)
597 endName = null;
598 if (message === void 0)
599 message = null;
504 if (dart.notNull(start < 0) || dart.notNull(start > length)) { 600 if (dart.notNull(start < 0) || dart.notNull(start > length)) {
505 if (startName === null) startName = "start"; 601 if (startName === null)
602 startName = "start";
506 throw new RangeError.range(start, 0, length, startName, message); 603 throw new RangeError.range(start, 0, length, startName, message);
507 } 604 }
508 if (dart.notNull(end !== null) && dart.notNull((dart.notNull(end < start) || dart.notNull(end > length)))) { 605 if (dart.notNull(end !== null) && dart.notNull(dart.notNull(end < start) | | dart.notNull(end > length))) {
509 if (endName === null) endName = "end"; 606 if (endName === null)
607 endName = "end";
510 throw new RangeError.range(end, start, length, endName, message); 608 throw new RangeError.range(end, start, length, endName, message);
511 } 609 }
512 } 610 }
513 static checkNotNegative(value, name, message) { 611 static checkNotNegative(value, name, message) {
514 if (name === undefined) name = null; 612 if (name === void 0)
515 if (message === undefined) message = null; 613 name = null;
516 if (value < 0) throw new RangeError.range(value, 0, null, name, message); 614 if (message === void 0)
615 message = null;
616 if (value < 0)
617 throw new RangeError.range(value, 0, null, name, message);
517 } 618 }
518 toString() { 619 toString() {
519 if (!dart.notNull(this._hasValue)) return `RangeError: ${this.message}`; 620 if (!dart.notNull(this._hasValue))
621 return `RangeError: ${this.message}`;
520 let value = Error.safeToString(this.invalidValue); 622 let value = Error.safeToString(this.invalidValue);
521 let explanation = ""; 623 let explanation = "";
522 if (this.start === null) { 624 if (this.start === null) {
523 if (this.end !== null) { 625 if (this.end !== null) {
524 explanation = `: Not less than or equal to ${this.end}`; 626 explanation = `: Not less than or equal to ${this.end}`;
525 } 627 }
526 } else if (this.end === null) { 628 } else if (this.end === null) {
527 explanation = `: Not greater than or equal to ${this.start}`; 629 explanation = `: Not greater than or equal to ${this.start}`;
528 } else if (dart.notNull(this.end) > dart.notNull(this.start)) { 630 } else if (dart.notNull(this.end) > dart.notNull(this.start)) {
529 explanation = `: Not in range ${this.start}..${this.end}, inclusive.`; 631 explanation = `: Not in range ${this.start}..${this.end}, inclusive.`;
530 } else if (dart.notNull(this.end) < dart.notNull(this.start)) { 632 } else if (dart.notNull(this.end) < dart.notNull(this.start)) {
531 explanation = ": Valid value range is empty"; 633 explanation = ": Valid value range is empty";
532 } else { 634 } else {
533 explanation = `: Only valid value is ${this.start}`; 635 explanation = `: Only valid value is ${this.start}`;
534 } 636 }
535 return `RangeError: ${this.message} (${value})${explanation}`; 637 return `RangeError: ${this.message} (${value})${explanation}`;
536 } 638 }
537 } 639 }
538 dart.defineNamedConstructor(RangeError, "value"); 640 dart.defineNamedConstructor(RangeError, 'value');
539 dart.defineNamedConstructor(RangeError, "range"); 641 dart.defineNamedConstructor(RangeError, 'range');
540 dart.defineNamedConstructor(RangeError, "index"); 642 dart.defineNamedConstructor(RangeError, 'index');
541
542 class IndexError extends ArgumentError { 643 class IndexError extends ArgumentError {
543 IndexError(invalidValue, indexable, name, message, length) { 644 IndexError(invalidValue, indexable, name, message, length) {
544 if (name === undefined) name = null; 645 if (name === void 0)
545 if (message === undefined) message = null; 646 name = null;
546 if (length === undefined) length = null; 647 if (message === void 0)
648 message = null;
649 if (length === void 0)
650 length = null;
547 this.indexable = indexable; 651 this.indexable = indexable;
548 this.length = (length !== null) ? length : dart.dload(indexable, "length") ; 652 this.length = length !== null ? length : dart.dload(indexable, 'length');
549 super.ArgumentError$value(invalidValue, name, (message !== null) ? message : "Index out of range"); 653 super.ArgumentError$value(invalidValue, name, message !== null ? message : "Index out of range");
550 } 654 }
551 get start() { return 0; } 655 get start() {
552 get end() { return this.length - 1; } 656 return 0;
657 }
658 get end() {
659 return this.length - 1;
660 }
553 toString() { 661 toString() {
554 dart.assert(this._hasValue); 662 dart.assert(this._hasValue);
555 let target = Error.safeToString(this.indexable); 663 let target = Error.safeToString(this.indexable);
556 let explanation = `index should be less than ${this.length}`; 664 let explanation = `index should be less than ${this.length}`;
557 if (dart.dbinary(this.invalidValue, "<", 0)) { 665 if (dart.dbinary(this.invalidValue, '<', 0)) {
558 explanation = "index must not be negative"; 666 explanation = "index must not be negative";
559 } 667 }
560 return `RangeError: ${this.message} (${target}[${this.invalidValue}]): ${e xplanation}`; 668 return `RangeError: ${this.message} (${target}[${this.invalidValue}]): ${e xplanation}`;
561 } 669 }
562 } 670 }
563
564 class FallThroughError extends Error { 671 class FallThroughError extends Error {
565 FallThroughError() { 672 FallThroughError() {
566 super.Error(); 673 super.Error();
567 } 674 }
568 } 675 }
569
570 class AbstractClassInstantiationError extends Error { 676 class AbstractClassInstantiationError extends Error {
571 AbstractClassInstantiationError(_className) { 677 AbstractClassInstantiationError(_className) {
572 this._className = _className; 678 this._className = _className;
573 super.Error(); 679 super.Error();
574 } 680 }
575 toString() { return `Cannot instantiate abstract class: '${this._className}' `; } 681 toString() {
682 return `Cannot instantiate abstract class: '${this._className}'`;
683 }
576 } 684 }
577
578 class NoSuchMethodError extends Error { 685 class NoSuchMethodError extends Error {
579 NoSuchMethodError(receiver, memberName, positionalArguments, namedArguments, existingArgumentNames) { 686 NoSuchMethodError(receiver, memberName, positionalArguments, namedArguments, existingArgumentNames) {
580 if (existingArgumentNames === undefined) existingArgumentNames = null; 687 if (existingArgumentNames === void 0)
688 existingArgumentNames = null;
581 this._receiver = receiver; 689 this._receiver = receiver;
582 this._memberName = memberName; 690 this._memberName = memberName;
583 this._arguments = positionalArguments; 691 this._arguments = positionalArguments;
584 this._namedArguments = namedArguments; 692 this._namedArguments = namedArguments;
585 this._existingArgumentNames = existingArgumentNames; 693 this._existingArgumentNames = existingArgumentNames;
586 super.Error(); 694 super.Error();
587 } 695 }
588 toString() { 696 toString() {
589 let sb = new StringBuffer(); 697 let sb = new StringBuffer();
590 let i = 0; 698 let i = 0;
(...skipping 10 matching lines...)
601 if (i > 0) { 709 if (i > 0) {
602 sb.write(", "); 710 sb.write(", ");
603 } 711 }
604 sb.write(_symbolToString(key)); 712 sb.write(_symbolToString(key));
605 sb.write(": "); 713 sb.write(": ");
606 sb.write(Error.safeToString(value)); 714 sb.write(Error.safeToString(value));
607 i++; 715 i++;
608 }).bind(this)); 716 }).bind(this));
609 } 717 }
610 if (this._existingArgumentNames === null) { 718 if (this._existingArgumentNames === null) {
611 return `NoSuchMethodError : method not found: '${this._memberName}'\n` + 719 return `NoSuchMethodError : method not found: '${this._memberName}'\n` + `Receiver: ${Error.safeToString(this._receiver)}\n` + `Arguments: [${sb}]`;
612 `Receiver: ${Error.safeToString(this._receiver)}\n` +
613 `Arguments: [${sb}]`;
614 } else { 720 } else {
615 let actualParameters = sb.toString(); 721 let actualParameters = sb.toString();
616 sb = new StringBuffer(); 722 sb = new StringBuffer();
617 for (let i = 0; i < this._existingArgumentNames.length; i++) { 723 for (let i = 0; i < this._existingArgumentNames.length; i++) {
618 if (i > 0) { 724 if (i > 0) {
619 sb.write(", "); 725 sb.write(", ");
620 } 726 }
621 sb.write(this._existingArgumentNames.get(i)); 727 sb.write(this._existingArgumentNames.get(i));
622 } 728 }
623 let formalParameters = sb.toString(); 729 let formalParameters = sb.toString();
624 return "NoSuchMethodError: incorrect number of arguments passed to " + 730 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})`;
625 `method named '${this._memberName}'\n` +
626 `Receiver: ${Error.safeToString(this._receiver)}\n` +
627 `Tried calling: ${this._memberName}(${actualParameters})\n` +
628 `Found: ${this._memberName}(${formalParameters})`;
629 } 731 }
630 } 732 }
631 } 733 }
632
633 class UnsupportedError extends Error { 734 class UnsupportedError extends Error {
634 UnsupportedError(message) { 735 UnsupportedError(message) {
635 this.message = message; 736 this.message = message;
636 super.Error(); 737 super.Error();
637 } 738 }
638 toString() { return `Unsupported operation: ${this.message}`; } 739 toString() {
740 return `Unsupported operation: ${this.message}`;
741 }
639 } 742 }
640
641 class UnimplementedError extends Error { 743 class UnimplementedError extends Error {
642 UnimplementedError(message) { 744 UnimplementedError(message) {
643 if (message === undefined) message = null; 745 if (message === void 0)
746 message = null;
644 this.message = message; 747 this.message = message;
645 super.Error(); 748 super.Error();
646 } 749 }
647 toString() { return (this.message !== null ? `UnimplementedError: ${this.mes sage}` : "UnimplementedError"); } 750 toString() {
751 return this.message !== null ? `UnimplementedError: ${this.message}` : "Un implementedError";
752 }
648 } 753 }
649
650 class StateError extends Error { 754 class StateError extends Error {
651 StateError(message) { 755 StateError(message) {
652 this.message = message; 756 this.message = message;
653 super.Error(); 757 super.Error();
654 } 758 }
655 toString() { return `Bad state: ${this.message}`; } 759 toString() {
760 return `Bad state: ${this.message}`;
761 }
656 } 762 }
657
658 class ConcurrentModificationError extends Error { 763 class ConcurrentModificationError extends Error {
659 ConcurrentModificationError(modifiedObject) { 764 ConcurrentModificationError(modifiedObject) {
660 if (modifiedObject === undefined) modifiedObject = null; 765 if (modifiedObject === void 0)
766 modifiedObject = null;
661 this.modifiedObject = modifiedObject; 767 this.modifiedObject = modifiedObject;
662 super.Error(); 768 super.Error();
663 } 769 }
664 toString() { 770 toString() {
665 if (this.modifiedObject === null) { 771 if (this.modifiedObject === null) {
666 return "Concurrent modification during iteration."; 772 return "Concurrent modification during iteration.";
667 } 773 }
668 return "Concurrent modification during iteration: " + 774 return "Concurrent modification during iteration: " + `${Error.safeToStrin g(this.modifiedObject)}.`;
669 `${Error.safeToString(this.modifiedObject)}.`;
670 } 775 }
671 } 776 }
672
673 class OutOfMemoryError extends dart.Object { 777 class OutOfMemoryError extends dart.Object {
674 OutOfMemoryError() { 778 OutOfMemoryError() {
675 } 779 }
676 toString() { return "Out of Memory"; } 780 toString() {
677 get stackTrace() { return null; } 781 return "Out of Memory";
782 }
783 get stackTrace() {
784 return null;
785 }
678 } 786 }
679
680 class StackOverflowError extends dart.Object { 787 class StackOverflowError extends dart.Object {
681 StackOverflowError() { 788 StackOverflowError() {
682 } 789 }
683 toString() { return "Stack Overflow"; } 790 toString() {
684 get stackTrace() { return null; } 791 return "Stack Overflow";
792 }
793 get stackTrace() {
794 return null;
795 }
685 } 796 }
686
687 class CyclicInitializationError extends Error { 797 class CyclicInitializationError extends Error {
688 CyclicInitializationError(variableName) { 798 CyclicInitializationError(variableName) {
689 if (variableName === undefined) variableName = null; 799 if (variableName === void 0)
800 variableName = null;
690 this.variableName = variableName; 801 this.variableName = variableName;
691 super.Error(); 802 super.Error();
692 } 803 }
693 toString() { return this.variableName === null ? "Reading static variable du ring its initialization" : `Reading static variable '${this.variableName}' durin g its initialization`; } 804 toString() {
805 return this.variableName === null ? "Reading static variable during its in itialization" : `Reading static variable '${this.variableName}' during its initi alization`;
806 }
694 } 807 }
695
696 class Exception extends dart.Object { 808 class Exception extends dart.Object {
697 Exception(message) { 809 Exception(message) {
698 if (message === undefined) message = null; 810 if (message === void 0)
811 message = null;
699 return new _ExceptionImplementation(message); 812 return new _ExceptionImplementation(message);
700 } 813 }
701 } 814 }
702
703 class _ExceptionImplementation extends dart.Object { 815 class _ExceptionImplementation extends dart.Object {
704 _ExceptionImplementation(message) { 816 _ExceptionImplementation(message) {
705 if (message === undefined) message = null; 817 if (message === void 0)
818 message = null;
706 this.message = message; 819 this.message = message;
707 } 820 }
708 toString() { 821 toString() {
709 if (this.message === null) return "Exception"; 822 if (this.message === null)
823 return "Exception";
710 return `Exception: ${this.message}`; 824 return `Exception: ${this.message}`;
711 } 825 }
712 } 826 }
713
714 class FormatException extends dart.Object { 827 class FormatException extends dart.Object {
715 FormatException(message, source, offset) { 828 FormatException(message, source, offset) {
716 if (message === undefined) message = ""; 829 if (message === void 0)
717 if (source === undefined) source = null; 830 message = "";
718 if (offset === undefined) offset = -1; 831 if (source === void 0)
832 source = null;
833 if (offset === void 0)
834 offset = -1;
719 this.message = message; 835 this.message = message;
720 this.source = source; 836 this.source = source;
721 this.offset = offset; 837 this.offset = offset;
722 } 838 }
723 toString() { 839 toString() {
724 let report = "FormatException"; 840 let report = "FormatException";
725 if (dart.notNull(this.message !== null) && dart.notNull(!dart.equals("", t his.message))) { 841 if (dart.notNull(this.message !== null) && dart.notNull(!dart.equals("", t his.message))) {
726 report = `${report}: ${this.message}`; 842 report = `${report}: ${this.message}`;
727 } 843 }
728 let offset = this.offset; 844 let offset = this.offset;
729 if (!(typeof this.source == "string")) { 845 if (!(typeof this.source == string)) {
730 if (offset !== -1) { 846 if (offset !== -1) {
731 report = ` (at offset ${offset})`; 847 report = ` (at offset ${offset})`;
732 } 848 }
733 return report; 849 return report;
734 } 850 }
735 if (dart.notNull(offset !== -1) && dart.notNull((dart.notNull(offset < 0) || dart.notNull(offset['>'](dart.dload(this.source, "length")))))) { 851 if (dart.notNull(offset !== -1) && dart.notNull(dart.notNull(offset < 0) | | dart.notNull(offset['>'](dart.dload(this.source, 'length'))))) {
736 offset = -1; 852 offset = -1;
737 } 853 }
738 if (offset === -1) { 854 if (offset === -1) {
739 let source = dart.as(this.source, String); 855 let source = dart.as(this.source, String);
740 if (source.length > 78) { 856 if (source.length > 78) {
741 source = String['+'](source.substring(0, 75), "..."); 857 source = String['+'](source.substring(0, 75), "...");
742 } 858 }
743 return `${report}\n${source}`; 859 return `${report}\n${source}`;
744 } 860 }
745 let lineNum = 1; 861 let lineNum = 1;
746 let lineStart = 0; 862 let lineStart = 0;
747 let lastWasCR = null; 863 let lastWasCR = null;
748 for (let i = 0; i < offset; i++) { 864 for (let i = 0; i < offset; i++) {
749 let char = dart.as(dart.dinvoke(this.source, "codeUnitAt", i), int); 865 let char = dart.as(dart.dinvoke(this.source, 'codeUnitAt', i), int);
750 if (char === 10) { 866 if (char === 10) {
751 if (dart.notNull(lineStart !== i) || dart.notNull(!dart.notNull(lastWa sCR))) { 867 if (dart.notNull(lineStart !== i) || dart.notNull(!dart.notNull(lastWa sCR))) {
752 lineNum++; 868 lineNum++;
753 } 869 }
754 lineStart = i + 1; 870 lineStart = i + 1;
755 lastWasCR = false; 871 lastWasCR = false;
756 } else if (char === 13) { 872 } else if (char === 13) {
757 lineNum++; 873 lineNum++;
758 lineStart = i + 1; 874 lineStart = i + 1;
759 lastWasCR = true; 875 lastWasCR = true;
760 } 876 }
761 } 877 }
762 if (lineNum > 1) { 878 if (lineNum > 1) {
763 report = ` (at line ${lineNum}, character ${offset - lineStart + 1})\n`; 879 report = ` (at line ${lineNum}, character ${offset - lineStart + 1})\n`;
764 } else { 880 } else {
765 report = ` (at character ${offset + 1})\n`; 881 report = ` (at character ${offset + 1})\n`;
766 } 882 }
767 let lineEnd = dart.as(dart.dload(this.source, "length"), int); 883 let lineEnd = dart.as(dart.dload(this.source, 'length'), int);
768 for (let i = offset; i['<'](dart.dload(this.source, "length")); i++) { 884 for (let i = offset; i['<'](dart.dload(this.source, 'length')); i++) {
769 let char = dart.as(dart.dinvoke(this.source, "codeUnitAt", i), int); 885 let char = dart.as(dart.dinvoke(this.source, 'codeUnitAt', i), int);
770 if (dart.notNull(char === 10) || dart.notNull(char === 13)) { 886 if (dart.notNull(char === 10) || dart.notNull(char === 13)) {
771 lineEnd = i; 887 lineEnd = i;
772 break; 888 break;
773 } 889 }
774 } 890 }
775 let length = lineEnd - lineStart; 891 let length = lineEnd - lineStart;
776 let start = lineStart; 892 let start = lineStart;
777 let end = lineEnd; 893 let end = lineEnd;
778 let prefix = ""; 894 let prefix = "";
779 let postfix = ""; 895 let postfix = "";
780 if (length > 78) { 896 if (length > 78) {
781 let index = offset - lineStart; 897 let index = offset - lineStart;
782 if (index < 75) { 898 if (index < 75) {
783 end = start + 75; 899 end = start + 75;
784 postfix = "..."; 900 postfix = "...";
785 } else if (end - offset < 75) { 901 } else if (end - offset < 75) {
786 start = end - 75; 902 start = end - 75;
787 prefix = "..."; 903 prefix = "...";
788 } else { 904 } else {
789 start = offset - 36; 905 start = offset - 36;
790 end = offset + 36; 906 end = offset + 36;
791 prefix = postfix = "..."; 907 prefix = postfix = "...";
792 } 908 }
793 } 909 }
794 let slice = dart.as(dart.dinvoke(this.source, "substring", start, end), St ring); 910 let slice = dart.as(dart.dinvoke(this.source, 'substring', start, end), St ring);
795 let markOffset = offset - start + prefix.length; 911 let markOffset = offset - start + prefix.length;
796 return `${report}${prefix}${slice}${postfix}\n${String['*'](" ", markOffse t)}^\n`; 912 return `${report}${prefix}${slice}${postfix}\n${String['*'](" ", markOffse t)}^\n`;
797 } 913 }
798 } 914 }
799
800 class IntegerDivisionByZeroException extends dart.Object { 915 class IntegerDivisionByZeroException extends dart.Object {
801 IntegerDivisionByZeroException() { 916 IntegerDivisionByZeroException() {
802 } 917 }
803 toString() { return "IntegerDivisionByZeroException"; } 918 toString() {
919 return "IntegerDivisionByZeroException";
920 }
804 } 921 }
805
806 let Expando$ = dart.generic(function(T) { 922 let Expando$ = dart.generic(function(T) {
807 class Expando extends dart.Object { 923 class Expando extends dart.Object {
808 Expando(name) { 924 Expando(name) {
809 if (name === undefined) name = null; 925 if (name === void 0)
926 name = null;
810 this.name = name; 927 this.name = name;
811 } 928 }
812 toString() { return `Expando:${this.name}`; } 929 toString() {
930 return `Expando:${this.name}`;
931 }
813 get(object) { 932 get(object) {
814 let values = dart.dinvoke(/* Unimplemented unknown name */Primitives, "g etProperty", object, /* Unimplemented unknown name */_EXPANDO_PROPERTY_NAME); 933 let values = dart.dinvoke(/* Unimplemented unknown name */Primitives, 'g etProperty', object, /* Unimplemented unknown name */_EXPANDO_PROPERTY_NAME);
815 return dart.as((values === null) ? null : dart.dinvoke(/* Unimplemented unknown name */Primitives, "getProperty", values, dart.dinvokef(/* Unimplemented unknown name */_getKey)), T); 934 return dart.as(values === null ? null : dart.dinvoke(/* Unimplemented un known name */Primitives, 'getProperty', values, dart.dinvokef(/* Unimplemented u nknown name */_getKey)), T);
816 } 935 }
817 set(object, value) { 936 set(object, value) {
818 let values = dart.dinvoke(/* Unimplemented unknown name */Primitives, "g etProperty", object, /* Unimplemented unknown name */_EXPANDO_PROPERTY_NAME); 937 let values = dart.dinvoke(/* Unimplemented unknown name */Primitives, 'g etProperty', object, /* Unimplemented unknown name */_EXPANDO_PROPERTY_NAME);
819 if (values === null) { 938 if (values === null) {
820 values = new Object(); 939 values = new Object();
821 dart.dinvoke(/* Unimplemented unknown name */Primitives, "setProperty" , object, /* Unimplemented unknown name */_EXPANDO_PROPERTY_NAME, values); 940 dart.dinvoke(/* Unimplemented unknown name */Primitives, 'setProperty' , object, /* Unimplemented unknown name */_EXPANDO_PROPERTY_NAME, values);
822 } 941 }
823 dart.dinvoke(/* Unimplemented unknown name */Primitives, "setProperty", values, dart.dinvokef(/* Unimplemented unknown name */_getKey), value); 942 dart.dinvoke(/* Unimplemented unknown name */Primitives, 'setProperty', values, dart.dinvokef(/* Unimplemented unknown name */_getKey), value);
824 } 943 }
825 } 944 }
826 return Expando; 945 return Expando;
827 }); 946 });
828 let Expando = Expando$(dynamic); 947 let Expando = Expando$(dynamic);
829
830 class Function extends dart.Object { 948 class Function extends dart.Object {
831 static apply(function, positionalArguments, namedArguments) { 949 static apply(function, positionalArguments, namedArguments) {
832 if (namedArguments === undefined) namedArguments = null; 950 if (namedArguments === void 0)
833 return dart.dinvoke(/* Unimplemented unknown name */Primitives, "applyFunc tion", function, positionalArguments, namedArguments === null ? null : dart.dinv okef(/* Unimplemented unknown name */_toMangledNames, namedArguments)); 951 namedArguments = null;
952 return dart.dinvoke(/* Unimplemented unknown name */Primitives, 'applyFunc tion', function, positionalArguments, namedArguments === null ? null : dart.dinv okef(/* Unimplemented unknown name */_toMangledNames, namedArguments));
834 } 953 }
835 } 954 }
836
837 // Function identical: (Object, Object) → bool 955 // Function identical: (Object, Object) → bool
838 function identical(a, b) { 956 function identical(a, b) {
839 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, "ide nticalImplementation", a, b), bool); 957 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'ide nticalImplementation', a, b), bool);
840 } 958 }
841
842 // Function identityHashCode: (Object) → int 959 // Function identityHashCode: (Object) → int
843 function identityHashCode(object) { return dart.as(dart.dinvokef(/* Unimplemen ted unknown name */objectHashCode, object), int); } 960 function identityHashCode(object) {
844 961 return dart.as(dart.dinvokef(/* Unimplemented unknown name */objectHashCode, object), int);
962 }
845 class int extends num { 963 class int extends num {
846 int$fromEnvironment(name, opt$) { 964 int$fromEnvironment(name, opt$) {
847 let defaultValue = opt$.defaultValue === undefined ? null : opt$.defaultVa lue; 965 let defaultValue = opt$.defaultValue === void 0 ? null : opt$.defaultValue ;
848 throw new UnsupportedError('int.fromEnvironment can only be used as a cons t constructor'); 966 throw new UnsupportedError('int.fromEnvironment can only be used as a cons t constructor');
849 } 967 }
850 static parse(source, opt$) { 968 static parse(source, opt$) {
851 let radix = opt$.radix === undefined ? null : opt$.radix; 969 let radix = opt$.radix === void 0 ? null : opt$.radix;
852 let onError = opt$.onError === undefined ? null : opt$.onError; 970 let onError = opt$.onError === void 0 ? null : opt$.onError;
853 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, "p arseInt", source, radix, onError), int); 971 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'p arseInt', source, radix, onError), int);
854 } 972 }
855 } 973 }
856 dart.defineNamedConstructor(int, "fromEnvironment"); 974 dart.defineNamedConstructor(int, 'fromEnvironment');
857
858 class Invocation extends dart.Object { 975 class Invocation extends dart.Object {
859 get isAccessor() { return dart.notNull(this.isGetter) || dart.notNull(this.i sSetter); } 976 get isAccessor() {
977 return dart.notNull(this.isGetter) || dart.notNull(this.isSetter);
978 }
860 } 979 }
861
862 let Iterable$ = dart.generic(function(E) { 980 let Iterable$ = dart.generic(function(E) {
863 class Iterable extends dart.Object { 981 class Iterable extends dart.Object {
864 Iterable() { 982 Iterable() {
865 } 983 }
866 Iterable$generate(count, generator) { 984 Iterable$generate(count, generator) {
867 if (generator === undefined) generator = null; 985 if (generator === void 0)
868 if (count <= 0) return new _internal.EmptyIterable(); 986 generator = null;
987 if (count <= 0)
988 return new _internal.EmptyIterable();
869 return new _GeneratorIterable(count, generator); 989 return new _GeneratorIterable(count, generator);
870 } 990 }
871 join(separator) { 991 join(separator) {
872 if (separator === undefined) separator = ""; 992 if (separator === void 0)
993 separator = "";
873 let buffer = new StringBuffer(); 994 let buffer = new StringBuffer();
874 buffer.writeAll(this, separator); 995 buffer.writeAll(this, separator);
875 return buffer.toString(); 996 return buffer.toString();
876 } 997 }
998 [Symbol.iterator]() {
999 var iterator = this.iterator;
1000 return {
1001 next() {
1002 var done = iterator.moveNext();
1003 return {done: done, current: done ? void 0 : iterator.current};
1004 }
1005 };
1006 }
877 } 1007 }
878 dart.defineNamedConstructor(Iterable, "generate"); 1008 dart.defineNamedConstructor(Iterable, 'generate');
879 Iterable.prototype[Symbol.iterator] = function() {
880 var iterator = this.iterator;
881 return {
882 next: function() {
883 var done = iterator.moveNext();
884 return { done: done, current: done ? void 0 : iterator.current };
885 }
886 };
887 };
888 return Iterable; 1009 return Iterable;
889 }); 1010 });
890 let Iterable = Iterable$(dynamic); 1011 let Iterable = Iterable$(dynamic);
891
892 let _GeneratorIterable$ = dart.generic(function(E) { 1012 let _GeneratorIterable$ = dart.generic(function(E) {
893 class _GeneratorIterable extends collection.IterableBase$(E) { 1013 class _GeneratorIterable extends collection.IterableBase$(E) {
894 _GeneratorIterable(_end, generator) { 1014 _GeneratorIterable(_end, generator) {
895 this._end = _end; 1015 this._end = _end;
896 this._start = 0; 1016 this._start = 0;
897 this._generator = (generator !== null) ? generator : _id; 1017 this._generator = generator !== null ? generator : _id;
898 super.IterableBase(); 1018 super.IterableBase();
899 } 1019 }
900 _GeneratorIterable$slice(_start, _end, _generator) { 1020 _GeneratorIterable$slice(_start, _end, _generator) {
901 this._start = _start; 1021 this._start = _start;
902 this._end = _end; 1022 this._end = _end;
903 this._generator = _generator; 1023 this._generator = _generator;
904 super.IterableBase(); 1024 super.IterableBase();
905 } 1025 }
906 get iterator() { return new _GeneratorIterator(this._start, this._end, thi s._generator); } 1026 get iterator() {
907 get length() { return this._end - this._start; } 1027 return new _GeneratorIterator(this._start, this._end, this._generator);
1028 }
1029 get length() {
1030 return this._end - this._start;
1031 }
908 skip(count) { 1032 skip(count) {
909 RangeError.checkNotNegative(count, "count"); 1033 RangeError.checkNotNegative(count, "count");
910 if (count === 0) return this; 1034 if (count === 0)
1035 return this;
911 let newStart = this._start + count; 1036 let newStart = this._start + count;
912 if (newStart >= this._end) return new _internal.EmptyIterable(); 1037 if (newStart >= this._end)
1038 return new _internal.EmptyIterable();
913 return new _GeneratorIterable.slice(newStart, this._end, this._generator ); 1039 return new _GeneratorIterable.slice(newStart, this._end, this._generator );
914 } 1040 }
915 take(count) { 1041 take(count) {
916 RangeError.checkNotNegative(count, "count"); 1042 RangeError.checkNotNegative(count, "count");
917 if (count === 0) return new _internal.EmptyIterable(); 1043 if (count === 0)
1044 return new _internal.EmptyIterable();
918 let newEnd = this._start + count; 1045 let newEnd = this._start + count;
919 if (newEnd >= this._end) return this; 1046 if (newEnd >= this._end)
1047 return this;
920 return new _GeneratorIterable.slice(this._start, newEnd, this._generator ); 1048 return new _GeneratorIterable.slice(this._start, newEnd, this._generator );
921 } 1049 }
922 static _id(n) { return n; } 1050 static _id(n) {
1051 return n;
1052 }
923 } 1053 }
924 dart.defineNamedConstructor(_GeneratorIterable, "slice"); 1054 dart.defineNamedConstructor(_GeneratorIterable, 'slice');
925 return _GeneratorIterable; 1055 return _GeneratorIterable;
926 }); 1056 });
927 let _GeneratorIterable = _GeneratorIterable$(dynamic); 1057 let _GeneratorIterable = _GeneratorIterable$(dynamic);
928
929 let _GeneratorIterator$ = dart.generic(function(E) { 1058 let _GeneratorIterator$ = dart.generic(function(E) {
930 class _GeneratorIterator extends dart.Object { 1059 class _GeneratorIterator extends dart.Object {
931 _GeneratorIterator(_index, _end, _generator) { 1060 _GeneratorIterator(_index, _end, _generator) {
932 this._index = _index; 1061 this._index = _index;
933 this._end = _end; 1062 this._end = _end;
934 this._generator = _generator; 1063 this._generator = _generator;
935 this._current = dart.as(null, E); 1064 this._current = dart.as(null, E);
936 } 1065 }
937 moveNext() { 1066 moveNext() {
938 if (this._index < this._end) { 1067 if (this._index < this._end) {
939 this._current = this._generator(this._index); 1068 this._current = this._generator(this._index);
940 this._index++; 1069 this._index++;
941 return true; 1070 return true;
942 } else { 1071 } else {
943 this._current = dart.as(null, E); 1072 this._current = dart.as(null, E);
944 return false; 1073 return false;
945 } 1074 }
946 } 1075 }
947 get current() { return this._current; } 1076 get current() {
1077 return this._current;
1078 }
948 } 1079 }
949 return _GeneratorIterator; 1080 return _GeneratorIterator;
950 }); 1081 });
951 let _GeneratorIterator = _GeneratorIterator$(dynamic); 1082 let _GeneratorIterator = _GeneratorIterator$(dynamic);
952
953 let BidirectionalIterator$ = dart.generic(function(E) { 1083 let BidirectionalIterator$ = dart.generic(function(E) {
954 class BidirectionalIterator extends dart.Object { 1084 class BidirectionalIterator extends dart.Object {
955 } 1085 }
956 return BidirectionalIterator; 1086 return BidirectionalIterator;
957 }); 1087 });
958 let BidirectionalIterator = BidirectionalIterator$(dynamic); 1088 let BidirectionalIterator = BidirectionalIterator$(dynamic);
959
960 let Iterator$ = dart.generic(function(E) { 1089 let Iterator$ = dart.generic(function(E) {
961 class Iterator extends dart.Object { 1090 class Iterator extends dart.Object {
962 } 1091 }
963 return Iterator; 1092 return Iterator;
964 }); 1093 });
965 let Iterator = Iterator$(dynamic); 1094 let Iterator = Iterator$(dynamic);
966
967 let List$ = dart.generic(function(E) { 1095 let List$ = dart.generic(function(E) {
968 class List extends dart.Object { 1096 class List extends dart.Object {
969 List(length) { 1097 List(length) {
970 if (length === undefined) length = new _ListConstructorSentinel(); 1098 if (length === void 0)
1099 length = new _ListConstructorSentinel();
971 if (length === new _ListConstructorSentinel()) { 1100 if (length === new _ListConstructorSentinel()) {
972 return dart.as(new JSArray./* Unimplemented unknown name */emptyGrowab le(), List$(E)); 1101 return dart.as(new JSArray.emptyGrowable(), List$(E));
973 } 1102 }
974 return dart.as(new JSArray./* Unimplemented unknown name */fixed(length) , List$(E)); 1103 return dart.as(new JSArray.fixed(length), List$(E));
975 } 1104 }
976 List$filled(length, fill) { 1105 List$filled(length, fill) {
977 let result = dart.as(new JSArray./* Unimplemented unknown name */fixed(l ength), List); 1106 let result = dart.as(new JSArray.fixed(length), List);
978 if (dart.notNull(length !== 0) && dart.notNull(fill !== null)) { 1107 if (dart.notNull(length !== 0) && dart.notNull(fill !== null)) {
979 for (let i = 0; i < result.length; i++) { 1108 for (let i = 0; i < result.length; i++) {
980 result.set(i, fill); 1109 result.set(i, fill);
981 } 1110 }
982 } 1111 }
983 return dart.as(result, List$(E)); 1112 return dart.as(result, List$(E));
984 } 1113 }
985 List$from(elements, opt$) { 1114 List$from(elements, opt$) {
986 let growable = opt$.growable === undefined ? true : opt$.growable; 1115 let growable = opt$.growable === void 0 ? true : opt$.growable;
987 let list = new List(); 1116 let list = new List();
988 for (let e of elements) { 1117 for (let e of elements) {
989 list.add(e); 1118 list.add(e);
990 } 1119 }
991 if (growable) return list; 1120 if (growable)
1121 return list;
992 return dart.as(_internal.makeListFixedLength(list), List$(E)); 1122 return dart.as(_internal.makeListFixedLength(list), List$(E));
993 } 1123 }
994 List$generate(length, generator, opt$) { 1124 List$generate(length, generator, opt$) {
995 let growable = opt$.growable === undefined ? true : opt$.growable; 1125 let growable = opt$.growable === void 0 ? true : opt$.growable;
996 let result = null; 1126 let result = null;
997 if (growable) { 1127 if (growable) {
998 result = ((_) => { 1128 result = ((_) => {
999 _.length = length; 1129 _.length = length;
1000 return _; 1130 return _;
1001 }).bind(this)(new List.from([])); 1131 }).bind(this)(new List.from([]));
1002 } else { 1132 } else {
1003 result = new List(length); 1133 result = new List(length);
1004 } 1134 }
1005 for (let i = 0; i < length; i++) { 1135 for (let i = 0; i < length; i++) {
1006 result.set(i, generator(i)); 1136 result.set(i, generator(i));
1007 } 1137 }
1008 return result; 1138 return result;
1009 } 1139 }
1010 } 1140 }
1011 dart.defineNamedConstructor(List, "filled"); 1141 dart.defineNamedConstructor(List, 'filled');
1012 dart.defineNamedConstructor(List, "from"); 1142 dart.defineNamedConstructor(List, 'from');
1013 dart.defineNamedConstructor(List, "generate"); 1143 dart.defineNamedConstructor(List, 'generate');
1014 return List; 1144 return List;
1015 }); 1145 });
1016 let List = List$(dynamic); 1146 let List = List$(dynamic);
1017
1018 let Map$ = dart.generic(function(K, V) { 1147 let Map$ = dart.generic(function(K, V) {
1019 class Map extends dart.Object { 1148 class Map extends dart.Object {
1020 Map() { 1149 Map() {
1021 return new collection.LinkedHashMap(); 1150 return new collection.LinkedHashMap();
1022 } 1151 }
1023 Map$from(other) { 1152 Map$from(other) {
1024 return new collection.LinkedHashMap.from(other); 1153 return new collection.LinkedHashMap.from(other);
1025 } 1154 }
1026 Map$identity() { 1155 Map$identity() {
1027 return new collection.LinkedHashMap.identity(); 1156 return new collection.LinkedHashMap.identity();
1028 } 1157 }
1029 Map$fromIterable(iterable, opt$) { 1158 Map$fromIterable(iterable, opt$) {
1030 return new collection.LinkedHashMap.fromIterable(iterable, opt$); 1159 return new collection.LinkedHashMap.fromIterable(iterable, opt$);
1031 } 1160 }
1032 Map$fromIterables(keys, values) { 1161 Map$fromIterables(keys, values) {
1033 return new collection.LinkedHashMap.fromIterables(keys, values); 1162 return new collection.LinkedHashMap.fromIterables(keys, values);
1034 } 1163 }
1035 } 1164 }
1036 dart.defineNamedConstructor(Map, "from"); 1165 dart.defineNamedConstructor(Map, 'from');
1037 dart.defineNamedConstructor(Map, "identity"); 1166 dart.defineNamedConstructor(Map, 'identity');
1038 dart.defineNamedConstructor(Map, "fromIterable"); 1167 dart.defineNamedConstructor(Map, 'fromIterable');
1039 dart.defineNamedConstructor(Map, "fromIterables"); 1168 dart.defineNamedConstructor(Map, 'fromIterables');
1040 return Map; 1169 return Map;
1041 }); 1170 });
1042 let Map = Map$(dynamic, dynamic); 1171 let Map = Map$(dynamic, dynamic);
1043
1044 class Null extends dart.Object { 1172 class Null extends dart.Object {
1045 Null$_uninstantiable() { 1173 Null$_uninstantiable() {
1046 throw new UnsupportedError('class Null cannot be instantiated'); 1174 throw new UnsupportedError('class Null cannot be instantiated');
1047 } 1175 }
1048 toString() { return "null"; } 1176 toString() {
1177 return "null";
1178 }
1049 } 1179 }
1050 dart.defineNamedConstructor(Null, "_uninstantiable"); 1180 dart.defineNamedConstructor(Null, '_uninstantiable');
1051
1052 class num extends dart.Object { 1181 class num extends dart.Object {
1053 static parse(input, onError) { 1182 static parse(input, onError) {
1054 if (onError === undefined) onError = null; 1183 if (onError === void 0)
1184 onError = null;
1055 let source = input.trim(); 1185 let source = input.trim();
1056 _parseError = false; 1186 _parseError = false;
1057 let result = int.parse(source, {onError: _onParseErrorInt}); 1187 let result = int.parse(source, {onError: _onParseErrorInt});
1058 if (!dart.notNull(_parseError)) return result; 1188 if (!dart.notNull(_parseError))
1189 return result;
1059 _parseError = false; 1190 _parseError = false;
1060 result = double.parse(source, _onParseErrorDouble); 1191 result = double.parse(source, _onParseErrorDouble);
1061 if (!dart.notNull(_parseError)) return result; 1192 if (!dart.notNull(_parseError))
1062 if (onError === null) throw new FormatException(input); 1193 return result;
1194 if (onError === null)
1195 throw new FormatException(input);
1063 return onError(input); 1196 return onError(input);
1064 } 1197 }
1065 static _onParseErrorInt(_) { 1198 static _onParseErrorInt(_) {
1066 _parseError = true; 1199 _parseError = true;
1067 return 0; 1200 return 0;
1068 } 1201 }
1069 static _onParseErrorDouble(_) { 1202 static _onParseErrorDouble(_) {
1070 _parseError = true; 1203 _parseError = true;
1071 return 0.0; 1204 return 0.0;
1072 } 1205 }
1073 } 1206 }
1074 num._parseError = false; 1207 num._parseError = false;
1075
1076 class Object extends dart.Object { 1208 class Object extends dart.Object {
1077 Object() { 1209 Object() {
1078 } 1210 }
1079 ['=='](other) { return identical(this, other); } 1211 ['=='](other) {
1080 get hashCode() { return dart.as(dart.dinvoke(/* Unimplemented unknown name * /Primitives, "objectHashCode", this), int); } 1212 return identical(this, other);
1081 toString() { return dart.as(dart.dinvoke(/* Unimplemented unknown name */Pri mitives, "objectToString", this), String); } 1213 }
1214 get hashCode() {
1215 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'o bjectHashCode', this), int);
1216 }
1217 toString() {
1218 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'o bjectToString', this), String);
1219 }
1082 noSuchMethod(invocation) { 1220 noSuchMethod(invocation) {
1083 throw new NoSuchMethodError(this, invocation.memberName, invocation.positi onalArguments, invocation.namedArguments); 1221 throw new NoSuchMethodError(this, invocation.memberName, invocation.positi onalArguments, invocation.namedArguments);
1084 } 1222 }
1085 get runtimeType() { return dart.as(dart.dinvokef(/* Unimplemented unknown na me */getRuntimeType, this), Type); } 1223 get runtimeType() {
1224 return dart.as(dart.dinvokef(/* Unimplemented unknown name */getRuntimeTyp e, this), Type);
1225 }
1086 } 1226 }
1087
1088 class Pattern extends dart.Object { 1227 class Pattern extends dart.Object {
1089 } 1228 }
1090
1091 // Function print: (Object) → void 1229 // Function print: (Object) → void
1092 function print(object) { 1230 function print(object) {
1093 let line = `${object}`; 1231 let line = `${object}`;
1094 if (_internal.printToZone === null) { 1232 if (_internal.printToZone === null) {
1095 _internal.printToConsole(line); 1233 _internal.printToConsole(line);
1096 } else { 1234 } else {
1097 dart.dinvokef(_internal.printToZone, line); 1235 dart.dinvokef(_internal.printToZone, line);
1098 } 1236 }
1099 } 1237 }
1100
1101 class Match extends dart.Object { 1238 class Match extends dart.Object {
1102 } 1239 }
1103
1104 class RegExp extends dart.Object { 1240 class RegExp extends dart.Object {
1105 RegExp(source, opt$) { 1241 RegExp(source, opt$) {
1106 let multiLine = opt$.multiLine === undefined ? false : opt$.multiLine; 1242 let multiLine = opt$.multiLine === void 0 ? false : opt$.multiLine;
1107 let caseSensitive = opt$.caseSensitive === undefined ? true : opt$.caseSen sitive; 1243 let caseSensitive = opt$.caseSensitive === void 0 ? true : opt$.caseSensit ive;
1108 return dart.as(new JSSyntaxRegExp(source, {/* Unimplemented unknown name * /multiLine: multiLine, /* Unimplemented unknown name */caseSensitive: caseSensit ive}), RegExp); 1244 return dart.as(new JSSyntaxRegExp(source, {multiLine: multiLine, caseSensi tive: caseSensitive}), RegExp);
1109 } 1245 }
1110 } 1246 }
1111
1112 let Set$ = dart.generic(function(E) { 1247 let Set$ = dart.generic(function(E) {
1113 class Set extends collection.IterableBase$(E) { 1248 class Set extends collection.IterableBase$(E) {
1114 Set() { 1249 Set() {
1115 return new collection.LinkedHashSet(); 1250 return new collection.LinkedHashSet();
1116 } 1251 }
1117 Set$identity() { 1252 Set$identity() {
1118 return new collection.LinkedHashSet.identity(); 1253 return new collection.LinkedHashSet.identity();
1119 } 1254 }
1120 Set$from(elements) { 1255 Set$from(elements) {
1121 return new collection.LinkedHashSet.from(elements); 1256 return new collection.LinkedHashSet.from(elements);
1122 } 1257 }
1123 } 1258 }
1124 dart.defineNamedConstructor(Set, "identity"); 1259 dart.defineNamedConstructor(Set, 'identity');
1125 dart.defineNamedConstructor(Set, "from"); 1260 dart.defineNamedConstructor(Set, 'from');
1126 return Set; 1261 return Set;
1127 }); 1262 });
1128 let Set = Set$(dynamic); 1263 let Set = Set$(dynamic);
1129
1130 let Sink$ = dart.generic(function(T) { 1264 let Sink$ = dart.generic(function(T) {
1131 class Sink extends dart.Object { 1265 class Sink extends dart.Object {
1132 } 1266 }
1133 return Sink; 1267 return Sink;
1134 }); 1268 });
1135 let Sink = Sink$(dynamic); 1269 let Sink = Sink$(dynamic);
1136
1137 class StackTrace extends dart.Object { 1270 class StackTrace extends dart.Object {
1138 } 1271 }
1139
1140 class Stopwatch extends dart.Object { 1272 class Stopwatch extends dart.Object {
1141 get frequency() { return _frequency; } 1273 get frequency() {
1274 return _frequency;
1275 }
1142 Stopwatch() { 1276 Stopwatch() {
1143 this._start = null; 1277 this._start = null;
1144 this._stop = null; 1278 this._stop = null;
1145 _initTicker(); 1279 _initTicker();
1146 } 1280 }
1147 start() { 1281 start() {
1148 if (this.isRunning) return; 1282 if (this.isRunning)
1283 return;
1149 if (this._start === null) { 1284 if (this._start === null) {
1150 this._start = _now(); 1285 this._start = _now();
1151 } else { 1286 } else {
1152 this._start = _now() - dart.notNull((dart.notNull(this._stop) - dart.not Null(this._start))); 1287 this._start = _now() - dart.notNull(dart.notNull(this._stop) - dart.notN ull(this._start));
1153 this._stop = null; 1288 this._stop = null;
1154 } 1289 }
1155 } 1290 }
1156 stop() { 1291 stop() {
1157 if (!dart.notNull(this.isRunning)) return; 1292 if (!dart.notNull(this.isRunning))
1293 return;
1158 this._stop = _now(); 1294 this._stop = _now();
1159 } 1295 }
1160 reset() { 1296 reset() {
1161 if (this._start === null) return; 1297 if (this._start === null)
1298 return;
1162 this._start = _now(); 1299 this._start = _now();
1163 if (this._stop !== null) { 1300 if (this._stop !== null) {
1164 this._stop = this._start; 1301 this._stop = this._start;
1165 } 1302 }
1166 } 1303 }
1167 get elapsedTicks() { 1304 get elapsedTicks() {
1168 if (this._start === null) { 1305 if (this._start === null) {
1169 return 0; 1306 return 0;
1170 } 1307 }
1171 return dart.notNull((this._stop === null) ? (_now() - dart.notNull(this._s tart)) : (dart.notNull(this._stop) - dart.notNull(this._start))); 1308 return dart.notNull(this._stop === null ? _now() - dart.notNull(this._star t) : dart.notNull(this._stop) - dart.notNull(this._start));
1172 } 1309 }
1173 get elapsed() { 1310 get elapsed() {
1174 return new Duration({microseconds: this.elapsedMicroseconds}); 1311 return new Duration({microseconds: this.elapsedMicroseconds});
1175 } 1312 }
1176 get elapsedMicroseconds() { 1313 get elapsedMicroseconds() {
1177 return ((this.elapsedTicks * 1000000) / this.frequency).truncate(); 1314 return (this.elapsedTicks * 1000000 / this.frequency).truncate();
1178 } 1315 }
1179 get elapsedMilliseconds() { 1316 get elapsedMilliseconds() {
1180 return ((this.elapsedTicks * 1000) / this.frequency).truncate(); 1317 return (this.elapsedTicks * 1000 / this.frequency).truncate();
1181 } 1318 }
1182 get isRunning() { return dart.notNull(this._start !== null) && dart.notNull( this._stop === null); } 1319 get isRunning() {
1320 return dart.notNull(this._start !== null) && dart.notNull(this._stop === n ull);
1321 }
1183 static _initTicker() { 1322 static _initTicker() {
1184 dart.dinvoke(/* Unimplemented unknown name */Primitives, "initTicker"); 1323 dart.dinvoke(/* Unimplemented unknown name */Primitives, 'initTicker');
1185 _frequency = dart.as(dart.dload(/* Unimplemented unknown name */Primitives , "timerFrequency"), int); 1324 _frequency = dart.as(dart.dload(/* Unimplemented unknown name */Primitives , 'timerFrequency'), int);
1186 } 1325 }
1187 static _now() { return dart.as(dart.dinvoke(/* Unimplemented unknown name */ Primitives, "timerTicks"), int); } 1326 static _now() {
1327 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 't imerTicks'), int);
1328 }
1188 } 1329 }
1189 Stopwatch._frequency = null; 1330 Stopwatch._frequency = null;
1190
1191 class String extends dart.Object { 1331 class String extends dart.Object {
1192 String$fromCharCodes(charCodes, start, end) { 1332 String$fromCharCodes(charCodes, start, end) {
1193 if (start === undefined) start = 0; 1333 if (start === void 0)
1194 if (end === undefined) end = null; 1334 start = 0;
1335 if (end === void 0)
1336 end = null;
1195 if (!dart.is(charCodes, dynamic)) { 1337 if (!dart.is(charCodes, dynamic)) {
1196 return dart.as(dart.dinvokef(/* Unimplemented unknown name */_stringFrom Iterable, charCodes, start, end), String); 1338 return dart.as(dart.dinvokef(/* Unimplemented unknown name */_stringFrom Iterable, charCodes, start, end), String);
1197 } 1339 }
1198 let list = dart.as(charCodes, List); 1340 let list = dart.as(charCodes, List);
1199 let len = list.length; 1341 let len = list.length;
1200 if (dart.notNull(start < 0) || dart.notNull(start > len)) { 1342 if (dart.notNull(start < 0) || dart.notNull(start > len)) {
1201 throw new RangeError.range(start, 0, len); 1343 throw new RangeError.range(start, 0, len);
1202 } 1344 }
1203 if (end === null) { 1345 if (end === null) {
1204 end = len; 1346 end = len;
1205 } else if (dart.notNull(end < start) || dart.notNull(end > len)) { 1347 } else if (dart.notNull(end < start) || dart.notNull(end > len)) {
1206 throw new RangeError.range(end, start, len); 1348 throw new RangeError.range(end, start, len);
1207 } 1349 }
1208 if (dart.notNull(start > 0) || dart.notNull(end < len)) { 1350 if (dart.notNull(start > 0) || dart.notNull(end < len)) {
1209 list = list.sublist(start, end); 1351 list = list.sublist(start, end);
1210 } 1352 }
1211 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, "s tringFromCharCodes", list), String); 1353 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 's tringFromCharCodes', list), String);
1212 } 1354 }
1213 String$fromCharCode(charCode) { 1355 String$fromCharCode(charCode) {
1214 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, "s tringFromCharCode", charCode), String); 1356 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 's tringFromCharCode', charCode), String);
1215 } 1357 }
1216 String$fromEnvironment(name, opt$) { 1358 String$fromEnvironment(name, opt$) {
1217 let defaultValue = opt$.defaultValue === undefined ? null : opt$.defaultVa lue; 1359 let defaultValue = opt$.defaultValue === void 0 ? null : opt$.defaultValue ;
1218 throw new UnsupportedError('String.fromEnvironment can only be used as a c onst constructor'); 1360 throw new UnsupportedError('String.fromEnvironment can only be used as a c onst constructor');
1219 } 1361 }
1220 } 1362 }
1221 dart.defineNamedConstructor(String, "fromCharCodes"); 1363 dart.defineNamedConstructor(String, 'fromCharCodes');
1222 dart.defineNamedConstructor(String, "fromCharCode"); 1364 dart.defineNamedConstructor(String, 'fromCharCode');
1223 dart.defineNamedConstructor(String, "fromEnvironment"); 1365 dart.defineNamedConstructor(String, 'fromEnvironment');
1224
1225 class Runes extends collection.IterableBase$(int) { 1366 class Runes extends collection.IterableBase$(int) {
1226 Runes(string) { 1367 Runes(string) {
1227 this.string = string; 1368 this.string = string;
1228 super.IterableBase(); 1369 super.IterableBase();
1229 } 1370 }
1230 get iterator() { return new RuneIterator(this.string); } 1371 get iterator() {
1372 return new RuneIterator(this.string);
1373 }
1231 get last() { 1374 get last() {
1232 if (this.string.length === 0) { 1375 if (this.string.length === 0) {
1233 throw new StateError('No elements.'); 1376 throw new StateError('No elements.');
1234 } 1377 }
1235 let length = this.string.length; 1378 let length = this.string.length;
1236 let code = this.string.codeUnitAt(length - 1); 1379 let code = this.string.codeUnitAt(length - 1);
1237 if (dart.notNull(_isTrailSurrogate(code)) && dart.notNull(this.string.leng th > 1)) { 1380 if (dart.notNull(_isTrailSurrogate(code)) && dart.notNull(this.string.leng th > 1)) {
1238 let previousCode = this.string.codeUnitAt(length - 2); 1381 let previousCode = this.string.codeUnitAt(length - 2);
1239 if (_isLeadSurrogate(previousCode)) { 1382 if (_isLeadSurrogate(previousCode)) {
1240 return _combineSurrogatePair(previousCode, code); 1383 return _combineSurrogatePair(previousCode, code);
1241 } 1384 }
1242 } 1385 }
1243 return code; 1386 return code;
1244 } 1387 }
1245 } 1388 }
1246
1247 // Function _isLeadSurrogate: (int) → bool 1389 // Function _isLeadSurrogate: (int) → bool
1248 function _isLeadSurrogate(code) { return (code & 64512) === 55296; } 1390 function _isLeadSurrogate(code) {
1249 1391 return (code & 64512) === 55296;
1392 }
1250 // Function _isTrailSurrogate: (int) → bool 1393 // Function _isTrailSurrogate: (int) → bool
1251 function _isTrailSurrogate(code) { return (code & 64512) === 56320; } 1394 function _isTrailSurrogate(code) {
1252 1395 return (code & 64512) === 56320;
1396 }
1253 // Function _combineSurrogatePair: (int, int) → int 1397 // Function _combineSurrogatePair: (int, int) → int
1254 function _combineSurrogatePair(start, end) { 1398 function _combineSurrogatePair(start, end) {
1255 return 65536 + ((start & 1023) << 10) + (end & 1023); 1399 return 65536 + ((start & 1023) << 10) + (end & 1023);
1256 } 1400 }
1257
1258 class RuneIterator extends dart.Object { 1401 class RuneIterator extends dart.Object {
1259 RuneIterator(string) { 1402 RuneIterator(string) {
1260 this.string = string; 1403 this.string = string;
1261 this._position = 0; 1404 this._position = 0;
1262 this._nextPosition = 0; 1405 this._nextPosition = 0;
1263 this._currentCodePoint = null; 1406 this._currentCodePoint = null;
1264 } 1407 }
1265 RuneIterator$at(string, index) { 1408 RuneIterator$at(string, index) {
1266 this.string = string; 1409 this.string = string;
1267 this._position = index; 1410 this._position = index;
1268 this._nextPosition = index; 1411 this._nextPosition = index;
1269 this._currentCodePoint = null; 1412 this._currentCodePoint = null;
1270 RangeError.checkValueInInterval(index, 0, string.length); 1413 RangeError.checkValueInInterval(index, 0, string.length);
1271 this._checkSplitSurrogate(index); 1414 this._checkSplitSurrogate(index);
1272 } 1415 }
1273 _checkSplitSurrogate(index) { 1416 _checkSplitSurrogate(index) {
1274 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))) ) { 1417 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))) ) {
1275 throw new ArgumentError(`Index inside surrogate pair: ${index}`); 1418 throw new ArgumentError(`Index inside surrogate pair: ${index}`);
1276 } 1419 }
1277 } 1420 }
1278 get rawIndex() { return dart.as((this._position !== this._nextPosition) ? th is._position : null, int); } 1421 get rawIndex() {
1422 return dart.as(this._position !== this._nextPosition ? this._position : nu ll, int);
1423 }
1279 set rawIndex(rawIndex) { 1424 set rawIndex(rawIndex) {
1280 RangeError.checkValidIndex(rawIndex, this.string, "rawIndex"); 1425 RangeError.checkValidIndex(rawIndex, this.string, "rawIndex");
1281 this.reset(rawIndex); 1426 this.reset(rawIndex);
1282 this.moveNext(); 1427 this.moveNext();
1283 } 1428 }
1284 reset(rawIndex) { 1429 reset(rawIndex) {
1285 if (rawIndex === undefined) rawIndex = 0; 1430 if (rawIndex === void 0)
1431 rawIndex = 0;
1286 RangeError.checkValueInInterval(rawIndex, 0, this.string.length, "rawIndex "); 1432 RangeError.checkValueInInterval(rawIndex, 0, this.string.length, "rawIndex ");
1287 this._checkSplitSurrogate(rawIndex); 1433 this._checkSplitSurrogate(rawIndex);
1288 this._position = this._nextPosition = rawIndex; 1434 this._position = this._nextPosition = rawIndex;
1289 this._currentCodePoint = null; 1435 this._currentCodePoint = null;
1290 } 1436 }
1291 get current() { return dart.notNull(this._currentCodePoint); } 1437 get current() {
1292 get currentSize() { return this._nextPosition - this._position; } 1438 return dart.notNull(this._currentCodePoint);
1439 }
1440 get currentSize() {
1441 return this._nextPosition - this._position;
1442 }
1293 get currentAsString() { 1443 get currentAsString() {
1294 if (this._position === this._nextPosition) return null; 1444 if (this._position === this._nextPosition)
1295 if (this._position + 1 === this._nextPosition) return this.string.get(this ._position); 1445 return null;
1446 if (this._position + 1 === this._nextPosition)
1447 return this.string.get(this._position);
1296 return this.string.substring(this._position, this._nextPosition); 1448 return this.string.substring(this._position, this._nextPosition);
1297 } 1449 }
1298 moveNext() { 1450 moveNext() {
1299 this._position = this._nextPosition; 1451 this._position = this._nextPosition;
1300 if (this._position === this.string.length) { 1452 if (this._position === this.string.length) {
1301 this._currentCodePoint = null; 1453 this._currentCodePoint = null;
1302 return false; 1454 return false;
1303 } 1455 }
1304 let codeUnit = this.string.codeUnitAt(this._position); 1456 let codeUnit = this.string.codeUnitAt(this._position);
1305 let nextPosition = this._position + 1; 1457 let nextPosition = this._position + 1;
(...skipping 23 matching lines...)
1329 this._position = position - 1; 1481 this._position = position - 1;
1330 this._currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit) ; 1482 this._currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit) ;
1331 return true; 1483 return true;
1332 } 1484 }
1333 } 1485 }
1334 this._position = position; 1486 this._position = position;
1335 this._currentCodePoint = codeUnit; 1487 this._currentCodePoint = codeUnit;
1336 return true; 1488 return true;
1337 } 1489 }
1338 } 1490 }
1339 dart.defineNamedConstructor(RuneIterator, "at"); 1491 dart.defineNamedConstructor(RuneIterator, 'at');
1340
1341 class StringBuffer extends dart.Object { 1492 class StringBuffer extends dart.Object {
1342 StringBuffer(content) { 1493 StringBuffer(content) {
1343 if (content === undefined) content = ""; 1494 if (content === void 0)
1495 content = "";
1344 /* Unimplemented unknown name */_contents = `${content}`; 1496 /* Unimplemented unknown name */_contents = `${content}`;
1345 } 1497 }
1346 get length() { return dart.as(dart.dload(/* Unimplemented unknown name */_co ntents, "length"), int); } 1498 get length() {
1347 get isEmpty() { return this.length === 0; } 1499 return dart.as(dart.dload(/* Unimplemented unknown name */_contents, 'leng th'), int);
1348 get isNotEmpty() { return !dart.notNull(this.isEmpty); } 1500 }
1501 get isEmpty() {
1502 return this.length === 0;
1503 }
1504 get isNotEmpty() {
1505 return !dart.notNull(this.isEmpty);
1506 }
1349 write(obj) { 1507 write(obj) {
1350 dart.dinvokef(/* Unimplemented unknown name */_writeString, `${obj}`); 1508 dart.dinvokef(/* Unimplemented unknown name */_writeString, `${obj}`);
1351 } 1509 }
1352 writeCharCode(charCode) { 1510 writeCharCode(charCode) {
1353 dart.dinvokef(/* Unimplemented unknown name */_writeString, new String.fro mCharCode(charCode)); 1511 dart.dinvokef(/* Unimplemented unknown name */_writeString, new String.fro mCharCode(charCode));
1354 } 1512 }
1355 writeAll(objects, separator) { 1513 writeAll(objects, separator) {
1356 if (separator === undefined) separator = ""; 1514 if (separator === void 0)
1515 separator = "";
1357 let iterator = objects.iterator; 1516 let iterator = objects.iterator;
1358 if (!dart.notNull(iterator.moveNext())) return; 1517 if (!dart.notNull(iterator.moveNext()))
1518 return;
1359 if (separator.isEmpty) { 1519 if (separator.isEmpty) {
1360 do { 1520 do {
1361 this.write(iterator.current); 1521 this.write(iterator.current);
1362 } 1522 } while (iterator.moveNext());
1363 while (iterator.moveNext());
1364 } else { 1523 } else {
1365 this.write(iterator.current); 1524 this.write(iterator.current);
1366 while (iterator.moveNext()) { 1525 while (iterator.moveNext()) {
1367 this.write(separator); 1526 this.write(separator);
1368 this.write(iterator.current); 1527 this.write(iterator.current);
1369 } 1528 }
1370 } 1529 }
1371 } 1530 }
1372 writeln(obj) { 1531 writeln(obj) {
1373 if (obj === undefined) obj = ""; 1532 if (obj === void 0)
1533 obj = "";
1374 this.write(obj); 1534 this.write(obj);
1375 this.write("\n"); 1535 this.write("\n");
1376 } 1536 }
1377 clear() { 1537 clear() {
1378 /* Unimplemented unknown name */_contents = ""; 1538 /* Unimplemented unknown name */_contents = "";
1379 } 1539 }
1380 toString() { return dart.as(dart.dinvoke(/* Unimplemented unknown name */Pri mitives, "flattenString", /* Unimplemented unknown name */_contents), String); } 1540 toString() {
1541 return dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'f lattenString', /* Unimplemented unknown name */_contents), String);
1542 }
1381 } 1543 }
1382
1383 class StringSink extends dart.Object { 1544 class StringSink extends dart.Object {
1384 } 1545 }
1385
1386 class Symbol extends dart.Object { 1546 class Symbol extends dart.Object {
1387 Symbol(name) { 1547 Symbol(name) {
1388 return new _internal.Symbol(name); 1548 return new _internal.Symbol(name);
1389 } 1549 }
1390 } 1550 }
1391
1392 class Type extends dart.Object { 1551 class Type extends dart.Object {
1393 } 1552 }
1394
1395 class Uri extends dart.Object { 1553 class Uri extends dart.Object {
1396 get authority() { 1554 get authority() {
1397 if (!dart.notNull(this.hasAuthority)) return ""; 1555 if (!dart.notNull(this.hasAuthority))
1556 return "";
1398 let sb = new StringBuffer(); 1557 let sb = new StringBuffer();
1399 this._writeAuthority(sb); 1558 this._writeAuthority(sb);
1400 return sb.toString(); 1559 return sb.toString();
1401 } 1560 }
1402 get userInfo() { return this._userInfo; } 1561 get userInfo() {
1562 return this._userInfo;
1563 }
1403 get host() { 1564 get host() {
1404 if (this._host === null) return ""; 1565 if (this._host === null)
1566 return "";
1405 if (this._host.startsWith('[')) { 1567 if (this._host.startsWith('[')) {
1406 return this._host.substring(1, this._host.length - 1); 1568 return this._host.substring(1, this._host.length - 1);
1407 } 1569 }
1408 return this._host; 1570 return this._host;
1409 } 1571 }
1410 get port() { 1572 get port() {
1411 if (this._port === null) return _defaultPort(this.scheme); 1573 if (this._port === null)
1574 return _defaultPort(this.scheme);
1412 return dart.notNull(this._port); 1575 return dart.notNull(this._port);
1413 } 1576 }
1414 static _defaultPort(scheme) { 1577 static _defaultPort(scheme) {
1415 if (dart.equals(scheme, "http")) return 80; 1578 if (dart.equals(scheme, "http"))
1416 if (dart.equals(scheme, "https")) return 443; 1579 return 80;
1580 if (dart.equals(scheme, "https"))
1581 return 443;
1417 return 0; 1582 return 0;
1418 } 1583 }
1419 get path() { return this._path; } 1584 get path() {
1420 get query() { return (this._query === null) ? "" : this._query; } 1585 return this._path;
1421 get fragment() { return (this._fragment === null) ? "" : this._fragment; } 1586 }
1587 get query() {
1588 return this._query === null ? "" : this._query;
1589 }
1590 get fragment() {
1591 return this._fragment === null ? "" : this._fragment;
1592 }
1422 static parse(uri) { 1593 static parse(uri) {
1423 // Function isRegName: (int) → bool 1594 // Function isRegName: (int) → bool
1424 function isRegName(ch) { 1595 function isRegName(ch) {
1425 return dart.notNull(ch < 128) && dart.notNull((!dart.equals((dart.dbinar y(dart.dindex(_regNameTable, ch >> 4), "&", (1 << (ch & 15)))), 0))); 1596 return dart.notNull(ch < 128) && dart.notNull(!dart.equals(dart.dbinary( dart.dindex(_regNameTable, ch >> 4), '&', 1 << (ch & 15)), 0));
1426 } 1597 }
1427 let EOI = -1; 1598 let EOI = -1;
1428 let scheme = ""; 1599 let scheme = "";
1429 let userinfo = ""; 1600 let userinfo = "";
1430 let host = null; 1601 let host = null;
1431 let port = null; 1602 let port = null;
1432 let path = null; 1603 let path = null;
1433 let query = null; 1604 let query = null;
1434 let fragment = null; 1605 let fragment = null;
1435 let index = 0; 1606 let index = 0;
(...skipping 64 matching lines...)
1500 let ALLOW_AUTH = 2; 1671 let ALLOW_AUTH = 2;
1501 let state = NOT_IN_PATH; 1672 let state = NOT_IN_PATH;
1502 let i = index; 1673 let i = index;
1503 while (i < uri.length) { 1674 while (i < uri.length) {
1504 char = uri.codeUnitAt(i); 1675 char = uri.codeUnitAt(i);
1505 if (dart.notNull(char === _QUESTION) || dart.notNull(char === _NUMBER_SI GN)) { 1676 if (dart.notNull(char === _QUESTION) || dart.notNull(char === _NUMBER_SI GN)) {
1506 state = NOT_IN_PATH; 1677 state = NOT_IN_PATH;
1507 break; 1678 break;
1508 } 1679 }
1509 if (char === _SLASH) { 1680 if (char === _SLASH) {
1510 state = (i === 0) ? ALLOW_AUTH : IN_PATH; 1681 state = i === 0 ? ALLOW_AUTH : IN_PATH;
1511 break; 1682 break;
1512 } 1683 }
1513 if (char === _COLON) { 1684 if (char === _COLON) {
1514 if (i === 0) _fail(uri, 0, "Invalid empty scheme"); 1685 if (i === 0)
1686 _fail(uri, 0, "Invalid empty scheme");
1515 scheme = _makeScheme(uri, i); 1687 scheme = _makeScheme(uri, i);
1516 i++; 1688 i++;
1517 pathStart = i; 1689 pathStart = i;
1518 if (i === uri.length) { 1690 if (i === uri.length) {
1519 char = EOI; 1691 char = EOI;
1520 state = NOT_IN_PATH; 1692 state = NOT_IN_PATH;
1521 } else { 1693 } else {
1522 char = uri.codeUnitAt(i); 1694 char = uri.codeUnitAt(i);
1523 if (dart.notNull(char === _QUESTION) || dart.notNull(char === _NUMBE R_SIGN)) { 1695 if (dart.notNull(char === _QUESTION) || dart.notNull(char === _NUMBE R_SIGN)) {
1524 state = NOT_IN_PATH; 1696 state = NOT_IN_PATH;
(...skipping 34 matching lines...)
1559 while (++index < uri.length) { 1731 while (++index < uri.length) {
1560 char = uri.codeUnitAt(index); 1732 char = uri.codeUnitAt(index);
1561 if (dart.notNull(char === _QUESTION) || dart.notNull(char === _NUMBER_ SIGN)) { 1733 if (dart.notNull(char === _QUESTION) || dart.notNull(char === _NUMBER_ SIGN)) {
1562 break; 1734 break;
1563 } 1735 }
1564 char = EOI; 1736 char = EOI;
1565 } 1737 }
1566 state = NOT_IN_PATH; 1738 state = NOT_IN_PATH;
1567 } 1739 }
1568 dart.assert(state === NOT_IN_PATH); 1740 dart.assert(state === NOT_IN_PATH);
1569 let isFile = (dart.equals(scheme, "file")); 1741 let isFile = dart.equals(scheme, "file");
1570 let ensureLeadingSlash = host !== null; 1742 let ensureLeadingSlash = host !== null;
1571 path = _makePath(uri, pathStart, index, null, ensureLeadingSlash, isFile); 1743 path = _makePath(uri, pathStart, index, null, ensureLeadingSlash, isFile);
1572 if (char === _QUESTION) { 1744 if (char === _QUESTION) {
1573 let numberSignIndex = uri.indexOf('#', index + 1); 1745 let numberSignIndex = uri.indexOf('#', index + 1);
1574 if (numberSignIndex < 0) { 1746 if (numberSignIndex < 0) {
1575 query = _makeQuery(uri, index + 1, uri.length, null); 1747 query = _makeQuery(uri, index + 1, uri.length, null);
1576 } else { 1748 } else {
1577 query = _makeQuery(uri, index + 1, numberSignIndex, null); 1749 query = _makeQuery(uri, index + 1, numberSignIndex, null);
1578 fragment = _makeFragment(uri, numberSignIndex + 1, uri.length); 1750 fragment = _makeFragment(uri, numberSignIndex + 1, uri.length);
1579 } 1751 }
(...skipping 10 matching lines...)
1590 this._userInfo = _userInfo; 1762 this._userInfo = _userInfo;
1591 this._host = _host; 1763 this._host = _host;
1592 this._port = _port; 1764 this._port = _port;
1593 this._path = _path; 1765 this._path = _path;
1594 this._query = _query; 1766 this._query = _query;
1595 this._fragment = _fragment; 1767 this._fragment = _fragment;
1596 this._pathSegments = null; 1768 this._pathSegments = null;
1597 this._queryParameters = null; 1769 this._queryParameters = null;
1598 } 1770 }
1599 Uri(opt$) { 1771 Uri(opt$) {
1600 let scheme = opt$.scheme === undefined ? "" : opt$.scheme; 1772 let scheme = opt$.scheme === void 0 ? "" : opt$.scheme;
1601 let userInfo = opt$.userInfo === undefined ? "" : opt$.userInfo; 1773 let userInfo = opt$.userInfo === void 0 ? "" : opt$.userInfo;
1602 let host = opt$.host === undefined ? null : opt$.host; 1774 let host = opt$.host === void 0 ? null : opt$.host;
1603 let port = opt$.port === undefined ? null : opt$.port; 1775 let port = opt$.port === void 0 ? null : opt$.port;
1604 let path = opt$.path === undefined ? null : opt$.path; 1776 let path = opt$.path === void 0 ? null : opt$.path;
1605 let pathSegments = opt$.pathSegments === undefined ? null : opt$.pathSegme nts; 1777 let pathSegments = opt$.pathSegments === void 0 ? null : opt$.pathSegments ;
1606 let query = opt$.query === undefined ? null : opt$.query; 1778 let query = opt$.query === void 0 ? null : opt$.query;
1607 let queryParameters = opt$.queryParameters === undefined ? null : opt$.que ryParameters; 1779 let queryParameters = opt$.queryParameters === void 0 ? null : opt$.queryP arameters;
1608 let fragment = opt$.fragment === undefined ? null : opt$.fragment; 1780 let fragment = opt$.fragment === void 0 ? null : opt$.fragment;
1609 scheme = _makeScheme(scheme, _stringOrNullLength(scheme)); 1781 scheme = _makeScheme(scheme, _stringOrNullLength(scheme));
1610 userInfo = _makeUserInfo(userInfo, 0, _stringOrNullLength(userInfo)); 1782 userInfo = _makeUserInfo(userInfo, 0, _stringOrNullLength(userInfo));
1611 host = _makeHost(host, 0, _stringOrNullLength(host), false); 1783 host = _makeHost(host, 0, _stringOrNullLength(host), false);
1612 if (dart.equals(query, "")) query = null; 1784 if (dart.equals(query, ""))
1785 query = null;
1613 query = _makeQuery(query, 0, _stringOrNullLength(query), queryParameters); 1786 query = _makeQuery(query, 0, _stringOrNullLength(query), queryParameters);
1614 fragment = _makeFragment(fragment, 0, _stringOrNullLength(fragment)); 1787 fragment = _makeFragment(fragment, 0, _stringOrNullLength(fragment));
1615 port = _makePort(port, scheme); 1788 port = _makePort(port, scheme);
1616 let isFile = (dart.equals(scheme, "file")); 1789 let isFile = dart.equals(scheme, "file");
1617 if (dart.notNull(host === null) && dart.notNull((dart.notNull(dart.notNull (userInfo.isNotEmpty) || dart.notNull(port !== null)) || dart.notNull(isFile)))) { 1790 if (dart.notNull(host === null) && dart.notNull(dart.notNull(dart.notNull( userInfo.isNotEmpty) || dart.notNull(port !== null)) || dart.notNull(isFile))) {
1618 host = ""; 1791 host = "";
1619 } 1792 }
1620 let ensureLeadingSlash = host !== null; 1793 let ensureLeadingSlash = host !== null;
1621 path = _makePath(path, 0, _stringOrNullLength(path), pathSegments, ensureL eadingSlash, isFile); 1794 path = _makePath(path, 0, _stringOrNullLength(path), pathSegments, ensureL eadingSlash, isFile);
1622 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme nt); 1795 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme nt);
1623 } 1796 }
1624 Uri$http(authority, unencodedPath, queryParameters) { 1797 Uri$http(authority, unencodedPath, queryParameters) {
1625 if (queryParameters === undefined) queryParameters = null; 1798 if (queryParameters === void 0)
1799 queryParameters = null;
1626 return _makeHttpUri("http", authority, unencodedPath, queryParameters); 1800 return _makeHttpUri("http", authority, unencodedPath, queryParameters);
1627 } 1801 }
1628 Uri$https(authority, unencodedPath, queryParameters) { 1802 Uri$https(authority, unencodedPath, queryParameters) {
1629 if (queryParameters === undefined) queryParameters = null; 1803 if (queryParameters === void 0)
1804 queryParameters = null;
1630 return _makeHttpUri("https", authority, unencodedPath, queryParameters); 1805 return _makeHttpUri("https", authority, unencodedPath, queryParameters);
1631 } 1806 }
1632 static _makeHttpUri(scheme, authority, unencodedPath, queryParameters) { 1807 static _makeHttpUri(scheme, authority, unencodedPath, queryParameters) {
1633 let userInfo = ""; 1808 let userInfo = "";
1634 let host = null; 1809 let host = null;
1635 let port = null; 1810 let port = null;
1636 if (dart.notNull(authority !== null) && dart.notNull(authority.isNotEmpty) ) { 1811 if (dart.notNull(authority !== null) && dart.notNull(authority.isNotEmpty) ) {
1637 let hostStart = 0; 1812 let hostStart = 0;
1638 let hasUserInfo = false; 1813 let hasUserInfo = false;
1639 for (let i = 0; i < authority.length; i++) { 1814 for (let i = 0; i < authority.length; i++) {
1640 if (authority.codeUnitAt(i) === _AT_SIGN) { 1815 if (authority.codeUnitAt(i) === _AT_SIGN) {
1641 hasUserInfo = true; 1816 hasUserInfo = true;
1642 userInfo = authority.substring(0, i); 1817 userInfo = authority.substring(0, i);
1643 hostStart = i + 1; 1818 hostStart = i + 1;
1644 break; 1819 break;
1645 } 1820 }
1646 } 1821 }
1647 let hostEnd = hostStart; 1822 let hostEnd = hostStart;
1648 if (dart.notNull(hostStart < authority.length) && dart.notNull(authority .codeUnitAt(hostStart) === _LEFT_BRACKET)) { 1823 if (dart.notNull(hostStart < authority.length) && dart.notNull(authority .codeUnitAt(hostStart) === _LEFT_BRACKET)) {
1649 for (; hostEnd < authority.length; hostEnd++) { 1824 for (; hostEnd < authority.length; hostEnd++) {
1650 if (authority.codeUnitAt(hostEnd) === _RIGHT_BRACKET) break; 1825 if (authority.codeUnitAt(hostEnd) === _RIGHT_BRACKET)
1826 break;
1651 } 1827 }
1652 if (hostEnd === authority.length) { 1828 if (hostEnd === authority.length) {
1653 throw new FormatException("Invalid IPv6 host entry.", authority, hos tStart); 1829 throw new FormatException("Invalid IPv6 host entry.", authority, hos tStart);
1654 } 1830 }
1655 parseIPv6Address(authority, hostStart + 1, hostEnd); 1831 parseIPv6Address(authority, hostStart + 1, hostEnd);
1656 hostEnd++; 1832 hostEnd++;
1657 if (dart.notNull(hostEnd !== authority.length) && dart.notNull(authori ty.codeUnitAt(hostEnd) !== _COLON)) { 1833 if (dart.notNull(hostEnd !== authority.length) && dart.notNull(authori ty.codeUnitAt(hostEnd) !== _COLON)) {
1658 throw new FormatException("Invalid end of authority", authority, hos tEnd); 1834 throw new FormatException("Invalid end of authority", authority, hos tEnd);
1659 } 1835 }
1660 } 1836 }
1661 let hasPort = false; 1837 let hasPort = false;
1662 for (; hostEnd < authority.length; hostEnd++) { 1838 for (; hostEnd < authority.length; hostEnd++) {
1663 if (authority.codeUnitAt(hostEnd) === _COLON) { 1839 if (authority.codeUnitAt(hostEnd) === _COLON) {
1664 let portString = authority.substring(hostEnd + 1); 1840 let portString = authority.substring(hostEnd + 1);
1665 if (portString.isNotEmpty) port = int.parse(portString); 1841 if (portString.isNotEmpty)
1842 port = int.parse(portString);
1666 break; 1843 break;
1667 } 1844 }
1668 } 1845 }
1669 host = authority.substring(hostStart, hostEnd); 1846 host = authority.substring(hostStart, hostEnd);
1670 } 1847 }
1671 return new Uri({scheme: scheme, userInfo: userInfo, host: host, port: port , pathSegments: unencodedPath.split("/"), queryParameters: queryParameters}); 1848 return new Uri({scheme: scheme, userInfo: userInfo, host: host, port: port , pathSegments: unencodedPath.split("/"), queryParameters: queryParameters});
1672 } 1849 }
1673 Uri$file(path, opt$) { 1850 Uri$file(path, opt$) {
1674 let windows = opt$.windows === undefined ? null : opt$.windows; 1851 let windows = opt$.windows === void 0 ? null : opt$.windows;
1675 windows = windows === null ? Uri._isWindows : windows; 1852 windows = windows === null ? Uri._isWindows : windows;
1676 return dart.as(windows ? _makeWindowsFileUrl(path) : _makeFileUri(path), U ri); 1853 return dart.as(windows ? _makeWindowsFileUrl(path) : _makeFileUri(path), U ri);
1677 } 1854 }
1678 static get base() { 1855 static get base() {
1679 let uri = dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, "currentUri"), String); 1856 let uri = dart.as(dart.dinvoke(/* Unimplemented unknown name */Primitives, 'currentUri'), String);
1680 if (uri !== null) return Uri.parse(uri); 1857 if (uri !== null)
1858 return Uri.parse(uri);
1681 throw new UnsupportedError("'Uri.base' is not supported"); 1859 throw new UnsupportedError("'Uri.base' is not supported");
1682 } 1860 }
1683 static get _isWindows() { return false; } 1861 static get _isWindows() {
1862 return false;
1863 }
1684 static _checkNonWindowsPathReservedCharacters(segments, argumentError) { 1864 static _checkNonWindowsPathReservedCharacters(segments, argumentError) {
1685 segments.forEach((segment) => { 1865 segments.forEach((segment) => {
1686 if (dart.dinvoke(segment, "contains", "/")) { 1866 if (dart.dinvoke(segment, 'contains', "/")) {
1687 if (argumentError) { 1867 if (argumentError) {
1688 throw new ArgumentError(`Illegal path character ${segment}`); 1868 throw new ArgumentError(`Illegal path character ${segment}`);
1689 } else { 1869 } else {
1690 throw new UnsupportedError(`Illegal path character ${segment}`); 1870 throw new UnsupportedError(`Illegal path character ${segment}`);
1691 } 1871 }
1692 } 1872 }
1693 }); 1873 });
1694 } 1874 }
1695 static _checkWindowsPathReservedCharacters(segments, argumentError, firstSeg ment) { 1875 static _checkWindowsPathReservedCharacters(segments, argumentError, firstSeg ment) {
1696 if (firstSegment === undefined) firstSegment = 0; 1876 if (firstSegment === void 0)
1877 firstSegment = 0;
1697 segments.skip(firstSegment).forEach((segment) => { 1878 segments.skip(firstSegment).forEach((segment) => {
1698 if (dart.dinvoke(segment, "contains", new RegExp('["*/:<>?\\\\|]'))) { 1879 if (dart.dinvoke(segment, 'contains', new RegExp('["*/:<>?\\\\|]'))) {
1699 if (argumentError) { 1880 if (argumentError) {
1700 throw new ArgumentError("Illegal character in path"); 1881 throw new ArgumentError("Illegal character in path");
1701 } else { 1882 } else {
1702 throw new UnsupportedError("Illegal character in path"); 1883 throw new UnsupportedError("Illegal character in path");
1703 } 1884 }
1704 } 1885 }
1705 }); 1886 });
1706 } 1887 }
1707 static _checkWindowsDriveLetter(charCode, argumentError) { 1888 static _checkWindowsDriveLetter(charCode, argumentError) {
1708 if (dart.notNull((dart.notNull(_UPPER_CASE_A <= charCode) && dart.notNull( charCode <= _UPPER_CASE_Z))) || dart.notNull((dart.notNull(_LOWER_CASE_A <= char Code) && dart.notNull(charCode <= _LOWER_CASE_Z)))) { 1889 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))) {
1709 return; 1890 return;
1710 } 1891 }
1711 if (argumentError) { 1892 if (argumentError) {
1712 throw new ArgumentError(String['+']("Illegal drive letter ", new String. fromCharCode(charCode))); 1893 throw new ArgumentError(String['+']("Illegal drive letter ", new String. fromCharCode(charCode)));
1713 } else { 1894 } else {
1714 throw new UnsupportedError(String['+']("Illegal drive letter ", new Stri ng.fromCharCode(charCode))); 1895 throw new UnsupportedError(String['+']("Illegal drive letter ", new Stri ng.fromCharCode(charCode)));
1715 } 1896 }
1716 } 1897 }
1717 static _makeFileUri(path) { 1898 static _makeFileUri(path) {
1718 let sep = "/"; 1899 let sep = "/";
(...skipping 39 matching lines...)
1758 _checkWindowsPathReservedCharacters(pathSegments, true); 1939 _checkWindowsPathReservedCharacters(pathSegments, true);
1759 return new Uri({scheme: "file", pathSegments: pathSegments}); 1940 return new Uri({scheme: "file", pathSegments: pathSegments});
1760 } 1941 }
1761 } else { 1942 } else {
1762 let pathSegments = path.split(sep); 1943 let pathSegments = path.split(sep);
1763 _checkWindowsPathReservedCharacters(pathSegments, true); 1944 _checkWindowsPathReservedCharacters(pathSegments, true);
1764 return new Uri({pathSegments: pathSegments}); 1945 return new Uri({pathSegments: pathSegments});
1765 } 1946 }
1766 } 1947 }
1767 replace(opt$) { 1948 replace(opt$) {
1768 let scheme = opt$.scheme === undefined ? null : opt$.scheme; 1949 let scheme = opt$.scheme === void 0 ? null : opt$.scheme;
1769 let userInfo = opt$.userInfo === undefined ? null : opt$.userInfo; 1950 let userInfo = opt$.userInfo === void 0 ? null : opt$.userInfo;
1770 let host = opt$.host === undefined ? null : opt$.host; 1951 let host = opt$.host === void 0 ? null : opt$.host;
1771 let port = opt$.port === undefined ? null : opt$.port; 1952 let port = opt$.port === void 0 ? null : opt$.port;
1772 let path = opt$.path === undefined ? null : opt$.path; 1953 let path = opt$.path === void 0 ? null : opt$.path;
1773 let pathSegments = opt$.pathSegments === undefined ? null : opt$.pathSegme nts; 1954 let pathSegments = opt$.pathSegments === void 0 ? null : opt$.pathSegments ;
1774 let query = opt$.query === undefined ? null : opt$.query; 1955 let query = opt$.query === void 0 ? null : opt$.query;
1775 let queryParameters = opt$.queryParameters === undefined ? null : opt$.que ryParameters; 1956 let queryParameters = opt$.queryParameters === void 0 ? null : opt$.queryP arameters;
1776 let fragment = opt$.fragment === undefined ? null : opt$.fragment; 1957 let fragment = opt$.fragment === void 0 ? null : opt$.fragment;
1777 let schemeChanged = false; 1958 let schemeChanged = false;
1778 if (scheme !== null) { 1959 if (scheme !== null) {
1779 scheme = _makeScheme(scheme, scheme.length); 1960 scheme = _makeScheme(scheme, scheme.length);
1780 schemeChanged = true; 1961 schemeChanged = true;
1781 } else { 1962 } else {
1782 scheme = this.scheme; 1963 scheme = this.scheme;
1783 } 1964 }
1784 let isFile = (dart.equals(scheme, "file")); 1965 let isFile = dart.equals(scheme, "file");
1785 if (userInfo !== null) { 1966 if (userInfo !== null) {
1786 userInfo = _makeUserInfo(userInfo, 0, userInfo.length); 1967 userInfo = _makeUserInfo(userInfo, 0, userInfo.length);
1787 } else { 1968 } else {
1788 userInfo = this.userInfo; 1969 userInfo = this.userInfo;
1789 } 1970 }
1790 if (port !== null) { 1971 if (port !== null) {
1791 port = _makePort(port, scheme); 1972 port = _makePort(port, scheme);
1792 } else { 1973 } else {
1793 port = dart.notNull(this._port); 1974 port = dart.notNull(this._port);
1794 if (schemeChanged) { 1975 if (schemeChanged) {
1795 port = _makePort(port, scheme); 1976 port = _makePort(port, scheme);
1796 } 1977 }
1797 } 1978 }
1798 if (host !== null) { 1979 if (host !== null) {
1799 host = _makeHost(host, 0, host.length, false); 1980 host = _makeHost(host, 0, host.length, false);
1800 } else if (this.hasAuthority) { 1981 } else if (this.hasAuthority) {
1801 host = this.host; 1982 host = this.host;
1802 } else if (dart.notNull(dart.notNull(userInfo.isNotEmpty) || dart.notNull( port !== null)) || dart.notNull(isFile)) { 1983 } else if (dart.notNull(dart.notNull(userInfo.isNotEmpty) || dart.notNull( port !== null)) || dart.notNull(isFile)) {
1803 host = ""; 1984 host = "";
1804 } 1985 }
1805 let ensureLeadingSlash = (host !== null); 1986 let ensureLeadingSlash = host !== null;
1806 if (dart.notNull(path !== null) || dart.notNull(pathSegments !== null)) { 1987 if (dart.notNull(path !== null) || dart.notNull(pathSegments !== null)) {
1807 path = _makePath(path, 0, _stringOrNullLength(path), pathSegments, ensur eLeadingSlash, isFile); 1988 path = _makePath(path, 0, _stringOrNullLength(path), pathSegments, ensur eLeadingSlash, isFile);
1808 } else { 1989 } else {
1809 path = this.path; 1990 path = this.path;
1810 if (dart.notNull((dart.notNull(isFile) || dart.notNull((dart.notNull(ens ureLeadingSlash) && dart.notNull(!dart.notNull(path.isEmpty)))))) && dart.notNul l(!dart.notNull(path.startsWith('/')))) { 1991 if (dart.notNull(dart.notNull(isFile) || dart.notNull(dart.notNull(ensur eLeadingSlash) && dart.notNull(!dart.notNull(path.isEmpty)))) && dart.notNull(!d art.notNull(path.startsWith('/')))) {
1811 path = `/${path}`; 1992 path = `/${path}`;
1812 } 1993 }
1813 } 1994 }
1814 if (dart.notNull(query !== null) || dart.notNull(queryParameters !== null) ) { 1995 if (dart.notNull(query !== null) || dart.notNull(queryParameters !== null) ) {
1815 query = _makeQuery(query, 0, _stringOrNullLength(query), queryParameters ); 1996 query = _makeQuery(query, 0, _stringOrNullLength(query), queryParameters );
1816 } else if (this.hasQuery) { 1997 } else if (this.hasQuery) {
1817 query = this.query; 1998 query = this.query;
1818 } 1999 }
1819 if (fragment !== null) { 2000 if (fragment !== null) {
1820 fragment = _makeFragment(fragment, 0, fragment.length); 2001 fragment = _makeFragment(fragment, 0, fragment.length);
1821 } else if (this.hasFragment) { 2002 } else if (this.hasFragment) {
1822 fragment = this.fragment; 2003 fragment = this.fragment;
1823 } 2004 }
1824 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme nt); 2005 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme nt);
1825 } 2006 }
1826 get pathSegments() { 2007 get pathSegments() {
1827 if (this._pathSegments === null) { 2008 if (this._pathSegments === null) {
1828 let pathToSplit = dart.notNull(!dart.notNull(this.path.isEmpty)) && dart .notNull(this.path.codeUnitAt(0) === _SLASH) ? this.path.substring(1) : this.pat h; 2009 let pathToSplit = dart.notNull(!dart.notNull(this.path.isEmpty)) && dart .notNull(this.path.codeUnitAt(0) === _SLASH) ? this.path.substring(1) : this.pat h;
1829 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)); 2010 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));
1830 } 2011 }
1831 return this._pathSegments; 2012 return this._pathSegments;
1832 } 2013 }
1833 get queryParameters() { 2014 get queryParameters() {
1834 if (this._queryParameters === null) { 2015 if (this._queryParameters === null) {
1835 this._queryParameters = dart.as(new collection.UnmodifiableMapView(split QueryString(this.query)), Map$(StringString)); 2016 this._queryParameters = dart.as(new collection.UnmodifiableMapView(split QueryString(this.query)), Map$(String, String));
1836 } 2017 }
1837 return this._queryParameters; 2018 return this._queryParameters;
1838 } 2019 }
1839 static _makePort(port, scheme) { 2020 static _makePort(port, scheme) {
1840 if (dart.notNull(port !== null) && dart.notNull(port === _defaultPort(sche me))) return dart.as(null, int); 2021 if (dart.notNull(port !== null) && dart.notNull(port === _defaultPort(sche me)))
2022 return dart.as(null, int);
1841 return port; 2023 return port;
1842 } 2024 }
1843 static _makeHost(host, start, end, strictIPv6) { 2025 static _makeHost(host, start, end, strictIPv6) {
1844 if (host === null) return null; 2026 if (host === null)
1845 if (start === end) return ""; 2027 return null;
2028 if (start === end)
2029 return "";
1846 if (host.codeUnitAt(start) === _LEFT_BRACKET) { 2030 if (host.codeUnitAt(start) === _LEFT_BRACKET) {
1847 if (host.codeUnitAt(end - 1) !== _RIGHT_BRACKET) { 2031 if (host.codeUnitAt(end - 1) !== _RIGHT_BRACKET) {
1848 _fail(host, start, 'Missing end `]` to match `[` in host'); 2032 _fail(host, start, 'Missing end `]` to match `[` in host');
1849 } 2033 }
1850 parseIPv6Address(host, start + 1, end - 1); 2034 parseIPv6Address(host, start + 1, end - 1);
1851 return host.substring(start, end).toLowerCase(); 2035 return host.substring(start, end).toLowerCase();
1852 } 2036 }
1853 if (!dart.notNull(strictIPv6)) { 2037 if (!dart.notNull(strictIPv6)) {
1854 for (let i = start; i < end; i++) { 2038 for (let i = start; i < end; i++) {
1855 if (host.codeUnitAt(i) === _COLON) { 2039 if (host.codeUnitAt(i) === _COLON) {
1856 parseIPv6Address(host, start, end); 2040 parseIPv6Address(host, start, end);
1857 return `[${host}]`; 2041 return `[${host}]`;
1858 } 2042 }
1859 } 2043 }
1860 } 2044 }
1861 return _normalizeRegName(host, start, end); 2045 return _normalizeRegName(host, start, end);
1862 } 2046 }
1863 static _isRegNameChar(char) { 2047 static _isRegNameChar(char) {
1864 return dart.notNull(char < 127) && dart.notNull(!dart.equals((dart.dbinary (dart.dindex(_regNameTable, char >> 4), "&", (1 << (char & 15)))), 0)); 2048 return dart.notNull(char < 127) && dart.notNull(!dart.equals(dart.dbinary( dart.dindex(_regNameTable, char >> 4), '&', 1 << (char & 15)), 0));
1865 } 2049 }
1866 static _normalizeRegName(host, start, end) { 2050 static _normalizeRegName(host, start, end) {
1867 let buffer = null; 2051 let buffer = null;
1868 let sectionStart = start; 2052 let sectionStart = start;
1869 let index = start; 2053 let index = start;
1870 let isNormalized = true; 2054 let isNormalized = true;
1871 while (index < end) { 2055 while (index < end) {
1872 let char = host.codeUnitAt(index); 2056 let char = host.codeUnitAt(index);
1873 if (char === _PERCENT) { 2057 if (char === _PERCENT) {
1874 let replacement = _normalizeEscape(host, index, true); 2058 let replacement = _normalizeEscape(host, index, true);
1875 if (dart.notNull(replacement === null) && dart.notNull(isNormalized)) { 2059 if (dart.notNull(replacement === null) && dart.notNull(isNormalized)) {
1876 index = 3; 2060 index = 3;
1877 continue; 2061 continue;
1878 } 2062 }
1879 if (buffer === null) buffer = new StringBuffer(); 2063 if (buffer === null)
2064 buffer = new StringBuffer();
1880 let slice = host.substring(sectionStart, index); 2065 let slice = host.substring(sectionStart, index);
1881 if (!dart.notNull(isNormalized)) slice = slice.toLowerCase(); 2066 if (!dart.notNull(isNormalized))
2067 slice = slice.toLowerCase();
1882 buffer.write(slice); 2068 buffer.write(slice);
1883 let sourceLength = 3; 2069 let sourceLength = 3;
1884 if (replacement === null) { 2070 if (replacement === null) {
1885 replacement = host.substring(index, index + 3); 2071 replacement = host.substring(index, index + 3);
1886 } else if (dart.equals(replacement, "%")) { 2072 } else if (dart.equals(replacement, "%")) {
1887 replacement = "%25"; 2073 replacement = "%25";
1888 sourceLength = 1; 2074 sourceLength = 1;
1889 } 2075 }
1890 buffer.write(replacement); 2076 buffer.write(replacement);
1891 index = sourceLength; 2077 index = sourceLength;
1892 sectionStart = index; 2078 sectionStart = index;
1893 isNormalized = true; 2079 isNormalized = true;
1894 } else if (_isRegNameChar(char)) { 2080 } else if (_isRegNameChar(char)) {
1895 if (dart.notNull(dart.notNull(isNormalized) && dart.notNull(_UPPER_CAS E_A <= char)) && dart.notNull(_UPPER_CASE_Z >= char)) { 2081 if (dart.notNull(dart.notNull(isNormalized) && dart.notNull(_UPPER_CAS E_A <= char)) && dart.notNull(_UPPER_CASE_Z >= char)) {
1896 if (buffer === null) buffer = new StringBuffer(); 2082 if (buffer === null)
2083 buffer = new StringBuffer();
1897 if (sectionStart < index) { 2084 if (sectionStart < index) {
1898 buffer.write(host.substring(sectionStart, index)); 2085 buffer.write(host.substring(sectionStart, index));
1899 sectionStart = index; 2086 sectionStart = index;
1900 } 2087 }
1901 isNormalized = false; 2088 isNormalized = false;
1902 } 2089 }
1903 index++; 2090 index++;
1904 } else if (_isGeneralDelimiter(char)) { 2091 } else if (_isGeneralDelimiter(char)) {
1905 _fail(host, index, "Invalid character"); 2092 _fail(host, index, "Invalid character");
1906 } else { 2093 } else {
1907 let sourceLength = 1; 2094 let sourceLength = 1;
1908 if (dart.notNull((char & 64512) === 55296) && dart.notNull((index + 1) < end)) { 2095 if (dart.notNull((char & 64512) === 55296) && dart.notNull(index + 1 < end)) {
1909 let tail = host.codeUnitAt(index + 1); 2096 let tail = host.codeUnitAt(index + 1);
1910 if ((tail & 64512) === 56320) { 2097 if ((tail & 64512) === 56320) {
1911 char = 65536 | ((char & 1023) << 10) | (tail & 1023); 2098 char = 65536 | (char & 1023) << 10 | tail & 1023;
1912 sourceLength = 2; 2099 sourceLength = 2;
1913 } 2100 }
1914 } 2101 }
1915 if (buffer === null) buffer = new StringBuffer(); 2102 if (buffer === null)
2103 buffer = new StringBuffer();
1916 let slice = host.substring(sectionStart, index); 2104 let slice = host.substring(sectionStart, index);
1917 if (!dart.notNull(isNormalized)) slice = slice.toLowerCase(); 2105 if (!dart.notNull(isNormalized))
2106 slice = slice.toLowerCase();
1918 buffer.write(slice); 2107 buffer.write(slice);
1919 buffer.write(_escapeChar(char)); 2108 buffer.write(_escapeChar(char));
1920 index = sourceLength; 2109 index = sourceLength;
1921 sectionStart = index; 2110 sectionStart = index;
1922 } 2111 }
1923 } 2112 }
1924 if (buffer === null) return host.substring(start, end); 2113 if (buffer === null)
2114 return host.substring(start, end);
1925 if (sectionStart < end) { 2115 if (sectionStart < end) {
1926 let slice = host.substring(sectionStart, end); 2116 let slice = host.substring(sectionStart, end);
1927 if (!dart.notNull(isNormalized)) slice = slice.toLowerCase(); 2117 if (!dart.notNull(isNormalized))
2118 slice = slice.toLowerCase();
1928 buffer.write(slice); 2119 buffer.write(slice);
1929 } 2120 }
1930 return buffer.toString(); 2121 return buffer.toString();
1931 } 2122 }
1932 static _makeScheme(scheme, end) { 2123 static _makeScheme(scheme, end) {
1933 if (end === 0) return ""; 2124 if (end === 0)
2125 return "";
1934 let firstCodeUnit = scheme.codeUnitAt(0); 2126 let firstCodeUnit = scheme.codeUnitAt(0);
1935 if (!dart.notNull(_isAlphabeticCharacter(firstCodeUnit))) { 2127 if (!dart.notNull(_isAlphabeticCharacter(firstCodeUnit))) {
1936 _fail(scheme, 0, "Scheme not starting with alphabetic character"); 2128 _fail(scheme, 0, "Scheme not starting with alphabetic character");
1937 } 2129 }
1938 let allLowercase = firstCodeUnit >= _LOWER_CASE_A; 2130 let allLowercase = firstCodeUnit >= _LOWER_CASE_A;
1939 for (let i = 0; i < end; i++) { 2131 for (let i = 0; i < end; i++) {
1940 let codeUnit = scheme.codeUnitAt(i); 2132 let codeUnit = scheme.codeUnitAt(i);
1941 if (!dart.notNull(_isSchemeCharacter(codeUnit))) { 2133 if (!dart.notNull(_isSchemeCharacter(codeUnit))) {
1942 _fail(scheme, i, "Illegal scheme character"); 2134 _fail(scheme, i, "Illegal scheme character");
1943 } 2135 }
1944 if (dart.notNull(codeUnit < _LOWER_CASE_A) || dart.notNull(codeUnit > _L OWER_CASE_Z)) { 2136 if (dart.notNull(codeUnit < _LOWER_CASE_A) || dart.notNull(codeUnit > _L OWER_CASE_Z)) {
1945 allLowercase = false; 2137 allLowercase = false;
1946 } 2138 }
1947 } 2139 }
1948 scheme = scheme.substring(0, end); 2140 scheme = scheme.substring(0, end);
1949 if (!dart.notNull(allLowercase)) scheme = scheme.toLowerCase(); 2141 if (!dart.notNull(allLowercase))
2142 scheme = scheme.toLowerCase();
1950 return scheme; 2143 return scheme;
1951 } 2144 }
1952 static _makeUserInfo(userInfo, start, end) { 2145 static _makeUserInfo(userInfo, start, end) {
1953 if (userInfo === null) return ""; 2146 if (userInfo === null)
2147 return "";
1954 return _normalize(userInfo, start, end, dart.as(_userinfoTable, List$(int) )); 2148 return _normalize(userInfo, start, end, dart.as(_userinfoTable, List$(int) ));
1955 } 2149 }
1956 static _makePath(path, start, end, pathSegments, ensureLeadingSlash, isFile) { 2150 static _makePath(path, start, end, pathSegments, ensureLeadingSlash, isFile) {
1957 if (dart.notNull(path === null) && dart.notNull(pathSegments === null)) re turn isFile ? "/" : ""; 2151 if (dart.notNull(path === null) && dart.notNull(pathSegments === null))
2152 return isFile ? "/" : "";
1958 if (dart.notNull(path !== null) && dart.notNull(pathSegments !== null)) { 2153 if (dart.notNull(path !== null) && dart.notNull(pathSegments !== null)) {
1959 throw new ArgumentError('Both path and pathSegments specified'); 2154 throw new ArgumentError('Both path and pathSegments specified');
1960 } 2155 }
1961 let result = null; 2156 let result = null;
1962 if (path !== null) { 2157 if (path !== null) {
1963 result = _normalize(path, start, end, dart.as(_pathCharOrSlashTable, Lis t$(int))); 2158 result = _normalize(path, start, end, dart.as(_pathCharOrSlashTable, Lis t$(int)));
1964 } else { 2159 } else {
1965 result = pathSegments.map((s) => _uriEncode(dart.as(_pathCharTable, List $(int)), dart.as(s, String))).join("/"); 2160 result = pathSegments.map((s) => _uriEncode(dart.as(_pathCharTable, List $(int)), dart.as(s, String))).join("/");
1966 } 2161 }
1967 if (dart.dload(result, "isEmpty")) { 2162 if (dart.dload(result, 'isEmpty')) {
1968 if (isFile) return "/"; 2163 if (isFile)
1969 } else if (dart.notNull((dart.notNull(isFile) || dart.notNull(ensureLeadin gSlash))) && dart.notNull(!dart.equals(dart.dinvoke(result, "codeUnitAt", 0), _S LASH))) { 2164 return "/";
2165 } else if (dart.notNull(dart.notNull(isFile) || dart.notNull(ensureLeading Slash)) && dart.notNull(!dart.equals(dart.dinvoke(result, 'codeUnitAt', 0), _SLA SH))) {
1970 return `/${result}`; 2166 return `/${result}`;
1971 } 2167 }
1972 return dart.as(result, String); 2168 return dart.as(result, String);
1973 } 2169 }
1974 static _makeQuery(query, start, end, queryParameters) { 2170 static _makeQuery(query, start, end, queryParameters) {
1975 if (dart.notNull(query === null) && dart.notNull(queryParameters === null) ) return null; 2171 if (dart.notNull(query === null) && dart.notNull(queryParameters === null) )
2172 return null;
1976 if (dart.notNull(query !== null) && dart.notNull(queryParameters !== null) ) { 2173 if (dart.notNull(query !== null) && dart.notNull(queryParameters !== null) ) {
1977 throw new ArgumentError('Both query and queryParameters specified'); 2174 throw new ArgumentError('Both query and queryParameters specified');
1978 } 2175 }
1979 if (query !== null) return _normalize(query, start, end, dart.as(_queryCha rTable, List$(int))); 2176 if (query !== null)
2177 return _normalize(query, start, end, dart.as(_queryCharTable, List$(int) ));
1980 let result = new StringBuffer(); 2178 let result = new StringBuffer();
1981 let first = true; 2179 let first = true;
1982 queryParameters.forEach(((key, value) => { 2180 queryParameters.forEach(((key, value) => {
1983 if (!dart.notNull(first)) { 2181 if (!dart.notNull(first)) {
1984 result.write("&"); 2182 result.write("&");
1985 } 2183 }
1986 first = false; 2184 first = false;
1987 result.write(Uri.encodeQueryComponent(dart.as(key, String))); 2185 result.write(Uri.encodeQueryComponent(dart.as(key, String)));
1988 if (dart.notNull(value !== null) && dart.notNull(/* Unimplemented postfi x operator: !value.isEmpty */)) { 2186 if (dart.notNull(value !== null) && dart.notNull(dart.throw_("Unimplemen ted PrefixExpression: !value.isEmpty"))) {
1989 result.write("="); 2187 result.write("=");
1990 result.write(Uri.encodeQueryComponent(dart.as(value, String))); 2188 result.write(Uri.encodeQueryComponent(dart.as(value, String)));
1991 } 2189 }
1992 }).bind(this)); 2190 }).bind(this));
1993 return result.toString(); 2191 return result.toString();
1994 } 2192 }
1995 static _makeFragment(fragment, start, end) { 2193 static _makeFragment(fragment, start, end) {
1996 if (fragment === null) return null; 2194 if (fragment === null)
2195 return null;
1997 return _normalize(fragment, start, end, dart.as(_queryCharTable, List$(int ))); 2196 return _normalize(fragment, start, end, dart.as(_queryCharTable, List$(int )));
1998 } 2197 }
1999 static _stringOrNullLength(s) { return (s === null) ? 0 : s.length; } 2198 static _stringOrNullLength(s) {
2199 return s === null ? 0 : s.length;
2200 }
2000 static _isHexDigit(char) { 2201 static _isHexDigit(char) {
2001 if (_NINE >= char) return _ZERO <= char; 2202 if (_NINE >= char)
2203 return _ZERO <= char;
2002 char = 32; 2204 char = 32;
2003 return dart.notNull(_LOWER_CASE_A <= char) && dart.notNull(_LOWER_CASE_F > = char); 2205 return dart.notNull(_LOWER_CASE_A <= char) && dart.notNull(_LOWER_CASE_F > = char);
2004 } 2206 }
2005 static _hexValue(char) { 2207 static _hexValue(char) {
2006 dart.assert(_isHexDigit(char)); 2208 dart.assert(_isHexDigit(char));
2007 if (_NINE >= char) return char - _ZERO; 2209 if (_NINE >= char)
2210 return char - _ZERO;
2008 char = 32; 2211 char = 32;
2009 return char - (_LOWER_CASE_A - 10); 2212 return char - (_LOWER_CASE_A - 10);
2010 } 2213 }
2011 static _normalizeEscape(source, index, lowerCase) { 2214 static _normalizeEscape(source, index, lowerCase) {
2012 dart.assert(source.codeUnitAt(index) === _PERCENT); 2215 dart.assert(source.codeUnitAt(index) === _PERCENT);
2013 if (index + 2 >= source.length) { 2216 if (index + 2 >= source.length) {
2014 return "%"; 2217 return "%";
2015 } 2218 }
2016 let firstDigit = source.codeUnitAt(index + 1); 2219 let firstDigit = source.codeUnitAt(index + 1);
2017 let secondDigit = source.codeUnitAt(index + 2); 2220 let secondDigit = source.codeUnitAt(index + 2);
2018 if (dart.notNull(!dart.notNull(_isHexDigit(firstDigit))) || dart.notNull(! dart.notNull(_isHexDigit(secondDigit)))) { 2221 if (dart.notNull(!dart.notNull(_isHexDigit(firstDigit))) || dart.notNull(! dart.notNull(_isHexDigit(secondDigit)))) {
2019 return "%"; 2222 return "%";
2020 } 2223 }
2021 let value = _hexValue(firstDigit) * 16 + _hexValue(secondDigit); 2224 let value = _hexValue(firstDigit) * 16 + _hexValue(secondDigit);
2022 if (_isUnreservedChar(value)) { 2225 if (_isUnreservedChar(value)) {
2023 if (dart.notNull(dart.notNull(lowerCase) && dart.notNull(_UPPER_CASE_A < = value)) && dart.notNull(_UPPER_CASE_Z >= value)) { 2226 if (dart.notNull(dart.notNull(lowerCase) && dart.notNull(_UPPER_CASE_A < = value)) && dart.notNull(_UPPER_CASE_Z >= value)) {
2024 value = 32; 2227 value = 32;
2025 } 2228 }
2026 return new String.fromCharCode(value); 2229 return new String.fromCharCode(value);
2027 } 2230 }
2028 if (dart.notNull(firstDigit >= _LOWER_CASE_A) || dart.notNull(secondDigit >= _LOWER_CASE_A)) { 2231 if (dart.notNull(firstDigit >= _LOWER_CASE_A) || dart.notNull(secondDigit >= _LOWER_CASE_A)) {
2029 return source.substring(index, index + 3).toUpperCase(); 2232 return source.substring(index, index + 3).toUpperCase();
2030 } 2233 }
2031 return null; 2234 return null;
2032 } 2235 }
2033 static _isUnreservedChar(ch) { 2236 static _isUnreservedChar(ch) {
2034 return dart.notNull(ch < 127) && dart.notNull((!dart.equals((dart.dbinary( dart.dindex(_unreservedTable, ch >> 4), "&", (1 << (ch & 15)))), 0))); 2237 return dart.notNull(ch < 127) && dart.notNull(!dart.equals(dart.dbinary(da rt.dindex(_unreservedTable, ch >> 4), '&', 1 << (ch & 15)), 0));
2035 } 2238 }
2036 static _escapeChar(char) { 2239 static _escapeChar(char) {
2037 dart.assert(dart.dbinary(char, "<=", 1114111)); 2240 dart.assert(dart.dbinary(char, '<=', 1114111));
2038 let hexDigits = "0123456789ABCDEF"; 2241 let hexDigits = "0123456789ABCDEF";
2039 let codeUnits = null; 2242 let codeUnits = null;
2040 if (dart.dbinary(char, "<", 128)) { 2243 if (dart.dbinary(char, '<', 128)) {
2041 codeUnits = new List(3); 2244 codeUnits = new List(3);
2042 codeUnits.set(0, _PERCENT); 2245 codeUnits.set(0, _PERCENT);
2043 codeUnits.set(1, hexDigits.codeUnitAt(dart.as(dart.dbinary(char, ">>", 4 ), int))); 2246 codeUnits.set(1, hexDigits.codeUnitAt(dart.as(dart.dbinary(char, '>>', 4 ), int)));
2044 codeUnits.set(2, hexDigits.codeUnitAt(dart.as(dart.dbinary(char, "&", 15 ), int))); 2247 codeUnits.set(2, hexDigits.codeUnitAt(dart.as(dart.dbinary(char, '&', 15 ), int)));
2045 } else { 2248 } else {
2046 let flag = 192; 2249 let flag = 192;
2047 let encodedBytes = 2; 2250 let encodedBytes = 2;
2048 if (dart.dbinary(char, ">", 2047)) { 2251 if (dart.dbinary(char, '>', 2047)) {
2049 flag = 224; 2252 flag = 224;
2050 encodedBytes = 3; 2253 encodedBytes = 3;
2051 if (dart.dbinary(char, ">", 65535)) { 2254 if (dart.dbinary(char, '>', 65535)) {
2052 encodedBytes = 4; 2255 encodedBytes = 4;
2053 flag = 240; 2256 flag = 240;
2054 } 2257 }
2055 } 2258 }
2056 codeUnits = new List(3 * encodedBytes); 2259 codeUnits = new List(3 * encodedBytes);
2057 let index = 0; 2260 let index = 0;
2058 while (--encodedBytes >= 0) { 2261 while (--encodedBytes >= 0) {
2059 let byte = dart.as(dart.dbinary((dart.dbinary((dart.dbinary(char, ">>" , (6 * encodedBytes))), "&", 63)), "|", flag), int); 2262 let byte = dart.as(dart.dbinary(dart.dbinary(dart.dbinary(char, '>>', 6 * encodedBytes), '&', 63), '|', flag), int);
2060 codeUnits.set(index, _PERCENT); 2263 codeUnits.set(index, _PERCENT);
2061 codeUnits.set(index + 1, hexDigits.codeUnitAt(byte >> 4)); 2264 codeUnits.set(index + 1, hexDigits.codeUnitAt(byte >> 4));
2062 codeUnits.set(index + 2, hexDigits.codeUnitAt(byte & 15)); 2265 codeUnits.set(index + 2, hexDigits.codeUnitAt(byte & 15));
2063 index = 3; 2266 index = 3;
2064 flag = 128; 2267 flag = 128;
2065 } 2268 }
2066 } 2269 }
2067 return new String.fromCharCodes(codeUnits); 2270 return new String.fromCharCodes(codeUnits);
2068 } 2271 }
2069 static _normalize(component, start, end, charTable) { 2272 static _normalize(component, start, end, charTable) {
2070 let buffer = null; 2273 let buffer = null;
2071 let sectionStart = start; 2274 let sectionStart = start;
2072 let index = start; 2275 let index = start;
2073 while (index < end) { 2276 while (index < end) {
2074 let char = component.codeUnitAt(index); 2277 let char = component.codeUnitAt(index);
2075 if (dart.notNull(char < 127) && dart.notNull((charTable.get(char >> 4) & (1 << (char & 15))) !== 0)) { 2278 if (dart.notNull(char < 127) && dart.notNull((charTable.get(char >> 4) & 1 << (char & 15)) !== 0)) {
2076 index++; 2279 index++;
2077 } else { 2280 } else {
2078 let replacement = null; 2281 let replacement = null;
2079 let sourceLength = null; 2282 let sourceLength = null;
2080 if (char === _PERCENT) { 2283 if (char === _PERCENT) {
2081 replacement = _normalizeEscape(component, index, false); 2284 replacement = _normalizeEscape(component, index, false);
2082 if (replacement === null) { 2285 if (replacement === null) {
2083 index = 3; 2286 index = 3;
2084 continue; 2287 continue;
2085 } 2288 }
2086 if (dart.equals("%", replacement)) { 2289 if (dart.equals("%", replacement)) {
2087 replacement = "%25"; 2290 replacement = "%25";
2088 sourceLength = 1; 2291 sourceLength = 1;
2089 } else { 2292 } else {
2090 sourceLength = 3; 2293 sourceLength = 3;
2091 } 2294 }
2092 } else if (_isGeneralDelimiter(char)) { 2295 } else if (_isGeneralDelimiter(char)) {
2093 _fail(component, index, "Invalid character"); 2296 _fail(component, index, "Invalid character");
2094 } else { 2297 } else {
2095 sourceLength = 1; 2298 sourceLength = 1;
2096 if ((char & 64512) === 55296) { 2299 if ((char & 64512) === 55296) {
2097 if (index + 1 < end) { 2300 if (index + 1 < end) {
2098 let tail = component.codeUnitAt(index + 1); 2301 let tail = component.codeUnitAt(index + 1);
2099 if ((tail & 64512) === 56320) { 2302 if ((tail & 64512) === 56320) {
2100 sourceLength = 2; 2303 sourceLength = 2;
2101 char = 65536 | ((char & 1023) << 10) | (tail & 1023); 2304 char = 65536 | (char & 1023) << 10 | tail & 1023;
2102 } 2305 }
2103 } 2306 }
2104 } 2307 }
2105 replacement = _escapeChar(char); 2308 replacement = _escapeChar(char);
2106 } 2309 }
2107 if (buffer === null) buffer = new StringBuffer(); 2310 if (buffer === null)
2311 buffer = new StringBuffer();
2108 buffer.write(component.substring(sectionStart, index)); 2312 buffer.write(component.substring(sectionStart, index));
2109 buffer.write(replacement); 2313 buffer.write(replacement);
2110 index = sourceLength; 2314 index = sourceLength;
2111 sectionStart = index; 2315 sectionStart = index;
2112 } 2316 }
2113 } 2317 }
2114 if (buffer === null) { 2318 if (buffer === null) {
2115 return component.substring(start, end); 2319 return component.substring(start, end);
2116 } 2320 }
2117 if (sectionStart < end) { 2321 if (sectionStart < end) {
2118 buffer.write(component.substring(sectionStart, end)); 2322 buffer.write(component.substring(sectionStart, end));
2119 } 2323 }
2120 return buffer.toString(); 2324 return buffer.toString();
2121 } 2325 }
2122 static _isSchemeCharacter(ch) { 2326 static _isSchemeCharacter(ch) {
2123 return dart.notNull(ch < 128) && dart.notNull((!dart.equals((dart.dbinary( dart.dindex(_schemeTable, ch >> 4), "&", (1 << (ch & 15)))), 0))); 2327 return dart.notNull(ch < 128) && dart.notNull(!dart.equals(dart.dbinary(da rt.dindex(_schemeTable, ch >> 4), '&', 1 << (ch & 15)), 0));
2124 } 2328 }
2125 static _isGeneralDelimiter(ch) { 2329 static _isGeneralDelimiter(ch) {
2126 return dart.notNull(ch <= _RIGHT_BRACKET) && dart.notNull((!dart.equals((d art.dbinary(dart.dindex(_genDelimitersTable, ch >> 4), "&", (1 << (ch & 15)))), 0))); 2330 return dart.notNull(ch <= _RIGHT_BRACKET) && dart.notNull(!dart.equals(dar t.dbinary(dart.dindex(_genDelimitersTable, ch >> 4), '&', 1 << (ch & 15)), 0));
2127 } 2331 }
2128 get isAbsolute() { return dart.notNull(!dart.equals(this.scheme, "")) && dar t.notNull(dart.equals(this.fragment, "")); } 2332 get isAbsolute() {
2333 return dart.notNull(!dart.equals(this.scheme, "")) && dart.notNull(dart.eq uals(this.fragment, ""));
2334 }
2129 _merge(base, reference) { 2335 _merge(base, reference) {
2130 if (base.isEmpty) return `/${reference}`; 2336 if (base.isEmpty)
2337 return `/${reference}`;
2131 let backCount = 0; 2338 let backCount = 0;
2132 let refStart = 0; 2339 let refStart = 0;
2133 while (reference.startsWith("../", refStart)) { 2340 while (reference.startsWith("../", refStart)) {
2134 refStart = 3; 2341 refStart = 3;
2135 backCount++; 2342 backCount++;
2136 } 2343 }
2137 let baseEnd = base.lastIndexOf('/'); 2344 let baseEnd = base.lastIndexOf('/');
2138 while (dart.notNull(baseEnd > 0) && dart.notNull(backCount > 0)) { 2345 while (dart.notNull(baseEnd > 0) && dart.notNull(backCount > 0)) {
2139 let newEnd = base.lastIndexOf('/', baseEnd - 1); 2346 let newEnd = base.lastIndexOf('/', baseEnd - 1);
2140 if (newEnd < 0) { 2347 if (newEnd < 0) {
2141 break; 2348 break;
2142 } 2349 }
2143 let delta = baseEnd - newEnd; 2350 let delta = baseEnd - newEnd;
2144 if (dart.notNull(dart.notNull((dart.notNull(delta === 2) || dart.notNull (delta === 3))) && dart.notNull(base.codeUnitAt(newEnd + 1) === _DOT)) && dart.n otNull((dart.notNull(delta === 2) || dart.notNull(base.codeUnitAt(newEnd + 2) == = _DOT)))) { 2351 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))) {
2145 break; 2352 break;
2146 } 2353 }
2147 baseEnd = newEnd; 2354 baseEnd = newEnd;
2148 backCount--; 2355 backCount--;
2149 } 2356 }
2150 return String['+'](base.substring(0, baseEnd + 1), reference.substring(ref Start - 3 * backCount)); 2357 return String['+'](base.substring(0, baseEnd + 1), reference.substring(ref Start - 3 * backCount));
2151 } 2358 }
2152 _hasDotSegments(path) { 2359 _hasDotSegments(path) {
2153 if (dart.notNull(path.length > 0) && dart.notNull(path.codeUnitAt(0) === _ DOT)) return true; 2360 if (dart.notNull(path.length > 0) && dart.notNull(path.codeUnitAt(0) === _ DOT))
2361 return true;
2154 let index = path.indexOf("/."); 2362 let index = path.indexOf("/.");
2155 return index !== -1; 2363 return index !== -1;
2156 } 2364 }
2157 _removeDotSegments(path) { 2365 _removeDotSegments(path) {
2158 if (!dart.notNull(this._hasDotSegments(path))) return path; 2366 if (!dart.notNull(this._hasDotSegments(path)))
2367 return path;
2159 let output = dart.as(new List.from([]), List$(String)); 2368 let output = dart.as(new List.from([]), List$(String));
2160 let appendSlash = false; 2369 let appendSlash = false;
2161 for (let segment of path.split("/")) { 2370 for (let segment of path.split("/")) {
2162 appendSlash = false; 2371 appendSlash = false;
2163 if (dart.equals(segment, "..")) { 2372 if (dart.equals(segment, "..")) {
2164 if (dart.notNull(!dart.notNull(output.isEmpty)) && dart.notNull((dart. notNull((output.length !== 1)) || dart.notNull((!dart.equals(output.get(0), "")) )))) output.removeLast(); 2373 if (dart.notNull(!dart.notNull(output.isEmpty)) && dart.notNull(dart.n otNull(output.length !== 1) || dart.notNull(!dart.equals(output.get(0), ""))))
2374 output.removeLast();
2165 appendSlash = true; 2375 appendSlash = true;
2166 } else if (dart.equals(".", segment)) { 2376 } else if (dart.equals(".", segment)) {
2167 appendSlash = true; 2377 appendSlash = true;
2168 } else { 2378 } else {
2169 output.add(segment); 2379 output.add(segment);
2170 } 2380 }
2171 } 2381 }
2172 if (appendSlash) output.add(""); 2382 if (appendSlash)
2383 output.add("");
2173 return output.join("/"); 2384 return output.join("/");
2174 } 2385 }
2175 resolve(reference) { 2386 resolve(reference) {
2176 return this.resolveUri(Uri.parse(reference)); 2387 return this.resolveUri(Uri.parse(reference));
2177 } 2388 }
2178 resolveUri(reference) { 2389 resolveUri(reference) {
2179 let targetScheme = null; 2390 let targetScheme = null;
2180 let targetUserInfo = ""; 2391 let targetUserInfo = "";
2181 let targetHost = null; 2392 let targetHost = null;
2182 let targetPort = null; 2393 let targetPort = null;
(...skipping 10 matching lines...)
2193 if (reference.hasQuery) { 2404 if (reference.hasQuery) {
2194 targetQuery = reference.query; 2405 targetQuery = reference.query;
2195 } 2406 }
2196 } else { 2407 } else {
2197 targetScheme = this.scheme; 2408 targetScheme = this.scheme;
2198 if (reference.hasAuthority) { 2409 if (reference.hasAuthority) {
2199 targetUserInfo = reference.userInfo; 2410 targetUserInfo = reference.userInfo;
2200 targetHost = reference.host; 2411 targetHost = reference.host;
2201 targetPort = _makePort(dart.as(reference.hasPort ? reference.port : nu ll, int), targetScheme); 2412 targetPort = _makePort(dart.as(reference.hasPort ? reference.port : nu ll, int), targetScheme);
2202 targetPath = this._removeDotSegments(reference.path); 2413 targetPath = this._removeDotSegments(reference.path);
2203 if (reference.hasQuery) targetQuery = reference.query; 2414 if (reference.hasQuery)
2415 targetQuery = reference.query;
2204 } else { 2416 } else {
2205 if (dart.equals(reference.path, "")) { 2417 if (dart.equals(reference.path, "")) {
2206 targetPath = this._path; 2418 targetPath = this._path;
2207 if (reference.hasQuery) { 2419 if (reference.hasQuery) {
2208 targetQuery = reference.query; 2420 targetQuery = reference.query;
2209 } else { 2421 } else {
2210 targetQuery = this._query; 2422 targetQuery = this._query;
2211 } 2423 }
2212 } else { 2424 } else {
2213 if (reference.path.startsWith("/")) { 2425 if (reference.path.startsWith("/")) {
2214 targetPath = this._removeDotSegments(reference.path); 2426 targetPath = this._removeDotSegments(reference.path);
2215 } else { 2427 } else {
2216 targetPath = this._removeDotSegments(this._merge(this._path, refer ence.path)); 2428 targetPath = this._removeDotSegments(this._merge(this._path, refer ence.path));
2217 } 2429 }
2218 if (reference.hasQuery) targetQuery = reference.query; 2430 if (reference.hasQuery)
2431 targetQuery = reference.query;
2219 } 2432 }
2220 targetUserInfo = this._userInfo; 2433 targetUserInfo = this._userInfo;
2221 targetHost = this._host; 2434 targetHost = this._host;
2222 targetPort = dart.notNull(this._port); 2435 targetPort = dart.notNull(this._port);
2223 } 2436 }
2224 } 2437 }
2225 let fragment = dart.as(reference.hasFragment ? reference.fragment : null, String); 2438 let fragment = dart.as(reference.hasFragment ? reference.fragment : null, String);
2226 return new Uri._internal(targetScheme, targetUserInfo, targetHost, targetP ort, targetPath, targetQuery, fragment); 2439 return new Uri._internal(targetScheme, targetUserInfo, targetHost, targetP ort, targetPath, targetQuery, fragment);
2227 } 2440 }
2228 get hasAuthority() { return this._host !== null; } 2441 get hasAuthority() {
2229 get hasPort() { return this._port !== null; } 2442 return this._host !== null;
2230 get hasQuery() { return this._query !== null; } 2443 }
2231 get hasFragment() { return this._fragment !== null; } 2444 get hasPort() {
2445 return this._port !== null;
2446 }
2447 get hasQuery() {
2448 return this._query !== null;
2449 }
2450 get hasFragment() {
2451 return this._fragment !== null;
2452 }
2232 get origin() { 2453 get origin() {
2233 if (dart.notNull(dart.notNull(dart.equals(this.scheme, "")) || dart.notNul l(this._host === null)) || dart.notNull(dart.equals(this._host, ""))) { 2454 if (dart.notNull(dart.notNull(dart.equals(this.scheme, "")) || dart.notNul l(this._host === null)) || dart.notNull(dart.equals(this._host, ""))) {
2234 throw new StateError(`Cannot use origin without a scheme: ${this}`); 2455 throw new StateError(`Cannot use origin without a scheme: ${this}`);
2235 } 2456 }
2236 if (dart.notNull(!dart.equals(this.scheme, "http")) && dart.notNull(!dart. equals(this.scheme, "https"))) { 2457 if (dart.notNull(!dart.equals(this.scheme, "http")) && dart.notNull(!dart. equals(this.scheme, "https"))) {
2237 throw new StateError(`Origin is only applicable schemes http and https: ${this}`); 2458 throw new StateError(`Origin is only applicable schemes http and https: ${this}`);
2238 } 2459 }
2239 if (this._port === null) return `${this.scheme}://${this._host}`; 2460 if (this._port === null)
2461 return `${this.scheme}://${this._host}`;
2240 return `${this.scheme}://${this._host}:${this._port}`; 2462 return `${this.scheme}://${this._host}:${this._port}`;
2241 } 2463 }
2242 toFilePath(opt$) { 2464 toFilePath(opt$) {
2243 let windows = opt$.windows === undefined ? null : opt$.windows; 2465 let windows = opt$.windows === void 0 ? null : opt$.windows;
2244 if (dart.notNull(!dart.equals(this.scheme, "")) && dart.notNull(!dart.equa ls(this.scheme, "file"))) { 2466 if (dart.notNull(!dart.equals(this.scheme, "")) && dart.notNull(!dart.equa ls(this.scheme, "file"))) {
2245 throw new UnsupportedError(`Cannot extract a file path from a ${this.sch eme} URI`); 2467 throw new UnsupportedError(`Cannot extract a file path from a ${this.sch eme} URI`);
2246 } 2468 }
2247 if (!dart.equals(this.query, "")) { 2469 if (!dart.equals(this.query, "")) {
2248 throw new UnsupportedError("Cannot extract a file path from a URI with a query component"); 2470 throw new UnsupportedError("Cannot extract a file path from a URI with a query component");
2249 } 2471 }
2250 if (!dart.equals(this.fragment, "")) { 2472 if (!dart.equals(this.fragment, "")) {
2251 throw new UnsupportedError("Cannot extract a file path from a URI with a fragment component"); 2473 throw new UnsupportedError("Cannot extract a file path from a URI with a fragment component");
2252 } 2474 }
2253 if (windows === null) windows = _isWindows; 2475 if (windows === null)
2476 windows = _isWindows;
2254 return windows ? this._toWindowsFilePath() : this._toFilePath(); 2477 return windows ? this._toWindowsFilePath() : this._toFilePath();
2255 } 2478 }
2256 _toFilePath() { 2479 _toFilePath() {
2257 if (!dart.equals(this.host, "")) { 2480 if (!dart.equals(this.host, "")) {
2258 throw new UnsupportedError("Cannot extract a non-Windows file path from a file URI " + 2481 throw new UnsupportedError("Cannot extract a non-Windows file path from a file URI " + "with an authority");
2259 "with an authority");
2260 } 2482 }
2261 _checkNonWindowsPathReservedCharacters(this.pathSegments, false); 2483 _checkNonWindowsPathReservedCharacters(this.pathSegments, false);
2262 let result = new StringBuffer(); 2484 let result = new StringBuffer();
2263 if (this._isPathAbsolute) result.write("/"); 2485 if (this._isPathAbsolute)
2486 result.write("/");
2264 result.writeAll(this.pathSegments, "/"); 2487 result.writeAll(this.pathSegments, "/");
2265 return result.toString(); 2488 return result.toString();
2266 } 2489 }
2267 _toWindowsFilePath() { 2490 _toWindowsFilePath() {
2268 let hasDriveLetter = false; 2491 let hasDriveLetter = false;
2269 let segments = this.pathSegments; 2492 let segments = this.pathSegments;
2270 if (dart.notNull(dart.notNull(segments.length > 0) && dart.notNull(segment s.get(0).length === 2)) && dart.notNull(segments.get(0).codeUnitAt(1) === _COLON )) { 2493 if (dart.notNull(dart.notNull(segments.length > 0) && dart.notNull(segment s.get(0).length === 2)) && dart.notNull(segments.get(0).codeUnitAt(1) === _COLON )) {
2271 _checkWindowsDriveLetter(segments.get(0).codeUnitAt(0), false); 2494 _checkWindowsDriveLetter(segments.get(0).codeUnitAt(0), false);
2272 _checkWindowsPathReservedCharacters(segments, false, 1); 2495 _checkWindowsPathReservedCharacters(segments, false, 1);
2273 hasDriveLetter = true; 2496 hasDriveLetter = true;
2274 } else { 2497 } else {
2275 _checkWindowsPathReservedCharacters(segments, false); 2498 _checkWindowsPathReservedCharacters(segments, false);
2276 } 2499 }
2277 let result = new StringBuffer(); 2500 let result = new StringBuffer();
2278 if (dart.notNull(this._isPathAbsolute) && dart.notNull(!dart.notNull(hasDr iveLetter))) result.write("\\"); 2501 if (dart.notNull(this._isPathAbsolute) && dart.notNull(!dart.notNull(hasDr iveLetter)))
2502 result.write("\\");
2279 if (!dart.equals(this.host, "")) { 2503 if (!dart.equals(this.host, "")) {
2280 result.write("\\"); 2504 result.write("\\");
2281 result.write(this.host); 2505 result.write(this.host);
2282 result.write("\\"); 2506 result.write("\\");
2283 } 2507 }
2284 result.writeAll(segments, "\\"); 2508 result.writeAll(segments, "\\");
2285 if (dart.notNull(hasDriveLetter) && dart.notNull(segments.length === 1)) r esult.write("\\"); 2509 if (dart.notNull(hasDriveLetter) && dart.notNull(segments.length === 1))
2510 result.write("\\");
2286 return result.toString(); 2511 return result.toString();
2287 } 2512 }
2288 get _isPathAbsolute() { 2513 get _isPathAbsolute() {
2289 if (dart.notNull(this.path === null) || dart.notNull(this.path.isEmpty)) r eturn false; 2514 if (dart.notNull(this.path === null) || dart.notNull(this.path.isEmpty))
2515 return false;
2290 return this.path.startsWith('/'); 2516 return this.path.startsWith('/');
2291 } 2517 }
2292 _writeAuthority(ss) { 2518 _writeAuthority(ss) {
2293 if (this._userInfo.isNotEmpty) { 2519 if (this._userInfo.isNotEmpty) {
2294 ss.write(this._userInfo); 2520 ss.write(this._userInfo);
2295 ss.write("@"); 2521 ss.write("@");
2296 } 2522 }
2297 if (this._host !== null) ss.write(this._host); 2523 if (this._host !== null)
2524 ss.write(this._host);
2298 if (this._port !== null) { 2525 if (this._port !== null) {
2299 ss.write(":"); 2526 ss.write(":");
2300 ss.write(this._port); 2527 ss.write(this._port);
2301 } 2528 }
2302 } 2529 }
2303 toString() { 2530 toString() {
2304 let sb = new StringBuffer(); 2531 let sb = new StringBuffer();
2305 _addIfNonEmpty(sb, this.scheme, this.scheme, ':'); 2532 _addIfNonEmpty(sb, this.scheme, this.scheme, ':');
2306 if (dart.notNull(dart.notNull(this.hasAuthority) || dart.notNull(this.path .startsWith("//"))) || dart.notNull((dart.equals(this.scheme, "file")))) { 2533 if (dart.notNull(dart.notNull(this.hasAuthority) || dart.notNull(this.path .startsWith("//"))) || dart.notNull(dart.equals(this.scheme, "file"))) {
2307 sb.write("//"); 2534 sb.write("//");
2308 this._writeAuthority(sb); 2535 this._writeAuthority(sb);
2309 } 2536 }
2310 sb.write(this.path); 2537 sb.write(this.path);
2311 if (this._query !== null) { 2538 if (this._query !== null) {
2312 sb.write("?"); 2539 sb.write("?");
2313 sb.write(this._query); 2540 sb.write(this._query);
2314 } 2541 }
2315 if (this._fragment !== null) { 2542 if (this._fragment !== null) {
2316 sb.write("#"); 2543 sb.write("#");
2317 sb.write(this._fragment); 2544 sb.write(this._fragment);
2318 } 2545 }
2319 return sb.toString(); 2546 return sb.toString();
2320 } 2547 }
2321 ['=='](other) { 2548 ['=='](other) {
2322 if (!dart.is(other, Uri)) return false; 2549 if (!dart.is(other, Uri))
2550 return false;
2323 let uri = dart.as(other, Uri); 2551 let uri = dart.as(other, Uri);
2324 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) ); 2552 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) );
2325 } 2553 }
2326 get hashCode() { 2554 get hashCode() {
2327 // Function combine: (dynamic, dynamic) → int 2555 // Function combine: (dynamic, dynamic) → int
2328 function combine(part, current) { 2556 function combine(part, current) {
2329 return dart.as(dart.dbinary((dart.dbinary(dart.dbinary(current, "*", 31) , "+", dart.dload(part, "hashCode"))), "&", 1073741823), int); 2557 return dart.as(dart.dbinary(dart.dbinary(dart.dbinary(current, '*', 31), '+', dart.dload(part, 'hashCode')), '&', 1073741823), int);
2330 } 2558 }
2331 return combine(this.scheme, combine(this.userInfo, combine(this.host, comb ine(this.port, combine(this.path, combine(this.query, combine(this.fragment, 1)) ))))); 2559 return combine(this.scheme, combine(this.userInfo, combine(this.host, comb ine(this.port, combine(this.path, combine(this.query, combine(this.fragment, 1)) )))));
2332 } 2560 }
2333 static _addIfNonEmpty(sb, test, first, second) { 2561 static _addIfNonEmpty(sb, test, first, second) {
2334 if (!dart.equals("", test)) { 2562 if (!dart.equals("", test)) {
2335 sb.write(first); 2563 sb.write(first);
2336 sb.write(second); 2564 sb.write(second);
2337 } 2565 }
2338 } 2566 }
2339 static encodeComponent(component) { 2567 static encodeComponent(component) {
2340 return _uriEncode(dart.as(_unreserved2396Table, List$(int)), component); 2568 return _uriEncode(dart.as(_unreserved2396Table, List$(int)), component);
2341 } 2569 }
2342 static encodeQueryComponent(component, opt$) { 2570 static encodeQueryComponent(component, opt$) {
2343 let encoding = opt$.encoding === undefined ? convert.UTF8 : opt$.encoding; 2571 let encoding = opt$.encoding === void 0 ? convert.UTF8 : opt$.encoding;
2344 return _uriEncode(dart.as(_unreservedTable, List$(int)), component, {encod ing: encoding, spaceToPlus: true}); 2572 return _uriEncode(dart.as(_unreservedTable, List$(int)), component, {encod ing: encoding, spaceToPlus: true});
2345 } 2573 }
2346 static decodeComponent(encodedComponent) { 2574 static decodeComponent(encodedComponent) {
2347 return _uriDecode(encodedComponent); 2575 return _uriDecode(encodedComponent);
2348 } 2576 }
2349 static decodeQueryComponent(encodedComponent, opt$) { 2577 static decodeQueryComponent(encodedComponent, opt$) {
2350 let encoding = opt$.encoding === undefined ? convert.UTF8 : opt$.encoding; 2578 let encoding = opt$.encoding === void 0 ? convert.UTF8 : opt$.encoding;
2351 return _uriDecode(encodedComponent, {plusToSpace: true, encoding: encoding }); 2579 return _uriDecode(encodedComponent, {plusToSpace: true, encoding: encoding });
2352 } 2580 }
2353 static encodeFull(uri) { 2581 static encodeFull(uri) {
2354 return _uriEncode(dart.as(_encodeFullTable, List$(int)), uri); 2582 return _uriEncode(dart.as(_encodeFullTable, List$(int)), uri);
2355 } 2583 }
2356 static decodeFull(uri) { 2584 static decodeFull(uri) {
2357 return _uriDecode(uri); 2585 return _uriDecode(uri);
2358 } 2586 }
2359 static splitQueryString(query, opt$) { 2587 static splitQueryString(query, opt$) {
2360 let encoding = opt$.encoding === undefined ? convert.UTF8 : opt$.encoding; 2588 let encoding = opt$.encoding === void 0 ? convert.UTF8 : opt$.encoding;
2361 return dart.as(query.split("&").fold(dart.map(), (map, element) => { 2589 return dart.as(query.split("&").fold(dart.map(), (map, element) => {
2362 let index = dart.as(dart.dinvoke(element, "indexOf", "="), int); 2590 let index = dart.as(dart.dinvoke(element, 'indexOf', "="), int);
2363 if (index === -1) { 2591 if (index === -1) {
2364 if (!dart.equals(element, "")) { 2592 if (!dart.equals(element, "")) {
2365 dart.dsetindex(map, decodeQueryComponent(dart.as(element, String), { encoding: encoding}), ""); 2593 dart.dsetindex(map, decodeQueryComponent(dart.as(element, String), { encoding: encoding}), "");
2366 } 2594 }
2367 } else if (index !== 0) { 2595 } else if (index !== 0) {
2368 let key = dart.dinvoke(element, "substring", 0, index); 2596 let key = dart.dinvoke(element, 'substring', 0, index);
2369 let value = dart.dinvoke(element, "substring", index + 1); 2597 let value = dart.dinvoke(element, 'substring', index + 1);
2370 dart.dsetindex(map, Uri.decodeQueryComponent(dart.as(key, String), {en coding: encoding}), decodeQueryComponent(dart.as(value, String), {encoding: enco ding})); 2598 dart.dsetindex(map, Uri.decodeQueryComponent(dart.as(key, String), {en coding: encoding}), decodeQueryComponent(dart.as(value, String), {encoding: enco ding}));
2371 } 2599 }
2372 return map; 2600 return map;
2373 }), Map$(StringString)); 2601 }), Map$(String, String));
2374 } 2602 }
2375 static parseIPv4Address(host) { 2603 static parseIPv4Address(host) {
2376 // Function error: (String) → void 2604 // Function error: (String) → void
2377 function error(msg) { 2605 function error(msg) {
2378 throw new FormatException(`Illegal IPv4 address, ${msg}`); 2606 throw new FormatException(`Illegal IPv4 address, ${msg}`);
2379 } 2607 }
2380 let bytes = host.split('.'); 2608 let bytes = host.split('.');
2381 if (bytes.length !== 4) { 2609 if (bytes.length !== 4) {
2382 error('IPv4 address should contain exactly 4 parts'); 2610 error('IPv4 address should contain exactly 4 parts');
2383 } 2611 }
2384 return dart.as(bytes.map((byteString) => { 2612 return dart.as(bytes.map((byteString) => {
2385 let byte = int.parse(dart.as(byteString, String)); 2613 let byte = int.parse(dart.as(byteString, String));
2386 if (dart.notNull(byte < 0) || dart.notNull(byte > 255)) { 2614 if (dart.notNull(byte < 0) || dart.notNull(byte > 255)) {
2387 error('each part must be in the range of `0..255`'); 2615 error('each part must be in the range of `0..255`');
2388 } 2616 }
2389 return byte; 2617 return byte;
2390 }).toList(), List$(int)); 2618 }).toList(), List$(int));
2391 } 2619 }
2392 static parseIPv6Address(host, start, end) { 2620 static parseIPv6Address(host, start, end) {
2393 if (start === undefined) start = 0; 2621 if (start === void 0)
2394 if (end === undefined) end = null; 2622 start = 0;
2395 if (end === null) end = host.length; 2623 if (end === void 0)
2624 end = null;
2625 if (end === null)
2626 end = host.length;
2396 // Function error: (String, [dynamic]) → void 2627 // Function error: (String, [dynamic]) → void
2397 function error(msg, position) { 2628 function error(msg, position) {
2398 if (position === undefined) position = null; 2629 if (position === void 0)
2630 position = null;
2399 throw new FormatException(`Illegal IPv6 address, ${msg}`, host, position ); 2631 throw new FormatException(`Illegal IPv6 address, ${msg}`, host, position );
2400 } 2632 }
2401 // Function parseHex: (int, int) → int 2633 // Function parseHex: (int, int) → int
2402 function parseHex(start, end) { 2634 function parseHex(start, end) {
2403 if (end - start > 4) { 2635 if (end - start > 4) {
2404 error('an IPv6 part can only contain a maximum of 4 hex digits', start ); 2636 error('an IPv6 part can only contain a maximum of 4 hex digits', start );
2405 } 2637 }
2406 let value = int.parse(host.substring(start, end), {radix: 16}); 2638 let value = int.parse(host.substring(start, end), {radix: 16});
2407 if (dart.notNull(value < 0) || dart.notNull(value > (1 << 16) - 1)) { 2639 if (dart.notNull(value < 0) || dart.notNull(value > (1 << 16) - 1)) {
2408 error('each part must be in the range of `0x0..0xFFFF`', start); 2640 error('each part must be in the range of `0x0..0xFFFF`', start);
2409 } 2641 }
2410 return value; 2642 return value;
2411 } 2643 }
2412 if (host.length < 2) error('address is too short'); 2644 if (host.length < 2)
2645 error('address is too short');
2413 let parts = dart.as(new List.from([]), List$(int)); 2646 let parts = dart.as(new List.from([]), List$(int));
2414 let wildcardSeen = false; 2647 let wildcardSeen = false;
2415 let partStart = start; 2648 let partStart = start;
2416 for (let i = start; i < end; i++) { 2649 for (let i = start; i < end; i++) {
2417 if (host.codeUnitAt(i) === _COLON) { 2650 if (host.codeUnitAt(i) === _COLON) {
2418 if (i === start) { 2651 if (i === start) {
2419 i++; 2652 i++;
2420 if (host.codeUnitAt(i) !== _COLON) { 2653 if (host.codeUnitAt(i) !== _COLON) {
2421 error('invalid start colon.', i); 2654 error('invalid start colon.', i);
2422 } 2655 }
2423 partStart = i; 2656 partStart = i;
2424 } 2657 }
2425 if (i === partStart) { 2658 if (i === partStart) {
2426 if (wildcardSeen) { 2659 if (wildcardSeen) {
2427 error('only one wildcard `::` is allowed', i); 2660 error('only one wildcard `::` is allowed', i);
2428 } 2661 }
2429 wildcardSeen = true; 2662 wildcardSeen = true;
2430 parts.add(-1); 2663 parts.add(-1);
2431 } else { 2664 } else {
2432 parts.add(parseHex(partStart, i)); 2665 parts.add(parseHex(partStart, i));
2433 } 2666 }
2434 partStart = i + 1; 2667 partStart = i + 1;
2435 } 2668 }
2436 } 2669 }
2437 if (parts.length === 0) error('too few parts'); 2670 if (parts.length === 0)
2438 let atEnd = (partStart === end); 2671 error('too few parts');
2439 let isLastWildcard = (parts.last === -1); 2672 let atEnd = partStart === end;
2673 let isLastWildcard = parts.last === -1;
2440 if (dart.notNull(atEnd) && dart.notNull(!dart.notNull(isLastWildcard))) { 2674 if (dart.notNull(atEnd) && dart.notNull(!dart.notNull(isLastWildcard))) {
2441 error('expected a part after last `:`', end); 2675 error('expected a part after last `:`', end);
2442 } 2676 }
2443 if (!dart.notNull(atEnd)) { 2677 if (!dart.notNull(atEnd)) {
2444 try { 2678 try {
2445 parts.add(parseHex(partStart, end)); 2679 parts.add(parseHex(partStart, end));
2446 } 2680 } catch (e) {
2447 catch (e) {
2448 try { 2681 try {
2449 let last = parseIPv4Address(host.substring(partStart, end)); 2682 let last = parseIPv4Address(host.substring(partStart, end));
2450 parts.add(last.get(0) << 8 | last.get(1)); 2683 parts.add(last.get(0) << 8 | last.get(1));
2451 parts.add(last.get(2) << 8 | last.get(3)); 2684 parts.add(last.get(2) << 8 | last.get(3));
2452 } 2685 } catch (e) {
2453 catch (e) {
2454 error('invalid end of IPv6 address.', partStart); 2686 error('invalid end of IPv6 address.', partStart);
2455 } 2687 }
2688
2456 } 2689 }
2690
2457 } 2691 }
2458 if (wildcardSeen) { 2692 if (wildcardSeen) {
2459 if (parts.length > 7) { 2693 if (parts.length > 7) {
2460 error('an address with a wildcard must have less than 7 parts'); 2694 error('an address with a wildcard must have less than 7 parts');
2461 } 2695 }
2462 } else if (parts.length !== 8) { 2696 } else if (parts.length !== 8) {
2463 error('an address without a wildcard must contain exactly 8 parts'); 2697 error('an address without a wildcard must contain exactly 8 parts');
2464 } 2698 }
2465 let bytes = new List(16); 2699 let bytes = new List(16);
2466 for (let i = 0, index = 0; i < parts.length; i++) { 2700 for (let i = 0, index = 0; i < parts.length; i++) {
2467 let value = parts.get(i); 2701 let value = parts.get(i);
2468 if (value === -1) { 2702 if (value === -1) {
2469 let wildCardLength = 9 - parts.length; 2703 let wildCardLength = 9 - parts.length;
2470 for (let j = 0; j < wildCardLength; j++) { 2704 for (let j = 0; j < wildCardLength; j++) {
2471 bytes.set(index, 0); 2705 bytes.set(index, 0);
2472 bytes.set(index + 1, 0); 2706 bytes.set(index + 1, 0);
2473 index = 2; 2707 index = 2;
2474 } 2708 }
2475 } else { 2709 } else {
2476 bytes.set(index, value >> 8); 2710 bytes.set(index, value >> 8);
2477 bytes.set(index + 1, value & 255); 2711 bytes.set(index + 1, value & 255);
2478 index = 2; 2712 index = 2;
2479 } 2713 }
2480 } 2714 }
2481 return dart.as(bytes, List$(int)); 2715 return dart.as(bytes, List$(int));
2482 } 2716 }
2483 static _uriEncode(canonicalTable, text, opt$) { 2717 static _uriEncode(canonicalTable, text, opt$) {
2484 let encoding = opt$.encoding === undefined ? convert.UTF8 : opt$.encoding; 2718 let encoding = opt$.encoding === void 0 ? convert.UTF8 : opt$.encoding;
2485 let spaceToPlus = opt$.spaceToPlus === undefined ? false : opt$.spaceToPlu s; 2719 let spaceToPlus = opt$.spaceToPlus === void 0 ? false : opt$.spaceToPlus;
2486 // Function byteToHex: (dynamic, dynamic) → dynamic 2720 // Function byteToHex: (dynamic, dynamic) → dynamic
2487 function byteToHex(byte, buffer) { 2721 function byteToHex(byte, buffer) {
2488 let hex = '0123456789ABCDEF'; 2722 let hex = '0123456789ABCDEF';
2489 dart.dinvoke(buffer, "writeCharCode", hex.codeUnitAt(dart.as(dart.dbinar y(byte, ">>", 4), int))); 2723 dart.dinvoke(buffer, 'writeCharCode', hex.codeUnitAt(dart.as(dart.dbinar y(byte, '>>', 4), int)));
2490 dart.dinvoke(buffer, "writeCharCode", hex.codeUnitAt(dart.as(dart.dbinar y(byte, "&", 15), int))); 2724 dart.dinvoke(buffer, 'writeCharCode', hex.codeUnitAt(dart.as(dart.dbinar y(byte, '&', 15), int)));
2491 } 2725 }
2492 let result = new StringBuffer(); 2726 let result = new StringBuffer();
2493 let bytes = encoding.encode(text); 2727 let bytes = encoding.encode(text);
2494 for (let i = 0; i < bytes.length; i++) { 2728 for (let i = 0; i < bytes.length; i++) {
2495 let byte = bytes.get(i); 2729 let byte = bytes.get(i);
2496 if (dart.notNull(byte < 128) && dart.notNull(((canonicalTable.get(byte > > 4) & (1 << (byte & 15))) !== 0))) { 2730 if (dart.notNull(byte < 128) && dart.notNull((canonicalTable.get(byte >> 4) & 1 << (byte & 15)) !== 0)) {
2497 result.writeCharCode(byte); 2731 result.writeCharCode(byte);
2498 } else if (dart.notNull(spaceToPlus) && dart.notNull(byte === _SPACE)) { 2732 } else if (dart.notNull(spaceToPlus) && dart.notNull(byte === _SPACE)) {
2499 result.writeCharCode(_PLUS); 2733 result.writeCharCode(_PLUS);
2500 } else { 2734 } else {
2501 result.writeCharCode(_PERCENT); 2735 result.writeCharCode(_PERCENT);
2502 byteToHex(byte, result); 2736 byteToHex(byte, result);
2503 } 2737 }
2504 } 2738 }
2505 return result.toString(); 2739 return result.toString();
2506 } 2740 }
2507 static _hexCharPairToByte(s, pos) { 2741 static _hexCharPairToByte(s, pos) {
2508 let byte = 0; 2742 let byte = 0;
2509 for (let i = 0; i < 2; i++) { 2743 for (let i = 0; i < 2; i++) {
2510 let charCode = s.codeUnitAt(pos + i); 2744 let charCode = s.codeUnitAt(pos + i);
2511 if (dart.notNull(48 <= charCode) && dart.notNull(charCode <= 57)) { 2745 if (dart.notNull(48 <= charCode) && dart.notNull(charCode <= 57)) {
2512 byte = byte * 16 + charCode - 48; 2746 byte = byte * 16 + charCode - 48;
2513 } else { 2747 } else {
2514 charCode = 32; 2748 charCode = 32;
2515 if (dart.notNull(97 <= charCode) && dart.notNull(charCode <= 102)) { 2749 if (dart.notNull(97 <= charCode) && dart.notNull(charCode <= 102)) {
2516 byte = byte * 16 + charCode - 87; 2750 byte = byte * 16 + charCode - 87;
2517 } else { 2751 } else {
2518 throw new ArgumentError("Invalid URL encoding"); 2752 throw new ArgumentError("Invalid URL encoding");
2519 } 2753 }
2520 } 2754 }
2521 } 2755 }
2522 return byte; 2756 return byte;
2523 } 2757 }
2524 static _uriDecode(text, opt$) { 2758 static _uriDecode(text, opt$) {
2525 let plusToSpace = opt$.plusToSpace === undefined ? false : opt$.plusToSpac e; 2759 let plusToSpace = opt$.plusToSpace === void 0 ? false : opt$.plusToSpace;
2526 let encoding = opt$.encoding === undefined ? convert.UTF8 : opt$.encoding; 2760 let encoding = opt$.encoding === void 0 ? convert.UTF8 : opt$.encoding;
2527 let simple = true; 2761 let simple = true;
2528 for (let i = 0; dart.notNull(i < text.length) && dart.notNull(simple); i++ ) { 2762 for (let i = 0; dart.notNull(i < text.length) && dart.notNull(simple); i++ ) {
2529 let codeUnit = text.codeUnitAt(i); 2763 let codeUnit = text.codeUnitAt(i);
2530 simple = dart.notNull(codeUnit !== _PERCENT) && dart.notNull(codeUnit != = _PLUS); 2764 simple = dart.notNull(codeUnit !== _PERCENT) && dart.notNull(codeUnit != = _PLUS);
2531 } 2765 }
2532 let bytes = null; 2766 let bytes = null;
2533 if (simple) { 2767 if (simple) {
2534 if (dart.notNull(dart.equals(encoding, convert.UTF8)) || dart.notNull(da rt.equals(encoding, convert.LATIN1))) { 2768 if (dart.notNull(dart.equals(encoding, convert.UTF8)) || dart.notNull(da rt.equals(encoding, convert.LATIN1))) {
2535 return text; 2769 return text;
2536 } else { 2770 } else {
(...skipping 14 matching lines...)
2551 i = 2; 2785 i = 2;
2552 } else if (dart.notNull(plusToSpace) && dart.notNull(codeUnit === _PLU S)) { 2786 } else if (dart.notNull(plusToSpace) && dart.notNull(codeUnit === _PLU S)) {
2553 bytes.add(_SPACE); 2787 bytes.add(_SPACE);
2554 } else { 2788 } else {
2555 bytes.add(codeUnit); 2789 bytes.add(codeUnit);
2556 } 2790 }
2557 } 2791 }
2558 } 2792 }
2559 return encoding.decode(bytes); 2793 return encoding.decode(bytes);
2560 } 2794 }
2561 static _isAlphabeticCharacter(codeUnit) { return dart.notNull((dart.notNull( codeUnit >= _LOWER_CASE_A) && dart.notNull(codeUnit <= _LOWER_CASE_Z))) || dart. notNull((dart.notNull(codeUnit >= _UPPER_CASE_A) && dart.notNull(codeUnit <= _UP PER_CASE_Z))); } 2795 static _isAlphabeticCharacter(codeUnit) {
2796 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));
2797 }
2562 } 2798 }
2563 dart.defineNamedConstructor(Uri, "_internal"); 2799 dart.defineNamedConstructor(Uri, '_internal');
2564 dart.defineNamedConstructor(Uri, "http"); 2800 dart.defineNamedConstructor(Uri, 'http');
2565 dart.defineNamedConstructor(Uri, "https"); 2801 dart.defineNamedConstructor(Uri, 'https');
2566 dart.defineNamedConstructor(Uri, "file"); 2802 dart.defineNamedConstructor(Uri, 'file');
2567 Uri._SPACE = 32; 2803 Uri._SPACE = 32;
2568 Uri._DOUBLE_QUOTE = 34; 2804 Uri._DOUBLE_QUOTE = 34;
2569 Uri._NUMBER_SIGN = 35; 2805 Uri._NUMBER_SIGN = 35;
2570 Uri._PERCENT = 37; 2806 Uri._PERCENT = 37;
2571 Uri._ASTERISK = 42; 2807 Uri._ASTERISK = 42;
2572 Uri._PLUS = 43; 2808 Uri._PLUS = 43;
2573 Uri._DOT = 46; 2809 Uri._DOT = 46;
2574 Uri._SLASH = 47; 2810 Uri._SLASH = 47;
2575 Uri._ZERO = 48; 2811 Uri._ZERO = 48;
2576 Uri._NINE = 57; 2812 Uri._NINE = 57;
(...skipping 17 matching lines...)
2594 Uri._encodeFullTable = /* Unimplemented const */new List.from([0, 0, 65498, 45 055, 65535, 34815, 65534, 18431]); 2830 Uri._encodeFullTable = /* Unimplemented const */new List.from([0, 0, 65498, 45 055, 65535, 34815, 65534, 18431]);
2595 Uri._schemeTable = /* Unimplemented const */new List.from([0, 0, 26624, 1023, 65534, 2047, 65534, 2047]); 2831 Uri._schemeTable = /* Unimplemented const */new List.from([0, 0, 26624, 1023, 65534, 2047, 65534, 2047]);
2596 Uri._schemeLowerTable = /* Unimplemented const */new List.from([0, 0, 26624, 1 023, 0, 0, 65534, 2047]); 2832 Uri._schemeLowerTable = /* Unimplemented const */new List.from([0, 0, 26624, 1 023, 0, 0, 65534, 2047]);
2597 Uri._subDelimitersTable = /* Unimplemented const */new List.from([0, 0, 32722, 11263, 65534, 34815, 65534, 18431]); 2833 Uri._subDelimitersTable = /* Unimplemented const */new List.from([0, 0, 32722, 11263, 65534, 34815, 65534, 18431]);
2598 Uri._genDelimitersTable = /* Unimplemented const */new List.from([0, 0, 32776, 33792, 1, 10240, 0, 0]); 2834 Uri._genDelimitersTable = /* Unimplemented const */new List.from([0, 0, 32776, 33792, 1, 10240, 0, 0]);
2599 Uri._userinfoTable = /* Unimplemented const */new List.from([0, 0, 32722, 1228 7, 65534, 34815, 65534, 18431]); 2835 Uri._userinfoTable = /* Unimplemented const */new List.from([0, 0, 32722, 1228 7, 65534, 34815, 65534, 18431]);
2600 Uri._regNameTable = /* Unimplemented const */new List.from([0, 0, 32754, 11263 , 65534, 34815, 65534, 18431]); 2836 Uri._regNameTable = /* Unimplemented const */new List.from([0, 0, 32754, 11263 , 65534, 34815, 65534, 18431]);
2601 Uri._pathCharTable = /* Unimplemented const */new List.from([0, 0, 32722, 1228 7, 65535, 34815, 65534, 18431]); 2837 Uri._pathCharTable = /* Unimplemented const */new List.from([0, 0, 32722, 1228 7, 65535, 34815, 65534, 18431]);
2602 Uri._pathCharOrSlashTable = /* Unimplemented const */new List.from([0, 0, 6549 0, 12287, 65535, 34815, 65534, 18431]); 2838 Uri._pathCharOrSlashTable = /* Unimplemented const */new List.from([0, 0, 6549 0, 12287, 65535, 34815, 65534, 18431]);
2603 Uri._queryCharTable = /* Unimplemented const */new List.from([0, 0, 65490, 450 55, 65535, 34815, 65534, 18431]); 2839 Uri._queryCharTable = /* Unimplemented const */new List.from([0, 0, 65490, 450 55, 65535, 34815, 65534, 18431]);
2604
2605 // Exports: 2840 // Exports:
2606 core.Deprecated = Deprecated; 2841 core.Deprecated = Deprecated;
2607 core.deprecated = deprecated; 2842 core.deprecated = deprecated;
2608 core.override = override; 2843 core.override = override;
2609 core.proxy = proxy; 2844 core.proxy = proxy;
2610 core.bool = bool; 2845 core.bool = bool;
2611 core.Comparable = Comparable; 2846 core.Comparable = Comparable;
2612 core.Comparable$ = Comparable$; 2847 core.Comparable$ = Comparable$;
2613 core.DateTime = DateTime; 2848 core.DateTime = DateTime;
2614 core.double = double; 2849 core.double = double;
(...skipping 51 matching lines...)
2666 core.Stopwatch = Stopwatch; 2901 core.Stopwatch = Stopwatch;
2667 core.String = String; 2902 core.String = String;
2668 core.Runes = Runes; 2903 core.Runes = Runes;
2669 core.RuneIterator = RuneIterator; 2904 core.RuneIterator = RuneIterator;
2670 core.StringBuffer = StringBuffer; 2905 core.StringBuffer = StringBuffer;
2671 core.StringSink = StringSink; 2906 core.StringSink = StringSink;
2672 core.Symbol = Symbol; 2907 core.Symbol = Symbol;
2673 core.Type = Type; 2908 core.Type = Type;
2674 core.Uri = Uri; 2909 core.Uri = Uri;
2675 })(core || (core = {})); 2910 })(core || (core = {}));
OLDNEW
« no previous file with comments | « test/codegen/expect/convert/convert.js ('k') | test/codegen/expect/dom/dom.js » ('j') | no next file with comments »

Powered by Google App Engine