OLD | NEW |
1 dart_library.library('dart/_js_helper', null, /* Imports */[ | 1 dart_library.library('dart/_js_helper', null, /* Imports */[ |
2 "dart/_runtime", | 2 "dart/_runtime", |
3 'dart/core', | 3 'dart/core', |
4 'dart/collection', | 4 'dart/collection', |
5 'dart/_interceptors', | 5 'dart/_interceptors', |
6 'dart/_foreign_helper' | 6 'dart/_foreign_helper' |
7 ], /* Lazy imports */[ | 7 ], /* Lazy imports */[ |
8 ], function(exports, dart, core, collection, _interceptors, _foreign_helper) { | 8 ], function(exports, dart, core, collection, _interceptors, _foreign_helper) { |
9 'use strict'; | 9 'use strict'; |
10 let dartx = dart.dartx; | 10 let dartx = dart.dartx; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 JSSyntaxRegExp(source, opts) { | 82 JSSyntaxRegExp(source, opts) { |
83 let multiLine = opts && 'multiLine' in opts ? opts.multiLine : false; | 83 let multiLine = opts && 'multiLine' in opts ? opts.multiLine : false; |
84 let caseSensitive = opts && 'caseSensitive' in opts ? opts.caseSensitive :
true; | 84 let caseSensitive = opts && 'caseSensitive' in opts ? opts.caseSensitive :
true; |
85 this.pattern = source; | 85 this.pattern = source; |
86 this[_nativeRegExp] = JSSyntaxRegExp.makeNative(source, multiLine, caseSen
sitive, false); | 86 this[_nativeRegExp] = JSSyntaxRegExp.makeNative(source, multiLine, caseSen
sitive, false); |
87 this[_nativeGlobalRegExp] = null; | 87 this[_nativeGlobalRegExp] = null; |
88 this[_nativeAnchoredRegExp] = null; | 88 this[_nativeAnchoredRegExp] = null; |
89 } | 89 } |
90 get [_nativeGlobalVersion]() { | 90 get [_nativeGlobalVersion]() { |
91 if (this[_nativeGlobalRegExp] != null) | 91 if (this[_nativeGlobalRegExp] != null) return this[_nativeGlobalRegExp]; |
92 return this[_nativeGlobalRegExp]; | |
93 return this[_nativeGlobalRegExp] = JSSyntaxRegExp.makeNative(this.pattern,
this[_isMultiLine], this[_isCaseSensitive], true); | 92 return this[_nativeGlobalRegExp] = JSSyntaxRegExp.makeNative(this.pattern,
this[_isMultiLine], this[_isCaseSensitive], true); |
94 } | 93 } |
95 get [_nativeAnchoredVersion]() { | 94 get [_nativeAnchoredVersion]() { |
96 if (this[_nativeAnchoredRegExp] != null) | 95 if (this[_nativeAnchoredRegExp] != null) return this[_nativeAnchoredRegExp
]; |
97 return this[_nativeAnchoredRegExp]; | |
98 return this[_nativeAnchoredRegExp] = JSSyntaxRegExp.makeNative(`${this.pat
tern}|()`, this[_isMultiLine], this[_isCaseSensitive], true); | 96 return this[_nativeAnchoredRegExp] = JSSyntaxRegExp.makeNative(`${this.pat
tern}|()`, this[_isMultiLine], this[_isCaseSensitive], true); |
99 } | 97 } |
100 get [_isMultiLine]() { | 98 get [_isMultiLine]() { |
101 return this[_nativeRegExp].multiline; | 99 return this[_nativeRegExp].multiline; |
102 } | 100 } |
103 get [_isCaseSensitive]() { | 101 get [_isCaseSensitive]() { |
104 return !this[_nativeRegExp].ignoreCase; | 102 return !this[_nativeRegExp].ignoreCase; |
105 } | 103 } |
106 static makeNative(source, multiLine, caseSensitive, global) { | 104 static makeNative(source, multiLine, caseSensitive, global) { |
107 checkString(source); | 105 checkString(source); |
108 let m = dart.notNull(multiLine) ? 'm' : ''; | 106 let m = dart.notNull(multiLine) ? 'm' : ''; |
109 let i = dart.notNull(caseSensitive) ? '' : 'i'; | 107 let i = dart.notNull(caseSensitive) ? '' : 'i'; |
110 let g = dart.notNull(global) ? 'g' : ''; | 108 let g = dart.notNull(global) ? 'g' : ''; |
111 let regexp = (function() { | 109 let regexp = (function() { |
112 try { | 110 try { |
113 return new RegExp(source, m + i + g); | 111 return new RegExp(source, m + i + g); |
114 } catch (e) { | 112 } catch (e) { |
115 return e; | 113 return e; |
116 } | 114 } |
117 | 115 |
118 })(); | 116 })(); |
119 if (regexp instanceof RegExp) | 117 if (regexp instanceof RegExp) return regexp; |
120 return regexp; | |
121 let errorMessage = String(regexp); | 118 let errorMessage = String(regexp); |
122 dart.throw(new core.FormatException(`Illegal RegExp pattern: ${source}, ${
errorMessage}`)); | 119 dart.throw(new core.FormatException(`Illegal RegExp pattern: ${source}, ${
errorMessage}`)); |
123 } | 120 } |
124 firstMatch(string) { | 121 firstMatch(string) { |
125 let m = dart.as(this[_nativeRegExp].exec(checkString(string)), core.List$(
core.String)); | 122 let m = dart.as(this[_nativeRegExp].exec(checkString(string)), core.List$(
core.String)); |
126 if (m == null) | 123 if (m == null) return null; |
127 return null; | |
128 return new _MatchImplementation(this, m); | 124 return new _MatchImplementation(this, m); |
129 } | 125 } |
130 hasMatch(string) { | 126 hasMatch(string) { |
131 return this[_nativeRegExp].test(checkString(string)); | 127 return this[_nativeRegExp].test(checkString(string)); |
132 } | 128 } |
133 stringMatch(string) { | 129 stringMatch(string) { |
134 let match = this.firstMatch(string); | 130 let match = this.firstMatch(string); |
135 if (match != null) | 131 if (match != null) return match.group(0); |
136 return match.group(0); | |
137 return null; | 132 return null; |
138 } | 133 } |
139 allMatches(string, start) { | 134 allMatches(string, start) { |
140 if (start === void 0) | 135 if (start === void 0) start = 0; |
141 start = 0; | |
142 checkString(string); | 136 checkString(string); |
143 checkInt(start); | 137 checkInt(start); |
144 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string[d
artx.length])) { | 138 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string[d
artx.length])) { |
145 dart.throw(new core.RangeError.range(start, 0, string[dartx.length])); | 139 dart.throw(new core.RangeError.range(start, 0, string[dartx.length])); |
146 } | 140 } |
147 return new _AllMatchesIterable(this, string, start); | 141 return new _AllMatchesIterable(this, string, start); |
148 } | 142 } |
149 [_execGlobal](string, start) { | 143 [_execGlobal](string, start) { |
150 let regexp = this[_nativeGlobalVersion]; | 144 let regexp = this[_nativeGlobalVersion]; |
151 regexp.lastIndex = start; | 145 regexp.lastIndex = start; |
152 let match = dart.as(regexp.exec(string), core.List); | 146 let match = dart.as(regexp.exec(string), core.List); |
153 if (match == null) | 147 if (match == null) return null; |
154 return null; | |
155 return new _MatchImplementation(this, dart.as(match, core.List$(core.Strin
g))); | 148 return new _MatchImplementation(this, dart.as(match, core.List$(core.Strin
g))); |
156 } | 149 } |
157 [_execAnchored](string, start) { | 150 [_execAnchored](string, start) { |
158 let regexp = this[_nativeAnchoredVersion]; | 151 let regexp = this[_nativeAnchoredVersion]; |
159 regexp.lastIndex = start; | 152 regexp.lastIndex = start; |
160 let match = dart.as(regexp.exec(string), core.List); | 153 let match = dart.as(regexp.exec(string), core.List); |
161 if (match == null) | 154 if (match == null) return null; |
162 return null; | 155 if (match[dartx.get](dart.notNull(match[dartx.length]) - 1) != null) retur
n null; |
163 if (match[dartx.get](dart.notNull(match[dartx.length]) - 1) != null) | |
164 return null; | |
165 match[dartx.length] = dart.notNull(match[dartx.length]) - 1; | 156 match[dartx.length] = dart.notNull(match[dartx.length]) - 1; |
166 return new _MatchImplementation(this, dart.as(match, core.List$(core.Strin
g))); | 157 return new _MatchImplementation(this, dart.as(match, core.List$(core.Strin
g))); |
167 } | 158 } |
168 matchAsPrefix(string, start) { | 159 matchAsPrefix(string, start) { |
169 if (start === void 0) | 160 if (start === void 0) start = 0; |
170 start = 0; | |
171 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string[d
artx.length])) { | 161 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string[d
artx.length])) { |
172 dart.throw(new core.RangeError.range(start, 0, string[dartx.length])); | 162 dart.throw(new core.RangeError.range(start, 0, string[dartx.length])); |
173 } | 163 } |
174 return this[_execAnchored](string, start); | 164 return this[_execAnchored](string, start); |
175 } | 165 } |
176 get isMultiLine() { | 166 get isMultiLine() { |
177 return this[_isMultiLine]; | 167 return this[_isMultiLine]; |
178 } | 168 } |
179 get isCaseSensitive() { | 169 get isCaseSensitive() { |
180 return this[_isCaseSensitive]; | 170 return this[_isCaseSensitive]; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 _AllMatchesIterator(regExp, string, nextIndex) { | 254 _AllMatchesIterator(regExp, string, nextIndex) { |
265 this[_regExp] = regExp; | 255 this[_regExp] = regExp; |
266 this[_string] = string; | 256 this[_string] = string; |
267 this[_nextIndex] = nextIndex; | 257 this[_nextIndex] = nextIndex; |
268 this[_current] = null; | 258 this[_current] = null; |
269 } | 259 } |
270 get current() { | 260 get current() { |
271 return this[_current]; | 261 return this[_current]; |
272 } | 262 } |
273 moveNext() { | 263 moveNext() { |
274 if (this[_string] == null) | 264 if (this[_string] == null) return false; |
275 return false; | |
276 if (dart.notNull(this[_nextIndex]) <= dart.notNull(this[_string][dartx.len
gth])) { | 265 if (dart.notNull(this[_nextIndex]) <= dart.notNull(this[_string][dartx.len
gth])) { |
277 let match = this[_regExp][_execGlobal](this[_string], this[_nextIndex]); | 266 let match = this[_regExp][_execGlobal](this[_string], this[_nextIndex]); |
278 if (match != null) { | 267 if (match != null) { |
279 this[_current] = match; | 268 this[_current] = match; |
280 let nextIndex = match.end; | 269 let nextIndex = match.end; |
281 if (match.start == nextIndex) { | 270 if (match.start == nextIndex) { |
282 nextIndex = dart.notNull(nextIndex) + 1; | 271 nextIndex = dart.notNull(nextIndex) + 1; |
283 } | 272 } |
284 this[_nextIndex] = nextIndex; | 273 this[_nextIndex] = nextIndex; |
285 return true; | 274 return true; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 } | 359 } |
371 } | 360 } |
372 dart.fn(stringContainsUnchecked); | 361 dart.fn(stringContainsUnchecked); |
373 function stringReplaceJS(receiver, replacer, to) { | 362 function stringReplaceJS(receiver, replacer, to) { |
374 to = to.replace(/\$/g, "$$$$"); | 363 to = to.replace(/\$/g, "$$$$"); |
375 return receiver.replace(replacer, to); | 364 return receiver.replace(replacer, to); |
376 } | 365 } |
377 dart.fn(stringReplaceJS); | 366 dart.fn(stringReplaceJS); |
378 function stringReplaceFirstRE(receiver, regexp, to, startIndex) { | 367 function stringReplaceFirstRE(receiver, regexp, to, startIndex) { |
379 let match = dart.dsend(regexp, _execGlobal, receiver, startIndex); | 368 let match = dart.dsend(regexp, _execGlobal, receiver, startIndex); |
380 if (match == null) | 369 if (match == null) return receiver; |
381 return receiver; | |
382 let start = dart.dload(match, 'start'); | 370 let start = dart.dload(match, 'start'); |
383 let end = dart.dload(match, 'end'); | 371 let end = dart.dload(match, 'end'); |
384 return `${dart.dsend(receiver, 'substring', 0, start)}${to}${dart.dsend(rece
iver, 'substring', end)}`; | 372 return `${dart.dsend(receiver, 'substring', 0, start)}${to}${dart.dsend(rece
iver, 'substring', end)}`; |
385 } | 373 } |
386 dart.fn(stringReplaceFirstRE); | 374 dart.fn(stringReplaceFirstRE); |
387 const ESCAPE_REGEXP = '[[\\]{}()*+?.\\\\^$|]'; | 375 const ESCAPE_REGEXP = '[[\\]{}()*+?.\\\\^$|]'; |
388 function stringReplaceAllUnchecked(receiver, from, to) { | 376 function stringReplaceAllUnchecked(receiver, from, to) { |
389 checkString(to); | 377 checkString(to); |
390 if (typeof from == 'string') { | 378 if (typeof from == 'string') { |
391 if (dart.equals(from, "")) { | 379 if (dart.equals(from, "")) { |
(...skipping 29 matching lines...) Expand all Loading... |
421 } | 409 } |
422 dart.fn(_matchString, core.String, [core.Match]); | 410 dart.fn(_matchString, core.String, [core.Match]); |
423 function _stringIdentity(string) { | 411 function _stringIdentity(string) { |
424 return string; | 412 return string; |
425 } | 413 } |
426 dart.fn(_stringIdentity, core.String, [core.String]); | 414 dart.fn(_stringIdentity, core.String, [core.String]); |
427 function stringReplaceAllFuncUnchecked(receiver, pattern, onMatch, onNonMatch)
{ | 415 function stringReplaceAllFuncUnchecked(receiver, pattern, onMatch, onNonMatch)
{ |
428 if (!dart.is(pattern, core.Pattern)) { | 416 if (!dart.is(pattern, core.Pattern)) { |
429 dart.throw(new core.ArgumentError(`${pattern} is not a Pattern`)); | 417 dart.throw(new core.ArgumentError(`${pattern} is not a Pattern`)); |
430 } | 418 } |
431 if (onMatch == null) | 419 if (onMatch == null) onMatch = _matchString; |
432 onMatch = _matchString; | 420 if (onNonMatch == null) onNonMatch = _stringIdentity; |
433 if (onNonMatch == null) | |
434 onNonMatch = _stringIdentity; | |
435 if (typeof pattern == 'string') { | 421 if (typeof pattern == 'string') { |
436 return stringReplaceAllStringFuncUnchecked(receiver, pattern, onMatch, onN
onMatch); | 422 return stringReplaceAllStringFuncUnchecked(receiver, pattern, onMatch, onN
onMatch); |
437 } | 423 } |
438 let buffer = new core.StringBuffer(); | 424 let buffer = new core.StringBuffer(); |
439 let startIndex = 0; | 425 let startIndex = 0; |
440 for (let match of dart.as(dart.dsend(pattern, 'allMatches', receiver), core.
Iterable$(core.Match))) { | 426 for (let match of dart.as(dart.dsend(pattern, 'allMatches', receiver), core.
Iterable$(core.Match))) { |
441 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', star
tIndex, match.start))); | 427 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', star
tIndex, match.start))); |
442 buffer.write(dart.dcall(onMatch, match)); | 428 buffer.write(dart.dcall(onMatch, match)); |
443 startIndex = match.end; | 429 startIndex = match.end; |
444 } | 430 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 } | 471 } |
486 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', star
tIndex, position))); | 472 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', star
tIndex, position))); |
487 buffer.write(dart.dcall(onMatch, new StringMatch(position, dart.as(receive
r, core.String), dart.as(pattern, core.String)))); | 473 buffer.write(dart.dcall(onMatch, new StringMatch(position, dart.as(receive
r, core.String), dart.as(pattern, core.String)))); |
488 startIndex = dart.notNull(position) + dart.notNull(patternLength); | 474 startIndex = dart.notNull(position) + dart.notNull(patternLength); |
489 } | 475 } |
490 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', startI
ndex))); | 476 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', startI
ndex))); |
491 return dart.toString(buffer); | 477 return dart.toString(buffer); |
492 } | 478 } |
493 dart.fn(stringReplaceAllStringFuncUnchecked); | 479 dart.fn(stringReplaceAllStringFuncUnchecked); |
494 function stringReplaceFirstUnchecked(receiver, from, to, startIndex) { | 480 function stringReplaceFirstUnchecked(receiver, from, to, startIndex) { |
495 if (startIndex === void 0) | 481 if (startIndex === void 0) startIndex = 0; |
496 startIndex = 0; | |
497 if (typeof from == 'string') { | 482 if (typeof from == 'string') { |
498 let index = dart.dsend(receiver, 'indexOf', from, startIndex); | 483 let index = dart.dsend(receiver, 'indexOf', from, startIndex); |
499 if (dart.notNull(dart.as(dart.dsend(index, '<', 0), core.bool))) | 484 if (dart.notNull(dart.as(dart.dsend(index, '<', 0), core.bool))) return re
ceiver; |
500 return receiver; | |
501 return `${dart.dsend(receiver, 'substring', 0, index)}${to}` + `${dart.dse
nd(receiver, 'substring', dart.dsend(index, '+', dart.dload(from, 'length')))}`; | 485 return `${dart.dsend(receiver, 'substring', 0, index)}${to}` + `${dart.dse
nd(receiver, 'substring', dart.dsend(index, '+', dart.dload(from, 'length')))}`; |
502 } else if (dart.is(from, JSSyntaxRegExp)) { | 486 } else if (dart.is(from, JSSyntaxRegExp)) { |
503 return startIndex == 0 ? stringReplaceJS(receiver, regExpGetNative(dart.as
(from, JSSyntaxRegExp)), to) : stringReplaceFirstRE(receiver, from, to, startInd
ex); | 487 return startIndex == 0 ? stringReplaceJS(receiver, regExpGetNative(dart.as
(from, JSSyntaxRegExp)), to) : stringReplaceFirstRE(receiver, from, to, startInd
ex); |
504 } else { | 488 } else { |
505 checkNull(from); | 489 checkNull(from); |
506 dart.throw("String.replace(Pattern) UNIMPLEMENTED"); | 490 dart.throw("String.replace(Pattern) UNIMPLEMENTED"); |
507 } | 491 } |
508 } | 492 } |
509 dart.fn(stringReplaceFirstUnchecked, dart.dynamic, [dart.dynamic, dart.dynamic
, dart.dynamic], [core.int]); | 493 dart.fn(stringReplaceFirstUnchecked, dart.dynamic, [dart.dynamic, dart.dynamic
, dart.dynamic], [core.int]); |
510 function stringJoinUnchecked(array, separator) { | 494 function stringJoinUnchecked(array, separator) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 if (hash == null) { | 532 if (hash == null) { |
549 hash = Math.random() * 0x3fffffff | 0; | 533 hash = Math.random() * 0x3fffffff | 0; |
550 object.$identityHash = hash; | 534 object.$identityHash = hash; |
551 } | 535 } |
552 return hash; | 536 return hash; |
553 } | 537 } |
554 static _throwFormatException(string) { | 538 static _throwFormatException(string) { |
555 dart.throw(new core.FormatException(string)); | 539 dart.throw(new core.FormatException(string)); |
556 } | 540 } |
557 static parseInt(source, radix, handleError) { | 541 static parseInt(source, radix, handleError) { |
558 if (handleError == null) | 542 if (handleError == null) handleError = dart.fn(s => dart.as(Primitives._th
rowFormatException(dart.as(s, core.String)), core.int), core.int, [dart.dynamic]
); |
559 handleError = dart.fn(s => dart.as(Primitives._throwFormatException(dart
.as(s, core.String)), core.int), core.int, [dart.dynamic]); | |
560 checkString(source); | 543 checkString(source); |
561 let match = /^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(source)
; | 544 let match = /^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(source)
; |
562 let digitsIndex = 1; | 545 let digitsIndex = 1; |
563 let hexIndex = 2; | 546 let hexIndex = 2; |
564 let decimalIndex = 3; | 547 let decimalIndex = 3; |
565 let nonDecimalHexIndex = 4; | 548 let nonDecimalHexIndex = 4; |
566 if (radix == null) { | 549 if (radix == null) { |
567 radix = 10; | 550 radix = 10; |
568 if (match != null) { | 551 if (match != null) { |
569 if (dart.dindex(match, hexIndex) != null) { | 552 if (dart.dindex(match, hexIndex) != null) { |
570 return parseInt(source, 16); | 553 return parseInt(source, 16); |
571 } | 554 } |
572 if (dart.dindex(match, decimalIndex) != null) { | 555 if (dart.dindex(match, decimalIndex) != null) { |
573 return parseInt(source, 10); | 556 return parseInt(source, 10); |
574 } | 557 } |
575 return handleError(source); | 558 return handleError(source); |
576 } | 559 } |
577 } else { | 560 } else { |
578 if (!(typeof radix == 'number')) | 561 if (!(typeof radix == 'number')) dart.throw(new core.ArgumentError("Radi
x is not an integer")); |
579 dart.throw(new core.ArgumentError("Radix is not an integer")); | |
580 if (dart.notNull(radix) < 2 || dart.notNull(radix) > 36) { | 562 if (dart.notNull(radix) < 2 || dart.notNull(radix) > 36) { |
581 dart.throw(new core.RangeError(`Radix ${radix} not in range 2..36`)); | 563 dart.throw(new core.RangeError(`Radix ${radix} not in range 2..36`)); |
582 } | 564 } |
583 if (match != null) { | 565 if (match != null) { |
584 if (radix == 10 && dart.dindex(match, decimalIndex) != null) { | 566 if (radix == 10 && dart.dindex(match, decimalIndex) != null) { |
585 return parseInt(source, 10); | 567 return parseInt(source, 10); |
586 } | 568 } |
587 if (dart.notNull(radix) < 10 || dart.dindex(match, decimalIndex) == nu
ll) { | 569 if (dart.notNull(radix) < 10 || dart.dindex(match, decimalIndex) == nu
ll) { |
588 let maxCharCode = null; | 570 let maxCharCode = null; |
589 if (dart.notNull(radix) <= 10) { | 571 if (dart.notNull(radix) <= 10) { |
590 maxCharCode = 48 + dart.notNull(radix) - 1; | 572 maxCharCode = 48 + dart.notNull(radix) - 1; |
591 } else { | 573 } else { |
592 maxCharCode = 97 + dart.notNull(radix) - 10 - 1; | 574 maxCharCode = 97 + dart.notNull(radix) - 10 - 1; |
593 } | 575 } |
594 let digitsPart = dart.as(dart.dindex(match, digitsIndex), core.Strin
g); | 576 let digitsPart = dart.as(dart.dindex(match, digitsIndex), core.Strin
g); |
595 for (let i = 0; dart.notNull(i) < dart.notNull(digitsPart[dartx.leng
th]); i = dart.notNull(i) + 1) { | 577 for (let i = 0; dart.notNull(i) < dart.notNull(digitsPart[dartx.leng
th]); i = dart.notNull(i) + 1) { |
596 let characterCode = dart.notNull(digitsPart[dartx.codeUnitAt](0))
| 32; | 578 let characterCode = dart.notNull(digitsPart[dartx.codeUnitAt](0))
| 32; |
597 if (dart.notNull(digitsPart[dartx.codeUnitAt](i)) > dart.notNull(m
axCharCode)) { | 579 if (dart.notNull(digitsPart[dartx.codeUnitAt](i)) > dart.notNull(m
axCharCode)) { |
598 return handleError(source); | 580 return handleError(source); |
599 } | 581 } |
600 } | 582 } |
601 } | 583 } |
602 } | 584 } |
603 } | 585 } |
604 if (match == null) | 586 if (match == null) return handleError(source); |
605 return handleError(source); | |
606 return parseInt(source, radix); | 587 return parseInt(source, radix); |
607 } | 588 } |
608 static parseDouble(source, handleError) { | 589 static parseDouble(source, handleError) { |
609 checkString(source); | 590 checkString(source); |
610 if (handleError == null) | 591 if (handleError == null) handleError = dart.fn(s => dart.as(Primitives._th
rowFormatException(dart.as(s, core.String)), core.double), core.double, [dart.dy
namic]); |
611 handleError = dart.fn(s => dart.as(Primitives._throwFormatException(dart
.as(s, core.String)), core.double), core.double, [dart.dynamic]); | |
612 if (!/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s
*$/.test(source)) { | 592 if (!/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s
*$/.test(source)) { |
613 return handleError(source); | 593 return handleError(source); |
614 } | 594 } |
615 let result = parseFloat(source); | 595 let result = parseFloat(source); |
616 if (dart.notNull(result[dartx.isNaN])) { | 596 if (dart.notNull(result[dartx.isNaN])) { |
617 let trimmed = source[dartx.trim](); | 597 let trimmed = source[dartx.trim](); |
618 if (trimmed == 'NaN' || trimmed == '+NaN' || trimmed == '-NaN') { | 598 if (trimmed == 'NaN' || trimmed == '+NaN' || trimmed == '-NaN') { |
619 return result; | 599 return result; |
620 } | 600 } |
621 return handleError(source); | 601 return handleError(source); |
622 } | 602 } |
623 return result; | 603 return result; |
624 } | 604 } |
625 static objectTypeName(object) { | 605 static objectTypeName(object) { |
626 return dart.toString(getRuntimeType(object)); | 606 return dart.toString(getRuntimeType(object)); |
627 } | 607 } |
628 static objectToString(object) { | 608 static objectToString(object) { |
629 let name = dart.typeName(dart.realRuntimeType(object)); | 609 let name = dart.typeName(dart.realRuntimeType(object)); |
630 return `Instance of '${name}'`; | 610 return `Instance of '${name}'`; |
631 } | 611 } |
632 static dateNow() { | 612 static dateNow() { |
633 return Date.now(); | 613 return Date.now(); |
634 } | 614 } |
635 static initTicker() { | 615 static initTicker() { |
636 if (Primitives.timerFrequency != null) | 616 if (Primitives.timerFrequency != null) return; |
637 return; | |
638 Primitives.timerFrequency = 1000; | 617 Primitives.timerFrequency = 1000; |
639 Primitives.timerTicks = Primitives.dateNow; | 618 Primitives.timerTicks = Primitives.dateNow; |
640 if (typeof window == "undefined") | 619 if (typeof window == "undefined") return; |
641 return; | |
642 let jsWindow = window; | 620 let jsWindow = window; |
643 if (jsWindow == null) | 621 if (jsWindow == null) return; |
644 return; | |
645 let performance = jsWindow.performance; | 622 let performance = jsWindow.performance; |
646 if (performance == null) | 623 if (performance == null) return; |
647 return; | 624 if (typeof performance.now != "function") return; |
648 if (typeof performance.now != "function") | |
649 return; | |
650 Primitives.timerFrequency = 1000000; | 625 Primitives.timerFrequency = 1000000; |
651 Primitives.timerTicks = dart.fn(() => (1000 * performance.now())[dartx.flo
or](), core.int, []); | 626 Primitives.timerTicks = dart.fn(() => (1000 * performance.now())[dartx.flo
or](), core.int, []); |
652 } | 627 } |
653 static get isD8() { | 628 static get isD8() { |
654 return typeof version == "function" && typeof os == "object" && "system" i
n os; | 629 return typeof version == "function" && typeof os == "object" && "system" i
n os; |
655 } | 630 } |
656 static get isJsshell() { | 631 static get isJsshell() { |
657 return typeof version == "function" && typeof system == "function"; | 632 return typeof version == "function" && typeof system == "function"; |
658 } | 633 } |
659 static currentUri() { | 634 static currentUri() { |
(...skipping 13 matching lines...) Expand all Loading... |
673 } else { | 648 } else { |
674 subarray = array.slice(i, dart.notNull(i) + dart.notNull(kMaxApply) <
dart.notNull(end) ? dart.notNull(i) + dart.notNull(kMaxApply) : end); | 649 subarray = array.slice(i, dart.notNull(i) + dart.notNull(kMaxApply) <
dart.notNull(end) ? dart.notNull(i) + dart.notNull(kMaxApply) : end); |
675 } | 650 } |
676 result = result + String.fromCharCode.apply(null, subarray); | 651 result = result + String.fromCharCode.apply(null, subarray); |
677 } | 652 } |
678 return result; | 653 return result; |
679 } | 654 } |
680 static stringFromCodePoints(codePoints) { | 655 static stringFromCodePoints(codePoints) { |
681 let a = dart.list([], core.int); | 656 let a = dart.list([], core.int); |
682 for (let i of dart.as(codePoints, core.Iterable)) { | 657 for (let i of dart.as(codePoints, core.Iterable)) { |
683 if (!(typeof i == 'number')) | 658 if (!(typeof i == 'number')) dart.throw(new core.ArgumentError(i)); |
684 dart.throw(new core.ArgumentError(i)); | |
685 if (dart.notNull(dart.as(dart.dsend(i, '<=', 65535), core.bool))) { | 659 if (dart.notNull(dart.as(dart.dsend(i, '<=', 65535), core.bool))) { |
686 a[dartx.add](dart.as(i, core.int)); | 660 a[dartx.add](dart.as(i, core.int)); |
687 } else if (dart.notNull(dart.as(dart.dsend(i, '<=', 1114111), core.bool)
)) { | 661 } else if (dart.notNull(dart.as(dart.dsend(i, '<=', 1114111), core.bool)
)) { |
688 a[dartx.add](dart.asInt((55296)[dartx['+']](dart.as(dart.dsend(dart.ds
end(dart.dsend(i, '-', 65536), '>>', 10), '&', 1023), core.num)))); | 662 a[dartx.add](dart.asInt((55296)[dartx['+']](dart.as(dart.dsend(dart.ds
end(dart.dsend(i, '-', 65536), '>>', 10), '&', 1023), core.num)))); |
689 a[dartx.add](dart.asInt((56320)[dartx['+']](dart.as(dart.dsend(i, '&',
1023), core.num)))); | 663 a[dartx.add](dart.asInt((56320)[dartx['+']](dart.as(dart.dsend(i, '&',
1023), core.num)))); |
690 } else { | 664 } else { |
691 dart.throw(new core.ArgumentError(i)); | 665 dart.throw(new core.ArgumentError(i)); |
692 } | 666 } |
693 } | 667 } |
694 return Primitives._fromCharCodeApply(a); | 668 return Primitives._fromCharCodeApply(a); |
695 } | 669 } |
696 static stringFromCharCodes(charCodes) { | 670 static stringFromCharCodes(charCodes) { |
697 for (let i of dart.as(charCodes, core.Iterable)) { | 671 for (let i of dart.as(charCodes, core.Iterable)) { |
698 if (!(typeof i == 'number')) | 672 if (!(typeof i == 'number')) dart.throw(new core.ArgumentError(i)); |
699 dart.throw(new core.ArgumentError(i)); | 673 if (dart.notNull(dart.as(dart.dsend(i, '<', 0), core.bool))) dart.throw(
new core.ArgumentError(i)); |
700 if (dart.notNull(dart.as(dart.dsend(i, '<', 0), core.bool))) | 674 if (dart.notNull(dart.as(dart.dsend(i, '>', 65535), core.bool))) return
Primitives.stringFromCodePoints(charCodes); |
701 dart.throw(new core.ArgumentError(i)); | |
702 if (dart.notNull(dart.as(dart.dsend(i, '>', 65535), core.bool))) | |
703 return Primitives.stringFromCodePoints(charCodes); | |
704 } | 675 } |
705 return Primitives._fromCharCodeApply(dart.as(charCodes, core.List$(core.in
t))); | 676 return Primitives._fromCharCodeApply(dart.as(charCodes, core.List$(core.in
t))); |
706 } | 677 } |
707 static stringFromCharCode(charCode) { | 678 static stringFromCharCode(charCode) { |
708 if (0 <= dart.notNull(dart.as(charCode, core.num))) { | 679 if (0 <= dart.notNull(dart.as(charCode, core.num))) { |
709 if (dart.notNull(dart.as(dart.dsend(charCode, '<=', 65535), core.bool)))
{ | 680 if (dart.notNull(dart.as(dart.dsend(charCode, '<=', 65535), core.bool)))
{ |
710 return String.fromCharCode(charCode); | 681 return String.fromCharCode(charCode); |
711 } | 682 } |
712 if (dart.notNull(dart.as(dart.dsend(charCode, '<=', 1114111), core.bool)
)) { | 683 if (dart.notNull(dart.as(dart.dsend(charCode, '<=', 1114111), core.bool)
)) { |
713 let bits = dart.dsend(charCode, '-', 65536); | 684 let bits = dart.dsend(charCode, '-', 65536); |
714 let low = (56320)[dartx['|']](dart.as(dart.dsend(bits, '&', 1023), cor
e.int)); | 685 let low = (56320)[dartx['|']](dart.as(dart.dsend(bits, '&', 1023), cor
e.int)); |
715 let high = (55296)[dartx['|']](dart.as(dart.dsend(bits, '>>', 10), cor
e.int)); | 686 let high = (55296)[dartx['|']](dart.as(dart.dsend(bits, '>>', 10), cor
e.int)); |
716 return String.fromCharCode(high, low); | 687 return String.fromCharCode(high, low); |
717 } | 688 } |
718 } | 689 } |
719 dart.throw(new core.RangeError.range(dart.as(charCode, core.num), 0, 11141
11)); | 690 dart.throw(new core.RangeError.range(dart.as(charCode, core.num), 0, 11141
11)); |
720 } | 691 } |
721 static stringConcatUnchecked(string1, string2) { | 692 static stringConcatUnchecked(string1, string2) { |
722 return _foreign_helper.JS_STRING_CONCAT(string1, string2); | 693 return _foreign_helper.JS_STRING_CONCAT(string1, string2); |
723 } | 694 } |
724 static flattenString(str) { | 695 static flattenString(str) { |
725 return str.charCodeAt(0) == 0 ? str : str; | 696 return str.charCodeAt(0) == 0 ? str : str; |
726 } | 697 } |
727 static getTimeZoneName(receiver) { | 698 static getTimeZoneName(receiver) { |
728 let d = Primitives.lazyAsJsDate(receiver); | 699 let d = Primitives.lazyAsJsDate(receiver); |
729 let match = dart.as(/\((.*)\)/.exec(d.toString()), core.List); | 700 let match = dart.as(/\((.*)\)/.exec(d.toString()), core.List); |
730 if (match != null) | 701 if (match != null) return dart.as(match[dartx.get](1), core.String); |
731 return dart.as(match[dartx.get](1), core.String); | |
732 match = dart.as(/^[A-Z,a-z]{3}\s[A-Z,a-z]{3}\s\d+\s\d{2}:\d{2}:\d{2}\s([A-
Z]{3,5})\s\d{4}$/.exec(d.toString()), core.List); | 702 match = dart.as(/^[A-Z,a-z]{3}\s[A-Z,a-z]{3}\s\d+\s\d{2}:\d{2}:\d{2}\s([A-
Z]{3,5})\s\d{4}$/.exec(d.toString()), core.List); |
733 if (match != null) | 703 if (match != null) return dart.as(match[dartx.get](1), core.String); |
734 return dart.as(match[dartx.get](1), core.String); | |
735 match = dart.as(/(?:GMT|UTC)[+-]\d{4}/.exec(d.toString()), core.List); | 704 match = dart.as(/(?:GMT|UTC)[+-]\d{4}/.exec(d.toString()), core.List); |
736 if (match != null) | 705 if (match != null) return dart.as(match[dartx.get](0), core.String); |
737 return dart.as(match[dartx.get](0), core.String); | |
738 return ""; | 706 return ""; |
739 } | 707 } |
740 static getTimeZoneOffsetInMinutes(receiver) { | 708 static getTimeZoneOffsetInMinutes(receiver) { |
741 return -Primitives.lazyAsJsDate(receiver).getTimezoneOffset(); | 709 return -Primitives.lazyAsJsDate(receiver).getTimezoneOffset(); |
742 } | 710 } |
743 static valueFromDecomposedDate(years, month, day, hours, minutes, seconds, m
illiseconds, isUtc) { | 711 static valueFromDecomposedDate(years, month, day, hours, minutes, seconds, m
illiseconds, isUtc) { |
744 let MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000; | 712 let MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000; |
745 checkInt(years); | 713 checkInt(years); |
746 checkInt(month); | 714 checkInt(month); |
747 checkInt(day); | 715 checkInt(day); |
748 checkInt(hours); | 716 checkInt(hours); |
749 checkInt(minutes); | 717 checkInt(minutes); |
750 checkInt(seconds); | 718 checkInt(seconds); |
751 checkInt(milliseconds); | 719 checkInt(milliseconds); |
752 checkBool(isUtc); | 720 checkBool(isUtc); |
753 let jsMonth = dart.dsend(month, '-', 1); | 721 let jsMonth = dart.dsend(month, '-', 1); |
754 let value = null; | 722 let value = null; |
755 if (dart.notNull(dart.as(isUtc, core.bool))) { | 723 if (dart.notNull(dart.as(isUtc, core.bool))) { |
756 value = Date.UTC(years, jsMonth, day, hours, minutes, seconds, milliseco
nds); | 724 value = Date.UTC(years, jsMonth, day, hours, minutes, seconds, milliseco
nds); |
757 } else { | 725 } else { |
758 value = new Date(years, jsMonth, day, hours, minutes, seconds, milliseco
nds).valueOf(); | 726 value = new Date(years, jsMonth, day, hours, minutes, seconds, milliseco
nds).valueOf(); |
759 } | 727 } |
760 if (dart.notNull(dart.as(dart.dload(value, 'isNaN'), core.bool)) || dart.n
otNull(dart.as(dart.dsend(value, '<', -dart.notNull(MAX_MILLISECONDS_SINCE_EPOCH
)), core.bool)) || dart.notNull(dart.as(dart.dsend(value, '>', MAX_MILLISECONDS_
SINCE_EPOCH), core.bool))) { | 728 if (dart.notNull(dart.as(dart.dload(value, 'isNaN'), core.bool)) || dart.n
otNull(dart.as(dart.dsend(value, '<', -dart.notNull(MAX_MILLISECONDS_SINCE_EPOCH
)), core.bool)) || dart.notNull(dart.as(dart.dsend(value, '>', MAX_MILLISECONDS_
SINCE_EPOCH), core.bool))) { |
761 return null; | 729 return null; |
762 } | 730 } |
763 if (dart.notNull(dart.as(dart.dsend(years, '<=', 0), core.bool)) || dart.n
otNull(dart.as(dart.dsend(years, '<', 100), core.bool))) | 731 if (dart.notNull(dart.as(dart.dsend(years, '<=', 0), core.bool)) || dart.n
otNull(dart.as(dart.dsend(years, '<', 100), core.bool))) return Primitives.patch
UpY2K(value, years, isUtc); |
764 return Primitives.patchUpY2K(value, years, isUtc); | |
765 return value; | 732 return value; |
766 } | 733 } |
767 static patchUpY2K(value, years, isUtc) { | 734 static patchUpY2K(value, years, isUtc) { |
768 let date = new Date(value); | 735 let date = new Date(value); |
769 if (dart.notNull(dart.as(isUtc, core.bool))) { | 736 if (dart.notNull(dart.as(isUtc, core.bool))) { |
770 date.setUTCFullYear(years); | 737 date.setUTCFullYear(years); |
771 } else { | 738 } else { |
772 date.setFullYear(years); | 739 date.setFullYear(years); |
773 } | 740 } |
774 return date.valueOf(); | 741 return date.valueOf(); |
(...skipping 23 matching lines...) Expand all Loading... |
798 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? P
rimitives.lazyAsJsDate(receiver).getUTCSeconds() + 0 : Primitives.lazyAsJsDate(r
eceiver).getSeconds() + 0; | 765 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? P
rimitives.lazyAsJsDate(receiver).getUTCSeconds() + 0 : Primitives.lazyAsJsDate(r
eceiver).getSeconds() + 0; |
799 } | 766 } |
800 static getMilliseconds(receiver) { | 767 static getMilliseconds(receiver) { |
801 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? P
rimitives.lazyAsJsDate(receiver).getUTCMilliseconds() + 0 : Primitives.lazyAsJsD
ate(receiver).getMilliseconds() + 0; | 768 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? P
rimitives.lazyAsJsDate(receiver).getUTCMilliseconds() + 0 : Primitives.lazyAsJsD
ate(receiver).getMilliseconds() + 0; |
802 } | 769 } |
803 static getWeekday(receiver) { | 770 static getWeekday(receiver) { |
804 let weekday = dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.boo
l)) ? Primitives.lazyAsJsDate(receiver).getUTCDay() + 0 : Primitives.lazyAsJsDat
e(receiver).getDay() + 0; | 771 let weekday = dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.boo
l)) ? Primitives.lazyAsJsDate(receiver).getUTCDay() + 0 : Primitives.lazyAsJsDat
e(receiver).getDay() + 0; |
805 return (dart.notNull(weekday) + 6) % 7 + 1; | 772 return (dart.notNull(weekday) + 6) % 7 + 1; |
806 } | 773 } |
807 static valueFromDateString(str) { | 774 static valueFromDateString(str) { |
808 if (!(typeof str == 'string')) | 775 if (!(typeof str == 'string')) dart.throw(new core.ArgumentError(str)); |
809 dart.throw(new core.ArgumentError(str)); | |
810 let value = Date.parse(str); | 776 let value = Date.parse(str); |
811 if (dart.notNull(value[dartx.isNaN])) | 777 if (dart.notNull(value[dartx.isNaN])) dart.throw(new core.ArgumentError(st
r)); |
812 dart.throw(new core.ArgumentError(str)); | |
813 return value; | 778 return value; |
814 } | 779 } |
815 static getProperty(object, key) { | 780 static getProperty(object, key) { |
816 if (object == null || typeof object == 'boolean' || typeof object == 'numb
er' || typeof object == 'string') { | 781 if (object == null || typeof object == 'boolean' || typeof object == 'numb
er' || typeof object == 'string') { |
817 dart.throw(new core.ArgumentError(object)); | 782 dart.throw(new core.ArgumentError(object)); |
818 } | 783 } |
819 return object[key]; | 784 return object[key]; |
820 } | 785 } |
821 static setProperty(object, key, value) { | 786 static setProperty(object, key, value) { |
822 if (object == null || typeof object == 'boolean' || typeof object == 'numb
er' || typeof object == 'string') { | 787 if (object == null || typeof object == 'boolean' || typeof object == 'numb
er' || typeof object == 'string') { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 Primitives.mirrorFunctionCacheName = '$cachedFunction'; | 838 Primitives.mirrorFunctionCacheName = '$cachedFunction'; |
874 Primitives.mirrorInvokeCacheName = '$cachedInvocation'; | 839 Primitives.mirrorInvokeCacheName = '$cachedInvocation'; |
875 Primitives.DOLLAR_CHAR_VALUE = 36; | 840 Primitives.DOLLAR_CHAR_VALUE = 36; |
876 Primitives.timerFrequency = null; | 841 Primitives.timerFrequency = null; |
877 Primitives.timerTicks = null; | 842 Primitives.timerTicks = null; |
878 function stringLastIndexOfUnchecked(receiver, element, start) { | 843 function stringLastIndexOfUnchecked(receiver, element, start) { |
879 return receiver.lastIndexOf(element, start); | 844 return receiver.lastIndexOf(element, start); |
880 } | 845 } |
881 dart.fn(stringLastIndexOfUnchecked); | 846 dart.fn(stringLastIndexOfUnchecked); |
882 function checkNull(object) { | 847 function checkNull(object) { |
883 if (object == null) | 848 if (object == null) dart.throw(new core.ArgumentError(null)); |
884 dart.throw(new core.ArgumentError(null)); | |
885 return object; | 849 return object; |
886 } | 850 } |
887 dart.fn(checkNull); | 851 dart.fn(checkNull); |
888 function checkNum(value) { | 852 function checkNum(value) { |
889 if (!(typeof value == 'number')) { | 853 if (!(typeof value == 'number')) { |
890 dart.throw(new core.ArgumentError(value)); | 854 dart.throw(new core.ArgumentError(value)); |
891 } | 855 } |
892 return value; | 856 return value; |
893 } | 857 } |
894 dart.fn(checkNum); | 858 dart.fn(checkNum); |
(...skipping 28 matching lines...) Expand all Loading... |
923 dart.fn(throwAbstractClassInstantiationError); | 887 dart.fn(throwAbstractClassInstantiationError); |
924 const _message = Symbol('_message'); | 888 const _message = Symbol('_message'); |
925 const _method = Symbol('_method'); | 889 const _method = Symbol('_method'); |
926 class NullError extends core.Error { | 890 class NullError extends core.Error { |
927 NullError(message, match) { | 891 NullError(message, match) { |
928 this[_message] = message; | 892 this[_message] = message; |
929 this[_method] = match == null ? null : dart.as(match.method, core.String); | 893 this[_method] = match == null ? null : dart.as(match.method, core.String); |
930 super.Error(); | 894 super.Error(); |
931 } | 895 } |
932 toString() { | 896 toString() { |
933 if (this[_method] == null) | 897 if (this[_method] == null) return `NullError: ${this[_message]}`; |
934 return `NullError: ${this[_message]}`; | |
935 return `NullError: Cannot call "${this[_method]}" on null`; | 898 return `NullError: Cannot call "${this[_method]}" on null`; |
936 } | 899 } |
937 } | 900 } |
938 NullError[dart.implements] = () => [core.NoSuchMethodError]; | 901 NullError[dart.implements] = () => [core.NoSuchMethodError]; |
939 dart.setSignature(NullError, { | 902 dart.setSignature(NullError, { |
940 constructors: () => ({NullError: [NullError, [core.String, dart.dynamic]]}) | 903 constructors: () => ({NullError: [NullError, [core.String, dart.dynamic]]}) |
941 }); | 904 }); |
942 const _receiver = Symbol('_receiver'); | 905 const _receiver = Symbol('_receiver'); |
943 class JsNoSuchMethodError extends core.Error { | 906 class JsNoSuchMethodError extends core.Error { |
944 JsNoSuchMethodError(message, match) { | 907 JsNoSuchMethodError(message, match) { |
945 this[_message] = message; | 908 this[_message] = message; |
946 this[_method] = match == null ? null : dart.as(match.method, core.String); | 909 this[_method] = match == null ? null : dart.as(match.method, core.String); |
947 this[_receiver] = match == null ? null : dart.as(match.receiver, core.Stri
ng); | 910 this[_receiver] = match == null ? null : dart.as(match.receiver, core.Stri
ng); |
948 super.Error(); | 911 super.Error(); |
949 } | 912 } |
950 toString() { | 913 toString() { |
951 if (this[_method] == null) | 914 if (this[_method] == null) return `NoSuchMethodError: ${this[_message]}`; |
952 return `NoSuchMethodError: ${this[_message]}`; | |
953 if (this[_receiver] == null) { | 915 if (this[_receiver] == null) { |
954 return `NoSuchMethodError: Cannot call "${this[_method]}" (${this[_messa
ge]})`; | 916 return `NoSuchMethodError: Cannot call "${this[_method]}" (${this[_messa
ge]})`; |
955 } | 917 } |
956 return `NoSuchMethodError: Cannot call "${this[_method]}" on "${this[_rece
iver]}" ` + `(${this[_message]})`; | 918 return `NoSuchMethodError: Cannot call "${this[_method]}" on "${this[_rece
iver]}" ` + `(${this[_message]})`; |
957 } | 919 } |
958 } | 920 } |
959 JsNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodError]; | 921 JsNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodError]; |
960 dart.setSignature(JsNoSuchMethodError, { | 922 dart.setSignature(JsNoSuchMethodError, { |
961 constructors: () => ({JsNoSuchMethodError: [JsNoSuchMethodError, [core.Strin
g, dart.dynamic]]}) | 923 constructors: () => ({JsNoSuchMethodError: [JsNoSuchMethodError, [core.Strin
g, dart.dynamic]]}) |
962 }); | 924 }); |
(...skipping 14 matching lines...) Expand all Loading... |
977 } | 939 } |
978 dart.fn(getTraceFromException, core.StackTrace, [dart.dynamic]); | 940 dart.fn(getTraceFromException, core.StackTrace, [dart.dynamic]); |
979 const _exception = Symbol('_exception'); | 941 const _exception = Symbol('_exception'); |
980 const _trace = Symbol('_trace'); | 942 const _trace = Symbol('_trace'); |
981 class _StackTrace extends core.Object { | 943 class _StackTrace extends core.Object { |
982 _StackTrace(exception) { | 944 _StackTrace(exception) { |
983 this[_exception] = exception; | 945 this[_exception] = exception; |
984 this[_trace] = null; | 946 this[_trace] = null; |
985 } | 947 } |
986 toString() { | 948 toString() { |
987 if (this[_trace] != null) | 949 if (this[_trace] != null) return this[_trace]; |
988 return this[_trace]; | |
989 let trace = null; | 950 let trace = null; |
990 if (typeof this[_exception] === "object") { | 951 if (typeof this[_exception] === "object") { |
991 trace = dart.as(this[_exception].stack, core.String); | 952 trace = dart.as(this[_exception].stack, core.String); |
992 } | 953 } |
993 return this[_trace] = trace == null ? '' : trace; | 954 return this[_trace] = trace == null ? '' : trace; |
994 } | 955 } |
995 } | 956 } |
996 _StackTrace[dart.implements] = () => [core.StackTrace]; | 957 _StackTrace[dart.implements] = () => [core.StackTrace]; |
997 dart.setSignature(_StackTrace, { | 958 dart.setSignature(_StackTrace, { |
998 constructors: () => ({_StackTrace: [_StackTrace, [dart.dynamic]]}) | 959 constructors: () => ({_StackTrace: [_StackTrace, [dart.dynamic]]}) |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 exports.CastErrorImplementation = CastErrorImplementation; | 1193 exports.CastErrorImplementation = CastErrorImplementation; |
1233 exports.FallThroughErrorImplementation = FallThroughErrorImplementation; | 1194 exports.FallThroughErrorImplementation = FallThroughErrorImplementation; |
1234 exports.RuntimeError = RuntimeError; | 1195 exports.RuntimeError = RuntimeError; |
1235 exports.random64 = random64; | 1196 exports.random64 = random64; |
1236 exports.jsonEncodeNative = jsonEncodeNative; | 1197 exports.jsonEncodeNative = jsonEncodeNative; |
1237 exports.SyncIterator$ = SyncIterator$; | 1198 exports.SyncIterator$ = SyncIterator$; |
1238 exports.SyncIterator = SyncIterator; | 1199 exports.SyncIterator = SyncIterator; |
1239 exports.SyncIterable$ = SyncIterable$; | 1200 exports.SyncIterable$ = SyncIterable$; |
1240 exports.SyncIterable = SyncIterable; | 1201 exports.SyncIterable = SyncIterable; |
1241 }); | 1202 }); |
OLD | NEW |