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

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

Issue 1355893003: Rewire DDC to use the analyzer task model (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 dart_library.library('dart/_js_helper', null, /* Imports */[ 1 dart_library.library('dart/_js_helper', null, /* Imports */[
2 "dart_runtime/dart", 2 "dart_runtime/dart",
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 let _execGlobal = Symbol('_execGlobal'); 85 let _execGlobal = Symbol('_execGlobal');
86 let _execAnchored = Symbol('_execAnchored'); 86 let _execAnchored = Symbol('_execAnchored');
87 class JSSyntaxRegExp extends core.Object { 87 class JSSyntaxRegExp extends core.Object {
88 toString() { 88 toString() {
89 return `RegExp/${this.pattern}/`; 89 return `RegExp/${this.pattern}/`;
90 } 90 }
91 JSSyntaxRegExp(source, opts) { 91 JSSyntaxRegExp(source, opts) {
92 let multiLine = opts && 'multiLine' in opts ? opts.multiLine : false; 92 let multiLine = opts && 'multiLine' in opts ? opts.multiLine : false;
93 let caseSensitive = opts && 'caseSensitive' in opts ? opts.caseSensitive : true; 93 let caseSensitive = opts && 'caseSensitive' in opts ? opts.caseSensitive : true;
94 this.pattern = source; 94 this.pattern = source;
95 this[_nativeRegExp] = JSSyntaxRegExp.makeNative(source, multiLine, caseSen sitive, false); 95 this[_nativeRegExp] = dart.dcall(JSSyntaxRegExp.makeNative, source, multiL ine, caseSensitive, false);
96 this[_nativeGlobalRegExp] = null; 96 this[_nativeGlobalRegExp] = null;
97 this[_nativeAnchoredRegExp] = null; 97 this[_nativeAnchoredRegExp] = null;
98 } 98 }
99 get [_nativeGlobalVersion]() { 99 get [_nativeGlobalVersion]() {
100 if (this[_nativeGlobalRegExp] != null) 100 if (this[_nativeGlobalRegExp] != null)
101 return this[_nativeGlobalRegExp]; 101 return this[_nativeGlobalRegExp];
102 return this[_nativeGlobalRegExp] = JSSyntaxRegExp.makeNative(this.pattern, this[_isMultiLine], this[_isCaseSensitive], true); 102 return this[_nativeGlobalRegExp] = dart.dcall(JSSyntaxRegExp.makeNative, t his.pattern, this[_isMultiLine], this[_isCaseSensitive], true);
103 } 103 }
104 get [_nativeAnchoredVersion]() { 104 get [_nativeAnchoredVersion]() {
105 if (this[_nativeAnchoredRegExp] != null) 105 if (this[_nativeAnchoredRegExp] != null)
106 return this[_nativeAnchoredRegExp]; 106 return this[_nativeAnchoredRegExp];
107 return this[_nativeAnchoredRegExp] = JSSyntaxRegExp.makeNative(`${this.pat tern}|()`, this[_isMultiLine], this[_isCaseSensitive], true); 107 return this[_nativeAnchoredRegExp] = dart.dcall(JSSyntaxRegExp.makeNative, `${this.pattern}|()`, this[_isMultiLine], this[_isCaseSensitive], true);
108 } 108 }
109 get [_isMultiLine]() { 109 get [_isMultiLine]() {
110 return this[_nativeRegExp].multiline; 110 return dart.as(this[_nativeRegExp].multiline, core.bool);
111 } 111 }
112 get [_isCaseSensitive]() { 112 get [_isCaseSensitive]() {
113 return !this[_nativeRegExp].ignoreCase; 113 return dart.as(!this[_nativeRegExp].ignoreCase, core.bool);
114 } 114 }
115 static makeNative(source, multiLine, caseSensitive, global) { 115 static makeNative(source, multiLine, caseSensitive, global) {
116 checkString(source); 116 dart.dcall(checkString, source);
117 let m = dart.notNull(multiLine) ? 'm' : ''; 117 let m = dart.notNull(multiLine) ? 'm' : '';
118 let i = dart.notNull(caseSensitive) ? '' : 'i'; 118 let i = dart.notNull(caseSensitive) ? '' : 'i';
119 let g = dart.notNull(global) ? 'g' : ''; 119 let g = dart.notNull(global) ? 'g' : '';
120 let regexp = (function() { 120 let regexp = (function() {
121 try { 121 try {
122 return new RegExp(source, m + i + g); 122 return new RegExp(source, m + i + g);
123 } catch (e) { 123 } catch (e) {
124 return e; 124 return e;
125 } 125 }
126 126
127 })(); 127 })();
128 if (regexp instanceof RegExp) 128 if (dart.notNull(dart.as(regexp instanceof RegExp, core.bool)))
129 return regexp; 129 return regexp;
130 let errorMessage = String(regexp); 130 let errorMessage = dart.as(String(regexp), core.String);
131 dart.throw(new core.FormatException(`Illegal RegExp pattern: ${source}, ${ errorMessage}`)); 131 dart.throw(new core.FormatException(`Illegal RegExp pattern: ${source}, ${ errorMessage}`));
132 } 132 }
133 firstMatch(string) { 133 firstMatch(string) {
134 let m = dart.as(this[_nativeRegExp].exec(checkString(string)), core.List$( core.String)); 134 let m = dart.as(this[_nativeRegExp].exec(dart.dcall(checkString, string)), core.List$(core.String));
135 if (m == null) 135 if (m == null)
136 return null; 136 return null;
137 return new _MatchImplementation(this, m); 137 return new _MatchImplementation(this, m);
138 } 138 }
139 hasMatch(string) { 139 hasMatch(string) {
140 return this[_nativeRegExp].test(checkString(string)); 140 return dart.as(this[_nativeRegExp].test(dart.dcall(checkString, string)), core.bool);
141 } 141 }
142 stringMatch(string) { 142 stringMatch(string) {
143 let match = this.firstMatch(string); 143 let match = dart.dcall(this.firstMatch, string);
144 if (match != null) 144 if (match != null)
145 return match.group(0); 145 return dart.as(dart.dsend(match, 'group', 0), core.String);
146 return null; 146 return null;
147 } 147 }
148 allMatches(string, start) { 148 allMatches(string, start) {
149 if (start === void 0) 149 if (start === void 0)
150 start = 0; 150 start = 0;
151 checkString(string); 151 dart.dcall(checkString, string);
152 checkInt(start); 152 dart.dcall(checkInt, start);
153 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string[d artx.length])) { 153 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string[d artx.length])) {
154 dart.throw(new core.RangeError.range(start, 0, string[dartx.length])); 154 dart.throw(new core.RangeError.range(start, 0, string[dartx.length]));
155 } 155 }
156 return new _AllMatchesIterable(this, string, start); 156 return new _AllMatchesIterable(this, string, start);
157 } 157 }
158 [_execGlobal](string, start) { 158 [_execGlobal](string, start) {
159 let regexp = this[_nativeGlobalVersion]; 159 let regexp = this[_nativeGlobalVersion];
160 regexp.lastIndex = start; 160 regexp.lastIndex = start;
161 let match = dart.as(regexp.exec(string), core.List); 161 let match = dart.as(regexp.exec(string), core.List);
162 if (match == null) 162 if (match == null)
(...skipping 10 matching lines...) Expand all
173 return null; 173 return null;
174 match[dartx.length] = dart.notNull(match[dartx.length]) - 1; 174 match[dartx.length] = dart.notNull(match[dartx.length]) - 1;
175 return new _MatchImplementation(this, dart.as(match, core.List$(core.Strin g))); 175 return new _MatchImplementation(this, dart.as(match, core.List$(core.Strin g)));
176 } 176 }
177 matchAsPrefix(string, start) { 177 matchAsPrefix(string, start) {
178 if (start === void 0) 178 if (start === void 0)
179 start = 0; 179 start = 0;
180 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string[d artx.length])) { 180 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string[d artx.length])) {
181 dart.throw(new core.RangeError.range(start, 0, string[dartx.length])); 181 dart.throw(new core.RangeError.range(start, 0, string[dartx.length]));
182 } 182 }
183 return this[_execAnchored](string, start); 183 return dart.dcall(this[_execAnchored], string, start);
184 } 184 }
185 get isMultiLine() { 185 get isMultiLine() {
186 return this[_isMultiLine]; 186 return this[_isMultiLine];
187 } 187 }
188 get isCaseSensitive() { 188 get isCaseSensitive() {
189 return this[_isCaseSensitive]; 189 return this[_isCaseSensitive];
190 } 190 }
191 } 191 }
192 JSSyntaxRegExp[dart.implements] = () => [core.RegExp]; 192 JSSyntaxRegExp[dart.implements] = () => [core.RegExp];
193 dart.setSignature(JSSyntaxRegExp, { 193 dart.setSignature(JSSyntaxRegExp, {
(...skipping 13 matching lines...) Expand all
207 dart.defineExtensionMembers(JSSyntaxRegExp, ['allMatches', 'matchAsPrefix']); 207 dart.defineExtensionMembers(JSSyntaxRegExp, ['allMatches', 'matchAsPrefix']);
208 let _match = Symbol('_match'); 208 let _match = Symbol('_match');
209 class _MatchImplementation extends core.Object { 209 class _MatchImplementation extends core.Object {
210 _MatchImplementation(pattern, match) { 210 _MatchImplementation(pattern, match) {
211 this.pattern = pattern; 211 this.pattern = pattern;
212 this[_match] = match; 212 this[_match] = match;
213 dart.assert(typeof this[_match].input == 'string'); 213 dart.assert(typeof this[_match].input == 'string');
214 dart.assert(typeof this[_match].index == 'number'); 214 dart.assert(typeof this[_match].index == 'number');
215 } 215 }
216 get input() { 216 get input() {
217 return this[_match].input; 217 return dart.as(this[_match].input, core.String);
218 } 218 }
219 get start() { 219 get start() {
220 return this[_match].index; 220 return dart.as(this[_match].index, core.int);
221 } 221 }
222 get end() { 222 get end() {
223 return dart.notNull(this.start) + dart.notNull(this[_match][dartx.get](0)[ dartx.length]); 223 return dart.notNull(this.start) + dart.notNull(this[_match][dartx.get](0)[ dartx.length]);
224 } 224 }
225 group(index) { 225 group(index) {
226 return this[_match][dartx.get](index); 226 return this[_match][dartx.get](index);
227 } 227 }
228 get(index) { 228 get(index) {
229 return this.group(index); 229 return dart.dcall(this.group, index);
230 } 230 }
231 get groupCount() { 231 get groupCount() {
232 return dart.notNull(this[_match][dartx.length]) - 1; 232 return dart.notNull(this[_match][dartx.length]) - 1;
233 } 233 }
234 groups(groups) { 234 groups(groups) {
235 let out = dart.list([], core.String); 235 let out = dart.list([], core.String);
236 for (let i of groups) { 236 for (let i of groups) {
237 out[dartx.add](this.group(i)); 237 dart.dcall(out[dartx.add], dart.dcall(this.group, i));
238 } 238 }
239 return out; 239 return out;
240 } 240 }
241 } 241 }
242 _MatchImplementation[dart.implements] = () => [core.Match]; 242 _MatchImplementation[dart.implements] = () => [core.Match];
243 dart.setSignature(_MatchImplementation, { 243 dart.setSignature(_MatchImplementation, {
244 constructors: () => ({_MatchImplementation: [_MatchImplementation, [core.Pat tern, core.List$(core.String)]]}), 244 constructors: () => ({_MatchImplementation: [_MatchImplementation, [core.Pat tern, core.List$(core.String)]]}),
245 methods: () => ({ 245 methods: () => ({
246 group: [core.String, [core.int]], 246 group: [core.String, [core.int]],
247 get: [core.String, [core.int]], 247 get: [core.String, [core.int]],
(...skipping 28 matching lines...) Expand all
276 this[_nextIndex] = nextIndex; 276 this[_nextIndex] = nextIndex;
277 this[_current] = null; 277 this[_current] = null;
278 } 278 }
279 get current() { 279 get current() {
280 return this[_current]; 280 return this[_current];
281 } 281 }
282 moveNext() { 282 moveNext() {
283 if (this[_string] == null) 283 if (this[_string] == null)
284 return false; 284 return false;
285 if (dart.notNull(this[_nextIndex]) <= dart.notNull(this[_string][dartx.len gth])) { 285 if (dart.notNull(this[_nextIndex]) <= dart.notNull(this[_string][dartx.len gth])) {
286 let match = this[_regExp][_execGlobal](this[_string], this[_nextIndex]); 286 let match = dart.dcall(this[_regExp][_execGlobal], this[_string], this[_ nextIndex]);
287 if (match != null) { 287 if (match != null) {
288 this[_current] = match; 288 this[_current] = dart.as(match, core.Match);
289 let nextIndex = match.end; 289 let nextIndex = dart.as(dart.dload(match, 'end'), core.int);
290 if (match.start == nextIndex) { 290 if (dart.equals(dart.dload(match, 'start'), nextIndex)) {
291 nextIndex = dart.notNull(nextIndex) + 1; 291 nextIndex = dart.notNull(nextIndex) + 1;
292 } 292 }
293 this[_nextIndex] = nextIndex; 293 this[_nextIndex] = nextIndex;
294 return true; 294 return true;
295 } 295 }
296 } 296 }
297 this[_current] = null; 297 this[_current] = null;
298 this[_string] = null; 298 this[_string] = null;
299 return false; 299 return false;
300 } 300 }
301 } 301 }
302 _AllMatchesIterator[dart.implements] = () => [core.Iterator$(core.Match)]; 302 _AllMatchesIterator[dart.implements] = () => [core.Iterator$(core.Match)];
303 dart.setSignature(_AllMatchesIterator, { 303 dart.setSignature(_AllMatchesIterator, {
304 constructors: () => ({_AllMatchesIterator: [_AllMatchesIterator, [JSSyntaxRe gExp, core.String, core.int]]}), 304 constructors: () => ({_AllMatchesIterator: [_AllMatchesIterator, [JSSyntaxRe gExp, core.String, core.int]]}),
305 methods: () => ({moveNext: [core.bool, []]}) 305 methods: () => ({moveNext: [core.bool, []]})
306 }); 306 });
307 function firstMatchAfter(regExp, string, start) { 307 function firstMatchAfter(regExp, string, start) {
308 return regExp[_execGlobal](string, start); 308 return dart.dcall(regExp[_execGlobal], string, start);
309 } 309 }
310 dart.fn(firstMatchAfter, core.Match, [JSSyntaxRegExp, core.String, core.int]); 310 dart.fn(firstMatchAfter, core.Match, [JSSyntaxRegExp, core.String, core.int]);
311 class StringMatch extends core.Object { 311 class StringMatch extends core.Object {
312 StringMatch(start, input, pattern) { 312 StringMatch(start, input, pattern) {
313 this.start = start; 313 this.start = start;
314 this.input = input; 314 this.input = input;
315 this.pattern = pattern; 315 this.pattern = pattern;
316 } 316 }
317 get end() { 317 get end() {
318 return dart.notNull(this.start) + dart.notNull(this.pattern[dartx.length]) ; 318 return dart.notNull(this.start) + dart.notNull(this.pattern[dartx.length]) ;
319 } 319 }
320 get(g) { 320 get(g) {
321 return this.group(g); 321 return dart.dcall(this.group, g);
322 } 322 }
323 get groupCount() { 323 get groupCount() {
324 return 0; 324 return 0;
325 } 325 }
326 group(group_) { 326 group(group_) {
327 if (group_ != 0) { 327 if (group_ != 0) {
328 dart.throw(new core.RangeError.value(group_)); 328 dart.throw(new core.RangeError.value(group_));
329 } 329 }
330 return this.pattern; 330 return this.pattern;
331 } 331 }
332 groups(groups_) { 332 groups(groups_) {
333 let result = core.List$(core.String).new(); 333 let result = core.List$(core.String).new();
334 for (let g of groups_) { 334 for (let g of groups_) {
335 result[dartx.add](this.group(g)); 335 dart.dcall(result[dartx.add], dart.dcall(this.group, g));
336 } 336 }
337 return result; 337 return result;
338 } 338 }
339 } 339 }
340 StringMatch[dart.implements] = () => [core.Match]; 340 StringMatch[dart.implements] = () => [core.Match];
341 dart.setSignature(StringMatch, { 341 dart.setSignature(StringMatch, {
342 constructors: () => ({StringMatch: [StringMatch, [core.int, core.String, cor e.String]]}), 342 constructors: () => ({StringMatch: [StringMatch, [core.int, core.String, cor e.String]]}),
343 methods: () => ({ 343 methods: () => ({
344 get: [core.String, [core.int]], 344 get: [core.String, [core.int]],
345 group: [core.String, [core.int]], 345 group: [core.String, [core.int]],
346 groups: [core.List$(core.String), [core.List$(core.int)]] 346 groups: [core.List$(core.String), [core.List$(core.int)]]
347 }) 347 })
348 }); 348 });
349 function allMatchesInStringUnchecked(needle, haystack, startIndex) { 349 function allMatchesInStringUnchecked(needle, haystack, startIndex) {
350 let result = core.List$(core.Match).new(); 350 let result = core.List$(core.Match).new();
351 let length = haystack[dartx.length]; 351 let length = haystack[dartx.length];
352 let patternLength = needle[dartx.length]; 352 let patternLength = needle[dartx.length];
353 while (true) { 353 while (true) {
354 let position = haystack[dartx.indexOf](needle, startIndex); 354 let position = dart.dcall(haystack[dartx.indexOf], needle, startIndex);
355 if (position == -1) { 355 if (position == -1) {
356 break; 356 break;
357 } 357 }
358 result[dartx.add](new StringMatch(position, haystack, needle)); 358 dart.dcall(result[dartx.add], new StringMatch(position, haystack, needle)) ;
359 let endIndex = dart.notNull(position) + dart.notNull(patternLength); 359 let endIndex = dart.notNull(position) + dart.notNull(patternLength);
360 if (endIndex == length) { 360 if (endIndex == length) {
361 break; 361 break;
362 } else if (position == endIndex) { 362 } else if (position == endIndex) {
363 startIndex = dart.notNull(startIndex) + 1; 363 startIndex = dart.notNull(startIndex) + 1;
364 } else { 364 } else {
365 startIndex = endIndex; 365 startIndex = endIndex;
366 } 366 }
367 } 367 }
368 return result; 368 return result;
(...skipping 19 matching lines...) Expand all
388 let match = dart.dsend(regexp, _execGlobal, receiver, startIndex); 388 let match = dart.dsend(regexp, _execGlobal, receiver, startIndex);
389 if (match == null) 389 if (match == null)
390 return receiver; 390 return receiver;
391 let start = dart.dload(match, 'start'); 391 let start = dart.dload(match, 'start');
392 let end = dart.dload(match, 'end'); 392 let end = dart.dload(match, 'end');
393 return `${dart.dsend(receiver, 'substring', 0, start)}${to}${dart.dsend(rece iver, 'substring', end)}`; 393 return `${dart.dsend(receiver, 'substring', 0, start)}${to}${dart.dsend(rece iver, 'substring', end)}`;
394 } 394 }
395 dart.fn(stringReplaceFirstRE); 395 dart.fn(stringReplaceFirstRE);
396 let ESCAPE_REGEXP = '[[\\]{}()*+?.\\\\^$|]'; 396 let ESCAPE_REGEXP = '[[\\]{}()*+?.\\\\^$|]';
397 function stringReplaceAllUnchecked(receiver, from, to) { 397 function stringReplaceAllUnchecked(receiver, from, to) {
398 checkString(to); 398 dart.dcall(checkString, to);
399 if (typeof from == 'string') { 399 if (typeof from == 'string') {
400 if (dart.equals(from, "")) { 400 if (dart.equals(from, "")) {
401 if (dart.equals(receiver, "")) { 401 if (dart.equals(receiver, "")) {
402 return to; 402 return to;
403 } else { 403 } else {
404 let result = new core.StringBuffer(); 404 let result = new core.StringBuffer();
405 let length = dart.as(dart.dload(receiver, 'length'), core.int); 405 let length = dart.as(dart.dload(receiver, 'length'), core.int);
406 result.write(to); 406 dart.dcall(result.write, to);
407 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNu ll(i) + 1) { 407 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNu ll(i) + 1) {
408 result.write(dart.dindex(receiver, i)); 408 dart.dcall(result.write, dart.dindex(receiver, i));
409 result.write(to); 409 dart.dcall(result.write, to);
410 } 410 }
411 return dart.toString(result); 411 return dart.dcall(result.toString);
412 } 412 }
413 } else { 413 } else {
414 let quoter = new RegExp(ESCAPE_REGEXP, 'g'); 414 let quoter = new RegExp(ESCAPE_REGEXP, 'g');
415 let quoted = from.replace(quoter, "\\$&"); 415 let quoted = from.replace(quoter, "\\$&");
416 let replacer = new RegExp(quoted, 'g'); 416 let replacer = new RegExp(quoted, 'g');
417 return stringReplaceJS(receiver, replacer, to); 417 return dart.dcall(stringReplaceJS, receiver, replacer, to);
418 } 418 }
419 } else if (dart.is(from, JSSyntaxRegExp)) { 419 } else if (dart.is(from, JSSyntaxRegExp)) {
420 let re = regExpGetGlobalNative(dart.as(from, JSSyntaxRegExp)); 420 let re = dart.dcall(regExpGetGlobalNative, from);
421 return stringReplaceJS(receiver, re, to); 421 return dart.dcall(stringReplaceJS, receiver, re, to);
422 } else { 422 } else {
423 checkNull(from); 423 dart.dcall(checkNull, from);
424 dart.throw("String.replaceAll(Pattern) UNIMPLEMENTED"); 424 dart.throw("String.replaceAll(Pattern) UNIMPLEMENTED");
425 } 425 }
426 } 426 }
427 dart.fn(stringReplaceAllUnchecked); 427 dart.fn(stringReplaceAllUnchecked);
428 function _matchString(match) { 428 function _matchString(match) {
429 return match.get(0); 429 return match.get(0);
430 } 430 }
431 dart.fn(_matchString, core.String, [core.Match]); 431 dart.fn(_matchString, core.String, [core.Match]);
432 function _stringIdentity(string) { 432 function _stringIdentity(string) {
433 return string; 433 return string;
434 } 434 }
435 dart.fn(_stringIdentity, core.String, [core.String]); 435 dart.fn(_stringIdentity, core.String, [core.String]);
436 function stringReplaceAllFuncUnchecked(receiver, pattern, onMatch, onNonMatch) { 436 function stringReplaceAllFuncUnchecked(receiver, pattern, onMatch, onNonMatch) {
437 if (!dart.is(pattern, core.Pattern)) { 437 if (!dart.is(pattern, core.Pattern)) {
438 dart.throw(new core.ArgumentError(`${pattern} is not a Pattern`)); 438 dart.throw(new core.ArgumentError(`${pattern} is not a Pattern`));
439 } 439 }
440 if (onMatch == null) 440 if (onMatch == null)
441 onMatch = _matchString; 441 onMatch = _matchString;
442 if (onNonMatch == null) 442 if (onNonMatch == null)
443 onNonMatch = _stringIdentity; 443 onNonMatch = _stringIdentity;
444 if (typeof pattern == 'string') { 444 if (typeof pattern == 'string') {
445 return stringReplaceAllStringFuncUnchecked(receiver, pattern, onMatch, onN onMatch); 445 return dart.dcall(stringReplaceAllStringFuncUnchecked, receiver, pattern, onMatch, onNonMatch);
446 } 446 }
447 let buffer = new core.StringBuffer(); 447 let buffer = new core.StringBuffer();
448 let startIndex = 0; 448 let startIndex = 0;
449 for (let match of dart.as(dart.dsend(pattern, 'allMatches', receiver), core. Iterable$(core.Match))) { 449 for (let match of dart.as(dart.dsend(pattern, 'allMatches', receiver), core. Iterable$(core.Match))) {
450 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', star tIndex, match.start))); 450 dart.dcall(buffer.write, dart.dcall(onNonMatch, dart.dsend(receiver, 'subs tring', startIndex, match.start)));
451 buffer.write(dart.dcall(onMatch, match)); 451 dart.dcall(buffer.write, dart.dcall(onMatch, match));
452 startIndex = match.end; 452 startIndex = match.end;
453 } 453 }
454 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', startI ndex))); 454 dart.dcall(buffer.write, dart.dcall(onNonMatch, dart.dsend(receiver, 'substr ing', startIndex)));
455 return dart.toString(buffer); 455 return dart.dcall(buffer.toString);
456 } 456 }
457 dart.fn(stringReplaceAllFuncUnchecked); 457 dart.fn(stringReplaceAllFuncUnchecked);
458 function stringReplaceAllEmptyFuncUnchecked(receiver, onMatch, onNonMatch) { 458 function stringReplaceAllEmptyFuncUnchecked(receiver, onMatch, onNonMatch) {
459 let buffer = new core.StringBuffer(); 459 let buffer = new core.StringBuffer();
460 let length = dart.as(dart.dload(receiver, 'length'), core.int); 460 let length = dart.as(dart.dload(receiver, 'length'), core.int);
461 let i = 0; 461 let i = 0;
462 buffer.write(dart.dcall(onNonMatch, "")); 462 dart.dcall(buffer.write, dart.dcall(onNonMatch, ""));
463 while (dart.notNull(i) < dart.notNull(length)) { 463 while (dart.notNull(i) < dart.notNull(length)) {
464 buffer.write(dart.dcall(onMatch, new StringMatch(i, dart.as(receiver, core .String), ""))); 464 dart.dcall(buffer.write, dart.dcall(onMatch, new StringMatch(i, dart.as(re ceiver, core.String), "")));
465 let code = dart.as(dart.dsend(receiver, 'codeUnitAt', i), core.int); 465 let code = dart.as(dart.dsend(receiver, 'codeUnitAt', i), core.int);
466 if ((dart.notNull(code) & ~1023) == 55296 && dart.notNull(length) > dart.n otNull(i) + 1) { 466 if ((dart.notNull(code) & ~1023) == 55296 && dart.notNull(length) > dart.n otNull(i) + 1) {
467 code = dart.as(dart.dsend(receiver, 'codeUnitAt', dart.notNull(i) + 1), core.int); 467 code = dart.as(dart.dsend(receiver, 'codeUnitAt', dart.notNull(i) + 1), core.int);
468 if ((dart.notNull(code) & ~1023) == 56320) { 468 if ((dart.notNull(code) & ~1023) == 56320) {
469 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', i, dart.notNull(i) + 2))); 469 dart.dcall(buffer.write, dart.dcall(onNonMatch, dart.dsend(receiver, ' substring', i, dart.notNull(i) + 2)));
470 i = dart.notNull(i) + 2; 470 i = dart.notNull(i) + 2;
471 continue; 471 continue;
472 } 472 }
473 } 473 }
474 buffer.write(dart.dcall(onNonMatch, dart.dindex(receiver, i))); 474 dart.dcall(buffer.write, dart.dcall(onNonMatch, dart.dindex(receiver, i))) ;
475 i = dart.notNull(i) + 1; 475 i = dart.notNull(i) + 1;
476 } 476 }
477 buffer.write(dart.dcall(onMatch, new StringMatch(i, dart.as(receiver, core.S tring), ""))); 477 dart.dcall(buffer.write, dart.dcall(onMatch, new StringMatch(i, dart.as(rece iver, core.String), "")));
478 buffer.write(dart.dcall(onNonMatch, "")); 478 dart.dcall(buffer.write, dart.dcall(onNonMatch, ""));
479 return dart.toString(buffer); 479 return dart.dcall(buffer.toString);
480 } 480 }
481 dart.fn(stringReplaceAllEmptyFuncUnchecked); 481 dart.fn(stringReplaceAllEmptyFuncUnchecked);
482 function stringReplaceAllStringFuncUnchecked(receiver, pattern, onMatch, onNon Match) { 482 function stringReplaceAllStringFuncUnchecked(receiver, pattern, onMatch, onNon Match) {
483 let patternLength = dart.as(dart.dload(pattern, 'length'), core.int); 483 let patternLength = dart.as(dart.dload(pattern, 'length'), core.int);
484 if (patternLength == 0) { 484 if (patternLength == 0) {
485 return stringReplaceAllEmptyFuncUnchecked(receiver, onMatch, onNonMatch); 485 return dart.dcall(stringReplaceAllEmptyFuncUnchecked, receiver, onMatch, o nNonMatch);
486 } 486 }
487 let length = dart.as(dart.dload(receiver, 'length'), core.int); 487 let length = dart.as(dart.dload(receiver, 'length'), core.int);
488 let buffer = new core.StringBuffer(); 488 let buffer = new core.StringBuffer();
489 let startIndex = 0; 489 let startIndex = 0;
490 while (dart.notNull(startIndex) < dart.notNull(length)) { 490 while (dart.notNull(startIndex) < dart.notNull(length)) {
491 let position = dart.as(dart.dsend(receiver, 'indexOf', pattern, startIndex ), core.int); 491 let position = dart.as(dart.dsend(receiver, 'indexOf', pattern, startIndex ), core.int);
492 if (position == -1) { 492 if (position == -1) {
493 break; 493 break;
494 } 494 }
495 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', star tIndex, position))); 495 dart.dcall(buffer.write, dart.dcall(onNonMatch, dart.dsend(receiver, 'subs tring', startIndex, position)));
496 buffer.write(dart.dcall(onMatch, new StringMatch(position, dart.as(receive r, core.String), dart.as(pattern, core.String)))); 496 dart.dcall(buffer.write, dart.dcall(onMatch, new StringMatch(position, dar t.as(receiver, core.String), dart.as(pattern, core.String))));
497 startIndex = dart.notNull(position) + dart.notNull(patternLength); 497 startIndex = dart.notNull(position) + dart.notNull(patternLength);
498 } 498 }
499 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', startI ndex))); 499 dart.dcall(buffer.write, dart.dcall(onNonMatch, dart.dsend(receiver, 'substr ing', startIndex)));
500 return dart.toString(buffer); 500 return dart.dcall(buffer.toString);
501 } 501 }
502 dart.fn(stringReplaceAllStringFuncUnchecked); 502 dart.fn(stringReplaceAllStringFuncUnchecked);
503 function stringReplaceFirstUnchecked(receiver, from, to, startIndex) { 503 function stringReplaceFirstUnchecked(receiver, from, to, startIndex) {
504 if (startIndex === void 0) 504 if (startIndex === void 0)
505 startIndex = 0; 505 startIndex = 0;
506 if (typeof from == 'string') { 506 if (typeof from == 'string') {
507 let index = dart.dsend(receiver, 'indexOf', from, startIndex); 507 let index = dart.dsend(receiver, 'indexOf', from, startIndex);
508 if (dart.notNull(dart.as(dart.dsend(index, '<', 0), core.bool))) 508 if (dart.notNull(dart.as(dart.dsend(index, '<', 0), core.bool)))
509 return receiver; 509 return receiver;
510 return `${dart.dsend(receiver, 'substring', 0, index)}${to}` + `${dart.dse nd(receiver, 'substring', dart.dsend(index, '+', dart.dload(from, 'length')))}`; 510 return `${dart.dsend(receiver, 'substring', 0, index)}${to}` + `${dart.dse nd(receiver, 'substring', dart.dsend(index, '+', dart.dload(from, 'length')))}`;
511 } else if (dart.is(from, JSSyntaxRegExp)) { 511 } else if (dart.is(from, JSSyntaxRegExp)) {
512 return startIndex == 0 ? stringReplaceJS(receiver, regExpGetNative(dart.as (from, JSSyntaxRegExp)), to) : stringReplaceFirstRE(receiver, from, to, startInd ex); 512 return startIndex == 0 ? dart.dcall(stringReplaceJS, receiver, dart.dcall( regExpGetNative, from), to) : dart.dcall(stringReplaceFirstRE, receiver, from, t o, startIndex);
513 } else { 513 } else {
514 checkNull(from); 514 dart.dcall(checkNull, from);
515 dart.throw("String.replace(Pattern) UNIMPLEMENTED"); 515 dart.throw("String.replace(Pattern) UNIMPLEMENTED");
516 } 516 }
517 } 517 }
518 dart.fn(stringReplaceFirstUnchecked, dart.dynamic, [dart.dynamic, dart.dynamic , dart.dynamic], [core.int]); 518 dart.fn(stringReplaceFirstUnchecked, dart.dynamic, [dart.dynamic, dart.dynamic , dart.dynamic], [core.int]);
519 function stringJoinUnchecked(array, separator) { 519 function stringJoinUnchecked(array, separator) {
520 return array.join(separator); 520 return array.join(separator);
521 } 521 }
522 dart.fn(stringJoinUnchecked); 522 dart.fn(stringJoinUnchecked);
523 function getRuntimeType(object) { 523 function getRuntimeType(object) {
524 return dart.as(dart.realRuntimeType(object), core.Type); 524 return dart.as(dart.realRuntimeType(object), core.Type);
525 } 525 }
526 dart.fn(getRuntimeType, core.Type, [dart.dynamic]); 526 dart.fn(getRuntimeType, core.Type, [dart.dynamic]);
527 function getIndex(array, index) { 527 function getIndex(array, index) {
528 dart.assert(isJsArray(array)); 528 dart.assert(dart.dcall(isJsArray, array));
529 return array[index]; 529 return array[index];
530 } 530 }
531 dart.fn(getIndex, dart.dynamic, [dart.dynamic, core.int]); 531 dart.fn(getIndex, dart.dynamic, [dart.dynamic, core.int]);
532 function getLength(array) { 532 function getLength(array) {
533 dart.assert(isJsArray(array)); 533 dart.assert(dart.dcall(isJsArray, array));
534 return array.length; 534 return dart.as(array.length, core.int);
535 } 535 }
536 dart.fn(getLength, core.int, [dart.dynamic]); 536 dart.fn(getLength, core.int, [dart.dynamic]);
537 function isJsArray(value) { 537 function isJsArray(value) {
538 return dart.is(value, _interceptors.JSArray); 538 return dart.is(value, _interceptors.JSArray);
539 } 539 }
540 dart.fn(isJsArray, core.bool, [dart.dynamic]); 540 dart.fn(isJsArray, core.bool, [dart.dynamic]);
541 class _Patch extends core.Object { 541 class _Patch extends core.Object {
542 _Patch() { 542 _Patch() {
543 } 543 }
544 } 544 }
545 dart.setSignature(_Patch, { 545 dart.setSignature(_Patch, {
546 constructors: () => ({_Patch: [_Patch, []]}) 546 constructors: () => ({_Patch: [_Patch, []]})
547 }); 547 });
548 let patch = dart.const(new _Patch()); 548 let patch = dart.const(new _Patch());
549 class InternalMap extends core.Object {} 549 class InternalMap extends core.Object {}
550 class Primitives extends core.Object { 550 class Primitives extends core.Object {
551 static initializeStatics(id) { 551 static initializeStatics(id) {
552 Primitives.mirrorFunctionCacheName = dart.notNull(Primitives.mirrorFunctio nCacheName) + `_${id}`; 552 Primitives.mirrorFunctionCacheName = dart.notNull(Primitives.mirrorFunctio nCacheName) + `_${id}`;
553 Primitives.mirrorInvokeCacheName = dart.notNull(Primitives.mirrorInvokeCac heName) + `_${id}`; 553 Primitives.mirrorInvokeCacheName = dart.notNull(Primitives.mirrorInvokeCac heName) + `_${id}`;
554 } 554 }
555 static objectHashCode(object) { 555 static objectHashCode(object) {
556 let hash = dart.as(object.$identityHash, core.int); 556 let hash = dart.as(object.$identityHash, core.int);
557 if (hash == null) { 557 if (hash == null) {
558 hash = Math.random() * 0x3fffffff | 0; 558 hash = dart.as(Math.random() * 0x3fffffff | 0, core.int);
559 object.$identityHash = hash; 559 object.$identityHash = hash;
560 } 560 }
561 return hash; 561 return dart.as(hash, core.int);
562 } 562 }
563 static _throwFormatException(string) { 563 static _throwFormatException(string) {
564 dart.throw(new core.FormatException(string)); 564 dart.throw(new core.FormatException(string));
565 } 565 }
566 static parseInt(source, radix, handleError) { 566 static parseInt(source, radix, handleError) {
567 if (handleError == null) 567 if (handleError == null)
568 handleError = dart.fn(s => dart.as(Primitives._throwFormatException(dart .as(s, core.String)), core.int), core.int, [dart.dynamic]); 568 handleError = dart.fn(s => dart.as(dart.dcall(Primitives._throwFormatExc eption, s), core.int), core.int, [dart.dynamic]);
569 checkString(source); 569 dart.dcall(checkString, source);
570 let match = /^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(source) ; 570 let match = /^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(source) ;
571 let digitsIndex = 1; 571 let digitsIndex = 1;
572 let hexIndex = 2; 572 let hexIndex = 2;
573 let decimalIndex = 3; 573 let decimalIndex = 3;
574 let nonDecimalHexIndex = 4; 574 let nonDecimalHexIndex = 4;
575 if (radix == null) { 575 if (radix == null) {
576 radix = 10; 576 radix = 10;
577 if (match != null) { 577 if (match != null) {
578 if (dart.dindex(match, hexIndex) != null) { 578 if (dart.dindex(match, hexIndex) != null) {
579 return parseInt(source, 16); 579 return dart.as(parseInt(source, 16), core.int);
580 } 580 }
581 if (dart.dindex(match, decimalIndex) != null) { 581 if (dart.dindex(match, decimalIndex) != null) {
582 return parseInt(source, 10); 582 return dart.as(parseInt(source, 10), core.int);
583 } 583 }
584 return handleError(source); 584 return handleError(source);
585 } 585 }
586 } else { 586 } else {
587 if (!(typeof radix == 'number')) 587 if (!(typeof radix == 'number'))
588 dart.throw(new core.ArgumentError("Radix is not an integer")); 588 dart.throw(new core.ArgumentError("Radix is not an integer"));
589 if (dart.notNull(radix) < 2 || dart.notNull(radix) > 36) { 589 if (dart.notNull(radix) < 2 || dart.notNull(radix) > 36) {
590 dart.throw(new core.RangeError(`Radix ${radix} not in range 2..36`)); 590 dart.throw(new core.RangeError(`Radix ${radix} not in range 2..36`));
591 } 591 }
592 if (match != null) { 592 if (match != null) {
593 if (radix == 10 && dart.dindex(match, decimalIndex) != null) { 593 if (radix == 10 && dart.dindex(match, decimalIndex) != null) {
594 return parseInt(source, 10); 594 return dart.as(parseInt(source, 10), core.int);
595 } 595 }
596 if (dart.notNull(radix) < 10 || dart.dindex(match, decimalIndex) == nu ll) { 596 if (dart.notNull(radix) < 10 || dart.dindex(match, decimalIndex) == nu ll) {
597 let maxCharCode = null; 597 let maxCharCode = null;
598 if (dart.notNull(radix) <= 10) { 598 if (dart.notNull(radix) <= 10) {
599 maxCharCode = 48 + dart.notNull(radix) - 1; 599 maxCharCode = 48 + dart.notNull(radix) - 1;
600 } else { 600 } else {
601 maxCharCode = 97 + dart.notNull(radix) - 10 - 1; 601 maxCharCode = 97 + dart.notNull(radix) - 10 - 1;
602 } 602 }
603 let digitsPart = dart.as(dart.dindex(match, digitsIndex), core.Strin g); 603 let digitsPart = dart.as(dart.dindex(match, digitsIndex), core.Strin g);
604 for (let i = 0; dart.notNull(i) < dart.notNull(digitsPart[dartx.leng th]); i = dart.notNull(i) + 1) { 604 for (let i = 0; dart.notNull(i) < dart.notNull(digitsPart[dartx.leng th]); i = dart.notNull(i) + 1) {
605 let characterCode = dart.notNull(digitsPart[dartx.codeUnitAt](0)) | 32; 605 let characterCode = dart.notNull(dart.dcall(digitsPart[dartx.codeU nitAt], 0)) | 32;
606 if (dart.notNull(digitsPart[dartx.codeUnitAt](i)) > dart.notNull(m axCharCode)) { 606 if (dart.notNull(dart.dcall(digitsPart[dartx.codeUnitAt], i)) > da rt.notNull(maxCharCode)) {
607 return handleError(source); 607 return handleError(source);
608 } 608 }
609 } 609 }
610 } 610 }
611 } 611 }
612 } 612 }
613 if (match == null) 613 if (match == null)
614 return handleError(source); 614 return handleError(source);
615 return parseInt(source, radix); 615 return dart.as(parseInt(source, radix), core.int);
616 } 616 }
617 static parseDouble(source, handleError) { 617 static parseDouble(source, handleError) {
618 checkString(source); 618 dart.dcall(checkString, source);
619 if (handleError == null) 619 if (handleError == null)
620 handleError = dart.fn(s => dart.as(Primitives._throwFormatException(dart .as(s, core.String)), core.double), core.double, [dart.dynamic]); 620 handleError = dart.fn(s => dart.as(dart.dcall(Primitives._throwFormatExc eption, s), core.double), core.double, [dart.dynamic]);
621 if (!/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s *$/.test(source)) { 621 if (!dart.notNull(dart.as(/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)? )(?:[eE][+-]?\d+)?)\s*$/.test(source), core.bool))) {
622 return handleError(source); 622 return handleError(source);
623 } 623 }
624 let result = parseFloat(source); 624 let result = parseFloat(source);
625 if (dart.notNull(result[dartx.isNaN])) { 625 if (dart.notNull(dart.as(dart.dload(result, 'isNaN'), core.bool))) {
626 let trimmed = source[dartx.trim](); 626 let trimmed = dart.dcall(source[dartx.trim]);
627 if (trimmed == 'NaN' || trimmed == '+NaN' || trimmed == '-NaN') { 627 if (dart.equals(trimmed, 'NaN') || dart.equals(trimmed, '+NaN') || dart. equals(trimmed, '-NaN')) {
628 return result; 628 return dart.as(result, core.double);
629 } 629 }
630 return handleError(source); 630 return handleError(source);
631 } 631 }
632 return result; 632 return dart.as(result, core.double);
633 } 633 }
634 static objectTypeName(object) { 634 static objectTypeName(object) {
635 return dart.toString(getRuntimeType(object)); 635 return dart.dcall(dart.dcall(getRuntimeType, object).toString);
636 } 636 }
637 static objectToString(object) { 637 static objectToString(object) {
638 let name = dart.typeName(dart.realRuntimeType(object)); 638 let name = dart.as(dart.typeName(dart.realRuntimeType(object)), core.Strin g);
639 return `Instance of '${name}'`; 639 return `Instance of '${name}'`;
640 } 640 }
641 static dateNow() { 641 static dateNow() {
642 return Date.now(); 642 return dart.as(Date.now(), core.num);
643 } 643 }
644 static initTicker() { 644 static initTicker() {
645 if (Primitives.timerFrequency != null) 645 if (Primitives.timerFrequency != null)
646 return; 646 return;
647 Primitives.timerFrequency = 1000; 647 Primitives.timerFrequency = 1000;
648 Primitives.timerTicks = Primitives.dateNow; 648 Primitives.timerTicks = Primitives.dateNow;
649 if (typeof window == "undefined") 649 if (dart.notNull(dart.as(typeof window == "undefined", core.bool)))
650 return; 650 return;
651 let jsWindow = window; 651 let jsWindow = window;
652 if (jsWindow == null) 652 if (jsWindow == null)
653 return; 653 return;
654 let performance = jsWindow.performance; 654 let performance = jsWindow.performance;
655 if (performance == null) 655 if (performance == null)
656 return; 656 return;
657 if (typeof performance.now != "function") 657 if (dart.notNull(dart.as(typeof performance.now != "function", core.bool)) )
658 return; 658 return;
659 Primitives.timerFrequency = 1000000; 659 Primitives.timerFrequency = 1000000;
660 Primitives.timerTicks = dart.fn(() => (1000 * performance.now())[dartx.flo or](), core.int, []); 660 Primitives.timerTicks = dart.fn(() => dart.dcall((1000 * dart.notNull(dart .as(performance.now(), core.num)))[dartx.floor]), core.int, []);
661 } 661 }
662 static get isD8() { 662 static get isD8() {
663 return typeof version == "function" && typeof os == "object" && "system" i n os; 663 return dart.as(typeof version == "function" && typeof os == "object" && "s ystem" in os, core.bool);
664 } 664 }
665 static get isJsshell() { 665 static get isJsshell() {
666 return typeof version == "function" && typeof system == "function"; 666 return dart.as(typeof version == "function" && typeof system == "function" , core.bool);
667 } 667 }
668 static currentUri() { 668 static currentUri() {
669 if (!!self.location) { 669 if (dart.notNull(dart.as(!!self.location, core.bool))) {
670 return self.location.href; 670 return dart.as(self.location.href, core.String);
671 } 671 }
672 return null; 672 return null;
673 } 673 }
674 static _fromCharCodeApply(array) { 674 static _fromCharCodeApply(array) {
675 let result = ""; 675 let result = "";
676 let kMaxApply = 500; 676 let kMaxApply = 500;
677 let end = array[dartx.length]; 677 let end = array[dartx.length];
678 for (let i = 0; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + dart.notNull(kMaxApply)) { 678 for (let i = 0; dart.notNull(dart.as(dart.dsend(i, '<', end), core.bool)); i = dart.dsend(i, '+', kMaxApply)) {
679 let subarray = null; 679 let subarray = null;
680 if (dart.notNull(end) <= dart.notNull(kMaxApply)) { 680 if (dart.notNull(end) <= dart.notNull(dart.as(kMaxApply, core.num))) {
681 subarray = array; 681 subarray = array;
682 } else { 682 } else {
683 subarray = array.slice(i, dart.notNull(i) + dart.notNull(kMaxApply) < dart.notNull(end) ? dart.notNull(i) + dart.notNull(kMaxApply) : end); 683 subarray = array.slice(i, dart.notNull(dart.as(dart.dsend(dart.dsend(i , '+', kMaxApply), '<', end), core.bool)) ? dart.dsend(i, '+', kMaxApply) : end) ;
684 } 684 }
685 result = result + String.fromCharCode.apply(null, subarray); 685 result = dart.as(result + String.fromCharCode.apply(null, subarray), cor e.String);
686 } 686 }
687 return result; 687 return result;
688 } 688 }
689 static stringFromCodePoints(codePoints) { 689 static stringFromCodePoints(codePoints) {
690 let a = dart.list([], core.int); 690 let a = dart.list([], core.int);
691 for (let i of dart.as(codePoints, core.Iterable)) { 691 for (let i of dart.as(codePoints, core.Iterable)) {
692 if (!(typeof i == 'number')) 692 if (!(typeof i == 'number'))
693 dart.throw(new core.ArgumentError(i)); 693 dart.throw(new core.ArgumentError(i));
694 if (dart.notNull(dart.as(dart.dsend(i, '<=', 65535), core.bool))) { 694 if (dart.notNull(dart.as(dart.dsend(i, '<=', 65535), core.bool))) {
695 a[dartx.add](dart.as(i, core.int)); 695 dart.dcall(a[dartx.add], i);
696 } else if (dart.notNull(dart.as(dart.dsend(i, '<=', 1114111), core.bool) )) { 696 } else if (dart.notNull(dart.as(dart.dsend(i, '<=', 1114111), core.bool) )) {
697 a[dartx.add]((55296)[dartx['+']](dart.as(dart.dsend(dart.dsend(dart.ds end(i, '-', 65536), '>>', 10), '&', 1023), core.num))); 697 dart.dcall(a[dartx.add], (55296)[dartx['+']](dart.as(dart.dsend(dart.d send(dart.dsend(i, '-', 65536), '>>', 10), '&', 1023), core.num)));
698 a[dartx.add]((56320)[dartx['+']](dart.as(dart.dsend(i, '&', 1023), cor e.num))); 698 dart.dcall(a[dartx.add], (56320)[dartx['+']](dart.as(dart.dsend(i, '&' , 1023), core.num)));
699 } else { 699 } else {
700 dart.throw(new core.ArgumentError(i)); 700 dart.throw(new core.ArgumentError(i));
701 } 701 }
702 } 702 }
703 return Primitives._fromCharCodeApply(a); 703 return dart.dcall(Primitives._fromCharCodeApply, a);
704 } 704 }
705 static stringFromCharCodes(charCodes) { 705 static stringFromCharCodes(charCodes) {
706 for (let i of dart.as(charCodes, core.Iterable)) { 706 for (let i of dart.as(charCodes, core.Iterable)) {
707 if (!(typeof i == 'number')) 707 if (!(typeof i == 'number'))
708 dart.throw(new core.ArgumentError(i)); 708 dart.throw(new core.ArgumentError(i));
709 if (dart.notNull(dart.as(dart.dsend(i, '<', 0), core.bool))) 709 if (dart.notNull(dart.as(dart.dsend(i, '<', 0), core.bool)))
710 dart.throw(new core.ArgumentError(i)); 710 dart.throw(new core.ArgumentError(i));
711 if (dart.notNull(dart.as(dart.dsend(i, '>', 65535), core.bool))) 711 if (dart.notNull(dart.as(dart.dsend(i, '>', 65535), core.bool)))
712 return Primitives.stringFromCodePoints(charCodes); 712 return dart.dcall(Primitives.stringFromCodePoints, charCodes);
713 } 713 }
714 return Primitives._fromCharCodeApply(dart.as(charCodes, core.List$(core.in t))); 714 return dart.dcall(Primitives._fromCharCodeApply, charCodes);
715 } 715 }
716 static stringFromCharCode(charCode) { 716 static stringFromCharCode(charCode) {
717 if (0 <= dart.notNull(dart.as(charCode, core.num))) { 717 if (0 <= dart.notNull(dart.as(charCode, core.num))) {
718 if (dart.notNull(dart.as(dart.dsend(charCode, '<=', 65535), core.bool))) { 718 if (dart.notNull(dart.as(dart.dsend(charCode, '<=', 65535), core.bool))) {
719 return String.fromCharCode(charCode); 719 return dart.as(String.fromCharCode(charCode), core.String);
720 } 720 }
721 if (dart.notNull(dart.as(dart.dsend(charCode, '<=', 1114111), core.bool) )) { 721 if (dart.notNull(dart.as(dart.dsend(charCode, '<=', 1114111), core.bool) )) {
722 let bits = dart.dsend(charCode, '-', 65536); 722 let bits = dart.dsend(charCode, '-', 65536);
723 let low = (56320)[dartx['|']](dart.as(dart.dsend(bits, '&', 1023), cor e.int)); 723 let low = (56320)[dartx['|']](dart.as(dart.dsend(bits, '&', 1023), cor e.int));
724 let high = (55296)[dartx['|']](dart.as(dart.dsend(bits, '>>', 10), cor e.int)); 724 let high = (55296)[dartx['|']](dart.as(dart.dsend(bits, '>>', 10), cor e.int));
725 return String.fromCharCode(high, low); 725 return dart.as(String.fromCharCode(high, low), core.String);
726 } 726 }
727 } 727 }
728 dart.throw(new core.RangeError.range(dart.as(charCode, core.num), 0, 11141 11)); 728 dart.throw(new core.RangeError.range(dart.as(charCode, core.num), 0, 11141 11));
729 } 729 }
730 static stringConcatUnchecked(string1, string2) { 730 static stringConcatUnchecked(string1, string2) {
731 return _foreign_helper.JS_STRING_CONCAT(string1, string2); 731 return dart.dcall(_foreign_helper.JS_STRING_CONCAT, string1, string2);
732 } 732 }
733 static flattenString(str) { 733 static flattenString(str) {
734 return str.charCodeAt(0) == 0 ? str : str; 734 return dart.as(str.charCodeAt(0) == 0 ? str : str, core.String);
735 } 735 }
736 static getTimeZoneName(receiver) { 736 static getTimeZoneName(receiver) {
737 let d = Primitives.lazyAsJsDate(receiver); 737 let d = dart.dcall(Primitives.lazyAsJsDate, receiver);
738 let match = dart.as(/\((.*)\)/.exec(d.toString()), core.List); 738 let match = dart.as(/\((.*)\)/.exec(d.toString()), core.List);
739 if (match != null) 739 if (match != null)
740 return dart.as(match[dartx.get](1), core.String); 740 return dart.as(match[dartx.get](1), core.String);
741 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); 741 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);
742 if (match != null) 742 if (match != null)
743 return dart.as(match[dartx.get](1), core.String); 743 return dart.as(match[dartx.get](1), core.String);
744 match = dart.as(/(?:GMT|UTC)[+-]\d{4}/.exec(d.toString()), core.List); 744 match = dart.as(/(?:GMT|UTC)[+-]\d{4}/.exec(d.toString()), core.List);
745 if (match != null) 745 if (match != null)
746 return dart.as(match[dartx.get](0), core.String); 746 return dart.as(match[dartx.get](0), core.String);
747 return ""; 747 return "";
748 } 748 }
749 static getTimeZoneOffsetInMinutes(receiver) { 749 static getTimeZoneOffsetInMinutes(receiver) {
750 return -Primitives.lazyAsJsDate(receiver).getTimezoneOffset(); 750 return dart.as(dart.dsend(dart.dcall(Primitives.lazyAsJsDate, receiver).ge tTimezoneOffset(), 'unary-'), core.int);
751 } 751 }
752 static valueFromDecomposedDate(years, month, day, hours, minutes, seconds, m illiseconds, isUtc) { 752 static valueFromDecomposedDate(years, month, day, hours, minutes, seconds, m illiseconds, isUtc) {
753 let MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000; 753 let MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000;
754 checkInt(years); 754 dart.dcall(checkInt, years);
755 checkInt(month); 755 dart.dcall(checkInt, month);
756 checkInt(day); 756 dart.dcall(checkInt, day);
757 checkInt(hours); 757 dart.dcall(checkInt, hours);
758 checkInt(minutes); 758 dart.dcall(checkInt, minutes);
759 checkInt(seconds); 759 dart.dcall(checkInt, seconds);
760 checkInt(milliseconds); 760 dart.dcall(checkInt, milliseconds);
761 checkBool(isUtc); 761 dart.dcall(checkBool, isUtc);
762 let jsMonth = dart.dsend(month, '-', 1); 762 let jsMonth = dart.dsend(month, '-', 1);
763 let value = null; 763 let value = null;
764 if (dart.notNull(dart.as(isUtc, core.bool))) { 764 if (dart.notNull(dart.as(isUtc, core.bool))) {
765 value = Date.UTC(years, jsMonth, day, hours, minutes, seconds, milliseco nds); 765 value = Date.UTC(years, jsMonth, day, hours, minutes, seconds, milliseco nds);
766 } else { 766 } else {
767 value = new Date(years, jsMonth, day, hours, minutes, seconds, milliseco nds).valueOf(); 767 value = new Date(years, jsMonth, day, hours, minutes, seconds, milliseco nds).valueOf();
768 } 768 }
769 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))) { 769 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))) {
770 return null; 770 return null;
771 } 771 }
772 if (dart.notNull(dart.as(dart.dsend(years, '<=', 0), core.bool)) || dart.n otNull(dart.as(dart.dsend(years, '<', 100), core.bool))) 772 if (dart.notNull(dart.as(dart.dsend(years, '<=', 0), core.bool)) || dart.n otNull(dart.as(dart.dsend(years, '<', 100), core.bool)))
773 return Primitives.patchUpY2K(value, years, isUtc); 773 return dart.dcall(Primitives.patchUpY2K, value, years, isUtc);
774 return value; 774 return value;
775 } 775 }
776 static patchUpY2K(value, years, isUtc) { 776 static patchUpY2K(value, years, isUtc) {
777 let date = new Date(value); 777 let date = new Date(value);
778 if (dart.notNull(dart.as(isUtc, core.bool))) { 778 if (dart.notNull(dart.as(isUtc, core.bool))) {
779 date.setUTCFullYear(years); 779 date.setUTCFullYear(years);
780 } else { 780 } else {
781 date.setFullYear(years); 781 date.setFullYear(years);
782 } 782 }
783 return date.valueOf(); 783 return date.valueOf();
784 } 784 }
785 static lazyAsJsDate(receiver) { 785 static lazyAsJsDate(receiver) {
786 if (receiver.date === void 0) { 786 if (dart.notNull(dart.as(receiver.date === void 0, core.bool))) {
787 receiver.date = new Date(dart.dload(receiver, 'millisecondsSinceEpoch')) ; 787 receiver.date = new Date(dart.dload(receiver, 'millisecondsSinceEpoch')) ;
788 } 788 }
789 return receiver.date; 789 return receiver.date;
790 } 790 }
791 static getYear(receiver) { 791 static getYear(receiver) {
792 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? P rimitives.lazyAsJsDate(receiver).getUTCFullYear() + 0 : Primitives.lazyAsJsDate( receiver).getFullYear() + 0; 792 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? d art.dcall(Primitives.lazyAsJsDate, receiver).getUTCFullYear() + 0 : dart.dcall(P rimitives.lazyAsJsDate, receiver).getFullYear() + 0;
793 } 793 }
794 static getMonth(receiver) { 794 static getMonth(receiver) {
795 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? P rimitives.lazyAsJsDate(receiver).getUTCMonth() + 1 : Primitives.lazyAsJsDate(rec eiver).getMonth() + 1; 795 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? d art.dcall(Primitives.lazyAsJsDate, receiver).getUTCMonth() + 1 : dart.dcall(Prim itives.lazyAsJsDate, receiver).getMonth() + 1;
796 } 796 }
797 static getDay(receiver) { 797 static getDay(receiver) {
798 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? P rimitives.lazyAsJsDate(receiver).getUTCDate() + 0 : Primitives.lazyAsJsDate(rece iver).getDate() + 0; 798 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? d art.dcall(Primitives.lazyAsJsDate, receiver).getUTCDate() + 0 : dart.dcall(Primi tives.lazyAsJsDate, receiver).getDate() + 0;
799 } 799 }
800 static getHours(receiver) { 800 static getHours(receiver) {
801 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? P rimitives.lazyAsJsDate(receiver).getUTCHours() + 0 : Primitives.lazyAsJsDate(rec eiver).getHours() + 0; 801 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? d art.dcall(Primitives.lazyAsJsDate, receiver).getUTCHours() + 0 : dart.dcall(Prim itives.lazyAsJsDate, receiver).getHours() + 0;
802 } 802 }
803 static getMinutes(receiver) { 803 static getMinutes(receiver) {
804 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? P rimitives.lazyAsJsDate(receiver).getUTCMinutes() + 0 : Primitives.lazyAsJsDate(r eceiver).getMinutes() + 0; 804 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? d art.dcall(Primitives.lazyAsJsDate, receiver).getUTCMinutes() + 0 : dart.dcall(Pr imitives.lazyAsJsDate, receiver).getMinutes() + 0;
805 } 805 }
806 static getSeconds(receiver) { 806 static getSeconds(receiver) {
807 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? P rimitives.lazyAsJsDate(receiver).getUTCSeconds() + 0 : Primitives.lazyAsJsDate(r eceiver).getSeconds() + 0; 807 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? d art.dcall(Primitives.lazyAsJsDate, receiver).getUTCSeconds() + 0 : dart.dcall(Pr imitives.lazyAsJsDate, receiver).getSeconds() + 0;
808 } 808 }
809 static getMilliseconds(receiver) { 809 static getMilliseconds(receiver) {
810 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? P rimitives.lazyAsJsDate(receiver).getUTCMilliseconds() + 0 : Primitives.lazyAsJsD ate(receiver).getMilliseconds() + 0; 810 return dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.bool)) ? d art.dcall(Primitives.lazyAsJsDate, receiver).getUTCMilliseconds() + 0 : dart.dca ll(Primitives.lazyAsJsDate, receiver).getMilliseconds() + 0;
811 } 811 }
812 static getWeekday(receiver) { 812 static getWeekday(receiver) {
813 let weekday = dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.boo l)) ? Primitives.lazyAsJsDate(receiver).getUTCDay() + 0 : Primitives.lazyAsJsDat e(receiver).getDay() + 0; 813 let weekday = dart.notNull(dart.as(dart.dload(receiver, 'isUtc'), core.boo l)) ? dart.as(dart.dcall(Primitives.lazyAsJsDate, receiver).getUTCDay() + 0, cor e.int) : dart.as(dart.dcall(Primitives.lazyAsJsDate, receiver).getDay() + 0, cor e.int);
814 return (dart.notNull(weekday) + 6) % 7 + 1; 814 return (dart.notNull(weekday) + 6) % 7 + 1;
815 } 815 }
816 static valueFromDateString(str) { 816 static valueFromDateString(str) {
817 if (!(typeof str == 'string')) 817 if (!(typeof str == 'string'))
818 dart.throw(new core.ArgumentError(str)); 818 dart.throw(new core.ArgumentError(str));
819 let value = Date.parse(str); 819 let value = Date.parse(str);
820 if (dart.notNull(value[dartx.isNaN])) 820 if (dart.notNull(dart.as(dart.dload(value, 'isNaN'), core.bool)))
821 dart.throw(new core.ArgumentError(str)); 821 dart.throw(new core.ArgumentError(str));
822 return value; 822 return value;
823 } 823 }
824 static getProperty(object, key) { 824 static getProperty(object, key) {
825 if (object == null || typeof object == 'boolean' || dart.is(object, core.n um) || typeof object == 'string') { 825 if (object == null || typeof object == 'boolean' || dart.is(object, core.n um) || typeof object == 'string') {
826 dart.throw(new core.ArgumentError(object)); 826 dart.throw(new core.ArgumentError(object));
827 } 827 }
828 return object[key]; 828 return object[key];
829 } 829 }
830 static setProperty(object, key, value) { 830 static setProperty(object, key, value) {
831 if (object == null || typeof object == 'boolean' || dart.is(object, core.n um) || typeof object == 'string') { 831 if (object == null || typeof object == 'boolean' || dart.is(object, core.n um) || typeof object == 'string') {
832 dart.throw(new core.ArgumentError(object)); 832 dart.throw(new core.ArgumentError(object));
833 } 833 }
834 object[key] = value; 834 object[key] = value;
835 } 835 }
836 static identicalImplementation(a, b) { 836 static identicalImplementation(a, b) {
837 return a == null ? b == null : a === b; 837 return dart.notNull(dart.as(a == null, core.bool)) ? dart.as(b == null, co re.bool) : dart.as(a === b, core.bool);
838 } 838 }
839 static extractStackTrace(error) { 839 static extractStackTrace(error) {
840 return getTraceFromException(error.$thrownJsError); 840 return dart.dcall(getTraceFromException, error.$thrownJsError);
841 } 841 }
842 } 842 }
843 dart.setSignature(Primitives, { 843 dart.setSignature(Primitives, {
844 statics: () => ({ 844 statics: () => ({
845 initializeStatics: [dart.void, [core.int]], 845 initializeStatics: [dart.void, [core.int]],
846 objectHashCode: [core.int, [dart.dynamic]], 846 objectHashCode: [core.int, [dart.dynamic]],
847 _throwFormatException: [dart.dynamic, [core.String]], 847 _throwFormatException: [dart.dynamic, [core.String]],
848 parseInt: [core.int, [core.String, core.int, dart.functionType(core.int, [ core.String])]], 848 parseInt: [core.int, [core.String, core.int, dart.functionType(core.int, [ core.String])]],
849 parseDouble: [core.double, [core.String, dart.functionType(core.double, [c ore.String])]], 849 parseDouble: [core.double, [core.String, dart.functionType(core.double, [c ore.String])]],
850 objectTypeName: [core.String, [core.Object]], 850 objectTypeName: [core.String, [core.Object]],
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 let _trace = Symbol('_trace'); 989 let _trace = Symbol('_trace');
990 class _StackTrace extends core.Object { 990 class _StackTrace extends core.Object {
991 _StackTrace(exception) { 991 _StackTrace(exception) {
992 this[_exception] = exception; 992 this[_exception] = exception;
993 this[_trace] = null; 993 this[_trace] = null;
994 } 994 }
995 toString() { 995 toString() {
996 if (this[_trace] != null) 996 if (this[_trace] != null)
997 return this[_trace]; 997 return this[_trace];
998 let trace = null; 998 let trace = null;
999 if (typeof this[_exception] === "object") { 999 if (dart.notNull(dart.as(typeof this[_exception] === "object", core.bool)) ) {
1000 trace = dart.as(this[_exception].stack, core.String); 1000 trace = dart.as(this[_exception].stack, core.String);
1001 } 1001 }
1002 return this[_trace] = trace == null ? '' : trace; 1002 return this[_trace] = trace == null ? '' : trace;
1003 } 1003 }
1004 } 1004 }
1005 _StackTrace[dart.implements] = () => [core.StackTrace]; 1005 _StackTrace[dart.implements] = () => [core.StackTrace];
1006 dart.setSignature(_StackTrace, { 1006 dart.setSignature(_StackTrace, {
1007 constructors: () => ({_StackTrace: [_StackTrace, [dart.dynamic]]}) 1007 constructors: () => ({_StackTrace: [_StackTrace, [dart.dynamic]]})
1008 }); 1008 });
1009 function objectHashCode(object) { 1009 function objectHashCode(object) {
1010 if (object == null || typeof object != 'object') { 1010 if (object == null || dart.notNull(dart.as(typeof object != 'object', core.b ool))) {
1011 return dart.hashCode(object); 1011 return dart.as(dart.dload(object, 'hashCode'), core.int);
1012 } else { 1012 } else {
1013 return Primitives.objectHashCode(object); 1013 return dart.dcall(Primitives.objectHashCode, object);
1014 } 1014 }
1015 } 1015 }
1016 dart.fn(objectHashCode, core.int, [dart.dynamic]); 1016 dart.fn(objectHashCode, core.int, [dart.dynamic]);
1017 function fillLiteralMap(keyValuePairs, result) { 1017 function fillLiteralMap(keyValuePairs, result) {
1018 let index = 0; 1018 let index = 0;
1019 let length = getLength(keyValuePairs); 1019 let length = dart.dcall(getLength, keyValuePairs);
1020 while (dart.notNull(index) < dart.notNull(length)) { 1020 while (dart.notNull(index) < dart.notNull(length)) {
1021 let key = getIndex(keyValuePairs, (() => { 1021 let key = dart.dcall(getIndex, keyValuePairs, (() => {
1022 let x = index; 1022 let x = index;
1023 index = dart.notNull(x) + 1; 1023 index = dart.notNull(x) + 1;
1024 return x; 1024 return x;
1025 })()); 1025 })());
1026 let value = getIndex(keyValuePairs, (() => { 1026 let value = dart.dcall(getIndex, keyValuePairs, (() => {
1027 let x = index; 1027 let x = index;
1028 index = dart.notNull(x) + 1; 1028 index = dart.notNull(x) + 1;
1029 return x; 1029 return x;
1030 })()); 1030 })());
1031 result.set(key, value); 1031 result.set(key, value);
1032 } 1032 }
1033 return result; 1033 return result;
1034 } 1034 }
1035 dart.fn(fillLiteralMap, dart.dynamic, [dart.dynamic, core.Map]); 1035 dart.fn(fillLiteralMap, dart.dynamic, [dart.dynamic, core.Map]);
1036 function jsHasOwnProperty(jsObject, property) { 1036 function jsHasOwnProperty(jsObject, property) {
1037 return jsObject.hasOwnProperty(property); 1037 return dart.as(jsObject.hasOwnProperty(property), core.bool);
1038 } 1038 }
1039 dart.fn(jsHasOwnProperty, core.bool, [dart.dynamic, core.String]); 1039 dart.fn(jsHasOwnProperty, core.bool, [dart.dynamic, core.String]);
1040 function jsPropertyAccess(jsObject, property) { 1040 function jsPropertyAccess(jsObject, property) {
1041 return jsObject[property]; 1041 return jsObject[property];
1042 } 1042 }
1043 dart.fn(jsPropertyAccess, dart.dynamic, [dart.dynamic, core.String]); 1043 dart.fn(jsPropertyAccess, dart.dynamic, [dart.dynamic, core.String]);
1044 function getFallThroughError() { 1044 function getFallThroughError() {
1045 return new FallThroughErrorImplementation(); 1045 return new FallThroughErrorImplementation();
1046 } 1046 }
1047 dart.fn(getFallThroughError); 1047 dart.fn(getFallThroughError);
(...skipping 17 matching lines...) Expand all
1065 JSName(name) { 1065 JSName(name) {
1066 this.name = name; 1066 this.name = name;
1067 } 1067 }
1068 } 1068 }
1069 dart.setSignature(JSName, { 1069 dart.setSignature(JSName, {
1070 constructors: () => ({JSName: [JSName, [core.String]]}) 1070 constructors: () => ({JSName: [JSName, [core.String]]})
1071 }); 1071 });
1072 class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable {} 1072 class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable {}
1073 class TypeErrorImplementation extends core.Error { 1073 class TypeErrorImplementation extends core.Error {
1074 TypeErrorImplementation(value, type) { 1074 TypeErrorImplementation(value, type) {
1075 this.message = `type '${Primitives.objectTypeName(value)}' is not a subtyp e ` + `of type '${type}'`; 1075 this.message = `type '${dart.dcall(Primitives.objectTypeName, value)}' is not a subtype ` + `of type '${type}'`;
1076 super.Error(); 1076 super.Error();
1077 } 1077 }
1078 fromMessage(message) { 1078 fromMessage(message) {
1079 this.message = message; 1079 this.message = message;
1080 super.Error(); 1080 super.Error();
1081 } 1081 }
1082 toString() { 1082 toString() {
1083 return this.message; 1083 return this.message;
1084 } 1084 }
1085 } 1085 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 super.Error(); 1121 super.Error();
1122 } 1122 }
1123 toString() { 1123 toString() {
1124 return `RuntimeError: ${this.message}`; 1124 return `RuntimeError: ${this.message}`;
1125 } 1125 }
1126 } 1126 }
1127 dart.setSignature(RuntimeError, { 1127 dart.setSignature(RuntimeError, {
1128 constructors: () => ({RuntimeError: [RuntimeError, [dart.dynamic]]}) 1128 constructors: () => ({RuntimeError: [RuntimeError, [dart.dynamic]]})
1129 }); 1129 });
1130 function random64() { 1130 function random64() {
1131 let int32a = Math.random() * 0x100000000 >>> 0; 1131 let int32a = dart.as(Math.random() * 0x100000000 >>> 0, core.int);
1132 let int32b = Math.random() * 0x100000000 >>> 0; 1132 let int32b = dart.as(Math.random() * 0x100000000 >>> 0, core.int);
1133 return dart.notNull(int32a) + dart.notNull(int32b) * 4294967296; 1133 return dart.notNull(int32a) + dart.notNull(int32b) * 4294967296;
1134 } 1134 }
1135 dart.fn(random64, core.int, []); 1135 dart.fn(random64, core.int, []);
1136 function jsonEncodeNative(string) { 1136 function jsonEncodeNative(string) {
1137 return JSON.stringify(string); 1137 return dart.as(JSON.stringify(string), core.String);
1138 } 1138 }
1139 dart.fn(jsonEncodeNative, core.String, [core.String]); 1139 dart.fn(jsonEncodeNative, core.String, [core.String]);
1140 let _jsIterator = Symbol('_jsIterator'); 1140 let _jsIterator = Symbol('_jsIterator');
1141 let SyncIterator$ = dart.generic(function(E) { 1141 let SyncIterator$ = dart.generic(function(E) {
1142 class SyncIterator extends core.Object { 1142 class SyncIterator extends core.Object {
1143 SyncIterator(jsIterator) { 1143 SyncIterator(jsIterator) {
1144 this[_jsIterator] = jsIterator; 1144 this[_jsIterator] = jsIterator;
1145 this[_current] = null; 1145 this[_current] = null;
1146 } 1146 }
1147 get current() { 1147 get current() {
1148 return this[_current]; 1148 return this[_current];
1149 } 1149 }
1150 moveNext() { 1150 moveNext() {
1151 let ret = this[_jsIterator].next(); 1151 let ret = this[_jsIterator].next();
1152 this[_current] = dart.as(ret.value, E); 1152 this[_current] = dart.as(ret.value, E);
1153 return !ret.done; 1153 return dart.as(!ret.done, core.bool);
1154 } 1154 }
1155 } 1155 }
1156 SyncIterator[dart.implements] = () => [core.Iterator$(E)]; 1156 SyncIterator[dart.implements] = () => [core.Iterator$(E)];
1157 dart.setSignature(SyncIterator, { 1157 dart.setSignature(SyncIterator, {
1158 constructors: () => ({SyncIterator: [SyncIterator$(E), [dart.dynamic]]}), 1158 constructors: () => ({SyncIterator: [SyncIterator$(E), [dart.dynamic]]}),
1159 methods: () => ({moveNext: [core.bool, []]}) 1159 methods: () => ({moveNext: [core.bool, []]})
1160 }); 1160 });
1161 return SyncIterator; 1161 return SyncIterator;
1162 }); 1162 });
1163 let SyncIterator = SyncIterator$(); 1163 let SyncIterator = SyncIterator$();
1164 let _generator = Symbol('_generator'); 1164 let _generator = Symbol('_generator');
1165 let _args = Symbol('_args'); 1165 let _args = Symbol('_args');
1166 let SyncIterable$ = dart.generic(function(E) { 1166 let SyncIterable$ = dart.generic(function(E) {
1167 class SyncIterable extends collection.IterableBase$(E) { 1167 class SyncIterable extends collection.IterableBase$(E) {
1168 SyncIterable(generator, args) { 1168 SyncIterable(generator, args) {
1169 this[_generator] = generator; 1169 this[_generator] = generator;
1170 this[_args] = args; 1170 this[_args] = args;
1171 super.IterableBase(); 1171 super.IterableBase();
1172 } 1172 }
1173 [_jsIterator]() { 1173 [_jsIterator]() {
1174 return this[_generator](...this[_args]); 1174 return this[_generator](...this[_args]);
1175 } 1175 }
1176 get iterator() { 1176 get iterator() {
1177 return new (SyncIterator$(E))(this[_jsIterator]()); 1177 return new (SyncIterator$(E))(dart.dcall(this[_jsIterator]));
1178 } 1178 }
1179 } 1179 }
1180 dart.setSignature(SyncIterable, { 1180 dart.setSignature(SyncIterable, {
1181 constructors: () => ({SyncIterable: [SyncIterable$(E), [dart.dynamic, dart .dynamic]]}), 1181 constructors: () => ({SyncIterable: [SyncIterable$(E), [dart.dynamic, dart .dynamic]]}),
1182 methods: () => ({[_jsIterator]: [dart.dynamic, []]}) 1182 methods: () => ({[_jsIterator]: [dart.dynamic, []]})
1183 }); 1183 });
1184 dart.defineExtensionMembers(SyncIterable, ['iterator']); 1184 dart.defineExtensionMembers(SyncIterable, ['iterator']);
1185 return SyncIterable; 1185 return SyncIterable;
1186 }); 1186 });
1187 let SyncIterable = SyncIterable$(); 1187 let SyncIterable = SyncIterable$();
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 exports.CastErrorImplementation = CastErrorImplementation; 1242 exports.CastErrorImplementation = CastErrorImplementation;
1243 exports.FallThroughErrorImplementation = FallThroughErrorImplementation; 1243 exports.FallThroughErrorImplementation = FallThroughErrorImplementation;
1244 exports.RuntimeError = RuntimeError; 1244 exports.RuntimeError = RuntimeError;
1245 exports.random64 = random64; 1245 exports.random64 = random64;
1246 exports.jsonEncodeNative = jsonEncodeNative; 1246 exports.jsonEncodeNative = jsonEncodeNative;
1247 exports.SyncIterator$ = SyncIterator$; 1247 exports.SyncIterator$ = SyncIterator$;
1248 exports.SyncIterator = SyncIterator; 1248 exports.SyncIterator = SyncIterator;
1249 exports.SyncIterable$ = SyncIterable$; 1249 exports.SyncIterable$ = SyncIterable$;
1250 exports.SyncIterable = SyncIterable; 1250 exports.SyncIterable = SyncIterable;
1251 }); 1251 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698