| OLD | NEW |
| 1 dart_library.library('dart/core', null, /* Imports */[ | 1 dart_library.library('dart/core', null, /* Imports */[ |
| 2 "dart_runtime/dart" | 2 "dart_runtime/dart" |
| 3 ], /* Lazy imports */[ | 3 ], /* Lazy imports */[ |
| 4 'dart/_js_helper', | 4 'dart/_js_helper', |
| 5 'dart/_internal', | 5 'dart/_internal', |
| 6 'dart/collection', | 6 'dart/collection', |
| 7 'dart/_interceptors', | 7 'dart/_interceptors', |
| 8 'dart/convert' | 8 'dart/convert' |
| 9 ], function(exports, dart, _js_helper, _internal, collection, _interceptors, con
vert) { | 9 ], function(exports, dart, _js_helper, _internal, collection, _interceptors, con
vert) { |
| 10 'use strict'; | 10 'use strict'; |
| 11 let dartx = dart.dartx; | 11 let dartx = dart.dartx; |
| 12 class Object { | 12 class Object { |
| 13 constructor() { | 13 constructor() { |
| 14 let name = this.constructor.name; | 14 let name = this.constructor.name; |
| 15 let result = void 0; | 15 let result = void 0; |
| 16 if (name in this) | 16 if (name in this) |
| 17 result = this[name](...arguments); | 17 result = this[name](...arguments); |
| 18 return result === void 0 ? this : result; | 18 return result === void 0 ? this : result; |
| 19 } | 19 } |
| 20 ['=='](other) { | 20 ['=='](other) { |
| 21 return identical(this, other); | 21 return dart.dcall(identical, this, other); |
| 22 } | 22 } |
| 23 get hashCode() { | 23 get hashCode() { |
| 24 return _js_helper.Primitives.objectHashCode(this); | 24 return dart.dcall(_js_helper.Primitives.objectHashCode, this); |
| 25 } | 25 } |
| 26 toString() { | 26 toString() { |
| 27 return _js_helper.Primitives.objectToString(this); | 27 return dart.dcall(_js_helper.Primitives.objectToString, this); |
| 28 } | 28 } |
| 29 noSuchMethod(invocation) { | 29 noSuchMethod(invocation) { |
| 30 dart.throw(new NoSuchMethodError(this, invocation.memberName, invocation.p
ositionalArguments, invocation.namedArguments)); | 30 dart.throw(new NoSuchMethodError(this, invocation.memberName, invocation.p
ositionalArguments, invocation.namedArguments)); |
| 31 } | 31 } |
| 32 get runtimeType() { | 32 get runtimeType() { |
| 33 return dart.realRuntimeType(this); | 33 return dart.as(dart.realRuntimeType(this), Type); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 dart.setSignature(Object, { | 36 dart.setSignature(Object, { |
| 37 constructors: () => ({Object: [Object, []]}), | 37 constructors: () => ({Object: [Object, []]}), |
| 38 methods: () => ({ | 38 methods: () => ({ |
| 39 '==': [bool, [dart.dynamic]], | 39 '==': [bool, [dart.dynamic]], |
| 40 toString: [String, []], | 40 toString: [String, []], |
| 41 noSuchMethod: [dart.dynamic, [Invocation]] | 41 noSuchMethod: [dart.dynamic, [Invocation]] |
| 42 }) | 42 }) |
| 43 }); | 43 }); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 constructors: () => ({fromEnvironment: [bool, [String], {defaultValue: bool}
]}) | 85 constructors: () => ({fromEnvironment: [bool, [String], {defaultValue: bool}
]}) |
| 86 }); | 86 }); |
| 87 let Comparator$ = dart.generic(function(T) { | 87 let Comparator$ = dart.generic(function(T) { |
| 88 let Comparator = dart.typedef('Comparator', () => dart.functionType(int, [T,
T])); | 88 let Comparator = dart.typedef('Comparator', () => dart.functionType(int, [T,
T])); |
| 89 return Comparator; | 89 return Comparator; |
| 90 }); | 90 }); |
| 91 let Comparator = Comparator$(); | 91 let Comparator = Comparator$(); |
| 92 let Comparable$ = dart.generic(function(T) { | 92 let Comparable$ = dart.generic(function(T) { |
| 93 class Comparable extends Object { | 93 class Comparable extends Object { |
| 94 static compare(a, b) { | 94 static compare(a, b) { |
| 95 return a[dartx.compareTo](b); | 95 return dart.dcall(a[dartx.compareTo], b); |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 dart.setSignature(Comparable, { | 98 dart.setSignature(Comparable, { |
| 99 statics: () => ({compare: [int, [Comparable$(), Comparable$()]]}), | 99 statics: () => ({compare: [int, [Comparable$(), Comparable$()]]}), |
| 100 names: ['compare'] | 100 names: ['compare'] |
| 101 }); | 101 }); |
| 102 return Comparable; | 102 return Comparable; |
| 103 }); | 103 }); |
| 104 let Comparable = Comparable$(); | 104 let Comparable = Comparable$(); |
| 105 class DateTime extends Object { | 105 class DateTime extends Object { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 131 second = 0; | 131 second = 0; |
| 132 if (millisecond === void 0) | 132 if (millisecond === void 0) |
| 133 millisecond = 0; | 133 millisecond = 0; |
| 134 this._internal(year, month, day, hour, minute, second, millisecond, true); | 134 this._internal(year, month, day, hour, minute, second, millisecond, true); |
| 135 } | 135 } |
| 136 now() { | 136 now() { |
| 137 this._now(); | 137 this._now(); |
| 138 } | 138 } |
| 139 static parse(formattedString) { | 139 static parse(formattedString) { |
| 140 let re = RegExp.new('^([+-]?\\d{4,6})-?(\\d\\d)-?(\\d\\d)' + '(?:[ T](\\d\
\d)(?::?(\\d\\d)(?::?(\\d\\d)(.\\d{1,6})?)?)?' + '( ?[zZ]| ?([-+])(\\d\\d)(?::?(
\\d\\d))?)?)?$'); | 140 let re = RegExp.new('^([+-]?\\d{4,6})-?(\\d\\d)-?(\\d\\d)' + '(?:[ T](\\d\
\d)(?::?(\\d\\d)(?::?(\\d\\d)(.\\d{1,6})?)?)?' + '( ?[zZ]| ?([-+])(\\d\\d)(?::?(
\\d\\d))?)?)?$'); |
| 141 let match = re.firstMatch(formattedString); | 141 let match = dart.dcall(re.firstMatch, formattedString); |
| 142 if (match != null) { | 142 if (match != null) { |
| 143 function parseIntOrZero(matched) { | 143 function parseIntOrZero(matched) { |
| 144 if (matched == null) | 144 if (matched == null) |
| 145 return 0; | 145 return 0; |
| 146 return int.parse(matched); | 146 return dart.dcall(int.parse, matched); |
| 147 } | 147 } |
| 148 dart.fn(parseIntOrZero, int, [String]); | 148 dart.fn(parseIntOrZero, int, [String]); |
| 149 function parseDoubleOrZero(matched) { | 149 function parseDoubleOrZero(matched) { |
| 150 if (matched == null) | 150 if (matched == null) |
| 151 return 0.0; | 151 return 0.0; |
| 152 return double.parse(matched); | 152 return dart.dcall(double.parse, matched); |
| 153 } | 153 } |
| 154 dart.fn(parseDoubleOrZero, double, [String]); | 154 dart.fn(parseDoubleOrZero, double, [String]); |
| 155 let years = int.parse(match.get(1)); | 155 let years = dart.dcall(int.parse, match.get(1)); |
| 156 let month = int.parse(match.get(2)); | 156 let month = dart.dcall(int.parse, match.get(2)); |
| 157 let day = int.parse(match.get(3)); | 157 let day = dart.dcall(int.parse, match.get(3)); |
| 158 let hour = parseIntOrZero(match.get(4)); | 158 let hour = dart.dcall(parseIntOrZero, match.get(4)); |
| 159 let minute = parseIntOrZero(match.get(5)); | 159 let minute = dart.dcall(parseIntOrZero, match.get(5)); |
| 160 let second = parseIntOrZero(match.get(6)); | 160 let second = dart.dcall(parseIntOrZero, match.get(6)); |
| 161 let addOneMillisecond = false; | 161 let addOneMillisecond = false; |
| 162 let millisecond = (dart.notNull(parseDoubleOrZero(match.get(7))) * 1000)
[dartx.round](); | 162 let millisecond = dart.dcall((dart.notNull(dart.dcall(parseDoubleOrZero,
match.get(7))) * 1000)[dartx.round]); |
| 163 if (millisecond == 1000) { | 163 if (millisecond == 1000) { |
| 164 addOneMillisecond = true; | 164 addOneMillisecond = true; |
| 165 millisecond = 999; | 165 millisecond = 999; |
| 166 } | 166 } |
| 167 let isUtc = false; | 167 let isUtc = false; |
| 168 if (match.get(8) != null) { | 168 if (match.get(8) != null) { |
| 169 isUtc = true; | 169 isUtc = true; |
| 170 if (match.get(9) != null) { | 170 if (match.get(9) != null) { |
| 171 let sign = match.get(9) == '-' ? -1 : 1; | 171 let sign = match.get(9) == '-' ? -1 : 1; |
| 172 let hourDifference = int.parse(match.get(10)); | 172 let hourDifference = dart.dcall(int.parse, match.get(10)); |
| 173 let minuteDifference = parseIntOrZero(match.get(11)); | 173 let minuteDifference = dart.dcall(parseIntOrZero, match.get(11)); |
| 174 minuteDifference = dart.notNull(minuteDifference) + 60 * dart.notNul
l(hourDifference); | 174 minuteDifference = dart.notNull(minuteDifference) + 60 * dart.notNul
l(hourDifference); |
| 175 minute = dart.notNull(minute) - dart.notNull(sign) * dart.notNull(mi
nuteDifference); | 175 minute = dart.notNull(minute) - dart.notNull(sign) * dart.notNull(mi
nuteDifference); |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 let millisecondsSinceEpoch = DateTime._brokenDownDateToMillisecondsSince
Epoch(years, month, day, hour, minute, second, millisecond, isUtc); | 178 let millisecondsSinceEpoch = dart.dcall(DateTime._brokenDownDateToMillis
econdsSinceEpoch, years, month, day, hour, minute, second, millisecond, isUtc); |
| 179 if (millisecondsSinceEpoch == null) { | 179 if (millisecondsSinceEpoch == null) { |
| 180 dart.throw(new FormatException("Time out of range", formattedString)); | 180 dart.throw(new FormatException("Time out of range", formattedString)); |
| 181 } | 181 } |
| 182 if (dart.notNull(addOneMillisecond)) { | 182 if (dart.notNull(addOneMillisecond)) { |
| 183 millisecondsSinceEpoch = dart.notNull(millisecondsSinceEpoch) + 1; | 183 millisecondsSinceEpoch = dart.notNull(millisecondsSinceEpoch) + 1; |
| 184 } | 184 } |
| 185 return new DateTime.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, {
isUtc: isUtc}); | 185 return new DateTime.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, {
isUtc: isUtc}); |
| 186 } else { | 186 } else { |
| 187 dart.throw(new FormatException("Invalid date format", formattedString)); | 187 dart.throw(new FormatException("Invalid date format", formattedString)); |
| 188 } | 188 } |
| 189 } | 189 } |
| 190 fromMillisecondsSinceEpoch(millisecondsSinceEpoch, opts) { | 190 fromMillisecondsSinceEpoch(millisecondsSinceEpoch, opts) { |
| 191 let isUtc = opts && 'isUtc' in opts ? opts.isUtc : false; | 191 let isUtc = opts && 'isUtc' in opts ? opts.isUtc : false; |
| 192 this.millisecondsSinceEpoch = millisecondsSinceEpoch; | 192 this.millisecondsSinceEpoch = millisecondsSinceEpoch; |
| 193 this.isUtc = isUtc; | 193 this.isUtc = isUtc; |
| 194 if (dart.notNull(millisecondsSinceEpoch[dartx.abs]()) > dart.notNull(DateT
ime._MAX_MILLISECONDS_SINCE_EPOCH)) { | 194 if (dart.notNull(dart.dcall(millisecondsSinceEpoch[dartx.abs])) > dart.not
Null(DateTime._MAX_MILLISECONDS_SINCE_EPOCH)) { |
| 195 dart.throw(new ArgumentError(millisecondsSinceEpoch)); | 195 dart.throw(new ArgumentError(millisecondsSinceEpoch)); |
| 196 } | 196 } |
| 197 if (isUtc == null) | 197 if (isUtc == null) |
| 198 dart.throw(new ArgumentError(isUtc)); | 198 dart.throw(new ArgumentError(isUtc)); |
| 199 } | 199 } |
| 200 ['=='](other) { | 200 ['=='](other) { |
| 201 if (!dart.is(other, DateTime)) | 201 if (!dart.is(other, DateTime)) |
| 202 return false; | 202 return false; |
| 203 return dart.equals(this.millisecondsSinceEpoch, dart.dload(other, 'millise
condsSinceEpoch')) && dart.equals(this.isUtc, dart.dload(other, 'isUtc')); | 203 return dart.equals(this.millisecondsSinceEpoch, dart.dload(other, 'millise
condsSinceEpoch')) && dart.equals(this.isUtc, dart.dload(other, 'isUtc')); |
| 204 } | 204 } |
| 205 isBefore(other) { | 205 isBefore(other) { |
| 206 return dart.notNull(this.millisecondsSinceEpoch) < dart.notNull(other.mill
isecondsSinceEpoch); | 206 return dart.notNull(this.millisecondsSinceEpoch) < dart.notNull(other.mill
isecondsSinceEpoch); |
| 207 } | 207 } |
| 208 isAfter(other) { | 208 isAfter(other) { |
| 209 return dart.notNull(this.millisecondsSinceEpoch) > dart.notNull(other.mill
isecondsSinceEpoch); | 209 return dart.notNull(this.millisecondsSinceEpoch) > dart.notNull(other.mill
isecondsSinceEpoch); |
| 210 } | 210 } |
| 211 isAtSameMomentAs(other) { | 211 isAtSameMomentAs(other) { |
| 212 return this.millisecondsSinceEpoch == other.millisecondsSinceEpoch; | 212 return this.millisecondsSinceEpoch == other.millisecondsSinceEpoch; |
| 213 } | 213 } |
| 214 compareTo(other) { | 214 compareTo(other) { |
| 215 return this.millisecondsSinceEpoch[dartx.compareTo](other.millisecondsSinc
eEpoch); | 215 return dart.dcall(this.millisecondsSinceEpoch[dartx.compareTo], other.mill
isecondsSinceEpoch); |
| 216 } | 216 } |
| 217 get hashCode() { | 217 get hashCode() { |
| 218 return this.millisecondsSinceEpoch; | 218 return this.millisecondsSinceEpoch; |
| 219 } | 219 } |
| 220 toLocal() { | 220 toLocal() { |
| 221 if (dart.notNull(this.isUtc)) { | 221 if (dart.notNull(this.isUtc)) { |
| 222 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpo
ch, {isUtc: false}); | 222 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpo
ch, {isUtc: false}); |
| 223 } | 223 } |
| 224 return this; | 224 return this; |
| 225 } | 225 } |
| 226 toUtc() { | 226 toUtc() { |
| 227 if (dart.notNull(this.isUtc)) | 227 if (dart.notNull(this.isUtc)) |
| 228 return this; | 228 return this; |
| 229 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpoch
, {isUtc: true}); | 229 return new DateTime.fromMillisecondsSinceEpoch(this.millisecondsSinceEpoch
, {isUtc: true}); |
| 230 } | 230 } |
| 231 static _fourDigits(n) { | 231 static _fourDigits(n) { |
| 232 let absN = n[dartx.abs](); | 232 let absN = dart.dcall(n[dartx.abs]); |
| 233 let sign = dart.notNull(n) < 0 ? "-" : ""; | 233 let sign = dart.notNull(n) < 0 ? "-" : ""; |
| 234 if (dart.notNull(absN) >= 1000) | 234 if (dart.notNull(absN) >= 1000) |
| 235 return `${n}`; | 235 return `${n}`; |
| 236 if (dart.notNull(absN) >= 100) | 236 if (dart.notNull(absN) >= 100) |
| 237 return `${sign}0${absN}`; | 237 return `${sign}0${absN}`; |
| 238 if (dart.notNull(absN) >= 10) | 238 if (dart.notNull(absN) >= 10) |
| 239 return `${sign}00${absN}`; | 239 return `${sign}00${absN}`; |
| 240 return `${sign}000${absN}`; | 240 return `${sign}000${absN}`; |
| 241 } | 241 } |
| 242 static _sixDigits(n) { | 242 static _sixDigits(n) { |
| 243 dart.assert(dart.notNull(n) < -9999 || dart.notNull(n) > 9999); | 243 dart.assert(dart.notNull(n) < -9999 || dart.notNull(n) > 9999); |
| 244 let absN = n[dartx.abs](); | 244 let absN = dart.dcall(n[dartx.abs]); |
| 245 let sign = dart.notNull(n) < 0 ? "-" : "+"; | 245 let sign = dart.notNull(n) < 0 ? "-" : "+"; |
| 246 if (dart.notNull(absN) >= 100000) | 246 if (dart.notNull(absN) >= 100000) |
| 247 return `${sign}${absN}`; | 247 return `${sign}${absN}`; |
| 248 return `${sign}0${absN}`; | 248 return `${sign}0${absN}`; |
| 249 } | 249 } |
| 250 static _threeDigits(n) { | 250 static _threeDigits(n) { |
| 251 if (dart.notNull(n) >= 100) | 251 if (dart.notNull(n) >= 100) |
| 252 return `${n}`; | 252 return `${n}`; |
| 253 if (dart.notNull(n) >= 10) | 253 if (dart.notNull(n) >= 10) |
| 254 return `0${n}`; | 254 return `0${n}`; |
| 255 return `00${n}`; | 255 return `00${n}`; |
| 256 } | 256 } |
| 257 static _twoDigits(n) { | 257 static _twoDigits(n) { |
| 258 if (dart.notNull(n) >= 10) | 258 if (dart.notNull(n) >= 10) |
| 259 return `${n}`; | 259 return `${n}`; |
| 260 return `0${n}`; | 260 return `0${n}`; |
| 261 } | 261 } |
| 262 toString() { | 262 toString() { |
| 263 let y = DateTime._fourDigits(this.year); | 263 let y = dart.dcall(DateTime._fourDigits, this.year); |
| 264 let m = DateTime._twoDigits(this.month); | 264 let m = dart.dcall(DateTime._twoDigits, this.month); |
| 265 let d = DateTime._twoDigits(this.day); | 265 let d = dart.dcall(DateTime._twoDigits, this.day); |
| 266 let h = DateTime._twoDigits(this.hour); | 266 let h = dart.dcall(DateTime._twoDigits, this.hour); |
| 267 let min = DateTime._twoDigits(this.minute); | 267 let min = dart.dcall(DateTime._twoDigits, this.minute); |
| 268 let sec = DateTime._twoDigits(this.second); | 268 let sec = dart.dcall(DateTime._twoDigits, this.second); |
| 269 let ms = DateTime._threeDigits(this.millisecond); | 269 let ms = dart.dcall(DateTime._threeDigits, this.millisecond); |
| 270 if (dart.notNull(this.isUtc)) { | 270 if (dart.notNull(this.isUtc)) { |
| 271 return `${y}-${m}-${d} ${h}:${min}:${sec}.${ms}Z`; | 271 return `${y}-${m}-${d} ${h}:${min}:${sec}.${ms}Z`; |
| 272 } else { | 272 } else { |
| 273 return `${y}-${m}-${d} ${h}:${min}:${sec}.${ms}`; | 273 return `${y}-${m}-${d} ${h}:${min}:${sec}.${ms}`; |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 toIso8601String() { | 276 toIso8601String() { |
| 277 let y = dart.notNull(this.year) >= -9999 && dart.notNull(this.year) <= 999
9 ? DateTime._fourDigits(this.year) : DateTime._sixDigits(this.year); | 277 let y = dart.notNull(this.year) >= -9999 && dart.notNull(this.year) <= 999
9 ? dart.dcall(DateTime._fourDigits, this.year) : dart.dcall(DateTime._sixDigits
, this.year); |
| 278 let m = DateTime._twoDigits(this.month); | 278 let m = dart.dcall(DateTime._twoDigits, this.month); |
| 279 let d = DateTime._twoDigits(this.day); | 279 let d = dart.dcall(DateTime._twoDigits, this.day); |
| 280 let h = DateTime._twoDigits(this.hour); | 280 let h = dart.dcall(DateTime._twoDigits, this.hour); |
| 281 let min = DateTime._twoDigits(this.minute); | 281 let min = dart.dcall(DateTime._twoDigits, this.minute); |
| 282 let sec = DateTime._twoDigits(this.second); | 282 let sec = dart.dcall(DateTime._twoDigits, this.second); |
| 283 let ms = DateTime._threeDigits(this.millisecond); | 283 let ms = dart.dcall(DateTime._threeDigits, this.millisecond); |
| 284 if (dart.notNull(this.isUtc)) { | 284 if (dart.notNull(this.isUtc)) { |
| 285 return `${y}-${m}-${d}T${h}:${min}:${sec}.${ms}Z`; | 285 return `${y}-${m}-${d}T${h}:${min}:${sec}.${ms}Z`; |
| 286 } else { | 286 } else { |
| 287 return `${y}-${m}-${d}T${h}:${min}:${sec}.${ms}`; | 287 return `${y}-${m}-${d}T${h}:${min}:${sec}.${ms}`; |
| 288 } | 288 } |
| 289 } | 289 } |
| 290 add(duration) { | 290 add(duration) { |
| 291 let ms = this.millisecondsSinceEpoch; | 291 let ms = this.millisecondsSinceEpoch; |
| 292 return new DateTime.fromMillisecondsSinceEpoch(dart.notNull(ms) + dart.not
Null(duration.inMilliseconds), {isUtc: this.isUtc}); | 292 return new DateTime.fromMillisecondsSinceEpoch(dart.notNull(ms) + dart.not
Null(duration.inMilliseconds), {isUtc: this.isUtc}); |
| 293 } | 293 } |
| 294 subtract(duration) { | 294 subtract(duration) { |
| 295 let ms = this.millisecondsSinceEpoch; | 295 let ms = this.millisecondsSinceEpoch; |
| 296 return new DateTime.fromMillisecondsSinceEpoch(dart.notNull(ms) - dart.not
Null(duration.inMilliseconds), {isUtc: this.isUtc}); | 296 return new DateTime.fromMillisecondsSinceEpoch(dart.notNull(ms) - dart.not
Null(duration.inMilliseconds), {isUtc: this.isUtc}); |
| 297 } | 297 } |
| 298 difference(other) { | 298 difference(other) { |
| 299 let ms = this.millisecondsSinceEpoch; | 299 let ms = this.millisecondsSinceEpoch; |
| 300 let otherMs = other.millisecondsSinceEpoch; | 300 let otherMs = other.millisecondsSinceEpoch; |
| 301 return new Duration({milliseconds: dart.notNull(ms) - dart.notNull(otherMs
)}); | 301 return new Duration({milliseconds: dart.notNull(ms) - dart.notNull(otherMs
)}); |
| 302 } | 302 } |
| 303 _internal(year, month, day, hour, minute, second, millisecond, isUtc) { | 303 _internal(year, month, day, hour, minute, second, millisecond, isUtc) { |
| 304 this.isUtc = typeof isUtc == 'boolean' ? isUtc : dart.throw(new ArgumentEr
ror(isUtc)); | 304 this.isUtc = typeof isUtc == 'boolean' ? isUtc : dart.throw(new ArgumentEr
ror(isUtc)); |
| 305 this.millisecondsSinceEpoch = dart.as(_js_helper.checkInt(_js_helper.Primi
tives.valueFromDecomposedDate(year, month, day, hour, minute, second, millisecon
d, isUtc)), int); | 305 this.millisecondsSinceEpoch = dart.as(dart.dcall(_js_helper.checkInt, dart
.dcall(_js_helper.Primitives.valueFromDecomposedDate, year, month, day, hour, mi
nute, second, millisecond, isUtc)), int); |
| 306 } | 306 } |
| 307 _now() { | 307 _now() { |
| 308 this.isUtc = false; | 308 this.isUtc = false; |
| 309 this.millisecondsSinceEpoch = _js_helper.Primitives.dateNow(); | 309 this.millisecondsSinceEpoch = dart.dcall(_js_helper.Primitives.dateNow); |
| 310 } | 310 } |
| 311 static _brokenDownDateToMillisecondsSinceEpoch(year, month, day, hour, minut
e, second, millisecond, isUtc) { | 311 static _brokenDownDateToMillisecondsSinceEpoch(year, month, day, hour, minut
e, second, millisecond, isUtc) { |
| 312 return dart.as(_js_helper.Primitives.valueFromDecomposedDate(year, month,
day, hour, minute, second, millisecond, isUtc), int); | 312 return dart.as(dart.dcall(_js_helper.Primitives.valueFromDecomposedDate, y
ear, month, day, hour, minute, second, millisecond, isUtc), int); |
| 313 } | 313 } |
| 314 get timeZoneName() { | 314 get timeZoneName() { |
| 315 if (dart.notNull(this.isUtc)) | 315 if (dart.notNull(this.isUtc)) |
| 316 return "UTC"; | 316 return "UTC"; |
| 317 return _js_helper.Primitives.getTimeZoneName(this); | 317 return dart.dcall(_js_helper.Primitives.getTimeZoneName, this); |
| 318 } | 318 } |
| 319 get timeZoneOffset() { | 319 get timeZoneOffset() { |
| 320 if (dart.notNull(this.isUtc)) | 320 if (dart.notNull(this.isUtc)) |
| 321 return new Duration(); | 321 return new Duration(); |
| 322 return new Duration({minutes: _js_helper.Primitives.getTimeZoneOffsetInMin
utes(this)}); | 322 return new Duration({minutes: dart.dcall(_js_helper.Primitives.getTimeZone
OffsetInMinutes, this)}); |
| 323 } | 323 } |
| 324 get year() { | 324 get year() { |
| 325 return dart.as(_js_helper.Primitives.getYear(this), int); | 325 return dart.as(dart.dcall(_js_helper.Primitives.getYear, this), int); |
| 326 } | 326 } |
| 327 get month() { | 327 get month() { |
| 328 return dart.as(_js_helper.Primitives.getMonth(this), int); | 328 return dart.as(dart.dcall(_js_helper.Primitives.getMonth, this), int); |
| 329 } | 329 } |
| 330 get day() { | 330 get day() { |
| 331 return dart.as(_js_helper.Primitives.getDay(this), int); | 331 return dart.as(dart.dcall(_js_helper.Primitives.getDay, this), int); |
| 332 } | 332 } |
| 333 get hour() { | 333 get hour() { |
| 334 return dart.as(_js_helper.Primitives.getHours(this), int); | 334 return dart.as(dart.dcall(_js_helper.Primitives.getHours, this), int); |
| 335 } | 335 } |
| 336 get minute() { | 336 get minute() { |
| 337 return dart.as(_js_helper.Primitives.getMinutes(this), int); | 337 return dart.as(dart.dcall(_js_helper.Primitives.getMinutes, this), int); |
| 338 } | 338 } |
| 339 get second() { | 339 get second() { |
| 340 return dart.as(_js_helper.Primitives.getSeconds(this), int); | 340 return dart.as(dart.dcall(_js_helper.Primitives.getSeconds, this), int); |
| 341 } | 341 } |
| 342 get millisecond() { | 342 get millisecond() { |
| 343 return dart.as(_js_helper.Primitives.getMilliseconds(this), int); | 343 return dart.as(dart.dcall(_js_helper.Primitives.getMilliseconds, this), in
t); |
| 344 } | 344 } |
| 345 get weekday() { | 345 get weekday() { |
| 346 return dart.as(_js_helper.Primitives.getWeekday(this), int); | 346 return dart.as(dart.dcall(_js_helper.Primitives.getWeekday, this), int); |
| 347 } | 347 } |
| 348 } | 348 } |
| 349 DateTime[dart.implements] = () => [Comparable]; | 349 DateTime[dart.implements] = () => [Comparable]; |
| 350 dart.defineNamedConstructor(DateTime, 'utc'); | 350 dart.defineNamedConstructor(DateTime, 'utc'); |
| 351 dart.defineNamedConstructor(DateTime, 'now'); | 351 dart.defineNamedConstructor(DateTime, 'now'); |
| 352 dart.defineNamedConstructor(DateTime, 'fromMillisecondsSinceEpoch'); | 352 dart.defineNamedConstructor(DateTime, 'fromMillisecondsSinceEpoch'); |
| 353 dart.defineNamedConstructor(DateTime, '_internal'); | 353 dart.defineNamedConstructor(DateTime, '_internal'); |
| 354 dart.defineNamedConstructor(DateTime, '_now'); | 354 dart.defineNamedConstructor(DateTime, '_now'); |
| 355 dart.setSignature(DateTime, { | 355 dart.setSignature(DateTime, { |
| 356 constructors: () => ({ | 356 constructors: () => ({ |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 DateTime.SEPTEMBER = 9; | 403 DateTime.SEPTEMBER = 9; |
| 404 DateTime.OCTOBER = 10; | 404 DateTime.OCTOBER = 10; |
| 405 DateTime.NOVEMBER = 11; | 405 DateTime.NOVEMBER = 11; |
| 406 DateTime.DECEMBER = 12; | 406 DateTime.DECEMBER = 12; |
| 407 DateTime.MONTHS_PER_YEAR = 12; | 407 DateTime.MONTHS_PER_YEAR = 12; |
| 408 DateTime._MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000; | 408 DateTime._MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000; |
| 409 class num extends Object { | 409 class num extends Object { |
| 410 static parse(input, onError) { | 410 static parse(input, onError) { |
| 411 if (onError === void 0) | 411 if (onError === void 0) |
| 412 onError = null; | 412 onError = null; |
| 413 let source = input[dartx.trim](); | 413 let source = dart.dcall(input[dartx.trim]); |
| 414 num._parseError = false; | 414 num._parseError = false; |
| 415 let result = int.parse(source, {onError: num._onParseErrorInt}); | 415 let result = dart.dcall(int.parse, source, {onError: num._onParseErrorInt}
); |
| 416 if (!dart.notNull(num._parseError)) | 416 if (!dart.notNull(num._parseError)) |
| 417 return result; | 417 return result; |
| 418 num._parseError = false; | 418 num._parseError = false; |
| 419 result = double.parse(source, num._onParseErrorDouble); | 419 result = dart.dcall(double.parse, source, num._onParseErrorDouble); |
| 420 if (!dart.notNull(num._parseError)) | 420 if (!dart.notNull(num._parseError)) |
| 421 return result; | 421 return result; |
| 422 if (onError == null) | 422 if (onError == null) |
| 423 dart.throw(new FormatException(input)); | 423 dart.throw(new FormatException(input)); |
| 424 return onError(input); | 424 return onError(input); |
| 425 } | 425 } |
| 426 static _onParseErrorInt(_) { | 426 static _onParseErrorInt(_) { |
| 427 num._parseError = true; | 427 num._parseError = true; |
| 428 return 0; | 428 return 0; |
| 429 } | 429 } |
| 430 static _onParseErrorDouble(_) { | 430 static _onParseErrorDouble(_) { |
| 431 num._parseError = true; | 431 num._parseError = true; |
| 432 return 0.0; | 432 return 0.0; |
| 433 } | 433 } |
| 434 } | 434 } |
| 435 num[dart.implements] = () => [Comparable$(num)]; | 435 num[dart.implements] = () => [Comparable$(num)]; |
| 436 dart.setSignature(num, { | 436 dart.setSignature(num, { |
| 437 statics: () => ({ | 437 statics: () => ({ |
| 438 parse: [num, [String], [dart.functionType(num, [String])]], | 438 parse: [num, [String], [dart.functionType(num, [String])]], |
| 439 _onParseErrorInt: [int, [String]], | 439 _onParseErrorInt: [int, [String]], |
| 440 _onParseErrorDouble: [double, [String]] | 440 _onParseErrorDouble: [double, [String]] |
| 441 }), | 441 }), |
| 442 names: ['parse', '_onParseErrorInt', '_onParseErrorDouble'] | 442 names: ['parse', '_onParseErrorInt', '_onParseErrorDouble'] |
| 443 }); | 443 }); |
| 444 class double extends num { | 444 class double extends num { |
| 445 static parse(source, onError) { | 445 static parse(source, onError) { |
| 446 if (onError === void 0) | 446 if (onError === void 0) |
| 447 onError = null; | 447 onError = null; |
| 448 return _js_helper.Primitives.parseDouble(source, onError); | 448 return dart.dcall(_js_helper.Primitives.parseDouble, source, onError); |
| 449 } | 449 } |
| 450 } | 450 } |
| 451 dart.setSignature(double, { | 451 dart.setSignature(double, { |
| 452 statics: () => ({parse: [double, [String], [dart.functionType(double, [Strin
g])]]}), | 452 statics: () => ({parse: [double, [String], [dart.functionType(double, [Strin
g])]]}), |
| 453 names: ['parse'] | 453 names: ['parse'] |
| 454 }); | 454 }); |
| 455 double.NAN = 0.0 / 0.0; | 455 double.NAN = 0.0 / 0.0; |
| 456 double.INFINITY = 1.0 / 0.0; | 456 double.INFINITY = 1.0 / 0.0; |
| 457 double.NEGATIVE_INFINITY = -dart.notNull(double.INFINITY); | 457 double.NEGATIVE_INFINITY = -dart.notNull(double.INFINITY); |
| 458 double.MIN_POSITIVE = 5e-324; | 458 double.MIN_POSITIVE = 5e-324; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 471 _microseconds(duration) { | 471 _microseconds(duration) { |
| 472 this[_duration] = duration; | 472 this[_duration] = duration; |
| 473 } | 473 } |
| 474 ['+'](other) { | 474 ['+'](other) { |
| 475 return new Duration._microseconds(dart.notNull(this[_duration]) + dart.not
Null(other[_duration])); | 475 return new Duration._microseconds(dart.notNull(this[_duration]) + dart.not
Null(other[_duration])); |
| 476 } | 476 } |
| 477 ['-'](other) { | 477 ['-'](other) { |
| 478 return new Duration._microseconds(dart.notNull(this[_duration]) - dart.not
Null(other[_duration])); | 478 return new Duration._microseconds(dart.notNull(this[_duration]) - dart.not
Null(other[_duration])); |
| 479 } | 479 } |
| 480 ['*'](factor) { | 480 ['*'](factor) { |
| 481 return new Duration._microseconds((dart.notNull(this[_duration]) * dart.no
tNull(factor))[dartx.round]()); | 481 return new Duration._microseconds(dart.dcall((dart.notNull(this[_duration]
) * dart.notNull(factor))[dartx.round])); |
| 482 } | 482 } |
| 483 ['~/'](quotient) { | 483 ['~/'](quotient) { |
| 484 if (quotient == 0) | 484 if (quotient == 0) |
| 485 dart.throw(new IntegerDivisionByZeroException()); | 485 dart.throw(new IntegerDivisionByZeroException()); |
| 486 return new Duration._microseconds((dart.notNull(this[_duration]) / dart.no
tNull(quotient))[dartx.truncate]()); | 486 return new Duration._microseconds((dart.notNull(this[_duration]) / dart.no
tNull(quotient))[dartx.truncate]()); |
| 487 } | 487 } |
| 488 ['<'](other) { | 488 ['<'](other) { |
| 489 return dart.notNull(this[_duration]) < dart.notNull(other[_duration]); | 489 return dart.notNull(this[_duration]) < dart.notNull(other[_duration]); |
| 490 } | 490 } |
| 491 ['>'](other) { | 491 ['>'](other) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 517 } | 517 } |
| 518 ['=='](other) { | 518 ['=='](other) { |
| 519 if (!dart.is(other, Duration)) | 519 if (!dart.is(other, Duration)) |
| 520 return false; | 520 return false; |
| 521 return dart.equals(this[_duration], dart.dload(other, _duration)); | 521 return dart.equals(this[_duration], dart.dload(other, _duration)); |
| 522 } | 522 } |
| 523 get hashCode() { | 523 get hashCode() { |
| 524 return dart.hashCode(this[_duration]); | 524 return dart.hashCode(this[_duration]); |
| 525 } | 525 } |
| 526 compareTo(other) { | 526 compareTo(other) { |
| 527 return this[_duration][dartx.compareTo](other[_duration]); | 527 return dart.dcall(this[_duration][dartx.compareTo], other[_duration]); |
| 528 } | 528 } |
| 529 toString() { | 529 toString() { |
| 530 function sixDigits(n) { | 530 function sixDigits(n) { |
| 531 if (dart.notNull(n) >= 100000) | 531 if (dart.notNull(n) >= 100000) |
| 532 return `${n}`; | 532 return `${n}`; |
| 533 if (dart.notNull(n) >= 10000) | 533 if (dart.notNull(n) >= 10000) |
| 534 return `0${n}`; | 534 return `0${n}`; |
| 535 if (dart.notNull(n) >= 1000) | 535 if (dart.notNull(n) >= 1000) |
| 536 return `00${n}`; | 536 return `00${n}`; |
| 537 if (dart.notNull(n) >= 100) | 537 if (dart.notNull(n) >= 100) |
| 538 return `000${n}`; | 538 return `000${n}`; |
| 539 if (dart.notNull(n) >= 10) | 539 if (dart.notNull(n) >= 10) |
| 540 return `0000${n}`; | 540 return `0000${n}`; |
| 541 return `00000${n}`; | 541 return `00000${n}`; |
| 542 } | 542 } |
| 543 dart.fn(sixDigits, String, [int]); | 543 dart.fn(sixDigits, String, [int]); |
| 544 function twoDigits(n) { | 544 function twoDigits(n) { |
| 545 if (dart.notNull(n) >= 10) | 545 if (dart.notNull(n) >= 10) |
| 546 return `${n}`; | 546 return `${n}`; |
| 547 return `0${n}`; | 547 return `0${n}`; |
| 548 } | 548 } |
| 549 dart.fn(twoDigits, String, [int]); | 549 dart.fn(twoDigits, String, [int]); |
| 550 if (dart.notNull(this.inMicroseconds) < 0) { | 550 if (dart.notNull(this.inMicroseconds) < 0) { |
| 551 return `-${this['unary-']()}`; | 551 return `-${this['unary-']()}`; |
| 552 } | 552 } |
| 553 let twoDigitMinutes = twoDigits(this.inMinutes[dartx.remainder](Duration.M
INUTES_PER_HOUR)); | 553 let twoDigitMinutes = dart.dcall(twoDigits, dart.dcall(this.inMinutes[dart
x.remainder], Duration.MINUTES_PER_HOUR)); |
| 554 let twoDigitSeconds = twoDigits(this.inSeconds[dartx.remainder](Duration.S
ECONDS_PER_MINUTE)); | 554 let twoDigitSeconds = dart.dcall(twoDigits, dart.dcall(this.inSeconds[dart
x.remainder], Duration.SECONDS_PER_MINUTE)); |
| 555 let sixDigitUs = sixDigits(this.inMicroseconds[dartx.remainder](Duration.M
ICROSECONDS_PER_SECOND)); | 555 let sixDigitUs = dart.dcall(sixDigits, dart.dcall(this.inMicroseconds[dart
x.remainder], Duration.MICROSECONDS_PER_SECOND)); |
| 556 return `${this.inHours}:${twoDigitMinutes}:${twoDigitSeconds}.${sixDigitUs
}`; | 556 return `${this.inHours}:${twoDigitMinutes}:${twoDigitSeconds}.${sixDigitUs
}`; |
| 557 } | 557 } |
| 558 get isNegative() { | 558 get isNegative() { |
| 559 return dart.notNull(this[_duration]) < 0; | 559 return dart.notNull(this[_duration]) < 0; |
| 560 } | 560 } |
| 561 abs() { | 561 abs() { |
| 562 return new Duration._microseconds(this[_duration][dartx.abs]()); | 562 return new Duration._microseconds(dart.dcall(this[_duration][dartx.abs])); |
| 563 } | 563 } |
| 564 ['unary-']() { | 564 ['unary-']() { |
| 565 return new Duration._microseconds(-dart.notNull(this[_duration])); | 565 return new Duration._microseconds(-dart.notNull(this[_duration])); |
| 566 } | 566 } |
| 567 } | 567 } |
| 568 Duration[dart.implements] = () => [Comparable$(Duration)]; | 568 Duration[dart.implements] = () => [Comparable$(Duration)]; |
| 569 dart.defineNamedConstructor(Duration, '_microseconds'); | 569 dart.defineNamedConstructor(Duration, '_microseconds'); |
| 570 dart.setSignature(Duration, { | 570 dart.setSignature(Duration, { |
| 571 constructors: () => ({ | 571 constructors: () => ({ |
| 572 Duration: [Duration, [], {days: int, hours: int, minutes: int, seconds: in
t, milliseconds: int, microseconds: int}], | 572 Duration: [Duration, [], {days: int, hours: int, minutes: int, seconds: in
t, milliseconds: int, microseconds: int}], |
| (...skipping 28 matching lines...) Expand all Loading... |
| 601 Duration.MILLISECONDS_PER_DAY = dart.notNull(Duration.MILLISECONDS_PER_HOUR) *
dart.notNull(Duration.HOURS_PER_DAY); | 601 Duration.MILLISECONDS_PER_DAY = dart.notNull(Duration.MILLISECONDS_PER_HOUR) *
dart.notNull(Duration.HOURS_PER_DAY); |
| 602 Duration.SECONDS_PER_HOUR = dart.notNull(Duration.SECONDS_PER_MINUTE) * dart.n
otNull(Duration.MINUTES_PER_HOUR); | 602 Duration.SECONDS_PER_HOUR = dart.notNull(Duration.SECONDS_PER_MINUTE) * dart.n
otNull(Duration.MINUTES_PER_HOUR); |
| 603 Duration.SECONDS_PER_DAY = dart.notNull(Duration.SECONDS_PER_HOUR) * dart.notN
ull(Duration.HOURS_PER_DAY); | 603 Duration.SECONDS_PER_DAY = dart.notNull(Duration.SECONDS_PER_HOUR) * dart.notN
ull(Duration.HOURS_PER_DAY); |
| 604 Duration.MINUTES_PER_DAY = dart.notNull(Duration.MINUTES_PER_HOUR) * dart.notN
ull(Duration.HOURS_PER_DAY); | 604 Duration.MINUTES_PER_DAY = dart.notNull(Duration.MINUTES_PER_HOUR) * dart.notN
ull(Duration.HOURS_PER_DAY); |
| 605 Duration.ZERO = dart.const(new Duration({seconds: 0})); | 605 Duration.ZERO = dart.const(new Duration({seconds: 0})); |
| 606 class Error extends Object { | 606 class Error extends Object { |
| 607 Error() { | 607 Error() { |
| 608 } | 608 } |
| 609 static safeToString(object) { | 609 static safeToString(object) { |
| 610 if (dart.is(object, num) || typeof object == 'boolean' || null == object)
{ | 610 if (dart.is(object, num) || typeof object == 'boolean' || null == object)
{ |
| 611 return dart.toString(object); | 611 return dart.dcall(object.toString); |
| 612 } | 612 } |
| 613 if (typeof object == 'string') { | 613 if (typeof object == 'string') { |
| 614 return Error._stringToSafeString(object); | 614 return dart.dcall(Error._stringToSafeString, object); |
| 615 } | 615 } |
| 616 return Error._objectToString(object); | 616 return dart.dcall(Error._objectToString, object); |
| 617 } | 617 } |
| 618 static _stringToSafeString(string) { | 618 static _stringToSafeString(string) { |
| 619 return _js_helper.jsonEncodeNative(string); | 619 return dart.dcall(_js_helper.jsonEncodeNative, string); |
| 620 } | 620 } |
| 621 static _objectToString(object) { | 621 static _objectToString(object) { |
| 622 return _js_helper.Primitives.objectToString(object); | 622 return dart.dcall(_js_helper.Primitives.objectToString, object); |
| 623 } | 623 } |
| 624 get stackTrace() { | 624 get stackTrace() { |
| 625 return _js_helper.Primitives.extractStackTrace(this); | 625 return dart.dcall(_js_helper.Primitives.extractStackTrace, this); |
| 626 } | 626 } |
| 627 } | 627 } |
| 628 dart.setSignature(Error, { | 628 dart.setSignature(Error, { |
| 629 constructors: () => ({Error: [Error, []]}), | 629 constructors: () => ({Error: [Error, []]}), |
| 630 statics: () => ({ | 630 statics: () => ({ |
| 631 safeToString: [String, [Object]], | 631 safeToString: [String, [Object]], |
| 632 _stringToSafeString: [String, [String]], | 632 _stringToSafeString: [String, [String]], |
| 633 _objectToString: [String, [Object]] | 633 _objectToString: [String, [Object]] |
| 634 }), | 634 }), |
| 635 names: ['safeToString', '_stringToSafeString', '_objectToString'] | 635 names: ['safeToString', '_stringToSafeString', '_objectToString'] |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 if (name === void 0) | 679 if (name === void 0) |
| 680 name = null; | 680 name = null; |
| 681 this.value(null, name, "Must not be null"); | 681 this.value(null, name, "Must not be null"); |
| 682 } | 682 } |
| 683 toString() { | 683 toString() { |
| 684 if (!dart.notNull(this[_hasValue])) { | 684 if (!dart.notNull(this[_hasValue])) { |
| 685 let result = "Invalid arguments(s)"; | 685 let result = "Invalid arguments(s)"; |
| 686 if (this.message != null) { | 686 if (this.message != null) { |
| 687 result = `${result}: ${this.message}`; | 687 result = `${result}: ${this.message}`; |
| 688 } | 688 } |
| 689 return result; | 689 return dart.as(result, String); |
| 690 } | 690 } |
| 691 let nameString = ""; | 691 let nameString = ""; |
| 692 if (this.name != null) { | 692 if (this.name != null) { |
| 693 nameString = ` (${this.name})`; | 693 nameString = ` (${this.name})`; |
| 694 } | 694 } |
| 695 return `${this.message}${nameString}: ${Error.safeToString(this.invalidVal
ue)}`; | 695 return `${this.message}${nameString}: ${dart.dcall(Error.safeToString, thi
s.invalidValue)}`; |
| 696 } | 696 } |
| 697 } | 697 } |
| 698 dart.defineNamedConstructor(ArgumentError, 'value'); | 698 dart.defineNamedConstructor(ArgumentError, 'value'); |
| 699 dart.defineNamedConstructor(ArgumentError, 'notNull'); | 699 dart.defineNamedConstructor(ArgumentError, 'notNull'); |
| 700 dart.setSignature(ArgumentError, { | 700 dart.setSignature(ArgumentError, { |
| 701 constructors: () => ({ | 701 constructors: () => ({ |
| 702 ArgumentError: [ArgumentError, [], [dart.dynamic]], | 702 ArgumentError: [ArgumentError, [], [dart.dynamic]], |
| 703 value: [ArgumentError, [dart.dynamic], [String, String]], | 703 value: [ArgumentError, [dart.dynamic], [String, String]], |
| 704 notNull: [ArgumentError, [], [String]] | 704 notNull: [ArgumentError, [], [String]] |
| 705 }) | 705 }) |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 if (name === void 0) | 777 if (name === void 0) |
| 778 name = null; | 778 name = null; |
| 779 if (message === void 0) | 779 if (message === void 0) |
| 780 message = null; | 780 message = null; |
| 781 if (dart.notNull(value) < 0) | 781 if (dart.notNull(value) < 0) |
| 782 dart.throw(new RangeError.range(value, 0, null, name, message)); | 782 dart.throw(new RangeError.range(value, 0, null, name, message)); |
| 783 } | 783 } |
| 784 toString() { | 784 toString() { |
| 785 if (!dart.notNull(this[_hasValue])) | 785 if (!dart.notNull(this[_hasValue])) |
| 786 return `RangeError: ${this.message}`; | 786 return `RangeError: ${this.message}`; |
| 787 let value = Error.safeToString(this.invalidValue); | 787 let value = dart.dcall(Error.safeToString, this.invalidValue); |
| 788 let explanation = ""; | 788 let explanation = ""; |
| 789 if (this.start == null) { | 789 if (this.start == null) { |
| 790 if (this.end != null) { | 790 if (this.end != null) { |
| 791 explanation = `: Not less than or equal to ${this.end}`; | 791 explanation = `: Not less than or equal to ${this.end}`; |
| 792 } | 792 } |
| 793 } else if (this.end == null) { | 793 } else if (this.end == null) { |
| 794 explanation = `: Not greater than or equal to ${this.start}`; | 794 explanation = `: Not greater than or equal to ${this.start}`; |
| 795 } else if (dart.notNull(this.end) > dart.notNull(this.start)) { | 795 } else if (dart.notNull(this.end) > dart.notNull(this.start)) { |
| 796 explanation = `: Not in range ${this.start}..${this.end}, inclusive.`; | 796 explanation = `: Not in range ${this.start}..${this.end}, inclusive.`; |
| 797 } else if (dart.notNull(this.end) < dart.notNull(this.start)) { | 797 } else if (dart.notNull(this.end) < dart.notNull(this.start)) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 super.value(invalidValue, name, message != null ? message : "Index out of
range"); | 832 super.value(invalidValue, name, message != null ? message : "Index out of
range"); |
| 833 } | 833 } |
| 834 get start() { | 834 get start() { |
| 835 return 0; | 835 return 0; |
| 836 } | 836 } |
| 837 get end() { | 837 get end() { |
| 838 return dart.notNull(this.length) - 1; | 838 return dart.notNull(this.length) - 1; |
| 839 } | 839 } |
| 840 toString() { | 840 toString() { |
| 841 dart.assert(this[_hasValue]); | 841 dart.assert(this[_hasValue]); |
| 842 let target = Error.safeToString(this.indexable); | 842 let target = dart.dcall(Error.safeToString, this.indexable); |
| 843 let explanation = `index should be less than ${this.length}`; | 843 let explanation = `index should be less than ${this.length}`; |
| 844 if (dart.notNull(dart.as(dart.dsend(this.invalidValue, '<', 0), bool))) { | 844 if (dart.notNull(dart.as(dart.dsend(this.invalidValue, '<', 0), bool))) { |
| 845 explanation = "index must not be negative"; | 845 explanation = "index must not be negative"; |
| 846 } | 846 } |
| 847 return `RangeError: ${this.message} (${target}[${this.invalidValue}]): ${e
xplanation}`; | 847 return `RangeError: ${this.message} (${target}[${this.invalidValue}]): ${e
xplanation}`; |
| 848 } | 848 } |
| 849 } | 849 } |
| 850 IndexError[dart.implements] = () => [RangeError]; | 850 IndexError[dart.implements] = () => [RangeError]; |
| 851 dart.setSignature(IndexError, { | 851 dart.setSignature(IndexError, { |
| 852 constructors: () => ({IndexError: [IndexError, [int, dart.dynamic], [String,
String, int]]}) | 852 constructors: () => ({IndexError: [IndexError, [int, dart.dynamic], [String,
String, int]]}) |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 this[_namedArguments] = namedArguments; | 887 this[_namedArguments] = namedArguments; |
| 888 this[_existingArgumentNames] = existingArgumentNames; | 888 this[_existingArgumentNames] = existingArgumentNames; |
| 889 super.Error(); | 889 super.Error(); |
| 890 } | 890 } |
| 891 toString() { | 891 toString() { |
| 892 let sb = new StringBuffer(); | 892 let sb = new StringBuffer(); |
| 893 let i = 0; | 893 let i = 0; |
| 894 if (this[_arguments] != null) { | 894 if (this[_arguments] != null) { |
| 895 for (; dart.notNull(i) < dart.notNull(this[_arguments][dartx.length]); i
= dart.notNull(i) + 1) { | 895 for (; dart.notNull(i) < dart.notNull(this[_arguments][dartx.length]); i
= dart.notNull(i) + 1) { |
| 896 if (dart.notNull(i) > 0) { | 896 if (dart.notNull(i) > 0) { |
| 897 sb.write(", "); | 897 dart.dcall(sb.write, ", "); |
| 898 } | 898 } |
| 899 sb.write(Error.safeToString(this[_arguments][dartx.get](i))); | 899 dart.dcall(sb.write, dart.dcall(Error.safeToString, this[_arguments][d
artx.get](i))); |
| 900 } | 900 } |
| 901 } | 901 } |
| 902 if (this[_namedArguments] != null) { | 902 if (this[_namedArguments] != null) { |
| 903 this[_namedArguments].forEach(dart.fn((key, value) => { | 903 dart.dcall(this[_namedArguments].forEach, dart.fn((key, value) => { |
| 904 if (dart.notNull(i) > 0) { | 904 if (dart.notNull(i) > 0) { |
| 905 sb.write(", "); | 905 dart.dcall(sb.write, ", "); |
| 906 } | 906 } |
| 907 sb.write(_symbolToString(key)); | 907 dart.dcall(sb.write, dart.dcall(_symbolToString, key)); |
| 908 sb.write(": "); | 908 dart.dcall(sb.write, ": "); |
| 909 sb.write(Error.safeToString(value)); | 909 dart.dcall(sb.write, dart.dcall(Error.safeToString, value)); |
| 910 i = dart.notNull(i) + 1; | 910 i = dart.notNull(i) + 1; |
| 911 }, dart.dynamic, [Symbol, dart.dynamic])); | 911 }, dart.dynamic, [Symbol, dart.dynamic])); |
| 912 } | 912 } |
| 913 if (this[_existingArgumentNames] == null) { | 913 if (this[_existingArgumentNames] == null) { |
| 914 return `NoSuchMethodError : method not found: '${this[_memberName]}'\n`
+ `Receiver: ${Error.safeToString(this[_receiver])}\n` + `Arguments: [${sb}]`; | 914 return `NoSuchMethodError : method not found: '${this[_memberName]}'\n`
+ `Receiver: ${dart.dcall(Error.safeToString, this[_receiver])}\n` + `Arguments:
[${sb}]`; |
| 915 } else { | 915 } else { |
| 916 let actualParameters = dart.toString(sb); | 916 let actualParameters = dart.dcall(sb.toString); |
| 917 sb = new StringBuffer(); | 917 sb = new StringBuffer(); |
| 918 for (let i = 0; dart.notNull(i) < dart.notNull(this[_existingArgumentNam
es][dartx.length]); i = dart.notNull(i) + 1) { | 918 for (let i = 0; dart.notNull(i) < dart.notNull(this[_existingArgumentNam
es][dartx.length]); i = dart.notNull(i) + 1) { |
| 919 if (dart.notNull(i) > 0) { | 919 if (dart.notNull(i) > 0) { |
| 920 sb.write(", "); | 920 dart.dcall(sb.write, ", "); |
| 921 } | 921 } |
| 922 sb.write(this[_existingArgumentNames][dartx.get](i)); | 922 dart.dcall(sb.write, this[_existingArgumentNames][dartx.get](i)); |
| 923 } | 923 } |
| 924 let formalParameters = dart.toString(sb); | 924 let formalParameters = dart.dcall(sb.toString); |
| 925 return "NoSuchMethodError: incorrect number of arguments passed to " + `
method named '${this[_memberName]}'\n` + `Receiver: ${Error.safeToString(this[_r
eceiver])}\n` + `Tried calling: ${this[_memberName]}(${actualParameters})\n` + `
Found: ${this[_memberName]}(${formalParameters})`; | 925 return "NoSuchMethodError: incorrect number of arguments passed to " + `
method named '${this[_memberName]}'\n` + `Receiver: ${dart.dcall(Error.safeToStr
ing, this[_receiver])}\n` + `Tried calling: ${this[_memberName]}(${actualParamet
ers})\n` + `Found: ${this[_memberName]}(${formalParameters})`; |
| 926 } | 926 } |
| 927 } | 927 } |
| 928 } | 928 } |
| 929 dart.setSignature(NoSuchMethodError, { | 929 dart.setSignature(NoSuchMethodError, { |
| 930 constructors: () => ({NoSuchMethodError: [NoSuchMethodError, [Object, Symbol
, List, Map$(Symbol, dart.dynamic)], [List]]}) | 930 constructors: () => ({NoSuchMethodError: [NoSuchMethodError, [Object, Symbol
, List, Map$(Symbol, dart.dynamic)], [List]]}) |
| 931 }); | 931 }); |
| 932 class UnsupportedError extends Error { | 932 class UnsupportedError extends Error { |
| 933 UnsupportedError(message) { | 933 UnsupportedError(message) { |
| 934 this.message = message; | 934 this.message = message; |
| 935 super.Error(); | 935 super.Error(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 ConcurrentModificationError(modifiedObject) { | 972 ConcurrentModificationError(modifiedObject) { |
| 973 if (modifiedObject === void 0) | 973 if (modifiedObject === void 0) |
| 974 modifiedObject = null; | 974 modifiedObject = null; |
| 975 this.modifiedObject = modifiedObject; | 975 this.modifiedObject = modifiedObject; |
| 976 super.Error(); | 976 super.Error(); |
| 977 } | 977 } |
| 978 toString() { | 978 toString() { |
| 979 if (this.modifiedObject == null) { | 979 if (this.modifiedObject == null) { |
| 980 return "Concurrent modification during iteration."; | 980 return "Concurrent modification during iteration."; |
| 981 } | 981 } |
| 982 return "Concurrent modification during iteration: " + `${Error.safeToStrin
g(this.modifiedObject)}.`; | 982 return "Concurrent modification during iteration: " + `${dart.dcall(Error.
safeToString, this.modifiedObject)}.`; |
| 983 } | 983 } |
| 984 } | 984 } |
| 985 dart.setSignature(ConcurrentModificationError, { | 985 dart.setSignature(ConcurrentModificationError, { |
| 986 constructors: () => ({ConcurrentModificationError: [ConcurrentModificationEr
ror, [], [Object]]}) | 986 constructors: () => ({ConcurrentModificationError: [ConcurrentModificationEr
ror, [], [Object]]}) |
| 987 }); | 987 }); |
| 988 class OutOfMemoryError extends Object { | 988 class OutOfMemoryError extends Object { |
| 989 OutOfMemoryError() { | 989 OutOfMemoryError() { |
| 990 } | 990 } |
| 991 toString() { | 991 toString() { |
| 992 return "Out of Memory"; | 992 return "Out of Memory"; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 report = dart.notNull(report) + ` (at offset ${offset})`; | 1076 report = dart.notNull(report) + ` (at offset ${offset})`; |
| 1077 } | 1077 } |
| 1078 return report; | 1078 return report; |
| 1079 } | 1079 } |
| 1080 if (offset != -1 && (dart.notNull(offset) < 0 || dart.notNull(offset) > da
rt.notNull(dart.as(dart.dload(this.source, 'length'), num)))) { | 1080 if (offset != -1 && (dart.notNull(offset) < 0 || dart.notNull(offset) > da
rt.notNull(dart.as(dart.dload(this.source, 'length'), num)))) { |
| 1081 offset = -1; | 1081 offset = -1; |
| 1082 } | 1082 } |
| 1083 if (offset == -1) { | 1083 if (offset == -1) { |
| 1084 let source = dart.as(this.source, String); | 1084 let source = dart.as(this.source, String); |
| 1085 if (dart.notNull(source[dartx.length]) > 78) { | 1085 if (dart.notNull(source[dartx.length]) > 78) { |
| 1086 source = dart.notNull(source[dartx.substring](0, 75)) + "..."; | 1086 source = dart.notNull(dart.dcall(source[dartx.substring], 0, 75)) + ".
.."; |
| 1087 } | 1087 } |
| 1088 return `${report}\n${source}`; | 1088 return `${report}\n${source}`; |
| 1089 } | 1089 } |
| 1090 let lineNum = 1; | 1090 let lineNum = 1; |
| 1091 let lineStart = 0; | 1091 let lineStart = 0; |
| 1092 let lastWasCR = null; | 1092 let lastWasCR = null; |
| 1093 for (let i = 0; dart.notNull(i) < dart.notNull(offset); i = dart.notNull(i
) + 1) { | 1093 for (let i = 0; dart.notNull(i) < dart.notNull(offset); i = dart.notNull(i
) + 1) { |
| 1094 let char = dart.as(dart.dsend(this.source, 'codeUnitAt', i), int); | 1094 let char = dart.as(dart.dsend(this.source, 'codeUnitAt', i), int); |
| 1095 if (char == 10) { | 1095 if (char == 10) { |
| 1096 if (lineStart != i || !dart.notNull(lastWasCR)) { | 1096 if (lineStart != i || !dart.notNull(lastWasCR)) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 class Expando extends Object { | 1161 class Expando extends Object { |
| 1162 Expando(name) { | 1162 Expando(name) { |
| 1163 if (name === void 0) | 1163 if (name === void 0) |
| 1164 name = null; | 1164 name = null; |
| 1165 this.name = name; | 1165 this.name = name; |
| 1166 } | 1166 } |
| 1167 toString() { | 1167 toString() { |
| 1168 return `Expando:${this.name}`; | 1168 return `Expando:${this.name}`; |
| 1169 } | 1169 } |
| 1170 get(object) { | 1170 get(object) { |
| 1171 let values = _js_helper.Primitives.getProperty(object, Expando$()._EXPAN
DO_PROPERTY_NAME); | 1171 let values = dart.dcall(_js_helper.Primitives.getProperty, object, Expan
do$()._EXPANDO_PROPERTY_NAME); |
| 1172 return values == null ? null : dart.as(_js_helper.Primitives.getProperty
(values, this[_getKey]()), T); | 1172 return values == null ? null : dart.as(dart.dcall(_js_helper.Primitives.
getProperty, values, dart.dcall(this[_getKey])), T); |
| 1173 } | 1173 } |
| 1174 set(object, value) { | 1174 set(object, value) { |
| 1175 dart.as(value, T); | 1175 dart.as(value, T); |
| 1176 let values = _js_helper.Primitives.getProperty(object, Expando$()._EXPAN
DO_PROPERTY_NAME); | 1176 let values = dart.dcall(_js_helper.Primitives.getProperty, object, Expan
do$()._EXPANDO_PROPERTY_NAME); |
| 1177 if (values == null) { | 1177 if (values == null) { |
| 1178 values = new Object(); | 1178 values = new Object(); |
| 1179 _js_helper.Primitives.setProperty(object, Expando$()._EXPANDO_PROPERTY
_NAME, values); | 1179 dart.dcall(_js_helper.Primitives.setProperty, object, Expando$()._EXPA
NDO_PROPERTY_NAME, values); |
| 1180 } | 1180 } |
| 1181 _js_helper.Primitives.setProperty(values, this[_getKey](), value); | 1181 dart.dcall(_js_helper.Primitives.setProperty, values, dart.dcall(this[_g
etKey]), value); |
| 1182 return value; | 1182 return value; |
| 1183 } | 1183 } |
| 1184 [_getKey]() { | 1184 [_getKey]() { |
| 1185 let key = dart.as(_js_helper.Primitives.getProperty(this, Expando$()._KE
Y_PROPERTY_NAME), String); | 1185 let key = dart.as(dart.dcall(_js_helper.Primitives.getProperty, this, Ex
pando$()._KEY_PROPERTY_NAME), String); |
| 1186 if (key == null) { | 1186 if (key == null) { |
| 1187 key = `expando$key$${(() => { | 1187 key = `expando$key$${(() => { |
| 1188 let x = Expando$()._keyCount; | 1188 let x = Expando$()._keyCount; |
| 1189 Expando$()._keyCount = dart.notNull(x) + 1; | 1189 Expando$()._keyCount = dart.notNull(x) + 1; |
| 1190 return x; | 1190 return x; |
| 1191 })()}`; | 1191 })()}`; |
| 1192 _js_helper.Primitives.setProperty(this, Expando$()._KEY_PROPERTY_NAME,
key); | 1192 dart.dcall(_js_helper.Primitives.setProperty, this, Expando$()._KEY_PR
OPERTY_NAME, key); |
| 1193 } | 1193 } |
| 1194 return key; | 1194 return key; |
| 1195 } | 1195 } |
| 1196 } | 1196 } |
| 1197 dart.setSignature(Expando, { | 1197 dart.setSignature(Expando, { |
| 1198 constructors: () => ({Expando: [Expando$(T), [], [String]]}), | 1198 constructors: () => ({Expando: [Expando$(T), [], [String]]}), |
| 1199 methods: () => ({ | 1199 methods: () => ({ |
| 1200 get: [T, [Object]], | 1200 get: [T, [Object]], |
| 1201 set: [dart.void, [Object, T]], | 1201 set: [dart.void, [Object, T]], |
| 1202 [_getKey]: [String, []] | 1202 [_getKey]: [String, []] |
| 1203 }) | 1203 }) |
| 1204 }); | 1204 }); |
| 1205 return Expando; | 1205 return Expando; |
| 1206 }); | 1206 }); |
| 1207 let Expando = Expando$(); | 1207 let Expando = Expando$(); |
| 1208 Expando._KEY_PROPERTY_NAME = 'expando$key'; | 1208 Expando._KEY_PROPERTY_NAME = 'expando$key'; |
| 1209 Expando._EXPANDO_PROPERTY_NAME = 'expando$values'; | 1209 Expando._EXPANDO_PROPERTY_NAME = 'expando$values'; |
| 1210 Expando._keyCount = 0; | 1210 Expando._keyCount = 0; |
| 1211 class Function extends Object { | 1211 class Function extends Object { |
| 1212 static apply(f, positionalArguments, namedArguments) { | 1212 static apply(f, positionalArguments, namedArguments) { |
| 1213 if (namedArguments === void 0) | 1213 if (namedArguments === void 0) |
| 1214 namedArguments = null; | 1214 namedArguments = null; |
| 1215 return dart.dcall.apply(null, [f].concat(positionalArguments)); | 1215 return dart.dcall.apply(null, [f].concat(positionalArguments)); |
| 1216 } | 1216 } |
| 1217 static _toMangledNames(namedArguments) { | 1217 static _toMangledNames(namedArguments) { |
| 1218 let result = dart.map(); | 1218 let result = dart.map(); |
| 1219 namedArguments.forEach(dart.fn((symbol, value) => { | 1219 dart.dcall(namedArguments.forEach, dart.fn((symbol, value) => { |
| 1220 result.set(_symbolToString(dart.as(symbol, Symbol)), value); | 1220 result.set(dart.dcall(_symbolToString, symbol), value); |
| 1221 })); | 1221 })); |
| 1222 return result; | 1222 return result; |
| 1223 } | 1223 } |
| 1224 } | 1224 } |
| 1225 dart.setSignature(Function, { | 1225 dart.setSignature(Function, { |
| 1226 statics: () => ({ | 1226 statics: () => ({ |
| 1227 apply: [dart.dynamic, [Function, List], [Map$(Symbol, dart.dynamic)]], | 1227 apply: [dart.dynamic, [Function, List], [Map$(Symbol, dart.dynamic)]], |
| 1228 _toMangledNames: [Map$(String, dart.dynamic), [Map$(Symbol, dart.dynamic)]
] | 1228 _toMangledNames: [Map$(String, dart.dynamic), [Map$(Symbol, dart.dynamic)]
] |
| 1229 }), | 1229 }), |
| 1230 names: ['apply', '_toMangledNames'] | 1230 names: ['apply', '_toMangledNames'] |
| 1231 }); | 1231 }); |
| 1232 function identical(a, b) { | 1232 function identical(a, b) { |
| 1233 return _js_helper.Primitives.identicalImplementation(a, b); | 1233 return dart.dcall(_js_helper.Primitives.identicalImplementation, a, b); |
| 1234 } | 1234 } |
| 1235 dart.fn(identical, bool, [Object, Object]); | 1235 dart.fn(identical, bool, [Object, Object]); |
| 1236 function identityHashCode(object) { | 1236 function identityHashCode(object) { |
| 1237 return _js_helper.objectHashCode(object); | 1237 return dart.dcall(_js_helper.objectHashCode, object); |
| 1238 } | 1238 } |
| 1239 dart.fn(identityHashCode, () => dart.definiteFunctionType(int, [Object])); | 1239 dart.fn(identityHashCode, () => dart.definiteFunctionType(int, [Object])); |
| 1240 class int extends num { | 1240 class int extends num { |
| 1241 static fromEnvironment(name, opts) { | 1241 static fromEnvironment(name, opts) { |
| 1242 let defaultValue = opts && 'defaultValue' in opts ? opts.defaultValue : nu
ll; | 1242 let defaultValue = opts && 'defaultValue' in opts ? opts.defaultValue : nu
ll; |
| 1243 dart.throw(new UnsupportedError('int.fromEnvironment can only be used as a
const constructor')); | 1243 dart.throw(new UnsupportedError('int.fromEnvironment can only be used as a
const constructor')); |
| 1244 } | 1244 } |
| 1245 static parse(source, opts) { | 1245 static parse(source, opts) { |
| 1246 let radix = opts && 'radix' in opts ? opts.radix : null; | 1246 let radix = opts && 'radix' in opts ? opts.radix : null; |
| 1247 let onError = opts && 'onError' in opts ? opts.onError : null; | 1247 let onError = opts && 'onError' in opts ? opts.onError : null; |
| 1248 return _js_helper.Primitives.parseInt(source, radix, onError); | 1248 return dart.dcall(_js_helper.Primitives.parseInt, source, radix, onError); |
| 1249 } | 1249 } |
| 1250 } | 1250 } |
| 1251 dart.setSignature(int, { | 1251 dart.setSignature(int, { |
| 1252 constructors: () => ({fromEnvironment: [int, [String], {defaultValue: int}]}
), | 1252 constructors: () => ({fromEnvironment: [int, [String], {defaultValue: int}]}
), |
| 1253 statics: () => ({parse: [int, [String], {radix: int, onError: dart.functionT
ype(int, [String])}]}), | 1253 statics: () => ({parse: [int, [String], {radix: int, onError: dart.functionT
ype(int, [String])}]}), |
| 1254 names: ['parse'] | 1254 names: ['parse'] |
| 1255 }); | 1255 }); |
| 1256 class Invocation extends Object { | 1256 class Invocation extends Object { |
| 1257 get isAccessor() { | 1257 get isAccessor() { |
| 1258 return dart.notNull(this.isGetter) || dart.notNull(this.isSetter); | 1258 return dart.notNull(this.isGetter) || dart.notNull(this.isSetter); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1272 return new (_internal.EmptyIterable$(E))(); | 1272 return new (_internal.EmptyIterable$(E))(); |
| 1273 return new (exports._GeneratorIterable$(E))(count, generator); | 1273 return new (exports._GeneratorIterable$(E))(count, generator); |
| 1274 } | 1274 } |
| 1275 [dart.JsSymbol.iterator]() { | 1275 [dart.JsSymbol.iterator]() { |
| 1276 return new dart.JsIterator(this[dartx.iterator]); | 1276 return new dart.JsIterator(this[dartx.iterator]); |
| 1277 } | 1277 } |
| 1278 [dartx.join](separator) { | 1278 [dartx.join](separator) { |
| 1279 if (separator === void 0) | 1279 if (separator === void 0) |
| 1280 separator = ""; | 1280 separator = ""; |
| 1281 let buffer = new StringBuffer(); | 1281 let buffer = new StringBuffer(); |
| 1282 buffer.writeAll(this, separator); | 1282 dart.dcall(buffer.writeAll, this, separator); |
| 1283 return dart.toString(buffer); | 1283 return dart.dcall(buffer.toString); |
| 1284 } | 1284 } |
| 1285 } | 1285 } |
| 1286 dart.setSignature(Iterable, { | 1286 dart.setSignature(Iterable, { |
| 1287 constructors: () => ({ | 1287 constructors: () => ({ |
| 1288 Iterable: [Iterable$(E), []], | 1288 Iterable: [Iterable$(E), []], |
| 1289 generate: [Iterable$(E), [int], [dart.functionType(E, [int])]] | 1289 generate: [Iterable$(E), [int], [dart.functionType(E, [int])]] |
| 1290 }), | 1290 }), |
| 1291 methods: () => ({[dartx.join]: [String, [], [String]]}) | 1291 methods: () => ({[dartx.join]: [String, [], [String]]}) |
| 1292 }); | 1292 }); |
| 1293 return Iterable; | 1293 return Iterable; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1315 this[_generator] = generator; | 1315 this[_generator] = generator; |
| 1316 super.IterableBase(); | 1316 super.IterableBase(); |
| 1317 } | 1317 } |
| 1318 get iterator() { | 1318 get iterator() { |
| 1319 return new (_GeneratorIterator$(E))(this[_start], this[_end], this[_gene
rator]); | 1319 return new (_GeneratorIterator$(E))(this[_start], this[_end], this[_gene
rator]); |
| 1320 } | 1320 } |
| 1321 get length() { | 1321 get length() { |
| 1322 return dart.notNull(this[_end]) - dart.notNull(this[_start]); | 1322 return dart.notNull(this[_end]) - dart.notNull(this[_start]); |
| 1323 } | 1323 } |
| 1324 skip(count) { | 1324 skip(count) { |
| 1325 RangeError.checkNotNegative(count, "count"); | 1325 dart.dcall(RangeError.checkNotNegative, count, "count"); |
| 1326 if (count == 0) | 1326 if (count == 0) |
| 1327 return this; | 1327 return this; |
| 1328 let newStart = dart.notNull(this[_start]) + dart.notNull(count); | 1328 let newStart = dart.notNull(this[_start]) + dart.notNull(count); |
| 1329 if (dart.notNull(newStart) >= dart.notNull(this[_end])) | 1329 if (dart.notNull(newStart) >= dart.notNull(this[_end])) |
| 1330 return new (_internal.EmptyIterable$(E))(); | 1330 return new (_internal.EmptyIterable$(E))(); |
| 1331 return new (exports._GeneratorIterable$(E)).slice(newStart, this[_end],
this[_generator]); | 1331 return new (exports._GeneratorIterable$(E)).slice(newStart, this[_end],
this[_generator]); |
| 1332 } | 1332 } |
| 1333 take(count) { | 1333 take(count) { |
| 1334 RangeError.checkNotNegative(count, "count"); | 1334 dart.dcall(RangeError.checkNotNegative, count, "count"); |
| 1335 if (count == 0) | 1335 if (count == 0) |
| 1336 return new (_internal.EmptyIterable$(E))(); | 1336 return new (_internal.EmptyIterable$(E))(); |
| 1337 let newEnd = dart.notNull(this[_start]) + dart.notNull(count); | 1337 let newEnd = dart.notNull(this[_start]) + dart.notNull(count); |
| 1338 if (dart.notNull(newEnd) >= dart.notNull(this[_end])) | 1338 if (dart.notNull(newEnd) >= dart.notNull(this[_end])) |
| 1339 return this; | 1339 return this; |
| 1340 return new (exports._GeneratorIterable$(E)).slice(this[_start], newEnd,
this[_generator]); | 1340 return new (exports._GeneratorIterable$(E)).slice(this[_start], newEnd,
this[_generator]); |
| 1341 } | 1341 } |
| 1342 static _id(n) { | 1342 static _id(n) { |
| 1343 return n; | 1343 return n; |
| 1344 } | 1344 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1366 let _GeneratorIterator$ = dart.generic(function(E) { | 1366 let _GeneratorIterator$ = dart.generic(function(E) { |
| 1367 class _GeneratorIterator extends Object { | 1367 class _GeneratorIterator extends Object { |
| 1368 _GeneratorIterator(index, end, generator) { | 1368 _GeneratorIterator(index, end, generator) { |
| 1369 this[_index] = index; | 1369 this[_index] = index; |
| 1370 this[_end] = end; | 1370 this[_end] = end; |
| 1371 this[_generator] = generator; | 1371 this[_generator] = generator; |
| 1372 this[_current] = null; | 1372 this[_current] = null; |
| 1373 } | 1373 } |
| 1374 moveNext() { | 1374 moveNext() { |
| 1375 if (dart.notNull(this[_index]) < dart.notNull(this[_end])) { | 1375 if (dart.notNull(this[_index]) < dart.notNull(this[_end])) { |
| 1376 this[_current] = this[_generator](this[_index]); | 1376 this[_current] = dart.dcall(this[_generator], this[_index]); |
| 1377 this[_index] = dart.notNull(this[_index]) + 1; | 1377 this[_index] = dart.notNull(this[_index]) + 1; |
| 1378 return true; | 1378 return true; |
| 1379 } else { | 1379 } else { |
| 1380 this[_current] = null; | 1380 this[_current] = null; |
| 1381 return false; | 1381 return false; |
| 1382 } | 1382 } |
| 1383 } | 1383 } |
| 1384 get current() { | 1384 get current() { |
| 1385 return this[_current]; | 1385 return this[_current]; |
| 1386 } | 1386 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1409 static new(length) { | 1409 static new(length) { |
| 1410 if (length === void 0) | 1410 if (length === void 0) |
| 1411 length = null; | 1411 length = null; |
| 1412 let list = null; | 1412 let list = null; |
| 1413 if (length == null) { | 1413 if (length == null) { |
| 1414 list = []; | 1414 list = []; |
| 1415 } else { | 1415 } else { |
| 1416 if (!(typeof length == 'number') || dart.notNull(length) < 0) { | 1416 if (!(typeof length == 'number') || dart.notNull(length) < 0) { |
| 1417 dart.throw(new ArgumentError(`Length must be a non-negative integer:
${length}`)); | 1417 dart.throw(new ArgumentError(`Length must be a non-negative integer:
${length}`)); |
| 1418 } | 1418 } |
| 1419 list = _interceptors.JSArray.markFixedList(dart.as(new Array(length),
List$())); | 1419 list = dart.dcall(_interceptors.JSArray.markFixedList, new Array(lengt
h)); |
| 1420 } | 1420 } |
| 1421 return _interceptors.JSArray$(E).typed(list); | 1421 return _interceptors.JSArray$(E).typed(list); |
| 1422 } | 1422 } |
| 1423 static filled(length, fill) { | 1423 static filled(length, fill) { |
| 1424 let result = List$(E).new(length); | 1424 let result = List$(E).new(length); |
| 1425 if (length != 0 && fill != null) { | 1425 if (length != 0 && fill != null) { |
| 1426 for (let i = 0; dart.notNull(i) < dart.notNull(result[dartx.length]);
i = dart.notNull(i) + 1) { | 1426 for (let i = 0; dart.notNull(i) < dart.notNull(result[dartx.length]);
i = dart.notNull(i) + 1) { |
| 1427 result[dartx.set](i, fill); | 1427 result[dartx.set](i, fill); |
| 1428 } | 1428 } |
| 1429 } | 1429 } |
| 1430 return result; | 1430 return result; |
| 1431 } | 1431 } |
| 1432 static from(elements, opts) { | 1432 static from(elements, opts) { |
| 1433 let growable = opts && 'growable' in opts ? opts.growable : true; | 1433 let growable = opts && 'growable' in opts ? opts.growable : true; |
| 1434 let list = List$(E).new(); | 1434 let list = List$(E).new(); |
| 1435 for (let e of elements) { | 1435 for (let e of elements) { |
| 1436 list[dartx.add](dart.as(e, E)); | 1436 dart.dcall(list[dartx.add], e); |
| 1437 } | 1437 } |
| 1438 if (dart.notNull(growable)) | 1438 if (dart.notNull(growable)) |
| 1439 return list; | 1439 return list; |
| 1440 return dart.as(_internal.makeListFixedLength(list), List$(E)); | 1440 return dart.as(dart.dcall(_internal.makeListFixedLength, list), List$(E)
); |
| 1441 } | 1441 } |
| 1442 static generate(length, generator, opts) { | 1442 static generate(length, generator, opts) { |
| 1443 let growable = opts && 'growable' in opts ? opts.growable : true; | 1443 let growable = opts && 'growable' in opts ? opts.growable : true; |
| 1444 let result = null; | 1444 let result = null; |
| 1445 if (dart.notNull(growable)) { | 1445 if (dart.notNull(growable)) { |
| 1446 result = dart.list([], E); | 1446 result = dart.list([], E); |
| 1447 result[dartx.length] = length; | 1447 result[dartx.length] = length; |
| 1448 } else { | 1448 } else { |
| 1449 result = List$(E).new(length); | 1449 result = List$(E).new(length); |
| 1450 } | 1450 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1508 } | 1508 } |
| 1509 } | 1509 } |
| 1510 dart.setSignature(Null, { | 1510 dart.setSignature(Null, { |
| 1511 constructors: () => ({_uninstantiable: [Null, []]}) | 1511 constructors: () => ({_uninstantiable: [Null, []]}) |
| 1512 }); | 1512 }); |
| 1513 num._parseError = false; | 1513 num._parseError = false; |
| 1514 class Pattern extends Object {} | 1514 class Pattern extends Object {} |
| 1515 function print(object) { | 1515 function print(object) { |
| 1516 let line = `${object}`; | 1516 let line = `${object}`; |
| 1517 if (_internal.printToZone == null) { | 1517 if (_internal.printToZone == null) { |
| 1518 _internal.printToConsole(line); | 1518 dart.dcall(_internal.printToConsole, line); |
| 1519 } else { | 1519 } else { |
| 1520 dart.dcall(_internal.printToZone, line); | 1520 dart.dcall(_internal.printToZone, line); |
| 1521 } | 1521 } |
| 1522 } | 1522 } |
| 1523 dart.fn(print, dart.void, [Object]); | 1523 dart.fn(print, dart.void, [Object]); |
| 1524 class Match extends Object {} | 1524 class Match extends Object {} |
| 1525 class RegExp extends Object { | 1525 class RegExp extends Object { |
| 1526 static new(source, opts) { | 1526 static new(source, opts) { |
| 1527 let multiLine = opts && 'multiLine' in opts ? opts.multiLine : false; | 1527 let multiLine = opts && 'multiLine' in opts ? opts.multiLine : false; |
| 1528 let caseSensitive = opts && 'caseSensitive' in opts ? opts.caseSensitive :
true; | 1528 let caseSensitive = opts && 'caseSensitive' in opts ? opts.caseSensitive :
true; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1563 let Sink = Sink$(); | 1563 let Sink = Sink$(); |
| 1564 class StackTrace extends Object {} | 1564 class StackTrace extends Object {} |
| 1565 let _stop = dart.JsSymbol('_stop'); | 1565 let _stop = dart.JsSymbol('_stop'); |
| 1566 class Stopwatch extends Object { | 1566 class Stopwatch extends Object { |
| 1567 get frequency() { | 1567 get frequency() { |
| 1568 return Stopwatch._frequency; | 1568 return Stopwatch._frequency; |
| 1569 } | 1569 } |
| 1570 Stopwatch() { | 1570 Stopwatch() { |
| 1571 this[_start] = null; | 1571 this[_start] = null; |
| 1572 this[_stop] = null; | 1572 this[_stop] = null; |
| 1573 Stopwatch._initTicker(); | 1573 dart.dcall(Stopwatch._initTicker); |
| 1574 } | 1574 } |
| 1575 start() { | 1575 start() { |
| 1576 if (dart.notNull(this.isRunning)) | 1576 if (dart.notNull(this.isRunning)) |
| 1577 return; | 1577 return; |
| 1578 if (this[_start] == null) { | 1578 if (this[_start] == null) { |
| 1579 this[_start] = Stopwatch._now(); | 1579 this[_start] = dart.dcall(Stopwatch._now); |
| 1580 } else { | 1580 } else { |
| 1581 this[_start] = dart.notNull(Stopwatch._now()) - (dart.notNull(this[_stop
]) - dart.notNull(this[_start])); | 1581 this[_start] = dart.notNull(dart.dcall(Stopwatch._now)) - (dart.notNull(
this[_stop]) - dart.notNull(this[_start])); |
| 1582 this[_stop] = null; | 1582 this[_stop] = null; |
| 1583 } | 1583 } |
| 1584 } | 1584 } |
| 1585 stop() { | 1585 stop() { |
| 1586 if (!dart.notNull(this.isRunning)) | 1586 if (!dart.notNull(this.isRunning)) |
| 1587 return; | 1587 return; |
| 1588 this[_stop] = Stopwatch._now(); | 1588 this[_stop] = dart.dcall(Stopwatch._now); |
| 1589 } | 1589 } |
| 1590 reset() { | 1590 reset() { |
| 1591 if (this[_start] == null) | 1591 if (this[_start] == null) |
| 1592 return; | 1592 return; |
| 1593 this[_start] = Stopwatch._now(); | 1593 this[_start] = dart.dcall(Stopwatch._now); |
| 1594 if (this[_stop] != null) { | 1594 if (this[_stop] != null) { |
| 1595 this[_stop] = this[_start]; | 1595 this[_stop] = this[_start]; |
| 1596 } | 1596 } |
| 1597 } | 1597 } |
| 1598 get elapsedTicks() { | 1598 get elapsedTicks() { |
| 1599 if (this[_start] == null) { | 1599 if (this[_start] == null) { |
| 1600 return 0; | 1600 return 0; |
| 1601 } | 1601 } |
| 1602 return this[_stop] == null ? dart.notNull(Stopwatch._now()) - dart.notNull
(this[_start]) : dart.notNull(this[_stop]) - dart.notNull(this[_start]); | 1602 return this[_stop] == null ? dart.notNull(dart.dcall(Stopwatch._now)) - da
rt.notNull(this[_start]) : dart.notNull(this[_stop]) - dart.notNull(this[_start]
); |
| 1603 } | 1603 } |
| 1604 get elapsed() { | 1604 get elapsed() { |
| 1605 return new Duration({microseconds: this.elapsedMicroseconds}); | 1605 return new Duration({microseconds: this.elapsedMicroseconds}); |
| 1606 } | 1606 } |
| 1607 get elapsedMicroseconds() { | 1607 get elapsedMicroseconds() { |
| 1608 return (dart.notNull(this.elapsedTicks) * 1000000 / dart.notNull(this.freq
uency))[dartx.truncate](); | 1608 return (dart.notNull(this.elapsedTicks) * 1000000 / dart.notNull(this.freq
uency))[dartx.truncate](); |
| 1609 } | 1609 } |
| 1610 get elapsedMilliseconds() { | 1610 get elapsedMilliseconds() { |
| 1611 return (dart.notNull(this.elapsedTicks) * 1000 / dart.notNull(this.frequen
cy))[dartx.truncate](); | 1611 return (dart.notNull(this.elapsedTicks) * 1000 / dart.notNull(this.frequen
cy))[dartx.truncate](); |
| 1612 } | 1612 } |
| 1613 get isRunning() { | 1613 get isRunning() { |
| 1614 return this[_start] != null && this[_stop] == null; | 1614 return this[_start] != null && this[_stop] == null; |
| 1615 } | 1615 } |
| 1616 static _initTicker() { | 1616 static _initTicker() { |
| 1617 _js_helper.Primitives.initTicker(); | 1617 dart.dcall(_js_helper.Primitives.initTicker); |
| 1618 Stopwatch._frequency = _js_helper.Primitives.timerFrequency; | 1618 Stopwatch._frequency = _js_helper.Primitives.timerFrequency; |
| 1619 } | 1619 } |
| 1620 static _now() { | 1620 static _now() { |
| 1621 return dart.as(dart.dcall(_js_helper.Primitives.timerTicks), int); | 1621 return dart.as(dart.dcall(_js_helper.Primitives.timerTicks), int); |
| 1622 } | 1622 } |
| 1623 } | 1623 } |
| 1624 dart.setSignature(Stopwatch, { | 1624 dart.setSignature(Stopwatch, { |
| 1625 constructors: () => ({Stopwatch: [Stopwatch, []]}), | 1625 constructors: () => ({Stopwatch: [Stopwatch, []]}), |
| 1626 methods: () => ({ | 1626 methods: () => ({ |
| 1627 start: [dart.void, []], | 1627 start: [dart.void, []], |
| 1628 stop: [dart.void, []], | 1628 stop: [dart.void, []], |
| 1629 reset: [dart.void, []] | 1629 reset: [dart.void, []] |
| 1630 }), | 1630 }), |
| 1631 statics: () => ({ | 1631 statics: () => ({ |
| 1632 _initTicker: [dart.void, []], | 1632 _initTicker: [dart.void, []], |
| 1633 _now: [int, []] | 1633 _now: [int, []] |
| 1634 }), | 1634 }), |
| 1635 names: ['_initTicker', '_now'] | 1635 names: ['_initTicker', '_now'] |
| 1636 }); | 1636 }); |
| 1637 Stopwatch._frequency = null; | 1637 Stopwatch._frequency = null; |
| 1638 class String extends Object { | 1638 class String extends Object { |
| 1639 static fromCharCodes(charCodes, start, end) { | 1639 static fromCharCodes(charCodes, start, end) { |
| 1640 if (start === void 0) | 1640 if (start === void 0) |
| 1641 start = 0; | 1641 start = 0; |
| 1642 if (end === void 0) | 1642 if (end === void 0) |
| 1643 end = null; | 1643 end = null; |
| 1644 if (!dart.is(charCodes, _interceptors.JSArray)) { | 1644 if (!dart.is(charCodes, _interceptors.JSArray)) { |
| 1645 return String._stringFromIterable(charCodes, start, end); | 1645 return dart.dcall(String._stringFromIterable, charCodes, start, end); |
| 1646 } | 1646 } |
| 1647 let list = dart.as(charCodes, List); | 1647 let list = dart.as(charCodes, List); |
| 1648 let len = list[dartx.length]; | 1648 let len = list[dartx.length]; |
| 1649 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(len)) { | 1649 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(len)) { |
| 1650 dart.throw(new RangeError.range(start, 0, len)); | 1650 dart.throw(new RangeError.range(start, 0, len)); |
| 1651 } | 1651 } |
| 1652 if (end == null) { | 1652 if (end == null) { |
| 1653 end = len; | 1653 end = len; |
| 1654 } else if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) >
dart.notNull(len)) { | 1654 } else if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) >
dart.notNull(len)) { |
| 1655 dart.throw(new RangeError.range(end, start, len)); | 1655 dart.throw(new RangeError.range(end, start, len)); |
| 1656 } | 1656 } |
| 1657 if (dart.notNull(start) > 0 || dart.notNull(end) < dart.notNull(len)) { | 1657 if (dart.notNull(start) > 0 || dart.notNull(end) < dart.notNull(len)) { |
| 1658 list = list[dartx.sublist](start, end); | 1658 list = dart.dcall(list[dartx.sublist], start, end); |
| 1659 } | 1659 } |
| 1660 return _js_helper.Primitives.stringFromCharCodes(list); | 1660 return dart.dcall(_js_helper.Primitives.stringFromCharCodes, list); |
| 1661 } | 1661 } |
| 1662 static fromCharCode(charCode) { | 1662 static fromCharCode(charCode) { |
| 1663 return _js_helper.Primitives.stringFromCharCode(charCode); | 1663 return dart.dcall(_js_helper.Primitives.stringFromCharCode, charCode); |
| 1664 } | 1664 } |
| 1665 static fromEnvironment(name, opts) { | 1665 static fromEnvironment(name, opts) { |
| 1666 let defaultValue = opts && 'defaultValue' in opts ? opts.defaultValue : nu
ll; | 1666 let defaultValue = opts && 'defaultValue' in opts ? opts.defaultValue : nu
ll; |
| 1667 dart.throw(new UnsupportedError('String.fromEnvironment can only be used a
s a const constructor')); | 1667 dart.throw(new UnsupportedError('String.fromEnvironment can only be used a
s a const constructor')); |
| 1668 } | 1668 } |
| 1669 static _stringFromIterable(charCodes, start, end) { | 1669 static _stringFromIterable(charCodes, start, end) { |
| 1670 if (dart.notNull(start) < 0) | 1670 if (dart.notNull(start) < 0) |
| 1671 dart.throw(new RangeError.range(start, 0, charCodes[dartx.length])); | 1671 dart.throw(new RangeError.range(start, 0, charCodes[dartx.length])); |
| 1672 if (end != null && dart.notNull(end) < dart.notNull(start)) { | 1672 if (end != null && dart.notNull(end) < dart.notNull(start)) { |
| 1673 dart.throw(new RangeError.range(end, start, charCodes[dartx.length])); | 1673 dart.throw(new RangeError.range(end, start, charCodes[dartx.length])); |
| 1674 } | 1674 } |
| 1675 let it = charCodes[dartx.iterator]; | 1675 let it = charCodes[dartx.iterator]; |
| 1676 for (let i = 0; dart.notNull(i) < dart.notNull(start); i = dart.notNull(i)
+ 1) { | 1676 for (let i = 0; dart.notNull(i) < dart.notNull(start); i = dart.notNull(i)
+ 1) { |
| 1677 if (!dart.notNull(it.moveNext())) { | 1677 if (!dart.notNull(dart.as(dart.dsend(it, 'moveNext'), bool))) { |
| 1678 dart.throw(new RangeError.range(start, 0, i)); | 1678 dart.throw(new RangeError.range(start, 0, i)); |
| 1679 } | 1679 } |
| 1680 } | 1680 } |
| 1681 let list = []; | 1681 let list = []; |
| 1682 if (end == null) { | 1682 if (end == null) { |
| 1683 while (dart.notNull(it.moveNext())) | 1683 while (dart.notNull(dart.as(dart.dsend(it, 'moveNext'), bool))) |
| 1684 list[dartx.add](it.current); | 1684 dart.dsend(list, 'add', dart.dload(it, 'current')); |
| 1685 } else { | 1685 } else { |
| 1686 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul
l(i) + 1) { | 1686 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul
l(i) + 1) { |
| 1687 if (!dart.notNull(it.moveNext())) { | 1687 if (!dart.notNull(dart.as(dart.dsend(it, 'moveNext'), bool))) { |
| 1688 dart.throw(new RangeError.range(end, start, i)); | 1688 dart.throw(new RangeError.range(end, start, i)); |
| 1689 } | 1689 } |
| 1690 list[dartx.add](it.current); | 1690 dart.dsend(list, 'add', dart.dload(it, 'current')); |
| 1691 } | 1691 } |
| 1692 } | 1692 } |
| 1693 return _js_helper.Primitives.stringFromCharCodes(list); | 1693 return dart.dcall(_js_helper.Primitives.stringFromCharCodes, list); |
| 1694 } | 1694 } |
| 1695 } | 1695 } |
| 1696 String[dart.implements] = () => [Comparable$(String), Pattern]; | 1696 String[dart.implements] = () => [Comparable$(String), Pattern]; |
| 1697 dart.setSignature(String, { | 1697 dart.setSignature(String, { |
| 1698 constructors: () => ({ | 1698 constructors: () => ({ |
| 1699 fromCharCodes: [String, [Iterable$(int)], [int, int]], | 1699 fromCharCodes: [String, [Iterable$(int)], [int, int]], |
| 1700 fromCharCode: [String, [int]], | 1700 fromCharCode: [String, [int]], |
| 1701 fromEnvironment: [String, [String], {defaultValue: String}] | 1701 fromEnvironment: [String, [String], {defaultValue: String}] |
| 1702 }), | 1702 }), |
| 1703 statics: () => ({_stringFromIterable: [String, [Iterable$(int), int, int]]})
, | 1703 statics: () => ({_stringFromIterable: [String, [Iterable$(int), int, int]]})
, |
| 1704 names: ['_stringFromIterable'] | 1704 names: ['_stringFromIterable'] |
| 1705 }); | 1705 }); |
| 1706 dart.defineLazyClass(exports, { | 1706 dart.defineLazyClass(exports, { |
| 1707 get Runes() { | 1707 get Runes() { |
| 1708 class Runes extends collection.IterableBase$(int) { | 1708 class Runes extends collection.IterableBase$(int) { |
| 1709 Runes(string) { | 1709 Runes(string) { |
| 1710 this.string = string; | 1710 this.string = string; |
| 1711 super.IterableBase(); | 1711 super.IterableBase(); |
| 1712 } | 1712 } |
| 1713 get iterator() { | 1713 get iterator() { |
| 1714 return new RuneIterator(this.string); | 1714 return new RuneIterator(this.string); |
| 1715 } | 1715 } |
| 1716 get last() { | 1716 get last() { |
| 1717 if (this.string[dartx.length] == 0) { | 1717 if (this.string[dartx.length] == 0) { |
| 1718 dart.throw(new StateError('No elements.')); | 1718 dart.throw(new StateError('No elements.')); |
| 1719 } | 1719 } |
| 1720 let length = this.string[dartx.length]; | 1720 let length = this.string[dartx.length]; |
| 1721 let code = this.string[dartx.codeUnitAt](dart.notNull(length) - 1); | 1721 let code = dart.dcall(this.string[dartx.codeUnitAt], dart.notNull(leng
th) - 1); |
| 1722 if (dart.notNull(_isTrailSurrogate(code)) && dart.notNull(this.string[
dartx.length]) > 1) { | 1722 if (dart.notNull(dart.dcall(_isTrailSurrogate, code)) && dart.notNull(
this.string[dartx.length]) > 1) { |
| 1723 let previousCode = this.string[dartx.codeUnitAt](dart.notNull(length
) - 2); | 1723 let previousCode = dart.dcall(this.string[dartx.codeUnitAt], dart.no
tNull(length) - 2); |
| 1724 if (dart.notNull(_isLeadSurrogate(previousCode))) { | 1724 if (dart.notNull(dart.dcall(_isLeadSurrogate, previousCode))) { |
| 1725 return _combineSurrogatePair(previousCode, code); | 1725 return dart.dcall(_combineSurrogatePair, previousCode, code); |
| 1726 } | 1726 } |
| 1727 } | 1727 } |
| 1728 return code; | 1728 return code; |
| 1729 } | 1729 } |
| 1730 } | 1730 } |
| 1731 dart.setSignature(Runes, { | 1731 dart.setSignature(Runes, { |
| 1732 constructors: () => ({Runes: [exports.Runes, [String]]}) | 1732 constructors: () => ({Runes: [exports.Runes, [String]]}) |
| 1733 }); | 1733 }); |
| 1734 dart.defineExtensionMembers(Runes, ['iterator', 'last']); | 1734 dart.defineExtensionMembers(Runes, ['iterator', 'last']); |
| 1735 return Runes; | 1735 return Runes; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1756 this.string = string; | 1756 this.string = string; |
| 1757 this[_position] = 0; | 1757 this[_position] = 0; |
| 1758 this[_nextPosition] = 0; | 1758 this[_nextPosition] = 0; |
| 1759 this[_currentCodePoint] = null; | 1759 this[_currentCodePoint] = null; |
| 1760 } | 1760 } |
| 1761 at(string, index) { | 1761 at(string, index) { |
| 1762 this.string = string; | 1762 this.string = string; |
| 1763 this[_position] = index; | 1763 this[_position] = index; |
| 1764 this[_nextPosition] = index; | 1764 this[_nextPosition] = index; |
| 1765 this[_currentCodePoint] = null; | 1765 this[_currentCodePoint] = null; |
| 1766 RangeError.checkValueInInterval(index, 0, string[dartx.length]); | 1766 dart.dcall(RangeError.checkValueInInterval, index, 0, string[dartx.length]
); |
| 1767 this[_checkSplitSurrogate](index); | 1767 dart.dcall(this[_checkSplitSurrogate], index); |
| 1768 } | 1768 } |
| 1769 [_checkSplitSurrogate](index) { | 1769 [_checkSplitSurrogate](index) { |
| 1770 if (dart.notNull(index) > 0 && dart.notNull(index) < dart.notNull(this.str
ing[dartx.length]) && dart.notNull(_isLeadSurrogate(this.string[dartx.codeUnitAt
](dart.notNull(index) - 1))) && dart.notNull(_isTrailSurrogate(this.string[dartx
.codeUnitAt](index)))) { | 1770 if (dart.notNull(index) > 0 && dart.notNull(index) < dart.notNull(this.str
ing[dartx.length]) && dart.notNull(dart.dcall(_isLeadSurrogate, dart.dcall(this.
string[dartx.codeUnitAt], dart.notNull(index) - 1))) && dart.notNull(dart.dcall(
_isTrailSurrogate, dart.dcall(this.string[dartx.codeUnitAt], index)))) { |
| 1771 dart.throw(new ArgumentError(`Index inside surrogate pair: ${index}`)); | 1771 dart.throw(new ArgumentError(`Index inside surrogate pair: ${index}`)); |
| 1772 } | 1772 } |
| 1773 } | 1773 } |
| 1774 get rawIndex() { | 1774 get rawIndex() { |
| 1775 return this[_position] != this[_nextPosition] ? this[_position] : null; | 1775 return this[_position] != this[_nextPosition] ? this[_position] : null; |
| 1776 } | 1776 } |
| 1777 set rawIndex(rawIndex) { | 1777 set rawIndex(rawIndex) { |
| 1778 RangeError.checkValidIndex(rawIndex, this.string, "rawIndex"); | 1778 dart.dcall(RangeError.checkValidIndex, rawIndex, this.string, "rawIndex"); |
| 1779 this.reset(rawIndex); | 1779 dart.dcall(this.reset, rawIndex); |
| 1780 this.moveNext(); | 1780 dart.dcall(this.moveNext); |
| 1781 } | 1781 } |
| 1782 reset(rawIndex) { | 1782 reset(rawIndex) { |
| 1783 if (rawIndex === void 0) | 1783 if (rawIndex === void 0) |
| 1784 rawIndex = 0; | 1784 rawIndex = 0; |
| 1785 RangeError.checkValueInInterval(rawIndex, 0, this.string[dartx.length], "r
awIndex"); | 1785 dart.dcall(RangeError.checkValueInInterval, rawIndex, 0, this.string[dartx
.length], "rawIndex"); |
| 1786 this[_checkSplitSurrogate](rawIndex); | 1786 dart.dcall(this[_checkSplitSurrogate], rawIndex); |
| 1787 this[_position] = this[_nextPosition] = rawIndex; | 1787 this[_position] = this[_nextPosition] = rawIndex; |
| 1788 this[_currentCodePoint] = null; | 1788 this[_currentCodePoint] = null; |
| 1789 } | 1789 } |
| 1790 get current() { | 1790 get current() { |
| 1791 return this[_currentCodePoint]; | 1791 return this[_currentCodePoint]; |
| 1792 } | 1792 } |
| 1793 get currentSize() { | 1793 get currentSize() { |
| 1794 return dart.notNull(this[_nextPosition]) - dart.notNull(this[_position]); | 1794 return dart.notNull(this[_nextPosition]) - dart.notNull(this[_position]); |
| 1795 } | 1795 } |
| 1796 get currentAsString() { | 1796 get currentAsString() { |
| 1797 if (this[_position] == this[_nextPosition]) | 1797 if (this[_position] == this[_nextPosition]) |
| 1798 return null; | 1798 return null; |
| 1799 if (dart.notNull(this[_position]) + 1 == this[_nextPosition]) | 1799 if (dart.notNull(this[_position]) + 1 == this[_nextPosition]) |
| 1800 return this.string[dartx.get](this[_position]); | 1800 return this.string[dartx.get](this[_position]); |
| 1801 return this.string[dartx.substring](this[_position], this[_nextPosition]); | 1801 return dart.dcall(this.string[dartx.substring], this[_position], this[_nex
tPosition]); |
| 1802 } | 1802 } |
| 1803 moveNext() { | 1803 moveNext() { |
| 1804 this[_position] = this[_nextPosition]; | 1804 this[_position] = this[_nextPosition]; |
| 1805 if (this[_position] == this.string[dartx.length]) { | 1805 if (this[_position] == this.string[dartx.length]) { |
| 1806 this[_currentCodePoint] = null; | 1806 this[_currentCodePoint] = null; |
| 1807 return false; | 1807 return false; |
| 1808 } | 1808 } |
| 1809 let codeUnit = this.string[dartx.codeUnitAt](this[_position]); | 1809 let codeUnit = dart.dcall(this.string[dartx.codeUnitAt], this[_position]); |
| 1810 let nextPosition = dart.notNull(this[_position]) + 1; | 1810 let nextPosition = dart.notNull(this[_position]) + 1; |
| 1811 if (dart.notNull(_isLeadSurrogate(codeUnit)) && dart.notNull(nextPosition)
< dart.notNull(this.string[dartx.length])) { | 1811 if (dart.notNull(dart.dcall(_isLeadSurrogate, codeUnit)) && dart.notNull(n
extPosition) < dart.notNull(this.string[dartx.length])) { |
| 1812 let nextCodeUnit = this.string[dartx.codeUnitAt](nextPosition); | 1812 let nextCodeUnit = dart.dcall(this.string[dartx.codeUnitAt], nextPositio
n); |
| 1813 if (dart.notNull(_isTrailSurrogate(nextCodeUnit))) { | 1813 if (dart.notNull(dart.dcall(_isTrailSurrogate, nextCodeUnit))) { |
| 1814 this[_nextPosition] = dart.notNull(nextPosition) + 1; | 1814 this[_nextPosition] = dart.notNull(nextPosition) + 1; |
| 1815 this[_currentCodePoint] = _combineSurrogatePair(codeUnit, nextCodeUnit
); | 1815 this[_currentCodePoint] = dart.dcall(_combineSurrogatePair, codeUnit,
nextCodeUnit); |
| 1816 return true; | 1816 return true; |
| 1817 } | 1817 } |
| 1818 } | 1818 } |
| 1819 this[_nextPosition] = nextPosition; | 1819 this[_nextPosition] = nextPosition; |
| 1820 this[_currentCodePoint] = codeUnit; | 1820 this[_currentCodePoint] = codeUnit; |
| 1821 return true; | 1821 return true; |
| 1822 } | 1822 } |
| 1823 movePrevious() { | 1823 movePrevious() { |
| 1824 this[_nextPosition] = this[_position]; | 1824 this[_nextPosition] = this[_position]; |
| 1825 if (this[_position] == 0) { | 1825 if (this[_position] == 0) { |
| 1826 this[_currentCodePoint] = null; | 1826 this[_currentCodePoint] = null; |
| 1827 return false; | 1827 return false; |
| 1828 } | 1828 } |
| 1829 let position = dart.notNull(this[_position]) - 1; | 1829 let position = dart.notNull(this[_position]) - 1; |
| 1830 let codeUnit = this.string[dartx.codeUnitAt](position); | 1830 let codeUnit = dart.dcall(this.string[dartx.codeUnitAt], position); |
| 1831 if (dart.notNull(_isTrailSurrogate(codeUnit)) && dart.notNull(position) >
0) { | 1831 if (dart.notNull(dart.dcall(_isTrailSurrogate, codeUnit)) && dart.notNull(
position) > 0) { |
| 1832 let prevCodeUnit = this.string[dartx.codeUnitAt](dart.notNull(position)
- 1); | 1832 let prevCodeUnit = dart.dcall(this.string[dartx.codeUnitAt], dart.notNul
l(position) - 1); |
| 1833 if (dart.notNull(_isLeadSurrogate(prevCodeUnit))) { | 1833 if (dart.notNull(dart.dcall(_isLeadSurrogate, prevCodeUnit))) { |
| 1834 this[_position] = dart.notNull(position) - 1; | 1834 this[_position] = dart.notNull(position) - 1; |
| 1835 this[_currentCodePoint] = _combineSurrogatePair(prevCodeUnit, codeUnit
); | 1835 this[_currentCodePoint] = dart.dcall(_combineSurrogatePair, prevCodeUn
it, codeUnit); |
| 1836 return true; | 1836 return true; |
| 1837 } | 1837 } |
| 1838 } | 1838 } |
| 1839 this[_position] = position; | 1839 this[_position] = position; |
| 1840 this[_currentCodePoint] = codeUnit; | 1840 this[_currentCodePoint] = codeUnit; |
| 1841 return true; | 1841 return true; |
| 1842 } | 1842 } |
| 1843 } | 1843 } |
| 1844 RuneIterator[dart.implements] = () => [BidirectionalIterator$(int)]; | 1844 RuneIterator[dart.implements] = () => [BidirectionalIterator$(int)]; |
| 1845 dart.defineNamedConstructor(RuneIterator, 'at'); | 1845 dart.defineNamedConstructor(RuneIterator, 'at'); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1866 get length() { | 1866 get length() { |
| 1867 return this[_contents][dartx.length]; | 1867 return this[_contents][dartx.length]; |
| 1868 } | 1868 } |
| 1869 get isEmpty() { | 1869 get isEmpty() { |
| 1870 return this.length == 0; | 1870 return this.length == 0; |
| 1871 } | 1871 } |
| 1872 get isNotEmpty() { | 1872 get isNotEmpty() { |
| 1873 return !dart.notNull(this.isEmpty); | 1873 return !dart.notNull(this.isEmpty); |
| 1874 } | 1874 } |
| 1875 write(obj) { | 1875 write(obj) { |
| 1876 this[_writeString](`${obj}`); | 1876 dart.dcall(this[_writeString], `${obj}`); |
| 1877 } | 1877 } |
| 1878 writeCharCode(charCode) { | 1878 writeCharCode(charCode) { |
| 1879 this[_writeString](String.fromCharCode(charCode)); | 1879 dart.dcall(this[_writeString], String.fromCharCode(charCode)); |
| 1880 } | 1880 } |
| 1881 writeAll(objects, separator) { | 1881 writeAll(objects, separator) { |
| 1882 if (separator === void 0) | 1882 if (separator === void 0) |
| 1883 separator = ""; | 1883 separator = ""; |
| 1884 let iterator = objects[dartx.iterator]; | 1884 let iterator = objects[dartx.iterator]; |
| 1885 if (!dart.notNull(iterator.moveNext())) | 1885 if (!dart.notNull(dart.dcall(iterator.moveNext))) |
| 1886 return; | 1886 return; |
| 1887 if (dart.notNull(separator[dartx.isEmpty])) { | 1887 if (dart.notNull(separator[dartx.isEmpty])) { |
| 1888 do { | 1888 do { |
| 1889 this.write(iterator.current); | 1889 dart.dcall(this.write, iterator.current); |
| 1890 } while (dart.notNull(iterator.moveNext())); | 1890 } while (dart.notNull(dart.dcall(iterator.moveNext))); |
| 1891 } else { | 1891 } else { |
| 1892 this.write(iterator.current); | 1892 dart.dcall(this.write, iterator.current); |
| 1893 while (dart.notNull(iterator.moveNext())) { | 1893 while (dart.notNull(dart.dcall(iterator.moveNext))) { |
| 1894 this.write(separator); | 1894 dart.dcall(this.write, separator); |
| 1895 this.write(iterator.current); | 1895 dart.dcall(this.write, iterator.current); |
| 1896 } | 1896 } |
| 1897 } | 1897 } |
| 1898 } | 1898 } |
| 1899 writeln(obj) { | 1899 writeln(obj) { |
| 1900 if (obj === void 0) | 1900 if (obj === void 0) |
| 1901 obj = ""; | 1901 obj = ""; |
| 1902 this.write(obj); | 1902 dart.dcall(this.write, obj); |
| 1903 this.write("\n"); | 1903 dart.dcall(this.write, "\n"); |
| 1904 } | 1904 } |
| 1905 clear() { | 1905 clear() { |
| 1906 this[_contents] = ""; | 1906 this[_contents] = ""; |
| 1907 } | 1907 } |
| 1908 toString() { | 1908 toString() { |
| 1909 return _js_helper.Primitives.flattenString(this[_contents]); | 1909 return dart.dcall(_js_helper.Primitives.flattenString, this[_contents]); |
| 1910 } | 1910 } |
| 1911 [_writeString](str) { | 1911 [_writeString](str) { |
| 1912 this[_contents] = _js_helper.Primitives.stringConcatUnchecked(this[_conten
ts], dart.as(str, String)); | 1912 this[_contents] = dart.dcall(_js_helper.Primitives.stringConcatUnchecked,
this[_contents], str); |
| 1913 } | 1913 } |
| 1914 } | 1914 } |
| 1915 StringBuffer[dart.implements] = () => [StringSink]; | 1915 StringBuffer[dart.implements] = () => [StringSink]; |
| 1916 dart.setSignature(StringBuffer, { | 1916 dart.setSignature(StringBuffer, { |
| 1917 constructors: () => ({StringBuffer: [StringBuffer, [], [Object]]}), | 1917 constructors: () => ({StringBuffer: [StringBuffer, [], [Object]]}), |
| 1918 methods: () => ({ | 1918 methods: () => ({ |
| 1919 write: [dart.void, [Object]], | 1919 write: [dart.void, [Object]], |
| 1920 writeCharCode: [dart.void, [int]], | 1920 writeCharCode: [dart.void, [int]], |
| 1921 writeAll: [dart.void, [Iterable], [String]], | 1921 writeAll: [dart.void, [Iterable], [String]], |
| 1922 writeln: [dart.void, [], [Object]], | 1922 writeln: [dart.void, [], [Object]], |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1947 let _hasDotSegments = dart.JsSymbol('_hasDotSegments'); | 1947 let _hasDotSegments = dart.JsSymbol('_hasDotSegments'); |
| 1948 let _removeDotSegments = dart.JsSymbol('_removeDotSegments'); | 1948 let _removeDotSegments = dart.JsSymbol('_removeDotSegments'); |
| 1949 let _toWindowsFilePath = dart.JsSymbol('_toWindowsFilePath'); | 1949 let _toWindowsFilePath = dart.JsSymbol('_toWindowsFilePath'); |
| 1950 let _toFilePath = dart.JsSymbol('_toFilePath'); | 1950 let _toFilePath = dart.JsSymbol('_toFilePath'); |
| 1951 let _isPathAbsolute = dart.JsSymbol('_isPathAbsolute'); | 1951 let _isPathAbsolute = dart.JsSymbol('_isPathAbsolute'); |
| 1952 class Uri extends Object { | 1952 class Uri extends Object { |
| 1953 get authority() { | 1953 get authority() { |
| 1954 if (!dart.notNull(this.hasAuthority)) | 1954 if (!dart.notNull(this.hasAuthority)) |
| 1955 return ""; | 1955 return ""; |
| 1956 let sb = new StringBuffer(); | 1956 let sb = new StringBuffer(); |
| 1957 this[_writeAuthority](sb); | 1957 dart.dcall(this[_writeAuthority], sb); |
| 1958 return dart.toString(sb); | 1958 return dart.as(dart.dsend(sb, 'toString'), String); |
| 1959 } | 1959 } |
| 1960 get userInfo() { | 1960 get userInfo() { |
| 1961 return this[_userInfo]; | 1961 return this[_userInfo]; |
| 1962 } | 1962 } |
| 1963 get host() { | 1963 get host() { |
| 1964 if (this[_host] == null) | 1964 if (this[_host] == null) |
| 1965 return ""; | 1965 return ""; |
| 1966 if (dart.notNull(this[_host][dartx.startsWith]('['))) { | 1966 if (dart.notNull(dart.dcall(this[_host][dartx.startsWith], '['))) { |
| 1967 return this[_host][dartx.substring](1, dart.notNull(this[_host][dartx.le
ngth]) - 1); | 1967 return dart.dcall(this[_host][dartx.substring], 1, dart.notNull(this[_ho
st][dartx.length]) - 1); |
| 1968 } | 1968 } |
| 1969 return this[_host]; | 1969 return this[_host]; |
| 1970 } | 1970 } |
| 1971 get port() { | 1971 get port() { |
| 1972 if (this[_port] == null) | 1972 if (this[_port] == null) |
| 1973 return Uri._defaultPort(this.scheme); | 1973 return dart.dcall(Uri._defaultPort, this.scheme); |
| 1974 return this[_port]; | 1974 return this[_port]; |
| 1975 } | 1975 } |
| 1976 static _defaultPort(scheme) { | 1976 static _defaultPort(scheme) { |
| 1977 if (scheme == "http") | 1977 if (scheme == "http") |
| 1978 return 80; | 1978 return 80; |
| 1979 if (scheme == "https") | 1979 if (scheme == "https") |
| 1980 return 443; | 1980 return 443; |
| 1981 return 0; | 1981 return 0; |
| 1982 } | 1982 } |
| 1983 get path() { | 1983 get path() { |
| 1984 return this[_path]; | 1984 return this[_path]; |
| 1985 } | 1985 } |
| 1986 get query() { | 1986 get query() { |
| 1987 return this[_query] == null ? "" : this[_query]; | 1987 return this[_query] == null ? "" : this[_query]; |
| 1988 } | 1988 } |
| 1989 get fragment() { | 1989 get fragment() { |
| 1990 return this[_fragment] == null ? "" : this[_fragment]; | 1990 return this[_fragment] == null ? "" : this[_fragment]; |
| 1991 } | 1991 } |
| 1992 static parse(uri) { | 1992 static parse(uri) { |
| 1993 function isRegName(ch) { | 1993 function isRegName(ch) { |
| 1994 return dart.notNull(ch) < 128 && !dart.equals(dart.dsend(Uri._regNameTab
le[dartx.get](dart.notNull(ch) >> 4), '&', 1 << (dart.notNull(ch) & 15)), 0); | 1994 return dart.notNull(ch) < 128 && !dart.equals(dart.dsend(dart.dindex(Uri
._regNameTable, dart.notNull(ch) >> 4), '&', 1 << (dart.notNull(ch) & 15)), 0); |
| 1995 } | 1995 } |
| 1996 dart.fn(isRegName, bool, [int]); | 1996 dart.fn(isRegName, bool, [int]); |
| 1997 let EOI = -1; | 1997 let EOI = -1; |
| 1998 let scheme = ""; | 1998 let scheme = ""; |
| 1999 let userinfo = ""; | 1999 let userinfo = ""; |
| 2000 let host = null; | 2000 let host = null; |
| 2001 let port = null; | 2001 let port = null; |
| 2002 let path = null; | 2002 let path = null; |
| 2003 let query = null; | 2003 let query = null; |
| 2004 let fragment = null; | 2004 let fragment = null; |
| 2005 let index = 0; | 2005 let index = 0; |
| 2006 let pathStart = 0; | 2006 let pathStart = 0; |
| 2007 let char = EOI; | 2007 let char = EOI; |
| 2008 function parseAuth() { | 2008 function parseAuth() { |
| 2009 if (index == uri[dartx.length]) { | 2009 if (index == uri[dartx.length]) { |
| 2010 char = EOI; | 2010 char = EOI; |
| 2011 return; | 2011 return; |
| 2012 } | 2012 } |
| 2013 let authStart = index; | 2013 let authStart = index; |
| 2014 let lastColon = -1; | 2014 let lastColon = -1; |
| 2015 let lastAt = -1; | 2015 let lastAt = -1; |
| 2016 char = uri[dartx.codeUnitAt](index); | 2016 char = dart.dcall(uri[dartx.codeUnitAt], index); |
| 2017 while (dart.notNull(index) < dart.notNull(uri[dartx.length])) { | 2017 while (dart.notNull(index) < dart.notNull(uri[dartx.length])) { |
| 2018 char = uri[dartx.codeUnitAt](index); | 2018 char = dart.dcall(uri[dartx.codeUnitAt], index); |
| 2019 if (char == Uri._SLASH || char == Uri._QUESTION || char == Uri._NUMBER
_SIGN) { | 2019 if (char == Uri._SLASH || char == Uri._QUESTION || char == Uri._NUMBER
_SIGN) { |
| 2020 break; | 2020 break; |
| 2021 } | 2021 } |
| 2022 if (char == Uri._AT_SIGN) { | 2022 if (char == Uri._AT_SIGN) { |
| 2023 lastAt = index; | 2023 lastAt = index; |
| 2024 lastColon = -1; | 2024 lastColon = -1; |
| 2025 } else if (char == Uri._COLON) { | 2025 } else if (char == Uri._COLON) { |
| 2026 lastColon = index; | 2026 lastColon = index; |
| 2027 } else if (char == Uri._LEFT_BRACKET) { | 2027 } else if (char == Uri._LEFT_BRACKET) { |
| 2028 lastColon = -1; | 2028 lastColon = -1; |
| 2029 let endBracket = uri[dartx.indexOf](']', dart.notNull(index) + 1); | 2029 let endBracket = dart.dcall(uri[dartx.indexOf], ']', dart.notNull(in
dex) + 1); |
| 2030 if (endBracket == -1) { | 2030 if (endBracket == -1) { |
| 2031 index = uri[dartx.length]; | 2031 index = uri[dartx.length]; |
| 2032 char = EOI; | 2032 char = EOI; |
| 2033 break; | 2033 break; |
| 2034 } else { | 2034 } else { |
| 2035 index = endBracket; | 2035 index = endBracket; |
| 2036 } | 2036 } |
| 2037 } | 2037 } |
| 2038 index = dart.notNull(index) + 1; | 2038 index = dart.notNull(index) + 1; |
| 2039 char = EOI; | 2039 char = EOI; |
| 2040 } | 2040 } |
| 2041 let hostStart = authStart; | 2041 let hostStart = authStart; |
| 2042 let hostEnd = index; | 2042 let hostEnd = index; |
| 2043 if (dart.notNull(lastAt) >= 0) { | 2043 if (dart.notNull(lastAt) >= 0) { |
| 2044 userinfo = Uri._makeUserInfo(uri, authStart, lastAt); | 2044 userinfo = dart.dcall(Uri._makeUserInfo, uri, authStart, lastAt); |
| 2045 hostStart = dart.notNull(lastAt) + 1; | 2045 hostStart = dart.notNull(lastAt) + 1; |
| 2046 } | 2046 } |
| 2047 if (dart.notNull(lastColon) >= 0) { | 2047 if (dart.notNull(lastColon) >= 0) { |
| 2048 let portNumber = null; | 2048 let portNumber = null; |
| 2049 if (dart.notNull(lastColon) + 1 < dart.notNull(index)) { | 2049 if (dart.notNull(lastColon) + 1 < dart.notNull(index)) { |
| 2050 portNumber = 0; | 2050 portNumber = 0; |
| 2051 for (let i = dart.notNull(lastColon) + 1; dart.notNull(i) < dart.not
Null(index); i = dart.notNull(i) + 1) { | 2051 for (let i = dart.notNull(lastColon) + 1; dart.notNull(i) < dart.not
Null(index); i = dart.notNull(i) + 1) { |
| 2052 let digit = uri[dartx.codeUnitAt](i); | 2052 let digit = dart.dcall(uri[dartx.codeUnitAt], i); |
| 2053 if (dart.notNull(Uri._ZERO) > dart.notNull(digit) || dart.notNull(
Uri._NINE) < dart.notNull(digit)) { | 2053 if (dart.notNull(Uri._ZERO) > dart.notNull(digit) || dart.notNull(
Uri._NINE) < dart.notNull(digit)) { |
| 2054 Uri._fail(uri, i, "Invalid port number"); | 2054 dart.dcall(Uri._fail, uri, i, "Invalid port number"); |
| 2055 } | 2055 } |
| 2056 portNumber = dart.notNull(portNumber) * 10 + (dart.notNull(digit)
- dart.notNull(Uri._ZERO)); | 2056 portNumber = dart.notNull(portNumber) * 10 + (dart.notNull(digit)
- dart.notNull(Uri._ZERO)); |
| 2057 } | 2057 } |
| 2058 } | 2058 } |
| 2059 port = Uri._makePort(portNumber, scheme); | 2059 port = dart.dcall(Uri._makePort, portNumber, scheme); |
| 2060 hostEnd = lastColon; | 2060 hostEnd = lastColon; |
| 2061 } | 2061 } |
| 2062 host = Uri._makeHost(uri, hostStart, hostEnd, true); | 2062 host = dart.dcall(Uri._makeHost, uri, hostStart, hostEnd, true); |
| 2063 if (dart.notNull(index) < dart.notNull(uri[dartx.length])) { | 2063 if (dart.notNull(index) < dart.notNull(uri[dartx.length])) { |
| 2064 char = uri[dartx.codeUnitAt](index); | 2064 char = dart.dcall(uri[dartx.codeUnitAt], index); |
| 2065 } | 2065 } |
| 2066 } | 2066 } |
| 2067 dart.fn(parseAuth, dart.void, []); | 2067 dart.fn(parseAuth, dart.void, []); |
| 2068 let NOT_IN_PATH = 0; | 2068 let NOT_IN_PATH = 0; |
| 2069 let IN_PATH = 1; | 2069 let IN_PATH = 1; |
| 2070 let ALLOW_AUTH = 2; | 2070 let ALLOW_AUTH = 2; |
| 2071 let state = NOT_IN_PATH; | 2071 let state = NOT_IN_PATH; |
| 2072 let i = index; | 2072 let i = index; |
| 2073 while (dart.notNull(i) < dart.notNull(uri[dartx.length])) { | 2073 while (dart.notNull(i) < dart.notNull(uri[dartx.length])) { |
| 2074 char = uri[dartx.codeUnitAt](i); | 2074 char = dart.dcall(uri[dartx.codeUnitAt], i); |
| 2075 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN) { | 2075 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN) { |
| 2076 state = NOT_IN_PATH; | 2076 state = NOT_IN_PATH; |
| 2077 break; | 2077 break; |
| 2078 } | 2078 } |
| 2079 if (char == Uri._SLASH) { | 2079 if (char == Uri._SLASH) { |
| 2080 state = i == 0 ? ALLOW_AUTH : IN_PATH; | 2080 state = i == 0 ? ALLOW_AUTH : IN_PATH; |
| 2081 break; | 2081 break; |
| 2082 } | 2082 } |
| 2083 if (char == Uri._COLON) { | 2083 if (char == Uri._COLON) { |
| 2084 if (i == 0) | 2084 if (i == 0) |
| 2085 Uri._fail(uri, 0, "Invalid empty scheme"); | 2085 dart.dcall(Uri._fail, uri, 0, "Invalid empty scheme"); |
| 2086 scheme = Uri._makeScheme(uri, i); | 2086 scheme = dart.dcall(Uri._makeScheme, uri, i); |
| 2087 i = dart.notNull(i) + 1; | 2087 i = dart.notNull(i) + 1; |
| 2088 pathStart = i; | 2088 pathStart = i; |
| 2089 if (i == uri[dartx.length]) { | 2089 if (i == uri[dartx.length]) { |
| 2090 char = EOI; | 2090 char = EOI; |
| 2091 state = NOT_IN_PATH; | 2091 state = NOT_IN_PATH; |
| 2092 } else { | 2092 } else { |
| 2093 char = uri[dartx.codeUnitAt](i); | 2093 char = dart.dcall(uri[dartx.codeUnitAt], i); |
| 2094 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN) { | 2094 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN) { |
| 2095 state = NOT_IN_PATH; | 2095 state = NOT_IN_PATH; |
| 2096 } else if (char == Uri._SLASH) { | 2096 } else if (char == Uri._SLASH) { |
| 2097 state = ALLOW_AUTH; | 2097 state = ALLOW_AUTH; |
| 2098 } else { | 2098 } else { |
| 2099 state = IN_PATH; | 2099 state = IN_PATH; |
| 2100 } | 2100 } |
| 2101 } | 2101 } |
| 2102 break; | 2102 break; |
| 2103 } | 2103 } |
| 2104 i = dart.notNull(i) + 1; | 2104 i = dart.notNull(i) + 1; |
| 2105 char = EOI; | 2105 char = EOI; |
| 2106 } | 2106 } |
| 2107 index = i; | 2107 index = i; |
| 2108 if (state == ALLOW_AUTH) { | 2108 if (state == ALLOW_AUTH) { |
| 2109 dart.assert(char == Uri._SLASH); | 2109 dart.assert(char == Uri._SLASH); |
| 2110 index = dart.notNull(index) + 1; | 2110 index = dart.notNull(index) + 1; |
| 2111 if (index == uri[dartx.length]) { | 2111 if (index == uri[dartx.length]) { |
| 2112 char = EOI; | 2112 char = EOI; |
| 2113 state = NOT_IN_PATH; | 2113 state = NOT_IN_PATH; |
| 2114 } else { | 2114 } else { |
| 2115 char = uri[dartx.codeUnitAt](index); | 2115 char = dart.dcall(uri[dartx.codeUnitAt], index); |
| 2116 if (char == Uri._SLASH) { | 2116 if (char == Uri._SLASH) { |
| 2117 index = dart.notNull(index) + 1; | 2117 index = dart.notNull(index) + 1; |
| 2118 parseAuth(); | 2118 dart.dcall(parseAuth); |
| 2119 pathStart = index; | 2119 pathStart = index; |
| 2120 } | 2120 } |
| 2121 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN || char == EOI)
{ | 2121 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN || char == EOI)
{ |
| 2122 state = NOT_IN_PATH; | 2122 state = NOT_IN_PATH; |
| 2123 } else { | 2123 } else { |
| 2124 state = IN_PATH; | 2124 state = IN_PATH; |
| 2125 } | 2125 } |
| 2126 } | 2126 } |
| 2127 } | 2127 } |
| 2128 dart.assert(state == IN_PATH || state == NOT_IN_PATH); | 2128 dart.assert(state == IN_PATH || state == NOT_IN_PATH); |
| 2129 if (state == IN_PATH) { | 2129 if (state == IN_PATH) { |
| 2130 while ((index = dart.notNull(index) + 1) < dart.notNull(uri[dartx.length
])) { | 2130 while ((index = dart.notNull(index) + 1) < dart.notNull(uri[dartx.length
])) { |
| 2131 char = uri[dartx.codeUnitAt](index); | 2131 char = dart.dcall(uri[dartx.codeUnitAt], index); |
| 2132 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN) { | 2132 if (char == Uri._QUESTION || char == Uri._NUMBER_SIGN) { |
| 2133 break; | 2133 break; |
| 2134 } | 2134 } |
| 2135 char = EOI; | 2135 char = EOI; |
| 2136 } | 2136 } |
| 2137 state = NOT_IN_PATH; | 2137 state = NOT_IN_PATH; |
| 2138 } | 2138 } |
| 2139 dart.assert(state == NOT_IN_PATH); | 2139 dart.assert(state == NOT_IN_PATH); |
| 2140 let isFile = scheme == "file"; | 2140 let isFile = scheme == "file"; |
| 2141 let ensureLeadingSlash = host != null; | 2141 let ensureLeadingSlash = host != null; |
| 2142 path = Uri._makePath(uri, pathStart, index, null, ensureLeadingSlash, isFi
le); | 2142 path = dart.dcall(Uri._makePath, uri, pathStart, index, null, ensureLeadin
gSlash, isFile); |
| 2143 if (char == Uri._QUESTION) { | 2143 if (char == Uri._QUESTION) { |
| 2144 let numberSignIndex = uri[dartx.indexOf]('#', dart.notNull(index) + 1); | 2144 let numberSignIndex = dart.dcall(uri[dartx.indexOf], '#', dart.notNull(i
ndex) + 1); |
| 2145 if (dart.notNull(numberSignIndex) < 0) { | 2145 if (dart.notNull(numberSignIndex) < 0) { |
| 2146 query = Uri._makeQuery(uri, dart.notNull(index) + 1, uri[dartx.length]
, null); | 2146 query = dart.dcall(Uri._makeQuery, uri, dart.notNull(index) + 1, uri[d
artx.length], null); |
| 2147 } else { | 2147 } else { |
| 2148 query = Uri._makeQuery(uri, dart.notNull(index) + 1, numberSignIndex,
null); | 2148 query = dart.dcall(Uri._makeQuery, uri, dart.notNull(index) + 1, numbe
rSignIndex, null); |
| 2149 fragment = Uri._makeFragment(uri, dart.notNull(numberSignIndex) + 1, u
ri[dartx.length]); | 2149 fragment = dart.dcall(Uri._makeFragment, uri, dart.notNull(numberSignI
ndex) + 1, uri[dartx.length]); |
| 2150 } | 2150 } |
| 2151 } else if (char == Uri._NUMBER_SIGN) { | 2151 } else if (char == Uri._NUMBER_SIGN) { |
| 2152 fragment = Uri._makeFragment(uri, dart.notNull(index) + 1, uri[dartx.len
gth]); | 2152 fragment = dart.dcall(Uri._makeFragment, uri, dart.notNull(index) + 1, u
ri[dartx.length]); |
| 2153 } | 2153 } |
| 2154 return new Uri._internal(scheme, userinfo, host, port, path, query, fragme
nt); | 2154 return new Uri._internal(scheme, userinfo, host, port, path, query, fragme
nt); |
| 2155 } | 2155 } |
| 2156 static _fail(uri, index, message) { | 2156 static _fail(uri, index, message) { |
| 2157 dart.throw(new FormatException(message, uri, index)); | 2157 dart.throw(new FormatException(message, uri, index)); |
| 2158 } | 2158 } |
| 2159 _internal(scheme, userInfo, host, port, path, query, fragment) { | 2159 _internal(scheme, userInfo, host, port, path, query, fragment) { |
| 2160 this.scheme = scheme; | 2160 this.scheme = scheme; |
| 2161 this[_userInfo] = userInfo; | 2161 this[_userInfo] = userInfo; |
| 2162 this[_host] = host; | 2162 this[_host] = host; |
| 2163 this[_port] = port; | 2163 this[_port] = port; |
| 2164 this[_path] = path; | 2164 this[_path] = path; |
| 2165 this[_query] = query; | 2165 this[_query] = query; |
| 2166 this[_fragment] = fragment; | 2166 this[_fragment] = fragment; |
| 2167 this[_pathSegments] = null; | 2167 this[_pathSegments] = null; |
| 2168 this[_queryParameters] = null; | 2168 this[_queryParameters] = null; |
| 2169 } | 2169 } |
| 2170 static new(opts) { | 2170 static new(opts) { |
| 2171 let scheme = opts && 'scheme' in opts ? opts.scheme : ""; | 2171 let scheme = opts && 'scheme' in opts ? opts.scheme : ""; |
| 2172 let userInfo = opts && 'userInfo' in opts ? opts.userInfo : ""; | 2172 let userInfo = opts && 'userInfo' in opts ? opts.userInfo : ""; |
| 2173 let host = opts && 'host' in opts ? opts.host : null; | 2173 let host = opts && 'host' in opts ? opts.host : null; |
| 2174 let port = opts && 'port' in opts ? opts.port : null; | 2174 let port = opts && 'port' in opts ? opts.port : null; |
| 2175 let path = opts && 'path' in opts ? opts.path : null; | 2175 let path = opts && 'path' in opts ? opts.path : null; |
| 2176 let pathSegments = opts && 'pathSegments' in opts ? opts.pathSegments : nu
ll; | 2176 let pathSegments = opts && 'pathSegments' in opts ? opts.pathSegments : nu
ll; |
| 2177 let query = opts && 'query' in opts ? opts.query : null; | 2177 let query = opts && 'query' in opts ? opts.query : null; |
| 2178 let queryParameters = opts && 'queryParameters' in opts ? opts.queryParame
ters : null; | 2178 let queryParameters = opts && 'queryParameters' in opts ? opts.queryParame
ters : null; |
| 2179 let fragment = opts && 'fragment' in opts ? opts.fragment : null; | 2179 let fragment = opts && 'fragment' in opts ? opts.fragment : null; |
| 2180 scheme = Uri._makeScheme(scheme, Uri._stringOrNullLength(scheme)); | 2180 scheme = dart.dcall(Uri._makeScheme, scheme, dart.dcall(Uri._stringOrNullL
ength, scheme)); |
| 2181 userInfo = Uri._makeUserInfo(userInfo, 0, Uri._stringOrNullLength(userInfo
)); | 2181 userInfo = dart.dcall(Uri._makeUserInfo, userInfo, 0, dart.dcall(Uri._stri
ngOrNullLength, userInfo)); |
| 2182 host = Uri._makeHost(host, 0, Uri._stringOrNullLength(host), false); | 2182 host = dart.dcall(Uri._makeHost, host, 0, dart.dcall(Uri._stringOrNullLeng
th, host), false); |
| 2183 if (query == "") | 2183 if (query == "") |
| 2184 query = null; | 2184 query = null; |
| 2185 query = Uri._makeQuery(query, 0, Uri._stringOrNullLength(query), queryPara
meters); | 2185 query = dart.dcall(Uri._makeQuery, query, 0, dart.dcall(Uri._stringOrNullL
ength, query), queryParameters); |
| 2186 fragment = Uri._makeFragment(fragment, 0, Uri._stringOrNullLength(fragment
)); | 2186 fragment = dart.dcall(Uri._makeFragment, fragment, 0, dart.dcall(Uri._stri
ngOrNullLength, fragment)); |
| 2187 port = Uri._makePort(port, scheme); | 2187 port = dart.dcall(Uri._makePort, port, scheme); |
| 2188 let isFile = scheme == "file"; | 2188 let isFile = scheme == "file"; |
| 2189 if (host == null && (dart.notNull(userInfo[dartx.isNotEmpty]) || port != n
ull || dart.notNull(isFile))) { | 2189 if (host == null && (dart.notNull(userInfo[dartx.isNotEmpty]) || port != n
ull || dart.notNull(isFile))) { |
| 2190 host = ""; | 2190 host = ""; |
| 2191 } | 2191 } |
| 2192 let ensureLeadingSlash = host != null; | 2192 let ensureLeadingSlash = host != null; |
| 2193 path = Uri._makePath(path, 0, Uri._stringOrNullLength(path), pathSegments,
ensureLeadingSlash, isFile); | 2193 path = dart.dcall(Uri._makePath, path, 0, dart.dcall(Uri._stringOrNullLeng
th, path), pathSegments, ensureLeadingSlash, isFile); |
| 2194 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme
nt); | 2194 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme
nt); |
| 2195 } | 2195 } |
| 2196 static http(authority, unencodedPath, queryParameters) { | 2196 static http(authority, unencodedPath, queryParameters) { |
| 2197 if (queryParameters === void 0) | 2197 if (queryParameters === void 0) |
| 2198 queryParameters = null; | 2198 queryParameters = null; |
| 2199 return Uri._makeHttpUri("http", authority, unencodedPath, queryParameters)
; | 2199 return dart.dcall(Uri._makeHttpUri, "http", authority, unencodedPath, quer
yParameters); |
| 2200 } | 2200 } |
| 2201 static https(authority, unencodedPath, queryParameters) { | 2201 static https(authority, unencodedPath, queryParameters) { |
| 2202 if (queryParameters === void 0) | 2202 if (queryParameters === void 0) |
| 2203 queryParameters = null; | 2203 queryParameters = null; |
| 2204 return Uri._makeHttpUri("https", authority, unencodedPath, queryParameters
); | 2204 return dart.dcall(Uri._makeHttpUri, "https", authority, unencodedPath, que
ryParameters); |
| 2205 } | 2205 } |
| 2206 static _makeHttpUri(scheme, authority, unencodedPath, queryParameters) { | 2206 static _makeHttpUri(scheme, authority, unencodedPath, queryParameters) { |
| 2207 let userInfo = ""; | 2207 let userInfo = ""; |
| 2208 let host = null; | 2208 let host = null; |
| 2209 let port = null; | 2209 let port = null; |
| 2210 if (authority != null && dart.notNull(authority[dartx.isNotEmpty])) { | 2210 if (authority != null && dart.notNull(authority[dartx.isNotEmpty])) { |
| 2211 let hostStart = 0; | 2211 let hostStart = 0; |
| 2212 let hasUserInfo = false; | 2212 let hasUserInfo = false; |
| 2213 for (let i = 0; dart.notNull(i) < dart.notNull(authority[dartx.length]);
i = dart.notNull(i) + 1) { | 2213 for (let i = 0; dart.notNull(i) < dart.notNull(authority[dartx.length]);
i = dart.notNull(i) + 1) { |
| 2214 if (authority[dartx.codeUnitAt](i) == Uri._AT_SIGN) { | 2214 if (dart.dcall(authority[dartx.codeUnitAt], i) == Uri._AT_SIGN) { |
| 2215 hasUserInfo = true; | 2215 hasUserInfo = true; |
| 2216 userInfo = authority[dartx.substring](0, i); | 2216 userInfo = dart.dcall(authority[dartx.substring], 0, i); |
| 2217 hostStart = dart.notNull(i) + 1; | 2217 hostStart = dart.notNull(i) + 1; |
| 2218 break; | 2218 break; |
| 2219 } | 2219 } |
| 2220 } | 2220 } |
| 2221 let hostEnd = hostStart; | 2221 let hostEnd = hostStart; |
| 2222 if (dart.notNull(hostStart) < dart.notNull(authority[dartx.length]) && a
uthority[dartx.codeUnitAt](hostStart) == Uri._LEFT_BRACKET) { | 2222 if (dart.notNull(dart.as(dart.dsend(hostStart, '<', authority[dartx.leng
th]), bool)) && dart.dcall(authority[dartx.codeUnitAt], hostStart) == Uri._LEFT_
BRACKET) { |
| 2223 for (; dart.notNull(hostEnd) < dart.notNull(authority[dartx.length]);
hostEnd = dart.notNull(hostEnd) + 1) { | 2223 for (; dart.notNull(dart.as(dart.dsend(hostEnd, '<', authority[dartx.l
ength]), bool)); hostEnd = dart.dsend(hostEnd, '+', 1)) { |
| 2224 if (authority[dartx.codeUnitAt](hostEnd) == Uri._RIGHT_BRACKET) | 2224 if (dart.dcall(authority[dartx.codeUnitAt], hostEnd) == Uri._RIGHT_B
RACKET) |
| 2225 break; | 2225 break; |
| 2226 } | 2226 } |
| 2227 if (hostEnd == authority[dartx.length]) { | 2227 if (dart.equals(hostEnd, authority[dartx.length])) { |
| 2228 dart.throw(new FormatException("Invalid IPv6 host entry.", authority
, hostStart)); | 2228 dart.throw(new FormatException("Invalid IPv6 host entry.", authority
, dart.as(hostStart, int))); |
| 2229 } | 2229 } |
| 2230 Uri.parseIPv6Address(authority, dart.notNull(hostStart) + 1, hostEnd); | 2230 dart.dcall(Uri.parseIPv6Address, authority, dart.dsend(hostStart, '+',
1), hostEnd); |
| 2231 hostEnd = dart.notNull(hostEnd) + 1; | 2231 hostEnd = dart.dsend(hostEnd, '+', 1); |
| 2232 if (hostEnd != authority[dartx.length] && authority[dartx.codeUnitAt](
hostEnd) != Uri._COLON) { | 2232 if (!dart.equals(hostEnd, authority[dartx.length]) && dart.dcall(autho
rity[dartx.codeUnitAt], hostEnd) != Uri._COLON) { |
| 2233 dart.throw(new FormatException("Invalid end of authority", authority
, hostEnd)); | 2233 dart.throw(new FormatException("Invalid end of authority", authority
, dart.as(hostEnd, int))); |
| 2234 } | 2234 } |
| 2235 } | 2235 } |
| 2236 let hasPort = false; | 2236 let hasPort = false; |
| 2237 for (; dart.notNull(hostEnd) < dart.notNull(authority[dartx.length]); ho
stEnd = dart.notNull(hostEnd) + 1) { | 2237 for (; dart.notNull(dart.as(dart.dsend(hostEnd, '<', authority[dartx.len
gth]), bool)); hostEnd = dart.dsend(hostEnd, '+', 1)) { |
| 2238 if (authority[dartx.codeUnitAt](hostEnd) == Uri._COLON) { | 2238 if (dart.dcall(authority[dartx.codeUnitAt], hostEnd) == Uri._COLON) { |
| 2239 let portString = authority[dartx.substring](dart.notNull(hostEnd) +
1); | 2239 let portString = dart.dcall(authority[dartx.substring], dart.dsend(h
ostEnd, '+', 1)); |
| 2240 if (dart.notNull(portString[dartx.isNotEmpty])) | 2240 if (dart.notNull(dart.as(dart.dload(portString, 'isNotEmpty'), bool)
)) |
| 2241 port = int.parse(portString); | 2241 port = dart.dcall(int.parse, portString); |
| 2242 break; | 2242 break; |
| 2243 } | 2243 } |
| 2244 } | 2244 } |
| 2245 host = authority[dartx.substring](hostStart, hostEnd); | 2245 host = dart.dcall(authority[dartx.substring], hostStart, hostEnd); |
| 2246 } | 2246 } |
| 2247 return Uri.new({scheme: scheme, userInfo: userInfo, host: dart.as(host, St
ring), port: dart.as(port, int), pathSegments: unencodedPath[dartx.split]("/"),
queryParameters: queryParameters}); | 2247 return Uri.new({scheme: scheme, userInfo: dart.as(userInfo, String), host:
dart.as(host, String), port: dart.as(port, int), pathSegments: dart.dcall(unenc
odedPath[dartx.split], "/"), queryParameters: queryParameters}); |
| 2248 } | 2248 } |
| 2249 static file(path, opts) { | 2249 static file(path, opts) { |
| 2250 let windows = opts && 'windows' in opts ? opts.windows : null; | 2250 let windows = opts && 'windows' in opts ? opts.windows : null; |
| 2251 windows = windows == null ? Uri._isWindows : windows; | 2251 windows = windows == null ? Uri._isWindows : windows; |
| 2252 return dart.notNull(windows) ? dart.as(Uri._makeWindowsFileUrl(path), Uri)
: dart.as(Uri._makeFileUri(path), Uri); | 2252 return dart.notNull(windows) ? dart.as(dart.dcall(Uri._makeWindowsFileUrl,
path), Uri) : dart.as(dart.dcall(Uri._makeFileUri, path), Uri); |
| 2253 } | 2253 } |
| 2254 static get base() { | 2254 static get base() { |
| 2255 let uri = _js_helper.Primitives.currentUri(); | 2255 let uri = dart.dcall(_js_helper.Primitives.currentUri); |
| 2256 if (uri != null) | 2256 if (uri != null) |
| 2257 return Uri.parse(uri); | 2257 return dart.dcall(Uri.parse, uri); |
| 2258 dart.throw(new UnsupportedError("'Uri.base' is not supported")); | 2258 dart.throw(new UnsupportedError("'Uri.base' is not supported")); |
| 2259 } | 2259 } |
| 2260 static get _isWindows() { | 2260 static get _isWindows() { |
| 2261 return false; | 2261 return false; |
| 2262 } | 2262 } |
| 2263 static _checkNonWindowsPathReservedCharacters(segments, argumentError) { | 2263 static _checkNonWindowsPathReservedCharacters(segments, argumentError) { |
| 2264 segments[dartx.forEach](dart.fn(segment => { | 2264 dart.dcall(segments[dartx.forEach], dart.fn(segment => { |
| 2265 if (dart.notNull(dart.as(dart.dsend(segment, 'contains', "/"), bool))) { | 2265 if (dart.notNull(dart.as(dart.dsend(segment, 'contains', "/"), bool))) { |
| 2266 if (dart.notNull(argumentError)) { | 2266 if (dart.notNull(argumentError)) { |
| 2267 dart.throw(new ArgumentError(`Illegal path character ${segment}`)); | 2267 dart.throw(new ArgumentError(`Illegal path character ${segment}`)); |
| 2268 } else { | 2268 } else { |
| 2269 dart.throw(new UnsupportedError(`Illegal path character ${segment}`)
); | 2269 dart.throw(new UnsupportedError(`Illegal path character ${segment}`)
); |
| 2270 } | 2270 } |
| 2271 } | 2271 } |
| 2272 })); | 2272 })); |
| 2273 } | 2273 } |
| 2274 static _checkWindowsPathReservedCharacters(segments, argumentError, firstSeg
ment) { | 2274 static _checkWindowsPathReservedCharacters(segments, argumentError, firstSeg
ment) { |
| 2275 if (firstSegment === void 0) | 2275 if (firstSegment === void 0) |
| 2276 firstSegment = 0; | 2276 firstSegment = 0; |
| 2277 segments[dartx.skip](firstSegment)[dartx.forEach](dart.fn(segment => { | 2277 dart.dcall(dart.dcall(segments[dartx.skip], firstSegment)[dartx.forEach],
dart.fn(segment => { |
| 2278 if (dart.notNull(dart.as(dart.dsend(segment, 'contains', RegExp.new('["*
/:<>?\\\\|]')), bool))) { | 2278 if (dart.notNull(dart.as(dart.dsend(segment, 'contains', RegExp.new('["*
/:<>?\\\\|]')), bool))) { |
| 2279 if (dart.notNull(argumentError)) { | 2279 if (dart.notNull(argumentError)) { |
| 2280 dart.throw(new ArgumentError("Illegal character in path")); | 2280 dart.throw(new ArgumentError("Illegal character in path")); |
| 2281 } else { | 2281 } else { |
| 2282 dart.throw(new UnsupportedError("Illegal character in path")); | 2282 dart.throw(new UnsupportedError("Illegal character in path")); |
| 2283 } | 2283 } |
| 2284 } | 2284 } |
| 2285 })); | 2285 })); |
| 2286 } | 2286 } |
| 2287 static _checkWindowsDriveLetter(charCode, argumentError) { | 2287 static _checkWindowsDriveLetter(charCode, argumentError) { |
| 2288 if (dart.notNull(Uri._UPPER_CASE_A) <= dart.notNull(charCode) && dart.notN
ull(charCode) <= dart.notNull(Uri._UPPER_CASE_Z) || dart.notNull(Uri._LOWER_CASE
_A) <= dart.notNull(charCode) && dart.notNull(charCode) <= dart.notNull(Uri._LOW
ER_CASE_Z)) { | 2288 if (dart.notNull(Uri._UPPER_CASE_A) <= dart.notNull(charCode) && dart.notN
ull(charCode) <= dart.notNull(Uri._UPPER_CASE_Z) || dart.notNull(Uri._LOWER_CASE
_A) <= dart.notNull(charCode) && dart.notNull(charCode) <= dart.notNull(Uri._LOW
ER_CASE_Z)) { |
| 2289 return; | 2289 return; |
| 2290 } | 2290 } |
| 2291 if (dart.notNull(argumentError)) { | 2291 if (dart.notNull(argumentError)) { |
| 2292 dart.throw(new ArgumentError("Illegal drive letter " + dart.notNull(Stri
ng.fromCharCode(charCode)))); | 2292 dart.throw(new ArgumentError("Illegal drive letter " + dart.notNull(Stri
ng.fromCharCode(charCode)))); |
| 2293 } else { | 2293 } else { |
| 2294 dart.throw(new UnsupportedError("Illegal drive letter " + dart.notNull(S
tring.fromCharCode(charCode)))); | 2294 dart.throw(new UnsupportedError("Illegal drive letter " + dart.notNull(S
tring.fromCharCode(charCode)))); |
| 2295 } | 2295 } |
| 2296 } | 2296 } |
| 2297 static _makeFileUri(path) { | 2297 static _makeFileUri(path) { |
| 2298 let sep = "/"; | 2298 let sep = "/"; |
| 2299 if (dart.notNull(path[dartx.startsWith](sep))) { | 2299 if (dart.notNull(dart.dcall(path[dartx.startsWith], sep))) { |
| 2300 return Uri.new({scheme: "file", pathSegments: path[dartx.split](sep)}); | 2300 return Uri.new({scheme: "file", pathSegments: dart.dcall(path[dartx.spli
t], sep)}); |
| 2301 } else { | 2301 } else { |
| 2302 return Uri.new({pathSegments: path[dartx.split](sep)}); | 2302 return Uri.new({pathSegments: dart.dcall(path[dartx.split], sep)}); |
| 2303 } | 2303 } |
| 2304 } | 2304 } |
| 2305 static _makeWindowsFileUrl(path) { | 2305 static _makeWindowsFileUrl(path) { |
| 2306 if (dart.notNull(path[dartx.startsWith]("\\\\?\\"))) { | 2306 if (dart.notNull(dart.dcall(path[dartx.startsWith], "\\\\?\\"))) { |
| 2307 if (dart.notNull(path[dartx.startsWith]("\\\\?\\UNC\\"))) { | 2307 if (dart.notNull(dart.dcall(path[dartx.startsWith], "\\\\?\\UNC\\"))) { |
| 2308 path = `\\${path[dartx.substring](7)}`; | 2308 path = `\\${dart.dcall(path[dartx.substring], 7)}`; |
| 2309 } else { | 2309 } else { |
| 2310 path = path[dartx.substring](4); | 2310 path = dart.dcall(path[dartx.substring], 4); |
| 2311 if (dart.notNull(path[dartx.length]) < 3 || path[dartx.codeUnitAt](1)
!= Uri._COLON || path[dartx.codeUnitAt](2) != Uri._BACKSLASH) { | 2311 if (dart.notNull(path[dartx.length]) < 3 || dart.dcall(path[dartx.code
UnitAt], 1) != Uri._COLON || dart.dcall(path[dartx.codeUnitAt], 2) != Uri._BACKS
LASH) { |
| 2312 dart.throw(new ArgumentError("Windows paths with \\\\?\\ prefix must
be absolute")); | 2312 dart.throw(new ArgumentError("Windows paths with \\\\?\\ prefix must
be absolute")); |
| 2313 } | 2313 } |
| 2314 } | 2314 } |
| 2315 } else { | 2315 } else { |
| 2316 path = path[dartx.replaceAll]("/", "\\"); | 2316 path = dart.dcall(path[dartx.replaceAll], "/", "\\"); |
| 2317 } | 2317 } |
| 2318 let sep = "\\"; | 2318 let sep = "\\"; |
| 2319 if (dart.notNull(path[dartx.length]) > 1 && path[dartx.get](1) == ":") { | 2319 if (dart.notNull(path[dartx.length]) > 1 && path[dartx.get](1) == ":") { |
| 2320 Uri._checkWindowsDriveLetter(path[dartx.codeUnitAt](0), true); | 2320 dart.dcall(Uri._checkWindowsDriveLetter, dart.dcall(path[dartx.codeUnitA
t], 0), true); |
| 2321 if (path[dartx.length] == 2 || path[dartx.codeUnitAt](2) != Uri._BACKSLA
SH) { | 2321 if (path[dartx.length] == 2 || dart.dcall(path[dartx.codeUnitAt], 2) !=
Uri._BACKSLASH) { |
| 2322 dart.throw(new ArgumentError("Windows paths with drive letter must be
absolute")); | 2322 dart.throw(new ArgumentError("Windows paths with drive letter must be
absolute")); |
| 2323 } | 2323 } |
| 2324 let pathSegments = path[dartx.split](sep); | 2324 let pathSegments = dart.dcall(path[dartx.split], sep); |
| 2325 Uri._checkWindowsPathReservedCharacters(pathSegments, true, 1); | 2325 dart.dcall(Uri._checkWindowsPathReservedCharacters, pathSegments, true,
1); |
| 2326 return Uri.new({scheme: "file", pathSegments: pathSegments}); | 2326 return Uri.new({scheme: "file", pathSegments: dart.as(pathSegments, Iter
able$(String))}); |
| 2327 } | 2327 } |
| 2328 if (dart.notNull(path[dartx.length]) > 0 && path[dartx.get](0) == sep) { | 2328 if (dart.notNull(path[dartx.length]) > 0 && path[dartx.get](0) == sep) { |
| 2329 if (dart.notNull(path[dartx.length]) > 1 && path[dartx.get](1) == sep) { | 2329 if (dart.notNull(path[dartx.length]) > 1 && path[dartx.get](1) == sep) { |
| 2330 let pathStart = path[dartx.indexOf]("\\", 2); | 2330 let pathStart = dart.dcall(path[dartx.indexOf], "\\", 2); |
| 2331 let hostPart = pathStart == -1 ? path[dartx.substring](2) : path[dartx
.substring](2, pathStart); | 2331 let hostPart = pathStart == -1 ? dart.dcall(path[dartx.substring], 2)
: dart.dcall(path[dartx.substring], 2, pathStart); |
| 2332 let pathPart = pathStart == -1 ? "" : path[dartx.substring](dart.notNu
ll(pathStart) + 1); | 2332 let pathPart = pathStart == -1 ? "" : dart.dcall(path[dartx.substring]
, dart.notNull(pathStart) + 1); |
| 2333 let pathSegments = pathPart[dartx.split](sep); | 2333 let pathSegments = dart.dcall(pathPart[dartx.split], sep); |
| 2334 Uri._checkWindowsPathReservedCharacters(pathSegments, true); | 2334 dart.dcall(Uri._checkWindowsPathReservedCharacters, pathSegments, true
); |
| 2335 return Uri.new({scheme: "file", host: hostPart, pathSegments: pathSegm
ents}); | 2335 return Uri.new({scheme: "file", host: hostPart, pathSegments: dart.as(
pathSegments, Iterable$(String))}); |
| 2336 } else { | 2336 } else { |
| 2337 let pathSegments = path[dartx.split](sep); | 2337 let pathSegments = dart.dcall(path[dartx.split], sep); |
| 2338 Uri._checkWindowsPathReservedCharacters(pathSegments, true); | 2338 dart.dcall(Uri._checkWindowsPathReservedCharacters, pathSegments, true
); |
| 2339 return Uri.new({scheme: "file", pathSegments: pathSegments}); | 2339 return Uri.new({scheme: "file", pathSegments: dart.as(pathSegments, It
erable$(String))}); |
| 2340 } | 2340 } |
| 2341 } else { | 2341 } else { |
| 2342 let pathSegments = path[dartx.split](sep); | 2342 let pathSegments = dart.dcall(path[dartx.split], sep); |
| 2343 Uri._checkWindowsPathReservedCharacters(pathSegments, true); | 2343 dart.dcall(Uri._checkWindowsPathReservedCharacters, pathSegments, true); |
| 2344 return Uri.new({pathSegments: pathSegments}); | 2344 return Uri.new({pathSegments: dart.as(pathSegments, Iterable$(String))})
; |
| 2345 } | 2345 } |
| 2346 } | 2346 } |
| 2347 replace(opts) { | 2347 replace(opts) { |
| 2348 let scheme = opts && 'scheme' in opts ? opts.scheme : null; | 2348 let scheme = opts && 'scheme' in opts ? opts.scheme : null; |
| 2349 let userInfo = opts && 'userInfo' in opts ? opts.userInfo : null; | 2349 let userInfo = opts && 'userInfo' in opts ? opts.userInfo : null; |
| 2350 let host = opts && 'host' in opts ? opts.host : null; | 2350 let host = opts && 'host' in opts ? opts.host : null; |
| 2351 let port = opts && 'port' in opts ? opts.port : null; | 2351 let port = opts && 'port' in opts ? opts.port : null; |
| 2352 let path = opts && 'path' in opts ? opts.path : null; | 2352 let path = opts && 'path' in opts ? opts.path : null; |
| 2353 let pathSegments = opts && 'pathSegments' in opts ? opts.pathSegments : nu
ll; | 2353 let pathSegments = opts && 'pathSegments' in opts ? opts.pathSegments : nu
ll; |
| 2354 let query = opts && 'query' in opts ? opts.query : null; | 2354 let query = opts && 'query' in opts ? opts.query : null; |
| 2355 let queryParameters = opts && 'queryParameters' in opts ? opts.queryParame
ters : null; | 2355 let queryParameters = opts && 'queryParameters' in opts ? opts.queryParame
ters : null; |
| 2356 let fragment = opts && 'fragment' in opts ? opts.fragment : null; | 2356 let fragment = opts && 'fragment' in opts ? opts.fragment : null; |
| 2357 let schemeChanged = false; | 2357 let schemeChanged = false; |
| 2358 if (scheme != null) { | 2358 if (scheme != null) { |
| 2359 scheme = Uri._makeScheme(scheme, scheme[dartx.length]); | 2359 scheme = dart.dcall(Uri._makeScheme, scheme, scheme[dartx.length]); |
| 2360 schemeChanged = true; | 2360 schemeChanged = true; |
| 2361 } else { | 2361 } else { |
| 2362 scheme = this.scheme; | 2362 scheme = this.scheme; |
| 2363 } | 2363 } |
| 2364 let isFile = scheme == "file"; | 2364 let isFile = scheme == "file"; |
| 2365 if (userInfo != null) { | 2365 if (userInfo != null) { |
| 2366 userInfo = Uri._makeUserInfo(userInfo, 0, userInfo[dartx.length]); | 2366 userInfo = dart.dcall(Uri._makeUserInfo, userInfo, 0, userInfo[dartx.len
gth]); |
| 2367 } else { | 2367 } else { |
| 2368 userInfo = this.userInfo; | 2368 userInfo = this.userInfo; |
| 2369 } | 2369 } |
| 2370 if (port != null) { | 2370 if (port != null) { |
| 2371 port = Uri._makePort(port, scheme); | 2371 port = dart.dcall(Uri._makePort, port, scheme); |
| 2372 } else { | 2372 } else { |
| 2373 port = this[_port]; | 2373 port = this[_port]; |
| 2374 if (dart.notNull(schemeChanged)) { | 2374 if (dart.notNull(schemeChanged)) { |
| 2375 port = Uri._makePort(port, scheme); | 2375 port = dart.dcall(Uri._makePort, port, scheme); |
| 2376 } | 2376 } |
| 2377 } | 2377 } |
| 2378 if (host != null) { | 2378 if (host != null) { |
| 2379 host = Uri._makeHost(host, 0, host[dartx.length], false); | 2379 host = dart.dcall(Uri._makeHost, host, 0, host[dartx.length], false); |
| 2380 } else if (dart.notNull(this.hasAuthority)) { | 2380 } else if (dart.notNull(this.hasAuthority)) { |
| 2381 host = this.host; | 2381 host = this.host; |
| 2382 } else if (dart.notNull(userInfo[dartx.isNotEmpty]) || port != null || dar
t.notNull(isFile)) { | 2382 } else if (dart.notNull(userInfo[dartx.isNotEmpty]) || port != null || dar
t.notNull(isFile)) { |
| 2383 host = ""; | 2383 host = ""; |
| 2384 } | 2384 } |
| 2385 let ensureLeadingSlash = host != null; | 2385 let ensureLeadingSlash = host != null; |
| 2386 if (path != null || pathSegments != null) { | 2386 if (path != null || pathSegments != null) { |
| 2387 path = Uri._makePath(path, 0, Uri._stringOrNullLength(path), pathSegment
s, ensureLeadingSlash, isFile); | 2387 path = dart.dcall(Uri._makePath, path, 0, dart.dcall(Uri._stringOrNullLe
ngth, path), pathSegments, ensureLeadingSlash, isFile); |
| 2388 } else { | 2388 } else { |
| 2389 path = this.path; | 2389 path = this.path; |
| 2390 if ((dart.notNull(isFile) || dart.notNull(ensureLeadingSlash) && !dart.n
otNull(path[dartx.isEmpty])) && !dart.notNull(path[dartx.startsWith]('/'))) { | 2390 if ((dart.notNull(isFile) || dart.notNull(ensureLeadingSlash) && !dart.n
otNull(path[dartx.isEmpty])) && !dart.notNull(dart.dcall(path[dartx.startsWith],
'/'))) { |
| 2391 path = `/${path}`; | 2391 path = `/${path}`; |
| 2392 } | 2392 } |
| 2393 } | 2393 } |
| 2394 if (query != null || queryParameters != null) { | 2394 if (query != null || queryParameters != null) { |
| 2395 query = Uri._makeQuery(query, 0, Uri._stringOrNullLength(query), queryPa
rameters); | 2395 query = dart.dcall(Uri._makeQuery, query, 0, dart.dcall(Uri._stringOrNul
lLength, query), queryParameters); |
| 2396 } else if (dart.notNull(this.hasQuery)) { | 2396 } else if (dart.notNull(this.hasQuery)) { |
| 2397 query = this.query; | 2397 query = this.query; |
| 2398 } | 2398 } |
| 2399 if (fragment != null) { | 2399 if (fragment != null) { |
| 2400 fragment = Uri._makeFragment(fragment, 0, fragment[dartx.length]); | 2400 fragment = dart.dcall(Uri._makeFragment, fragment, 0, fragment[dartx.len
gth]); |
| 2401 } else if (dart.notNull(this.hasFragment)) { | 2401 } else if (dart.notNull(this.hasFragment)) { |
| 2402 fragment = this.fragment; | 2402 fragment = this.fragment; |
| 2403 } | 2403 } |
| 2404 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme
nt); | 2404 return new Uri._internal(scheme, userInfo, host, port, path, query, fragme
nt); |
| 2405 } | 2405 } |
| 2406 get pathSegments() { | 2406 get pathSegments() { |
| 2407 if (this[_pathSegments] == null) { | 2407 if (this[_pathSegments] == null) { |
| 2408 let pathToSplit = !dart.notNull(this.path[dartx.isEmpty]) && this.path[d
artx.codeUnitAt](0) == Uri._SLASH ? this.path[dartx.substring](1) : this.path; | 2408 let pathToSplit = !dart.notNull(this.path[dartx.isEmpty]) && dart.dcall(
this.path[dartx.codeUnitAt], 0) == Uri._SLASH ? dart.dcall(this.path[dartx.subst
ring], 1) : this.path; |
| 2409 this[_pathSegments] = new (collection.UnmodifiableListView$(String))(pat
hToSplit == "" ? dart.const(dart.list([], String)) : List$(String).from(pathToSp
lit[dartx.split]("/")[dartx.map](Uri.decodeComponent), {growable: false})); | 2409 this[_pathSegments] = new (collection.UnmodifiableListView$(String))(dar
t.equals(pathToSplit, "") ? dart.const(dart.list([], String)) : List$(String).fr
om(dart.as(dart.dsend(dart.dsend(pathToSplit, 'split', "/"), 'map', Uri.decodeCo
mponent), Iterable), {growable: false})); |
| 2410 } | 2410 } |
| 2411 return this[_pathSegments]; | 2411 return this[_pathSegments]; |
| 2412 } | 2412 } |
| 2413 get queryParameters() { | 2413 get queryParameters() { |
| 2414 if (this[_queryParameters] == null) { | 2414 if (this[_queryParameters] == null) { |
| 2415 this[_queryParameters] = new (collection.UnmodifiableMapView$(String, St
ring))(Uri.splitQueryString(this.query)); | 2415 this[_queryParameters] = new (collection.UnmodifiableMapView$(String, St
ring))(dart.dcall(Uri.splitQueryString, this.query)); |
| 2416 } | 2416 } |
| 2417 return this[_queryParameters]; | 2417 return this[_queryParameters]; |
| 2418 } | 2418 } |
| 2419 static _makePort(port, scheme) { | 2419 static _makePort(port, scheme) { |
| 2420 if (port != null && port == Uri._defaultPort(scheme)) | 2420 if (port != null && port == dart.dcall(Uri._defaultPort, scheme)) |
| 2421 return null; | 2421 return null; |
| 2422 return port; | 2422 return port; |
| 2423 } | 2423 } |
| 2424 static _makeHost(host, start, end, strictIPv6) { | 2424 static _makeHost(host, start, end, strictIPv6) { |
| 2425 if (host == null) | 2425 if (host == null) |
| 2426 return null; | 2426 return null; |
| 2427 if (start == end) | 2427 if (start == end) |
| 2428 return ""; | 2428 return ""; |
| 2429 if (host[dartx.codeUnitAt](start) == Uri._LEFT_BRACKET) { | 2429 if (dart.dcall(host[dartx.codeUnitAt], start) == Uri._LEFT_BRACKET) { |
| 2430 if (host[dartx.codeUnitAt](dart.notNull(end) - 1) != Uri._RIGHT_BRACKET)
{ | 2430 if (dart.dcall(host[dartx.codeUnitAt], dart.notNull(end) - 1) != Uri._RI
GHT_BRACKET) { |
| 2431 Uri._fail(host, start, 'Missing end `]` to match `[` in host'); | 2431 dart.dcall(Uri._fail, host, start, 'Missing end `]` to match `[` in ho
st'); |
| 2432 } | 2432 } |
| 2433 Uri.parseIPv6Address(host, dart.notNull(start) + 1, dart.notNull(end) -
1); | 2433 dart.dcall(Uri.parseIPv6Address, host, dart.notNull(start) + 1, dart.not
Null(end) - 1); |
| 2434 return host[dartx.substring](start, end)[dartx.toLowerCase](); | 2434 return dart.dcall(dart.dcall(host[dartx.substring], start, end)[dartx.to
LowerCase]); |
| 2435 } | 2435 } |
| 2436 if (!dart.notNull(strictIPv6)) { | 2436 if (!dart.notNull(strictIPv6)) { |
| 2437 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul
l(i) + 1) { | 2437 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul
l(i) + 1) { |
| 2438 if (host[dartx.codeUnitAt](i) == Uri._COLON) { | 2438 if (dart.dcall(host[dartx.codeUnitAt], i) == Uri._COLON) { |
| 2439 Uri.parseIPv6Address(host, start, end); | 2439 dart.dcall(Uri.parseIPv6Address, host, start, end); |
| 2440 return `[${host}]`; | 2440 return `[${host}]`; |
| 2441 } | 2441 } |
| 2442 } | 2442 } |
| 2443 } | 2443 } |
| 2444 return Uri._normalizeRegName(host, start, end); | 2444 return dart.dcall(Uri._normalizeRegName, host, start, end); |
| 2445 } | 2445 } |
| 2446 static _isRegNameChar(char) { | 2446 static _isRegNameChar(char) { |
| 2447 return dart.notNull(char) < 127 && !dart.equals(dart.dsend(Uri._regNameTab
le[dartx.get](dart.notNull(char) >> 4), '&', 1 << (dart.notNull(char) & 15)), 0)
; | 2447 return dart.notNull(char) < 127 && !dart.equals(dart.dsend(dart.dindex(Uri
._regNameTable, dart.notNull(char) >> 4), '&', 1 << (dart.notNull(char) & 15)),
0); |
| 2448 } | 2448 } |
| 2449 static _normalizeRegName(host, start, end) { | 2449 static _normalizeRegName(host, start, end) { |
| 2450 let buffer = null; | 2450 let buffer = null; |
| 2451 let sectionStart = start; | 2451 let sectionStart = start; |
| 2452 let index = start; | 2452 let index = start; |
| 2453 let isNormalized = true; | 2453 let isNormalized = true; |
| 2454 while (dart.notNull(index) < dart.notNull(end)) { | 2454 while (dart.notNull(index) < dart.notNull(end)) { |
| 2455 let char = host[dartx.codeUnitAt](index); | 2455 let char = dart.dcall(host[dartx.codeUnitAt], index); |
| 2456 if (char == Uri._PERCENT) { | 2456 if (char == Uri._PERCENT) { |
| 2457 let replacement = Uri._normalizeEscape(host, index, true); | 2457 let replacement = dart.dcall(Uri._normalizeEscape, host, index, true); |
| 2458 if (replacement == null && dart.notNull(isNormalized)) { | 2458 if (replacement == null && dart.notNull(isNormalized)) { |
| 2459 index = dart.notNull(index) + 3; | 2459 index = dart.notNull(index) + 3; |
| 2460 continue; | 2460 continue; |
| 2461 } | 2461 } |
| 2462 if (buffer == null) | 2462 if (buffer == null) |
| 2463 buffer = new StringBuffer(); | 2463 buffer = new StringBuffer(); |
| 2464 let slice = host[dartx.substring](sectionStart, index); | 2464 let slice = dart.dcall(host[dartx.substring], sectionStart, index); |
| 2465 if (!dart.notNull(isNormalized)) | 2465 if (!dart.notNull(isNormalized)) |
| 2466 slice = slice[dartx.toLowerCase](); | 2466 slice = dart.dcall(slice[dartx.toLowerCase]); |
| 2467 buffer.write(slice); | 2467 dart.dcall(buffer.write, slice); |
| 2468 let sourceLength = 3; | 2468 let sourceLength = 3; |
| 2469 if (replacement == null) { | 2469 if (replacement == null) { |
| 2470 replacement = host[dartx.substring](index, dart.notNull(index) + 3); | 2470 replacement = dart.dcall(host[dartx.substring], index, dart.notNull(
index) + 3); |
| 2471 } else if (replacement == "%") { | 2471 } else if (replacement == "%") { |
| 2472 replacement = "%25"; | 2472 replacement = "%25"; |
| 2473 sourceLength = 1; | 2473 sourceLength = 1; |
| 2474 } | 2474 } |
| 2475 buffer.write(replacement); | 2475 dart.dcall(buffer.write, replacement); |
| 2476 index = dart.notNull(index) + dart.notNull(sourceLength); | 2476 index = dart.notNull(index) + dart.notNull(sourceLength); |
| 2477 sectionStart = index; | 2477 sectionStart = index; |
| 2478 isNormalized = true; | 2478 isNormalized = true; |
| 2479 } else if (dart.notNull(Uri._isRegNameChar(char))) { | 2479 } else if (dart.notNull(dart.dcall(Uri._isRegNameChar, char))) { |
| 2480 if (dart.notNull(isNormalized) && dart.notNull(Uri._UPPER_CASE_A) <= d
art.notNull(char) && dart.notNull(Uri._UPPER_CASE_Z) >= dart.notNull(char)) { | 2480 if (dart.notNull(isNormalized) && dart.notNull(Uri._UPPER_CASE_A) <= d
art.notNull(char) && dart.notNull(Uri._UPPER_CASE_Z) >= dart.notNull(char)) { |
| 2481 if (buffer == null) | 2481 if (buffer == null) |
| 2482 buffer = new StringBuffer(); | 2482 buffer = new StringBuffer(); |
| 2483 if (dart.notNull(sectionStart) < dart.notNull(index)) { | 2483 if (dart.notNull(sectionStart) < dart.notNull(index)) { |
| 2484 buffer.write(host[dartx.substring](sectionStart, index)); | 2484 dart.dcall(buffer.write, dart.dcall(host[dartx.substring], section
Start, index)); |
| 2485 sectionStart = index; | 2485 sectionStart = index; |
| 2486 } | 2486 } |
| 2487 isNormalized = false; | 2487 isNormalized = false; |
| 2488 } | 2488 } |
| 2489 index = dart.notNull(index) + 1; | 2489 index = dart.notNull(index) + 1; |
| 2490 } else if (dart.notNull(Uri._isGeneralDelimiter(char))) { | 2490 } else if (dart.notNull(dart.dcall(Uri._isGeneralDelimiter, char))) { |
| 2491 Uri._fail(host, index, "Invalid character"); | 2491 dart.dcall(Uri._fail, host, index, "Invalid character"); |
| 2492 } else { | 2492 } else { |
| 2493 let sourceLength = 1; | 2493 let sourceLength = 1; |
| 2494 if ((dart.notNull(char) & 64512) == 55296 && dart.notNull(index) + 1 <
dart.notNull(end)) { | 2494 if ((dart.notNull(char) & 64512) == 55296 && dart.notNull(index) + 1 <
dart.notNull(end)) { |
| 2495 let tail = host[dartx.codeUnitAt](dart.notNull(index) + 1); | 2495 let tail = dart.dcall(host[dartx.codeUnitAt], dart.notNull(index) +
1); |
| 2496 if ((dart.notNull(tail) & 64512) == 56320) { | 2496 if ((dart.notNull(tail) & 64512) == 56320) { |
| 2497 char = 65536 | (dart.notNull(char) & 1023) << 10 | dart.notNull(ta
il) & 1023; | 2497 char = 65536 | (dart.notNull(char) & 1023) << 10 | dart.notNull(ta
il) & 1023; |
| 2498 sourceLength = 2; | 2498 sourceLength = 2; |
| 2499 } | 2499 } |
| 2500 } | 2500 } |
| 2501 if (buffer == null) | 2501 if (buffer == null) |
| 2502 buffer = new StringBuffer(); | 2502 buffer = new StringBuffer(); |
| 2503 let slice = host[dartx.substring](sectionStart, index); | 2503 let slice = dart.dcall(host[dartx.substring], sectionStart, index); |
| 2504 if (!dart.notNull(isNormalized)) | 2504 if (!dart.notNull(isNormalized)) |
| 2505 slice = slice[dartx.toLowerCase](); | 2505 slice = dart.dcall(slice[dartx.toLowerCase]); |
| 2506 buffer.write(slice); | 2506 dart.dcall(buffer.write, slice); |
| 2507 buffer.write(Uri._escapeChar(char)); | 2507 dart.dcall(buffer.write, dart.dcall(Uri._escapeChar, char)); |
| 2508 index = dart.notNull(index) + dart.notNull(sourceLength); | 2508 index = dart.notNull(index) + dart.notNull(sourceLength); |
| 2509 sectionStart = index; | 2509 sectionStart = index; |
| 2510 } | 2510 } |
| 2511 } | 2511 } |
| 2512 if (buffer == null) | 2512 if (buffer == null) |
| 2513 return host[dartx.substring](start, end); | 2513 return dart.dcall(host[dartx.substring], start, end); |
| 2514 if (dart.notNull(sectionStart) < dart.notNull(end)) { | 2514 if (dart.notNull(sectionStart) < dart.notNull(end)) { |
| 2515 let slice = host[dartx.substring](sectionStart, end); | 2515 let slice = dart.dcall(host[dartx.substring], sectionStart, end); |
| 2516 if (!dart.notNull(isNormalized)) | 2516 if (!dart.notNull(isNormalized)) |
| 2517 slice = slice[dartx.toLowerCase](); | 2517 slice = dart.dcall(slice[dartx.toLowerCase]); |
| 2518 buffer.write(slice); | 2518 dart.dcall(buffer.write, slice); |
| 2519 } | 2519 } |
| 2520 return dart.toString(buffer); | 2520 return dart.dcall(buffer.toString); |
| 2521 } | 2521 } |
| 2522 static _makeScheme(scheme, end) { | 2522 static _makeScheme(scheme, end) { |
| 2523 if (end == 0) | 2523 if (end == 0) |
| 2524 return ""; | 2524 return ""; |
| 2525 let firstCodeUnit = scheme[dartx.codeUnitAt](0); | 2525 let firstCodeUnit = dart.dcall(scheme[dartx.codeUnitAt], 0); |
| 2526 if (!dart.notNull(Uri._isAlphabeticCharacter(firstCodeUnit))) { | 2526 if (!dart.notNull(dart.dcall(Uri._isAlphabeticCharacter, firstCodeUnit)))
{ |
| 2527 Uri._fail(scheme, 0, "Scheme not starting with alphabetic character"); | 2527 dart.dcall(Uri._fail, scheme, 0, "Scheme not starting with alphabetic ch
aracter"); |
| 2528 } | 2528 } |
| 2529 let allLowercase = dart.notNull(firstCodeUnit) >= dart.notNull(Uri._LOWER_
CASE_A); | 2529 let allLowercase = dart.notNull(firstCodeUnit) >= dart.notNull(Uri._LOWER_
CASE_A); |
| 2530 for (let i = 0; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) +
1) { | 2530 for (let i = 0; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) +
1) { |
| 2531 let codeUnit = scheme[dartx.codeUnitAt](i); | 2531 let codeUnit = dart.dcall(scheme[dartx.codeUnitAt], i); |
| 2532 if (!dart.notNull(Uri._isSchemeCharacter(codeUnit))) { | 2532 if (!dart.notNull(dart.dcall(Uri._isSchemeCharacter, codeUnit))) { |
| 2533 Uri._fail(scheme, i, "Illegal scheme character"); | 2533 dart.dcall(Uri._fail, scheme, i, "Illegal scheme character"); |
| 2534 } | 2534 } |
| 2535 if (dart.notNull(codeUnit) < dart.notNull(Uri._LOWER_CASE_A) || dart.not
Null(codeUnit) > dart.notNull(Uri._LOWER_CASE_Z)) { | 2535 if (dart.notNull(codeUnit) < dart.notNull(Uri._LOWER_CASE_A) || dart.not
Null(codeUnit) > dart.notNull(Uri._LOWER_CASE_Z)) { |
| 2536 allLowercase = false; | 2536 allLowercase = false; |
| 2537 } | 2537 } |
| 2538 } | 2538 } |
| 2539 scheme = scheme[dartx.substring](0, end); | 2539 scheme = dart.dcall(scheme[dartx.substring], 0, end); |
| 2540 if (!dart.notNull(allLowercase)) | 2540 if (!dart.notNull(allLowercase)) |
| 2541 scheme = scheme[dartx.toLowerCase](); | 2541 scheme = dart.dcall(scheme[dartx.toLowerCase]); |
| 2542 return scheme; | 2542 return scheme; |
| 2543 } | 2543 } |
| 2544 static _makeUserInfo(userInfo, start, end) { | 2544 static _makeUserInfo(userInfo, start, end) { |
| 2545 if (userInfo == null) | 2545 if (userInfo == null) |
| 2546 return ""; | 2546 return ""; |
| 2547 return Uri._normalize(userInfo, start, end, dart.as(Uri._userinfoTable, Li
st$(int))); | 2547 return dart.dcall(Uri._normalize, userInfo, start, end, Uri._userinfoTable
); |
| 2548 } | 2548 } |
| 2549 static _makePath(path, start, end, pathSegments, ensureLeadingSlash, isFile)
{ | 2549 static _makePath(path, start, end, pathSegments, ensureLeadingSlash, isFile)
{ |
| 2550 if (path == null && pathSegments == null) | 2550 if (path == null && pathSegments == null) |
| 2551 return dart.notNull(isFile) ? "/" : ""; | 2551 return dart.notNull(isFile) ? "/" : ""; |
| 2552 if (path != null && pathSegments != null) { | 2552 if (path != null && pathSegments != null) { |
| 2553 dart.throw(new ArgumentError('Both path and pathSegments specified')); | 2553 dart.throw(new ArgumentError('Both path and pathSegments specified')); |
| 2554 } | 2554 } |
| 2555 let result = null; | 2555 let result = null; |
| 2556 if (path != null) { | 2556 if (path != null) { |
| 2557 result = Uri._normalize(path, start, end, dart.as(Uri._pathCharOrSlashTa
ble, List$(int))); | 2557 result = dart.dcall(Uri._normalize, path, start, end, Uri._pathCharOrSla
shTable); |
| 2558 } else { | 2558 } else { |
| 2559 result = pathSegments[dartx.map](dart.fn(s => Uri._uriEncode(dart.as(Uri
._pathCharTable, List$(int)), dart.as(s, String)), String, [dart.dynamic]))[dart
x.join]("/"); | 2559 result = dart.dcall(dart.dcall(pathSegments[dartx.map], dart.fn(s => dar
t.dcall(Uri._uriEncode, Uri._pathCharTable, s), String, [dart.dynamic]))[dartx.j
oin], "/"); |
| 2560 } | 2560 } |
| 2561 if (dart.notNull(dart.as(dart.dload(result, 'isEmpty'), bool))) { | 2561 if (dart.notNull(dart.as(dart.dload(result, 'isEmpty'), bool))) { |
| 2562 if (dart.notNull(isFile)) | 2562 if (dart.notNull(isFile)) |
| 2563 return "/"; | 2563 return "/"; |
| 2564 } else if ((dart.notNull(isFile) || dart.notNull(ensureLeadingSlash)) && !
dart.equals(dart.dsend(result, 'codeUnitAt', 0), Uri._SLASH)) { | 2564 } else if ((dart.notNull(isFile) || dart.notNull(ensureLeadingSlash)) && !
dart.equals(dart.dsend(result, 'codeUnitAt', 0), Uri._SLASH)) { |
| 2565 return `/${result}`; | 2565 return `/${result}`; |
| 2566 } | 2566 } |
| 2567 return dart.as(result, String); | 2567 return dart.as(result, String); |
| 2568 } | 2568 } |
| 2569 static _makeQuery(query, start, end, queryParameters) { | 2569 static _makeQuery(query, start, end, queryParameters) { |
| 2570 if (query == null && queryParameters == null) | 2570 if (query == null && queryParameters == null) |
| 2571 return null; | 2571 return null; |
| 2572 if (query != null && queryParameters != null) { | 2572 if (query != null && queryParameters != null) { |
| 2573 dart.throw(new ArgumentError('Both query and queryParameters specified')
); | 2573 dart.throw(new ArgumentError('Both query and queryParameters specified')
); |
| 2574 } | 2574 } |
| 2575 if (query != null) | 2575 if (query != null) |
| 2576 return Uri._normalize(query, start, end, dart.as(Uri._queryCharTable, Li
st$(int))); | 2576 return dart.dcall(Uri._normalize, query, start, end, Uri._queryCharTable
); |
| 2577 let result = new StringBuffer(); | 2577 let result = new StringBuffer(); |
| 2578 let first = true; | 2578 let first = true; |
| 2579 queryParameters.forEach(dart.fn((key, value) => { | 2579 dart.dcall(queryParameters.forEach, dart.fn((key, value) => { |
| 2580 if (!dart.notNull(first)) { | 2580 if (!dart.notNull(dart.as(first, bool))) { |
| 2581 result.write("&"); | 2581 dart.dsend(result, 'write', "&"); |
| 2582 } | 2582 } |
| 2583 first = false; | 2583 first = false; |
| 2584 result.write(Uri.encodeQueryComponent(dart.as(key, String))); | 2584 dart.dsend(result, 'write', dart.dcall(Uri.encodeQueryComponent, key)); |
| 2585 if (value != null && !dart.notNull(dart.as(dart.dload(value, 'isEmpty'),
bool))) { | 2585 if (value != null && !dart.notNull(dart.as(dart.dload(value, 'isEmpty'),
bool))) { |
| 2586 result.write("="); | 2586 dart.dsend(result, 'write', "="); |
| 2587 result.write(Uri.encodeQueryComponent(dart.as(value, String))); | 2587 dart.dsend(result, 'write', dart.dcall(Uri.encodeQueryComponent, value
)); |
| 2588 } | 2588 } |
| 2589 })); | 2589 })); |
| 2590 return dart.toString(result); | 2590 return dart.as(dart.dsend(result, 'toString'), String); |
| 2591 } | 2591 } |
| 2592 static _makeFragment(fragment, start, end) { | 2592 static _makeFragment(fragment, start, end) { |
| 2593 if (fragment == null) | 2593 if (fragment == null) |
| 2594 return null; | 2594 return null; |
| 2595 return Uri._normalize(fragment, start, end, dart.as(Uri._queryCharTable, L
ist$(int))); | 2595 return dart.dcall(Uri._normalize, fragment, start, end, Uri._queryCharTabl
e); |
| 2596 } | 2596 } |
| 2597 static _stringOrNullLength(s) { | 2597 static _stringOrNullLength(s) { |
| 2598 return s == null ? 0 : s[dartx.length]; | 2598 return s == null ? 0 : s[dartx.length]; |
| 2599 } | 2599 } |
| 2600 static _isHexDigit(char) { | 2600 static _isHexDigit(char) { |
| 2601 if (dart.notNull(Uri._NINE) >= dart.notNull(char)) | 2601 if (dart.notNull(Uri._NINE) >= dart.notNull(char)) |
| 2602 return dart.notNull(Uri._ZERO) <= dart.notNull(char); | 2602 return dart.notNull(Uri._ZERO) <= dart.notNull(char); |
| 2603 char = dart.notNull(char) | 32; | 2603 char = dart.notNull(char) | 32; |
| 2604 return dart.notNull(Uri._LOWER_CASE_A) <= dart.notNull(char) && dart.notNu
ll(Uri._LOWER_CASE_F) >= dart.notNull(char); | 2604 return dart.notNull(Uri._LOWER_CASE_A) <= dart.notNull(char) && dart.notNu
ll(Uri._LOWER_CASE_F) >= dart.notNull(char); |
| 2605 } | 2605 } |
| 2606 static _hexValue(char) { | 2606 static _hexValue(char) { |
| 2607 dart.assert(Uri._isHexDigit(char)); | 2607 dart.assert(dart.dcall(Uri._isHexDigit, char)); |
| 2608 if (dart.notNull(Uri._NINE) >= dart.notNull(char)) | 2608 if (dart.notNull(Uri._NINE) >= dart.notNull(char)) |
| 2609 return dart.notNull(char) - dart.notNull(Uri._ZERO); | 2609 return dart.notNull(char) - dart.notNull(Uri._ZERO); |
| 2610 char = dart.notNull(char) | 32; | 2610 char = dart.notNull(char) | 32; |
| 2611 return dart.notNull(char) - (dart.notNull(Uri._LOWER_CASE_A) - 10); | 2611 return dart.notNull(char) - (dart.notNull(Uri._LOWER_CASE_A) - 10); |
| 2612 } | 2612 } |
| 2613 static _normalizeEscape(source, index, lowerCase) { | 2613 static _normalizeEscape(source, index, lowerCase) { |
| 2614 dart.assert(source[dartx.codeUnitAt](index) == Uri._PERCENT); | 2614 dart.assert(dart.dcall(source[dartx.codeUnitAt], index) == Uri._PERCENT); |
| 2615 if (dart.notNull(index) + 2 >= dart.notNull(source[dartx.length])) { | 2615 if (dart.notNull(index) + 2 >= dart.notNull(source[dartx.length])) { |
| 2616 return "%"; | 2616 return "%"; |
| 2617 } | 2617 } |
| 2618 let firstDigit = source[dartx.codeUnitAt](dart.notNull(index) + 1); | 2618 let firstDigit = dart.dcall(source[dartx.codeUnitAt], dart.notNull(index)
+ 1); |
| 2619 let secondDigit = source[dartx.codeUnitAt](dart.notNull(index) + 2); | 2619 let secondDigit = dart.dcall(source[dartx.codeUnitAt], dart.notNull(index)
+ 2); |
| 2620 if (!dart.notNull(Uri._isHexDigit(firstDigit)) || !dart.notNull(Uri._isHex
Digit(secondDigit))) { | 2620 if (!dart.notNull(dart.dcall(Uri._isHexDigit, firstDigit)) || !dart.notNul
l(dart.dcall(Uri._isHexDigit, secondDigit))) { |
| 2621 return "%"; | 2621 return "%"; |
| 2622 } | 2622 } |
| 2623 let value = dart.notNull(Uri._hexValue(firstDigit)) * 16 + dart.notNull(Ur
i._hexValue(secondDigit)); | 2623 let value = dart.notNull(dart.dcall(Uri._hexValue, firstDigit)) * 16 + dar
t.notNull(dart.dcall(Uri._hexValue, secondDigit)); |
| 2624 if (dart.notNull(Uri._isUnreservedChar(value))) { | 2624 if (dart.notNull(dart.dcall(Uri._isUnreservedChar, value))) { |
| 2625 if (dart.notNull(lowerCase) && dart.notNull(Uri._UPPER_CASE_A) <= dart.n
otNull(value) && dart.notNull(Uri._UPPER_CASE_Z) >= dart.notNull(value)) { | 2625 if (dart.notNull(lowerCase) && dart.notNull(Uri._UPPER_CASE_A) <= dart.n
otNull(value) && dart.notNull(Uri._UPPER_CASE_Z) >= dart.notNull(value)) { |
| 2626 value = dart.notNull(value) | 32; | 2626 value = dart.notNull(value) | 32; |
| 2627 } | 2627 } |
| 2628 return String.fromCharCode(value); | 2628 return String.fromCharCode(value); |
| 2629 } | 2629 } |
| 2630 if (dart.notNull(firstDigit) >= dart.notNull(Uri._LOWER_CASE_A) || dart.no
tNull(secondDigit) >= dart.notNull(Uri._LOWER_CASE_A)) { | 2630 if (dart.notNull(firstDigit) >= dart.notNull(Uri._LOWER_CASE_A) || dart.no
tNull(secondDigit) >= dart.notNull(Uri._LOWER_CASE_A)) { |
| 2631 return source[dartx.substring](index, dart.notNull(index) + 3)[dartx.toU
pperCase](); | 2631 return dart.dcall(dart.dcall(source[dartx.substring], index, dart.notNul
l(index) + 3)[dartx.toUpperCase]); |
| 2632 } | 2632 } |
| 2633 return null; | 2633 return null; |
| 2634 } | 2634 } |
| 2635 static _isUnreservedChar(ch) { | 2635 static _isUnreservedChar(ch) { |
| 2636 return dart.notNull(ch) < 127 && !dart.equals(dart.dsend(Uri._unreservedTa
ble[dartx.get](dart.notNull(ch) >> 4), '&', 1 << (dart.notNull(ch) & 15)), 0); | 2636 return dart.notNull(ch) < 127 && !dart.equals(dart.dsend(dart.dindex(Uri._
unreservedTable, dart.notNull(ch) >> 4), '&', 1 << (dart.notNull(ch) & 15)), 0); |
| 2637 } | 2637 } |
| 2638 static _escapeChar(char) { | 2638 static _escapeChar(char) { |
| 2639 dart.assert(dart.dsend(char, '<=', 1114111)); | 2639 dart.assert(dart.dsend(char, '<=', 1114111)); |
| 2640 let hexDigits = "0123456789ABCDEF"; | 2640 let hexDigits = "0123456789ABCDEF"; |
| 2641 let codeUnits = null; | 2641 let codeUnits = null; |
| 2642 if (dart.notNull(dart.as(dart.dsend(char, '<', 128), bool))) { | 2642 if (dart.notNull(dart.as(dart.dsend(char, '<', 128), bool))) { |
| 2643 codeUnits = List.new(3); | 2643 codeUnits = List.new(3); |
| 2644 codeUnits[dartx.set](0, Uri._PERCENT); | 2644 codeUnits[dartx.set](0, Uri._PERCENT); |
| 2645 codeUnits[dartx.set](1, hexDigits[dartx.codeUnitAt](dart.as(dart.dsend(c
har, '>>', 4), int))); | 2645 codeUnits[dartx.set](1, dart.dsend(hexDigits, 'codeUnitAt', dart.dsend(c
har, '>>', 4))); |
| 2646 codeUnits[dartx.set](2, hexDigits[dartx.codeUnitAt](dart.as(dart.dsend(c
har, '&', 15), int))); | 2646 codeUnits[dartx.set](2, dart.dsend(hexDigits, 'codeUnitAt', dart.dsend(c
har, '&', 15))); |
| 2647 } else { | 2647 } else { |
| 2648 let flag = 192; | 2648 let flag = 192; |
| 2649 let encodedBytes = 2; | 2649 let encodedBytes = 2; |
| 2650 if (dart.notNull(dart.as(dart.dsend(char, '>', 2047), bool))) { | 2650 if (dart.notNull(dart.as(dart.dsend(char, '>', 2047), bool))) { |
| 2651 flag = 224; | 2651 flag = 224; |
| 2652 encodedBytes = 3; | 2652 encodedBytes = 3; |
| 2653 if (dart.notNull(dart.as(dart.dsend(char, '>', 65535), bool))) { | 2653 if (dart.notNull(dart.as(dart.dsend(char, '>', 65535), bool))) { |
| 2654 encodedBytes = 4; | 2654 encodedBytes = 4; |
| 2655 flag = 240; | 2655 flag = 240; |
| 2656 } | 2656 } |
| 2657 } | 2657 } |
| 2658 codeUnits = List.new(3 * dart.notNull(encodedBytes)); | 2658 codeUnits = List.new(3 * dart.notNull(encodedBytes)); |
| 2659 let index = 0; | 2659 let index = 0; |
| 2660 while ((encodedBytes = dart.notNull(encodedBytes) - 1) >= 0) { | 2660 while ((encodedBytes = dart.notNull(encodedBytes) - 1) >= 0) { |
| 2661 let byte = dart.as(dart.dsend(dart.dsend(dart.dsend(char, '>>', 6 * da
rt.notNull(encodedBytes)), '&', 63), '|', flag), int); | 2661 let byte = dart.as(dart.dsend(dart.dsend(dart.dsend(char, '>>', 6 * da
rt.notNull(encodedBytes)), '&', 63), '|', flag), int); |
| 2662 codeUnits[dartx.set](index, Uri._PERCENT); | 2662 codeUnits[dartx.set](index, Uri._PERCENT); |
| 2663 codeUnits[dartx.set](dart.notNull(index) + 1, hexDigits[dartx.codeUnit
At](dart.notNull(byte) >> 4)); | 2663 codeUnits[dartx.set](dart.notNull(index) + 1, dart.dsend(hexDigits, 'c
odeUnitAt', dart.notNull(byte) >> 4)); |
| 2664 codeUnits[dartx.set](dart.notNull(index) + 2, hexDigits[dartx.codeUnit
At](dart.notNull(byte) & 15)); | 2664 codeUnits[dartx.set](dart.notNull(index) + 2, dart.dsend(hexDigits, 'c
odeUnitAt', dart.notNull(byte) & 15)); |
| 2665 index = dart.notNull(index) + 3; | 2665 index = dart.notNull(index) + 3; |
| 2666 flag = 128; | 2666 flag = 128; |
| 2667 } | 2667 } |
| 2668 } | 2668 } |
| 2669 return String.fromCharCodes(dart.as(codeUnits, Iterable$(int))); | 2669 return String.fromCharCodes(dart.as(codeUnits, Iterable$(int))); |
| 2670 } | 2670 } |
| 2671 static _normalize(component, start, end, charTable) { | 2671 static _normalize(component, start, end, charTable) { |
| 2672 let buffer = null; | 2672 let buffer = null; |
| 2673 let sectionStart = start; | 2673 let sectionStart = start; |
| 2674 let index = start; | 2674 let index = start; |
| 2675 while (dart.notNull(index) < dart.notNull(end)) { | 2675 while (dart.notNull(index) < dart.notNull(end)) { |
| 2676 let char = component[dartx.codeUnitAt](index); | 2676 let char = dart.dcall(component[dartx.codeUnitAt], index); |
| 2677 if (dart.notNull(char) < 127 && (dart.notNull(charTable[dartx.get](dart.
notNull(char) >> 4)) & 1 << (dart.notNull(char) & 15)) != 0) { | 2677 if (dart.notNull(char) < 127 && (dart.notNull(charTable[dartx.get](dart.
notNull(char) >> 4)) & 1 << (dart.notNull(char) & 15)) != 0) { |
| 2678 index = dart.notNull(index) + 1; | 2678 index = dart.notNull(index) + 1; |
| 2679 } else { | 2679 } else { |
| 2680 let replacement = null; | 2680 let replacement = null; |
| 2681 let sourceLength = null; | 2681 let sourceLength = null; |
| 2682 if (char == Uri._PERCENT) { | 2682 if (char == Uri._PERCENT) { |
| 2683 replacement = Uri._normalizeEscape(component, index, false); | 2683 replacement = dart.dcall(Uri._normalizeEscape, component, index, fal
se); |
| 2684 if (replacement == null) { | 2684 if (replacement == null) { |
| 2685 index = dart.notNull(index) + 3; | 2685 index = dart.notNull(index) + 3; |
| 2686 continue; | 2686 continue; |
| 2687 } | 2687 } |
| 2688 if ("%" == replacement) { | 2688 if ("%" == replacement) { |
| 2689 replacement = "%25"; | 2689 replacement = "%25"; |
| 2690 sourceLength = 1; | 2690 sourceLength = 1; |
| 2691 } else { | 2691 } else { |
| 2692 sourceLength = 3; | 2692 sourceLength = 3; |
| 2693 } | 2693 } |
| 2694 } else if (dart.notNull(Uri._isGeneralDelimiter(char))) { | 2694 } else if (dart.notNull(dart.dcall(Uri._isGeneralDelimiter, char))) { |
| 2695 Uri._fail(component, index, "Invalid character"); | 2695 dart.dcall(Uri._fail, component, index, "Invalid character"); |
| 2696 } else { | 2696 } else { |
| 2697 sourceLength = 1; | 2697 sourceLength = 1; |
| 2698 if ((dart.notNull(char) & 64512) == 55296) { | 2698 if ((dart.notNull(char) & 64512) == 55296) { |
| 2699 if (dart.notNull(index) + 1 < dart.notNull(end)) { | 2699 if (dart.notNull(index) + 1 < dart.notNull(end)) { |
| 2700 let tail = component[dartx.codeUnitAt](dart.notNull(index) + 1); | 2700 let tail = dart.dcall(component[dartx.codeUnitAt], dart.notNull(
index) + 1); |
| 2701 if ((dart.notNull(tail) & 64512) == 56320) { | 2701 if ((dart.notNull(tail) & 64512) == 56320) { |
| 2702 sourceLength = 2; | 2702 sourceLength = 2; |
| 2703 char = 65536 | (dart.notNull(char) & 1023) << 10 | dart.notNul
l(tail) & 1023; | 2703 char = 65536 | (dart.notNull(char) & 1023) << 10 | dart.notNul
l(tail) & 1023; |
| 2704 } | 2704 } |
| 2705 } | 2705 } |
| 2706 } | 2706 } |
| 2707 replacement = Uri._escapeChar(char); | 2707 replacement = dart.dcall(Uri._escapeChar, char); |
| 2708 } | 2708 } |
| 2709 if (buffer == null) | 2709 if (buffer == null) |
| 2710 buffer = new StringBuffer(); | 2710 buffer = new StringBuffer(); |
| 2711 buffer.write(component[dartx.substring](sectionStart, index)); | 2711 dart.dcall(buffer.write, dart.dcall(component[dartx.substring], sectio
nStart, index)); |
| 2712 buffer.write(replacement); | 2712 dart.dcall(buffer.write, replacement); |
| 2713 index = dart.notNull(index) + dart.notNull(sourceLength); | 2713 index = dart.notNull(index) + dart.notNull(sourceLength); |
| 2714 sectionStart = index; | 2714 sectionStart = index; |
| 2715 } | 2715 } |
| 2716 } | 2716 } |
| 2717 if (buffer == null) { | 2717 if (buffer == null) { |
| 2718 return component[dartx.substring](start, end); | 2718 return dart.dcall(component[dartx.substring], start, end); |
| 2719 } | 2719 } |
| 2720 if (dart.notNull(sectionStart) < dart.notNull(end)) { | 2720 if (dart.notNull(sectionStart) < dart.notNull(end)) { |
| 2721 buffer.write(component[dartx.substring](sectionStart, end)); | 2721 dart.dcall(buffer.write, dart.dcall(component[dartx.substring], sectionS
tart, end)); |
| 2722 } | 2722 } |
| 2723 return dart.toString(buffer); | 2723 return dart.dcall(buffer.toString); |
| 2724 } | 2724 } |
| 2725 static _isSchemeCharacter(ch) { | 2725 static _isSchemeCharacter(ch) { |
| 2726 return dart.notNull(ch) < 128 && !dart.equals(dart.dsend(Uri._schemeTable[
dartx.get](dart.notNull(ch) >> 4), '&', 1 << (dart.notNull(ch) & 15)), 0); | 2726 return dart.notNull(ch) < 128 && !dart.equals(dart.dsend(dart.dindex(Uri._
schemeTable, dart.notNull(ch) >> 4), '&', 1 << (dart.notNull(ch) & 15)), 0); |
| 2727 } | 2727 } |
| 2728 static _isGeneralDelimiter(ch) { | 2728 static _isGeneralDelimiter(ch) { |
| 2729 return dart.notNull(ch) <= dart.notNull(Uri._RIGHT_BRACKET) && !dart.equal
s(dart.dsend(Uri._genDelimitersTable[dartx.get](dart.notNull(ch) >> 4), '&', 1 <
< (dart.notNull(ch) & 15)), 0); | 2729 return dart.notNull(ch) <= dart.notNull(Uri._RIGHT_BRACKET) && !dart.equal
s(dart.dsend(dart.dindex(Uri._genDelimitersTable, dart.notNull(ch) >> 4), '&', 1
<< (dart.notNull(ch) & 15)), 0); |
| 2730 } | 2730 } |
| 2731 get isAbsolute() { | 2731 get isAbsolute() { |
| 2732 return this.scheme != "" && this.fragment == ""; | 2732 return this.scheme != "" && this.fragment == ""; |
| 2733 } | 2733 } |
| 2734 [_merge](base, reference) { | 2734 [_merge](base, reference) { |
| 2735 if (dart.notNull(base[dartx.isEmpty])) | 2735 if (dart.notNull(base[dartx.isEmpty])) |
| 2736 return `/${reference}`; | 2736 return `/${reference}`; |
| 2737 let backCount = 0; | 2737 let backCount = 0; |
| 2738 let refStart = 0; | 2738 let refStart = 0; |
| 2739 while (dart.notNull(reference[dartx.startsWith]("../", refStart))) { | 2739 while (dart.notNull(dart.dcall(reference[dartx.startsWith], "../", refStar
t))) { |
| 2740 refStart = dart.notNull(refStart) + 3; | 2740 refStart = dart.notNull(refStart) + 3; |
| 2741 backCount = dart.notNull(backCount) + 1; | 2741 backCount = dart.notNull(backCount) + 1; |
| 2742 } | 2742 } |
| 2743 let baseEnd = base[dartx.lastIndexOf]('/'); | 2743 let baseEnd = dart.dcall(base[dartx.lastIndexOf], '/'); |
| 2744 while (dart.notNull(baseEnd) > 0 && dart.notNull(backCount) > 0) { | 2744 while (dart.notNull(baseEnd) > 0 && dart.notNull(backCount) > 0) { |
| 2745 let newEnd = base[dartx.lastIndexOf]('/', dart.notNull(baseEnd) - 1); | 2745 let newEnd = dart.dcall(base[dartx.lastIndexOf], '/', dart.notNull(baseE
nd) - 1); |
| 2746 if (dart.notNull(newEnd) < 0) { | 2746 if (dart.notNull(newEnd) < 0) { |
| 2747 break; | 2747 break; |
| 2748 } | 2748 } |
| 2749 let delta = dart.notNull(baseEnd) - dart.notNull(newEnd); | 2749 let delta = dart.notNull(baseEnd) - dart.notNull(newEnd); |
| 2750 if ((delta == 2 || delta == 3) && base[dartx.codeUnitAt](dart.notNull(ne
wEnd) + 1) == Uri._DOT && (delta == 2 || base[dartx.codeUnitAt](dart.notNull(new
End) + 2) == Uri._DOT)) { | 2750 if ((delta == 2 || delta == 3) && dart.dcall(base[dartx.codeUnitAt], dar
t.notNull(newEnd) + 1) == Uri._DOT && (delta == 2 || dart.dcall(base[dartx.codeU
nitAt], dart.notNull(newEnd) + 2) == Uri._DOT)) { |
| 2751 break; | 2751 break; |
| 2752 } | 2752 } |
| 2753 baseEnd = newEnd; | 2753 baseEnd = newEnd; |
| 2754 backCount = dart.notNull(backCount) - 1; | 2754 backCount = dart.notNull(backCount) - 1; |
| 2755 } | 2755 } |
| 2756 return dart.notNull(base[dartx.substring](0, dart.notNull(baseEnd) + 1)) +
dart.notNull(reference[dartx.substring](dart.notNull(refStart) - 3 * dart.notNu
ll(backCount))); | 2756 return dart.notNull(dart.dcall(base[dartx.substring], 0, dart.notNull(base
End) + 1)) + dart.notNull(dart.dcall(reference[dartx.substring], dart.notNull(re
fStart) - 3 * dart.notNull(backCount))); |
| 2757 } | 2757 } |
| 2758 [_hasDotSegments](path) { | 2758 [_hasDotSegments](path) { |
| 2759 if (dart.notNull(path[dartx.length]) > 0 && path[dartx.codeUnitAt](0) == U
ri._DOT) | 2759 if (dart.notNull(path[dartx.length]) > 0 && dart.dcall(path[dartx.codeUnit
At], 0) == Uri._DOT) |
| 2760 return true; | 2760 return true; |
| 2761 let index = path[dartx.indexOf]("/."); | 2761 let index = dart.dcall(path[dartx.indexOf], "/."); |
| 2762 return index != -1; | 2762 return index != -1; |
| 2763 } | 2763 } |
| 2764 [_removeDotSegments](path) { | 2764 [_removeDotSegments](path) { |
| 2765 if (!dart.notNull(this[_hasDotSegments](path))) | 2765 if (!dart.notNull(dart.dcall(this[_hasDotSegments], path))) |
| 2766 return path; | 2766 return path; |
| 2767 let output = dart.list([], String); | 2767 let output = dart.list([], String); |
| 2768 let appendSlash = false; | 2768 let appendSlash = false; |
| 2769 for (let segment of path[dartx.split]("/")) { | 2769 for (let segment of dart.dcall(path[dartx.split], "/")) { |
| 2770 appendSlash = false; | 2770 appendSlash = false; |
| 2771 if (segment == "..") { | 2771 if (segment == "..") { |
| 2772 if (!dart.notNull(output[dartx.isEmpty]) && (output[dartx.length] != 1
|| output[dartx.get](0) != "")) | 2772 if (!dart.notNull(output[dartx.isEmpty]) && (output[dartx.length] != 1
|| output[dartx.get](0) != "")) |
| 2773 output[dartx.removeLast](); | 2773 dart.dcall(output[dartx.removeLast]); |
| 2774 appendSlash = true; | 2774 appendSlash = true; |
| 2775 } else if ("." == segment) { | 2775 } else if ("." == segment) { |
| 2776 appendSlash = true; | 2776 appendSlash = true; |
| 2777 } else { | 2777 } else { |
| 2778 output[dartx.add](segment); | 2778 dart.dcall(output[dartx.add], segment); |
| 2779 } | 2779 } |
| 2780 } | 2780 } |
| 2781 if (dart.notNull(appendSlash)) | 2781 if (dart.notNull(appendSlash)) |
| 2782 output[dartx.add](""); | 2782 dart.dcall(output[dartx.add], ""); |
| 2783 return output[dartx.join]("/"); | 2783 return dart.dcall(output[dartx.join], "/"); |
| 2784 } | 2784 } |
| 2785 resolve(reference) { | 2785 resolve(reference) { |
| 2786 return this.resolveUri(Uri.parse(reference)); | 2786 return dart.dcall(this.resolveUri, dart.dcall(Uri.parse, reference)); |
| 2787 } | 2787 } |
| 2788 resolveUri(reference) { | 2788 resolveUri(reference) { |
| 2789 let targetScheme = null; | 2789 let targetScheme = null; |
| 2790 let targetUserInfo = ""; | 2790 let targetUserInfo = ""; |
| 2791 let targetHost = null; | 2791 let targetHost = null; |
| 2792 let targetPort = null; | 2792 let targetPort = null; |
| 2793 let targetPath = null; | 2793 let targetPath = null; |
| 2794 let targetQuery = null; | 2794 let targetQuery = null; |
| 2795 if (dart.notNull(reference.scheme[dartx.isNotEmpty])) { | 2795 if (dart.notNull(reference.scheme[dartx.isNotEmpty])) { |
| 2796 targetScheme = reference.scheme; | 2796 targetScheme = reference.scheme; |
| 2797 if (dart.notNull(reference.hasAuthority)) { | 2797 if (dart.notNull(reference.hasAuthority)) { |
| 2798 targetUserInfo = reference.userInfo; | 2798 targetUserInfo = reference.userInfo; |
| 2799 targetHost = reference.host; | 2799 targetHost = reference.host; |
| 2800 targetPort = dart.notNull(reference.hasPort) ? reference.port : null; | 2800 targetPort = dart.notNull(reference.hasPort) ? reference.port : null; |
| 2801 } | 2801 } |
| 2802 targetPath = this[_removeDotSegments](reference.path); | 2802 targetPath = dart.dcall(this[_removeDotSegments], reference.path); |
| 2803 if (dart.notNull(reference.hasQuery)) { | 2803 if (dart.notNull(reference.hasQuery)) { |
| 2804 targetQuery = reference.query; | 2804 targetQuery = reference.query; |
| 2805 } | 2805 } |
| 2806 } else { | 2806 } else { |
| 2807 targetScheme = this.scheme; | 2807 targetScheme = this.scheme; |
| 2808 if (dart.notNull(reference.hasAuthority)) { | 2808 if (dart.notNull(reference.hasAuthority)) { |
| 2809 targetUserInfo = reference.userInfo; | 2809 targetUserInfo = reference.userInfo; |
| 2810 targetHost = reference.host; | 2810 targetHost = reference.host; |
| 2811 targetPort = Uri._makePort(dart.notNull(reference.hasPort) ? reference
.port : null, targetScheme); | 2811 targetPort = dart.dcall(Uri._makePort, dart.notNull(reference.hasPort)
? reference.port : null, targetScheme); |
| 2812 targetPath = this[_removeDotSegments](reference.path); | 2812 targetPath = dart.dcall(this[_removeDotSegments], reference.path); |
| 2813 if (dart.notNull(reference.hasQuery)) | 2813 if (dart.notNull(reference.hasQuery)) |
| 2814 targetQuery = reference.query; | 2814 targetQuery = reference.query; |
| 2815 } else { | 2815 } else { |
| 2816 if (reference.path == "") { | 2816 if (reference.path == "") { |
| 2817 targetPath = this[_path]; | 2817 targetPath = this[_path]; |
| 2818 if (dart.notNull(reference.hasQuery)) { | 2818 if (dart.notNull(reference.hasQuery)) { |
| 2819 targetQuery = reference.query; | 2819 targetQuery = reference.query; |
| 2820 } else { | 2820 } else { |
| 2821 targetQuery = this[_query]; | 2821 targetQuery = this[_query]; |
| 2822 } | 2822 } |
| 2823 } else { | 2823 } else { |
| 2824 if (dart.notNull(reference.path[dartx.startsWith]("/"))) { | 2824 if (dart.notNull(dart.dcall(reference.path[dartx.startsWith], "/")))
{ |
| 2825 targetPath = this[_removeDotSegments](reference.path); | 2825 targetPath = dart.dcall(this[_removeDotSegments], reference.path); |
| 2826 } else { | 2826 } else { |
| 2827 targetPath = this[_removeDotSegments](this[_merge](this[_path], re
ference.path)); | 2827 targetPath = dart.dcall(this[_removeDotSegments], dart.dcall(this[
_merge], this[_path], reference.path)); |
| 2828 } | 2828 } |
| 2829 if (dart.notNull(reference.hasQuery)) | 2829 if (dart.notNull(reference.hasQuery)) |
| 2830 targetQuery = reference.query; | 2830 targetQuery = reference.query; |
| 2831 } | 2831 } |
| 2832 targetUserInfo = this[_userInfo]; | 2832 targetUserInfo = this[_userInfo]; |
| 2833 targetHost = this[_host]; | 2833 targetHost = this[_host]; |
| 2834 targetPort = this[_port]; | 2834 targetPort = this[_port]; |
| 2835 } | 2835 } |
| 2836 } | 2836 } |
| 2837 let fragment = dart.notNull(reference.hasFragment) ? reference.fragment :
null; | 2837 let fragment = dart.notNull(reference.hasFragment) ? reference.fragment :
null; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2866 dart.throw(new UnsupportedError(`Cannot extract a file path from a ${thi
s.scheme} URI`)); | 2866 dart.throw(new UnsupportedError(`Cannot extract a file path from a ${thi
s.scheme} URI`)); |
| 2867 } | 2867 } |
| 2868 if (this.query != "") { | 2868 if (this.query != "") { |
| 2869 dart.throw(new UnsupportedError("Cannot extract a file path from a URI w
ith a query component")); | 2869 dart.throw(new UnsupportedError("Cannot extract a file path from a URI w
ith a query component")); |
| 2870 } | 2870 } |
| 2871 if (this.fragment != "") { | 2871 if (this.fragment != "") { |
| 2872 dart.throw(new UnsupportedError("Cannot extract a file path from a URI w
ith a fragment component")); | 2872 dart.throw(new UnsupportedError("Cannot extract a file path from a URI w
ith a fragment component")); |
| 2873 } | 2873 } |
| 2874 if (windows == null) | 2874 if (windows == null) |
| 2875 windows = Uri._isWindows; | 2875 windows = Uri._isWindows; |
| 2876 return dart.notNull(windows) ? this[_toWindowsFilePath]() : this[_toFilePa
th](); | 2876 return dart.notNull(windows) ? dart.dcall(this[_toWindowsFilePath]) : dart
.dcall(this[_toFilePath]); |
| 2877 } | 2877 } |
| 2878 [_toFilePath]() { | 2878 [_toFilePath]() { |
| 2879 if (this.host != "") { | 2879 if (this.host != "") { |
| 2880 dart.throw(new UnsupportedError("Cannot extract a non-Windows file path
from a file URI " + "with an authority")); | 2880 dart.throw(new UnsupportedError("Cannot extract a non-Windows file path
from a file URI " + "with an authority")); |
| 2881 } | 2881 } |
| 2882 Uri._checkNonWindowsPathReservedCharacters(this.pathSegments, false); | 2882 dart.dcall(Uri._checkNonWindowsPathReservedCharacters, this.pathSegments,
false); |
| 2883 let result = new StringBuffer(); | 2883 let result = new StringBuffer(); |
| 2884 if (dart.notNull(this[_isPathAbsolute])) | 2884 if (dart.notNull(this[_isPathAbsolute])) |
| 2885 result.write("/"); | 2885 dart.dsend(result, 'write', "/"); |
| 2886 result.writeAll(this.pathSegments, "/"); | 2886 dart.dsend(result, 'writeAll', this.pathSegments, "/"); |
| 2887 return dart.toString(result); | 2887 return dart.as(dart.dsend(result, 'toString'), String); |
| 2888 } | 2888 } |
| 2889 [_toWindowsFilePath]() { | 2889 [_toWindowsFilePath]() { |
| 2890 let hasDriveLetter = false; | 2890 let hasDriveLetter = false; |
| 2891 let segments = this.pathSegments; | 2891 let segments = this.pathSegments; |
| 2892 if (dart.notNull(segments[dartx.length]) > 0 && segments[dartx.get](0)[dar
tx.length] == 2 && segments[dartx.get](0)[dartx.codeUnitAt](1) == Uri._COLON) { | 2892 if (dart.notNull(dart.as(dart.dsend(dart.dload(segments, 'length'), '>', 0
), bool)) && dart.equals(dart.dload(dart.dindex(segments, 0), 'length'), 2) && d
art.equals(dart.dsend(dart.dindex(segments, 0), 'codeUnitAt', 1), Uri._COLON)) { |
| 2893 Uri._checkWindowsDriveLetter(segments[dartx.get](0)[dartx.codeUnitAt](0)
, false); | 2893 dart.dcall(Uri._checkWindowsDriveLetter, dart.dsend(dart.dindex(segments
, 0), 'codeUnitAt', 0), false); |
| 2894 Uri._checkWindowsPathReservedCharacters(segments, false, 1); | 2894 dart.dcall(Uri._checkWindowsPathReservedCharacters, segments, false, 1); |
| 2895 hasDriveLetter = true; | 2895 hasDriveLetter = true; |
| 2896 } else { | 2896 } else { |
| 2897 Uri._checkWindowsPathReservedCharacters(segments, false); | 2897 dart.dcall(Uri._checkWindowsPathReservedCharacters, segments, false); |
| 2898 } | 2898 } |
| 2899 let result = new StringBuffer(); | 2899 let result = new StringBuffer(); |
| 2900 if (dart.notNull(this[_isPathAbsolute]) && !dart.notNull(hasDriveLetter)) | 2900 if (dart.notNull(this[_isPathAbsolute]) && !dart.notNull(hasDriveLetter)) |
| 2901 result.write("\\"); | 2901 dart.dsend(result, 'write', "\\"); |
| 2902 if (this.host != "") { | 2902 if (this.host != "") { |
| 2903 result.write("\\"); | 2903 dart.dsend(result, 'write', "\\"); |
| 2904 result.write(this.host); | 2904 dart.dsend(result, 'write', this.host); |
| 2905 result.write("\\"); | 2905 dart.dsend(result, 'write', "\\"); |
| 2906 } | 2906 } |
| 2907 result.writeAll(segments, "\\"); | 2907 dart.dsend(result, 'writeAll', segments, "\\"); |
| 2908 if (dart.notNull(hasDriveLetter) && segments[dartx.length] == 1) | 2908 if (dart.notNull(hasDriveLetter) && dart.equals(dart.dload(segments, 'leng
th'), 1)) |
| 2909 result.write("\\"); | 2909 dart.dsend(result, 'write', "\\"); |
| 2910 return dart.toString(result); | 2910 return dart.as(dart.dsend(result, 'toString'), String); |
| 2911 } | 2911 } |
| 2912 get [_isPathAbsolute]() { | 2912 get [_isPathAbsolute]() { |
| 2913 if (this.path == null || dart.notNull(this.path[dartx.isEmpty])) | 2913 if (this.path == null || dart.notNull(this.path[dartx.isEmpty])) |
| 2914 return false; | 2914 return false; |
| 2915 return this.path[dartx.startsWith]('/'); | 2915 return dart.dcall(this.path[dartx.startsWith], '/'); |
| 2916 } | 2916 } |
| 2917 [_writeAuthority](ss) { | 2917 [_writeAuthority](ss) { |
| 2918 if (dart.notNull(this[_userInfo][dartx.isNotEmpty])) { | 2918 if (dart.notNull(this[_userInfo][dartx.isNotEmpty])) { |
| 2919 ss.write(this[_userInfo]); | 2919 dart.dcall(ss.write, this[_userInfo]); |
| 2920 ss.write("@"); | 2920 dart.dcall(ss.write, "@"); |
| 2921 } | 2921 } |
| 2922 if (this[_host] != null) | 2922 if (this[_host] != null) |
| 2923 ss.write(this[_host]); | 2923 dart.dcall(ss.write, this[_host]); |
| 2924 if (this[_port] != null) { | 2924 if (this[_port] != null) { |
| 2925 ss.write(":"); | 2925 dart.dcall(ss.write, ":"); |
| 2926 ss.write(this[_port]); | 2926 dart.dcall(ss.write, this[_port]); |
| 2927 } | 2927 } |
| 2928 } | 2928 } |
| 2929 toString() { | 2929 toString() { |
| 2930 let sb = new StringBuffer(); | 2930 let sb = new StringBuffer(); |
| 2931 Uri._addIfNonEmpty(sb, this.scheme, this.scheme, ':'); | 2931 dart.dcall(Uri._addIfNonEmpty, sb, this.scheme, this.scheme, ':'); |
| 2932 if (dart.notNull(this.hasAuthority) || dart.notNull(this.path[dartx.starts
With]("//")) || this.scheme == "file") { | 2932 if (dart.notNull(this.hasAuthority) || dart.notNull(dart.dcall(this.path[d
artx.startsWith], "//")) || this.scheme == "file") { |
| 2933 sb.write("//"); | 2933 dart.dcall(sb.write, "//"); |
| 2934 this[_writeAuthority](sb); | 2934 dart.dcall(this[_writeAuthority], sb); |
| 2935 } | 2935 } |
| 2936 sb.write(this.path); | 2936 dart.dcall(sb.write, this.path); |
| 2937 if (this[_query] != null) { | 2937 if (this[_query] != null) { |
| 2938 sb.write("?"); | 2938 dart.dcall(sb.write, "?"); |
| 2939 sb.write(this[_query]); | 2939 dart.dcall(sb.write, this[_query]); |
| 2940 } | 2940 } |
| 2941 if (this[_fragment] != null) { | 2941 if (this[_fragment] != null) { |
| 2942 sb.write("#"); | 2942 dart.dcall(sb.write, "#"); |
| 2943 sb.write(this[_fragment]); | 2943 dart.dcall(sb.write, this[_fragment]); |
| 2944 } | 2944 } |
| 2945 return dart.toString(sb); | 2945 return dart.dcall(sb.toString); |
| 2946 } | 2946 } |
| 2947 ['=='](other) { | 2947 ['=='](other) { |
| 2948 if (!dart.is(other, Uri)) | 2948 if (!dart.is(other, Uri)) |
| 2949 return false; | 2949 return false; |
| 2950 let uri = dart.as(other, Uri); | 2950 let uri = dart.as(other, Uri); |
| 2951 return this.scheme == uri.scheme && this.hasAuthority == uri.hasAuthority
&& this.userInfo == uri.userInfo && this.host == uri.host && this.port == uri.po
rt && this.path == uri.path && this.hasQuery == uri.hasQuery && this.query == ur
i.query && this.hasFragment == uri.hasFragment && this.fragment == uri.fragment; | 2951 return this.scheme == uri.scheme && this.hasAuthority == uri.hasAuthority
&& this.userInfo == uri.userInfo && this.host == uri.host && this.port == uri.po
rt && this.path == uri.path && this.hasQuery == uri.hasQuery && this.query == ur
i.query && this.hasFragment == uri.hasFragment && this.fragment == uri.fragment; |
| 2952 } | 2952 } |
| 2953 get hashCode() { | 2953 get hashCode() { |
| 2954 function combine(part, current) { | 2954 function combine(part, current) { |
| 2955 return dart.as(dart.dsend(dart.dsend(dart.dsend(current, '*', 31), '+',
dart.hashCode(part)), '&', 1073741823), int); | 2955 return dart.as(dart.dsend(dart.dsend(dart.dsend(current, '*', 31), '+',
dart.dload(part, 'hashCode')), '&', 1073741823), int); |
| 2956 } | 2956 } |
| 2957 dart.fn(combine, int, [dart.dynamic, dart.dynamic]); | 2957 dart.fn(combine, int, [dart.dynamic, dart.dynamic]); |
| 2958 return combine(this.scheme, combine(this.userInfo, combine(this.host, comb
ine(this.port, combine(this.path, combine(this.query, combine(this.fragment, 1))
))))); | 2958 return dart.dcall(combine, this.scheme, dart.dcall(combine, this.userInfo,
dart.dcall(combine, this.host, dart.dcall(combine, this.port, dart.dcall(combin
e, this.path, dart.dcall(combine, this.query, dart.dcall(combine, this.fragment,
1))))))); |
| 2959 } | 2959 } |
| 2960 static _addIfNonEmpty(sb, test, first, second) { | 2960 static _addIfNonEmpty(sb, test, first, second) { |
| 2961 if ("" != test) { | 2961 if ("" != test) { |
| 2962 sb.write(first); | 2962 dart.dcall(sb.write, first); |
| 2963 sb.write(second); | 2963 dart.dcall(sb.write, second); |
| 2964 } | 2964 } |
| 2965 } | 2965 } |
| 2966 static encodeComponent(component) { | 2966 static encodeComponent(component) { |
| 2967 return Uri._uriEncode(dart.as(Uri._unreserved2396Table, List$(int)), compo
nent); | 2967 return dart.dcall(Uri._uriEncode, Uri._unreserved2396Table, component); |
| 2968 } | 2968 } |
| 2969 static encodeQueryComponent(component, opts) { | 2969 static encodeQueryComponent(component, opts) { |
| 2970 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8; | 2970 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8; |
| 2971 return Uri._uriEncode(dart.as(Uri._unreservedTable, List$(int)), component
, {encoding: encoding, spaceToPlus: true}); | 2971 return dart.dcall(Uri._uriEncode, Uri._unreservedTable, component, {encodi
ng: encoding, spaceToPlus: true}); |
| 2972 } | 2972 } |
| 2973 static decodeComponent(encodedComponent) { | 2973 static decodeComponent(encodedComponent) { |
| 2974 return Uri._uriDecode(encodedComponent); | 2974 return dart.dcall(Uri._uriDecode, encodedComponent); |
| 2975 } | 2975 } |
| 2976 static decodeQueryComponent(encodedComponent, opts) { | 2976 static decodeQueryComponent(encodedComponent, opts) { |
| 2977 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8; | 2977 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8; |
| 2978 return Uri._uriDecode(encodedComponent, {plusToSpace: true, encoding: enco
ding}); | 2978 return dart.dcall(Uri._uriDecode, encodedComponent, {plusToSpace: true, en
coding: encoding}); |
| 2979 } | 2979 } |
| 2980 static encodeFull(uri) { | 2980 static encodeFull(uri) { |
| 2981 return Uri._uriEncode(dart.as(Uri._encodeFullTable, List$(int)), uri); | 2981 return dart.dcall(Uri._uriEncode, Uri._encodeFullTable, uri); |
| 2982 } | 2982 } |
| 2983 static decodeFull(uri) { | 2983 static decodeFull(uri) { |
| 2984 return Uri._uriDecode(uri); | 2984 return dart.dcall(Uri._uriDecode, uri); |
| 2985 } | 2985 } |
| 2986 static splitQueryString(query, opts) { | 2986 static splitQueryString(query, opts) { |
| 2987 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8; | 2987 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8; |
| 2988 return dart.as(query[dartx.split]("&")[dartx.fold](dart.map(), dart.fn((ma
p, element) => { | 2988 return dart.as(dart.dcall(dart.dcall(query[dartx.split], "&")[dartx.fold],
dart.map(), dart.fn((map, element) => { |
| 2989 let index = dart.as(dart.dsend(element, 'indexOf', "="), int); | 2989 let index = dart.as(dart.dsend(element, 'indexOf', "="), int); |
| 2990 if (index == -1) { | 2990 if (index == -1) { |
| 2991 if (!dart.equals(element, "")) { | 2991 if (!dart.equals(element, "")) { |
| 2992 dart.dsetindex(map, Uri.decodeQueryComponent(dart.as(element, String
), {encoding: encoding}), ""); | 2992 dart.dsetindex(map, dart.dcall(Uri.decodeQueryComponent, element, {e
ncoding: encoding}), ""); |
| 2993 } | 2993 } |
| 2994 } else if (index != 0) { | 2994 } else if (index != 0) { |
| 2995 let key = dart.dsend(element, 'substring', 0, index); | 2995 let key = dart.dsend(element, 'substring', 0, index); |
| 2996 let value = dart.dsend(element, 'substring', dart.notNull(index) + 1); | 2996 let value = dart.dsend(element, 'substring', dart.notNull(index) + 1); |
| 2997 dart.dsetindex(map, Uri.decodeQueryComponent(dart.as(key, String), {en
coding: encoding}), Uri.decodeQueryComponent(dart.as(value, String), {encoding:
encoding})); | 2997 dart.dsetindex(map, dart.dcall(Uri.decodeQueryComponent, key, {encodin
g: encoding}), dart.dcall(Uri.decodeQueryComponent, value, {encoding: encoding})
); |
| 2998 } | 2998 } |
| 2999 return map; | 2999 return map; |
| 3000 })), Map$(String, String)); | 3000 })), Map$(String, String)); |
| 3001 } | 3001 } |
| 3002 static parseIPv4Address(host) { | 3002 static parseIPv4Address(host) { |
| 3003 function error(msg) { | 3003 function error(msg) { |
| 3004 dart.throw(new FormatException(`Illegal IPv4 address, ${msg}`)); | 3004 dart.throw(new FormatException(`Illegal IPv4 address, ${msg}`)); |
| 3005 } | 3005 } |
| 3006 dart.fn(error, dart.void, [String]); | 3006 dart.fn(error, dart.void, [String]); |
| 3007 let bytes = host[dartx.split]('.'); | 3007 let bytes = dart.dcall(host[dartx.split], '.'); |
| 3008 if (bytes[dartx.length] != 4) { | 3008 if (!dart.equals(dart.dload(bytes, 'length'), 4)) { |
| 3009 error('IPv4 address should contain exactly 4 parts'); | 3009 dart.dcall(error, 'IPv4 address should contain exactly 4 parts'); |
| 3010 } | 3010 } |
| 3011 return dart.as(bytes[dartx.map](dart.fn(byteString => { | 3011 return dart.as(dart.dsend(dart.dsend(bytes, 'map', dart.fn(byteString => { |
| 3012 let byte = int.parse(dart.as(byteString, String)); | 3012 let byte = dart.dcall(int.parse, byteString); |
| 3013 if (dart.notNull(byte) < 0 || dart.notNull(byte) > 255) { | 3013 if (dart.notNull(byte) < 0 || dart.notNull(byte) > 255) { |
| 3014 error('each part must be in the range of `0..255`'); | 3014 dart.dcall(error, 'each part must be in the range of `0..255`'); |
| 3015 } | 3015 } |
| 3016 return byte; | 3016 return byte; |
| 3017 }))[dartx.toList](), List$(int)); | 3017 })), 'toList'), List$(int)); |
| 3018 } | 3018 } |
| 3019 static parseIPv6Address(host, start, end) { | 3019 static parseIPv6Address(host, start, end) { |
| 3020 if (start === void 0) | 3020 if (start === void 0) |
| 3021 start = 0; | 3021 start = 0; |
| 3022 if (end === void 0) | 3022 if (end === void 0) |
| 3023 end = null; | 3023 end = null; |
| 3024 if (end == null) | 3024 if (end == null) |
| 3025 end = host[dartx.length]; | 3025 end = host[dartx.length]; |
| 3026 function error(msg, position) { | 3026 function error(msg, position) { |
| 3027 if (position === void 0) | 3027 if (position === void 0) |
| 3028 position = null; | 3028 position = null; |
| 3029 dart.throw(new FormatException(`Illegal IPv6 address, ${msg}`, host, dar
t.as(position, int))); | 3029 dart.throw(new FormatException(`Illegal IPv6 address, ${msg}`, host, dar
t.as(position, int))); |
| 3030 } | 3030 } |
| 3031 dart.fn(error, dart.void, [String], [dart.dynamic]); | 3031 dart.fn(error, dart.void, [String], [dart.dynamic]); |
| 3032 function parseHex(start, end) { | 3032 function parseHex(start, end) { |
| 3033 if (dart.notNull(end) - dart.notNull(start) > 4) { | 3033 if (dart.notNull(end) - dart.notNull(start) > 4) { |
| 3034 error('an IPv6 part can only contain a maximum of 4 hex digits', start
); | 3034 dart.dcall(error, 'an IPv6 part can only contain a maximum of 4 hex di
gits', start); |
| 3035 } | 3035 } |
| 3036 let value = int.parse(host[dartx.substring](start, end), {radix: 16}); | 3036 let value = dart.dcall(int.parse, dart.dcall(host[dartx.substring], star
t, end), {radix: 16}); |
| 3037 if (dart.notNull(value) < 0 || dart.notNull(value) > (1 << 16) - 1) { | 3037 if (dart.notNull(value) < 0 || dart.notNull(value) > (1 << 16) - 1) { |
| 3038 error('each part must be in the range of `0x0..0xFFFF`', start); | 3038 dart.dcall(error, 'each part must be in the range of `0x0..0xFFFF`', s
tart); |
| 3039 } | 3039 } |
| 3040 return value; | 3040 return value; |
| 3041 } | 3041 } |
| 3042 dart.fn(parseHex, int, [int, int]); | 3042 dart.fn(parseHex, int, [int, int]); |
| 3043 if (dart.notNull(host[dartx.length]) < 2) | 3043 if (dart.notNull(host[dartx.length]) < 2) |
| 3044 error('address is too short'); | 3044 dart.dcall(error, 'address is too short'); |
| 3045 let parts = dart.list([], int); | 3045 let parts = dart.list([], int); |
| 3046 let wildcardSeen = false; | 3046 let wildcardSeen = false; |
| 3047 let partStart = start; | 3047 let partStart = start; |
| 3048 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(
i) + 1) { | 3048 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(
i) + 1) { |
| 3049 if (host[dartx.codeUnitAt](i) == Uri._COLON) { | 3049 if (dart.dcall(host[dartx.codeUnitAt], i) == Uri._COLON) { |
| 3050 if (i == start) { | 3050 if (i == start) { |
| 3051 i = dart.notNull(i) + 1; | 3051 i = dart.notNull(i) + 1; |
| 3052 if (host[dartx.codeUnitAt](i) != Uri._COLON) { | 3052 if (dart.dcall(host[dartx.codeUnitAt], i) != Uri._COLON) { |
| 3053 error('invalid start colon.', i); | 3053 dart.dcall(error, 'invalid start colon.', i); |
| 3054 } | 3054 } |
| 3055 partStart = i; | 3055 partStart = i; |
| 3056 } | 3056 } |
| 3057 if (i == partStart) { | 3057 if (i == partStart) { |
| 3058 if (dart.notNull(wildcardSeen)) { | 3058 if (dart.notNull(wildcardSeen)) { |
| 3059 error('only one wildcard `::` is allowed', i); | 3059 dart.dcall(error, 'only one wildcard `::` is allowed', i); |
| 3060 } | 3060 } |
| 3061 wildcardSeen = true; | 3061 wildcardSeen = true; |
| 3062 parts[dartx.add](-1); | 3062 dart.dcall(parts[dartx.add], -1); |
| 3063 } else { | 3063 } else { |
| 3064 parts[dartx.add](parseHex(partStart, i)); | 3064 dart.dcall(parts[dartx.add], dart.dcall(parseHex, partStart, i)); |
| 3065 } | 3065 } |
| 3066 partStart = dart.notNull(i) + 1; | 3066 partStart = dart.notNull(i) + 1; |
| 3067 } | 3067 } |
| 3068 } | 3068 } |
| 3069 if (parts[dartx.length] == 0) | 3069 if (parts[dartx.length] == 0) |
| 3070 error('too few parts'); | 3070 dart.dcall(error, 'too few parts'); |
| 3071 let atEnd = partStart == end; | 3071 let atEnd = partStart == end; |
| 3072 let isLastWildcard = parts[dartx.last] == -1; | 3072 let isLastWildcard = parts[dartx.last] == -1; |
| 3073 if (dart.notNull(atEnd) && !dart.notNull(isLastWildcard)) { | 3073 if (dart.notNull(atEnd) && !dart.notNull(isLastWildcard)) { |
| 3074 error('expected a part after last `:`', end); | 3074 dart.dcall(error, 'expected a part after last `:`', end); |
| 3075 } | 3075 } |
| 3076 if (!dart.notNull(atEnd)) { | 3076 if (!dart.notNull(atEnd)) { |
| 3077 try { | 3077 try { |
| 3078 parts[dartx.add](parseHex(partStart, end)); | 3078 dart.dcall(parts[dartx.add], dart.dcall(parseHex, partStart, end)); |
| 3079 } catch (e) { | 3079 } catch (e) { |
| 3080 try { | 3080 try { |
| 3081 let last = Uri.parseIPv4Address(host[dartx.substring](partStart, end
)); | 3081 let last = dart.dcall(Uri.parseIPv4Address, dart.dcall(host[dartx.su
bstring], partStart, end)); |
| 3082 parts[dartx.add](dart.notNull(last[dartx.get](0)) << 8 | dart.notNul
l(last[dartx.get](1))); | 3082 dart.dcall(parts[dartx.add], dart.notNull(last[dartx.get](0)) << 8 |
dart.notNull(last[dartx.get](1))); |
| 3083 parts[dartx.add](dart.notNull(last[dartx.get](2)) << 8 | dart.notNul
l(last[dartx.get](3))); | 3083 dart.dcall(parts[dartx.add], dart.notNull(last[dartx.get](2)) << 8 |
dart.notNull(last[dartx.get](3))); |
| 3084 } catch (e) { | 3084 } catch (e) { |
| 3085 error('invalid end of IPv6 address.', partStart); | 3085 dart.dcall(error, 'invalid end of IPv6 address.', partStart); |
| 3086 } | 3086 } |
| 3087 | 3087 |
| 3088 } | 3088 } |
| 3089 | 3089 |
| 3090 } | 3090 } |
| 3091 if (dart.notNull(wildcardSeen)) { | 3091 if (dart.notNull(wildcardSeen)) { |
| 3092 if (dart.notNull(parts[dartx.length]) > 7) { | 3092 if (dart.notNull(parts[dartx.length]) > 7) { |
| 3093 error('an address with a wildcard must have less than 7 parts'); | 3093 dart.dcall(error, 'an address with a wildcard must have less than 7 pa
rts'); |
| 3094 } | 3094 } |
| 3095 } else if (parts[dartx.length] != 8) { | 3095 } else if (parts[dartx.length] != 8) { |
| 3096 error('an address without a wildcard must contain exactly 8 parts'); | 3096 dart.dcall(error, 'an address without a wildcard must contain exactly 8
parts'); |
| 3097 } | 3097 } |
| 3098 let bytes = List$(int).new(16); | 3098 let bytes = List$(int).new(16); |
| 3099 for (let i = 0, index = 0; dart.notNull(i) < dart.notNull(parts[dartx.leng
th]); i = dart.notNull(i) + 1) { | 3099 for (let i = 0, index = 0; dart.notNull(i) < dart.notNull(parts[dartx.leng
th]); i = dart.notNull(i) + 1) { |
| 3100 let value = parts[dartx.get](i); | 3100 let value = parts[dartx.get](i); |
| 3101 if (value == -1) { | 3101 if (value == -1) { |
| 3102 let wildCardLength = 9 - dart.notNull(parts[dartx.length]); | 3102 let wildCardLength = 9 - dart.notNull(parts[dartx.length]); |
| 3103 for (let j = 0; dart.notNull(j) < dart.notNull(wildCardLength); j = da
rt.notNull(j) + 1) { | 3103 for (let j = 0; dart.notNull(j) < dart.notNull(wildCardLength); j = da
rt.notNull(j) + 1) { |
| 3104 bytes[dartx.set](index, 0); | 3104 bytes[dartx.set](index, 0); |
| 3105 bytes[dartx.set](dart.notNull(index) + 1, 0); | 3105 bytes[dartx.set](dart.notNull(index) + 1, 0); |
| 3106 index = dart.notNull(index) + 2; | 3106 index = dart.notNull(index) + 2; |
| 3107 } | 3107 } |
| 3108 } else { | 3108 } else { |
| 3109 bytes[dartx.set](index, dart.notNull(value) >> 8); | 3109 bytes[dartx.set](index, dart.notNull(value) >> 8); |
| 3110 bytes[dartx.set](dart.notNull(index) + 1, dart.notNull(value) & 255); | 3110 bytes[dartx.set](dart.notNull(index) + 1, dart.notNull(value) & 255); |
| 3111 index = dart.notNull(index) + 2; | 3111 index = dart.notNull(index) + 2; |
| 3112 } | 3112 } |
| 3113 } | 3113 } |
| 3114 return dart.as(bytes, List$(int)); | 3114 return dart.as(bytes, List$(int)); |
| 3115 } | 3115 } |
| 3116 static _uriEncode(canonicalTable, text, opts) { | 3116 static _uriEncode(canonicalTable, text, opts) { |
| 3117 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8; | 3117 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8; |
| 3118 let spaceToPlus = opts && 'spaceToPlus' in opts ? opts.spaceToPlus : false
; | 3118 let spaceToPlus = opts && 'spaceToPlus' in opts ? opts.spaceToPlus : false
; |
| 3119 function byteToHex(byte, buffer) { | 3119 function byteToHex(byte, buffer) { |
| 3120 let hex = '0123456789ABCDEF'; | 3120 let hex = '0123456789ABCDEF'; |
| 3121 dart.dsend(buffer, 'writeCharCode', hex[dartx.codeUnitAt](dart.as(dart.d
send(byte, '>>', 4), int))); | 3121 dart.dsend(buffer, 'writeCharCode', dart.dcall(hex[dartx.codeUnitAt], da
rt.dsend(byte, '>>', 4))); |
| 3122 dart.dsend(buffer, 'writeCharCode', hex[dartx.codeUnitAt](dart.as(dart.d
send(byte, '&', 15), int))); | 3122 dart.dsend(buffer, 'writeCharCode', dart.dcall(hex[dartx.codeUnitAt], da
rt.dsend(byte, '&', 15))); |
| 3123 } | 3123 } |
| 3124 dart.fn(byteToHex); | 3124 dart.fn(byteToHex); |
| 3125 let result = new StringBuffer(); | 3125 let result = new StringBuffer(); |
| 3126 let bytes = encoding.encode(text); | 3126 let bytes = dart.dcall(encoding.encode, text); |
| 3127 for (let i = 0; dart.notNull(i) < dart.notNull(bytes[dartx.length]); i = d
art.notNull(i) + 1) { | 3127 for (let i = 0; dart.notNull(i) < dart.notNull(dart.as(dart.dload(bytes, '
length'), num)); i = dart.notNull(i) + 1) { |
| 3128 let byte = bytes[dartx.get](i); | 3128 let byte = dart.as(dart.dindex(bytes, i), int); |
| 3129 if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx.get](
dart.notNull(byte) >> 4)) & 1 << (dart.notNull(byte) & 15)) != 0) { | 3129 if (dart.notNull(byte) < 128 && (dart.notNull(canonicalTable[dartx.get](
dart.notNull(byte) >> 4)) & 1 << (dart.notNull(byte) & 15)) != 0) { |
| 3130 result.writeCharCode(byte); | 3130 dart.dcall(result.writeCharCode, byte); |
| 3131 } else if (dart.notNull(spaceToPlus) && byte == Uri._SPACE) { | 3131 } else if (dart.notNull(spaceToPlus) && byte == Uri._SPACE) { |
| 3132 result.writeCharCode(Uri._PLUS); | 3132 dart.dcall(result.writeCharCode, Uri._PLUS); |
| 3133 } else { | 3133 } else { |
| 3134 result.writeCharCode(Uri._PERCENT); | 3134 dart.dcall(result.writeCharCode, Uri._PERCENT); |
| 3135 byteToHex(byte, result); | 3135 dart.dcall(byteToHex, byte, result); |
| 3136 } | 3136 } |
| 3137 } | 3137 } |
| 3138 return dart.toString(result); | 3138 return dart.dcall(result.toString); |
| 3139 } | 3139 } |
| 3140 static _hexCharPairToByte(s, pos) { | 3140 static _hexCharPairToByte(s, pos) { |
| 3141 let byte = 0; | 3141 let byte = 0; |
| 3142 for (let i = 0; dart.notNull(i) < 2; i = dart.notNull(i) + 1) { | 3142 for (let i = 0; dart.notNull(i) < 2; i = dart.notNull(i) + 1) { |
| 3143 let charCode = s[dartx.codeUnitAt](dart.notNull(pos) + dart.notNull(i)); | 3143 let charCode = dart.dcall(s[dartx.codeUnitAt], dart.notNull(pos) + dart.
notNull(i)); |
| 3144 if (48 <= dart.notNull(charCode) && dart.notNull(charCode) <= 57) { | 3144 if (48 <= dart.notNull(dart.as(charCode, num)) && dart.notNull(dart.as(d
art.dsend(charCode, '<=', 57), bool))) { |
| 3145 byte = dart.notNull(byte) * 16 + dart.notNull(charCode) - 48; | 3145 byte = dart.notNull(byte) * 16 + dart.notNull(dart.as(charCode, num))
- 48; |
| 3146 } else { | 3146 } else { |
| 3147 charCode = dart.notNull(charCode) | 32; | 3147 charCode = dart.dsend(charCode, '|', 32); |
| 3148 if (97 <= dart.notNull(charCode) && dart.notNull(charCode) <= 102) { | 3148 if (97 <= dart.notNull(dart.as(charCode, num)) && dart.notNull(dart.as
(dart.dsend(charCode, '<=', 102), bool))) { |
| 3149 byte = dart.notNull(byte) * 16 + dart.notNull(charCode) - 87; | 3149 byte = dart.notNull(byte) * 16 + dart.notNull(dart.as(charCode, num)
) - 87; |
| 3150 } else { | 3150 } else { |
| 3151 dart.throw(new ArgumentError("Invalid URL encoding")); | 3151 dart.throw(new ArgumentError("Invalid URL encoding")); |
| 3152 } | 3152 } |
| 3153 } | 3153 } |
| 3154 } | 3154 } |
| 3155 return byte; | 3155 return byte; |
| 3156 } | 3156 } |
| 3157 static _uriDecode(text, opts) { | 3157 static _uriDecode(text, opts) { |
| 3158 let plusToSpace = opts && 'plusToSpace' in opts ? opts.plusToSpace : false
; | 3158 let plusToSpace = opts && 'plusToSpace' in opts ? opts.plusToSpace : false
; |
| 3159 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8; | 3159 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8; |
| 3160 let simple = true; | 3160 let simple = true; |
| 3161 for (let i = 0; dart.notNull(i) < dart.notNull(text[dartx.length]) && dart
.notNull(simple); i = dart.notNull(i) + 1) { | 3161 for (let i = 0; dart.notNull(i) < dart.notNull(text[dartx.length]) && dart
.notNull(simple); i = dart.notNull(i) + 1) { |
| 3162 let codeUnit = text[dartx.codeUnitAt](i); | 3162 let codeUnit = dart.dcall(text[dartx.codeUnitAt], i); |
| 3163 simple = codeUnit != Uri._PERCENT && codeUnit != Uri._PLUS; | 3163 simple = !dart.equals(codeUnit, Uri._PERCENT) && !dart.equals(codeUnit,
Uri._PLUS); |
| 3164 } | 3164 } |
| 3165 let bytes = null; | 3165 let bytes = null; |
| 3166 if (dart.notNull(simple)) { | 3166 if (dart.notNull(simple)) { |
| 3167 if (dart.equals(encoding, convert.UTF8) || dart.equals(encoding, convert
.LATIN1)) { | 3167 if (dart.equals(encoding, convert.UTF8) || dart.equals(encoding, convert
.LATIN1)) { |
| 3168 return text; | 3168 return text; |
| 3169 } else { | 3169 } else { |
| 3170 bytes = text[dartx.codeUnits]; | 3170 bytes = text[dartx.codeUnits]; |
| 3171 } | 3171 } |
| 3172 } else { | 3172 } else { |
| 3173 bytes = List$(int).new(); | 3173 bytes = List$(int).new(); |
| 3174 for (let i = 0; dart.notNull(i) < dart.notNull(text[dartx.length]); i =
dart.notNull(i) + 1) { | 3174 for (let i = 0; dart.notNull(i) < dart.notNull(text[dartx.length]); i =
dart.notNull(i) + 1) { |
| 3175 let codeUnit = text[dartx.codeUnitAt](i); | 3175 let codeUnit = dart.dcall(text[dartx.codeUnitAt], i); |
| 3176 if (dart.notNull(codeUnit) > 127) { | 3176 if (dart.notNull(dart.as(dart.dsend(codeUnit, '>', 127), bool))) { |
| 3177 dart.throw(new ArgumentError("Illegal percent encoding in URI")); | 3177 dart.throw(new ArgumentError("Illegal percent encoding in URI")); |
| 3178 } | 3178 } |
| 3179 if (codeUnit == Uri._PERCENT) { | 3179 if (dart.equals(codeUnit, Uri._PERCENT)) { |
| 3180 if (dart.notNull(i) + 3 > dart.notNull(text[dartx.length])) { | 3180 if (dart.notNull(i) + 3 > dart.notNull(text[dartx.length])) { |
| 3181 dart.throw(new ArgumentError('Truncated URI')); | 3181 dart.throw(new ArgumentError('Truncated URI')); |
| 3182 } | 3182 } |
| 3183 bytes[dartx.add](Uri._hexCharPairToByte(text, dart.notNull(i) + 1)); | 3183 dart.dcall(bytes[dartx.add], dart.dcall(Uri._hexCharPairToByte, text
, dart.notNull(i) + 1)); |
| 3184 i = dart.notNull(i) + 2; | 3184 i = dart.notNull(i) + 2; |
| 3185 } else if (dart.notNull(plusToSpace) && codeUnit == Uri._PLUS) { | 3185 } else if (dart.notNull(plusToSpace) && dart.equals(codeUnit, Uri._PLU
S)) { |
| 3186 bytes[dartx.add](Uri._SPACE); | 3186 dart.dcall(bytes[dartx.add], Uri._SPACE); |
| 3187 } else { | 3187 } else { |
| 3188 bytes[dartx.add](codeUnit); | 3188 dart.dcall(bytes[dartx.add], codeUnit); |
| 3189 } | 3189 } |
| 3190 } | 3190 } |
| 3191 } | 3191 } |
| 3192 return encoding.decode(bytes); | 3192 return dart.dcall(encoding.decode, bytes); |
| 3193 } | 3193 } |
| 3194 static _isAlphabeticCharacter(codeUnit) { | 3194 static _isAlphabeticCharacter(codeUnit) { |
| 3195 return dart.notNull(codeUnit) >= dart.notNull(Uri._LOWER_CASE_A) && dart.n
otNull(codeUnit) <= dart.notNull(Uri._LOWER_CASE_Z) || dart.notNull(codeUnit) >=
dart.notNull(Uri._UPPER_CASE_A) && dart.notNull(codeUnit) <= dart.notNull(Uri._
UPPER_CASE_Z); | 3195 return dart.notNull(codeUnit) >= dart.notNull(Uri._LOWER_CASE_A) && dart.n
otNull(codeUnit) <= dart.notNull(Uri._LOWER_CASE_Z) || dart.notNull(codeUnit) >=
dart.notNull(Uri._UPPER_CASE_A) && dart.notNull(codeUnit) <= dart.notNull(Uri._
UPPER_CASE_Z); |
| 3196 } | 3196 } |
| 3197 } | 3197 } |
| 3198 dart.defineNamedConstructor(Uri, '_internal'); | 3198 dart.defineNamedConstructor(Uri, '_internal'); |
| 3199 dart.setSignature(Uri, { | 3199 dart.setSignature(Uri, { |
| 3200 constructors: () => ({ | 3200 constructors: () => ({ |
| 3201 _internal: [Uri, [String, String, String, num, String, String, String]], | 3201 _internal: [Uri, [String, String, String, num, String, String, String]], |
| 3202 new: [Uri, [], {scheme: String, userInfo: String, host: String, port: int,
path: String, pathSegments: Iterable$(String), query: String, queryParameters:
Map$(String, String), fragment: String}], | 3202 new: [Uri, [], {scheme: String, userInfo: String, host: String, port: int,
path: String, pathSegments: Iterable$(String), query: String, queryParameters:
Map$(String, String), fragment: String}], |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3292 Uri._schemeTable = dart.const([0, 0, 26624, 1023, 65534, 2047, 65534, 2047]); | 3292 Uri._schemeTable = dart.const([0, 0, 26624, 1023, 65534, 2047, 65534, 2047]); |
| 3293 Uri._schemeLowerTable = dart.const([0, 0, 26624, 1023, 0, 0, 65534, 2047]); | 3293 Uri._schemeLowerTable = dart.const([0, 0, 26624, 1023, 0, 0, 65534, 2047]); |
| 3294 Uri._subDelimitersTable = dart.const([0, 0, 32722, 11263, 65534, 34815, 65534,
18431]); | 3294 Uri._subDelimitersTable = dart.const([0, 0, 32722, 11263, 65534, 34815, 65534,
18431]); |
| 3295 Uri._genDelimitersTable = dart.const([0, 0, 32776, 33792, 1, 10240, 0, 0]); | 3295 Uri._genDelimitersTable = dart.const([0, 0, 32776, 33792, 1, 10240, 0, 0]); |
| 3296 Uri._userinfoTable = dart.const([0, 0, 32722, 12287, 65534, 34815, 65534, 1843
1]); | 3296 Uri._userinfoTable = dart.const([0, 0, 32722, 12287, 65534, 34815, 65534, 1843
1]); |
| 3297 Uri._regNameTable = dart.const([0, 0, 32754, 11263, 65534, 34815, 65534, 18431
]); | 3297 Uri._regNameTable = dart.const([0, 0, 32754, 11263, 65534, 34815, 65534, 18431
]); |
| 3298 Uri._pathCharTable = dart.const([0, 0, 32722, 12287, 65535, 34815, 65534, 1843
1]); | 3298 Uri._pathCharTable = dart.const([0, 0, 32722, 12287, 65535, 34815, 65534, 1843
1]); |
| 3299 Uri._pathCharOrSlashTable = dart.const([0, 0, 65490, 12287, 65535, 34815, 6553
4, 18431]); | 3299 Uri._pathCharOrSlashTable = dart.const([0, 0, 65490, 12287, 65535, 34815, 6553
4, 18431]); |
| 3300 Uri._queryCharTable = dart.const([0, 0, 65490, 45055, 65535, 34815, 65534, 184
31]); | 3300 Uri._queryCharTable = dart.const([0, 0, 65490, 45055, 65535, 34815, 65534, 184
31]); |
| 3301 function _symbolToString(symbol) { | 3301 function _symbolToString(symbol) { |
| 3302 return _internal.Symbol.getName(dart.as(symbol, _internal.Symbol)); | 3302 return dart.dcall(_internal.Symbol.getName, symbol); |
| 3303 } | 3303 } |
| 3304 dart.fn(_symbolToString, String, [Symbol]); | 3304 dart.fn(_symbolToString, String, [Symbol]); |
| 3305 // Exports: | 3305 // Exports: |
| 3306 exports.Object = Object; | 3306 exports.Object = Object; |
| 3307 exports.Deprecated = Deprecated; | 3307 exports.Deprecated = Deprecated; |
| 3308 exports.deprecated = deprecated; | 3308 exports.deprecated = deprecated; |
| 3309 exports.override = override; | 3309 exports.override = override; |
| 3310 exports.proxy = proxy; | 3310 exports.proxy = proxy; |
| 3311 exports.bool = bool; | 3311 exports.bool = bool; |
| 3312 exports.Comparator$ = Comparator$; | 3312 exports.Comparator$ = Comparator$; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3366 exports.StackTrace = StackTrace; | 3366 exports.StackTrace = StackTrace; |
| 3367 exports.Stopwatch = Stopwatch; | 3367 exports.Stopwatch = Stopwatch; |
| 3368 exports.String = String; | 3368 exports.String = String; |
| 3369 exports.RuneIterator = RuneIterator; | 3369 exports.RuneIterator = RuneIterator; |
| 3370 exports.StringBuffer = StringBuffer; | 3370 exports.StringBuffer = StringBuffer; |
| 3371 exports.StringSink = StringSink; | 3371 exports.StringSink = StringSink; |
| 3372 exports.Symbol = Symbol; | 3372 exports.Symbol = Symbol; |
| 3373 exports.Type = Type; | 3373 exports.Type = Type; |
| 3374 exports.Uri = Uri; | 3374 exports.Uri = Uri; |
| 3375 }); | 3375 }); |
| OLD | NEW |