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

Side by Side Diff: frog/frogsh

Issue 8746005: Fix a bunch of issues with 'hidden' DOM types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: removed dead code Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env node 1 #!/usr/bin/env node
2 // ********** Library dart:core ************** 2 // ********** Library dart:core **************
3 // ********** Natives dart:core ************** 3 // ********** Natives dart:core **************
4 Object.prototype.$typeNameOf = function() {
5 if ((typeof(window) != 'undefined' && window.constructor.name == 'DOMWindow')
6 || typeof(process) != 'undefined') { // fast-path for Chrome and Node
7 return this.constructor.name;
8 }
9 var str = Object.prototype.toString.call(this);
10 str = str.substring(8, str.length - 1);
11 if (str == 'Window') str = 'DOMWindow';
12 return str;
13 }
4 /** 14 /**
5 * Generates a dynamic call stub for a function. 15 * Generates a dynamic call stub for a function.
6 * Our goal is to create a stub method like this on-the-fly: 16 * Our goal is to create a stub method like this on-the-fly:
7 * function($0, $1, capture) { this($0, $1, true, capture); } 17 * function($0, $1, capture) { return this($0, $1, true, capture); }
8 * 18 *
9 * This stub then replaces the dynamic one on Function, with one that is 19 * This stub then replaces the dynamic one on Function, with one that is
10 * specialized for that particular function, taking into account its default 20 * specialized for that particular function, taking into account its default
11 * arguments. 21 * arguments.
12 */ 22 */
13 Function.prototype.$genStub = function(argsLength, names) { 23 Function.prototype.$genStub = function(argsLength, names) {
14 // TODO(jmesserly): only emit $genStub if actually needed
15
16 // Fast path: if no named arguments and arg count matches 24 // Fast path: if no named arguments and arg count matches
17 if (this.length == argsLength && !names) { 25 if (this.length == argsLength && !names) {
18 return this; 26 return this;
19 } 27 }
20 28
21 function $throwArgMismatch() { 29 function $throwArgMismatch() {
22 // TODO(jmesserly): better error message 30 // TODO(jmesserly): better error message
23 $throw(new ClosureArgumentMismatchException()); 31 $throw(new ClosureArgumentMismatchException());
24 } 32 }
25 33
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // Fast path #2: named arguments, but they're in order. 72 // Fast path #2: named arguments, but they're in order.
65 return this; 73 return this;
66 } 74 }
67 75
68 // Note: using Function instead of 'eval' to get a clean scope. 76 // Note: using Function instead of 'eval' to get a clean scope.
69 // TODO(jmesserly): evaluate the performance of these stubs. 77 // TODO(jmesserly): evaluate the performance of these stubs.
70 var f = 'function(' + a.join(',') + '){return $f(' + p.join(',') + ');}'; 78 var f = 'function(' + a.join(',') + '){return $f(' + p.join(',') + ');}';
71 return new Function('$f', 'return ' + f + '').call(null, this); 79 return new Function('$f', 'return ' + f + '').call(null, this);
72 } 80 }
73 function $notnull_bool(test) { 81 function $notnull_bool(test) {
74 return (test === true || test === false) ? test : test.is$bool(); // TypeError 82 if (test === true || test === false) return test;
83 $throw(new TypeError(test, 'bool'));
75 } 84 }
76 function $assert(test, text, url, line, column) { 85 function $assert(test, text, url, line, column) {
77 if (typeof test == 'function') test = test(); 86 if (typeof test == 'function') test = test();
78 if (!test) $throw(new AssertError(text, url, line, column)); 87 if (!test) $throw(new AssertError(text, url, line, column));
79 } 88 }
80 function $throw(e) { 89 function $throw(e) {
81 // If e is not a value, we can use V8's captureStackTrace utility method. 90 // If e is not a value, we can use V8's captureStackTrace utility method.
82 // TODO(jmesserly): capture the stack trace on other JS engines. 91 // TODO(jmesserly): capture the stack trace on other JS engines.
83 if (e && (typeof e == 'object') && Error.captureStackTrace) { 92 if (e && (typeof e == 'object') && Error.captureStackTrace) {
84 // TODO(jmesserly): this will clobber the e.stack property 93 // TODO(jmesserly): this will clobber the e.stack property
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 156 }
148 // ********** Code for Clock ************** 157 // ********** Code for Clock **************
149 function Clock() {} 158 function Clock() {}
150 Clock.now = function() { 159 Clock.now = function() {
151 return new Date().getTime(); 160 return new Date().getTime();
152 } 161 }
153 Clock.frequency = function() { 162 Clock.frequency = function() {
154 return 1000; 163 return 1000;
155 } 164 }
156 // ********** Code for AssertError ************** 165 // ********** Code for AssertError **************
157 function AssertError(failedAssertion, url, line, column) { 166 function AssertError() {}
167 AssertError._internal$ctor = function(failedAssertion, url, line, column) {
158 this.failedAssertion = failedAssertion; 168 this.failedAssertion = failedAssertion;
159 this.url = url; 169 this.url = url;
160 this.line = line; 170 this.line = line;
161 this.column = column; 171 this.column = column;
162 // Initializers done 172 // Initializers done
163 } 173 }
174 AssertError._internal$ctor.prototype = AssertError.prototype;
164 AssertError.prototype.toString = function() { 175 AssertError.prototype.toString = function() {
165 return ("Failed assertion: '" + this.failedAssertion + "' is not true ") + ("i n " + this.url + " at line " + this.line + ", column " + this.column + "."); 176 return ("Failed assertion: '" + this.failedAssertion + "' is not true ") + ("i n " + this.url + " at line " + this.line + ", column " + this.column + ".");
166 } 177 }
167 AssertError.prototype.toString$0 = AssertError.prototype.toString; 178 AssertError.prototype.toString$0 = function() {
179 return this.toString();
180 };
181 // ********** Code for TypeError **************
182 TypeError._internal$ctor = function(src, dstType) {
183 this.srcType = (src == null ? "Null" : src.$typeNameOf());
184 this.destType = destType;
185 this.toString = function() {
186 return ("Failed type check: type " + this.srcType +
187 " is not assignable to type" + this.dstType);
188 }
189 }
190 TypeError._internal$ctor.prototype = TypeError.prototype;
168 // ********** Code for Object ************** 191 // ********** Code for Object **************
169 Object.prototype.get$dynamic = function() { 192 Object.prototype.get$dynamic = function() {
170 return this; 193 return this;
171 } 194 }
172 Object.prototype.noSuchMethod = function(name, args) { 195 Object.prototype.noSuchMethod = function(name, args) {
173 $throw(new NoSuchMethodException(this, name, args)); 196 $throw(new NoSuchMethodException(this, name, args));
174 } 197 }
175 Object.prototype._get$3 = function($0, $1, $2) { 198 Object.prototype._get$3 = function($0, $1, $2) {
176 return this.noSuchMethod("_get", [$0, $1, $2]); 199 return this.noSuchMethod("_get", [$0, $1, $2]);
177 }; 200 };
(...skipping 14 matching lines...) Expand all
192 }; 215 };
193 Object.prototype.addMethod$2 = function($0, $1) { 216 Object.prototype.addMethod$2 = function($0, $1) {
194 return this.noSuchMethod("addMethod", [$0, $1]); 217 return this.noSuchMethod("addMethod", [$0, $1]);
195 }; 218 };
196 Object.prototype.addSource$1 = function($0) { 219 Object.prototype.addSource$1 = function($0) {
197 return this.noSuchMethod("addSource", [$0]); 220 return this.noSuchMethod("addSource", [$0]);
198 }; 221 };
199 Object.prototype.appendByteStringToken$2 = function($0, $1) { 222 Object.prototype.appendByteStringToken$2 = function($0, $1) {
200 return this.noSuchMethod("appendByteStringToken", [$0, $1]); 223 return this.noSuchMethod("appendByteStringToken", [$0, $1]);
201 }; 224 };
225 Object.prototype.assert$ArgumentNode = function() {
226 $throw(new TypeError._internal$ctor(this, "ArgumentNode"));
227 };
228 Object.prototype.assert$Arguments = function() {
229 $throw(new TypeError._internal$ctor(this, "Arguments"));
230 };
231 Object.prototype.assert$BeginGroupToken = function() {
232 $throw(new TypeError._internal$ctor(this, "BeginGroupToken"));
233 };
234 Object.prototype.assert$BinaryExpression = function() {
235 $throw(new TypeError._internal$ctor(this, "BinaryExpression"));
236 };
237 Object.prototype.assert$BlockScope = function() {
238 $throw(new TypeError._internal$ctor(this, "BlockScope"));
239 };
240 Object.prototype.assert$BlockStatement = function() {
241 $throw(new TypeError._internal$ctor(this, "BlockStatement"));
242 };
243 Object.prototype.assert$CallExpression = function() {
244 $throw(new TypeError._internal$ctor(this, "CallExpression"));
245 };
246 Object.prototype.assert$ClassElement = function() {
247 $throw(new TypeError._internal$ctor(this, "ClassElement"));
248 };
249 Object.prototype.assert$ClassNode = function() {
250 $throw(new TypeError._internal$ctor(this, "ClassNode"));
251 };
252 Object.prototype.assert$CodeWriter = function() {
253 $throw(new TypeError._internal$ctor(this, "CodeWriter"));
254 };
255 Object.prototype.assert$Collection_E = function() {
256 $throw(new TypeError._internal$ctor(this, "Collection<E>"));
257 };
258 Object.prototype.assert$Collection_Object = function() {
259 $throw(new TypeError._internal$ctor(this, "Collection<Object>"));
260 };
261 Object.prototype.assert$Collection_Type = function() {
262 $throw(new TypeError._internal$ctor(this, "Collection<Type>"));
263 };
264 Object.prototype.assert$Comparable = function() {
265 $throw(new TypeError._internal$ctor(this, "Comparable"));
266 };
267 Object.prototype.assert$Compiler = function() {
268 $throw(new TypeError._internal$ctor(this, "Compiler"));
269 };
270 Object.prototype.assert$ConcreteMember = function() {
271 $throw(new TypeError._internal$ctor(this, "ConcreteMember"));
272 };
273 Object.prototype.assert$ConcreteType = function() {
274 $throw(new TypeError._internal$ctor(this, "ConcreteType"));
275 };
276 Object.prototype.assert$Date = function() {
277 $throw(new TypeError._internal$ctor(this, "Date"));
278 };
279 Object.prototype.assert$DeclaredIdentifier = function() {
280 $throw(new TypeError._internal$ctor(this, "DeclaredIdentifier"));
281 };
282 Object.prototype.assert$DefinedType = function() {
283 $throw(new TypeError._internal$ctor(this, "DefinedType"));
284 };
285 Object.prototype.assert$Definition = function() {
286 $throw(new TypeError._internal$ctor(this, "Definition"));
287 };
288 Object.prototype.assert$DotExpression = function() {
289 $throw(new TypeError._internal$ctor(this, "DotExpression"));
290 };
291 Object.prototype.assert$DoubleLinkedQueueEntry_KeyValuePair_K$V = function() {
292 $throw(new TypeError._internal$ctor(this, "DoubleLinkedQueueEntry<KeyValuePair <K, V>>"));
293 };
294 Object.prototype.assert$Duration = function() {
295 $throw(new TypeError._internal$ctor(this, "Duration"));
296 };
297 Object.prototype.assert$Element = function() {
298 $throw(new TypeError._internal$ctor(this, "Element"));
299 };
300 Object.prototype.assert$Expression = function() {
301 $throw(new TypeError._internal$ctor(this, "Expression"));
302 };
303 Object.prototype.assert$ExpressionStatement = function() {
304 $throw(new TypeError._internal$ctor(this, "ExpressionStatement"));
305 };
306 Object.prototype.assert$FieldMember = function() {
307 $throw(new TypeError._internal$ctor(this, "FieldMember"));
308 };
309 Object.prototype.assert$FunctionDefinition = function() {
310 $throw(new TypeError._internal$ctor(this, "FunctionDefinition"));
311 };
312 Object.prototype.assert$FunctionElement = function() {
313 $throw(new TypeError._internal$ctor(this, "FunctionElement"));
314 };
315 Object.prototype.assert$FunctionExpression = function() {
316 $throw(new TypeError._internal$ctor(this, "FunctionExpression"));
317 };
318 Object.prototype.assert$FunctionType = function() {
319 $throw(new TypeError._internal$ctor(this, "FunctionType"));
320 };
321 Object.prototype.assert$FunctionTypeReference = function() {
322 $throw(new TypeError._internal$ctor(this, "FunctionTypeReference"));
323 };
324 Object.prototype.assert$GenericTypeReference = function() {
325 $throw(new TypeError._internal$ctor(this, "GenericTypeReference"));
326 };
327 Object.prototype.assert$GlobalValue = function() {
328 $throw(new TypeError._internal$ctor(this, "GlobalValue"));
329 };
330 Object.prototype.assert$HBasicBlock = function() {
331 $throw(new TypeError._internal$ctor(this, "HBasicBlock"));
332 };
333 Object.prototype.assert$HGraph = function() {
334 $throw(new TypeError._internal$ctor(this, "HGraph"));
335 };
336 Object.prototype.assert$HInstruction = function() {
337 $throw(new TypeError._internal$ctor(this, "HInstruction"));
338 };
339 Object.prototype.assert$HLiteral = function() {
340 $throw(new TypeError._internal$ctor(this, "HLiteral"));
341 };
342 Object.prototype.assert$HLocal = function() {
343 $throw(new TypeError._internal$ctor(this, "HLocal"));
344 };
345 Object.prototype.assert$HParameterValue = function() {
346 $throw(new TypeError._internal$ctor(this, "HParameterValue"));
347 };
348 Object.prototype.assert$HPhi = function() {
349 $throw(new TypeError._internal$ctor(this, "HPhi"));
350 };
351 Object.prototype.assert$HStatic = function() {
352 $throw(new TypeError._internal$ctor(this, "HStatic"));
353 };
354 Object.prototype.assert$HTypeGuard = function() {
355 $throw(new TypeError._internal$ctor(this, "HTypeGuard"));
356 };
357 Object.prototype.assert$HVisitor = function() {
358 $throw(new TypeError._internal$ctor(this, "HVisitor"));
359 };
360 Object.prototype.assert$HashMapImplementation = function() {
361 $throw(new TypeError._internal$ctor(this, "HashMapImplementation"));
362 };
363 Object.prototype.assert$HashSetImplementation = function() {
364 $throw(new TypeError._internal$ctor(this, "HashSetImplementation"));
365 };
366 Object.prototype.assert$Identifier = function() {
367 $throw(new TypeError._internal$ctor(this, "Identifier"));
368 };
369 Object.prototype.assert$IndexExpression = function() {
370 $throw(new TypeError._internal$ctor(this, "IndexExpression"));
371 };
372 Object.prototype.assert$InterpStack = function() {
373 $throw(new TypeError._internal$ctor(this, "InterpStack"));
374 };
375 Object.prototype.assert$Iterable = function() {
376 $throw(new TypeError._internal$ctor(this, "Iterable"));
377 };
378 Object.prototype.assert$Iterator_T = function() {
379 $throw(new TypeError._internal$ctor(this, "Iterator<T>"));
380 };
381 Object.prototype.assert$KeywordState = function() {
382 $throw(new TypeError._internal$ctor(this, "KeywordState"));
383 };
384 Object.prototype.assert$LambdaExpression = function() {
385 $throw(new TypeError._internal$ctor(this, "LambdaExpression"));
386 };
387 Object.prototype.assert$Library = function() {
388 $throw(new TypeError._internal$ctor(this, "Library"));
389 };
390 Object.prototype.assert$Link_Element = function() {
391 $throw(new TypeError._internal$ctor(this, "Link<Element>"));
392 };
393 Object.prototype.assert$Link_Node = function() {
394 $throw(new TypeError._internal$ctor(this, "Link<Node>"));
395 };
396 Object.prototype.assert$Link_Token = function() {
397 $throw(new TypeError._internal$ctor(this, "Link<Token>"));
398 };
399 Object.prototype.assert$Link_Type = function() {
400 $throw(new TypeError._internal$ctor(this, "Link<Type>"));
401 };
402 Object.prototype.assert$List = function() {
403 $throw(new TypeError._internal$ctor(this, "List"));
404 };
405 Object.prototype.assert$ListFactory = function() {
406 $throw(new TypeError._internal$ctor(this, "ListFactory"));
407 };
408 Object.prototype.assert$List_ArgumentNode = function() {
409 $throw(new TypeError._internal$ctor(this, "List<ArgumentNode>"));
410 };
411 Object.prototype.assert$List_Definition = function() {
412 $throw(new TypeError._internal$ctor(this, "List<Definition>"));
413 };
414 Object.prototype.assert$List_EvaluatedValue = function() {
415 $throw(new TypeError._internal$ctor(this, "List<EvaluatedValue>"));
416 };
417 Object.prototype.assert$List_GlobalValue = function() {
418 $throw(new TypeError._internal$ctor(this, "List<GlobalValue>"));
419 };
420 Object.prototype.assert$List_HInstruction = function() {
421 $throw(new TypeError._internal$ctor(this, "List<HInstruction>"));
422 };
423 Object.prototype.assert$List_Member = function() {
424 $throw(new TypeError._internal$ctor(this, "List<Member>"));
425 };
426 Object.prototype.assert$List_ParameterType = function() {
427 $throw(new TypeError._internal$ctor(this, "List<ParameterType>"));
428 };
429 Object.prototype.assert$List_String = function() {
430 $throw(new TypeError._internal$ctor(this, "List<String>"));
431 };
432 Object.prototype.assert$List_Token = function() {
433 $throw(new TypeError._internal$ctor(this, "List<Token>"));
434 };
435 Object.prototype.assert$List_Type = function() {
436 $throw(new TypeError._internal$ctor(this, "List<Type>"));
437 };
438 Object.prototype.assert$List_Value = function() {
439 $throw(new TypeError._internal$ctor(this, "List<Value>"));
440 };
441 Object.prototype.assert$List_int = function() {
442 $throw(new TypeError._internal$ctor(this, "List<int>"));
443 };
444 Object.prototype.assert$LiteralString = function() {
445 $throw(new TypeError._internal$ctor(this, "LiteralString"));
446 };
447 Object.prototype.assert$Map_Node$Element = function() {
448 $throw(new TypeError._internal$ctor(this, "Map<Node, Element>"));
449 };
450 Object.prototype.assert$Map_String$Member = function() {
451 $throw(new TypeError._internal$ctor(this, "Map<String, Member>"));
452 };
453 Object.prototype.assert$Member = function() {
454 $throw(new TypeError._internal$ctor(this, "Member"));
455 };
456 Object.prototype.assert$MemberSet = function() {
457 $throw(new TypeError._internal$ctor(this, "MemberSet"));
458 };
459 Object.prototype.assert$MethodGenerator = function() {
460 $throw(new TypeError._internal$ctor(this, "MethodGenerator"));
461 };
462 Object.prototype.assert$MethodMember = function() {
463 $throw(new TypeError._internal$ctor(this, "MethodMember"));
464 };
465 Object.prototype.assert$NameTypeReference = function() {
466 $throw(new TypeError._internal$ctor(this, "NameTypeReference"));
467 };
468 Object.prototype.assert$Node = function() {
469 $throw(new TypeError._internal$ctor(this, "Node"));
470 };
471 Object.prototype.assert$NodeList = function() {
472 $throw(new TypeError._internal$ctor(this, "NodeList"));
473 };
474 Object.prototype.assert$NumImplementation = function() {
475 $throw(new TypeError._internal$ctor(this, "NumImplementation"));
476 };
477 Object.prototype.assert$Operator = function() {
478 $throw(new TypeError._internal$ctor(this, "Operator"));
479 };
480 Object.prototype.assert$Parameter = function() {
481 $throw(new TypeError._internal$ctor(this, "Parameter"));
482 };
483 Object.prototype.assert$ParameterType = function() {
484 $throw(new TypeError._internal$ctor(this, "ParameterType"));
485 };
486 Object.prototype.assert$ParenthesizedExpression = function() {
487 $throw(new TypeError._internal$ctor(this, "ParenthesizedExpression"));
488 };
489 Object.prototype.assert$Pattern = function() {
490 $throw(new TypeError._internal$ctor(this, "Pattern"));
491 };
492 Object.prototype.assert$PostfixExpression = function() {
493 $throw(new TypeError._internal$ctor(this, "PostfixExpression"));
494 };
495 Object.prototype.assert$PropertyMember = function() {
496 $throw(new TypeError._internal$ctor(this, "PropertyMember"));
497 };
498 Object.prototype.assert$SendSet = function() {
499 $throw(new TypeError._internal$ctor(this, "SendSet"));
500 };
501 Object.prototype.assert$SourceFile = function() {
502 $throw(new TypeError._internal$ctor(this, "SourceFile"));
503 };
504 Object.prototype.assert$SourceSpan = function() {
505 $throw(new TypeError._internal$ctor(this, "SourceSpan"));
506 };
507 Object.prototype.assert$SourceString = function() {
508 $throw(new TypeError._internal$ctor(this, "SourceString"));
509 };
510 Object.prototype.assert$Statement = function() {
511 $throw(new TypeError._internal$ctor(this, "Statement"));
512 };
513 Object.prototype.assert$StringBuffer = function() {
514 $throw(new TypeError._internal$ctor(this, "StringBuffer"));
515 };
516 Object.prototype.assert$Token = function() {
517 $throw(new TypeError._internal$ctor(this, "Token"));
518 };
519 Object.prototype.assert$TreeVisitor = function() {
520 $throw(new TypeError._internal$ctor(this, "TreeVisitor"));
521 };
522 Object.prototype.assert$Type = function() {
523 $throw(new TypeError._internal$ctor(this, "Type"));
524 };
525 Object.prototype.assert$TypeAnnotation = function() {
526 $throw(new TypeError._internal$ctor(this, "TypeAnnotation"));
527 };
528 Object.prototype.assert$TypeDefinition = function() {
529 $throw(new TypeError._internal$ctor(this, "TypeDefinition"));
530 };
531 Object.prototype.assert$TypeMember = function() {
532 $throw(new TypeError._internal$ctor(this, "TypeMember"));
533 };
534 Object.prototype.assert$TypeReference = function() {
535 $throw(new TypeError._internal$ctor(this, "TypeReference"));
536 };
537 Object.prototype.assert$Types = function() {
538 $throw(new TypeError._internal$ctor(this, "Types"));
539 };
540 Object.prototype.assert$UnaryExpression = function() {
541 $throw(new TypeError._internal$ctor(this, "UnaryExpression"));
542 };
543 Object.prototype.assert$Value = function() {
544 $throw(new TypeError._internal$ctor(this, "Value"));
545 };
546 Object.prototype.assert$ValueSetNode = function() {
547 $throw(new TypeError._internal$ctor(this, "ValueSetNode"));
548 };
549 Object.prototype.assert$VarExpression = function() {
550 $throw(new TypeError._internal$ctor(this, "VarExpression"));
551 };
552 Object.prototype.assert$VarFunctionStub = function() {
553 $throw(new TypeError._internal$ctor(this, "VarFunctionStub"));
554 };
555 Object.prototype.assert$VarMember = function() {
556 $throw(new TypeError._internal$ctor(this, "VarMember"));
557 };
558 Object.prototype.assert$VariableDefinitions = function() {
559 $throw(new TypeError._internal$ctor(this, "VariableDefinitions"));
560 };
561 Object.prototype.assert$VariableElement = function() {
562 $throw(new TypeError._internal$ctor(this, "VariableElement"));
563 };
564 Object.prototype.assert$Visitor = function() {
565 $throw(new TypeError._internal$ctor(this, "Visitor"));
566 };
567 Object.prototype.assert$lang_Element = function() {
568 $throw(new TypeError._internal$ctor(this, "Element"));
569 };
570 Object.prototype.assert$lang_Expression = function() {
571 $throw(new TypeError._internal$ctor(this, "Expression"));
572 };
573 Object.prototype.assert$lang_Identifier = function() {
574 $throw(new TypeError._internal$ctor(this, "Identifier"));
575 };
576 Object.prototype.assert$lang_Node = function() {
577 $throw(new TypeError._internal$ctor(this, "Node"));
578 };
579 Object.prototype.assert$lang_Statement = function() {
580 $throw(new TypeError._internal$ctor(this, "Statement"));
581 };
582 Object.prototype.assert$lang_Token = function() {
583 $throw(new TypeError._internal$ctor(this, "Token"));
584 };
585 Object.prototype.assert$lang_Type = function() {
586 $throw(new TypeError._internal$ctor(this, "Type"));
587 };
202 Object.prototype.block$0 = function() { 588 Object.prototype.block$0 = function() {
203 return this.noSuchMethod("block", []); 589 return this.noSuchMethod("block", []);
204 }; 590 };
205 Object.prototype.canInvoke$2 = function($0, $1) { 591 Object.prototype.canInvoke$2 = function($0, $1) {
206 return this.noSuchMethod("canInvoke", [$0, $1]); 592 return this.noSuchMethod("canInvoke", [$0, $1]);
207 }; 593 };
208 Object.prototype.charCodeAt$1 = function($0) { 594 Object.prototype.charCodeAt$1 = function($0) {
209 return this.noSuchMethod("charCodeAt", [$0]); 595 return this.noSuchMethod("charCodeAt", [$0]);
210 }; 596 };
211 Object.prototype.checkFirstClass$1 = function($0) { 597 Object.prototype.checkFirstClass$1 = function($0) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 }; 647 };
262 Object.prototype.forEachPhi$1 = function($0) { 648 Object.prototype.forEachPhi$1 = function($0) {
263 return this.noSuchMethod("forEachPhi", [$0]); 649 return this.noSuchMethod("forEachPhi", [$0]);
264 }; 650 };
265 Object.prototype.genValue$2 = function($0, $1) { 651 Object.prototype.genValue$2 = function($0, $1) {
266 return this.noSuchMethod("genValue", [$0, $1]); 652 return this.noSuchMethod("genValue", [$0, $1]);
267 }; 653 };
268 Object.prototype.generate$1 = function($0) { 654 Object.prototype.generate$1 = function($0) {
269 return this.noSuchMethod("generate", [$0]); 655 return this.noSuchMethod("generate", [$0]);
270 }; 656 };
271 Object.prototype.generateBody$2 = function($0, $1) {
272 return this.noSuchMethod("generateBody", [$0, $1]);
273 };
274 Object.prototype.getBeginToken$0 = function() { 657 Object.prototype.getBeginToken$0 = function() {
275 return this.noSuchMethod("getBeginToken", []); 658 return this.noSuchMethod("getBeginToken", []);
276 }; 659 };
277 Object.prototype.getColumn$2 = function($0, $1) { 660 Object.prototype.getColumn$2 = function($0, $1) {
278 return this.noSuchMethod("getColumn", [$0, $1]); 661 return this.noSuchMethod("getColumn", [$0, $1]);
279 }; 662 };
280 Object.prototype.getConstructor$1 = function($0) { 663 Object.prototype.getConstructor$1 = function($0) {
281 return this.noSuchMethod("getConstructor", [$0]); 664 return this.noSuchMethod("getConstructor", [$0]);
282 }; 665 };
283 Object.prototype.getEndToken$0 = function() { 666 Object.prototype.getEndToken$0 = function() {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 }; 707 };
325 Object.prototype.invoke$4 = function($0, $1, $2, $3) { 708 Object.prototype.invoke$4 = function($0, $1, $2, $3) {
326 return this.noSuchMethod("invoke", [$0, $1, $2, $3]); 709 return this.noSuchMethod("invoke", [$0, $1, $2, $3]);
327 }; 710 };
328 Object.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 711 Object.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) {
329 return this.noSuchMethod("invoke", [$0, $1, $2, $3, isDynamic]); 712 return this.noSuchMethod("invoke", [$0, $1, $2, $3, isDynamic]);
330 }; 713 };
331 Object.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 714 Object.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
332 return this.noSuchMethod("invoke", [$0, $1, $2, $3, $4]); 715 return this.noSuchMethod("invoke", [$0, $1, $2, $3, $4]);
333 }; 716 };
717 Object.prototype.is$List = function() {
718 return false;
719 };
720 Object.prototype.is$SourceString = function() {
721 return false;
722 };
334 Object.prototype.isAssignable$1 = function($0) { 723 Object.prototype.isAssignable$1 = function($0) {
335 return this.noSuchMethod("isAssignable", [$0]); 724 return this.noSuchMethod("isAssignable", [$0]);
336 }; 725 };
337 Object.prototype.isEmpty$0 = function() { 726 Object.prototype.isEmpty$0 = function() {
338 return this.noSuchMethod("isEmpty", []); 727 return this.noSuchMethod("isEmpty", []);
339 }; 728 };
340 Object.prototype.isExitBlock$0 = function() { 729 Object.prototype.isExitBlock$0 = function() {
341 return this.noSuchMethod("isExitBlock", []); 730 return this.noSuchMethod("isExitBlock", []);
342 }; 731 };
343 Object.prototype.isInBasicBlock$0 = function() { 732 Object.prototype.isInBasicBlock$0 = function() {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 return this.noSuchMethod("visitPostfixExpression", [$0]); 847 return this.noSuchMethod("visitPostfixExpression", [$0]);
459 }; 848 };
460 Object.prototype.visitSources$0 = function() { 849 Object.prototype.visitSources$0 = function() {
461 return this.noSuchMethod("visitSources", []); 850 return this.noSuchMethod("visitSources", []);
462 }; 851 };
463 Object.prototype.writeDefinition$2 = function($0, $1) { 852 Object.prototype.writeDefinition$2 = function($0, $1) {
464 return this.noSuchMethod("writeDefinition", [$0, $1]); 853 return this.noSuchMethod("writeDefinition", [$0, $1]);
465 }; 854 };
466 function $assert_bool(x) { 855 function $assert_bool(x) {
467 if (x == null || typeof(x) == "boolean") return x; 856 if (x == null || typeof(x) == "boolean") return x;
468 throw new TypeError("'" + x + "' is not a bool."); 857 $throw(new TypeError._internal$ctor(this, "bool"))
469 } 858 }
470 // ********** Code for IllegalAccessException ************** 859 // ********** Code for IllegalAccessException **************
471 function IllegalAccessException() { 860 function IllegalAccessException() {
472 // Initializers done 861 // Initializers done
473 } 862 }
474 IllegalAccessException.prototype.toString = function() { 863 IllegalAccessException.prototype.toString = function() {
475 return "Attempt to modify an immutable object"; 864 return "Attempt to modify an immutable object";
476 } 865 }
477 IllegalAccessException.prototype.toString$0 = IllegalAccessException.prototype.t oString; 866 IllegalAccessException.prototype.toString$0 = IllegalAccessException.prototype.t oString;
478 // ********** Code for NoSuchMethodException ************** 867 // ********** Code for NoSuchMethodException **************
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 if (a == b) return a; 982 if (a == b) return a;
594 if (a < b) { 983 if (a < b) {
595 if (isNaN(b)) return b; 984 if (isNaN(b)) return b;
596 else return a; 985 else return a;
597 } 986 }
598 if (isNaN(a)) return a; 987 if (isNaN(a)) return a;
599 else return b; 988 else return b;
600 } 989 }
601 function $assert_num(x) { 990 function $assert_num(x) {
602 if (x == null || typeof(x) == "number") return x; 991 if (x == null || typeof(x) == "number") return x;
603 throw new TypeError("'" + x + "' is not a num."); 992 $throw(new TypeError._internal$ctor(this, "num"))
604 } 993 }
605 function $assert_String(x) { 994 function $assert_String(x) {
606 if (x == null || typeof(x) == "string") return x; 995 if (x == null || typeof(x) == "string") return x;
607 throw new TypeError("'" + x + "' is not a String."); 996 $throw(new TypeError._internal$ctor(this, "String"))
608 } 997 }
609 // ********** Code for Strings ************** 998 // ********** Code for Strings **************
610 function Strings() {} 999 function Strings() {}
611 Strings.String$fromCharCodes$factory = function(charCodes) { 1000 Strings.String$fromCharCodes$factory = function(charCodes) {
612 return StringBase.createFromCharCodes(charCodes); 1001 return StringBase.createFromCharCodes(charCodes);
613 } 1002 }
614 Strings.join = function(strings, separator) { 1003 Strings.join = function(strings, separator) {
615 return StringBase.join(strings, separator); 1004 return StringBase.join(strings, separator);
616 } 1005 }
617 // ********** Code for top level ************** 1006 // ********** Code for top level **************
618 function print(obj) { 1007 function print(obj) {
619 if (typeof console == 'object') { 1008 if (typeof console == 'object') {
620 if (obj) obj = obj.toString(); 1009 if (obj) obj = obj.toString();
621 console.log(obj); 1010 console.log(obj);
622 } else { 1011 } else {
623 write(obj); 1012 write(obj);
624 write('\n'); 1013 write('\n');
625 } 1014 }
626 } 1015 }
627 function _toDartException(e) { 1016 function _toDartException(e) {
628 { 1017 function attachStack(dartEx) {
629 function attachStack(dartEx) { 1018 // TODO(jmesserly): setting the stack property is not a long term solution.
630 // TODO(jmesserly): setting the stack property is not a long term solution . 1019 var stack = e.stack;
631 var stack = e.stack; 1020 // The stack contains the error message, and the stack is all that is
632 // The stack contains the error message, and the stack is all that is 1021 // printed (the exception's toString() is never called). Make the Dart
633 // printed (the exception's toString() is never called). Make the Dart 1022 // exception's toString() be the dominant message.
634 // exception's toString() be the dominant message. 1023 if (typeof stack == 'string') {
635 if (typeof stack == 'string') { 1024 var message = dartEx.toString();
636 var message = dartEx.toString(); 1025 if (/^(Type|Range)Error:/.test(stack)) {
637 if (/^(Type|Range)Error:/.test(stack)) { 1026 // Indent JS message (it can be helpful) so new message stands out.
638 // Indent JS message (it can be helpful) so new message stands out. 1027 stack = ' (' + stack.substring(0, stack.indexOf('\n')) + ')\n' +
639 stack = ' (' + stack.substring(0, stack.indexOf('\n')) + ')\n' + 1028 stack.substring(stack.indexOf('\n') + 1);
640 stack.substring(stack.indexOf('\n') + 1); 1029 }
1030 stack = message + '\n' + stack;
1031 }
1032 dartEx.stack = stack;
1033 return dartEx;
1034 }
1035
1036 if (e instanceof TypeError) {
1037 switch(e.type) {
1038 case 'property_not_function':
1039 case 'called_non_callable':
1040 if (e.arguments[0] == null) {
1041 return attachStack(new NullPointerException());
1042 } else {
1043 return attachStack(new ObjectNotClosureException());
641 } 1044 }
642 stack = message + '\n' + stack; 1045 break;
643 } 1046 case 'non_object_property_call':
644 dartEx.stack = stack; 1047 case 'non_object_property_load':
645 return dartEx; 1048 return attachStack(new NullPointerException());
1049 break;
1050 case 'undefined_method':
1051 if (e.arguments[0] == 'call' || e.arguments[0] == 'apply') {
1052 return attachStack(new ObjectNotClosureException());
1053 } else {
1054 // TODO(jmesserly): can this ever happen?
1055 // sra: Yes, seen on '$add'.
1056 return attachStack(new NoSuchMethodException('', e.arguments[0], []));
1057 }
1058 break;
646 } 1059 }
647 1060 } else if (e instanceof RangeError) {
648 if (e instanceof TypeError) { 1061 if (e.message.indexOf('call stack') >= 0) {
649 switch(e.type) { 1062 return attachStack(new StackOverflowException());
650 case 'property_not_function':
651 case 'called_non_callable':
652 if (e.arguments[0] == null) {
653 return attachStack(new NullPointerException());
654 } else {
655 return attachStack(new ObjectNotClosureException());
656 }
657 break;
658 case 'non_object_property_call':
659 case 'non_object_property_load':
660 return attachStack(new NullPointerException());
661 break;
662 case 'undefined_method':
663 if (e.arguments[0] == 'call' || e.arguments[0] == 'apply') {
664 return attachStack(new ObjectNotClosureException());
665 } else {
666 // TODO(jmesserly): can this ever happen?
667 // sra: Yes, seen on '$add'.
668 return attachStack(new NoSuchMethodException('', e.arguments[0], []) );
669 }
670 break;
671 }
672 } else if (e instanceof RangeError) {
673 if (e.message.indexOf('call stack') >= 0) {
674 return attachStack(new StackOverflowException());
675 }
676 } 1063 }
677 return e;
678 } 1064 }
1065 return e;
679 } 1066 }
680 // ********** Library dart:coreimpl ************** 1067 // ********** Library dart:coreimpl **************
681 // ********** Code for ListFactory ************** 1068 // ********** Code for ListFactory **************
682 ListFactory = Array; 1069 ListFactory = Array;
683 ListFactory.prototype.is$ListFactory = function(){return this;}; 1070 ListFactory.prototype.assert$ListFactory = function(){return this};
684 ListFactory.prototype.is$List = function(){return this;}; 1071 ListFactory.prototype.is$List = function(){return true};
685 ListFactory.prototype.is$List_ArgumentNode = function(){return this;}; 1072 ListFactory.prototype.assert$List = function(){return this};
686 ListFactory.prototype.is$List_Definition = function(){return this;}; 1073 ListFactory.prototype.assert$List_ArgumentNode = function(){return this};
687 ListFactory.prototype.is$List_EvaluatedValue = function(){return this;}; 1074 ListFactory.prototype.assert$List_Definition = function(){return this};
688 ListFactory.prototype.is$List_GlobalValue = function(){return this;}; 1075 ListFactory.prototype.assert$List_EvaluatedValue = function(){return this};
689 ListFactory.prototype.is$List_HInstruction = function(){return this;}; 1076 ListFactory.prototype.assert$List_GlobalValue = function(){return this};
690 ListFactory.prototype.is$List_Member = function(){return this;}; 1077 ListFactory.prototype.assert$List_HInstruction = function(){return this};
691 ListFactory.prototype.is$List_ParameterType = function(){return this;}; 1078 ListFactory.prototype.assert$List_Member = function(){return this};
692 ListFactory.prototype.is$List_String = function(){return this;}; 1079 ListFactory.prototype.assert$List_ParameterType = function(){return this};
693 ListFactory.prototype.is$List_Token = function(){return this;}; 1080 ListFactory.prototype.assert$List_String = function(){return this};
694 ListFactory.prototype.is$List_Type = function(){return this;}; 1081 ListFactory.prototype.assert$List_Token = function(){return this};
695 ListFactory.prototype.is$List_Value = function(){return this;}; 1082 ListFactory.prototype.assert$List_Type = function(){return this};
696 ListFactory.prototype.is$List_int = function(){return this;}; 1083 ListFactory.prototype.assert$List_Value = function(){return this};
697 ListFactory.prototype.is$Collection_E = function(){return this;}; 1084 ListFactory.prototype.assert$List_int = function(){return this};
698 ListFactory.prototype.is$Collection_Object = function(){return this;}; 1085 ListFactory.prototype.assert$Collection_E = function(){return this};
699 ListFactory.prototype.is$Collection_Type = function(){return this;}; 1086 ListFactory.prototype.assert$Collection_Object = function(){return this};
700 ListFactory.prototype.is$Iterable = function(){return this;}; 1087 ListFactory.prototype.assert$Collection_Type = function(){return this};
1088 ListFactory.prototype.assert$Iterable = function(){return this};
701 ListFactory.ListFactory$from$factory = function(other) { 1089 ListFactory.ListFactory$from$factory = function(other) {
702 var list = []; 1090 var list = [];
703 for (var $i = other.iterator(); $i.hasNext$0(); ) { 1091 for (var $i = other.iterator(); $i.hasNext$0(); ) {
704 var e = $i.next$0(); 1092 var e = $i.next$0();
705 list.add(e); 1093 list.add(e);
706 } 1094 }
707 return (list && list.is$ListFactory()); 1095 return (list == null ? null : list.assert$ListFactory());
708 } 1096 }
709 ListFactory.prototype.add = function(value) { 1097 ListFactory.prototype.add = function(value) {
710 this.push(value); 1098 this.push(value);
711 } 1099 }
712 ListFactory.prototype.addLast = function(value) { 1100 ListFactory.prototype.addLast = function(value) {
713 this.push(value); 1101 this.push(value);
714 } 1102 }
715 ListFactory.prototype.addAll = function(collection) { 1103 ListFactory.prototype.addAll = function(collection) {
716 for (var $i = collection.iterator(); $i.hasNext$0(); ) { 1104 for (var $i = collection.iterator(); $i.hasNext$0(); ) {
717 var item = $i.next$0(); 1105 var item = $i.next$0();
(...skipping 27 matching lines...) Expand all
745 1133
746 } 1134 }
747 ListFactory.prototype.isEmpty = function() { 1135 ListFactory.prototype.isEmpty = function() {
748 return this.length == 0; 1136 return this.length == 0;
749 } 1137 }
750 ListFactory.prototype.iterator = function() { 1138 ListFactory.prototype.iterator = function() {
751 return new ListIterator(this); 1139 return new ListIterator(this);
752 } 1140 }
753 ListFactory.prototype.add$1 = ListFactory.prototype.add; 1141 ListFactory.prototype.add$1 = ListFactory.prototype.add;
754 ListFactory.prototype.addAll$1 = function($0) { 1142 ListFactory.prototype.addAll$1 = function($0) {
755 return this.addAll(($0 && $0.is$Collection_E())); 1143 return this.addAll(($0 == null ? null : $0.assert$Collection_E()));
756 }; 1144 };
757 ListFactory.prototype.every$1 = function($0) { 1145 ListFactory.prototype.every$1 = function($0) {
758 return this.every(to$call$1($0)); 1146 return this.every(to$call$1($0));
759 }; 1147 };
760 ListFactory.prototype.filter$1 = function($0) { 1148 ListFactory.prototype.filter$1 = function($0) {
761 return this.filter(to$call$1($0)); 1149 return this.filter(to$call$1($0));
762 }; 1150 };
763 ListFactory.prototype.forEach$1 = function($0) { 1151 ListFactory.prototype.forEach$1 = function($0) {
764 return this.forEach(to$call$1($0)); 1152 return this.forEach(to$call$1($0));
765 }; 1153 };
(...skipping 19 matching lines...) Expand all
785 ListFactory_T = ListFactory; 1173 ListFactory_T = ListFactory;
786 ListFactory_V = ListFactory; 1174 ListFactory_V = ListFactory;
787 ListFactory_ValueSetNode = ListFactory; 1175 ListFactory_ValueSetNode = ListFactory;
788 ListFactory_int = ListFactory; 1176 ListFactory_int = ListFactory;
789 // ********** Code for ListIterator ************** 1177 // ********** Code for ListIterator **************
790 function ListIterator(array) { 1178 function ListIterator(array) {
791 this._array = array; 1179 this._array = array;
792 this._pos = 0; 1180 this._pos = 0;
793 // Initializers done 1181 // Initializers done
794 } 1182 }
795 ListIterator.prototype.is$Iterator_T = function(){return this;}; 1183 ListIterator.prototype.assert$Iterator_T = function(){return this};
796 ListIterator.prototype.hasNext = function() { 1184 ListIterator.prototype.hasNext = function() {
797 return this._array.length > this._pos; 1185 return this._array.length > this._pos;
798 } 1186 }
799 ListIterator.prototype.next = function() { 1187 ListIterator.prototype.next = function() {
800 if (!this.hasNext()) { 1188 if (!this.hasNext()) {
801 $throw(const$0/*const NoMoreElementsException()*/); 1189 $throw(const$0/*const NoMoreElementsException()*/);
802 } 1190 }
803 return this._array.$index(this._pos++); 1191 return this._array.$index(this._pos++);
804 } 1192 }
805 ListIterator.prototype.hasNext$0 = ListIterator.prototype.hasNext; 1193 ListIterator.prototype.hasNext$0 = ListIterator.prototype.hasNext;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 $throw(const$20/*const IllegalAccessException()*/); 1256 $throw(const$20/*const IllegalAccessException()*/);
869 } 1257 }
870 ImmutableList.prototype.removeLast = function() { 1258 ImmutableList.prototype.removeLast = function() {
871 $throw(const$20/*const IllegalAccessException()*/); 1259 $throw(const$20/*const IllegalAccessException()*/);
872 } 1260 }
873 ImmutableList.prototype.toString = function() { 1261 ImmutableList.prototype.toString = function() {
874 return ListFactory.ListFactory$from$factory(this).toString(); 1262 return ListFactory.ListFactory$from$factory(this).toString();
875 } 1263 }
876 ImmutableList.prototype.add$1 = ImmutableList.prototype.add; 1264 ImmutableList.prototype.add$1 = ImmutableList.prototype.add;
877 ImmutableList.prototype.addAll$1 = function($0) { 1265 ImmutableList.prototype.addAll$1 = function($0) {
878 return this.addAll(($0 && $0.is$Collection_E())); 1266 return this.addAll(($0 == null ? null : $0.assert$Collection_E()));
879 }; 1267 };
880 ImmutableList.prototype.removeLast$0 = ImmutableList.prototype.removeLast; 1268 ImmutableList.prototype.removeLast$0 = ImmutableList.prototype.removeLast;
881 ImmutableList.prototype.sort$1 = function($0) { 1269 ImmutableList.prototype.sort$1 = function($0) {
882 return this.sort(to$call$2($0)); 1270 return this.sort(to$call$2($0));
883 }; 1271 };
884 ImmutableList.prototype.toString$0 = ImmutableList.prototype.toString; 1272 ImmutableList.prototype.toString$0 = ImmutableList.prototype.toString;
885 // ********** Code for ImmutableMap ************** 1273 // ********** Code for ImmutableMap **************
886 function ImmutableMap(keyValuePairs) { 1274 function ImmutableMap(keyValuePairs) {
887 this._internal = $map([]); 1275 this._internal = $map([]);
888 // Initializers done 1276 // Initializers done
889 for (var i = 0; 1277 for (var i = 0;
890 i < keyValuePairs.length; i += 2) { 1278 i < keyValuePairs.length; i += 2) {
891 this._internal.$setindex(keyValuePairs.$index(i), keyValuePairs.$index(i + 1 )); 1279 this._internal.$setindex(keyValuePairs.$index(i), keyValuePairs.$index(i + 1 ));
892 } 1280 }
893 } 1281 }
894 ImmutableMap.prototype.is$Map_Node$Element = function(){return this;}; 1282 ImmutableMap.prototype.assert$Map_Node$Element = function(){return this};
895 ImmutableMap.prototype.is$Map_String$Member = function(){return this;}; 1283 ImmutableMap.prototype.assert$Map_String$Member = function(){return this};
896 ImmutableMap.prototype.$index = function(key) { 1284 ImmutableMap.prototype.$index = function(key) {
897 return this._internal.$index(key); 1285 return this._internal.$index(key);
898 } 1286 }
899 ImmutableMap.prototype.isEmpty = function() { 1287 ImmutableMap.prototype.isEmpty = function() {
900 return this._internal.isEmpty(); 1288 return this._internal.isEmpty();
901 } 1289 }
902 ImmutableMap.prototype.get$length = function() { 1290 ImmutableMap.prototype.get$length = function() {
903 return this._internal.get$length(); 1291 return this._internal.get$length();
904 } 1292 }
905 Object.defineProperty(ImmutableMap.prototype, "length", { 1293 Object.defineProperty(ImmutableMap.prototype, "length", {
(...skipping 21 matching lines...) Expand all
927 $throw(const$20/*const IllegalAccessException()*/); 1315 $throw(const$20/*const IllegalAccessException()*/);
928 } 1316 }
929 ImmutableMap.prototype.forEach$1 = function($0) { 1317 ImmutableMap.prototype.forEach$1 = function($0) {
930 return this.forEach(to$call$2($0)); 1318 return this.forEach(to$call$2($0));
931 }; 1319 };
932 ImmutableMap.prototype.getKeys$0 = ImmutableMap.prototype.getKeys; 1320 ImmutableMap.prototype.getKeys$0 = ImmutableMap.prototype.getKeys;
933 ImmutableMap.prototype.getValues$0 = ImmutableMap.prototype.getValues; 1321 ImmutableMap.prototype.getValues$0 = ImmutableMap.prototype.getValues;
934 ImmutableMap.prototype.isEmpty$0 = ImmutableMap.prototype.isEmpty; 1322 ImmutableMap.prototype.isEmpty$0 = ImmutableMap.prototype.isEmpty;
935 // ********** Code for NumImplementation ************** 1323 // ********** Code for NumImplementation **************
936 NumImplementation = Number; 1324 NumImplementation = Number;
937 NumImplementation.prototype.is$NumImplementation = function(){return this;}; 1325 NumImplementation.prototype.assert$NumImplementation = function(){return this};
938 NumImplementation.prototype.is$Comparable = function(){return this;}; 1326 NumImplementation.prototype.assert$Comparable = function(){return this};
939 NumImplementation.prototype.isNaN = function() { 1327 NumImplementation.prototype.isNaN = function() {
940 return isNaN(this); 1328 return isNaN(this);
941 } 1329 }
942 NumImplementation.prototype.isNegative = function() { 1330 NumImplementation.prototype.isNegative = function() {
943 return this == 0 ? (1 / this) < 0 : this < 0; 1331 return this == 0 ? (1 / this) < 0 : this < 0;
944 } 1332 }
945 NumImplementation.prototype.hashCode = function() { 1333 NumImplementation.prototype.hashCode = function() {
946 return this & 0xFFFFFFF; 1334 return this & 0xFFFFFFF;
947 } 1335 }
948 NumImplementation.prototype.toInt = function() { 1336 NumImplementation.prototype.toInt = function() {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 if (other.isNaN()) { 1368 if (other.isNaN()) {
981 return 0; 1369 return 0;
982 } 1370 }
983 return 1; 1371 return 1;
984 } 1372 }
985 else { 1373 else {
986 return -1; 1374 return -1;
987 } 1375 }
988 } 1376 }
989 NumImplementation.prototype.compareTo$1 = function($0) { 1377 NumImplementation.prototype.compareTo$1 = function($0) {
990 return this.compareTo(($0 && $0.is$NumImplementation())); 1378 return this.compareTo(($0 == null ? null : $0.assert$NumImplementation()));
991 }; 1379 };
992 NumImplementation.prototype.hashCode$0 = NumImplementation.prototype.hashCode; 1380 NumImplementation.prototype.hashCode$0 = NumImplementation.prototype.hashCode;
993 // ********** Code for ExceptionImplementation ************** 1381 // ********** Code for ExceptionImplementation **************
994 function ExceptionImplementation(msg) { 1382 function ExceptionImplementation(msg) {
995 this._msg = msg; 1383 this._msg = msg;
996 // Initializers done 1384 // Initializers done
997 } 1385 }
998 ExceptionImplementation.prototype.toString = function() { 1386 ExceptionImplementation.prototype.toString = function() {
999 return (this._msg == null) ? "Exception" : ("Exception: " + this._msg); 1387 return (this._msg == null) ? "Exception" : ("Exception: " + this._msg);
1000 } 1388 }
1001 ExceptionImplementation.prototype.toString$0 = ExceptionImplementation.prototype .toString; 1389 ExceptionImplementation.prototype.toString$0 = ExceptionImplementation.prototype .toString;
1002 // ********** Code for HashMapImplementation ************** 1390 // ********** Code for HashMapImplementation **************
1003 function HashMapImplementation() { 1391 function HashMapImplementation() {
1004 // Initializers done 1392 // Initializers done
1005 this._numberOfEntries = 0; 1393 this._numberOfEntries = 0;
1006 this._numberOfDeleted = 0; 1394 this._numberOfDeleted = 0;
1007 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/); 1395 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/);
1008 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1396 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1009 this._values = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1397 this._values = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1010 } 1398 }
1011 HashMapImplementation.prototype.is$HashMapImplementation = function(){return thi s;}; 1399 HashMapImplementation.prototype.assert$HashMapImplementation = function(){return this};
1012 HashMapImplementation.prototype.is$Map_Node$Element = function(){return this;}; 1400 HashMapImplementation.prototype.assert$Map_Node$Element = function(){return this };
1013 HashMapImplementation.prototype.is$Map_String$Member = function(){return this;}; 1401 HashMapImplementation.prototype.assert$Map_String$Member = function(){return thi s};
1014 HashMapImplementation.HashMapImplementation$from$factory = function(other) { 1402 HashMapImplementation.HashMapImplementation$from$factory = function(other) {
1015 var result = new HashMapImplementation(); 1403 var result = new HashMapImplementation();
1016 other.forEach((function (key, value) { 1404 other.forEach((function (key, value) {
1017 result.$setindex(key, value); 1405 result.$setindex(key, value);
1018 }) 1406 })
1019 ); 1407 );
1020 return (result && result.is$HashMapImplementation()); 1408 return (result == null ? null : result.assert$HashMapImplementation());
1021 } 1409 }
1022 HashMapImplementation._computeLoadLimit = function(capacity) { 1410 HashMapImplementation._computeLoadLimit = function(capacity) {
1023 return $truncdiv((capacity * 3), 4); 1411 return $truncdiv((capacity * 3), 4);
1024 } 1412 }
1025 HashMapImplementation._firstProbe = function(hashCode, length) { 1413 HashMapImplementation._firstProbe = function(hashCode, length) {
1026 return hashCode & (length - 1); 1414 return hashCode & (length - 1);
1027 } 1415 }
1028 HashMapImplementation._nextProbe = function(currentProbe, numberOfProbes, length ) { 1416 HashMapImplementation._nextProbe = function(currentProbe, numberOfProbes, length ) {
1029 return (currentProbe + numberOfProbes) & (length - 1); 1417 return (currentProbe + numberOfProbes) & (length - 1);
1030 } 1418 }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 // ********** Code for HashMapImplementation_E$E ************** 1575 // ********** Code for HashMapImplementation_E$E **************
1188 function HashMapImplementation_E$E() { 1576 function HashMapImplementation_E$E() {
1189 // Initializers done 1577 // Initializers done
1190 this._numberOfEntries = 0; 1578 this._numberOfEntries = 0;
1191 this._numberOfDeleted = 0; 1579 this._numberOfDeleted = 0;
1192 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/); 1580 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/);
1193 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1581 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1194 this._values = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1582 this._values = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1195 } 1583 }
1196 $inherits(HashMapImplementation_E$E, HashMapImplementation); 1584 $inherits(HashMapImplementation_E$E, HashMapImplementation);
1197 HashMapImplementation_E$E.prototype.is$Map_Node$Element = function(){return this ;}; 1585 HashMapImplementation_E$E.prototype.assert$Map_Node$Element = function(){return this};
1198 HashMapImplementation_E$E.prototype.is$Map_String$Member = function(){return thi s;}; 1586 HashMapImplementation_E$E.prototype.assert$Map_String$Member = function(){return this};
1199 HashMapImplementation_E$E._computeLoadLimit = function(capacity) { 1587 HashMapImplementation_E$E._computeLoadLimit = function(capacity) {
1200 return $truncdiv((capacity * 3), 4); 1588 return $truncdiv((capacity * 3), 4);
1201 } 1589 }
1202 HashMapImplementation_E$E._firstProbe = function(hashCode, length) { 1590 HashMapImplementation_E$E._firstProbe = function(hashCode, length) {
1203 return hashCode & (length - 1); 1591 return hashCode & (length - 1);
1204 } 1592 }
1205 HashMapImplementation_E$E._nextProbe = function(currentProbe, numberOfProbes, le ngth) { 1593 HashMapImplementation_E$E._nextProbe = function(currentProbe, numberOfProbes, le ngth) {
1206 return (currentProbe + numberOfProbes) & (length - 1); 1594 return (currentProbe + numberOfProbes) & (length - 1);
1207 } 1595 }
1208 HashMapImplementation_E$E.prototype._probeForAdding = function(key) { 1596 HashMapImplementation_E$E.prototype._probeForAdding = function(key) {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 } 1712 }
1325 ); 1713 );
1326 return list; 1714 return list;
1327 } 1715 }
1328 HashMapImplementation_E$E.prototype.containsKey = function(key) { 1716 HashMapImplementation_E$E.prototype.containsKey = function(key) {
1329 return (this._probeForLookup(key) != -1); 1717 return (this._probeForLookup(key) != -1);
1330 } 1718 }
1331 // ********** Code for HashMapImplementation_Element$HInstruction ************** 1719 // ********** Code for HashMapImplementation_Element$HInstruction **************
1332 function HashMapImplementation_Element$HInstruction() {} 1720 function HashMapImplementation_Element$HInstruction() {}
1333 $inherits(HashMapImplementation_Element$HInstruction, HashMapImplementation); 1721 $inherits(HashMapImplementation_Element$HInstruction, HashMapImplementation);
1334 HashMapImplementation_Element$HInstruction.prototype.is$Map_Node$Element = false ; 1722 HashMapImplementation_Element$HInstruction.prototype.assert$Map_Node$Element = f unction(){$throw(new TypeError._internal$ctor(this, "Map<Node, Element>"))};
1335 HashMapImplementation_Element$HInstruction.prototype.is$Map_String$Member = fals e; 1723 HashMapImplementation_Element$HInstruction.prototype.assert$Map_String$Member = function(){$throw(new TypeError._internal$ctor(this, "Map<String, Member>"))};
1336 // ********** Code for HashMapImplementation_Element$HLocal ************** 1724 // ********** Code for HashMapImplementation_Element$HLocal **************
1337 function HashMapImplementation_Element$HLocal() {} 1725 function HashMapImplementation_Element$HLocal() {}
1338 $inherits(HashMapImplementation_Element$HLocal, HashMapImplementation); 1726 $inherits(HashMapImplementation_Element$HLocal, HashMapImplementation);
1339 HashMapImplementation_Element$HLocal.prototype.is$Map_Node$Element = false; 1727 HashMapImplementation_Element$HLocal.prototype.assert$Map_Node$Element = functio n(){$throw(new TypeError._internal$ctor(this, "Map<Node, Element>"))};
1340 HashMapImplementation_Element$HLocal.prototype.is$Map_String$Member = false; 1728 HashMapImplementation_Element$HLocal.prototype.assert$Map_String$Member = functi on(){$throw(new TypeError._internal$ctor(this, "Map<String, Member>"))};
1341 // ********** Code for HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePa ir_K$V ************** 1729 // ********** Code for HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePa ir_K$V **************
1342 function HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePair_K$V() {} 1730 function HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePair_K$V() {}
1343 $inherits(HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePair_K$V, HashM apImplementation); 1731 $inherits(HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePair_K$V, HashM apImplementation);
1344 HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.is$Map _Node$Element = false; 1732 HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.assert $Map_Node$Element = function(){$throw(new TypeError._internal$ctor(this, "Map<No de, Element>"))};
1345 HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.is$Map _String$Member = false; 1733 HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.assert $Map_String$Member = function(){$throw(new TypeError._internal$ctor(this, "Map<S tring, Member>"))};
1346 // ********** Code for HashMapImplementation_String$EvaluatedValue ************* * 1734 // ********** Code for HashMapImplementation_String$EvaluatedValue ************* *
1347 function HashMapImplementation_String$EvaluatedValue() {} 1735 function HashMapImplementation_String$EvaluatedValue() {}
1348 $inherits(HashMapImplementation_String$EvaluatedValue, HashMapImplementation); 1736 $inherits(HashMapImplementation_String$EvaluatedValue, HashMapImplementation);
1349 HashMapImplementation_String$EvaluatedValue.prototype.is$Map_Node$Element = fals e; 1737 HashMapImplementation_String$EvaluatedValue.prototype.assert$Map_Node$Element = function(){$throw(new TypeError._internal$ctor(this, "Map<Node, Element>"))};
1350 HashMapImplementation_String$EvaluatedValue.prototype.is$Map_String$Member = fal se; 1738 HashMapImplementation_String$EvaluatedValue.prototype.assert$Map_String$Member = function(){$throw(new TypeError._internal$ctor(this, "Map<String, Member>"))};
1351 // ********** Code for HashMapImplementation_String$int ************** 1739 // ********** Code for HashMapImplementation_String$int **************
1352 function HashMapImplementation_String$int() {} 1740 function HashMapImplementation_String$int() {}
1353 $inherits(HashMapImplementation_String$int, HashMapImplementation); 1741 $inherits(HashMapImplementation_String$int, HashMapImplementation);
1354 HashMapImplementation_String$int.prototype.is$Map_Node$Element = false; 1742 HashMapImplementation_String$int.prototype.assert$Map_Node$Element = function(){ $throw(new TypeError._internal$ctor(this, "Map<Node, Element>"))};
1355 HashMapImplementation_String$int.prototype.is$Map_String$Member = false; 1743 HashMapImplementation_String$int.prototype.assert$Map_String$Member = function() {$throw(new TypeError._internal$ctor(this, "Map<String, Member>"))};
1356 // ********** Code for HashMapImplementation_int$HInstruction ************** 1744 // ********** Code for HashMapImplementation_int$HInstruction **************
1357 function HashMapImplementation_int$HInstruction() {} 1745 function HashMapImplementation_int$HInstruction() {}
1358 $inherits(HashMapImplementation_int$HInstruction, HashMapImplementation); 1746 $inherits(HashMapImplementation_int$HInstruction, HashMapImplementation);
1359 HashMapImplementation_int$HInstruction.prototype.is$Map_Node$Element = false; 1747 HashMapImplementation_int$HInstruction.prototype.assert$Map_Node$Element = funct ion(){$throw(new TypeError._internal$ctor(this, "Map<Node, Element>"))};
1360 HashMapImplementation_int$HInstruction.prototype.is$Map_String$Member = false; 1748 HashMapImplementation_int$HInstruction.prototype.assert$Map_String$Member = func tion(){$throw(new TypeError._internal$ctor(this, "Map<String, Member>"))};
1361 // ********** Code for HashMapImplementation_int$String ************** 1749 // ********** Code for HashMapImplementation_int$String **************
1362 function HashMapImplementation_int$String() {} 1750 function HashMapImplementation_int$String() {}
1363 $inherits(HashMapImplementation_int$String, HashMapImplementation); 1751 $inherits(HashMapImplementation_int$String, HashMapImplementation);
1364 HashMapImplementation_int$String.prototype.is$Map_Node$Element = false; 1752 HashMapImplementation_int$String.prototype.assert$Map_Node$Element = function(){ $throw(new TypeError._internal$ctor(this, "Map<Node, Element>"))};
1365 HashMapImplementation_int$String.prototype.is$Map_String$Member = false; 1753 HashMapImplementation_int$String.prototype.assert$Map_String$Member = function() {$throw(new TypeError._internal$ctor(this, "Map<String, Member>"))};
1366 // ********** Code for HashSetImplementation ************** 1754 // ********** Code for HashSetImplementation **************
1367 function HashSetImplementation() { 1755 function HashSetImplementation() {
1368 // Initializers done 1756 // Initializers done
1369 this._backingMap = new HashMapImplementation_E$E(); 1757 this._backingMap = new HashMapImplementation_E$E();
1370 } 1758 }
1371 HashSetImplementation.prototype.is$HashSetImplementation = function(){return thi s;}; 1759 HashSetImplementation.prototype.assert$HashSetImplementation = function(){return this};
1372 HashSetImplementation.prototype.is$Collection_E = function(){return this;}; 1760 HashSetImplementation.prototype.assert$Collection_E = function(){return this};
1373 HashSetImplementation.prototype.is$Collection_Object = function(){return this;}; 1761 HashSetImplementation.prototype.assert$Collection_Object = function(){return thi s};
1374 HashSetImplementation.prototype.is$Collection_Type = function(){return this;}; 1762 HashSetImplementation.prototype.assert$Collection_Type = function(){return this} ;
1375 HashSetImplementation.prototype.is$Iterable = function(){return this;}; 1763 HashSetImplementation.prototype.assert$Iterable = function(){return this};
1376 HashSetImplementation.HashSetImplementation$from$factory = function(other) { 1764 HashSetImplementation.HashSetImplementation$from$factory = function(other) {
1377 var set = new HashSetImplementation(); 1765 var set = new HashSetImplementation();
1378 for (var $i = other.iterator(); $i.hasNext$0(); ) { 1766 for (var $i = other.iterator(); $i.hasNext$0(); ) {
1379 var e = $i.next$0(); 1767 var e = $i.next$0();
1380 set.add(e); 1768 set.add(e);
1381 } 1769 }
1382 return (set && set.is$HashSetImplementation()); 1770 return (set == null ? null : set.assert$HashSetImplementation());
1383 } 1771 }
1384 HashSetImplementation.prototype.clear = function() { 1772 HashSetImplementation.prototype.clear = function() {
1385 this._backingMap.clear(); 1773 this._backingMap.clear();
1386 } 1774 }
1387 HashSetImplementation.prototype.add = function(value) { 1775 HashSetImplementation.prototype.add = function(value) {
1388 this._backingMap.$setindex(value, value); 1776 this._backingMap.$setindex(value, value);
1389 } 1777 }
1390 HashSetImplementation.prototype.contains = function(value) { 1778 HashSetImplementation.prototype.contains = function(value) {
1391 return this._backingMap.containsKey(value); 1779 return this._backingMap.containsKey(value);
1392 } 1780 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 return this._backingMap.get$length(); 1819 return this._backingMap.get$length();
1432 } 1820 }
1433 Object.defineProperty(HashSetImplementation.prototype, "length", { 1821 Object.defineProperty(HashSetImplementation.prototype, "length", {
1434 get: HashSetImplementation.prototype.get$length 1822 get: HashSetImplementation.prototype.get$length
1435 }); 1823 });
1436 HashSetImplementation.prototype.iterator = function() { 1824 HashSetImplementation.prototype.iterator = function() {
1437 return new HashSetIterator_E(this); 1825 return new HashSetIterator_E(this);
1438 } 1826 }
1439 HashSetImplementation.prototype.add$1 = HashSetImplementation.prototype.add; 1827 HashSetImplementation.prototype.add$1 = HashSetImplementation.prototype.add;
1440 HashSetImplementation.prototype.addAll$1 = function($0) { 1828 HashSetImplementation.prototype.addAll$1 = function($0) {
1441 return this.addAll(($0 && $0.is$Collection_E())); 1829 return this.addAll(($0 == null ? null : $0.assert$Collection_E()));
1442 }; 1830 };
1443 HashSetImplementation.prototype.contains$1 = HashSetImplementation.prototype.con tains; 1831 HashSetImplementation.prototype.contains$1 = HashSetImplementation.prototype.con tains;
1444 HashSetImplementation.prototype.every$1 = function($0) { 1832 HashSetImplementation.prototype.every$1 = function($0) {
1445 return this.every(to$call$1($0)); 1833 return this.every(to$call$1($0));
1446 }; 1834 };
1447 HashSetImplementation.prototype.filter$1 = function($0) { 1835 HashSetImplementation.prototype.filter$1 = function($0) {
1448 return this.filter(to$call$1($0)); 1836 return this.filter(to$call$1($0));
1449 }; 1837 };
1450 HashSetImplementation.prototype.forEach$1 = function($0) { 1838 HashSetImplementation.prototype.forEach$1 = function($0) {
1451 return this.forEach(to$call$1($0)); 1839 return this.forEach(to$call$1($0));
1452 }; 1840 };
1453 HashSetImplementation.prototype.isEmpty$0 = HashSetImplementation.prototype.isEm pty; 1841 HashSetImplementation.prototype.isEmpty$0 = HashSetImplementation.prototype.isEm pty;
1454 HashSetImplementation.prototype.iterator$0 = HashSetImplementation.prototype.ite rator; 1842 HashSetImplementation.prototype.iterator$0 = HashSetImplementation.prototype.ite rator;
1455 HashSetImplementation.prototype.some$1 = function($0) { 1843 HashSetImplementation.prototype.some$1 = function($0) {
1456 return this.some(to$call$1($0)); 1844 return this.some(to$call$1($0));
1457 }; 1845 };
1458 // ********** Code for HashSetImplementation_E ************** 1846 // ********** Code for HashSetImplementation_E **************
1459 function HashSetImplementation_E() {} 1847 function HashSetImplementation_E() {}
1460 $inherits(HashSetImplementation_E, HashSetImplementation); 1848 $inherits(HashSetImplementation_E, HashSetImplementation);
1461 HashSetImplementation_E.prototype.is$Collection_E = function(){return this;}; 1849 HashSetImplementation_E.prototype.assert$Collection_E = function(){return this};
1462 HashSetImplementation_E.prototype.is$Collection_Object = function(){return this; }; 1850 HashSetImplementation_E.prototype.assert$Collection_Object = function(){return t his};
1463 HashSetImplementation_E.prototype.is$Collection_Type = function(){return this;}; 1851 HashSetImplementation_E.prototype.assert$Collection_Type = function(){return thi s};
1464 HashSetImplementation_E.prototype.is$Iterable = function(){return this;}; 1852 HashSetImplementation_E.prototype.assert$Iterable = function(){return this};
1465 // ********** Code for HashSetImplementation_HInstruction ************** 1853 // ********** Code for HashSetImplementation_HInstruction **************
1466 function HashSetImplementation_HInstruction() {} 1854 function HashSetImplementation_HInstruction() {}
1467 $inherits(HashSetImplementation_HInstruction, HashSetImplementation); 1855 $inherits(HashSetImplementation_HInstruction, HashSetImplementation);
1468 HashSetImplementation_HInstruction.prototype.is$Collection_E = function(){return this;}; 1856 HashSetImplementation_HInstruction.prototype.assert$Collection_E = function(){re turn this};
1469 HashSetImplementation_HInstruction.prototype.is$Collection_Object = function(){r eturn this;}; 1857 HashSetImplementation_HInstruction.prototype.assert$Collection_Object = function (){return this};
1470 HashSetImplementation_HInstruction.prototype.is$Collection_Type = false; 1858 HashSetImplementation_HInstruction.prototype.assert$Collection_Type = function() {$throw(new TypeError._internal$ctor(this, "Collection<Type>"))};
1471 HashSetImplementation_HInstruction.prototype.is$Iterable = function(){return thi s;}; 1859 HashSetImplementation_HInstruction.prototype.assert$Iterable = function(){return this};
1472 // ********** Code for HashSetImplementation_HPhi ************** 1860 // ********** Code for HashSetImplementation_HPhi **************
1473 function HashSetImplementation_HPhi() {} 1861 function HashSetImplementation_HPhi() {}
1474 $inherits(HashSetImplementation_HPhi, HashSetImplementation); 1862 $inherits(HashSetImplementation_HPhi, HashSetImplementation);
1475 HashSetImplementation_HPhi.prototype.is$Collection_E = function(){return this;}; 1863 HashSetImplementation_HPhi.prototype.assert$Collection_E = function(){return thi s};
1476 HashSetImplementation_HPhi.prototype.is$Collection_Object = function(){return th is;}; 1864 HashSetImplementation_HPhi.prototype.assert$Collection_Object = function(){retur n this};
1477 HashSetImplementation_HPhi.prototype.is$Collection_Type = false; 1865 HashSetImplementation_HPhi.prototype.assert$Collection_Type = function(){$throw( new TypeError._internal$ctor(this, "Collection<Type>"))};
1478 HashSetImplementation_HPhi.prototype.is$Iterable = function(){return this;}; 1866 HashSetImplementation_HPhi.prototype.assert$Iterable = function(){return this};
1479 // ********** Code for HashSetImplementation_String ************** 1867 // ********** Code for HashSetImplementation_String **************
1480 function HashSetImplementation_String() {} 1868 function HashSetImplementation_String() {}
1481 $inherits(HashSetImplementation_String, HashSetImplementation); 1869 $inherits(HashSetImplementation_String, HashSetImplementation);
1482 HashSetImplementation_String.prototype.is$Collection_E = function(){return this; }; 1870 HashSetImplementation_String.prototype.assert$Collection_E = function(){return t his};
1483 HashSetImplementation_String.prototype.is$Collection_Object = function(){return this;}; 1871 HashSetImplementation_String.prototype.assert$Collection_Object = function(){ret urn this};
1484 HashSetImplementation_String.prototype.is$Collection_Type = false; 1872 HashSetImplementation_String.prototype.assert$Collection_Type = function(){$thro w(new TypeError._internal$ctor(this, "Collection<Type>"))};
1485 HashSetImplementation_String.prototype.is$Iterable = function(){return this;}; 1873 HashSetImplementation_String.prototype.assert$Iterable = function(){return this} ;
1486 // ********** Code for HashSetImplementation_lang_Type ************** 1874 // ********** Code for HashSetImplementation_lang_Type **************
1487 function HashSetImplementation_lang_Type() {} 1875 function HashSetImplementation_lang_Type() {}
1488 $inherits(HashSetImplementation_lang_Type, HashSetImplementation); 1876 $inherits(HashSetImplementation_lang_Type, HashSetImplementation);
1489 HashSetImplementation_lang_Type.prototype.is$Collection_E = function(){return th is;}; 1877 HashSetImplementation_lang_Type.prototype.assert$Collection_E = function(){retur n this};
1490 HashSetImplementation_lang_Type.prototype.is$Collection_Object = function(){retu rn this;}; 1878 HashSetImplementation_lang_Type.prototype.assert$Collection_Object = function(){ return this};
1491 HashSetImplementation_lang_Type.prototype.is$Collection_Type = function(){return this;}; 1879 HashSetImplementation_lang_Type.prototype.assert$Collection_Type = function(){re turn this};
1492 HashSetImplementation_lang_Type.prototype.is$Iterable = function(){return this;} ; 1880 HashSetImplementation_lang_Type.prototype.assert$Iterable = function(){return th is};
1493 // ********** Code for HashSetImplementation_int ************** 1881 // ********** Code for HashSetImplementation_int **************
1494 function HashSetImplementation_int() {} 1882 function HashSetImplementation_int() {}
1495 $inherits(HashSetImplementation_int, HashSetImplementation); 1883 $inherits(HashSetImplementation_int, HashSetImplementation);
1496 HashSetImplementation_int.prototype.is$Collection_E = function(){return this;}; 1884 HashSetImplementation_int.prototype.assert$Collection_E = function(){return this };
1497 HashSetImplementation_int.prototype.is$Collection_Object = function(){return thi s;}; 1885 HashSetImplementation_int.prototype.assert$Collection_Object = function(){return this};
1498 HashSetImplementation_int.prototype.is$Collection_Type = false; 1886 HashSetImplementation_int.prototype.assert$Collection_Type = function(){$throw(n ew TypeError._internal$ctor(this, "Collection<Type>"))};
1499 HashSetImplementation_int.prototype.is$Iterable = function(){return this;}; 1887 HashSetImplementation_int.prototype.assert$Iterable = function(){return this};
1500 // ********** Code for HashSetIterator ************** 1888 // ********** Code for HashSetIterator **************
1501 function HashSetIterator(set_) { 1889 function HashSetIterator(set_) {
1502 this._nextValidIndex = -1; 1890 this._nextValidIndex = -1;
1503 this._entries = set_._backingMap._keys; 1891 this._entries = set_._backingMap._keys;
1504 // Initializers done 1892 // Initializers done
1505 this._advance(); 1893 this._advance();
1506 } 1894 }
1507 HashSetIterator.prototype.is$Iterator_T = function(){return this;}; 1895 HashSetIterator.prototype.assert$Iterator_T = function(){return this};
1508 HashSetIterator.prototype.hasNext = function() { 1896 HashSetIterator.prototype.hasNext = function() {
1509 if (this._nextValidIndex >= this._entries.length) return false; 1897 if (this._nextValidIndex >= this._entries.length) return false;
1510 if (this._entries.$index(this._nextValidIndex) === const$1/*HashMapImplementat ion._DELETED_KEY*/) { 1898 if (this._entries.$index(this._nextValidIndex) === const$1/*HashMapImplementat ion._DELETED_KEY*/) {
1511 this._advance(); 1899 this._advance();
1512 } 1900 }
1513 return this._nextValidIndex < this._entries.length; 1901 return this._nextValidIndex < this._entries.length;
1514 } 1902 }
1515 HashSetIterator.prototype.next = function() { 1903 HashSetIterator.prototype.next = function() {
1516 if (!this.hasNext()) { 1904 if (!this.hasNext()) {
1517 $throw(const$0/*const NoMoreElementsException()*/); 1905 $throw(const$0/*const NoMoreElementsException()*/);
(...skipping 15 matching lines...) Expand all
1533 HashSetIterator.prototype.hasNext$0 = HashSetIterator.prototype.hasNext; 1921 HashSetIterator.prototype.hasNext$0 = HashSetIterator.prototype.hasNext;
1534 HashSetIterator.prototype.next$0 = HashSetIterator.prototype.next; 1922 HashSetIterator.prototype.next$0 = HashSetIterator.prototype.next;
1535 // ********** Code for HashSetIterator_E ************** 1923 // ********** Code for HashSetIterator_E **************
1536 function HashSetIterator_E(set_) { 1924 function HashSetIterator_E(set_) {
1537 this._nextValidIndex = -1; 1925 this._nextValidIndex = -1;
1538 this._entries = set_._backingMap._keys; 1926 this._entries = set_._backingMap._keys;
1539 // Initializers done 1927 // Initializers done
1540 this._advance(); 1928 this._advance();
1541 } 1929 }
1542 $inherits(HashSetIterator_E, HashSetIterator); 1930 $inherits(HashSetIterator_E, HashSetIterator);
1543 HashSetIterator_E.prototype.is$Iterator_T = function(){return this;}; 1931 HashSetIterator_E.prototype.assert$Iterator_T = function(){return this};
1544 HashSetIterator_E.prototype._advance = function() { 1932 HashSetIterator_E.prototype._advance = function() {
1545 var length = this._entries.length; 1933 var length = this._entries.length;
1546 var entry; 1934 var entry;
1547 var deletedKey = const$1/*HashMapImplementation._DELETED_KEY*/; 1935 var deletedKey = const$1/*HashMapImplementation._DELETED_KEY*/;
1548 do { 1936 do {
1549 if (++this._nextValidIndex >= length) break; 1937 if (++this._nextValidIndex >= length) break;
1550 entry = this._entries.$index(this._nextValidIndex); 1938 entry = this._entries.$index(this._nextValidIndex);
1551 } 1939 }
1552 while ((entry == null) || (entry === deletedKey)) 1940 while ((entry == null) || (entry === deletedKey))
1553 } 1941 }
(...skipping 15 matching lines...) Expand all
1569 this.value = value; 1957 this.value = value;
1570 // Initializers done 1958 // Initializers done
1571 } 1959 }
1572 $inherits(KeyValuePair_K$V, KeyValuePair); 1960 $inherits(KeyValuePair_K$V, KeyValuePair);
1573 // ********** Code for LinkedHashMapImplementation ************** 1961 // ********** Code for LinkedHashMapImplementation **************
1574 function LinkedHashMapImplementation() { 1962 function LinkedHashMapImplementation() {
1575 // Initializers done 1963 // Initializers done
1576 this._map = new HashMapImplementation(); 1964 this._map = new HashMapImplementation();
1577 this._list = new DoubleLinkedQueue_KeyValuePair_K$V(); 1965 this._list = new DoubleLinkedQueue_KeyValuePair_K$V();
1578 } 1966 }
1579 LinkedHashMapImplementation.prototype.is$Map_Node$Element = function(){return th is;}; 1967 LinkedHashMapImplementation.prototype.assert$Map_Node$Element = function(){retur n this};
1580 LinkedHashMapImplementation.prototype.is$Map_String$Member = function(){return t his;}; 1968 LinkedHashMapImplementation.prototype.assert$Map_String$Member = function(){retu rn this};
1581 LinkedHashMapImplementation.prototype.$setindex = function(key, value) { 1969 LinkedHashMapImplementation.prototype.$setindex = function(key, value) {
1582 if (this._map.containsKey(key)) { 1970 if (this._map.containsKey(key)) {
1583 this._map.$index(key).get$element().set$value(value); 1971 this._map.$index(key).get$element().set$value(value);
1584 } 1972 }
1585 else { 1973 else {
1586 this._list.addLast(new KeyValuePair_K$V(key, value)); 1974 this._list.addLast(new KeyValuePair_K$V(key, value));
1587 this._map.$setindex(key, this._list.lastEntry()); 1975 this._map.$setindex(key, this._list.lastEntry());
1588 } 1976 }
1589 } 1977 }
1590 LinkedHashMapImplementation.prototype.$index = function(key) { 1978 LinkedHashMapImplementation.prototype.$index = function(key) {
1591 var $0; 1979 var $0;
1592 var entry = (($0 = this._map.$index(key)) && $0.is$DoubleLinkedQueueEntry_KeyV aluePair_K$V()); 1980 var entry = (($0 = this._map.$index(key)) == null ? null : $0.assert$DoubleLin kedQueueEntry_KeyValuePair_K$V());
1593 if (entry == null) return null; 1981 if (entry == null) return null;
1594 return entry.get$element().get$value(); 1982 return entry.get$element().get$value();
1595 } 1983 }
1596 LinkedHashMapImplementation.prototype.remove = function(key) { 1984 LinkedHashMapImplementation.prototype.remove = function(key) {
1597 var $0; 1985 var $0;
1598 var entry = (($0 = this._map.remove(key)) && $0.is$DoubleLinkedQueueEntry_KeyV aluePair_K$V()); 1986 var entry = (($0 = this._map.remove(key)) == null ? null : $0.assert$DoubleLin kedQueueEntry_KeyValuePair_K$V());
1599 if (entry == null) return null; 1987 if (entry == null) return null;
1600 entry.remove(); 1988 entry.remove();
1601 return entry.get$element().get$value(); 1989 return entry.get$element().get$value();
1602 } 1990 }
1603 LinkedHashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { 1991 LinkedHashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) {
1604 var value = this.$index(key); 1992 var value = this.$index(key);
1605 if ((this.$index(key) == null) && !(this.containsKey(key))) { 1993 if ((this.$index(key) == null) && !(this.containsKey(key))) {
1606 value = ifAbsent(); 1994 value = ifAbsent();
1607 this.$setindex(key, value); 1995 this.$setindex(key, value);
1608 } 1996 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1648 } 2036 }
1649 LinkedHashMapImplementation.prototype.forEach$1 = function($0) { 2037 LinkedHashMapImplementation.prototype.forEach$1 = function($0) {
1650 return this.forEach(to$call$2($0)); 2038 return this.forEach(to$call$2($0));
1651 }; 2039 };
1652 LinkedHashMapImplementation.prototype.getKeys$0 = LinkedHashMapImplementation.pr ototype.getKeys; 2040 LinkedHashMapImplementation.prototype.getKeys$0 = LinkedHashMapImplementation.pr ototype.getKeys;
1653 LinkedHashMapImplementation.prototype.getValues$0 = LinkedHashMapImplementation. prototype.getValues; 2041 LinkedHashMapImplementation.prototype.getValues$0 = LinkedHashMapImplementation. prototype.getValues;
1654 LinkedHashMapImplementation.prototype.isEmpty$0 = LinkedHashMapImplementation.pr ototype.isEmpty; 2042 LinkedHashMapImplementation.prototype.isEmpty$0 = LinkedHashMapImplementation.pr ototype.isEmpty;
1655 // ********** Code for LinkedHashMapImplementation_Element$String ************** 2043 // ********** Code for LinkedHashMapImplementation_Element$String **************
1656 function LinkedHashMapImplementation_Element$String() {} 2044 function LinkedHashMapImplementation_Element$String() {}
1657 $inherits(LinkedHashMapImplementation_Element$String, LinkedHashMapImplementatio n); 2045 $inherits(LinkedHashMapImplementation_Element$String, LinkedHashMapImplementatio n);
1658 LinkedHashMapImplementation_Element$String.prototype.is$Map_Node$Element = false ; 2046 LinkedHashMapImplementation_Element$String.prototype.assert$Map_Node$Element = f unction(){$throw(new TypeError._internal$ctor(this, "Map<Node, Element>"))};
1659 LinkedHashMapImplementation_Element$String.prototype.is$Map_String$Member = fals e; 2047 LinkedHashMapImplementation_Element$String.prototype.assert$Map_String$Member = function(){$throw(new TypeError._internal$ctor(this, "Map<String, Member>"))};
1660 // ********** Code for LinkedHashMapImplementation_Node$Element ************** 2048 // ********** Code for LinkedHashMapImplementation_Node$Element **************
1661 function LinkedHashMapImplementation_Node$Element() {} 2049 function LinkedHashMapImplementation_Node$Element() {}
1662 $inherits(LinkedHashMapImplementation_Node$Element, LinkedHashMapImplementation) ; 2050 $inherits(LinkedHashMapImplementation_Node$Element, LinkedHashMapImplementation) ;
1663 LinkedHashMapImplementation_Node$Element.prototype.is$Map_Node$Element = functio n(){return this;}; 2051 LinkedHashMapImplementation_Node$Element.prototype.assert$Map_Node$Element = fun ction(){return this};
1664 LinkedHashMapImplementation_Node$Element.prototype.is$Map_String$Member = false; 2052 LinkedHashMapImplementation_Node$Element.prototype.assert$Map_String$Member = fu nction(){$throw(new TypeError._internal$ctor(this, "Map<String, Member>"))};
1665 // ********** Code for LinkedHashMapImplementation_String$Keyword ************** 2053 // ********** Code for LinkedHashMapImplementation_String$Keyword **************
1666 function LinkedHashMapImplementation_String$Keyword() {} 2054 function LinkedHashMapImplementation_String$Keyword() {}
1667 $inherits(LinkedHashMapImplementation_String$Keyword, LinkedHashMapImplementatio n); 2055 $inherits(LinkedHashMapImplementation_String$Keyword, LinkedHashMapImplementatio n);
1668 LinkedHashMapImplementation_String$Keyword.prototype.is$Map_Node$Element = false ; 2056 LinkedHashMapImplementation_String$Keyword.prototype.assert$Map_Node$Element = f unction(){$throw(new TypeError._internal$ctor(this, "Map<Node, Element>"))};
1669 LinkedHashMapImplementation_String$Keyword.prototype.is$Map_String$Member = fals e; 2057 LinkedHashMapImplementation_String$Keyword.prototype.assert$Map_String$Member = function(){$throw(new TypeError._internal$ctor(this, "Map<String, Member>"))};
1670 // ********** Code for DoubleLinkedQueueEntry ************** 2058 // ********** Code for DoubleLinkedQueueEntry **************
1671 function DoubleLinkedQueueEntry(e) { 2059 function DoubleLinkedQueueEntry(e) {
1672 // Initializers done 2060 // Initializers done
1673 this._element = e; 2061 this._element = e;
1674 } 2062 }
1675 DoubleLinkedQueueEntry.prototype.is$DoubleLinkedQueueEntry_KeyValuePair_K$V = fu nction(){return this;}; 2063 DoubleLinkedQueueEntry.prototype.assert$DoubleLinkedQueueEntry_KeyValuePair_K$V = function(){return this};
1676 DoubleLinkedQueueEntry.prototype._link = function(p, n) { 2064 DoubleLinkedQueueEntry.prototype._link = function(p, n) {
1677 this._next = n; 2065 this._next = n;
1678 this._previous = p; 2066 this._previous = p;
1679 p._next = this; 2067 p._next = this;
1680 n._previous = this; 2068 n._previous = this;
1681 } 2069 }
1682 DoubleLinkedQueueEntry.prototype.prepend = function(e) { 2070 DoubleLinkedQueueEntry.prototype.prepend = function(e) {
1683 new DoubleLinkedQueueEntry_E(e)._link(this._previous, this); 2071 new DoubleLinkedQueueEntry_E(e)._link(this._previous, this);
1684 } 2072 }
1685 DoubleLinkedQueueEntry.prototype.remove = function() { 2073 DoubleLinkedQueueEntry.prototype.remove = function() {
(...skipping 11 matching lines...) Expand all
1697 } 2085 }
1698 DoubleLinkedQueueEntry.prototype.get$element = function() { 2086 DoubleLinkedQueueEntry.prototype.get$element = function() {
1699 return this._element; 2087 return this._element;
1700 } 2088 }
1701 // ********** Code for DoubleLinkedQueueEntry_E ************** 2089 // ********** Code for DoubleLinkedQueueEntry_E **************
1702 function DoubleLinkedQueueEntry_E(e) { 2090 function DoubleLinkedQueueEntry_E(e) {
1703 // Initializers done 2091 // Initializers done
1704 this._element = e; 2092 this._element = e;
1705 } 2093 }
1706 $inherits(DoubleLinkedQueueEntry_E, DoubleLinkedQueueEntry); 2094 $inherits(DoubleLinkedQueueEntry_E, DoubleLinkedQueueEntry);
1707 DoubleLinkedQueueEntry_E.prototype.is$DoubleLinkedQueueEntry_KeyValuePair_K$V = function(){return this;}; 2095 DoubleLinkedQueueEntry_E.prototype.assert$DoubleLinkedQueueEntry_KeyValuePair_K$ V = function(){return this};
1708 DoubleLinkedQueueEntry_E.prototype._link = function(p, n) { 2096 DoubleLinkedQueueEntry_E.prototype._link = function(p, n) {
1709 this._next = n; 2097 this._next = n;
1710 this._previous = p; 2098 this._previous = p;
1711 p._next = this; 2099 p._next = this;
1712 n._previous = this; 2100 n._previous = this;
1713 } 2101 }
1714 DoubleLinkedQueueEntry_E.prototype.prepend = function(e) { 2102 DoubleLinkedQueueEntry_E.prototype.prepend = function(e) {
1715 new DoubleLinkedQueueEntry_E(e)._link(this._previous, this); 2103 new DoubleLinkedQueueEntry_E(e)._link(this._previous, this);
1716 } 2104 }
1717 DoubleLinkedQueueEntry_E.prototype.remove = function() { 2105 DoubleLinkedQueueEntry_E.prototype.remove = function() {
1718 this._previous._next = this._next; 2106 this._previous._next = this._next;
1719 this._next._previous = this._previous; 2107 this._next._previous = this._previous;
1720 this._next = null; 2108 this._next = null;
1721 this._previous = null; 2109 this._previous = null;
1722 return this._element; 2110 return this._element;
1723 } 2111 }
1724 DoubleLinkedQueueEntry_E.prototype._asNonSentinelEntry = function() { 2112 DoubleLinkedQueueEntry_E.prototype._asNonSentinelEntry = function() {
1725 return this; 2113 return this;
1726 } 2114 }
1727 DoubleLinkedQueueEntry_E.prototype.previousEntry = function() { 2115 DoubleLinkedQueueEntry_E.prototype.previousEntry = function() {
1728 return this._previous._asNonSentinelEntry(); 2116 return this._previous._asNonSentinelEntry();
1729 } 2117 }
1730 // ********** Code for DoubleLinkedQueueEntry_KeyValuePair_K$V ************** 2118 // ********** Code for DoubleLinkedQueueEntry_KeyValuePair_K$V **************
1731 function DoubleLinkedQueueEntry_KeyValuePair_K$V(e) { 2119 function DoubleLinkedQueueEntry_KeyValuePair_K$V(e) {
1732 // Initializers done 2120 // Initializers done
1733 this._element = e; 2121 this._element = e;
1734 } 2122 }
1735 $inherits(DoubleLinkedQueueEntry_KeyValuePair_K$V, DoubleLinkedQueueEntry); 2123 $inherits(DoubleLinkedQueueEntry_KeyValuePair_K$V, DoubleLinkedQueueEntry);
1736 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.is$DoubleLinkedQueueEntry_KeyV aluePair_K$V = function(){return this;}; 2124 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.assert$DoubleLinkedQueueEntry_ KeyValuePair_K$V = function(){return this};
1737 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype._link = function(p, n) { 2125 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype._link = function(p, n) {
1738 this._next = n; 2126 this._next = n;
1739 this._previous = p; 2127 this._previous = p;
1740 p._next = this; 2128 p._next = this;
1741 n._previous = this; 2129 n._previous = this;
1742 } 2130 }
1743 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.prepend = function(e) { 2131 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.prepend = function(e) {
1744 new DoubleLinkedQueueEntry_KeyValuePair_K$V(e)._link(this._previous, this); 2132 new DoubleLinkedQueueEntry_KeyValuePair_K$V(e)._link(this._previous, this);
1745 } 2133 }
1746 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.remove = function() { 2134 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.remove = function() {
1747 this._previous._next = this._next; 2135 this._previous._next = this._next;
1748 this._next._previous = this._previous; 2136 this._next._previous = this._previous;
1749 this._next = null; 2137 this._next = null;
1750 this._previous = null; 2138 this._previous = null;
1751 return this._element; 2139 return this._element;
1752 } 2140 }
1753 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype._asNonSentinelEntry = function () { 2141 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype._asNonSentinelEntry = function () {
1754 return this; 2142 return this;
1755 } 2143 }
1756 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.previousEntry = function() { 2144 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.previousEntry = function() {
1757 var $0; 2145 var $0;
1758 return (($0 = this._previous._asNonSentinelEntry()) && $0.is$DoubleLinkedQueue Entry_KeyValuePair_K$V()); 2146 return (($0 = this._previous._asNonSentinelEntry()) == null ? null : $0.assert $DoubleLinkedQueueEntry_KeyValuePair_K$V());
1759 } 2147 }
1760 // ********** Code for _DoubleLinkedQueueEntrySentinel ************** 2148 // ********** Code for _DoubleLinkedQueueEntrySentinel **************
1761 function _DoubleLinkedQueueEntrySentinel() { 2149 function _DoubleLinkedQueueEntrySentinel() {
1762 // Initializers done 2150 // Initializers done
1763 DoubleLinkedQueueEntry_E.call(this, null); 2151 DoubleLinkedQueueEntry_E.call(this, null);
1764 this._link(this, this); 2152 this._link(this, this);
1765 } 2153 }
1766 $inherits(_DoubleLinkedQueueEntrySentinel, DoubleLinkedQueueEntry_E); 2154 $inherits(_DoubleLinkedQueueEntrySentinel, DoubleLinkedQueueEntry_E);
1767 _DoubleLinkedQueueEntrySentinel.prototype.remove = function() { 2155 _DoubleLinkedQueueEntrySentinel.prototype.remove = function() {
1768 $throw(const$5/*const EmptyQueueException()*/); 2156 $throw(const$5/*const EmptyQueueException()*/);
(...skipping 16 matching lines...) Expand all
1785 // Initializers done 2173 // Initializers done
1786 DoubleLinkedQueueEntry_KeyValuePair_K$V.call(this, null); 2174 DoubleLinkedQueueEntry_KeyValuePair_K$V.call(this, null);
1787 this._link(this, this); 2175 this._link(this, this);
1788 } 2176 }
1789 $inherits(_DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V, _DoubleLinkedQueueEn trySentinel); 2177 $inherits(_DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V, _DoubleLinkedQueueEn trySentinel);
1790 // ********** Code for DoubleLinkedQueue ************** 2178 // ********** Code for DoubleLinkedQueue **************
1791 function DoubleLinkedQueue() { 2179 function DoubleLinkedQueue() {
1792 // Initializers done 2180 // Initializers done
1793 this._sentinel = new _DoubleLinkedQueueEntrySentinel_E(); 2181 this._sentinel = new _DoubleLinkedQueueEntrySentinel_E();
1794 } 2182 }
1795 DoubleLinkedQueue.prototype.is$Collection_E = function(){return this;}; 2183 DoubleLinkedQueue.prototype.assert$Collection_E = function(){return this};
1796 DoubleLinkedQueue.prototype.is$Collection_Object = function(){return this;}; 2184 DoubleLinkedQueue.prototype.assert$Collection_Object = function(){return this};
1797 DoubleLinkedQueue.prototype.is$Collection_Type = function(){return this;}; 2185 DoubleLinkedQueue.prototype.assert$Collection_Type = function(){return this};
1798 DoubleLinkedQueue.prototype.is$Iterable = function(){return this;}; 2186 DoubleLinkedQueue.prototype.assert$Iterable = function(){return this};
1799 DoubleLinkedQueue.prototype.addLast = function(value) { 2187 DoubleLinkedQueue.prototype.addLast = function(value) {
1800 this._sentinel.prepend(value); 2188 this._sentinel.prepend(value);
1801 } 2189 }
1802 DoubleLinkedQueue.prototype.add = function(value) { 2190 DoubleLinkedQueue.prototype.add = function(value) {
1803 this.addLast(value); 2191 this.addLast(value);
1804 } 2192 }
1805 DoubleLinkedQueue.prototype.addAll = function(collection) { 2193 DoubleLinkedQueue.prototype.addAll = function(collection) {
1806 for (var $i = collection.iterator(); $i.hasNext$0(); ) { 2194 for (var $i = collection.iterator(); $i.hasNext$0(); ) {
1807 var e = $i.next$0(); 2195 var e = $i.next$0();
1808 this.add(e); 2196 this.add(e);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1868 if (f(entry._element)) other.addLast(entry._element); 2256 if (f(entry._element)) other.addLast(entry._element);
1869 entry = nextEntry; 2257 entry = nextEntry;
1870 } 2258 }
1871 return other; 2259 return other;
1872 } 2260 }
1873 DoubleLinkedQueue.prototype.iterator = function() { 2261 DoubleLinkedQueue.prototype.iterator = function() {
1874 return new _DoubleLinkedQueueIterator_E(this._sentinel); 2262 return new _DoubleLinkedQueueIterator_E(this._sentinel);
1875 } 2263 }
1876 DoubleLinkedQueue.prototype.add$1 = DoubleLinkedQueue.prototype.add; 2264 DoubleLinkedQueue.prototype.add$1 = DoubleLinkedQueue.prototype.add;
1877 DoubleLinkedQueue.prototype.addAll$1 = function($0) { 2265 DoubleLinkedQueue.prototype.addAll$1 = function($0) {
1878 return this.addAll(($0 && $0.is$Collection_E())); 2266 return this.addAll(($0 == null ? null : $0.assert$Collection_E()));
1879 }; 2267 };
1880 DoubleLinkedQueue.prototype.every$1 = function($0) { 2268 DoubleLinkedQueue.prototype.every$1 = function($0) {
1881 return this.every(to$call$1($0)); 2269 return this.every(to$call$1($0));
1882 }; 2270 };
1883 DoubleLinkedQueue.prototype.filter$1 = function($0) { 2271 DoubleLinkedQueue.prototype.filter$1 = function($0) {
1884 return this.filter(to$call$1($0)); 2272 return this.filter(to$call$1($0));
1885 }; 2273 };
1886 DoubleLinkedQueue.prototype.forEach$1 = function($0) { 2274 DoubleLinkedQueue.prototype.forEach$1 = function($0) {
1887 return this.forEach(to$call$1($0)); 2275 return this.forEach(to$call$1($0));
1888 }; 2276 };
1889 DoubleLinkedQueue.prototype.isEmpty$0 = DoubleLinkedQueue.prototype.isEmpty; 2277 DoubleLinkedQueue.prototype.isEmpty$0 = DoubleLinkedQueue.prototype.isEmpty;
1890 DoubleLinkedQueue.prototype.iterator$0 = DoubleLinkedQueue.prototype.iterator; 2278 DoubleLinkedQueue.prototype.iterator$0 = DoubleLinkedQueue.prototype.iterator;
1891 DoubleLinkedQueue.prototype.last$0 = DoubleLinkedQueue.prototype.last; 2279 DoubleLinkedQueue.prototype.last$0 = DoubleLinkedQueue.prototype.last;
1892 DoubleLinkedQueue.prototype.removeLast$0 = DoubleLinkedQueue.prototype.removeLas t; 2280 DoubleLinkedQueue.prototype.removeLast$0 = DoubleLinkedQueue.prototype.removeLas t;
1893 DoubleLinkedQueue.prototype.some$1 = function($0) { 2281 DoubleLinkedQueue.prototype.some$1 = function($0) {
1894 return this.some(to$call$1($0)); 2282 return this.some(to$call$1($0));
1895 }; 2283 };
1896 // ********** Code for DoubleLinkedQueue_ClassElement ************** 2284 // ********** Code for DoubleLinkedQueue_ClassElement **************
1897 function DoubleLinkedQueue_ClassElement() {} 2285 function DoubleLinkedQueue_ClassElement() {}
1898 $inherits(DoubleLinkedQueue_ClassElement, DoubleLinkedQueue); 2286 $inherits(DoubleLinkedQueue_ClassElement, DoubleLinkedQueue);
1899 DoubleLinkedQueue_ClassElement.prototype.is$Collection_E = function(){return thi s;}; 2287 DoubleLinkedQueue_ClassElement.prototype.assert$Collection_E = function(){return this};
1900 DoubleLinkedQueue_ClassElement.prototype.is$Collection_Object = function(){retur n this;}; 2288 DoubleLinkedQueue_ClassElement.prototype.assert$Collection_Object = function(){r eturn this};
1901 DoubleLinkedQueue_ClassElement.prototype.is$Collection_Type = false; 2289 DoubleLinkedQueue_ClassElement.prototype.assert$Collection_Type = function(){$th row(new TypeError._internal$ctor(this, "Collection<Type>"))};
1902 DoubleLinkedQueue_ClassElement.prototype.is$Iterable = function(){return this;}; 2290 DoubleLinkedQueue_ClassElement.prototype.assert$Iterable = function(){return thi s};
1903 // ********** Code for DoubleLinkedQueue_E ************** 2291 // ********** Code for DoubleLinkedQueue_E **************
1904 function DoubleLinkedQueue_E() {} 2292 function DoubleLinkedQueue_E() {}
1905 $inherits(DoubleLinkedQueue_E, DoubleLinkedQueue); 2293 $inherits(DoubleLinkedQueue_E, DoubleLinkedQueue);
1906 DoubleLinkedQueue_E.prototype.is$Collection_E = function(){return this;}; 2294 DoubleLinkedQueue_E.prototype.assert$Collection_E = function(){return this};
1907 DoubleLinkedQueue_E.prototype.is$Collection_Object = function(){return this;}; 2295 DoubleLinkedQueue_E.prototype.assert$Collection_Object = function(){return this} ;
1908 DoubleLinkedQueue_E.prototype.is$Collection_Type = function(){return this;}; 2296 DoubleLinkedQueue_E.prototype.assert$Collection_Type = function(){return this};
1909 DoubleLinkedQueue_E.prototype.is$Iterable = function(){return this;}; 2297 DoubleLinkedQueue_E.prototype.assert$Iterable = function(){return this};
1910 // ********** Code for DoubleLinkedQueue_Element ************** 2298 // ********** Code for DoubleLinkedQueue_Element **************
1911 function DoubleLinkedQueue_Element() {} 2299 function DoubleLinkedQueue_Element() {}
1912 $inherits(DoubleLinkedQueue_Element, DoubleLinkedQueue); 2300 $inherits(DoubleLinkedQueue_Element, DoubleLinkedQueue);
1913 DoubleLinkedQueue_Element.prototype.is$Collection_E = function(){return this;}; 2301 DoubleLinkedQueue_Element.prototype.assert$Collection_E = function(){return this };
1914 DoubleLinkedQueue_Element.prototype.is$Collection_Object = function(){return thi s;}; 2302 DoubleLinkedQueue_Element.prototype.assert$Collection_Object = function(){return this};
1915 DoubleLinkedQueue_Element.prototype.is$Collection_Type = false; 2303 DoubleLinkedQueue_Element.prototype.assert$Collection_Type = function(){$throw(n ew TypeError._internal$ctor(this, "Collection<Type>"))};
1916 DoubleLinkedQueue_Element.prototype.is$Iterable = function(){return this;}; 2304 DoubleLinkedQueue_Element.prototype.assert$Iterable = function(){return this};
1917 // ********** Code for DoubleLinkedQueue_KeyValuePair_K$V ************** 2305 // ********** Code for DoubleLinkedQueue_KeyValuePair_K$V **************
1918 function DoubleLinkedQueue_KeyValuePair_K$V() { 2306 function DoubleLinkedQueue_KeyValuePair_K$V() {
1919 // Initializers done 2307 // Initializers done
1920 this._sentinel = new _DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V(); 2308 this._sentinel = new _DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V();
1921 } 2309 }
1922 $inherits(DoubleLinkedQueue_KeyValuePair_K$V, DoubleLinkedQueue); 2310 $inherits(DoubleLinkedQueue_KeyValuePair_K$V, DoubleLinkedQueue);
1923 DoubleLinkedQueue_KeyValuePair_K$V.prototype.is$Collection_E = function(){return this;}; 2311 DoubleLinkedQueue_KeyValuePair_K$V.prototype.assert$Collection_E = function(){re turn this};
1924 DoubleLinkedQueue_KeyValuePair_K$V.prototype.is$Collection_Object = function(){r eturn this;}; 2312 DoubleLinkedQueue_KeyValuePair_K$V.prototype.assert$Collection_Object = function (){return this};
1925 DoubleLinkedQueue_KeyValuePair_K$V.prototype.is$Collection_Type = false; 2313 DoubleLinkedQueue_KeyValuePair_K$V.prototype.assert$Collection_Type = function() {$throw(new TypeError._internal$ctor(this, "Collection<Type>"))};
1926 DoubleLinkedQueue_KeyValuePair_K$V.prototype.is$Iterable = function(){return thi s;}; 2314 DoubleLinkedQueue_KeyValuePair_K$V.prototype.assert$Iterable = function(){return this};
1927 DoubleLinkedQueue_KeyValuePair_K$V.prototype.addLast = function(value) { 2315 DoubleLinkedQueue_KeyValuePair_K$V.prototype.addLast = function(value) {
1928 this._sentinel.prepend(value); 2316 this._sentinel.prepend(value);
1929 } 2317 }
1930 DoubleLinkedQueue_KeyValuePair_K$V.prototype.lastEntry = function() { 2318 DoubleLinkedQueue_KeyValuePair_K$V.prototype.lastEntry = function() {
1931 return this._sentinel.previousEntry(); 2319 return this._sentinel.previousEntry();
1932 } 2320 }
1933 DoubleLinkedQueue_KeyValuePair_K$V.prototype.forEach = function(f) { 2321 DoubleLinkedQueue_KeyValuePair_K$V.prototype.forEach = function(f) {
1934 var entry = this._sentinel._next; 2322 var entry = this._sentinel._next;
1935 while (entry !== this._sentinel) { 2323 while (entry !== this._sentinel) {
1936 var nextEntry = entry._next; 2324 var nextEntry = entry._next;
1937 f(entry._element); 2325 f(entry._element);
1938 entry = nextEntry; 2326 entry = nextEntry;
1939 } 2327 }
1940 } 2328 }
1941 // ********** Code for _DoubleLinkedQueueIterator ************** 2329 // ********** Code for _DoubleLinkedQueueIterator **************
1942 function _DoubleLinkedQueueIterator(_sentinel) { 2330 function _DoubleLinkedQueueIterator(_sentinel) {
1943 this._sentinel = _sentinel; 2331 this._sentinel = _sentinel;
1944 // Initializers done 2332 // Initializers done
1945 this._currentEntry = this._sentinel; 2333 this._currentEntry = this._sentinel;
1946 } 2334 }
1947 _DoubleLinkedQueueIterator.prototype.is$Iterator_T = function(){return this;}; 2335 _DoubleLinkedQueueIterator.prototype.assert$Iterator_T = function(){return this} ;
1948 _DoubleLinkedQueueIterator.prototype.hasNext = function() { 2336 _DoubleLinkedQueueIterator.prototype.hasNext = function() {
1949 return this._currentEntry._next !== this._sentinel; 2337 return this._currentEntry._next !== this._sentinel;
1950 } 2338 }
1951 _DoubleLinkedQueueIterator.prototype.next = function() { 2339 _DoubleLinkedQueueIterator.prototype.next = function() {
1952 if (!this.hasNext()) { 2340 if (!this.hasNext()) {
1953 $throw(const$0/*const NoMoreElementsException()*/); 2341 $throw(const$0/*const NoMoreElementsException()*/);
1954 } 2342 }
1955 this._currentEntry = this._currentEntry._next; 2343 this._currentEntry = this._currentEntry._next;
1956 return this._currentEntry.get$element(); 2344 return this._currentEntry.get$element();
1957 } 2345 }
1958 _DoubleLinkedQueueIterator.prototype.hasNext$0 = _DoubleLinkedQueueIterator.prot otype.hasNext; 2346 _DoubleLinkedQueueIterator.prototype.hasNext$0 = _DoubleLinkedQueueIterator.prot otype.hasNext;
1959 _DoubleLinkedQueueIterator.prototype.next$0 = _DoubleLinkedQueueIterator.prototy pe.next; 2347 _DoubleLinkedQueueIterator.prototype.next$0 = _DoubleLinkedQueueIterator.prototy pe.next;
1960 // ********** Code for _DoubleLinkedQueueIterator_E ************** 2348 // ********** Code for _DoubleLinkedQueueIterator_E **************
1961 function _DoubleLinkedQueueIterator_E(_sentinel) { 2349 function _DoubleLinkedQueueIterator_E(_sentinel) {
1962 this._sentinel = _sentinel; 2350 this._sentinel = _sentinel;
1963 // Initializers done 2351 // Initializers done
1964 this._currentEntry = this._sentinel; 2352 this._currentEntry = this._sentinel;
1965 } 2353 }
1966 $inherits(_DoubleLinkedQueueIterator_E, _DoubleLinkedQueueIterator); 2354 $inherits(_DoubleLinkedQueueIterator_E, _DoubleLinkedQueueIterator);
1967 _DoubleLinkedQueueIterator_E.prototype.is$Iterator_T = function(){return this;}; 2355 _DoubleLinkedQueueIterator_E.prototype.assert$Iterator_T = function(){return thi s};
1968 // ********** Code for StopwatchImplementation ************** 2356 // ********** Code for StopwatchImplementation **************
1969 function StopwatchImplementation() { 2357 function StopwatchImplementation() {
1970 this._start = null; 2358 this._start = null;
1971 this._stop = null; 2359 this._stop = null;
1972 // Initializers done 2360 // Initializers done
1973 } 2361 }
1974 StopwatchImplementation.prototype.start = function() { 2362 StopwatchImplementation.prototype.start = function() {
1975 if (this._start == null) { 2363 if (this._start == null) {
1976 this._start = Clock.now(); 2364 this._start = Clock.now();
1977 } 2365 }
(...skipping 24 matching lines...) Expand all
2002 } 2390 }
2003 StopwatchImplementation.prototype.frequency = function() { 2391 StopwatchImplementation.prototype.frequency = function() {
2004 return Clock.frequency(); 2392 return Clock.frequency();
2005 } 2393 }
2006 // ********** Code for StringBufferImpl ************** 2394 // ********** Code for StringBufferImpl **************
2007 function StringBufferImpl(content) { 2395 function StringBufferImpl(content) {
2008 // Initializers done 2396 // Initializers done
2009 this.clear(); 2397 this.clear();
2010 this.add(content); 2398 this.add(content);
2011 } 2399 }
2012 StringBufferImpl.prototype.is$StringBuffer = function(){return this;}; 2400 StringBufferImpl.prototype.assert$StringBuffer = function(){return this};
2013 StringBufferImpl.prototype.get$length = function() { 2401 StringBufferImpl.prototype.get$length = function() {
2014 return this._length; 2402 return this._length;
2015 } 2403 }
2016 Object.defineProperty(StringBufferImpl.prototype, "length", { 2404 Object.defineProperty(StringBufferImpl.prototype, "length", {
2017 get: StringBufferImpl.prototype.get$length 2405 get: StringBufferImpl.prototype.get$length
2018 }); 2406 });
2019 StringBufferImpl.prototype.isEmpty = function() { 2407 StringBufferImpl.prototype.isEmpty = function() {
2020 return this._length == 0; 2408 return this._length == 0;
2021 } 2409 }
2022 StringBufferImpl.prototype.add = function(obj) { 2410 StringBufferImpl.prototype.add = function(obj) {
(...skipping 18 matching lines...) Expand all
2041 StringBufferImpl.prototype.toString = function() { 2429 StringBufferImpl.prototype.toString = function() {
2042 if (this._buffer.length == 0) return ""; 2430 if (this._buffer.length == 0) return "";
2043 if (this._buffer.length == 1) return $assert_String(this._buffer.$index(0)); 2431 if (this._buffer.length == 1) return $assert_String(this._buffer.$index(0));
2044 var result = StringBase.concatAll(this._buffer); 2432 var result = StringBase.concatAll(this._buffer);
2045 this._buffer.clear(); 2433 this._buffer.clear();
2046 this._buffer.add(result); 2434 this._buffer.add(result);
2047 return result; 2435 return result;
2048 } 2436 }
2049 StringBufferImpl.prototype.add$1 = StringBufferImpl.prototype.add; 2437 StringBufferImpl.prototype.add$1 = StringBufferImpl.prototype.add;
2050 StringBufferImpl.prototype.addAll$1 = function($0) { 2438 StringBufferImpl.prototype.addAll$1 = function($0) {
2051 return this.addAll(($0 && $0.is$Collection_Object())); 2439 return this.addAll(($0 == null ? null : $0.assert$Collection_Object()));
2052 }; 2440 };
2053 StringBufferImpl.prototype.isEmpty$0 = StringBufferImpl.prototype.isEmpty; 2441 StringBufferImpl.prototype.isEmpty$0 = StringBufferImpl.prototype.isEmpty;
2054 StringBufferImpl.prototype.toString$0 = StringBufferImpl.prototype.toString; 2442 StringBufferImpl.prototype.toString$0 = StringBufferImpl.prototype.toString;
2055 // ********** Code for StringBase ************** 2443 // ********** Code for StringBase **************
2056 function StringBase() {} 2444 function StringBase() {}
2057 StringBase.createFromCharCodes = function(charCodes) { 2445 StringBase.createFromCharCodes = function(charCodes) {
2058 if (Object.getPrototypeOf(charCodes) !== Array.prototype) { 2446 if (Object.getPrototypeOf(charCodes) !== Array.prototype) {
2059 charCodes = new ListFactory.ListFactory$from$factory(charCodes); 2447 charCodes = new ListFactory.ListFactory$from$factory(charCodes);
2060 } 2448 }
2061 return String.fromCharCode.apply(null, charCodes); 2449 return String.fromCharCode.apply(null, charCodes);
2062 } 2450 }
2063 StringBase.join = function(strings, separator) { 2451 StringBase.join = function(strings, separator) {
2064 if (strings.length == 0) return ''; 2452 if (strings.length == 0) return '';
2065 var s = $assert_String(strings.$index(0)); 2453 var s = $assert_String(strings.$index(0));
2066 for (var i = 1; 2454 for (var i = 1;
2067 i < strings.length; i++) { 2455 i < strings.length; i++) {
2068 s = s + separator + strings.$index(i); 2456 s = s + separator + strings.$index(i);
2069 } 2457 }
2070 return s; 2458 return s;
2071 } 2459 }
2072 StringBase.concatAll = function(strings) { 2460 StringBase.concatAll = function(strings) {
2073 return StringBase.join(strings, ""); 2461 return StringBase.join(strings, "");
2074 } 2462 }
2075 // ********** Code for StringImplementation ************** 2463 // ********** Code for StringImplementation **************
2076 StringImplementation = String; 2464 StringImplementation = String;
2077 StringImplementation.prototype.is$Pattern = function(){return this;}; 2465 StringImplementation.prototype.assert$Pattern = function(){return this};
2078 StringImplementation.prototype.is$Comparable = function(){return this;}; 2466 StringImplementation.prototype.assert$Comparable = function(){return this};
2079 StringImplementation.prototype.endsWith = function(other) { 2467 StringImplementation.prototype.endsWith = function(other) {
2080 if (other.length > this.length) return false; 2468 if (other.length > this.length) return false;
2081 return other == this.substring(this.length - other.length); 2469 return other == this.substring(this.length - other.length);
2082 } 2470 }
2083 StringImplementation.prototype.startsWith = function(other) { 2471 StringImplementation.prototype.startsWith = function(other) {
2084 if (other.length > this.length) return false; 2472 if (other.length > this.length) return false;
2085 return other == this.substring(0, other.length); 2473 return other == this.substring(0, other.length);
2086 } 2474 }
2087 StringImplementation.prototype.isEmpty = function() { 2475 StringImplementation.prototype.isEmpty = function() {
2088 return this.length == 0; 2476 return this.length == 0;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2126 }; 2514 };
2127 StringImplementation.prototype.endsWith$1 = function($0) { 2515 StringImplementation.prototype.endsWith$1 = function($0) {
2128 return this.endsWith($assert_String($0)); 2516 return this.endsWith($assert_String($0));
2129 }; 2517 };
2130 StringImplementation.prototype.hashCode$0 = StringImplementation.prototype.hashC ode; 2518 StringImplementation.prototype.hashCode$0 = StringImplementation.prototype.hashC ode;
2131 StringImplementation.prototype.indexOf$2 = function($0, $1) { 2519 StringImplementation.prototype.indexOf$2 = function($0, $1) {
2132 return this.indexOf($assert_String($0), $assert_num($1)); 2520 return this.indexOf($assert_String($0), $assert_num($1));
2133 }; 2521 };
2134 StringImplementation.prototype.isEmpty$0 = StringImplementation.prototype.isEmpt y; 2522 StringImplementation.prototype.isEmpty$0 = StringImplementation.prototype.isEmpt y;
2135 StringImplementation.prototype.replaceAll$2 = function($0, $1) { 2523 StringImplementation.prototype.replaceAll$2 = function($0, $1) {
2136 return this.replaceAll(($0 && $0.is$Pattern()), $assert_String($1)); 2524 return this.replaceAll(($0 == null ? null : $0.assert$Pattern()), $assert_Stri ng($1));
2137 }; 2525 };
2138 StringImplementation.prototype.replaceFirst$2 = function($0, $1) { 2526 StringImplementation.prototype.replaceFirst$2 = function($0, $1) {
2139 return this.replaceFirst(($0 && $0.is$Pattern()), $assert_String($1)); 2527 return this.replaceFirst(($0 == null ? null : $0.assert$Pattern()), $assert_St ring($1));
2140 }; 2528 };
2141 StringImplementation.prototype.startsWith$1 = function($0) { 2529 StringImplementation.prototype.startsWith$1 = function($0) {
2142 return this.startsWith($assert_String($0)); 2530 return this.startsWith($assert_String($0));
2143 }; 2531 };
2144 StringImplementation.prototype.substring$1 = function($0) { 2532 StringImplementation.prototype.substring$1 = function($0) {
2145 return this.substring($assert_num($0)); 2533 return this.substring($assert_num($0));
2146 }; 2534 };
2147 StringImplementation.prototype.substring$2 = function($0, $1) { 2535 StringImplementation.prototype.substring$2 = function($0, $1) {
2148 return this.substring($assert_num($0), $assert_num($1)); 2536 return this.substring($assert_num($0), $assert_num($1));
2149 }; 2537 };
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
2184 // Initializers done 2572 // Initializers done
2185 } 2573 }
2186 DateImplementation.fromEpoch$ctor.prototype = DateImplementation.prototype; 2574 DateImplementation.fromEpoch$ctor.prototype = DateImplementation.prototype;
2187 DateImplementation.now$ctor = function() { 2575 DateImplementation.now$ctor = function() {
2188 this.timeZone = new TimeZoneImplementation.local$ctor(); 2576 this.timeZone = new TimeZoneImplementation.local$ctor();
2189 this.value = DateImplementation._now(); 2577 this.value = DateImplementation._now();
2190 // Initializers done 2578 // Initializers done
2191 this._asJs(); 2579 this._asJs();
2192 } 2580 }
2193 DateImplementation.now$ctor.prototype = DateImplementation.prototype; 2581 DateImplementation.now$ctor.prototype = DateImplementation.prototype;
2194 DateImplementation.prototype.is$Date = function(){return this;}; 2582 DateImplementation.prototype.assert$Date = function(){return this};
2195 DateImplementation.prototype.is$Comparable = function(){return this;}; 2583 DateImplementation.prototype.assert$Comparable = function(){return this};
2196 DateImplementation.prototype.get$value = function() { return this.value; }; 2584 DateImplementation.prototype.get$value = function() { return this.value; };
2197 DateImplementation.prototype.get$timeZone = function() { return this.timeZone; } ; 2585 DateImplementation.prototype.get$timeZone = function() { return this.timeZone; } ;
2198 DateImplementation.prototype.$eq = function(other) { 2586 DateImplementation.prototype.$eq = function(other) {
2199 if (!((other instanceof DateImplementation))) return false; 2587 if (!((other instanceof DateImplementation))) return false;
2200 return (this.value == other.get$value()) && ($eq(this.timeZone, other.get$time Zone())); 2588 return (this.value == other.get$value()) && ($eq(this.timeZone, other.get$time Zone()));
2201 } 2589 }
2202 DateImplementation.prototype.compareTo = function(other) { 2590 DateImplementation.prototype.compareTo = function(other) {
2203 var $0; 2591 var $0;
2204 return $assert_num(this.value.compareTo$1(other.value)); 2592 return $assert_num(this.value.compareTo$1(other.value));
2205 } 2593 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
2256 DateImplementation._now = function() { 2644 DateImplementation._now = function() {
2257 return new Date().valueOf(); 2645 return new Date().valueOf();
2258 } 2646 }
2259 DateImplementation.prototype._asJs = function() { 2647 DateImplementation.prototype._asJs = function() {
2260 if (!this.date) { 2648 if (!this.date) {
2261 this.date = new Date(this.value); 2649 this.date = new Date(this.value);
2262 } 2650 }
2263 return this.date; 2651 return this.date;
2264 } 2652 }
2265 DateImplementation.prototype.add$1 = function($0) { 2653 DateImplementation.prototype.add$1 = function($0) {
2266 return this.add(($0 && $0.is$Duration())); 2654 return this.add(($0 == null ? null : $0.assert$Duration()));
2267 }; 2655 };
2268 DateImplementation.prototype.compareTo$1 = function($0) { 2656 DateImplementation.prototype.compareTo$1 = function($0) {
2269 return this.compareTo(($0 && $0.is$Date())); 2657 return this.compareTo(($0 == null ? null : $0.assert$Date()));
2270 }; 2658 };
2271 DateImplementation.prototype.toString$0 = DateImplementation.prototype.toString; 2659 DateImplementation.prototype.toString$0 = DateImplementation.prototype.toString;
2272 // ********** Code for TimeZoneImplementation ************** 2660 // ********** Code for TimeZoneImplementation **************
2273 function TimeZoneImplementation() {} 2661 function TimeZoneImplementation() {}
2274 TimeZoneImplementation.local$ctor = function() { 2662 TimeZoneImplementation.local$ctor = function() {
2275 this.isUtc = false; 2663 this.isUtc = false;
2276 // Initializers done 2664 // Initializers done
2277 } 2665 }
2278 TimeZoneImplementation.local$ctor.prototype = TimeZoneImplementation.prototype; 2666 TimeZoneImplementation.local$ctor.prototype = TimeZoneImplementation.prototype;
2279 TimeZoneImplementation.prototype.$eq = function(other) { 2667 TimeZoneImplementation.prototype.$eq = function(other) {
(...skipping 30 matching lines...) Expand all
2310 if ($notnull_bool($eq(piece, '..')) && pieces.length > 0 && $notnull_bool($n e(pieces.last$0(), '.')) && $notnull_bool($ne(pieces.last$0(), '..'))) { 2698 if ($notnull_bool($eq(piece, '..')) && pieces.length > 0 && $notnull_bool($n e(pieces.last$0(), '.')) && $notnull_bool($ne(pieces.last$0(), '..'))) {
2311 pieces.removeLast$0(); 2699 pieces.removeLast$0();
2312 } 2700 }
2313 else if ($notnull_bool($ne(piece, ''))) { 2701 else if ($notnull_bool($ne(piece, ''))) {
2314 if (pieces.length > 0 && $notnull_bool($eq(pieces.last$0(), '.'))) { 2702 if (pieces.length > 0 && $notnull_bool($eq(pieces.last$0(), '.'))) {
2315 pieces.removeLast$0(); 2703 pieces.removeLast$0();
2316 } 2704 }
2317 pieces.add$1(piece); 2705 pieces.add$1(piece);
2318 } 2706 }
2319 } 2707 }
2320 return Strings.join((pieces && pieces.is$List_String()), '/'); 2708 return Strings.join((pieces == null ? null : pieces.assert$List_String()), '/' );
2321 } 2709 }
2322 function dirname(path) { 2710 function dirname(path) {
2323 var lastSlash = path.lastIndexOf('/', path.length); 2711 var lastSlash = path.lastIndexOf('/', path.length);
2324 if (lastSlash == -1) { 2712 if (lastSlash == -1) {
2325 return '.'; 2713 return '.';
2326 } 2714 }
2327 else { 2715 else {
2328 return path.substring(0, lastSlash); 2716 return path.substring(0, lastSlash);
2329 } 2717 }
2330 } 2718 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2363 LinkFactory.Link$factory = function(head, tail) { 2751 LinkFactory.Link$factory = function(head, tail) {
2364 if (tail == null) { 2752 if (tail == null) {
2365 tail = new LinkTail_T(); 2753 tail = new LinkTail_T();
2366 } 2754 }
2367 return new LinkEntry_T(head, tail); 2755 return new LinkEntry_T(head, tail);
2368 } 2756 }
2369 // ********** Code for LinkTail ************** 2757 // ********** Code for LinkTail **************
2370 function LinkTail() { 2758 function LinkTail() {
2371 // Initializers done 2759 // Initializers done
2372 } 2760 }
2373 LinkTail.prototype.is$Link_Element = function(){return this;}; 2761 LinkTail.prototype.assert$Link_Element = function(){return this};
2374 LinkTail.prototype.is$Link_Node = function(){return this;}; 2762 LinkTail.prototype.assert$Link_Node = function(){return this};
2375 LinkTail.prototype.is$Link_Token = function(){return this;}; 2763 LinkTail.prototype.assert$Link_Token = function(){return this};
2376 LinkTail.prototype.is$Link_Type = function(){return this;}; 2764 LinkTail.prototype.assert$Link_Type = function(){return this};
2377 LinkTail.prototype.is$Iterable = function(){return this;}; 2765 LinkTail.prototype.assert$Iterable = function(){return this};
2378 LinkTail.prototype.get$head = function() { 2766 LinkTail.prototype.get$head = function() {
2379 return null; 2767 return null;
2380 } 2768 }
2381 LinkTail.prototype.get$tail = function() { 2769 LinkTail.prototype.get$tail = function() {
2382 return null; 2770 return null;
2383 } 2771 }
2384 LinkTail.prototype.prepend = function(element) { 2772 LinkTail.prototype.prepend = function(element) {
2385 return new LinkEntry_T(element, this); 2773 return new LinkEntry_T(element, this);
2386 } 2774 }
2387 LinkTail.prototype.iterator = function() { 2775 LinkTail.prototype.iterator = function() {
2388 return this.toList().iterator(); 2776 return this.toList().iterator();
2389 } 2777 }
2390 LinkTail.prototype.printOn = function(buffer, separatedBy) { 2778 LinkTail.prototype.printOn = function(buffer, separatedBy) {
2391 2779
2392 } 2780 }
2393 LinkTail.prototype.toString = function() { 2781 LinkTail.prototype.toString = function() {
2394 return "[]"; 2782 return "[]";
2395 } 2783 }
2396 LinkTail.prototype.toList = function() { 2784 LinkTail.prototype.toList = function() {
2397 return const$21/*const []*/; 2785 return const$21/*const []*/;
2398 } 2786 }
2399 LinkTail.prototype.isEmpty = function() { 2787 LinkTail.prototype.isEmpty = function() {
2400 return true; 2788 return true;
2401 } 2789 }
2402 LinkTail.prototype.isEmpty$0 = LinkTail.prototype.isEmpty; 2790 LinkTail.prototype.isEmpty$0 = LinkTail.prototype.isEmpty;
2403 LinkTail.prototype.iterator$0 = LinkTail.prototype.iterator; 2791 LinkTail.prototype.iterator$0 = LinkTail.prototype.iterator;
2404 LinkTail.prototype.printOn$1 = function($0) { 2792 LinkTail.prototype.printOn$1 = function($0) {
2405 return this.printOn(($0 && $0.is$StringBuffer())); 2793 return this.printOn(($0 == null ? null : $0.assert$StringBuffer()));
2406 }; 2794 };
2407 LinkTail.prototype.toString$0 = LinkTail.prototype.toString; 2795 LinkTail.prototype.toString$0 = LinkTail.prototype.toString;
2408 // ********** Code for LinkTail_Element ************** 2796 // ********** Code for LinkTail_Element **************
2409 function LinkTail_Element() {} 2797 function LinkTail_Element() {}
2410 $inherits(LinkTail_Element, LinkTail); 2798 $inherits(LinkTail_Element, LinkTail);
2411 LinkTail_Element.prototype.is$Link_Element = function(){return this;}; 2799 LinkTail_Element.prototype.assert$Link_Element = function(){return this};
2412 LinkTail_Element.prototype.is$Link_Node = false; 2800 LinkTail_Element.prototype.assert$Link_Node = function(){$throw(new TypeError._i nternal$ctor(this, "Link<Node>"))};
2413 LinkTail_Element.prototype.is$Link_Token = false; 2801 LinkTail_Element.prototype.assert$Link_Token = function(){$throw(new TypeError._ internal$ctor(this, "Link<Token>"))};
2414 LinkTail_Element.prototype.is$Link_Type = false; 2802 LinkTail_Element.prototype.assert$Link_Type = function(){$throw(new TypeError._i nternal$ctor(this, "Link<Type>"))};
2415 LinkTail_Element.prototype.is$Iterable = function(){return this;}; 2803 LinkTail_Element.prototype.assert$Iterable = function(){return this};
2416 // ********** Code for LinkTail_Node ************** 2804 // ********** Code for LinkTail_Node **************
2417 function LinkTail_Node() {} 2805 function LinkTail_Node() {}
2418 $inherits(LinkTail_Node, LinkTail); 2806 $inherits(LinkTail_Node, LinkTail);
2419 LinkTail_Node.prototype.is$Link_Element = false; 2807 LinkTail_Node.prototype.assert$Link_Element = function(){$throw(new TypeError._i nternal$ctor(this, "Link<Element>"))};
2420 LinkTail_Node.prototype.is$Link_Node = function(){return this;}; 2808 LinkTail_Node.prototype.assert$Link_Node = function(){return this};
2421 LinkTail_Node.prototype.is$Link_Token = false; 2809 LinkTail_Node.prototype.assert$Link_Token = function(){$throw(new TypeError._int ernal$ctor(this, "Link<Token>"))};
2422 LinkTail_Node.prototype.is$Link_Type = false; 2810 LinkTail_Node.prototype.assert$Link_Type = function(){$throw(new TypeError._inte rnal$ctor(this, "Link<Type>"))};
2423 LinkTail_Node.prototype.is$Iterable = function(){return this;}; 2811 LinkTail_Node.prototype.assert$Iterable = function(){return this};
2424 // ********** Code for LinkTail_T ************** 2812 // ********** Code for LinkTail_T **************
2425 function LinkTail_T() { 2813 function LinkTail_T() {
2426 // Initializers done 2814 // Initializers done
2427 } 2815 }
2428 $inherits(LinkTail_T, LinkTail); 2816 $inherits(LinkTail_T, LinkTail);
2429 LinkTail_T.prototype.is$Link_Element = function(){return this;}; 2817 LinkTail_T.prototype.assert$Link_Element = function(){return this};
2430 LinkTail_T.prototype.is$Link_Node = function(){return this;}; 2818 LinkTail_T.prototype.assert$Link_Node = function(){return this};
2431 LinkTail_T.prototype.is$Link_Token = function(){return this;}; 2819 LinkTail_T.prototype.assert$Link_Token = function(){return this};
2432 LinkTail_T.prototype.is$Link_Type = function(){return this;}; 2820 LinkTail_T.prototype.assert$Link_Type = function(){return this};
2433 LinkTail_T.prototype.is$Iterable = function(){return this;}; 2821 LinkTail_T.prototype.assert$Iterable = function(){return this};
2434 // ********** Code for LinkTail_Token ************** 2822 // ********** Code for LinkTail_Token **************
2435 function LinkTail_Token() {} 2823 function LinkTail_Token() {}
2436 $inherits(LinkTail_Token, LinkTail); 2824 $inherits(LinkTail_Token, LinkTail);
2437 LinkTail_Token.prototype.is$Link_Element = false; 2825 LinkTail_Token.prototype.assert$Link_Element = function(){$throw(new TypeError._ internal$ctor(this, "Link<Element>"))};
2438 LinkTail_Token.prototype.is$Link_Node = false; 2826 LinkTail_Token.prototype.assert$Link_Node = function(){$throw(new TypeError._int ernal$ctor(this, "Link<Node>"))};
2439 LinkTail_Token.prototype.is$Link_Token = function(){return this;}; 2827 LinkTail_Token.prototype.assert$Link_Token = function(){return this};
2440 LinkTail_Token.prototype.is$Link_Type = false; 2828 LinkTail_Token.prototype.assert$Link_Type = function(){$throw(new TypeError._int ernal$ctor(this, "Link<Type>"))};
2441 LinkTail_Token.prototype.is$Iterable = function(){return this;}; 2829 LinkTail_Token.prototype.assert$Iterable = function(){return this};
2442 // ********** Code for LinkTail_Type ************** 2830 // ********** Code for LinkTail_Type **************
2443 function LinkTail_Type() {} 2831 function LinkTail_Type() {}
2444 $inherits(LinkTail_Type, LinkTail); 2832 $inherits(LinkTail_Type, LinkTail);
2445 LinkTail_Type.prototype.is$Link_Element = false; 2833 LinkTail_Type.prototype.assert$Link_Element = function(){$throw(new TypeError._i nternal$ctor(this, "Link<Element>"))};
2446 LinkTail_Type.prototype.is$Link_Node = false; 2834 LinkTail_Type.prototype.assert$Link_Node = function(){$throw(new TypeError._inte rnal$ctor(this, "Link<Node>"))};
2447 LinkTail_Type.prototype.is$Link_Token = false; 2835 LinkTail_Type.prototype.assert$Link_Token = function(){$throw(new TypeError._int ernal$ctor(this, "Link<Token>"))};
2448 LinkTail_Type.prototype.is$Link_Type = function(){return this;}; 2836 LinkTail_Type.prototype.assert$Link_Type = function(){return this};
2449 LinkTail_Type.prototype.is$Iterable = function(){return this;}; 2837 LinkTail_Type.prototype.assert$Iterable = function(){return this};
2450 // ********** Code for LinkEntry ************** 2838 // ********** Code for LinkEntry **************
2451 function LinkEntry(head, tail) { 2839 function LinkEntry(head, tail) {
2452 this.head = head; 2840 this.head = head;
2453 this.tail = tail; 2841 this.tail = tail;
2454 // Initializers done 2842 // Initializers done
2455 } 2843 }
2456 LinkEntry.prototype.is$Link_Element = function(){return this;}; 2844 LinkEntry.prototype.assert$Link_Element = function(){return this};
2457 LinkEntry.prototype.is$Link_Node = function(){return this;}; 2845 LinkEntry.prototype.assert$Link_Node = function(){return this};
2458 LinkEntry.prototype.is$Link_Token = function(){return this;}; 2846 LinkEntry.prototype.assert$Link_Token = function(){return this};
2459 LinkEntry.prototype.is$Link_Type = function(){return this;}; 2847 LinkEntry.prototype.assert$Link_Type = function(){return this};
2460 LinkEntry.prototype.is$Iterable = function(){return this;}; 2848 LinkEntry.prototype.assert$Iterable = function(){return this};
2461 LinkEntry.prototype.get$head = function() { return this.head; }; 2849 LinkEntry.prototype.get$head = function() { return this.head; };
2462 LinkEntry.prototype.get$tail = function() { return this.tail; }; 2850 LinkEntry.prototype.get$tail = function() { return this.tail; };
2463 LinkEntry.prototype.set$tail = function(value) { return this.tail = value; }; 2851 LinkEntry.prototype.set$tail = function(value) { return this.tail = value; };
2464 LinkEntry.prototype.prepend = function(element) { 2852 LinkEntry.prototype.prepend = function(element) {
2465 return new LinkEntry_T(element, this); 2853 return new LinkEntry_T(element, this);
2466 } 2854 }
2467 LinkEntry.prototype.iterator = function() { 2855 LinkEntry.prototype.iterator = function() {
2468 var $0; 2856 var $0;
2469 return (($0 = this.toList().iterator()) && $0.is$Iterator_T()); 2857 return (($0 = this.toList().iterator()) == null ? null : $0.assert$Iterator_T( ));
2470 } 2858 }
2471 LinkEntry.prototype.printOn = function(buffer, separatedBy) { 2859 LinkEntry.prototype.printOn = function(buffer, separatedBy) {
2472 buffer.add(this.head == null ? 'null' : this.head); 2860 buffer.add(this.head == null ? 'null' : this.head);
2473 if (separatedBy == null) separatedBy = ''; 2861 if (separatedBy == null) separatedBy = '';
2474 for (var link = this.tail; 2862 for (var link = this.tail;
2475 !$notnull_bool(link.isEmpty()); link = link.get$tail()) { 2863 !$notnull_bool(link.isEmpty()); link = link.get$tail()) {
2476 buffer.add(separatedBy); 2864 buffer.add(separatedBy);
2477 buffer.add(link.get$head() == null ? 'null' : link.get$head()); 2865 buffer.add(link.get$head() == null ? 'null' : link.get$head());
2478 } 2866 }
2479 } 2867 }
(...skipping 11 matching lines...) Expand all
2491 var list = new ListFactory(); 2879 var list = new ListFactory();
2492 for (var link = this; 2880 for (var link = this;
2493 !$notnull_bool(link.isEmpty()); link = link.get$tail()) { 2881 !$notnull_bool(link.isEmpty()); link = link.get$tail()) {
2494 list.addLast(link.get$head()); 2882 list.addLast(link.get$head());
2495 } 2883 }
2496 return list; 2884 return list;
2497 } 2885 }
2498 LinkEntry.prototype.isEmpty$0 = LinkEntry.prototype.isEmpty; 2886 LinkEntry.prototype.isEmpty$0 = LinkEntry.prototype.isEmpty;
2499 LinkEntry.prototype.iterator$0 = LinkEntry.prototype.iterator; 2887 LinkEntry.prototype.iterator$0 = LinkEntry.prototype.iterator;
2500 LinkEntry.prototype.printOn$1 = function($0) { 2888 LinkEntry.prototype.printOn$1 = function($0) {
2501 return this.printOn(($0 && $0.is$StringBuffer())); 2889 return this.printOn(($0 == null ? null : $0.assert$StringBuffer()));
2502 }; 2890 };
2503 LinkEntry.prototype.toString$0 = LinkEntry.prototype.toString; 2891 LinkEntry.prototype.toString$0 = LinkEntry.prototype.toString;
2504 // ********** Code for LinkEntry_T ************** 2892 // ********** Code for LinkEntry_T **************
2505 function LinkEntry_T(head, tail) { 2893 function LinkEntry_T(head, tail) {
2506 this.head = head; 2894 this.head = head;
2507 this.tail = tail; 2895 this.tail = tail;
2508 // Initializers done 2896 // Initializers done
2509 } 2897 }
2510 $inherits(LinkEntry_T, LinkEntry); 2898 $inherits(LinkEntry_T, LinkEntry);
2511 LinkEntry_T.prototype.is$Link_Element = function(){return this;}; 2899 LinkEntry_T.prototype.assert$Link_Element = function(){return this};
2512 LinkEntry_T.prototype.is$Link_Node = function(){return this;}; 2900 LinkEntry_T.prototype.assert$Link_Node = function(){return this};
2513 LinkEntry_T.prototype.is$Link_Token = function(){return this;}; 2901 LinkEntry_T.prototype.assert$Link_Token = function(){return this};
2514 LinkEntry_T.prototype.is$Link_Type = function(){return this;}; 2902 LinkEntry_T.prototype.assert$Link_Type = function(){return this};
2515 LinkEntry_T.prototype.is$Iterable = function(){return this;}; 2903 LinkEntry_T.prototype.assert$Iterable = function(){return this};
2516 // ********** Code for LinkBuilderImplementation ************** 2904 // ********** Code for LinkBuilderImplementation **************
2517 function LinkBuilderImplementation() { 2905 function LinkBuilderImplementation() {
2518 this.head = null 2906 this.head = null
2519 this.lastLink = null 2907 this.lastLink = null
2520 // Initializers done 2908 // Initializers done
2521 } 2909 }
2522 LinkBuilderImplementation.prototype.get$head = function() { return this.head; }; 2910 LinkBuilderImplementation.prototype.get$head = function() { return this.head; };
2523 LinkBuilderImplementation.prototype.set$head = function(value) { return this.hea d = value; }; 2911 LinkBuilderImplementation.prototype.set$head = function(value) { return this.hea d = value; };
2524 LinkBuilderImplementation.prototype.toLink = function() { 2912 LinkBuilderImplementation.prototype.toLink = function() {
2525 if (this.head == null) return const$236/*const LinkTail()*/; 2913 if (this.head == null) return const$236/*const LinkTail()*/;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
2608 } 2996 }
2609 ArrayBasedScanner.prototype.appendWhiteSpace = function(next) { 2997 ArrayBasedScanner.prototype.appendWhiteSpace = function(next) {
2610 2998
2611 } 2999 }
2612 ArrayBasedScanner.prototype.appendBeginGroup = function(kind, value) { 3000 ArrayBasedScanner.prototype.appendBeginGroup = function(kind, value) {
2613 var $0; 3001 var $0;
2614 var token = new BeginGroupToken(kind, value, this.tokenStart); 3002 var token = new BeginGroupToken(kind, value, this.tokenStart);
2615 this.tail.next = token; 3003 this.tail.next = token;
2616 this.tail = this.tail.next; 3004 this.tail = this.tail.next;
2617 while (kind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.isEmp ty()) && this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { 3005 while (kind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.isEmp ty()) && this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) {
2618 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Tok en()); 3006 this.groupingStack = (($0 = this.groupingStack.get$tail()) == null ? null : $0.assert$Link_Token());
2619 } 3007 }
2620 this.groupingStack = (($0 = this.groupingStack.prepend(token)) && $0.is$Link_T oken()); 3008 this.groupingStack = (($0 = this.groupingStack.prepend(token)) == null ? null : $0.assert$Link_Token());
2621 } 3009 }
2622 ArrayBasedScanner.prototype.appendEndGroup = function(kind, value, openKind) { 3010 ArrayBasedScanner.prototype.appendEndGroup = function(kind, value, openKind) {
2623 var $0; 3011 var $0;
2624 var oldTail = this.tail; 3012 var oldTail = this.tail;
2625 this.appendStringToken(kind, value); 3013 this.appendStringToken(kind, value);
2626 if ($notnull_bool(this.groupingStack.isEmpty())) { 3014 if ($notnull_bool(this.groupingStack.isEmpty())) {
2627 if (openKind === 60/*null.LT_TOKEN*/) return; 3015 if (openKind === 60/*null.LT_TOKEN*/) return;
2628 $throw(new MalformedInputException(('Unmatched ' + value))); 3016 $throw(new MalformedInputException(('Unmatched ' + value)));
2629 } 3017 }
2630 while (openKind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.i sEmpty()) && this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { 3018 while (openKind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.i sEmpty()) && this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) {
2631 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Tok en()); 3019 this.groupingStack = (($0 = this.groupingStack.get$tail()) == null ? null : $0.assert$Link_Token());
2632 } 3020 }
2633 if (this.groupingStack.get$head().get$kind() !== openKind) { 3021 if (this.groupingStack.get$head().get$kind() !== openKind) {
2634 if (openKind === 60/*null.LT_TOKEN*/) return; 3022 if (openKind === 60/*null.LT_TOKEN*/) return;
2635 $throw(new MalformedInputException(('Unmatched ' + value))); 3023 $throw(new MalformedInputException(('Unmatched ' + value)));
2636 } 3024 }
2637 this.groupingStack.get$head().set$endGroup(oldTail.next); 3025 this.groupingStack.get$head().set$endGroup(oldTail.next);
2638 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Token ()); 3026 this.groupingStack = (($0 = this.groupingStack.get$tail()) == null ? null : $0 .assert$Link_Token());
2639 } 3027 }
2640 ArrayBasedScanner.prototype.appendGtGt = function(kind, value) { 3028 ArrayBasedScanner.prototype.appendGtGt = function(kind, value) {
2641 var $0; 3029 var $0;
2642 var oldTail = this.tail; 3030 var oldTail = this.tail;
2643 this.appendStringToken(kind, value); 3031 this.appendStringToken(kind, value);
2644 if ($notnull_bool(this.groupingStack.isEmpty())) return; 3032 if ($notnull_bool(this.groupingStack.isEmpty())) return;
2645 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { 3033 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) {
2646 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Tok en()); 3034 this.groupingStack = (($0 = this.groupingStack.get$tail()) == null ? null : $0.assert$Link_Token());
2647 } 3035 }
2648 if ($notnull_bool(this.groupingStack.isEmpty())) return; 3036 if ($notnull_bool(this.groupingStack.isEmpty())) return;
2649 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { 3037 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) {
2650 this.groupingStack.get$head().set$endGroup(oldTail.next); 3038 this.groupingStack.get$head().set$endGroup(oldTail.next);
2651 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Tok en()); 3039 this.groupingStack = (($0 = this.groupingStack.get$tail()) == null ? null : $0.assert$Link_Token());
2652 } 3040 }
2653 } 3041 }
2654 ArrayBasedScanner.prototype.appendGtGtGt = function(kind, value) { 3042 ArrayBasedScanner.prototype.appendGtGtGt = function(kind, value) {
2655 var $0; 3043 var $0;
2656 var oldTail = this.tail; 3044 var oldTail = this.tail;
2657 this.appendStringToken(kind, value); 3045 this.appendStringToken(kind, value);
2658 if ($notnull_bool(this.groupingStack.isEmpty())) return; 3046 if ($notnull_bool(this.groupingStack.isEmpty())) return;
2659 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { 3047 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) {
2660 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Tok en()); 3048 this.groupingStack = (($0 = this.groupingStack.get$tail()) == null ? null : $0.assert$Link_Token());
2661 } 3049 }
2662 if ($notnull_bool(this.groupingStack.isEmpty())) return; 3050 if ($notnull_bool(this.groupingStack.isEmpty())) return;
2663 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { 3051 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) {
2664 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Tok en()); 3052 this.groupingStack = (($0 = this.groupingStack.get$tail()) == null ? null : $0.assert$Link_Token());
2665 } 3053 }
2666 if ($notnull_bool(this.groupingStack.isEmpty())) return; 3054 if ($notnull_bool(this.groupingStack.isEmpty())) return;
2667 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { 3055 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) {
2668 this.groupingStack.get$head().set$endGroup(oldTail.next); 3056 this.groupingStack.get$head().set$endGroup(oldTail.next);
2669 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Tok en()); 3057 this.groupingStack = (($0 = this.groupingStack.get$tail()) == null ? null : $0.assert$Link_Token());
2670 } 3058 }
2671 } 3059 }
2672 // ********** Code for ArrayBasedScanner_SourceString ************** 3060 // ********** Code for ArrayBasedScanner_SourceString **************
2673 function ArrayBasedScanner_SourceString() { 3061 function ArrayBasedScanner_SourceString() {
2674 this.groupingStack = const$22/*const EmptyLink<Token>()*/ 3062 this.groupingStack = const$22/*const EmptyLink<Token>()*/
2675 this.extraCharOffset = 0; 3063 this.extraCharOffset = 0;
2676 this.tokenStart = -1; 3064 this.tokenStart = -1;
2677 this.byteOffset = -1; 3065 this.byteOffset = -1;
2678 this.tokens = new Token(0/*null.EOF_TOKEN*/, -1); 3066 this.tokens = new Token(0/*null.EOF_TOKEN*/, -1);
2679 // Initializers done 3067 // Initializers done
2680 AbstractScanner_SourceString.call(this); 3068 AbstractScanner_SourceString.call(this);
2681 this.tail = this.tokens; 3069 this.tail = this.tokens;
2682 } 3070 }
2683 $inherits(ArrayBasedScanner_SourceString, ArrayBasedScanner); 3071 $inherits(ArrayBasedScanner_SourceString, ArrayBasedScanner);
2684 // ********** Code for top level ************** 3072 // ********** Code for top level **************
2685 // ********** Library scanner ************** 3073 // ********** Library scanner **************
2686 // ********** Code for Keyword ************** 3074 // ********** Code for Keyword **************
2687 function Keyword(syntax, isPseudo) { 3075 function Keyword(syntax, isPseudo) {
2688 this.syntax = syntax; 3076 this.syntax = syntax;
2689 this.isPseudo = isPseudo; 3077 this.isPseudo = isPseudo;
2690 // Initializers done 3078 // Initializers done
2691 } 3079 }
2692 Keyword.prototype.is$SourceString = function(){return this;}; 3080 Keyword.prototype.is$SourceString = function(){return true};
3081 Keyword.prototype.assert$SourceString = function(){return this};
2693 Keyword.prototype.get$syntax = function() { return this.syntax; }; 3082 Keyword.prototype.get$syntax = function() { return this.syntax; };
2694 Keyword.prototype.get$isPseudo = function() { return this.isPseudo; }; 3083 Keyword.prototype.get$isPseudo = function() { return this.isPseudo; };
2695 Keyword.get$keywords = function() { 3084 Keyword.get$keywords = function() {
2696 if ($globals.Keyword__keywords == null) { 3085 if ($globals.Keyword__keywords == null) {
2697 $globals.Keyword__keywords = Keyword.computeKeywordMap(); 3086 $globals.Keyword__keywords = Keyword.computeKeywordMap();
2698 } 3087 }
2699 return $globals.Keyword__keywords; 3088 return $globals.Keyword__keywords;
2700 } 3089 }
2701 Keyword.computeKeywordMap = function() { 3090 Keyword.computeKeywordMap = function() {
2702 var result = new LinkedHashMapImplementation(); 3091 var result = new LinkedHashMapImplementation();
2703 for (var $i0 = const$119/*Keyword.values*/.iterator(); $i0.hasNext(); ) { 3092 for (var $i0 = const$119/*Keyword.values*/.iterator(); $i0.hasNext(); ) {
2704 var keyword = $i0.next(); 3093 var keyword = $i0.next();
2705 result.$setindex(keyword.syntax, keyword); 3094 result.$setindex(keyword.syntax, keyword);
2706 } 3095 }
2707 return result; 3096 return result;
2708 } 3097 }
2709 Keyword.prototype.hashCode = function() { 3098 Keyword.prototype.hashCode = function() {
2710 return this.syntax.hashCode(); 3099 return this.syntax.hashCode();
2711 } 3100 }
2712 Keyword.prototype.$eq = function(other) { 3101 Keyword.prototype.$eq = function(other) {
2713 return !!(other && other.is$SourceString) && this.toString() == other.toString $0(); 3102 return !!(other && other.is$SourceString()) && this.toString() == other.toStri ng$0();
2714 } 3103 }
2715 Keyword.prototype.printOn = function(sb) { 3104 Keyword.prototype.printOn = function(sb) {
2716 sb.add(this.syntax); 3105 sb.add(this.syntax);
2717 } 3106 }
2718 Keyword.prototype.toString = function() { 3107 Keyword.prototype.toString = function() {
2719 return this.syntax; 3108 return this.syntax;
2720 } 3109 }
2721 Keyword.prototype.get$stringValue = function() { 3110 Keyword.prototype.get$stringValue = function() {
2722 return this.syntax; 3111 return this.syntax;
2723 } 3112 }
2724 Keyword.prototype.hashCode$0 = Keyword.prototype.hashCode; 3113 Keyword.prototype.hashCode$0 = Keyword.prototype.hashCode;
2725 Keyword.prototype.printOn$1 = function($0) { 3114 Keyword.prototype.printOn$1 = function($0) {
2726 return this.printOn(($0 && $0.is$StringBuffer())); 3115 return this.printOn(($0 == null ? null : $0.assert$StringBuffer()));
2727 }; 3116 };
2728 Keyword.prototype.toString$0 = Keyword.prototype.toString; 3117 Keyword.prototype.toString$0 = Keyword.prototype.toString;
2729 // ********** Code for KeywordState ************** 3118 // ********** Code for KeywordState **************
2730 function KeywordState() { 3119 function KeywordState() {
2731 // Initializers done 3120 // Initializers done
2732 } 3121 }
2733 KeywordState.prototype.is$KeywordState = function(){return this;}; 3122 KeywordState.prototype.assert$KeywordState = function(){return this};
2734 KeywordState.get$KEYWORD_STATE = function() { 3123 KeywordState.get$KEYWORD_STATE = function() {
2735 if ($globals.KeywordState__KEYWORD_STATE == null) { 3124 if ($globals.KeywordState__KEYWORD_STATE == null) {
2736 var strings = new ListFactory(const$119/*Keyword.values*/.get$length()); 3125 var strings = new ListFactory(const$119/*Keyword.values*/.get$length());
2737 for (var i = 0; 3126 for (var i = 0;
2738 i < const$119/*Keyword.values*/.get$length(); i++) { 3127 i < const$119/*Keyword.values*/.get$length(); i++) {
2739 strings.$setindex(i, const$119/*Keyword.values*/[i].get$syntax()); 3128 strings.$setindex(i, const$119/*Keyword.values*/[i].get$syntax());
2740 } 3129 }
2741 strings.sort((function (a, b) { 3130 strings.sort((function (a, b) {
2742 return a.compareTo$1(b); 3131 return a.compareTo$1(b);
2743 }) 3132 })
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
2778 this.table = table; 3167 this.table = table;
2779 // Initializers done 3168 // Initializers done
2780 KeywordState.call(this); 3169 KeywordState.call(this);
2781 } 3170 }
2782 $inherits(ArrayKeywordState, KeywordState); 3171 $inherits(ArrayKeywordState, KeywordState);
2783 ArrayKeywordState.prototype.isLeaf = function() { 3172 ArrayKeywordState.prototype.isLeaf = function() {
2784 return false; 3173 return false;
2785 } 3174 }
2786 ArrayKeywordState.prototype.next = function(c) { 3175 ArrayKeywordState.prototype.next = function(c) {
2787 var $0; 3176 var $0;
2788 return (($0 = this.table.$index(c - 97/*null.$a*/)) && $0.is$KeywordState()); 3177 return (($0 = this.table.$index(c - 97/*null.$a*/)) == null ? null : $0.assert $KeywordState());
2789 } 3178 }
2790 ArrayKeywordState.prototype.get$keyword = function() { 3179 ArrayKeywordState.prototype.get$keyword = function() {
2791 $throw("should not be called"); 3180 $throw("should not be called");
2792 } 3181 }
2793 ArrayKeywordState.prototype.toString = function() { 3182 ArrayKeywordState.prototype.toString = function() {
2794 var sb = new StringBufferImpl(""); 3183 var sb = new StringBufferImpl("");
2795 sb.add("["); 3184 sb.add("[");
2796 var foo = this.table; 3185 var foo = this.table;
2797 for (var i = 0; 3186 for (var i = 0;
2798 i < foo.length; i++) { 3187 i < foo.length; i++) {
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
3108 } 3497 }
3109 $inherits(ElementListener, Listener); 3498 $inherits(ElementListener, Listener);
3110 ElementListener.prototype.get$nodes = function() { return this.nodes; }; 3499 ElementListener.prototype.get$nodes = function() { return this.nodes; };
3111 ElementListener.prototype.set$nodes = function(value) { return this.nodes = valu e; }; 3500 ElementListener.prototype.set$nodes = function(value) { return this.nodes = valu e; };
3112 ElementListener.prototype.beginLibraryTag = function(token) { 3501 ElementListener.prototype.beginLibraryTag = function(token) {
3113 this.canceler.cancel("Cannot handle library tags", null, token); 3502 this.canceler.cancel("Cannot handle library tags", null, token);
3114 } 3503 }
3115 ElementListener.prototype.endClassDeclaration = function(interfacesCount, beginT oken, extendsKeyword, implementsKeyword, endToken) { 3504 ElementListener.prototype.endClassDeclaration = function(interfacesCount, beginT oken, extendsKeyword, implementsKeyword, endToken) {
3116 var $0; 3505 var $0;
3117 this.discardNodes(interfacesCount); 3506 this.discardNodes(interfacesCount);
3118 var supertype = (($0 = this.popNode()) && $0.is$Identifier()); 3507 var supertype = (($0 = this.popNode()) == null ? null : $0.assert$Identifier() );
3119 var name = (($0 = this.popNode()) && $0.is$Identifier()); 3508 var name = (($0 = this.popNode()) == null ? null : $0.assert$Identifier());
3120 this.pushElement(new PartialClassElement(name.get$source(), beginToken, endTok en)); 3509 this.pushElement(new PartialClassElement(name.get$source(), beginToken, endTok en));
3121 } 3510 }
3122 ElementListener.prototype.endInterface = function(token) { 3511 ElementListener.prototype.endInterface = function(token) {
3123 this.canceler.cancel("Cannot handle interfaces", null, token); 3512 this.canceler.cancel("Cannot handle interfaces", null, token);
3124 } 3513 }
3125 ElementListener.prototype.endFunctionTypeAlias = function(token) { 3514 ElementListener.prototype.endFunctionTypeAlias = function(token) {
3126 this.canceler.cancel("Cannot handle typedefs", null, token); 3515 this.canceler.cancel("Cannot handle typedefs", null, token);
3127 } 3516 }
3128 ElementListener.prototype.endTopLevelMethod = function(beginToken, endToken) { 3517 ElementListener.prototype.endTopLevelMethod = function(beginToken, endToken) {
3129 var $0; 3518 var $0;
3130 var name = (($0 = this.popNode()) && $0.is$Identifier()); 3519 var name = (($0 = this.popNode()) == null ? null : $0.assert$Identifier());
3131 this.pushElement(new PartialFunctionElement(name.get$source(), beginToken, end Token)); 3520 this.pushElement(new PartialFunctionElement(name.get$source(), beginToken, end Token));
3132 } 3521 }
3133 ElementListener.prototype.endTopLevelField = function(beginToken, endToken) { 3522 ElementListener.prototype.endTopLevelField = function(beginToken, endToken) {
3134 var $0; 3523 var $0;
3135 var name = (($0 = this.popNode()) && $0.is$Identifier()); 3524 var name = (($0 = this.popNode()) == null ? null : $0.assert$Identifier());
3136 this.canceler.cancel("Cannot handle fields", null, beginToken); 3525 this.canceler.cancel("Cannot handle fields", null, beginToken);
3137 } 3526 }
3138 ElementListener.prototype.handleIdentifier = function(token) { 3527 ElementListener.prototype.handleIdentifier = function(token) {
3139 this.pushNode(new Identifier(token)); 3528 this.pushNode(new Identifier(token));
3140 } 3529 }
3141 ElementListener.prototype.handleNoType = function(token) { 3530 ElementListener.prototype.handleNoType = function(token) {
3142 this.pushNode(null); 3531 this.pushNode(null);
3143 } 3532 }
3144 ElementListener.prototype.endTypeArguments = function(count, beginToken, endToke n) { 3533 ElementListener.prototype.endTypeArguments = function(count, beginToken, endToke n) {
3145 this.discardNodes(count); 3534 this.discardNodes(count);
3146 } 3535 }
3147 ElementListener.prototype.handleParenthesizedExpression = function(token) { 3536 ElementListener.prototype.handleParenthesizedExpression = function(token) {
3148 var $0; 3537 var $0;
3149 var expression = (($0 = this.popNode()) && $0.is$Expression()); 3538 var expression = (($0 = this.popNode()) == null ? null : $0.assert$Expression( ));
3150 this.pushNode(new ParenthesizedExpression(expression, token)); 3539 this.pushNode(new ParenthesizedExpression(expression, token));
3151 } 3540 }
3152 ElementListener.prototype.discardNodes = function(count) { 3541 ElementListener.prototype.discardNodes = function(count) {
3153 for (; count > 0; --count) { 3542 for (; count > 0; --count) {
3154 this.popNode(); 3543 this.popNode();
3155 } 3544 }
3156 } 3545 }
3157 ElementListener.prototype.expected = function(string, token) { 3546 ElementListener.prototype.expected = function(string, token) {
3158 this.canceler.cancel(("Expected '" + string + "', but got '" + token + "'"), n ull, token); 3547 this.canceler.cancel(("Expected '" + string + "', but got '" + token + "'"), n ull, token);
3159 } 3548 }
3160 ElementListener.prototype.expectedIdentifier = function(token) { 3549 ElementListener.prototype.expectedIdentifier = function(token) {
3161 this.canceler.cancel(("Expected identifier, but got '" + token + "'"), null, t oken); 3550 this.canceler.cancel(("Expected identifier, but got '" + token + "'"), null, t oken);
3162 } 3551 }
3163 ElementListener.prototype.expectedType = function(token) { 3552 ElementListener.prototype.expectedType = function(token) {
3164 this.canceler.cancel(("Expected a type, but got '" + token + "'"), null, token ); 3553 this.canceler.cancel(("Expected a type, but got '" + token + "'"), null, token );
3165 } 3554 }
3166 ElementListener.prototype.expectedBlock = function(token) { 3555 ElementListener.prototype.expectedBlock = function(token) {
3167 this.canceler.cancel(("Expected a block, but got '" + token + "'"), null, toke n); 3556 this.canceler.cancel(("Expected a block, but got '" + token + "'"), null, toke n);
3168 } 3557 }
3169 ElementListener.prototype.unexpected = function(token) { 3558 ElementListener.prototype.unexpected = function(token) {
3170 this.canceler.cancel(("Unexpected token '" + token + "'"), null, token); 3559 this.canceler.cancel(("Unexpected token '" + token + "'"), null, token);
3171 } 3560 }
3172 ElementListener.prototype.pushElement = function(element) { 3561 ElementListener.prototype.pushElement = function(element) {
3173 var $0; 3562 var $0;
3174 this.topLevelElements = (($0 = this.topLevelElements.prepend(element)) && $0.i s$Link_Element()); 3563 this.topLevelElements = (($0 = this.topLevelElements.prepend(element)) == null ? null : $0.assert$Link_Element());
3175 } 3564 }
3176 ElementListener.prototype.pushNode = function(node) { 3565 ElementListener.prototype.pushNode = function(node) {
3177 var $0; 3566 var $0;
3178 this.nodes = (($0 = this.nodes.prepend(node)) && $0.is$Link_Node()); 3567 this.nodes = (($0 = this.nodes.prepend(node)) == null ? null : $0.assert$Link_ Node());
3179 if (false/*null.VERBOSE*/) this.log(("push " + this.nodes)); 3568 if (false/*null.VERBOSE*/) this.log(("push " + this.nodes));
3180 } 3569 }
3181 ElementListener.prototype.popNode = function() { 3570 ElementListener.prototype.popNode = function() {
3182 var $0; 3571 var $0;
3183 $assert(!$notnull_bool(this.nodes.isEmpty()), "!nodes.isEmpty()", "listener.da rt", 406, 12); 3572 $assert(!$notnull_bool(this.nodes.isEmpty()), "!nodes.isEmpty()", "listener.da rt", 406, 12);
3184 var node = (($0 = this.nodes.get$head()) && $0.is$Node()); 3573 var node = (($0 = this.nodes.get$head()) == null ? null : $0.assert$Node());
3185 this.nodes = (($0 = this.nodes.get$tail()) && $0.is$Link_Node()); 3574 this.nodes = (($0 = this.nodes.get$tail()) == null ? null : $0.assert$Link_Nod e());
3186 if (false/*null.VERBOSE*/) this.log(("pop " + this.nodes)); 3575 if (false/*null.VERBOSE*/) this.log(("pop " + this.nodes));
3187 return node; 3576 return node;
3188 } 3577 }
3189 ElementListener.prototype.log = function(message) { 3578 ElementListener.prototype.log = function(message) {
3190 3579
3191 } 3580 }
3192 // ********** Code for NodeListener ************** 3581 // ********** Code for NodeListener **************
3193 function NodeListener(canceler, logger) { 3582 function NodeListener(canceler, logger) {
3194 this.logger = logger; 3583 this.logger = logger;
3195 // Initializers done 3584 // Initializers done
3196 ElementListener.call(this, canceler); 3585 ElementListener.call(this, canceler);
3197 } 3586 }
3198 $inherits(NodeListener, ElementListener); 3587 $inherits(NodeListener, ElementListener);
3199 NodeListener.prototype.endClassDeclaration = function(interfacesCount, beginToke n, extendsKeyword, implementsKeyword, endToken) { 3588 NodeListener.prototype.endClassDeclaration = function(interfacesCount, beginToke n, extendsKeyword, implementsKeyword, endToken) {
3200 var $0; 3589 var $0;
3201 var body = (($0 = this.popNode()) && $0.is$NodeList()); 3590 var body = (($0 = this.popNode()) == null ? null : $0.assert$NodeList());
3202 var interfaces = this.makeNodeList(interfacesCount, implementsKeyword, null, " ,"); 3591 var interfaces = this.makeNodeList(interfacesCount, implementsKeyword, null, " ,");
3203 var supertype = (($0 = this.popNode()) && $0.is$TypeAnnotation()); 3592 var supertype = (($0 = this.popNode()) == null ? null : $0.assert$TypeAnnotati on());
3204 var name = (($0 = this.popNode()) && $0.is$Identifier()); 3593 var name = (($0 = this.popNode()) == null ? null : $0.assert$Identifier());
3205 this.pushNode(new ClassNode(name, supertype, interfaces, beginToken, extendsKe yword, endToken)); 3594 this.pushNode(new ClassNode(name, supertype, interfaces, beginToken, extendsKe yword, endToken));
3206 } 3595 }
3207 NodeListener.prototype.endClassBody = function(memberCount, beginToken, endToken ) { 3596 NodeListener.prototype.endClassBody = function(memberCount, beginToken, endToken ) {
3208 this.pushNode(this.makeNodeList(memberCount, beginToken, endToken, null)); 3597 this.pushNode(this.makeNodeList(memberCount, beginToken, endToken, null));
3209 } 3598 }
3210 NodeListener.prototype.endFormalParameter = function(token) { 3599 NodeListener.prototype.endFormalParameter = function(token) {
3211 var $0; 3600 var $0;
3212 var name = new NodeList.singleton$ctor(this.popNode()); 3601 var name = new NodeList.singleton$ctor(this.popNode());
3213 var type = (($0 = this.popNode()) && $0.is$TypeAnnotation()); 3602 var type = (($0 = this.popNode()) == null ? null : $0.assert$TypeAnnotation()) ;
3214 this.pushNode(new VariableDefinitions(type, null, name, token)); 3603 this.pushNode(new VariableDefinitions(type, null, name, token));
3215 } 3604 }
3216 NodeListener.prototype.endFormalParameters = function(count, beginToken, endToke n) { 3605 NodeListener.prototype.endFormalParameters = function(count, beginToken, endToke n) {
3217 this.pushNode(this.makeNodeList(count, beginToken, endToken, ",")); 3606 this.pushNode(this.makeNodeList(count, beginToken, endToken, ","));
3218 } 3607 }
3219 NodeListener.prototype.endArguments = function(count, beginToken, endToken) { 3608 NodeListener.prototype.endArguments = function(count, beginToken, endToken) {
3220 this.pushNode(this.makeNodeList(count, beginToken, endToken, ",")); 3609 this.pushNode(this.makeNodeList(count, beginToken, endToken, ","));
3221 } 3610 }
3222 NodeListener.prototype.handleNoArguments = function(token) { 3611 NodeListener.prototype.handleNoArguments = function(token) {
3223 this.pushNode(null); 3612 this.pushNode(null);
3224 } 3613 }
3225 NodeListener.prototype.endReturnStatement = function(hasExpression, beginToken, endToken) { 3614 NodeListener.prototype.endReturnStatement = function(hasExpression, beginToken, endToken) {
3226 var $0; 3615 var $0;
3227 var expression = (($0 = $notnull_bool(hasExpression) ? this.popNode() : null) && $0.is$Expression()); 3616 var expression = (($0 = $notnull_bool(hasExpression) ? this.popNode() : null) == null ? null : $0.assert$Expression());
3228 this.pushNode(new Return(beginToken, endToken, expression)); 3617 this.pushNode(new Return(beginToken, endToken, expression));
3229 } 3618 }
3230 NodeListener.prototype.endExpressionStatement = function(token) { 3619 NodeListener.prototype.endExpressionStatement = function(token) {
3231 this.pushNode(new ExpressionStatement(this.popNode(), token)); 3620 this.pushNode(new ExpressionStatement(this.popNode(), token));
3232 } 3621 }
3233 NodeListener.prototype.handleOnError = function(token, error) { 3622 NodeListener.prototype.handleOnError = function(token, error) {
3234 this.canceler.cancel(("internal error: '" + token.get$value() + "': " + error) , null, token); 3623 this.canceler.cancel(("internal error: '" + token.get$value() + "': " + error) , null, token);
3235 } 3624 }
3236 NodeListener.prototype.handleLiteralInt = function(token) { 3625 NodeListener.prototype.handleLiteralInt = function(token) {
3237 var $this = this; // closure support 3626 var $this = this; // closure support
3238 this.pushNode(new LiteralInt(token, (function (t, e) { 3627 this.pushNode(new LiteralInt(token, (function (t, e) {
3239 return $this.handleOnError((t && t.is$Token()), e); 3628 return $this.handleOnError((t == null ? null : t.assert$Token()), e);
3240 }) 3629 })
3241 )); 3630 ));
3242 } 3631 }
3243 NodeListener.prototype.handleLiteralDouble = function(token) { 3632 NodeListener.prototype.handleLiteralDouble = function(token) {
3244 var $this = this; // closure support 3633 var $this = this; // closure support
3245 this.pushNode(new LiteralDouble(token, (function (t, e) { 3634 this.pushNode(new LiteralDouble(token, (function (t, e) {
3246 return $this.handleOnError((t && t.is$Token()), e); 3635 return $this.handleOnError((t == null ? null : t.assert$Token()), e);
3247 }) 3636 })
3248 )); 3637 ));
3249 } 3638 }
3250 NodeListener.prototype.handleLiteralBool = function(token) { 3639 NodeListener.prototype.handleLiteralBool = function(token) {
3251 var $this = this; // closure support 3640 var $this = this; // closure support
3252 this.pushNode(new LiteralBool(token, (function (t, e) { 3641 this.pushNode(new LiteralBool(token, (function (t, e) {
3253 return $this.handleOnError((t && t.is$Token()), e); 3642 return $this.handleOnError((t == null ? null : t.assert$Token()), e);
3254 }) 3643 })
3255 )); 3644 ));
3256 } 3645 }
3257 NodeListener.prototype.handleLiteralString = function(token) { 3646 NodeListener.prototype.handleLiteralString = function(token) {
3258 this.pushNode(new LiteralString(token)); 3647 this.pushNode(new LiteralString(token));
3259 } 3648 }
3260 NodeListener.prototype.handleLiteralNull = function(token) { 3649 NodeListener.prototype.handleLiteralNull = function(token) {
3261 this.pushNode(new LiteralNull(token)); 3650 this.pushNode(new LiteralNull(token));
3262 } 3651 }
3263 NodeListener.prototype.handleBinaryExpression = function(token) { 3652 NodeListener.prototype.handleBinaryExpression = function(token) {
(...skipping 25 matching lines...) Expand all
3289 } 3678 }
3290 NodeListener.prototype.handleConditionalExpression = function(question, colon) { 3679 NodeListener.prototype.handleConditionalExpression = function(question, colon) {
3291 var elseExpression = this.popNode(); 3680 var elseExpression = this.popNode();
3292 var thenExpression = this.popNode(); 3681 var thenExpression = this.popNode();
3293 var condition = this.popNode(); 3682 var condition = this.popNode();
3294 this.pushNode(null); 3683 this.pushNode(null);
3295 this.canceler.cancel('conditional expression not implemented yet', null, quest ion); 3684 this.canceler.cancel('conditional expression not implemented yet', null, quest ion);
3296 } 3685 }
3297 NodeListener.prototype.endSend = function(token) { 3686 NodeListener.prototype.endSend = function(token) {
3298 var $0; 3687 var $0;
3299 var arguments = (($0 = this.popNode()) && $0.is$NodeList()); 3688 var arguments = (($0 = this.popNode()) == null ? null : $0.assert$NodeList());
3300 var selector = this.popNode(); 3689 var selector = this.popNode();
3301 this.pushNode(new Send(null, selector, arguments)); 3690 this.pushNode(new Send(null, selector, arguments));
3302 } 3691 }
3303 NodeListener.prototype.handleVoidKeyword = function(token) { 3692 NodeListener.prototype.handleVoidKeyword = function(token) {
3304 this.pushNode(new TypeAnnotation(new Identifier(token))); 3693 this.pushNode(new TypeAnnotation(new Identifier(token)));
3305 } 3694 }
3306 NodeListener.prototype.endFunctionBody = function(count, beginToken, endToken) { 3695 NodeListener.prototype.endFunctionBody = function(count, beginToken, endToken) {
3307 this.pushNode(new Block(this.makeNodeList(count, beginToken, endToken, null))) ; 3696 this.pushNode(new Block(this.makeNodeList(count, beginToken, endToken, null))) ;
3308 } 3697 }
3309 NodeListener.prototype.endFunction = function(token) { 3698 NodeListener.prototype.endFunction = function(token) {
3310 var $0; 3699 var $0;
3311 var body = (($0 = this.popNode()) && $0.is$Statement()); 3700 var body = (($0 = this.popNode()) == null ? null : $0.assert$Statement());
3312 var formals = this.popNode(); 3701 var formals = this.popNode();
3313 var name = this.popNode(); 3702 var name = this.popNode();
3314 var type = (($0 = this.popNode()) && $0.is$TypeAnnotation()); 3703 var type = (($0 = this.popNode()) == null ? null : $0.assert$TypeAnnotation()) ;
3315 this.pushNode(new FunctionExpression(name, formals, body, type)); 3704 this.pushNode(new FunctionExpression(name, formals, body, type));
3316 } 3705 }
3317 NodeListener.prototype.handleVarKeyword = function(token) { 3706 NodeListener.prototype.handleVarKeyword = function(token) {
3318 this.pushNode(new Identifier(token)); 3707 this.pushNode(new Identifier(token));
3319 } 3708 }
3320 NodeListener.prototype.handleFinalKeyword = function(token) { 3709 NodeListener.prototype.handleFinalKeyword = function(token) {
3321 this.pushNode(new Identifier(token)); 3710 this.pushNode(new Identifier(token));
3322 } 3711 }
3323 NodeListener.prototype.endVariablesDeclaration = function(count, endToken) { 3712 NodeListener.prototype.endVariablesDeclaration = function(count, endToken) {
3324 var $0; 3713 var $0;
3325 var variables = this.makeNodeList(count, null, null, ","); 3714 var variables = this.makeNodeList(count, null, null, ",");
3326 var type = (($0 = this.popNode()) && $0.is$TypeAnnotation()); 3715 var type = (($0 = this.popNode()) == null ? null : $0.assert$TypeAnnotation()) ;
3327 this.pushNode(new VariableDefinitions(type, null, variables, endToken)); 3716 this.pushNode(new VariableDefinitions(type, null, variables, endToken));
3328 } 3717 }
3329 NodeListener.prototype.endInitializer = function(assignmentOperator) { 3718 NodeListener.prototype.endInitializer = function(assignmentOperator) {
3330 var $0; 3719 var $0;
3331 var initializer = (($0 = this.popNode()) && $0.is$Expression()); 3720 var initializer = (($0 = this.popNode()) == null ? null : $0.assert$Expression ());
3332 var arguments = new NodeList.singleton$ctor(initializer); 3721 var arguments = new NodeList.singleton$ctor(initializer);
3333 var name = (($0 = this.popNode()) && $0.is$Expression()); 3722 var name = (($0 = this.popNode()) == null ? null : $0.assert$Expression());
3334 var op = new Operator(assignmentOperator); 3723 var op = new Operator(assignmentOperator);
3335 this.pushNode(new SendSet(null, name, op, arguments)); 3724 this.pushNode(new SendSet(null, name, op, arguments));
3336 } 3725 }
3337 NodeListener.prototype.endIfStatement = function(ifToken, elseToken) { 3726 NodeListener.prototype.endIfStatement = function(ifToken, elseToken) {
3338 var $0; 3727 var $0;
3339 var elsePart = (($0 = (elseToken == null) ? null : this.popNode()) && $0.is$St atement()); 3728 var elsePart = (($0 = (elseToken == null) ? null : this.popNode()) == null ? n ull : $0.assert$Statement());
3340 var thenPart = (($0 = this.popNode()) && $0.is$Statement()); 3729 var thenPart = (($0 = this.popNode()) == null ? null : $0.assert$Statement());
3341 var condition = (($0 = this.popNode()) && $0.is$ParenthesizedExpression()); 3730 var condition = (($0 = this.popNode()) == null ? null : $0.assert$Parenthesize dExpression());
3342 this.pushNode(new If(condition, thenPart, elsePart, ifToken, elseToken)); 3731 this.pushNode(new If(condition, thenPart, elsePart, ifToken, elseToken));
3343 } 3732 }
3344 NodeListener.prototype.endForStatement = function(beginToken, endToken) { 3733 NodeListener.prototype.endForStatement = function(beginToken, endToken) {
3345 var $0; 3734 var $0;
3346 var body = (($0 = this.popNode()) && $0.is$Statement()); 3735 var body = (($0 = this.popNode()) == null ? null : $0.assert$Statement());
3347 var update = (($0 = this.popNode()) && $0.is$Expression()); 3736 var update = (($0 = this.popNode()) == null ? null : $0.assert$Expression());
3348 var condition = (($0 = this.popNode()) && $0.is$ExpressionStatement()); 3737 var condition = (($0 = this.popNode()) == null ? null : $0.assert$ExpressionSt atement());
3349 var initializer = (($0 = this.popNode()) && $0.is$VariableDefinitions()); 3738 var initializer = (($0 = this.popNode()) == null ? null : $0.assert$VariableDe finitions());
3350 this.pushNode(new For(initializer, condition, update, body, beginToken)); 3739 this.pushNode(new For(initializer, condition, update, body, beginToken));
3351 } 3740 }
3352 NodeListener.prototype.endDoWhileStatement = function(doKeyword, whileKeyword, e ndToken) { 3741 NodeListener.prototype.endDoWhileStatement = function(doKeyword, whileKeyword, e ndToken) {
3353 var $0; 3742 var $0;
3354 var condition = (($0 = this.popNode()) && $0.is$Expression()); 3743 var condition = (($0 = this.popNode()) == null ? null : $0.assert$Expression() );
3355 var body = (($0 = this.popNode()) && $0.is$Statement()); 3744 var body = (($0 = this.popNode()) == null ? null : $0.assert$Statement());
3356 this.pushNode(new DoWhile(body, condition, doKeyword, whileKeyword, endToken)) ; 3745 this.pushNode(new DoWhile(body, condition, doKeyword, whileKeyword, endToken)) ;
3357 } 3746 }
3358 NodeListener.prototype.endWhileStatement = function(whileKeyword, endToken) { 3747 NodeListener.prototype.endWhileStatement = function(whileKeyword, endToken) {
3359 var $0; 3748 var $0;
3360 var body = (($0 = this.popNode()) && $0.is$Statement()); 3749 var body = (($0 = this.popNode()) == null ? null : $0.assert$Statement());
3361 var condition = (($0 = this.popNode()) && $0.is$Expression()); 3750 var condition = (($0 = this.popNode()) == null ? null : $0.assert$Expression() );
3362 this.pushNode(new While(condition, body, whileKeyword)); 3751 this.pushNode(new While(condition, body, whileKeyword));
3363 } 3752 }
3364 NodeListener.prototype.endBlock = function(count, beginToken, endToken) { 3753 NodeListener.prototype.endBlock = function(count, beginToken, endToken) {
3365 this.pushNode(new Block(this.makeNodeList(count, beginToken, endToken, null))) ; 3754 this.pushNode(new Block(this.makeNodeList(count, beginToken, endToken, null))) ;
3366 } 3755 }
3367 NodeListener.prototype.endType = function(count, beginToken, endToken) { 3756 NodeListener.prototype.endType = function(count, beginToken, endToken) {
3368 var $0; 3757 var $0;
3369 var type = new TypeAnnotation((($0 = this.popNode()) && $0.is$Identifier())); 3758 var type = new TypeAnnotation((($0 = this.popNode()) == null ? null : $0.asser t$Identifier()));
3370 this.discardNodes(count - 1); 3759 this.discardNodes(count - 1);
3371 this.pushNode(type); 3760 this.pushNode(type);
3372 } 3761 }
3373 NodeListener.prototype.endThrowStatement = function(throwToken, endToken) { 3762 NodeListener.prototype.endThrowStatement = function(throwToken, endToken) {
3374 var $0; 3763 var $0;
3375 var expression = (($0 = this.popNode()) && $0.is$Expression()); 3764 var expression = (($0 = this.popNode()) == null ? null : $0.assert$Expression( ));
3376 this.pushNode(new Throw(expression, throwToken, endToken)); 3765 this.pushNode(new Throw(expression, throwToken, endToken));
3377 } 3766 }
3378 NodeListener.prototype.endRethrowStatement = function(throwToken, endToken) { 3767 NodeListener.prototype.endRethrowStatement = function(throwToken, endToken) {
3379 this.pushNode(new Throw(null, throwToken, endToken)); 3768 this.pushNode(new Throw(null, throwToken, endToken));
3380 } 3769 }
3381 NodeListener.prototype.handleUnaryPrefixExpression = function(token) { 3770 NodeListener.prototype.handleUnaryPrefixExpression = function(token) {
3382 this.pushNode(new Send.prefix$ctor(this.popNode(), new Operator(token))); 3771 this.pushNode(new Send.prefix$ctor(this.popNode(), new Operator(token)));
3383 } 3772 }
3384 NodeListener.prototype.handleSuperExpression = function(token) { 3773 NodeListener.prototype.handleSuperExpression = function(token) {
3385 this.pushNode(new Identifier(token)); 3774 this.pushNode(new Identifier(token));
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
3417 this.discardNodes(count); 3806 this.discardNodes(count);
3418 } 3807 }
3419 NodeListener.prototype.handleNoInitializers = function() { 3808 NodeListener.prototype.handleNoInitializers = function() {
3420 3809
3421 } 3810 }
3422 NodeListener.prototype.handleNoFieldInitializer = function(token) { 3811 NodeListener.prototype.handleNoFieldInitializer = function(token) {
3423 this.pushNode(null); 3812 this.pushNode(null);
3424 } 3813 }
3425 NodeListener.prototype.endField = function(beginToken, endToken) { 3814 NodeListener.prototype.endField = function(beginToken, endToken) {
3426 var $0; 3815 var $0;
3427 var initializer = (($0 = this.popNode()) && $0.is$Expression()); 3816 var initializer = (($0 = this.popNode()) == null ? null : $0.assert$Expression ());
3428 var name = (($0 = this.popNode()) && $0.is$Identifier()); 3817 var name = (($0 = this.popNode()) == null ? null : $0.assert$Identifier());
3429 this.pushNode(null); 3818 this.pushNode(null);
3430 this.canceler.cancel("fields are not implemented yet", name); 3819 this.canceler.cancel("fields are not implemented yet", name);
3431 } 3820 }
3432 NodeListener.prototype.endMethod = function(beginToken, endToken) { 3821 NodeListener.prototype.endMethod = function(beginToken, endToken) {
3433 var name = this.popNode(); 3822 var name = this.popNode();
3434 this.pushNode(new FunctionExpression(name, null, null, null)); 3823 this.pushNode(new FunctionExpression(name, null, null, null));
3435 } 3824 }
3436 NodeListener.prototype.makeNodeList = function(count, beginToken, endToken, deli miter) { 3825 NodeListener.prototype.makeNodeList = function(count, beginToken, endToken, deli miter) {
3437 var $0; 3826 var $0;
3438 var nodes = const$209/*const EmptyLink<Node>()*/; 3827 var nodes = const$209/*const EmptyLink<Node>()*/;
3439 for (; count > 0; --count) { 3828 for (; count > 0; --count) {
3440 nodes = (($0 = nodes.prepend(this.popNode())) && $0.is$Link_Node()); 3829 nodes = (($0 = nodes.prepend(this.popNode())) == null ? null : $0.assert$Lin k_Node());
3441 } 3830 }
3442 var sourceDelimiter = (($0 = (delimiter == null) ? null : new StringWrapper(de limiter)) && $0.is$SourceString()); 3831 var sourceDelimiter = (($0 = (delimiter == null) ? null : new StringWrapper(de limiter)) == null ? null : $0.assert$SourceString());
3443 return new NodeList(beginToken, nodes, endToken, sourceDelimiter); 3832 return new NodeList(beginToken, nodes, endToken, sourceDelimiter);
3444 } 3833 }
3445 NodeListener.prototype.log = function(message) { 3834 NodeListener.prototype.log = function(message) {
3446 this.logger.log(message); 3835 this.logger.log(message);
3447 } 3836 }
3448 // ********** Code for PartialFunctionElement ************** 3837 // ********** Code for PartialFunctionElement **************
3449 function PartialFunctionElement(name, beginToken, endToken) { 3838 function PartialFunctionElement(name, beginToken, endToken) {
3450 this.beginToken = beginToken; 3839 this.beginToken = beginToken;
3451 this.endToken = endToken; 3840 this.endToken = endToken;
3452 // Initializers done 3841 // Initializers done
3453 FunctionElement.call(this, name); 3842 FunctionElement.call(this, name);
3454 } 3843 }
3455 $inherits(PartialFunctionElement, FunctionElement); 3844 $inherits(PartialFunctionElement, FunctionElement);
3456 PartialFunctionElement.prototype.parseNode = function(canceler, logger) { 3845 PartialFunctionElement.prototype.parseNode = function(canceler, logger) {
3457 var $this = this; // closure support 3846 var $this = this; // closure support
3458 var $0; 3847 var $0;
3459 if (this.node != null) return this.node; 3848 if (this.node != null) return this.node;
3460 this.node = (($0 = parse(canceler, logger, (function (p) { 3849 this.node = (($0 = parse(canceler, logger, (function (p) {
3461 return p.parseFunction$1($this.beginToken); 3850 return p.parseFunction$1($this.beginToken);
3462 }) 3851 })
3463 )) && $0.is$FunctionExpression()); 3852 )) == null ? null : $0.assert$FunctionExpression());
3464 return this.node; 3853 return this.node;
3465 } 3854 }
3466 // ********** Code for PartialClassElement ************** 3855 // ********** Code for PartialClassElement **************
3467 function PartialClassElement(name, beginToken, endToken) { 3856 function PartialClassElement(name, beginToken, endToken) {
3468 this.beginToken = beginToken; 3857 this.beginToken = beginToken;
3469 this.endToken = endToken; 3858 this.endToken = endToken;
3470 // Initializers done 3859 // Initializers done
3471 ClassElement.call(this, name); 3860 ClassElement.call(this, name);
3472 } 3861 }
3473 $inherits(PartialClassElement, ClassElement); 3862 $inherits(PartialClassElement, ClassElement);
3474 PartialClassElement.prototype.parseNode = function(canceler, logger) { 3863 PartialClassElement.prototype.parseNode = function(canceler, logger) {
3475 var $this = this; // closure support 3864 var $this = this; // closure support
3476 var $0; 3865 var $0;
3477 if (this.node != null) return this.node; 3866 if (this.node != null) return this.node;
3478 this.node = (($0 = parse(canceler, logger, (function (p) { 3867 this.node = (($0 = parse(canceler, logger, (function (p) {
3479 return p.parseClass$1($this.beginToken); 3868 return p.parseClass$1($this.beginToken);
3480 }) 3869 })
3481 )) && $0.is$ClassNode()); 3870 )) == null ? null : $0.assert$ClassNode());
3482 return this.node; 3871 return this.node;
3483 } 3872 }
3484 // ********** Code for Parser ************** 3873 // ********** Code for Parser **************
3485 function Parser(listener) { 3874 function Parser(listener) {
3486 this.listener = listener; 3875 this.listener = listener;
3487 // Initializers done 3876 // Initializers done
3488 } 3877 }
3489 Parser.prototype.parseUnit = function(token) { 3878 Parser.prototype.parseUnit = function(token) {
3490 while (token.kind !== 0/*null.EOF_TOKEN*/) { 3879 while (token.kind !== 0/*null.EOF_TOKEN*/) {
3491 var value = token.get$stringValue(); 3880 var value = token.get$stringValue();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
3588 Parser.prototype.parseFactoryClauseOpt = function(token) { 3977 Parser.prototype.parseFactoryClauseOpt = function(token) {
3589 if ($notnull_bool(this.optional('factory', token))) { 3978 if ($notnull_bool(this.optional('factory', token))) {
3590 return this.parseType(token.next); 3979 return this.parseType(token.next);
3591 } 3980 }
3592 return token; 3981 return token;
3593 } 3982 }
3594 Parser.prototype.skipBlock = function(token) { 3983 Parser.prototype.skipBlock = function(token) {
3595 if (!$notnull_bool(this.optional('{', token))) { 3984 if (!$notnull_bool(this.optional('{', token))) {
3596 return this.listener.expectedBlock(token); 3985 return this.listener.expectedBlock(token);
3597 } 3986 }
3598 var beginGroupToken = (token && token.is$BeginGroupToken()); 3987 var beginGroupToken = (token == null ? null : token.assert$BeginGroupToken());
3599 $assert(beginGroupToken.endGroup == null || beginGroupToken.endGroup.kind === 125/*null.$RBRACE*/, "beginGroupToken.endGroup === null ||\n beginGrou pToken.endGroup.kind === $RBRACE", "parser.dart", 127, 12); 3988 $assert(beginGroupToken.endGroup == null || beginGroupToken.endGroup.kind === 125/*null.$RBRACE*/, "beginGroupToken.endGroup === null ||\n beginGrou pToken.endGroup.kind === $RBRACE", "parser.dart", 127, 12);
3600 return beginGroupToken.endGroup; 3989 return beginGroupToken.endGroup;
3601 } 3990 }
3602 Parser.prototype.skipFormals = function(token) { 3991 Parser.prototype.skipFormals = function(token) {
3603 return token.endGroup; 3992 return token.endGroup;
3604 } 3993 }
3605 Parser.prototype.parseClass = function(token) { 3994 Parser.prototype.parseClass = function(token) {
3606 var begin = token; 3995 var begin = token;
3607 this.listener.beginClassDeclaration(token); 3996 this.listener.beginClassDeclaration(token);
3608 token = this.parseIdentifier(token.next); 3997 token = this.parseIdentifier(token.next);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
3685 else { 4074 else {
3686 token = this.listener.expectedType(token); 4075 token = this.listener.expectedType(token);
3687 } 4076 }
3688 token = this.parseTypeArgumentsOpt(token); 4077 token = this.parseTypeArgumentsOpt(token);
3689 this.listener.endType(identifierCount, begin, token); 4078 this.listener.endType(identifierCount, begin, token);
3690 return token; 4079 return token;
3691 } 4080 }
3692 Parser.prototype.parseTypeArgumentsOpt = function(token) { 4081 Parser.prototype.parseTypeArgumentsOpt = function(token) {
3693 var $this = this; // closure support 4082 var $this = this; // closure support
3694 return this.parseStuff(token, (function (t) { 4083 return this.parseStuff(token, (function (t) {
3695 return $this.listener.beginTypeArguments((t && t.is$Token())); 4084 return $this.listener.beginTypeArguments((t == null ? null : t.assert$Token( )));
3696 }) 4085 })
3697 , (function (t) { 4086 , (function (t) {
3698 return $this.parseType((t && t.is$Token())); 4087 return $this.parseType((t == null ? null : t.assert$Token()));
3699 }) 4088 })
3700 , (function (c, bt, et) { 4089 , (function (c, bt, et) {
3701 return $this.listener.endTypeArguments($assert_num(c), (bt && bt.is$Token()) , (et && et.is$Token())); 4090 return $this.listener.endTypeArguments($assert_num(c), (bt == null ? null : bt.assert$Token()), (et == null ? null : et.assert$Token()));
3702 }) 4091 })
3703 , (function (t) { 4092 , (function (t) {
3704 return $this.listener.handleNoTypeArguments((t && t.is$Token())); 4093 return $this.listener.handleNoTypeArguments((t == null ? null : t.assert$Tok en()));
3705 }) 4094 })
3706 ); 4095 );
3707 } 4096 }
3708 Parser.prototype.parseTypeVariablesOpt = function(token) { 4097 Parser.prototype.parseTypeVariablesOpt = function(token) {
3709 if ($notnull_bool(this.optional('<', token))) { 4098 if ($notnull_bool(this.optional('<', token))) {
3710 var beginGroupToken = (token && token.is$BeginGroupToken()); 4099 var beginGroupToken = (token == null ? null : token.assert$BeginGroupToken() );
3711 token = beginGroupToken.endGroup.next; 4100 token = beginGroupToken.endGroup.next;
3712 } 4101 }
3713 this.listener.handleNoTypeVariables(token); 4102 this.listener.handleNoTypeVariables(token);
3714 return token; 4103 return token;
3715 } 4104 }
3716 Parser.prototype.parseStuff = function(token, beginStuff, stuffParser, endStuff, handleNoStuff) { 4105 Parser.prototype.parseStuff = function(token, beginStuff, stuffParser, endStuff, handleNoStuff) {
3717 var $0; 4106 var $0;
3718 if ($notnull_bool(this.optional('<', token))) { 4107 if ($notnull_bool(this.optional('<', token))) {
3719 var begin = token; 4108 var begin = token;
3720 beginStuff.call$1(begin); 4109 beginStuff.call$1(begin);
3721 var count = 0; 4110 var count = 0;
3722 do { 4111 do {
3723 token = (($0 = stuffParser.call$1(token.next)) && $0.is$Token()); 4112 token = (($0 = stuffParser.call$1(token.next)) == null ? null : $0.assert$ Token());
3724 ++count; 4113 ++count;
3725 } 4114 }
3726 while ($notnull_bool(this.optional(',', token))) 4115 while ($notnull_bool(this.optional(',', token)))
3727 endStuff.call$3(count, begin, token); 4116 endStuff.call$3(count, begin, token);
3728 return this.expect('>', token); 4117 return this.expect('>', token);
3729 } 4118 }
3730 handleNoStuff.call$1(token); 4119 handleNoStuff.call$1(token);
3731 return token; 4120 return token;
3732 } 4121 }
3733 Parser.prototype.parseTopLevelMember = function(token) { 4122 Parser.prototype.parseTopLevelMember = function(token) {
(...skipping 21 matching lines...) Expand all
3755 } 4144 }
3756 } 4145 }
3757 if ($notnull_bool(isField)) { 4146 if ($notnull_bool(isField)) {
3758 if ($notnull_bool(this.optional('=', token))) { 4147 if ($notnull_bool(this.optional('=', token))) {
3759 token = this.parseExpression(token.next); 4148 token = this.parseExpression(token.next);
3760 } 4149 }
3761 this.expectSemicolon(token); 4150 this.expectSemicolon(token);
3762 this.listener.endTopLevelField(start, token); 4151 this.listener.endTopLevelField(start, token);
3763 } 4152 }
3764 else { 4153 else {
3765 token = this.skipFormals((token && token.is$BeginGroupToken())).next; 4154 token = this.skipFormals((token == null ? null : token.assert$BeginGroupToke n())).next;
3766 token = this.parseFunctionBody(token); 4155 token = this.parseFunctionBody(token);
3767 this.listener.endTopLevelMethod(start, token); 4156 this.listener.endTopLevelMethod(start, token);
3768 } 4157 }
3769 return token.next; 4158 return token.next;
3770 } 4159 }
3771 Parser.prototype.parseInitializersOpt = function(token) { 4160 Parser.prototype.parseInitializersOpt = function(token) {
3772 if ($notnull_bool(this.optional(':', token))) { 4161 if ($notnull_bool(this.optional(':', token))) {
3773 return this.parseInitializers(token); 4162 return this.parseInitializers(token);
3774 } 4163 }
3775 else { 4164 else {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
3822 if ('void' !== token.get$stringValue() && !$notnull_bool(this.isIdentifier(tok en))) { 4211 if ('void' !== token.get$stringValue() && !$notnull_bool(this.isIdentifier(tok en))) {
3823 this.listener.expectedIdentifier(token); 4212 this.listener.expectedIdentifier(token);
3824 } 4213 }
3825 var peek = token.next; 4214 var peek = token.next;
3826 if (peek.kind === 46/*null.PERIOD_TOKEN*/) { 4215 if (peek.kind === 46/*null.PERIOD_TOKEN*/) {
3827 if (peek.next.kind === 97/*null.IDENTIFIER_TOKEN*/) { 4216 if (peek.next.kind === 97/*null.IDENTIFIER_TOKEN*/) {
3828 peek = peek.next.next; 4217 peek = peek.next.next;
3829 } 4218 }
3830 } 4219 }
3831 if (peek.kind === 60/*null.LT_TOKEN*/) { 4220 if (peek.kind === 60/*null.LT_TOKEN*/) {
3832 var beginGroupToken = (peek && peek.is$BeginGroupToken()); 4221 var beginGroupToken = (peek == null ? null : peek.assert$BeginGroupToken());
3833 var gtToken = beginGroupToken.endGroup; 4222 var gtToken = beginGroupToken.endGroup;
3834 if (gtToken != null) { 4223 if (gtToken != null) {
3835 return gtToken.next; 4224 return gtToken.next;
3836 } 4225 }
3837 } 4226 }
3838 return peek; 4227 return peek;
3839 } 4228 }
3840 Parser.prototype.parseClassBody = function(token) { 4229 Parser.prototype.parseClassBody = function(token) {
3841 var begin = token; 4230 var begin = token;
3842 this.listener.beginClassBody(token); 4231 this.listener.beginClassBody(token);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
3880 if ($notnull_bool(this.optional('=', token))) { 4269 if ($notnull_bool(this.optional('=', token))) {
3881 token = this.parseExpression(token.next); 4270 token = this.parseExpression(token.next);
3882 } 4271 }
3883 else { 4272 else {
3884 this.listener.handleNoFieldInitializer(token); 4273 this.listener.handleNoFieldInitializer(token);
3885 } 4274 }
3886 this.expectSemicolon(token); 4275 this.expectSemicolon(token);
3887 this.listener.endField(start, token); 4276 this.listener.endField(start, token);
3888 } 4277 }
3889 else { 4278 else {
3890 token = this.skipFormals((token && token.is$BeginGroupToken())).next; 4279 token = this.skipFormals((token == null ? null : token.assert$BeginGroupToke n())).next;
3891 token = this.parseInitializersOpt(token); 4280 token = this.parseInitializersOpt(token);
3892 if (!$notnull_bool(this.optional(';', token))) { 4281 if (!$notnull_bool(this.optional(';', token))) {
3893 token = this.parseFunctionBody(token); 4282 token = this.parseFunctionBody(token);
3894 } 4283 }
3895 this.listener.endMethod(start, token); 4284 this.listener.endMethod(start, token);
3896 } 4285 }
3897 return token.next; 4286 return token.next;
3898 } 4287 }
3899 Parser.prototype.parseFunction = function(token) { 4288 Parser.prototype.parseFunction = function(token) {
3900 this.listener.beginFunction(token); 4289 this.listener.beginFunction(token);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
3988 Parser.prototype.parseExpressionStatementOrDeclaration = function(token) { 4377 Parser.prototype.parseExpressionStatementOrDeclaration = function(token) {
3989 var identifier = this.peekIdentifierAfterType(token); 4378 var identifier = this.peekIdentifierAfterType(token);
3990 if (identifier != null) { 4379 if (identifier != null) {
3991 $assert(identifier.kind === 97/*null.IDENTIFIER_TOKEN*/, "identifier.kind == = IDENTIFIER_TOKEN", "parser.dart", 544, 14); 4380 $assert(identifier.kind === 97/*null.IDENTIFIER_TOKEN*/, "identifier.kind == = IDENTIFIER_TOKEN", "parser.dart", 544, 14);
3992 var afterId = identifier.next; 4381 var afterId = identifier.next;
3993 var afterIdKind = afterId.kind; 4382 var afterIdKind = afterId.kind;
3994 if (afterIdKind === 61/*null.EQ_TOKEN*/ || afterIdKind === 59/*null.SEMICOLO N_TOKEN*/) { 4383 if (afterIdKind === 61/*null.EQ_TOKEN*/ || afterIdKind === 59/*null.SEMICOLO N_TOKEN*/) {
3995 return this.parseVariablesDeclaration(token); 4384 return this.parseVariablesDeclaration(token);
3996 } 4385 }
3997 else if (afterIdKind === 40/*null.LPAREN_TOKEN*/) { 4386 else if (afterIdKind === 40/*null.LPAREN_TOKEN*/) {
3998 var beginParen = (afterId && afterId.is$BeginGroupToken()); 4387 var beginParen = (afterId == null ? null : afterId.assert$BeginGroupToken( ));
3999 var endParen = beginParen.endGroup; 4388 var endParen = beginParen.endGroup;
4000 var afterParens = endParen.next; 4389 var afterParens = endParen.next;
4001 if ($notnull_bool(this.optional('{', afterParens)) || $notnull_bool(this.o ptional('=>', afterParens))) { 4390 if ($notnull_bool(this.optional('{', afterParens)) || $notnull_bool(this.o ptional('=>', afterParens))) {
4002 return this.parseFunction(token); 4391 return this.parseFunction(token);
4003 } 4392 }
4004 } 4393 }
4005 } 4394 }
4006 return this.parseExpressionStatement(token); 4395 return this.parseExpressionStatement(token);
4007 } 4396 }
4008 Parser.prototype.parseExpressionStatement = function(token) { 4397 Parser.prototype.parseExpressionStatement = function(token) {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
4157 } 4546 }
4158 else if (kind === 40/*null.LPAREN_TOKEN*/) { 4547 else if (kind === 40/*null.LPAREN_TOKEN*/) {
4159 return this.parseParenthesizedExpression(token); 4548 return this.parseParenthesizedExpression(token);
4160 } 4549 }
4161 else { 4550 else {
4162 this.listener.unexpected(token); 4551 this.listener.unexpected(token);
4163 $throw('not yet implemented'); 4552 $throw('not yet implemented');
4164 } 4553 }
4165 } 4554 }
4166 Parser.prototype.parseParenthesizedExpression = function(token) { 4555 Parser.prototype.parseParenthesizedExpression = function(token) {
4167 var begin = (token && token.is$BeginGroupToken()); 4556 var begin = (token == null ? null : token.assert$BeginGroupToken());
4168 token = this.expect('(', token); 4557 token = this.expect('(', token);
4169 token = this.parseExpression(token); 4558 token = this.parseExpression(token);
4170 $assert(begin.endGroup === token, "begin.endGroup === token", "parser.dart", 7 31, 12); 4559 $assert(begin.endGroup === token, "begin.endGroup === token", "parser.dart", 7 31, 12);
4171 this.listener.handleParenthesizedExpression(begin); 4560 this.listener.handleParenthesizedExpression(begin);
4172 return this.expect(')', token); 4561 return this.expect(')', token);
4173 } 4562 }
4174 Parser.prototype.parseThisExpression = function(token) { 4563 Parser.prototype.parseThisExpression = function(token) {
4175 this.listener.handleThisExpression(token); 4564 this.listener.handleThisExpression(token);
4176 token = token.next; 4565 token = token.next;
4177 if ($notnull_bool(this.optional('(', token))) { 4566 if ($notnull_bool(this.optional('(', token))) {
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
4342 this.listener.endRethrowStatement(throwToken, token); 4731 this.listener.endRethrowStatement(throwToken, token);
4343 return token.next; 4732 return token.next;
4344 } 4733 }
4345 else { 4734 else {
4346 token = this.parseExpression(token); 4735 token = this.parseExpression(token);
4347 this.listener.endThrowStatement(throwToken, token); 4736 this.listener.endThrowStatement(throwToken, token);
4348 return this.expectSemicolon(token); 4737 return this.expectSemicolon(token);
4349 } 4738 }
4350 } 4739 }
4351 Parser.prototype.parseClass$1 = function($0) { 4740 Parser.prototype.parseClass$1 = function($0) {
4352 return this.parseClass(($0 && $0.is$Token())); 4741 return this.parseClass(($0 == null ? null : $0.assert$Token()));
4353 }; 4742 };
4354 Parser.prototype.parseFunction$1 = function($0) { 4743 Parser.prototype.parseFunction$1 = function($0) {
4355 return this.parseFunction(($0 && $0.is$Token())); 4744 return this.parseFunction(($0 == null ? null : $0.assert$Token()));
4356 }; 4745 };
4357 // ********** Code for ParserTask ************** 4746 // ********** Code for ParserTask **************
4358 function ParserTask(compiler) { 4747 function ParserTask(compiler) {
4359 // Initializers done 4748 // Initializers done
4360 CompilerTask.call(this, compiler); 4749 CompilerTask.call(this, compiler);
4361 } 4750 }
4362 $inherits(ParserTask, CompilerTask); 4751 $inherits(ParserTask, CompilerTask);
4363 ParserTask.prototype.get$name = function() { 4752 ParserTask.prototype.get$name = function() {
4364 return 'Parser'; 4753 return 'Parser';
4365 } 4754 }
4366 ParserTask.prototype.parse = function(element) { 4755 ParserTask.prototype.parse = function(element) {
4367 var $this = this; // closure support 4756 var $this = this; // closure support
4368 var $0; 4757 var $0;
4369 return (($0 = this.measure((function () { 4758 return (($0 = this.measure((function () {
4370 return element.parseNode($this.compiler, $this.compiler); 4759 return element.parseNode($this.compiler, $this.compiler);
4371 }) 4760 })
4372 )) && $0.is$Node()); 4761 )) == null ? null : $0.assert$Node());
4373 } 4762 }
4374 // ********** Code for PartialParser ************** 4763 // ********** Code for PartialParser **************
4375 function PartialParser(listener) { 4764 function PartialParser(listener) {
4376 // Initializers done 4765 // Initializers done
4377 Parser.call(this, listener); 4766 Parser.call(this, listener);
4378 } 4767 }
4379 $inherits(PartialParser, Parser); 4768 $inherits(PartialParser, Parser);
4380 PartialParser.prototype.parseClassBody = function(token) { 4769 PartialParser.prototype.parseClassBody = function(token) {
4381 return this.skipBlock(token); 4770 return this.skipBlock(token);
4382 } 4771 }
4383 PartialParser.prototype.parseExpression = function(token) { 4772 PartialParser.prototype.parseExpression = function(token) {
4384 return this.skipExpression(token); 4773 return this.skipExpression(token);
4385 } 4774 }
4386 PartialParser.prototype.skipExpression = function(token) { 4775 PartialParser.prototype.skipExpression = function(token) {
4387 while (true) { 4776 while (true) {
4388 var kind = token.kind; 4777 var kind = token.kind;
4389 if ((token.kind === 0/*null.EOF_TOKEN*/) || (token.kind === 59/*null.SEMICOL ON_TOKEN*/)) return token; 4778 if ((token.kind === 0/*null.EOF_TOKEN*/) || (token.kind === 59/*null.SEMICOL ON_TOKEN*/)) return token;
4390 if ((token instanceof BeginGroupToken)) { 4779 if ((token instanceof BeginGroupToken)) {
4391 var begin = (token && token.is$BeginGroupToken()); 4780 var begin = (token == null ? null : token.assert$BeginGroupToken());
4392 token = (begin.endGroup != null) ? begin.endGroup : token; 4781 token = (begin.endGroup != null) ? begin.endGroup : token;
4393 } 4782 }
4394 token = token.next; 4783 token = token.next;
4395 } 4784 }
4396 } 4785 }
4397 PartialParser.prototype.parseFunctionBody = function(token) { 4786 PartialParser.prototype.parseFunctionBody = function(token) {
4398 if ($notnull_bool(this.optional(';', token))) { 4787 if ($notnull_bool(this.optional(';', token))) {
4399 return token; 4788 return token;
4400 } 4789 }
4401 else if ($notnull_bool(this.optional('=>', token))) { 4790 else if ($notnull_bool(this.optional('=>', token))) {
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after
5597 $inherits(ScannerTask, CompilerTask); 5986 $inherits(ScannerTask, CompilerTask);
5598 ScannerTask.prototype.get$name = function() { 5987 ScannerTask.prototype.get$name = function() {
5599 return 'Scanner'; 5988 return 'Scanner';
5600 } 5989 }
5601 ScannerTask.prototype.scan = function(script) { 5990 ScannerTask.prototype.scan = function(script) {
5602 var $this = this; // closure support 5991 var $this = this; // closure support
5603 this.measure((function () { 5992 this.measure((function () {
5604 var $0; 5993 var $0;
5605 var elements = $this.scanElements(script.get$text()); 5994 var elements = $this.scanElements(script.get$text());
5606 for (var link = elements; 5995 for (var link = elements;
5607 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Lin k_Element())) { 5996 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == null ? nu ll : $0.assert$Link_Element())) {
5608 $this.compiler.universe.define((($0 = link.get$head()) && $0.is$Element()) ); 5997 $this.compiler.universe.define((($0 = link.get$head()) == null ? null : $0 .assert$Element()));
5609 } 5998 }
5610 }) 5999 })
5611 ); 6000 );
5612 } 6001 }
5613 ScannerTask.prototype.scanElements = function(text) { 6002 ScannerTask.prototype.scanElements = function(text) {
5614 var tokens = new StringScanner(text).tokenize(); 6003 var tokens = new StringScanner(text).tokenize();
5615 var listener = new ElementListener(this.compiler); 6004 var listener = new ElementListener(this.compiler);
5616 var parser = new PartialParser(listener); 6005 var parser = new PartialParser(listener);
5617 parser.parseUnit(tokens); 6006 parser.parseUnit(tokens);
5618 return listener.topLevelElements; 6007 return listener.topLevelElements;
(...skipping 18 matching lines...) Expand all
5637 return new SubstringWrapper(this.string, start, this.byteOffset); 6026 return new SubstringWrapper(this.string, start, this.byteOffset);
5638 } 6027 }
5639 StringScanner.prototype.utf8String = function(start, offset) { 6028 StringScanner.prototype.utf8String = function(start, offset) {
5640 return new SubstringWrapper(this.string, start, this.byteOffset + offset + 1); 6029 return new SubstringWrapper(this.string, start, this.byteOffset + offset + 1);
5641 } 6030 }
5642 StringScanner.prototype.appendByteStringToken = function(kind, value) { 6031 StringScanner.prototype.appendByteStringToken = function(kind, value) {
5643 this.tail.next = new StringToken.fromSource$ctor(kind, value, this.tokenStart) ; 6032 this.tail.next = new StringToken.fromSource$ctor(kind, value, this.tokenStart) ;
5644 this.tail = this.tail.next; 6033 this.tail = this.tail.next;
5645 } 6034 }
5646 StringScanner.prototype.appendByteStringToken$2 = function($0, $1) { 6035 StringScanner.prototype.appendByteStringToken$2 = function($0, $1) {
5647 return this.appendByteStringToken($assert_num($0), ($1 && $1.is$SourceString() )); 6036 return this.appendByteStringToken($assert_num($0), ($1 == null ? null : $1.ass ert$SourceString()));
5648 }; 6037 };
5649 // ********** Code for SubstringWrapper ************** 6038 // ********** Code for SubstringWrapper **************
5650 function SubstringWrapper(internalString, begin, end) { 6039 function SubstringWrapper(internalString, begin, end) {
5651 this.internalString = internalString; 6040 this.internalString = internalString;
5652 this.begin = begin; 6041 this.begin = begin;
5653 this.end = end; 6042 this.end = end;
5654 // Initializers done 6043 // Initializers done
5655 } 6044 }
5656 SubstringWrapper.prototype.is$SourceString = function(){return this;}; 6045 SubstringWrapper.prototype.is$SourceString = function(){return true};
6046 SubstringWrapper.prototype.assert$SourceString = function(){return this};
5657 SubstringWrapper.prototype.get$end = function() { return this.end; }; 6047 SubstringWrapper.prototype.get$end = function() { return this.end; };
5658 SubstringWrapper.prototype.hashCode = function() { 6048 SubstringWrapper.prototype.hashCode = function() {
5659 return this.toString().hashCode(); 6049 return this.toString().hashCode();
5660 } 6050 }
5661 SubstringWrapper.prototype.$eq = function(other) { 6051 SubstringWrapper.prototype.$eq = function(other) {
5662 return !!(other && other.is$SourceString) && this.toString() == other.toString $0(); 6052 return !!(other && other.is$SourceString()) && this.toString() == other.toStri ng$0();
5663 } 6053 }
5664 SubstringWrapper.prototype.printOn = function(sb) { 6054 SubstringWrapper.prototype.printOn = function(sb) {
5665 sb.add(this); 6055 sb.add(this);
5666 } 6056 }
5667 SubstringWrapper.prototype.toString = function() { 6057 SubstringWrapper.prototype.toString = function() {
5668 return this.internalString.substring(this.begin, this.end); 6058 return this.internalString.substring(this.begin, this.end);
5669 } 6059 }
5670 SubstringWrapper.prototype.get$stringValue = function() { 6060 SubstringWrapper.prototype.get$stringValue = function() {
5671 return this.toString(); 6061 return this.toString();
5672 } 6062 }
5673 SubstringWrapper.prototype.hashCode$0 = SubstringWrapper.prototype.hashCode; 6063 SubstringWrapper.prototype.hashCode$0 = SubstringWrapper.prototype.hashCode;
5674 SubstringWrapper.prototype.printOn$1 = function($0) { 6064 SubstringWrapper.prototype.printOn$1 = function($0) {
5675 return this.printOn(($0 && $0.is$StringBuffer())); 6065 return this.printOn(($0 == null ? null : $0.assert$StringBuffer()));
5676 }; 6066 };
5677 SubstringWrapper.prototype.toString$0 = SubstringWrapper.prototype.toString; 6067 SubstringWrapper.prototype.toString$0 = SubstringWrapper.prototype.toString;
5678 // ********** Code for Token ************** 6068 // ********** Code for Token **************
5679 function Token(kind, charOffset) { 6069 function Token(kind, charOffset) {
5680 this.kind = kind; 6070 this.kind = kind;
5681 this.charOffset = charOffset; 6071 this.charOffset = charOffset;
5682 // Initializers done 6072 // Initializers done
5683 } 6073 }
5684 Token.prototype.is$Token = function(){return this;}; 6074 Token.prototype.assert$Token = function(){return this};
5685 Token.prototype.get$kind = function() { return this.kind; }; 6075 Token.prototype.get$kind = function() { return this.kind; };
5686 Token.prototype.get$charOffset = function() { return this.charOffset; }; 6076 Token.prototype.get$charOffset = function() { return this.charOffset; };
5687 Token.prototype.get$value = function() { 6077 Token.prototype.get$value = function() {
5688 return const$121/*const SourceString('EOF')*/; 6078 return const$121/*const SourceString('EOF')*/;
5689 } 6079 }
5690 Token.prototype.get$stringValue = function() { 6080 Token.prototype.get$stringValue = function() {
5691 return 'EOF'; 6081 return 'EOF';
5692 } 6082 }
5693 Token.prototype.toString = function() { 6083 Token.prototype.toString = function() {
5694 return Strings.String$fromCharCodes$factory([this.kind]); 6084 return Strings.String$fromCharCodes$factory([this.kind]);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
5730 } 6120 }
5731 StringToken.prototype.toString = function() { 6121 StringToken.prototype.toString = function() {
5732 return this.value.toString(); 6122 return this.value.toString();
5733 } 6123 }
5734 StringToken.prototype.toString$0 = StringToken.prototype.toString; 6124 StringToken.prototype.toString$0 = StringToken.prototype.toString;
5735 // ********** Code for StringWrapper ************** 6125 // ********** Code for StringWrapper **************
5736 function StringWrapper(stringValue) { 6126 function StringWrapper(stringValue) {
5737 this.stringValue = stringValue; 6127 this.stringValue = stringValue;
5738 // Initializers done 6128 // Initializers done
5739 } 6129 }
5740 StringWrapper.prototype.is$SourceString = function(){return this;}; 6130 StringWrapper.prototype.is$SourceString = function(){return true};
6131 StringWrapper.prototype.assert$SourceString = function(){return this};
5741 StringWrapper.prototype.get$stringValue = function() { return this.stringValue; }; 6132 StringWrapper.prototype.get$stringValue = function() { return this.stringValue; };
5742 StringWrapper.prototype.hashCode = function() { 6133 StringWrapper.prototype.hashCode = function() {
5743 return this.stringValue.hashCode(); 6134 return this.stringValue.hashCode();
5744 } 6135 }
5745 StringWrapper.prototype.$eq = function(other) { 6136 StringWrapper.prototype.$eq = function(other) {
5746 return !!(other && other.is$SourceString) && this.toString() == other.toString $0(); 6137 return !!(other && other.is$SourceString()) && this.toString() == other.toStri ng$0();
5747 } 6138 }
5748 StringWrapper.prototype.printOn = function(sb) { 6139 StringWrapper.prototype.printOn = function(sb) {
5749 sb.add(this.stringValue); 6140 sb.add(this.stringValue);
5750 } 6141 }
5751 StringWrapper.prototype.toString = function() { 6142 StringWrapper.prototype.toString = function() {
5752 return this.stringValue; 6143 return this.stringValue;
5753 } 6144 }
5754 StringWrapper.prototype.hashCode$0 = StringWrapper.prototype.hashCode; 6145 StringWrapper.prototype.hashCode$0 = StringWrapper.prototype.hashCode;
5755 StringWrapper.prototype.printOn$1 = function($0) { 6146 StringWrapper.prototype.printOn$1 = function($0) {
5756 return this.printOn(($0 && $0.is$StringBuffer())); 6147 return this.printOn(($0 == null ? null : $0.assert$StringBuffer()));
5757 }; 6148 };
5758 StringWrapper.prototype.toString$0 = StringWrapper.prototype.toString; 6149 StringWrapper.prototype.toString$0 = StringWrapper.prototype.toString;
5759 // ********** Code for BeginGroupToken ************** 6150 // ********** Code for BeginGroupToken **************
5760 function BeginGroupToken(kind, value, charOffset) { 6151 function BeginGroupToken(kind, value, charOffset) {
5761 // Initializers done 6152 // Initializers done
5762 StringToken.call(this, kind, value, charOffset); 6153 StringToken.call(this, kind, value, charOffset);
5763 } 6154 }
5764 $inherits(BeginGroupToken, StringToken); 6155 $inherits(BeginGroupToken, StringToken);
5765 BeginGroupToken.prototype.is$BeginGroupToken = function(){return this;}; 6156 BeginGroupToken.prototype.assert$BeginGroupToken = function(){return this};
5766 BeginGroupToken.prototype.get$endGroup = function() { return this.endGroup; }; 6157 BeginGroupToken.prototype.get$endGroup = function() { return this.endGroup; };
5767 BeginGroupToken.prototype.set$endGroup = function(value) { return this.endGroup = value; }; 6158 BeginGroupToken.prototype.set$endGroup = function(value) { return this.endGroup = value; };
5768 // ********** Code for top level ************** 6159 // ********** Code for top level **************
5769 function parse(canceler, logger, doParse) { 6160 function parse(canceler, logger, doParse) {
5770 var listener = new NodeListener(canceler, logger); 6161 var listener = new NodeListener(canceler, logger);
5771 doParse(new Parser(listener)); 6162 doParse(new Parser(listener));
5772 var node = listener.popNode(); 6163 var node = listener.popNode();
5773 $assert(listener.nodes.isEmpty(), "listener.nodes.isEmpty()", "listener.dart", 747, 10); 6164 $assert(listener.nodes.isEmpty(), "listener.nodes.isEmpty()", "listener.dart", 747, 10);
5774 return node; 6165 return node;
5775 } 6166 }
5776 // ********** Library tree ************** 6167 // ********** Library tree **************
5777 // ********** Code for Node ************** 6168 // ********** Code for Node **************
5778 function Node() { 6169 function Node() {
5779 this._hashCode = ++$globals.Node__HASH_COUNTER; 6170 this._hashCode = ++$globals.Node__HASH_COUNTER;
5780 // Initializers done 6171 // Initializers done
5781 } 6172 }
5782 Node.prototype.is$Node = function(){return this;}; 6173 Node.prototype.assert$Node = function(){return this};
5783 Node.prototype.hashCode = function() { 6174 Node.prototype.hashCode = function() {
5784 return this._hashCode; 6175 return this._hashCode;
5785 } 6176 }
5786 Node.prototype.toString = function() { 6177 Node.prototype.toString = function() {
5787 return this.unparse(); 6178 return this.unparse();
5788 } 6179 }
5789 Node.prototype.getObjectDescription = function() { 6180 Node.prototype.getObjectDescription = function() {
5790 return Object.prototype.toString.call(this); 6181 return Object.prototype.toString.call(this);
5791 } 6182 }
5792 Node.prototype.unparse = function() { 6183 Node.prototype.unparse = function() {
5793 var unparser = new Unparser(false); 6184 var unparser = new Unparser(false);
5794 try { 6185 try {
5795 return unparser.unparse(this); 6186 return unparser.unparse(this);
5796 } catch (e) { 6187 } catch (e) {
5797 e = _toDartException(e); 6188 e = _toDartException(e);
5798 return ('<<unparse error: ' + this.getObjectDescription() + ': ' + unparser. sb + '>>'); 6189 return ('<<unparse error: ' + this.getObjectDescription() + ': ' + unparser. sb + '>>');
5799 } 6190 }
5800 } 6191 }
5801 Node.prototype.asOperator = function() { 6192 Node.prototype.asOperator = function() {
5802 return null; 6193 return null;
5803 } 6194 }
5804 Node.prototype.asSend = function() { 6195 Node.prototype.asSend = function() {
5805 return null; 6196 return null;
5806 } 6197 }
5807 Node.prototype.asSendSet = function() { 6198 Node.prototype.asSendSet = function() {
5808 return null; 6199 return null;
5809 } 6200 }
5810 Node.prototype.accept$1 = function($0) { 6201 Node.prototype.accept$1 = function($0) {
5811 return this.accept(($0 && $0.is$Visitor())); 6202 return this.accept(($0 == null ? null : $0.assert$Visitor()));
5812 }; 6203 };
5813 Node.prototype.getBeginToken$0 = Node.prototype.getBeginToken; 6204 Node.prototype.getBeginToken$0 = Node.prototype.getBeginToken;
5814 Node.prototype.getEndToken$0 = Node.prototype.getEndToken; 6205 Node.prototype.getEndToken$0 = Node.prototype.getEndToken;
5815 Node.prototype.hashCode$0 = Node.prototype.hashCode; 6206 Node.prototype.hashCode$0 = Node.prototype.hashCode;
5816 Node.prototype.toString$0 = Node.prototype.toString; 6207 Node.prototype.toString$0 = Node.prototype.toString;
5817 // ********** Code for ClassNode ************** 6208 // ********** Code for ClassNode **************
5818 function ClassNode(name, superclass, interfaces, beginToken, extendsKeyword, end Token) { 6209 function ClassNode(name, superclass, interfaces, beginToken, extendsKeyword, end Token) {
5819 this.name = name; 6210 this.name = name;
5820 this.superclass = superclass; 6211 this.superclass = superclass;
5821 this.interfaces = interfaces; 6212 this.interfaces = interfaces;
5822 this.beginToken = beginToken; 6213 this.beginToken = beginToken;
5823 this.extendsKeyword = extendsKeyword; 6214 this.extendsKeyword = extendsKeyword;
5824 this.endToken = endToken; 6215 this.endToken = endToken;
5825 // Initializers done 6216 // Initializers done
5826 Node.call(this); 6217 Node.call(this);
5827 } 6218 }
5828 $inherits(ClassNode, Node); 6219 $inherits(ClassNode, Node);
5829 ClassNode.prototype.is$ClassNode = function(){return this;}; 6220 ClassNode.prototype.assert$ClassNode = function(){return this};
5830 ClassNode.prototype.get$name = function() { return this.name; }; 6221 ClassNode.prototype.get$name = function() { return this.name; };
5831 ClassNode.prototype.get$interfaces = function() { return this.interfaces; }; 6222 ClassNode.prototype.get$interfaces = function() { return this.interfaces; };
5832 ClassNode.prototype.accept = function(visitor) { 6223 ClassNode.prototype.accept = function(visitor) {
5833 return visitor.visitClassNode(this); 6224 return visitor.visitClassNode(this);
5834 } 6225 }
5835 ClassNode.prototype.get$isInterface = function() { 6226 ClassNode.prototype.get$isInterface = function() {
5836 return this.beginToken.get$stringValue() === 'interface'; 6227 return this.beginToken.get$stringValue() === 'interface';
5837 } 6228 }
5838 ClassNode.prototype.get$isClass = function() { 6229 ClassNode.prototype.get$isClass = function() {
5839 return !$notnull_bool(this.get$isInterface()); 6230 return !$notnull_bool(this.get$isInterface());
5840 } 6231 }
5841 ClassNode.prototype.getBeginToken = function() { 6232 ClassNode.prototype.getBeginToken = function() {
5842 return this.beginToken; 6233 return this.beginToken;
5843 } 6234 }
5844 ClassNode.prototype.getEndToken = function() { 6235 ClassNode.prototype.getEndToken = function() {
5845 return this.endToken; 6236 return this.endToken;
5846 } 6237 }
5847 ClassNode.prototype.accept$1 = function($0) { 6238 ClassNode.prototype.accept$1 = function($0) {
5848 return this.accept(($0 && $0.is$Visitor())); 6239 return this.accept(($0 == null ? null : $0.assert$Visitor()));
5849 }; 6240 };
5850 ClassNode.prototype.getBeginToken$0 = ClassNode.prototype.getBeginToken; 6241 ClassNode.prototype.getBeginToken$0 = ClassNode.prototype.getBeginToken;
5851 ClassNode.prototype.getEndToken$0 = ClassNode.prototype.getEndToken; 6242 ClassNode.prototype.getEndToken$0 = ClassNode.prototype.getEndToken;
5852 // ********** Code for Expression ************** 6243 // ********** Code for Expression **************
5853 function Expression() { 6244 function Expression() {
5854 // Initializers done 6245 // Initializers done
5855 Node.call(this); 6246 Node.call(this);
5856 } 6247 }
5857 $inherits(Expression, Node); 6248 $inherits(Expression, Node);
5858 Expression.prototype.is$Expression = function(){return this;}; 6249 Expression.prototype.assert$Expression = function(){return this};
5859 // ********** Code for Statement ************** 6250 // ********** Code for Statement **************
5860 function Statement() { 6251 function Statement() {
5861 // Initializers done 6252 // Initializers done
5862 Node.call(this); 6253 Node.call(this);
5863 } 6254 }
5864 $inherits(Statement, Node); 6255 $inherits(Statement, Node);
5865 Statement.prototype.is$Statement = function(){return this;}; 6256 Statement.prototype.assert$Statement = function(){return this};
5866 // ********** Code for Send ************** 6257 // ********** Code for Send **************
5867 function Send(receiver, selector, argumentsNode) { 6258 function Send(receiver, selector, argumentsNode) {
5868 this.receiver = receiver; 6259 this.receiver = receiver;
5869 this.selector = selector; 6260 this.selector = selector;
5870 this.argumentsNode = argumentsNode; 6261 this.argumentsNode = argumentsNode;
5871 // Initializers done 6262 // Initializers done
5872 Expression.call(this); 6263 Expression.call(this);
5873 } 6264 }
5874 Send.postfix$ctor = function(receiver, selector) { 6265 Send.postfix$ctor = function(receiver, selector) {
5875 this.receiver = receiver; 6266 this.receiver = receiver;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
5914 } 6305 }
5915 Send.prototype.getBeginToken = function() { 6306 Send.prototype.getBeginToken = function() {
5916 return firstBeginToken(this.receiver, this.selector); 6307 return firstBeginToken(this.receiver, this.selector);
5917 } 6308 }
5918 Send.prototype.getEndToken = function() { 6309 Send.prototype.getEndToken = function() {
5919 var $0; 6310 var $0;
5920 var token; 6311 var token;
5921 if (this.argumentsNode != null) token = this.argumentsNode.getEndToken(); 6312 if (this.argumentsNode != null) token = this.argumentsNode.getEndToken();
5922 if (token != null) return token; 6313 if (token != null) return token;
5923 if (this.selector != null) { 6314 if (this.selector != null) {
5924 return (($0 = this.selector.getEndToken()) && $0.is$Token()); 6315 return (($0 = this.selector.getEndToken()) == null ? null : $0.assert$Token( ));
5925 } 6316 }
5926 return (($0 = this.receiver.getBeginToken()) && $0.is$Token()); 6317 return (($0 = this.receiver.getBeginToken()) == null ? null : $0.assert$Token( ));
5927 } 6318 }
5928 Send.prototype.copyWithReceiver = function(receiver) { 6319 Send.prototype.copyWithReceiver = function(receiver) {
5929 return new Send(receiver, this.selector, this.argumentsNode); 6320 return new Send(receiver, this.selector, this.argumentsNode);
5930 } 6321 }
5931 Send.prototype.accept$1 = function($0) { 6322 Send.prototype.accept$1 = function($0) {
5932 return this.accept(($0 && $0.is$Visitor())); 6323 return this.accept(($0 == null ? null : $0.assert$Visitor()));
5933 }; 6324 };
5934 Send.prototype.getBeginToken$0 = Send.prototype.getBeginToken; 6325 Send.prototype.getBeginToken$0 = Send.prototype.getBeginToken;
5935 Send.prototype.getEndToken$0 = Send.prototype.getEndToken; 6326 Send.prototype.getEndToken$0 = Send.prototype.getEndToken;
5936 // ********** Code for Postfix ************** 6327 // ********** Code for Postfix **************
5937 function Postfix() { 6328 function Postfix() {
5938 // Initializers done 6329 // Initializers done
5939 NodeList.call(this); 6330 NodeList.call(this);
5940 } 6331 }
5941 $inherits(Postfix, NodeList); 6332 $inherits(Postfix, NodeList);
5942 // ********** Code for Prefix ************** 6333 // ********** Code for Prefix **************
(...skipping 14 matching lines...) Expand all
5957 Send.postfix$ctor.call(this, receiver, selector); 6348 Send.postfix$ctor.call(this, receiver, selector);
5958 } 6349 }
5959 SendSet.postfix$ctor.prototype = SendSet.prototype; 6350 SendSet.postfix$ctor.prototype = SendSet.prototype;
5960 SendSet.prefix$ctor = function(receiver, selector, assignmentOperator) { 6351 SendSet.prefix$ctor = function(receiver, selector, assignmentOperator) {
5961 this.assignmentOperator = assignmentOperator; 6352 this.assignmentOperator = assignmentOperator;
5962 // Initializers done 6353 // Initializers done
5963 Send.prefix$ctor.call(this, receiver, selector); 6354 Send.prefix$ctor.call(this, receiver, selector);
5964 } 6355 }
5965 SendSet.prefix$ctor.prototype = SendSet.prototype; 6356 SendSet.prefix$ctor.prototype = SendSet.prototype;
5966 $inherits(SendSet, Send); 6357 $inherits(SendSet, Send);
5967 SendSet.prototype.is$SendSet = function(){return this;}; 6358 SendSet.prototype.assert$SendSet = function(){return this};
5968 SendSet.prototype.asSendSet = function() { 6359 SendSet.prototype.asSendSet = function() {
5969 return this; 6360 return this;
5970 } 6361 }
5971 SendSet.prototype.accept = function(visitor) { 6362 SendSet.prototype.accept = function(visitor) {
5972 return visitor.visitSendSet(this); 6363 return visitor.visitSendSet(this);
5973 } 6364 }
5974 SendSet.prototype.copyWithReceiver = function(receiver) { 6365 SendSet.prototype.copyWithReceiver = function(receiver) {
5975 $throw('not implemented'); 6366 $throw('not implemented');
5976 } 6367 }
5977 SendSet.prototype.accept$1 = function($0) { 6368 SendSet.prototype.accept$1 = function($0) {
5978 return this.accept(($0 && $0.is$Visitor())); 6369 return this.accept(($0 == null ? null : $0.assert$Visitor()));
5979 }; 6370 };
5980 // ********** Code for NodeList ************** 6371 // ********** Code for NodeList **************
5981 function NodeList(beginToken, nodes, endToken, delimiter) { 6372 function NodeList(beginToken, nodes, endToken, delimiter) {
5982 this.beginToken = beginToken; 6373 this.beginToken = beginToken;
5983 this.endToken = endToken; 6374 this.endToken = endToken;
5984 this.delimiter = delimiter; 6375 this.delimiter = delimiter;
5985 this._nodes = nodes; 6376 this._nodes = nodes;
5986 // Initializers done 6377 // Initializers done
5987 Node.call(this); 6378 Node.call(this);
5988 } 6379 }
5989 NodeList.singleton$ctor = function(node) { 6380 NodeList.singleton$ctor = function(node) {
5990 // Initializers done 6381 // Initializers done
5991 NodeList.call(this, null, LinkFactory.Link$factory(node)); 6382 NodeList.call(this, null, LinkFactory.Link$factory(node));
5992 } 6383 }
5993 NodeList.singleton$ctor.prototype = NodeList.prototype; 6384 NodeList.singleton$ctor.prototype = NodeList.prototype;
5994 $inherits(NodeList, Node); 6385 $inherits(NodeList, Node);
5995 NodeList.prototype.is$NodeList = function(){return this;}; 6386 NodeList.prototype.assert$NodeList = function(){return this};
5996 NodeList.prototype.get$nodes = function() { 6387 NodeList.prototype.get$nodes = function() {
5997 var $0; 6388 var $0;
5998 return (($0 = this._nodes != null ? this._nodes : const$209/*const EmptyLink<N ode>()*/) && $0.is$Link_Node()); 6389 return (($0 = this._nodes != null ? this._nodes : const$209/*const EmptyLink<N ode>()*/) == null ? null : $0.assert$Link_Node());
5999 } 6390 }
6000 NodeList.prototype.accept = function(visitor) { 6391 NodeList.prototype.accept = function(visitor) {
6001 return visitor.visitNodeList(this); 6392 return visitor.visitNodeList(this);
6002 } 6393 }
6003 NodeList.prototype.getBeginToken = function() { 6394 NodeList.prototype.getBeginToken = function() {
6004 var $0; 6395 var $0;
6005 if (this.beginToken != null) return this.beginToken; 6396 if (this.beginToken != null) return this.beginToken;
6006 if (this.get$nodes() != null) { 6397 if (this.get$nodes() != null) {
6007 for (var link = this.get$nodes(); 6398 for (var link = this.get$nodes();
6008 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Lin k_Node())) { 6399 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == null ? nu ll : $0.assert$Link_Node())) {
6009 if (link.get$head().getBeginToken$0() != null) { 6400 if (link.get$head().getBeginToken$0() != null) {
6010 return (($0 = link.get$head().getBeginToken$0()) && $0.is$Token()); 6401 return (($0 = link.get$head().getBeginToken$0()) == null ? null : $0.ass ert$Token());
6011 } 6402 }
6012 if (link.get$head().getEndToken$0() != null) { 6403 if (link.get$head().getEndToken$0() != null) {
6013 return (($0 = link.get$head().getEndToken$0()) && $0.is$Token()); 6404 return (($0 = link.get$head().getEndToken$0()) == null ? null : $0.asser t$Token());
6014 } 6405 }
6015 } 6406 }
6016 } 6407 }
6017 return this.endToken; 6408 return this.endToken;
6018 } 6409 }
6019 NodeList.prototype.getEndToken = function() { 6410 NodeList.prototype.getEndToken = function() {
6020 var $0; 6411 var $0;
6021 if (this.endToken != null) return this.endToken; 6412 if (this.endToken != null) return this.endToken;
6022 if (this.get$nodes() != null) { 6413 if (this.get$nodes() != null) {
6023 var link = this.get$nodes(); 6414 var link = this.get$nodes();
6024 if ($notnull_bool(link.isEmpty())) return this.beginToken; 6415 if ($notnull_bool(link.isEmpty())) return this.beginToken;
6025 while (!$notnull_bool(link.get$tail().isEmpty$0())) link = (($0 = link.get$t ail()) && $0.is$Link_Node()); 6416 while (!$notnull_bool(link.get$tail().isEmpty$0())) link = (($0 = link.get$t ail()) == null ? null : $0.assert$Link_Node());
6026 if (link.get$head().getEndToken$0() != null) return (($0 = link.get$head().g etEndToken$0()) && $0.is$Token()); 6417 if (link.get$head().getEndToken$0() != null) return (($0 = link.get$head().g etEndToken$0()) == null ? null : $0.assert$Token());
6027 if (link.get$head().getBeginToken$0() != null) return (($0 = link.get$head() .getBeginToken$0()) && $0.is$Token()); 6418 if (link.get$head().getBeginToken$0() != null) return (($0 = link.get$head() .getBeginToken$0()) == null ? null : $0.assert$Token());
6028 } 6419 }
6029 return this.beginToken; 6420 return this.beginToken;
6030 } 6421 }
6031 NodeList.prototype.accept$1 = function($0) { 6422 NodeList.prototype.accept$1 = function($0) {
6032 return this.accept(($0 && $0.is$Visitor())); 6423 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6033 }; 6424 };
6034 NodeList.prototype.getBeginToken$0 = NodeList.prototype.getBeginToken; 6425 NodeList.prototype.getBeginToken$0 = NodeList.prototype.getBeginToken;
6035 NodeList.prototype.getEndToken$0 = NodeList.prototype.getEndToken; 6426 NodeList.prototype.getEndToken$0 = NodeList.prototype.getEndToken;
6036 // ********** Code for Block ************** 6427 // ********** Code for Block **************
6037 function Block(statements) { 6428 function Block(statements) {
6038 this.statements = statements; 6429 this.statements = statements;
6039 // Initializers done 6430 // Initializers done
6040 Statement.call(this); 6431 Statement.call(this);
6041 } 6432 }
6042 $inherits(Block, Statement); 6433 $inherits(Block, Statement);
6043 Block.prototype.get$statements = function() { return this.statements; }; 6434 Block.prototype.get$statements = function() { return this.statements; };
6044 Block.prototype.accept = function(visitor) { 6435 Block.prototype.accept = function(visitor) {
6045 return visitor.visitBlock(this); 6436 return visitor.visitBlock(this);
6046 } 6437 }
6047 Block.prototype.getBeginToken = function() { 6438 Block.prototype.getBeginToken = function() {
6048 return this.statements.getBeginToken(); 6439 return this.statements.getBeginToken();
6049 } 6440 }
6050 Block.prototype.getEndToken = function() { 6441 Block.prototype.getEndToken = function() {
6051 return this.statements.getEndToken(); 6442 return this.statements.getEndToken();
6052 } 6443 }
6053 Block.prototype.accept$1 = function($0) { 6444 Block.prototype.accept$1 = function($0) {
6054 return this.accept(($0 && $0.is$Visitor())); 6445 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6055 }; 6446 };
6056 Block.prototype.getBeginToken$0 = Block.prototype.getBeginToken; 6447 Block.prototype.getBeginToken$0 = Block.prototype.getBeginToken;
6057 Block.prototype.getEndToken$0 = Block.prototype.getEndToken; 6448 Block.prototype.getEndToken$0 = Block.prototype.getEndToken;
6058 // ********** Code for If ************** 6449 // ********** Code for If **************
6059 function If(condition, thenPart, elsePart, ifToken, elseToken) { 6450 function If(condition, thenPart, elsePart, ifToken, elseToken) {
6060 this.condition = condition; 6451 this.condition = condition;
6061 this.thenPart = thenPart; 6452 this.thenPart = thenPart;
6062 this.elsePart = elsePart; 6453 this.elsePart = elsePart;
6063 this.ifToken = ifToken; 6454 this.ifToken = ifToken;
6064 this.elseToken = elseToken; 6455 this.elseToken = elseToken;
6065 // Initializers done 6456 // Initializers done
6066 Statement.call(this); 6457 Statement.call(this);
6067 } 6458 }
6068 $inherits(If, Statement); 6459 $inherits(If, Statement);
6069 If.prototype.get$hasElsePart = function() { 6460 If.prototype.get$hasElsePart = function() {
6070 return this.elsePart != null; 6461 return this.elsePart != null;
6071 } 6462 }
6072 If.prototype.accept = function(visitor) { 6463 If.prototype.accept = function(visitor) {
6073 return visitor.visitIf(this); 6464 return visitor.visitIf(this);
6074 } 6465 }
6075 If.prototype.getBeginToken = function() { 6466 If.prototype.getBeginToken = function() {
6076 return this.ifToken; 6467 return this.ifToken;
6077 } 6468 }
6078 If.prototype.getEndToken = function() { 6469 If.prototype.getEndToken = function() {
6079 if (this.elsePart == null) return this.thenPart.getEndToken(); 6470 if (this.elsePart == null) return this.thenPart.getEndToken();
6080 return this.elsePart.getEndToken(); 6471 return this.elsePart.getEndToken();
6081 } 6472 }
6082 If.prototype.accept$1 = function($0) { 6473 If.prototype.accept$1 = function($0) {
6083 return this.accept(($0 && $0.is$Visitor())); 6474 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6084 }; 6475 };
6085 If.prototype.getBeginToken$0 = If.prototype.getBeginToken; 6476 If.prototype.getBeginToken$0 = If.prototype.getBeginToken;
6086 If.prototype.getEndToken$0 = If.prototype.getEndToken; 6477 If.prototype.getEndToken$0 = If.prototype.getEndToken;
6087 // ********** Code for For ************** 6478 // ********** Code for For **************
6088 function For(initializer, conditionStatement, update, body, forToken) { 6479 function For(initializer, conditionStatement, update, body, forToken) {
6089 this.initializer = initializer; 6480 this.initializer = initializer;
6090 this.conditionStatement = conditionStatement; 6481 this.conditionStatement = conditionStatement;
6091 this.update = update; 6482 this.update = update;
6092 this.forToken = forToken; 6483 this.forToken = forToken;
6093 // Initializers done 6484 // Initializers done
6094 Loop.call(this, body); 6485 Loop.call(this, body);
6095 } 6486 }
6096 $inherits(For, Loop); 6487 $inherits(For, Loop);
6097 For.prototype.get$condition = function() { 6488 For.prototype.get$condition = function() {
6098 return this.conditionStatement.expression; 6489 return this.conditionStatement.expression;
6099 } 6490 }
6100 For.prototype.accept = function(visitor) { 6491 For.prototype.accept = function(visitor) {
6101 return visitor.visitFor(this); 6492 return visitor.visitFor(this);
6102 } 6493 }
6103 For.prototype.getBeginToken = function() { 6494 For.prototype.getBeginToken = function() {
6104 return this.forToken; 6495 return this.forToken;
6105 } 6496 }
6106 For.prototype.getEndToken = function() { 6497 For.prototype.getEndToken = function() {
6107 return this.body.getEndToken(); 6498 return this.body.getEndToken();
6108 } 6499 }
6109 For.prototype.accept$1 = function($0) { 6500 For.prototype.accept$1 = function($0) {
6110 return this.accept(($0 && $0.is$Visitor())); 6501 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6111 }; 6502 };
6112 For.prototype.getBeginToken$0 = For.prototype.getBeginToken; 6503 For.prototype.getBeginToken$0 = For.prototype.getBeginToken;
6113 For.prototype.getEndToken$0 = For.prototype.getEndToken; 6504 For.prototype.getEndToken$0 = For.prototype.getEndToken;
6114 // ********** Code for FunctionExpression ************** 6505 // ********** Code for FunctionExpression **************
6115 function FunctionExpression(name, parameters, body, returnType) { 6506 function FunctionExpression(name, parameters, body, returnType) {
6116 this.name = name; 6507 this.name = name;
6117 this.parameters = parameters; 6508 this.parameters = parameters;
6118 this.body = body; 6509 this.body = body;
6119 this.returnType = returnType; 6510 this.returnType = returnType;
6120 // Initializers done 6511 // Initializers done
6121 Expression.call(this); 6512 Expression.call(this);
6122 } 6513 }
6123 $inherits(FunctionExpression, Expression); 6514 $inherits(FunctionExpression, Expression);
6124 FunctionExpression.prototype.is$FunctionExpression = function(){return this;}; 6515 FunctionExpression.prototype.assert$FunctionExpression = function(){return this} ;
6125 FunctionExpression.prototype.get$name = function() { return this.name; }; 6516 FunctionExpression.prototype.get$name = function() { return this.name; };
6126 FunctionExpression.prototype.get$parameters = function() { return this.parameter s; }; 6517 FunctionExpression.prototype.get$parameters = function() { return this.parameter s; };
6127 FunctionExpression.prototype.get$body = function() { return this.body; }; 6518 FunctionExpression.prototype.get$body = function() { return this.body; };
6128 FunctionExpression.prototype.get$returnType = function() { return this.returnTyp e; }; 6519 FunctionExpression.prototype.get$returnType = function() { return this.returnTyp e; };
6129 FunctionExpression.prototype.accept = function(visitor) { 6520 FunctionExpression.prototype.accept = function(visitor) {
6130 return visitor.visitFunctionExpression(this); 6521 return visitor.visitFunctionExpression(this);
6131 } 6522 }
6132 FunctionExpression.prototype.getBeginToken = function() { 6523 FunctionExpression.prototype.getBeginToken = function() {
6133 return firstBeginToken(this.returnType, this.name); 6524 return firstBeginToken(this.returnType, this.name);
6134 } 6525 }
6135 FunctionExpression.prototype.getEndToken = function() { 6526 FunctionExpression.prototype.getEndToken = function() {
6136 return this.body.getEndToken(); 6527 return this.body.getEndToken();
6137 } 6528 }
6138 FunctionExpression.prototype.accept$1 = function($0) { 6529 FunctionExpression.prototype.accept$1 = function($0) {
6139 return this.accept(($0 && $0.is$Visitor())); 6530 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6140 }; 6531 };
6141 FunctionExpression.prototype.getBeginToken$0 = FunctionExpression.prototype.getB eginToken; 6532 FunctionExpression.prototype.getBeginToken$0 = FunctionExpression.prototype.getB eginToken;
6142 FunctionExpression.prototype.getEndToken$0 = FunctionExpression.prototype.getEnd Token; 6533 FunctionExpression.prototype.getEndToken$0 = FunctionExpression.prototype.getEnd Token;
6143 // ********** Code for Literal ************** 6534 // ********** Code for Literal **************
6144 function Literal(token, handler) { 6535 function Literal(token, handler) {
6145 this.token = token; 6536 this.token = token;
6146 this.handler = handler; 6537 this.handler = handler;
6147 // Initializers done 6538 // Initializers done
6148 Expression.call(this); 6539 Expression.call(this);
6149 } 6540 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
6200 } catch (ex) { 6591 } catch (ex) {
6201 ex = _toDartException(ex); 6592 ex = _toDartException(ex);
6202 if (!(ex instanceof BadNumberFormatException)) throw ex; 6593 if (!(ex instanceof BadNumberFormatException)) throw ex;
6203 (this.handler)(this.token, ex); 6594 (this.handler)(this.token, ex);
6204 } 6595 }
6205 } 6596 }
6206 LiteralInt.prototype.accept = function(visitor) { 6597 LiteralInt.prototype.accept = function(visitor) {
6207 return visitor.visitLiteralInt(this); 6598 return visitor.visitLiteralInt(this);
6208 } 6599 }
6209 LiteralInt.prototype.accept$1 = function($0) { 6600 LiteralInt.prototype.accept$1 = function($0) {
6210 return this.accept(($0 && $0.is$Visitor())); 6601 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6211 }; 6602 };
6212 // ********** Code for LiteralDouble ************** 6603 // ********** Code for LiteralDouble **************
6213 function LiteralDouble(token, handler) { 6604 function LiteralDouble(token, handler) {
6214 // Initializers done 6605 // Initializers done
6215 Literal_double.call(this, token, handler); 6606 Literal_double.call(this, token, handler);
6216 } 6607 }
6217 $inherits(LiteralDouble, Literal_double); 6608 $inherits(LiteralDouble, Literal_double);
6218 LiteralDouble.prototype.get$value = function() { 6609 LiteralDouble.prototype.get$value = function() {
6219 try { 6610 try {
6220 return Math.parseDouble(this.token.get$value().toString$0()); 6611 return Math.parseDouble(this.token.get$value().toString$0());
6221 } catch (ex) { 6612 } catch (ex) {
6222 ex = _toDartException(ex); 6613 ex = _toDartException(ex);
6223 if (!(ex instanceof BadNumberFormatException)) throw ex; 6614 if (!(ex instanceof BadNumberFormatException)) throw ex;
6224 (this.handler)(this.token, ex); 6615 (this.handler)(this.token, ex);
6225 } 6616 }
6226 } 6617 }
6227 LiteralDouble.prototype.accept = function(visitor) { 6618 LiteralDouble.prototype.accept = function(visitor) {
6228 return visitor.visitLiteralDouble(this); 6619 return visitor.visitLiteralDouble(this);
6229 } 6620 }
6230 LiteralDouble.prototype.accept$1 = function($0) { 6621 LiteralDouble.prototype.accept$1 = function($0) {
6231 return this.accept(($0 && $0.is$Visitor())); 6622 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6232 }; 6623 };
6233 // ********** Code for LiteralBool ************** 6624 // ********** Code for LiteralBool **************
6234 function LiteralBool(token, handler) { 6625 function LiteralBool(token, handler) {
6235 // Initializers done 6626 // Initializers done
6236 Literal_bool.call(this, token, handler); 6627 Literal_bool.call(this, token, handler);
6237 } 6628 }
6238 $inherits(LiteralBool, Literal_bool); 6629 $inherits(LiteralBool, Literal_bool);
6239 LiteralBool.prototype.get$value = function() { 6630 LiteralBool.prototype.get$value = function() {
6240 switch (this.token.get$value()) { 6631 switch (this.token.get$value()) {
6241 case const$75/*Keyword.TRUE*/: 6632 case const$75/*Keyword.TRUE*/:
6242 6633
6243 return true; 6634 return true;
6244 6635
6245 case const$47/*Keyword.FALSE*/: 6636 case const$47/*Keyword.FALSE*/:
6246 6637
6247 return false; 6638 return false;
6248 6639
6249 default: 6640 default:
6250 6641
6251 (this.handler)(this.token, ("not a bool " + this.token.get$value())); 6642 (this.handler)(this.token, ("not a bool " + this.token.get$value()));
6252 6643
6253 } 6644 }
6254 } 6645 }
6255 LiteralBool.prototype.accept = function(visitor) { 6646 LiteralBool.prototype.accept = function(visitor) {
6256 return visitor.visitLiteralBool(this); 6647 return visitor.visitLiteralBool(this);
6257 } 6648 }
6258 LiteralBool.prototype.accept$1 = function($0) { 6649 LiteralBool.prototype.accept$1 = function($0) {
6259 return this.accept(($0 && $0.is$Visitor())); 6650 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6260 }; 6651 };
6261 // ********** Code for LiteralString ************** 6652 // ********** Code for LiteralString **************
6262 function LiteralString(token) { 6653 function LiteralString(token) {
6263 // Initializers done 6654 // Initializers done
6264 Literal_SourceString.call(this, token, to$call$2(null)); 6655 Literal_SourceString.call(this, token, to$call$2(null));
6265 } 6656 }
6266 $inherits(LiteralString, Literal_SourceString); 6657 $inherits(LiteralString, Literal_SourceString);
6267 LiteralString.prototype.is$LiteralString = function(){return this;}; 6658 LiteralString.prototype.assert$LiteralString = function(){return this};
6268 LiteralString.prototype.get$value = function() { 6659 LiteralString.prototype.get$value = function() {
6269 var $0; 6660 var $0;
6270 return (($0 = this.token.get$value()) && $0.is$SourceString()); 6661 return (($0 = this.token.get$value()) == null ? null : $0.assert$SourceString( ));
6271 } 6662 }
6272 LiteralString.prototype.accept = function(visitor) { 6663 LiteralString.prototype.accept = function(visitor) {
6273 return visitor.visitLiteralString(this); 6664 return visitor.visitLiteralString(this);
6274 } 6665 }
6275 LiteralString.prototype.accept$1 = function($0) { 6666 LiteralString.prototype.accept$1 = function($0) {
6276 return this.accept(($0 && $0.is$Visitor())); 6667 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6277 }; 6668 };
6278 // ********** Code for LiteralNull ************** 6669 // ********** Code for LiteralNull **************
6279 function LiteralNull(token) { 6670 function LiteralNull(token) {
6280 // Initializers done 6671 // Initializers done
6281 Literal_SourceString.call(this, token, to$call$2(null)); 6672 Literal_SourceString.call(this, token, to$call$2(null));
6282 } 6673 }
6283 $inherits(LiteralNull, Literal_SourceString); 6674 $inherits(LiteralNull, Literal_SourceString);
6284 LiteralNull.prototype.get$value = function() { 6675 LiteralNull.prototype.get$value = function() {
6285 return null; 6676 return null;
6286 } 6677 }
6287 LiteralNull.prototype.accept = function(visitor) { 6678 LiteralNull.prototype.accept = function(visitor) {
6288 return visitor.visitLiteralNull(this); 6679 return visitor.visitLiteralNull(this);
6289 } 6680 }
6290 LiteralNull.prototype.accept$1 = function($0) { 6681 LiteralNull.prototype.accept$1 = function($0) {
6291 return this.accept(($0 && $0.is$Visitor())); 6682 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6292 }; 6683 };
6293 // ********** Code for Identifier ************** 6684 // ********** Code for Identifier **************
6294 function Identifier(token) { 6685 function Identifier(token) {
6295 this.token = token; 6686 this.token = token;
6296 // Initializers done 6687 // Initializers done
6297 Expression.call(this); 6688 Expression.call(this);
6298 } 6689 }
6299 $inherits(Identifier, Expression); 6690 $inherits(Identifier, Expression);
6300 Identifier.prototype.is$Identifier = function(){return this;}; 6691 Identifier.prototype.assert$Identifier = function(){return this};
6301 Identifier.prototype.get$source = function() { 6692 Identifier.prototype.get$source = function() {
6302 var $0; 6693 var $0;
6303 return (($0 = this.token.get$value()) && $0.is$SourceString()); 6694 return (($0 = this.token.get$value()) == null ? null : $0.assert$SourceString( ));
6304 } 6695 }
6305 Identifier.prototype.accept = function(visitor) { 6696 Identifier.prototype.accept = function(visitor) {
6306 return visitor.visitIdentifier(this); 6697 return visitor.visitIdentifier(this);
6307 } 6698 }
6308 Identifier.prototype.getBeginToken = function() { 6699 Identifier.prototype.getBeginToken = function() {
6309 return this.token; 6700 return this.token;
6310 } 6701 }
6311 Identifier.prototype.getEndToken = function() { 6702 Identifier.prototype.getEndToken = function() {
6312 return this.token; 6703 return this.token;
6313 } 6704 }
6314 Identifier.prototype.accept$1 = function($0) { 6705 Identifier.prototype.accept$1 = function($0) {
6315 return this.accept(($0 && $0.is$Visitor())); 6706 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6316 }; 6707 };
6317 Identifier.prototype.getBeginToken$0 = Identifier.prototype.getBeginToken; 6708 Identifier.prototype.getBeginToken$0 = Identifier.prototype.getBeginToken;
6318 Identifier.prototype.getEndToken$0 = Identifier.prototype.getEndToken; 6709 Identifier.prototype.getEndToken$0 = Identifier.prototype.getEndToken;
6319 // ********** Code for Operator ************** 6710 // ********** Code for Operator **************
6320 function Operator(token) { 6711 function Operator(token) {
6321 // Initializers done 6712 // Initializers done
6322 Identifier.call(this, token); 6713 Identifier.call(this, token);
6323 } 6714 }
6324 $inherits(Operator, Identifier); 6715 $inherits(Operator, Identifier);
6325 Operator.prototype.is$Operator = function(){return this;}; 6716 Operator.prototype.assert$Operator = function(){return this};
6326 Operator.prototype.asOperator = function() { 6717 Operator.prototype.asOperator = function() {
6327 return this; 6718 return this;
6328 } 6719 }
6329 Operator.prototype.accept = function(visitor) { 6720 Operator.prototype.accept = function(visitor) {
6330 return visitor.visitOperator(this); 6721 return visitor.visitOperator(this);
6331 } 6722 }
6332 Operator.prototype.accept$1 = function($0) { 6723 Operator.prototype.accept$1 = function($0) {
6333 return this.accept(($0 && $0.is$Visitor())); 6724 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6334 }; 6725 };
6335 // ********** Code for Return ************** 6726 // ********** Code for Return **************
6336 function Return(beginToken, endToken, expression) { 6727 function Return(beginToken, endToken, expression) {
6337 this.beginToken = beginToken; 6728 this.beginToken = beginToken;
6338 this.endToken = endToken; 6729 this.endToken = endToken;
6339 this.expression = expression; 6730 this.expression = expression;
6340 // Initializers done 6731 // Initializers done
6341 Statement.call(this); 6732 Statement.call(this);
6342 } 6733 }
6343 $inherits(Return, Statement); 6734 $inherits(Return, Statement);
6344 Return.prototype.get$hasExpression = function() { 6735 Return.prototype.get$hasExpression = function() {
6345 return this.expression != null; 6736 return this.expression != null;
6346 } 6737 }
6347 Return.prototype.accept = function(visitor) { 6738 Return.prototype.accept = function(visitor) {
6348 return visitor.visitReturn(this); 6739 return visitor.visitReturn(this);
6349 } 6740 }
6350 Return.prototype.getBeginToken = function() { 6741 Return.prototype.getBeginToken = function() {
6351 return this.beginToken; 6742 return this.beginToken;
6352 } 6743 }
6353 Return.prototype.getEndToken = function() { 6744 Return.prototype.getEndToken = function() {
6354 return this.endToken; 6745 return this.endToken;
6355 } 6746 }
6356 Return.prototype.accept$1 = function($0) { 6747 Return.prototype.accept$1 = function($0) {
6357 return this.accept(($0 && $0.is$Visitor())); 6748 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6358 }; 6749 };
6359 Return.prototype.getBeginToken$0 = Return.prototype.getBeginToken; 6750 Return.prototype.getBeginToken$0 = Return.prototype.getBeginToken;
6360 Return.prototype.getEndToken$0 = Return.prototype.getEndToken; 6751 Return.prototype.getEndToken$0 = Return.prototype.getEndToken;
6361 // ********** Code for ExpressionStatement ************** 6752 // ********** Code for ExpressionStatement **************
6362 function ExpressionStatement(expression, endToken) { 6753 function ExpressionStatement(expression, endToken) {
6363 this.expression = expression; 6754 this.expression = expression;
6364 this.endToken = endToken; 6755 this.endToken = endToken;
6365 // Initializers done 6756 // Initializers done
6366 Statement.call(this); 6757 Statement.call(this);
6367 } 6758 }
6368 $inherits(ExpressionStatement, Statement); 6759 $inherits(ExpressionStatement, Statement);
6369 ExpressionStatement.prototype.is$ExpressionStatement = function(){return this;}; 6760 ExpressionStatement.prototype.assert$ExpressionStatement = function(){return thi s};
6370 ExpressionStatement.prototype.accept = function(visitor) { 6761 ExpressionStatement.prototype.accept = function(visitor) {
6371 return visitor.visitExpressionStatement(this); 6762 return visitor.visitExpressionStatement(this);
6372 } 6763 }
6373 ExpressionStatement.prototype.getBeginToken = function() { 6764 ExpressionStatement.prototype.getBeginToken = function() {
6374 var $0; 6765 var $0;
6375 return (($0 = this.expression.getBeginToken()) && $0.is$Token()); 6766 return (($0 = this.expression.getBeginToken()) == null ? null : $0.assert$Toke n());
6376 } 6767 }
6377 ExpressionStatement.prototype.getEndToken = function() { 6768 ExpressionStatement.prototype.getEndToken = function() {
6378 return this.endToken; 6769 return this.endToken;
6379 } 6770 }
6380 ExpressionStatement.prototype.accept$1 = function($0) { 6771 ExpressionStatement.prototype.accept$1 = function($0) {
6381 return this.accept(($0 && $0.is$Visitor())); 6772 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6382 }; 6773 };
6383 ExpressionStatement.prototype.getBeginToken$0 = ExpressionStatement.prototype.ge tBeginToken; 6774 ExpressionStatement.prototype.getBeginToken$0 = ExpressionStatement.prototype.ge tBeginToken;
6384 ExpressionStatement.prototype.getEndToken$0 = ExpressionStatement.prototype.getE ndToken; 6775 ExpressionStatement.prototype.getEndToken$0 = ExpressionStatement.prototype.getE ndToken;
6385 // ********** Code for Throw ************** 6776 // ********** Code for Throw **************
6386 function Throw(expression, throwToken, endToken) { 6777 function Throw(expression, throwToken, endToken) {
6387 this.expression = expression; 6778 this.expression = expression;
6388 this.throwToken = throwToken; 6779 this.throwToken = throwToken;
6389 this.endToken = endToken; 6780 this.endToken = endToken;
6390 // Initializers done 6781 // Initializers done
6391 Statement.call(this); 6782 Statement.call(this);
6392 } 6783 }
6393 $inherits(Throw, Statement); 6784 $inherits(Throw, Statement);
6394 Throw.prototype.accept = function(visitor) { 6785 Throw.prototype.accept = function(visitor) {
6395 return visitor.visitThrow(this); 6786 return visitor.visitThrow(this);
6396 } 6787 }
6397 Throw.prototype.getBeginToken = function() { 6788 Throw.prototype.getBeginToken = function() {
6398 return this.throwToken; 6789 return this.throwToken;
6399 } 6790 }
6400 Throw.prototype.getEndToken = function() { 6791 Throw.prototype.getEndToken = function() {
6401 return this.endToken; 6792 return this.endToken;
6402 } 6793 }
6403 Throw.prototype.accept$1 = function($0) { 6794 Throw.prototype.accept$1 = function($0) {
6404 return this.accept(($0 && $0.is$Visitor())); 6795 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6405 }; 6796 };
6406 Throw.prototype.getBeginToken$0 = Throw.prototype.getBeginToken; 6797 Throw.prototype.getBeginToken$0 = Throw.prototype.getBeginToken;
6407 Throw.prototype.getEndToken$0 = Throw.prototype.getEndToken; 6798 Throw.prototype.getEndToken$0 = Throw.prototype.getEndToken;
6408 // ********** Code for TypeAnnotation ************** 6799 // ********** Code for TypeAnnotation **************
6409 function TypeAnnotation(typeName) { 6800 function TypeAnnotation(typeName) {
6410 this.typeName = typeName; 6801 this.typeName = typeName;
6411 // Initializers done 6802 // Initializers done
6412 Node.call(this); 6803 Node.call(this);
6413 } 6804 }
6414 $inherits(TypeAnnotation, Node); 6805 $inherits(TypeAnnotation, Node);
6415 TypeAnnotation.prototype.is$TypeAnnotation = function(){return this;}; 6806 TypeAnnotation.prototype.assert$TypeAnnotation = function(){return this};
6416 TypeAnnotation.prototype.get$typeName = function() { return this.typeName; };
6417 TypeAnnotation.prototype.accept = function(visitor) { 6807 TypeAnnotation.prototype.accept = function(visitor) {
6418 return visitor.visitTypeAnnotation(this); 6808 return visitor.visitTypeAnnotation(this);
6419 } 6809 }
6420 TypeAnnotation.prototype.getBeginToken = function() { 6810 TypeAnnotation.prototype.getBeginToken = function() {
6421 var $0; 6811 var $0;
6422 return (($0 = this.typeName.getBeginToken()) && $0.is$Token()); 6812 return (($0 = this.typeName.getBeginToken()) == null ? null : $0.assert$Token( ));
6423 } 6813 }
6424 TypeAnnotation.prototype.getEndToken = function() { 6814 TypeAnnotation.prototype.getEndToken = function() {
6425 var $0; 6815 var $0;
6426 return (($0 = this.typeName.getEndToken()) && $0.is$Token()); 6816 return (($0 = this.typeName.getEndToken()) == null ? null : $0.assert$Token()) ;
6427 } 6817 }
6428 TypeAnnotation.prototype.accept$1 = function($0) { 6818 TypeAnnotation.prototype.accept$1 = function($0) {
6429 return this.accept(($0 && $0.is$Visitor())); 6819 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6430 }; 6820 };
6431 TypeAnnotation.prototype.getBeginToken$0 = TypeAnnotation.prototype.getBeginToke n; 6821 TypeAnnotation.prototype.getBeginToken$0 = TypeAnnotation.prototype.getBeginToke n;
6432 TypeAnnotation.prototype.getEndToken$0 = TypeAnnotation.prototype.getEndToken; 6822 TypeAnnotation.prototype.getEndToken$0 = TypeAnnotation.prototype.getEndToken;
6433 // ********** Code for VariableDefinitions ************** 6823 // ********** Code for VariableDefinitions **************
6434 function VariableDefinitions(type, modifiers, definitions, endToken) { 6824 function VariableDefinitions(type, modifiers, definitions, endToken) {
6435 this.type = type; 6825 this.type = type;
6436 this.modifiers = modifiers; 6826 this.modifiers = modifiers;
6437 this.definitions = definitions; 6827 this.definitions = definitions;
6438 this.endToken = endToken; 6828 this.endToken = endToken;
6439 // Initializers done 6829 // Initializers done
6440 Statement.call(this); 6830 Statement.call(this);
6441 } 6831 }
6442 $inherits(VariableDefinitions, Statement); 6832 $inherits(VariableDefinitions, Statement);
6443 VariableDefinitions.prototype.is$VariableDefinitions = function(){return this;}; 6833 VariableDefinitions.prototype.assert$VariableDefinitions = function(){return thi s};
6444 VariableDefinitions.prototype.get$type = function() { return this.type; }; 6834 VariableDefinitions.prototype.get$type = function() { return this.type; };
6445 VariableDefinitions.prototype.get$definitions = function() { return this.definit ions; }; 6835 VariableDefinitions.prototype.get$definitions = function() { return this.definit ions; };
6446 VariableDefinitions.prototype.accept = function(visitor) { 6836 VariableDefinitions.prototype.accept = function(visitor) {
6447 return visitor.visitVariableDefinitions(this); 6837 return visitor.visitVariableDefinitions(this);
6448 } 6838 }
6449 VariableDefinitions.prototype.getBeginToken = function() { 6839 VariableDefinitions.prototype.getBeginToken = function() {
6450 return firstBeginToken(this.type, this.definitions); 6840 return firstBeginToken(this.type, this.definitions);
6451 } 6841 }
6452 VariableDefinitions.prototype.getEndToken = function() { 6842 VariableDefinitions.prototype.getEndToken = function() {
6453 return this.endToken; 6843 return this.endToken;
6454 } 6844 }
6455 VariableDefinitions.prototype.accept$1 = function($0) { 6845 VariableDefinitions.prototype.accept$1 = function($0) {
6456 return this.accept(($0 && $0.is$Visitor())); 6846 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6457 }; 6847 };
6458 VariableDefinitions.prototype.getBeginToken$0 = VariableDefinitions.prototype.ge tBeginToken; 6848 VariableDefinitions.prototype.getBeginToken$0 = VariableDefinitions.prototype.ge tBeginToken;
6459 VariableDefinitions.prototype.getEndToken$0 = VariableDefinitions.prototype.getE ndToken; 6849 VariableDefinitions.prototype.getEndToken$0 = VariableDefinitions.prototype.getE ndToken;
6460 // ********** Code for Loop ************** 6850 // ********** Code for Loop **************
6461 function Loop(body) { 6851 function Loop(body) {
6462 this.body = body; 6852 this.body = body;
6463 // Initializers done 6853 // Initializers done
6464 Statement.call(this); 6854 Statement.call(this);
6465 } 6855 }
6466 $inherits(Loop, Statement); 6856 $inherits(Loop, Statement);
(...skipping 11 matching lines...) Expand all
6478 DoWhile.prototype.accept = function(visitor) { 6868 DoWhile.prototype.accept = function(visitor) {
6479 return visitor.visitDoWhile(this); 6869 return visitor.visitDoWhile(this);
6480 } 6870 }
6481 DoWhile.prototype.getBeginToken = function() { 6871 DoWhile.prototype.getBeginToken = function() {
6482 return this.doKeyword; 6872 return this.doKeyword;
6483 } 6873 }
6484 DoWhile.prototype.getEndToken = function() { 6874 DoWhile.prototype.getEndToken = function() {
6485 return this.endToken; 6875 return this.endToken;
6486 } 6876 }
6487 DoWhile.prototype.accept$1 = function($0) { 6877 DoWhile.prototype.accept$1 = function($0) {
6488 return this.accept(($0 && $0.is$Visitor())); 6878 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6489 }; 6879 };
6490 DoWhile.prototype.getBeginToken$0 = DoWhile.prototype.getBeginToken; 6880 DoWhile.prototype.getBeginToken$0 = DoWhile.prototype.getBeginToken;
6491 DoWhile.prototype.getEndToken$0 = DoWhile.prototype.getEndToken; 6881 DoWhile.prototype.getEndToken$0 = DoWhile.prototype.getEndToken;
6492 // ********** Code for While ************** 6882 // ********** Code for While **************
6493 function While(condition, body, whileKeyword) { 6883 function While(condition, body, whileKeyword) {
6494 this.condition = condition; 6884 this.condition = condition;
6495 this.whileKeyword = whileKeyword; 6885 this.whileKeyword = whileKeyword;
6496 // Initializers done 6886 // Initializers done
6497 Loop.call(this, body); 6887 Loop.call(this, body);
6498 } 6888 }
6499 $inherits(While, Loop); 6889 $inherits(While, Loop);
6500 While.prototype.accept = function(visitor) { 6890 While.prototype.accept = function(visitor) {
6501 return visitor.visitWhile(this); 6891 return visitor.visitWhile(this);
6502 } 6892 }
6503 While.prototype.getBeginToken = function() { 6893 While.prototype.getBeginToken = function() {
6504 return this.whileKeyword; 6894 return this.whileKeyword;
6505 } 6895 }
6506 While.prototype.getEndToken = function() { 6896 While.prototype.getEndToken = function() {
6507 return this.body.getEndToken(); 6897 return this.body.getEndToken();
6508 } 6898 }
6509 While.prototype.accept$1 = function($0) { 6899 While.prototype.accept$1 = function($0) {
6510 return this.accept(($0 && $0.is$Visitor())); 6900 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6511 }; 6901 };
6512 While.prototype.getBeginToken$0 = While.prototype.getBeginToken; 6902 While.prototype.getBeginToken$0 = While.prototype.getBeginToken;
6513 While.prototype.getEndToken$0 = While.prototype.getEndToken; 6903 While.prototype.getEndToken$0 = While.prototype.getEndToken;
6514 // ********** Code for ParenthesizedExpression ************** 6904 // ********** Code for ParenthesizedExpression **************
6515 function ParenthesizedExpression(expression, beginToken) { 6905 function ParenthesizedExpression(expression, beginToken) {
6516 this.expression = expression; 6906 this.expression = expression;
6517 this.beginToken = beginToken; 6907 this.beginToken = beginToken;
6518 // Initializers done 6908 // Initializers done
6519 Expression.call(this); 6909 Expression.call(this);
6520 } 6910 }
6521 $inherits(ParenthesizedExpression, Expression); 6911 $inherits(ParenthesizedExpression, Expression);
6522 ParenthesizedExpression.prototype.is$ParenthesizedExpression = function(){return this;}; 6912 ParenthesizedExpression.prototype.assert$ParenthesizedExpression = function(){re turn this};
6523 ParenthesizedExpression.prototype.accept = function(visitor) { 6913 ParenthesizedExpression.prototype.accept = function(visitor) {
6524 return visitor.visitParenthesizedExpression(this); 6914 return visitor.visitParenthesizedExpression(this);
6525 } 6915 }
6526 ParenthesizedExpression.prototype.getBeginToken = function() { 6916 ParenthesizedExpression.prototype.getBeginToken = function() {
6527 return this.beginToken; 6917 return this.beginToken;
6528 } 6918 }
6529 ParenthesizedExpression.prototype.getEndToken = function() { 6919 ParenthesizedExpression.prototype.getEndToken = function() {
6530 return this.beginToken.endGroup; 6920 return this.beginToken.endGroup;
6531 } 6921 }
6532 ParenthesizedExpression.prototype.accept$1 = function($0) { 6922 ParenthesizedExpression.prototype.accept$1 = function($0) {
6533 return this.accept(($0 && $0.is$Visitor())); 6923 return this.accept(($0 == null ? null : $0.assert$Visitor()));
6534 }; 6924 };
6535 ParenthesizedExpression.prototype.getBeginToken$0 = ParenthesizedExpression.prot otype.getBeginToken; 6925 ParenthesizedExpression.prototype.getBeginToken$0 = ParenthesizedExpression.prot otype.getBeginToken;
6536 ParenthesizedExpression.prototype.getEndToken$0 = ParenthesizedExpression.protot ype.getEndToken; 6926 ParenthesizedExpression.prototype.getEndToken$0 = ParenthesizedExpression.protot ype.getEndToken;
6537 // ********** Code for Unparser ************** 6927 // ********** Code for Unparser **************
6538 function Unparser(printDebugInfo) { 6928 function Unparser(printDebugInfo) {
6539 this.printDebugInfo = printDebugInfo; 6929 this.printDebugInfo = printDebugInfo;
6540 // Initializers done 6930 // Initializers done
6541 } 6931 }
6542 Unparser.prototype.is$Visitor = function(){return this;}; 6932 Unparser.prototype.assert$Visitor = function(){return this};
6543 Unparser.prototype.unparse = function(node) { 6933 Unparser.prototype.unparse = function(node) {
6544 this.sb = new StringBufferImpl(""); 6934 this.sb = new StringBufferImpl("");
6545 this.visit(node); 6935 this.visit(node);
6546 return this.sb.toString(); 6936 return this.sb.toString();
6547 } 6937 }
6548 Unparser.prototype.add = function(string) { 6938 Unparser.prototype.add = function(string) {
6549 string.printOn(this.sb); 6939 string.printOn(this.sb);
6550 } 6940 }
6551 Unparser.prototype.visit = function(node) { 6941 Unparser.prototype.visit = function(node) {
6552 if (node != null) { 6942 if (node != null) {
(...skipping 19 matching lines...) Expand all
6572 this.visit(node.superclass); 6962 this.visit(node.superclass);
6573 this.sb.add(' '); 6963 this.sb.add(' ');
6574 } 6964 }
6575 this.visit(node.interfaces); 6965 this.visit(node.interfaces);
6576 this.sb.add('{\n'); 6966 this.sb.add('{\n');
6577 this.sb.add('}\n'); 6967 this.sb.add('}\n');
6578 } 6968 }
6579 Unparser.prototype.visitExpressionStatement = function(node) { 6969 Unparser.prototype.visitExpressionStatement = function(node) {
6580 var $0; 6970 var $0;
6581 this.visit(node.expression); 6971 this.visit(node.expression);
6582 this.add((($0 = node.endToken.get$value()) && $0.is$SourceString())); 6972 this.add((($0 = node.endToken.get$value()) == null ? null : $0.assert$SourceSt ring()));
6583 } 6973 }
6584 Unparser.prototype.visitFor = function(node) { 6974 Unparser.prototype.visitFor = function(node) {
6585 node.forToken.get$value().printOn$1(this.sb); 6975 node.forToken.get$value().printOn$1(this.sb);
6586 this.sb.add('('); 6976 this.sb.add('(');
6587 this.visit(node.initializer); 6977 this.visit(node.initializer);
6588 this.visit(node.conditionStatement); 6978 this.visit(node.conditionStatement);
6589 this.visit(node.update); 6979 this.visit(node.update);
6590 this.sb.add(')'); 6980 this.sb.add(')');
6591 this.visit(node.body); 6981 this.visit(node.body);
6592 } 6982 }
6593 Unparser.prototype.visitFunctionExpression = function(node) { 6983 Unparser.prototype.visitFunctionExpression = function(node) {
6594 if (node.returnType != null) { 6984 if (node.returnType != null) {
6595 this.visit(node.returnType); 6985 this.visit(node.returnType);
6596 this.sb.add(' '); 6986 this.sb.add(' ');
6597 } 6987 }
6598 this.visit(node.name); 6988 this.visit(node.name);
6599 this.visit(node.parameters); 6989 this.visit(node.parameters);
6600 this.visit(node.body); 6990 this.visit(node.body);
6601 } 6991 }
6602 Unparser.prototype.visitIdentifier = function(node) { 6992 Unparser.prototype.visitIdentifier = function(node) {
6603 var $0; 6993 var $0;
6604 this.add((($0 = node.token.get$value()) && $0.is$SourceString())); 6994 this.add((($0 = node.token.get$value()) == null ? null : $0.assert$SourceStrin g()));
6605 } 6995 }
6606 Unparser.prototype.visitIf = function(node) { 6996 Unparser.prototype.visitIf = function(node) {
6607 var $0; 6997 var $0;
6608 this.add((($0 = node.ifToken.get$value()) && $0.is$SourceString())); 6998 this.add((($0 = node.ifToken.get$value()) == null ? null : $0.assert$SourceStr ing()));
6609 this.visit(node.condition); 6999 this.visit(node.condition);
6610 this.visit(node.thenPart); 7000 this.visit(node.thenPart);
6611 if ($notnull_bool(node.get$hasElsePart())) { 7001 if ($notnull_bool(node.get$hasElsePart())) {
6612 this.add((($0 = node.elseToken.get$value()) && $0.is$SourceString())); 7002 this.add((($0 = node.elseToken.get$value()) == null ? null : $0.assert$Sourc eString()));
6613 this.visit(node.elsePart); 7003 this.visit(node.elsePart);
6614 } 7004 }
6615 } 7005 }
6616 Unparser.prototype.visitLiteralBool = function(node) { 7006 Unparser.prototype.visitLiteralBool = function(node) {
6617 var $0; 7007 var $0;
6618 this.add((($0 = node.token.get$value()) && $0.is$SourceString())); 7008 this.add((($0 = node.token.get$value()) == null ? null : $0.assert$SourceStrin g()));
6619 } 7009 }
6620 Unparser.prototype.visitLiteralDouble = function(node) { 7010 Unparser.prototype.visitLiteralDouble = function(node) {
6621 var $0; 7011 var $0;
6622 this.add((($0 = node.token.get$value()) && $0.is$SourceString())); 7012 this.add((($0 = node.token.get$value()) == null ? null : $0.assert$SourceStrin g()));
6623 } 7013 }
6624 Unparser.prototype.visitLiteralInt = function(node) { 7014 Unparser.prototype.visitLiteralInt = function(node) {
6625 var $0; 7015 var $0;
6626 this.add((($0 = node.token.get$value()) && $0.is$SourceString())); 7016 this.add((($0 = node.token.get$value()) == null ? null : $0.assert$SourceStrin g()));
6627 } 7017 }
6628 Unparser.prototype.visitLiteralString = function(node) { 7018 Unparser.prototype.visitLiteralString = function(node) {
6629 var $0; 7019 var $0;
6630 this.add((($0 = node.token.get$value()) && $0.is$SourceString())); 7020 this.add((($0 = node.token.get$value()) == null ? null : $0.assert$SourceStrin g()));
6631 } 7021 }
6632 Unparser.prototype.visitLiteralNull = function(node) { 7022 Unparser.prototype.visitLiteralNull = function(node) {
6633 var $0; 7023 var $0;
6634 this.add((($0 = node.token.get$value()) && $0.is$SourceString())); 7024 this.add((($0 = node.token.get$value()) == null ? null : $0.assert$SourceStrin g()));
6635 } 7025 }
6636 Unparser.prototype.visitNodeList = function(node) { 7026 Unparser.prototype.visitNodeList = function(node) {
6637 var $0; 7027 var $0;
6638 if (node.beginToken != null) this.add((($0 = node.beginToken.get$value()) && $ 0.is$SourceString())); 7028 if (node.beginToken != null) this.add((($0 = node.beginToken.get$value()) == n ull ? null : $0.assert$SourceString()));
6639 if (node.get$nodes() != null) { 7029 if (node.get$nodes() != null) {
6640 node.get$nodes().printOn(this.sb, node.delimiter); 7030 node.get$nodes().printOn(this.sb, node.delimiter);
6641 } 7031 }
6642 if (node.endToken != null) this.add((($0 = node.endToken.get$value()) && $0.is $SourceString())); 7032 if (node.endToken != null) this.add((($0 = node.endToken.get$value()) == null ? null : $0.assert$SourceString()));
6643 } 7033 }
6644 Unparser.prototype.visitOperator = function(node) { 7034 Unparser.prototype.visitOperator = function(node) {
6645 this.visitIdentifier(node); 7035 this.visitIdentifier(node);
6646 } 7036 }
6647 Unparser.prototype.visitReturn = function(node) { 7037 Unparser.prototype.visitReturn = function(node) {
6648 var $0; 7038 var $0;
6649 this.add((($0 = node.beginToken.get$value()) && $0.is$SourceString())); 7039 this.add((($0 = node.beginToken.get$value()) == null ? null : $0.assert$Source String()));
6650 if ($notnull_bool(node.get$hasExpression())) { 7040 if ($notnull_bool(node.get$hasExpression())) {
6651 this.sb.add(' '); 7041 this.sb.add(' ');
6652 this.visit(node.expression); 7042 this.visit(node.expression);
6653 } 7043 }
6654 this.add((($0 = node.endToken.get$value()) && $0.is$SourceString())); 7044 this.add((($0 = node.endToken.get$value()) == null ? null : $0.assert$SourceSt ring()));
6655 } 7045 }
6656 Unparser.prototype.visitSend = function(node) { 7046 Unparser.prototype.visitSend = function(node) {
6657 if ($notnull_bool(node.get$isPrefix())) { 7047 if ($notnull_bool(node.get$isPrefix())) {
6658 this.visit(node.selector); 7048 this.visit(node.selector);
6659 } 7049 }
6660 if (node.receiver != null) { 7050 if (node.receiver != null) {
6661 this.visit(node.receiver); 7051 this.visit(node.receiver);
6662 if (!(node.selector instanceof Operator)) this.sb.add('.'); 7052 if (!(node.selector instanceof Operator)) this.sb.add('.');
6663 } 7053 }
6664 if (!$notnull_bool(node.get$isPrefix())) { 7054 if (!$notnull_bool(node.get$isPrefix())) {
6665 this.visit(node.selector); 7055 this.visit(node.selector);
6666 } 7056 }
6667 this.visit(node.argumentsNode); 7057 this.visit(node.argumentsNode);
6668 } 7058 }
6669 Unparser.prototype.visitSendSet = function(node) { 7059 Unparser.prototype.visitSendSet = function(node) {
6670 var $0; 7060 var $0;
6671 if (node.receiver != null) { 7061 if (node.receiver != null) {
6672 this.visit(node.receiver); 7062 this.visit(node.receiver);
6673 this.sb.add('.'); 7063 this.sb.add('.');
6674 } 7064 }
6675 this.visit(node.selector); 7065 this.visit(node.selector);
6676 this.add((($0 = node.assignmentOperator.token.get$value()) && $0.is$SourceStri ng())); 7066 this.add((($0 = node.assignmentOperator.token.get$value()) == null ? null : $0 .assert$SourceString()));
6677 this.visit(node.argumentsNode); 7067 this.visit(node.argumentsNode);
6678 } 7068 }
6679 Unparser.prototype.visitThrow = function(node) { 7069 Unparser.prototype.visitThrow = function(node) {
6680 node.throwToken.get$value().printOn$1(this.sb); 7070 node.throwToken.get$value().printOn$1(this.sb);
6681 if (node.expression != null) { 7071 if (node.expression != null) {
6682 this.visit(node.expression); 7072 this.visit(node.expression);
6683 } 7073 }
6684 node.endToken.get$value().printOn$1(this.sb); 7074 node.endToken.get$value().printOn$1(this.sb);
6685 } 7075 }
6686 Unparser.prototype.visitTypeAnnotation = function(node) { 7076 Unparser.prototype.visitTypeAnnotation = function(node) {
6687 this.visit(node.typeName); 7077 this.visit(node.typeName);
6688 } 7078 }
6689 Unparser.prototype.visitVariableDefinitions = function(node) { 7079 Unparser.prototype.visitVariableDefinitions = function(node) {
6690 var $0; 7080 var $0;
6691 if (node.type != null) { 7081 if (node.type != null) {
6692 this.visit(node.type); 7082 this.visit(node.type);
6693 } 7083 }
6694 else { 7084 else {
6695 this.sb.add('var'); 7085 this.sb.add('var');
6696 } 7086 }
6697 this.sb.add(' '); 7087 this.sb.add(' ');
6698 this.visit(node.definitions); 7088 this.visit(node.definitions);
6699 if ($notnull_bool($eq(node.endToken.get$value(), const$223/*const SourceString (';')*/))) { 7089 if ($notnull_bool($eq(node.endToken.get$value(), const$223/*const SourceString (';')*/))) {
6700 this.add((($0 = node.endToken.get$value()) && $0.is$SourceString())); 7090 this.add((($0 = node.endToken.get$value()) == null ? null : $0.assert$Source String()));
6701 } 7091 }
6702 } 7092 }
6703 Unparser.prototype.visitDoWhile = function(node) { 7093 Unparser.prototype.visitDoWhile = function(node) {
6704 var $0; 7094 var $0;
6705 this.add((($0 = node.doKeyword.get$value()) && $0.is$SourceString())); 7095 this.add((($0 = node.doKeyword.get$value()) == null ? null : $0.assert$SourceS tring()));
6706 this.sb.add(' '); 7096 this.sb.add(' ');
6707 this.visit(node.body); 7097 this.visit(node.body);
6708 this.sb.add(' '); 7098 this.sb.add(' ');
6709 this.add((($0 = node.whileKeyword.get$value()) && $0.is$SourceString())); 7099 this.add((($0 = node.whileKeyword.get$value()) == null ? null : $0.assert$Sour ceString()));
6710 this.sb.add(' '); 7100 this.sb.add(' ');
6711 this.visit(node.condition); 7101 this.visit(node.condition);
6712 this.sb.add(node.endToken.get$value()); 7102 this.sb.add(node.endToken.get$value());
6713 } 7103 }
6714 Unparser.prototype.visitWhile = function(node) { 7104 Unparser.prototype.visitWhile = function(node) {
6715 var $0; 7105 var $0;
6716 this.add((($0 = node.whileKeyword.get$value()) && $0.is$SourceString())); 7106 this.add((($0 = node.whileKeyword.get$value()) == null ? null : $0.assert$Sour ceString()));
6717 this.sb.add(' '); 7107 this.sb.add(' ');
6718 this.visit(node.condition); 7108 this.visit(node.condition);
6719 this.sb.add(' '); 7109 this.sb.add(' ');
6720 this.visit(node.body); 7110 this.visit(node.body);
6721 } 7111 }
6722 Unparser.prototype.visitParenthesizedExpression = function(node) { 7112 Unparser.prototype.visitParenthesizedExpression = function(node) {
6723 var $0; 7113 var $0;
6724 this.add((($0 = node.getBeginToken().get$value()) && $0.is$SourceString())); 7114 this.add((($0 = node.getBeginToken().get$value()) == null ? null : $0.assert$S ourceString()));
6725 this.visit(node.expression); 7115 this.visit(node.expression);
6726 this.add((($0 = node.getEndToken().get$value()) && $0.is$SourceString())); 7116 this.add((($0 = node.getEndToken().get$value()) == null ? null : $0.assert$Sou rceString()));
6727 } 7117 }
6728 Unparser.prototype.add$1 = function($0) { 7118 Unparser.prototype.add$1 = function($0) {
6729 return this.add(($0 && $0.is$SourceString())); 7119 return this.add(($0 == null ? null : $0.assert$SourceString()));
6730 }; 7120 };
6731 Unparser.prototype.visit$1 = function($0) { 7121 Unparser.prototype.visit$1 = function($0) {
6732 return this.visit(($0 && $0.is$Node())); 7122 return this.visit(($0 == null ? null : $0.assert$Node()));
6733 }; 7123 };
6734 // ********** Code for AbstractVisitor ************** 7124 // ********** Code for AbstractVisitor **************
6735 function AbstractVisitor() { 7125 function AbstractVisitor() {
6736 // Initializers done 7126 // Initializers done
6737 } 7127 }
6738 AbstractVisitor.prototype.is$Visitor = function(){return this;}; 7128 AbstractVisitor.prototype.assert$Visitor = function(){return this};
6739 AbstractVisitor.prototype.visitExpression = function(node) { 7129 AbstractVisitor.prototype.visitExpression = function(node) {
6740 return this.visitNode(node); 7130 return this.visitNode(node);
6741 } 7131 }
6742 AbstractVisitor.prototype.visitIdentifier = function(node) { 7132 AbstractVisitor.prototype.visitIdentifier = function(node) {
6743 return this.visitExpression(node); 7133 return this.visitExpression(node);
6744 } 7134 }
6745 AbstractVisitor.prototype.visitLiteral = function(node) { 7135 AbstractVisitor.prototype.visitLiteral = function(node) {
6746 return this.visitExpression(node); 7136 return this.visitExpression(node);
6747 } 7137 }
6748 AbstractVisitor.prototype.visitLoop = function(node) { 7138 AbstractVisitor.prototype.visitLoop = function(node) {
6749 return this.visitStatement(node); 7139 return this.visitStatement(node);
6750 } 7140 }
6751 AbstractVisitor.prototype.visitSend = function(node) { 7141 AbstractVisitor.prototype.visitSend = function(node) {
6752 return this.visitExpression(node); 7142 return this.visitExpression(node);
6753 } 7143 }
6754 AbstractVisitor.prototype.visitStatement = function(node) { 7144 AbstractVisitor.prototype.visitStatement = function(node) {
6755 return this.visitNode(node); 7145 return this.visitNode(node);
6756 } 7146 }
6757 // ********** Code for AbstractVisitor_Element ************** 7147 // ********** Code for AbstractVisitor_Element **************
6758 function AbstractVisitor_Element() { 7148 function AbstractVisitor_Element() {
6759 // Initializers done 7149 // Initializers done
6760 } 7150 }
6761 $inherits(AbstractVisitor_Element, AbstractVisitor); 7151 $inherits(AbstractVisitor_Element, AbstractVisitor);
6762 AbstractVisitor_Element.prototype.is$Visitor = function(){return this;}; 7152 AbstractVisitor_Element.prototype.assert$Visitor = function(){return this};
6763 AbstractVisitor_Element.prototype.visitClassNode = function(node) { 7153 AbstractVisitor_Element.prototype.visitClassNode = function(node) {
6764 var $0; 7154 var $0;
6765 return (($0 = this.visitNode(node)) && $0.is$Element()); 7155 return (($0 = this.visitNode(node)) == null ? null : $0.assert$Element());
6766 } 7156 }
6767 AbstractVisitor_Element.prototype.visitTypeAnnotation = function(node) { 7157 AbstractVisitor_Element.prototype.visitTypeAnnotation = function(node) {
6768 var $0; 7158 var $0;
6769 return (($0 = this.visitNode(node)) && $0.is$Element()); 7159 return (($0 = this.visitNode(node)) == null ? null : $0.assert$Element());
6770 } 7160 }
6771 // ********** Code for AbstractVisitor_SourceString ************** 7161 // ********** Code for AbstractVisitor_SourceString **************
6772 function AbstractVisitor_SourceString() { 7162 function AbstractVisitor_SourceString() {
6773 // Initializers done 7163 // Initializers done
6774 } 7164 }
6775 $inherits(AbstractVisitor_SourceString, AbstractVisitor); 7165 $inherits(AbstractVisitor_SourceString, AbstractVisitor);
6776 AbstractVisitor_SourceString.prototype.is$Visitor = function(){return this;}; 7166 AbstractVisitor_SourceString.prototype.assert$Visitor = function(){return this};
6777 // ********** Code for AbstractVisitor_Type ************** 7167 // ********** Code for AbstractVisitor_Type **************
6778 function AbstractVisitor_Type() { 7168 function AbstractVisitor_Type() {
6779 // Initializers done 7169 // Initializers done
6780 } 7170 }
6781 $inherits(AbstractVisitor_Type, AbstractVisitor); 7171 $inherits(AbstractVisitor_Type, AbstractVisitor);
6782 AbstractVisitor_Type.prototype.is$Visitor = function(){return this;}; 7172 AbstractVisitor_Type.prototype.assert$Visitor = function(){return this};
6783 AbstractVisitor_Type.prototype.visitBlock = function(node) { 7173 AbstractVisitor_Type.prototype.visitBlock = function(node) {
6784 return this.visitStatement(node); 7174 return this.visitStatement(node);
6785 } 7175 }
6786 AbstractVisitor_Type.prototype.visitDoWhile = function(node) { 7176 AbstractVisitor_Type.prototype.visitDoWhile = function(node) {
6787 return this.visitLoop(node); 7177 return this.visitLoop(node);
6788 } 7178 }
6789 AbstractVisitor_Type.prototype.visitExpression = function(node) { 7179 AbstractVisitor_Type.prototype.visitExpression = function(node) {
6790 var $0; 7180 var $0;
6791 return (($0 = this.visitNode(node)) && $0.is$Type()); 7181 return (($0 = this.visitNode(node)) == null ? null : $0.assert$Type());
6792 } 7182 }
6793 AbstractVisitor_Type.prototype.visitExpressionStatement = function(node) { 7183 AbstractVisitor_Type.prototype.visitExpressionStatement = function(node) {
6794 return this.visitStatement(node); 7184 return this.visitStatement(node);
6795 } 7185 }
6796 AbstractVisitor_Type.prototype.visitFor = function(node) { 7186 AbstractVisitor_Type.prototype.visitFor = function(node) {
6797 return this.visitStatement(node); 7187 return this.visitStatement(node);
6798 } 7188 }
6799 AbstractVisitor_Type.prototype.visitFunctionExpression = function(node) { 7189 AbstractVisitor_Type.prototype.visitFunctionExpression = function(node) {
6800 return this.visitExpression(node); 7190 return this.visitExpression(node);
6801 } 7191 }
(...skipping 19 matching lines...) Expand all
6821 return this.visitLiteral(node); 7211 return this.visitLiteral(node);
6822 } 7212 }
6823 AbstractVisitor_Type.prototype.visitLiteralString = function(node) { 7213 AbstractVisitor_Type.prototype.visitLiteralString = function(node) {
6824 return this.visitLiteral(node); 7214 return this.visitLiteral(node);
6825 } 7215 }
6826 AbstractVisitor_Type.prototype.visitLoop = function(node) { 7216 AbstractVisitor_Type.prototype.visitLoop = function(node) {
6827 return this.visitStatement(node); 7217 return this.visitStatement(node);
6828 } 7218 }
6829 AbstractVisitor_Type.prototype.visitNodeList = function(node) { 7219 AbstractVisitor_Type.prototype.visitNodeList = function(node) {
6830 var $0; 7220 var $0;
6831 return (($0 = this.visitNode(node)) && $0.is$Type()); 7221 return (($0 = this.visitNode(node)) == null ? null : $0.assert$Type());
6832 } 7222 }
6833 AbstractVisitor_Type.prototype.visitOperator = function(node) { 7223 AbstractVisitor_Type.prototype.visitOperator = function(node) {
6834 var $0; 7224 var $0;
6835 return (($0 = this.visitIdentifier(node)) && $0.is$Type()); 7225 return (($0 = this.visitIdentifier(node)) == null ? null : $0.assert$Type());
6836 } 7226 }
6837 AbstractVisitor_Type.prototype.visitParenthesizedExpression = function(node) { 7227 AbstractVisitor_Type.prototype.visitParenthesizedExpression = function(node) {
6838 return this.visitExpression(node); 7228 return this.visitExpression(node);
6839 } 7229 }
6840 AbstractVisitor_Type.prototype.visitReturn = function(node) { 7230 AbstractVisitor_Type.prototype.visitReturn = function(node) {
6841 return this.visitStatement(node); 7231 return this.visitStatement(node);
6842 } 7232 }
6843 AbstractVisitor_Type.prototype.visitSend = function(node) { 7233 AbstractVisitor_Type.prototype.visitSend = function(node) {
6844 return this.visitExpression(node); 7234 return this.visitExpression(node);
6845 } 7235 }
6846 AbstractVisitor_Type.prototype.visitSendSet = function(node) { 7236 AbstractVisitor_Type.prototype.visitSendSet = function(node) {
6847 return this.visitSend(node); 7237 return this.visitSend(node);
6848 } 7238 }
6849 AbstractVisitor_Type.prototype.visitStatement = function(node) { 7239 AbstractVisitor_Type.prototype.visitStatement = function(node) {
6850 var $0; 7240 var $0;
6851 return (($0 = this.visitNode(node)) && $0.is$Type()); 7241 return (($0 = this.visitNode(node)) == null ? null : $0.assert$Type());
6852 } 7242 }
6853 AbstractVisitor_Type.prototype.visitThrow = function(node) { 7243 AbstractVisitor_Type.prototype.visitThrow = function(node) {
6854 return this.visitStatement(node); 7244 return this.visitStatement(node);
6855 } 7245 }
6856 AbstractVisitor_Type.prototype.visitVariableDefinitions = function(node) { 7246 AbstractVisitor_Type.prototype.visitVariableDefinitions = function(node) {
6857 return this.visitStatement(node); 7247 return this.visitStatement(node);
6858 } 7248 }
6859 AbstractVisitor_Type.prototype.visitWhile = function(node) { 7249 AbstractVisitor_Type.prototype.visitWhile = function(node) {
6860 return this.visitLoop(node); 7250 return this.visitLoop(node);
6861 } 7251 }
6862 // ********** Code for top level ************** 7252 // ********** Code for top level **************
6863 function firstBeginToken(first, second) { 7253 function firstBeginToken(first, second) {
6864 var $0; 7254 var $0;
6865 return (($0 = (first != null) ? first.getBeginToken() : second.getBeginToken() ) && $0.is$Token()); 7255 return (($0 = (first != null) ? first.getBeginToken() : second.getBeginToken() ) == null ? null : $0.assert$Token());
6866 } 7256 }
6867 // ********** Library elements ************** 7257 // ********** Library elements **************
6868 // ********** Code for ElementKind ************** 7258 // ********** Code for ElementKind **************
6869 function ElementKind(id) { 7259 function ElementKind(id) {
6870 this.id = id; 7260 this.id = id;
6871 // Initializers done 7261 // Initializers done
6872 } 7262 }
6873 ElementKind.prototype.get$id = function() { return this.id; }; 7263 ElementKind.prototype.get$id = function() { return this.id; };
6874 ElementKind.prototype.toString = function() { 7264 ElementKind.prototype.toString = function() {
6875 return this.id; 7265 return this.id;
6876 } 7266 }
6877 ElementKind.prototype.toString$0 = ElementKind.prototype.toString; 7267 ElementKind.prototype.toString$0 = ElementKind.prototype.toString;
6878 // ********** Code for Element ************** 7268 // ********** Code for Element **************
6879 function Element(name, kind, enclosingElement) { 7269 function Element(name, kind, enclosingElement) {
6880 this.name = name; 7270 this.name = name;
6881 this.kind = kind; 7271 this.kind = kind;
6882 this.enclosingElement = enclosingElement; 7272 this.enclosingElement = enclosingElement;
6883 // Initializers done 7273 // Initializers done
6884 } 7274 }
6885 Element.prototype.is$Element = function(){return this;}; 7275 Element.prototype.assert$Element = function(){return this};
6886 Element.prototype.get$name = function() { return this.name; }; 7276 Element.prototype.get$name = function() { return this.name; };
6887 Element.prototype.get$kind = function() { return this.kind; }; 7277 Element.prototype.get$kind = function() { return this.kind; };
6888 Element.prototype.get$enclosingElement = function() { return this.enclosingEleme nt; }; 7278 Element.prototype.get$enclosingElement = function() { return this.enclosingEleme nt; };
6889 Element.prototype.hashCode = function() { 7279 Element.prototype.hashCode = function() {
6890 return this.name.hashCode(); 7280 return this.name.hashCode();
6891 } 7281 }
6892 Element.prototype.computeType$2 = function($0, $1) { 7282 Element.prototype.computeType$2 = function($0, $1) {
6893 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); 7283 return this.computeType(($0 == null ? null : $0.assert$Compiler()), ($1 == nul l ? null : $1.assert$Types()));
6894 }; 7284 };
6895 Element.prototype.hashCode$0 = Element.prototype.hashCode; 7285 Element.prototype.hashCode$0 = Element.prototype.hashCode;
6896 // ********** Code for VariableElement ************** 7286 // ********** Code for VariableElement **************
6897 function VariableElement(node, typeAnnotation, kind, name, enclosingElement) { 7287 function VariableElement(node, typeAnnotation, kind, name, enclosingElement) {
6898 this.node = node; 7288 this.node = node;
6899 this.typeAnnotation = typeAnnotation; 7289 this.typeAnnotation = typeAnnotation;
6900 // Initializers done 7290 // Initializers done
6901 Element.call(this, name, kind, enclosingElement); 7291 Element.call(this, name, kind, enclosingElement);
6902 } 7292 }
6903 $inherits(VariableElement, Element); 7293 $inherits(VariableElement, Element);
6904 VariableElement.prototype.is$VariableElement = function(){return this;}; 7294 VariableElement.prototype.assert$VariableElement = function(){return this};
6905 VariableElement.prototype.get$type = function() { return this.type; }; 7295 VariableElement.prototype.get$type = function() { return this.type; };
6906 VariableElement.prototype.set$type = function(value) { return this.type = value; }; 7296 VariableElement.prototype.set$type = function(value) { return this.type = value; };
6907 VariableElement.prototype.parseNode = function(canceler, logger) { 7297 VariableElement.prototype.parseNode = function(canceler, logger) {
6908 return this.node; 7298 return this.node;
6909 } 7299 }
6910 VariableElement.prototype.computeType = function(compiler, types) { 7300 VariableElement.prototype.computeType = function(compiler, types) {
6911 if (this.type != null) return this.type; 7301 if (this.type != null) return this.type;
6912 this.type = getType(this.typeAnnotation, types); 7302 this.type = getType(this.typeAnnotation, types);
6913 return this.type; 7303 return this.type;
6914 } 7304 }
6915 VariableElement.prototype.computeType$2 = function($0, $1) { 7305 VariableElement.prototype.computeType$2 = function($0, $1) {
6916 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); 7306 return this.computeType(($0 == null ? null : $0.assert$Compiler()), ($1 == nul l ? null : $1.assert$Types()));
6917 }; 7307 };
6918 // ********** Code for ForeignElement ************** 7308 // ********** Code for ForeignElement **************
6919 function ForeignElement(name) { 7309 function ForeignElement(name) {
6920 // Initializers done 7310 // Initializers done
6921 Element.call(this, name, const$219, null); 7311 Element.call(this, name, const$219, null);
6922 } 7312 }
6923 $inherits(ForeignElement, Element); 7313 $inherits(ForeignElement, Element);
6924 ForeignElement.prototype.computeType = function(compiler, types) { 7314 ForeignElement.prototype.computeType = function(compiler, types) {
6925 return types.dynamicType; 7315 return types.dynamicType;
6926 } 7316 }
6927 ForeignElement.prototype.computeType$2 = function($0, $1) { 7317 ForeignElement.prototype.computeType$2 = function($0, $1) {
6928 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); 7318 return this.computeType(($0 == null ? null : $0.assert$Compiler()), ($1 == nul l ? null : $1.assert$Types()));
6929 }; 7319 };
6930 // ********** Code for FunctionElement ************** 7320 // ********** Code for FunctionElement **************
6931 function FunctionElement(name) { 7321 function FunctionElement(name) {
6932 // Initializers done 7322 // Initializers done
6933 Element.call(this, name, const$216, null); 7323 Element.call(this, name, const$216, null);
6934 } 7324 }
6935 FunctionElement.node$ctor = function(node, enclosing) { 7325 FunctionElement.node$ctor = function(node, enclosing) {
6936 this.node = node; 7326 this.node = node;
6937 // Initializers done 7327 // Initializers done
6938 Element.call(this, node.name.get$dynamic().get$source(), const$216, enclosing) ; 7328 Element.call(this, node.name.get$dynamic().get$source(), const$216, enclosing) ;
6939 } 7329 }
6940 FunctionElement.node$ctor.prototype = FunctionElement.prototype; 7330 FunctionElement.node$ctor.prototype = FunctionElement.prototype;
6941 $inherits(FunctionElement, Element); 7331 $inherits(FunctionElement, Element);
6942 FunctionElement.prototype.is$FunctionElement = function(){return this;}; 7332 FunctionElement.prototype.assert$FunctionElement = function(){return this};
6943 FunctionElement.prototype.get$parameters = function() { return this.parameters; }; 7333 FunctionElement.prototype.get$parameters = function() { return this.parameters; };
6944 FunctionElement.prototype.set$parameters = function(value) { return this.paramet ers = value; }; 7334 FunctionElement.prototype.set$parameters = function(value) { return this.paramet ers = value; };
6945 FunctionElement.prototype.get$type = function() { return this.type; }; 7335 FunctionElement.prototype.get$type = function() { return this.type; };
6946 FunctionElement.prototype.set$type = function(value) { return this.type = value; }; 7336 FunctionElement.prototype.set$type = function(value) { return this.type = value; };
6947 FunctionElement.prototype.computeType = function(compiler, types) { 7337 FunctionElement.prototype.computeType = function(compiler, types) {
6948 var $0; 7338 var $0;
6949 if (this.type != null) return (($0 = this.type) && $0.is$FunctionType()); 7339 if (this.type != null) return (($0 = this.type) == null ? null : $0.assert$Fun ctionType());
6950 if (this.parameters == null) compiler.resolveSignature(this); 7340 if (this.parameters == null) compiler.resolveSignature(this);
6951 var node = (($0 = this.parseNode(compiler, compiler)) && $0.is$FunctionExpress ion()); 7341 var node = (($0 = this.parseNode(compiler, compiler)) == null ? null : $0.asse rt$FunctionExpression());
6952 var returnType = getType(node.returnType, types); 7342 var returnType = getType(node.returnType, types);
6953 if (returnType == null) compiler.cancel(('unknown type ' + node.returnType)); 7343 if (returnType == null) compiler.cancel(('unknown type ' + node.returnType));
6954 var parameterTypes = new LinkBuilderImplementation(); 7344 var parameterTypes = new LinkBuilderImplementation();
6955 for (var link = this.parameters; 7345 for (var link = this.parameters;
6956 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_ Element())) { 7346 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == null ? null : $0.assert$Link_Element())) {
6957 parameterTypes.addLast(link.get$head().computeType$2(compiler, types)); 7347 parameterTypes.addLast(link.get$head().computeType$2(compiler, types));
6958 } 7348 }
6959 this.type = new FunctionType(returnType, (($0 = parameterTypes.toLink()) && $0 .is$Link_Type())); 7349 this.type = new FunctionType(returnType, (($0 = parameterTypes.toLink()) == nu ll ? null : $0.assert$Link_Type()));
6960 return (($0 = this.type) && $0.is$FunctionType()); 7350 return (($0 = this.type) == null ? null : $0.assert$FunctionType());
6961 } 7351 }
6962 FunctionElement.prototype.parseNode = function(canceler, logger) { 7352 FunctionElement.prototype.parseNode = function(canceler, logger) {
6963 return this.node; 7353 return this.node;
6964 } 7354 }
6965 FunctionElement.prototype.computeType$2 = function($0, $1) { 7355 FunctionElement.prototype.computeType$2 = function($0, $1) {
6966 return this.computeType(($0 && $0.is$Compiler()), $1); 7356 return this.computeType(($0 == null ? null : $0.assert$Compiler()), $1);
6967 }; 7357 };
6968 // ********** Code for ClassElement ************** 7358 // ********** Code for ClassElement **************
6969 function ClassElement(name) { 7359 function ClassElement(name) {
6970 this.interfaces = const$213/*const EmptyLink<Type>()*/ 7360 this.interfaces = const$213/*const EmptyLink<Type>()*/
6971 this.isResolved = false 7361 this.isResolved = false
6972 // Initializers done 7362 // Initializers done
6973 Element.call(this, name, const$214, null); 7363 Element.call(this, name, const$214, null);
6974 } 7364 }
6975 $inherits(ClassElement, Element); 7365 $inherits(ClassElement, Element);
6976 ClassElement.prototype.is$ClassElement = function(){return this;}; 7366 ClassElement.prototype.assert$ClassElement = function(){return this};
6977 ClassElement.prototype.get$type = function() { return this.type; }; 7367 ClassElement.prototype.get$type = function() { return this.type; };
6978 ClassElement.prototype.set$type = function(value) { return this.type = value; }; 7368 ClassElement.prototype.set$type = function(value) { return this.type = value; };
6979 ClassElement.prototype.get$interfaces = function() { return this.interfaces; }; 7369 ClassElement.prototype.get$interfaces = function() { return this.interfaces; };
6980 ClassElement.prototype.set$interfaces = function(value) { return this.interfaces = value; }; 7370 ClassElement.prototype.set$interfaces = function(value) { return this.interfaces = value; };
6981 ClassElement.prototype.computeType = function(compiler, types) { 7371 ClassElement.prototype.computeType = function(compiler, types) {
6982 if (this.type == null) { 7372 if (this.type == null) {
6983 this.type = new SimpleType(this.name, this); 7373 this.type = new SimpleType(this.name, this);
6984 } 7374 }
6985 return this.type; 7375 return this.type;
6986 } 7376 }
6987 ClassElement.prototype.resolve = function(compiler) { 7377 ClassElement.prototype.resolve = function(compiler) {
6988 if ($notnull_bool(this.isResolved)) return; 7378 if ($notnull_bool(this.isResolved)) return;
6989 compiler.resolveType(this); 7379 compiler.resolveType(this);
6990 this.isResolved = true; 7380 this.isResolved = true;
6991 } 7381 }
6992 ClassElement.prototype.computeType$2 = ClassElement.prototype.computeType; 7382 ClassElement.prototype.computeType$2 = ClassElement.prototype.computeType;
6993 ClassElement.prototype.resolve$1 = function($0) { 7383 ClassElement.prototype.resolve$1 = function($0) {
6994 return this.resolve(($0 && $0.is$Compiler())); 7384 return this.resolve(($0 == null ? null : $0.assert$Compiler()));
6995 }; 7385 };
6996 // ********** Code for top level ************** 7386 // ********** Code for top level **************
6997 function getType(annotation, types) { 7387 function getType(annotation, types) {
6998 var $0; 7388 var $0;
6999 if (annotation == null || annotation.typeName == null) { 7389 if (annotation == null || annotation.typeName == null) {
7000 return (($0 = types.get$dynamicType()) && $0.is$Type()); 7390 return (($0 = types.get$dynamicType()) == null ? null : $0.assert$Type());
7001 } 7391 }
7002 return (($0 = types.lookup$1(annotation.typeName.get$source())) && $0.is$Type( )); 7392 return (($0 = types.lookup$1(annotation.typeName.get$source())) == null ? null : $0.assert$Type());
7003 } 7393 }
7004 // ********** Library ssa ************** 7394 // ********** Library ssa **************
7005 // ********** Code for SsaBuilderTask ************** 7395 // ********** Code for SsaBuilderTask **************
7006 function SsaBuilderTask(compiler) { 7396 function SsaBuilderTask(compiler) {
7007 // Initializers done 7397 // Initializers done
7008 CompilerTask.call(this, compiler); 7398 CompilerTask.call(this, compiler);
7009 } 7399 }
7010 $inherits(SsaBuilderTask, CompilerTask); 7400 $inherits(SsaBuilderTask, CompilerTask);
7011 SsaBuilderTask.prototype.get$name = function() { 7401 SsaBuilderTask.prototype.get$name = function() {
7012 return 'SSA builder'; 7402 return 'SSA builder';
7013 } 7403 }
7014 SsaBuilderTask.prototype.build = function(tree, elements) { 7404 SsaBuilderTask.prototype.build = function(tree, elements) {
7015 var $this = this; // closure support 7405 var $this = this; // closure support
7016 var $0; 7406 var $0;
7017 return (($0 = this.measure((function () { 7407 return (($0 = this.measure((function () {
7018 var $0; 7408 var $0;
7019 var function_ = (tree && tree.is$FunctionExpression()); 7409 var function_ = (tree == null ? null : tree.assert$FunctionExpression());
7020 $globals.HInstruction_idCounter = 0; 7410 $globals.HInstruction_idCounter = 0;
7021 var graph = $this.compileMethod(function_.parameters, function_.body, elemen ts); 7411 var graph = $this.compileMethod(function_.parameters, function_.body, elemen ts);
7022 $assert(graph.isValid(), "graph.isValid()", "builder.dart", 15, 14); 7412 $assert(graph.isValid(), "graph.isValid()", "builder.dart", 15, 14);
7023 if (false/*null.GENERATE_SSA_TRACE*/) { 7413 if (false/*null.GENERATE_SSA_TRACE*/) {
7024 var name = (($0 = function_.name) && $0.is$Identifier()); 7414 var name = (($0 = function_.name) == null ? null : $0.assert$Identifier()) ;
7025 HTracer.HTracer$singleton$factory().traceCompilation(name.get$source().toS tring()); 7415 HTracer.HTracer$singleton$factory().traceCompilation(name.get$source().toS tring());
7026 HTracer.HTracer$singleton$factory().traceGraph('builder', graph); 7416 HTracer.HTracer$singleton$factory().traceGraph('builder', graph);
7027 } 7417 }
7028 return graph; 7418 return graph;
7029 }) 7419 })
7030 )) && $0.is$HGraph()); 7420 )) == null ? null : $0.assert$HGraph());
7031 } 7421 }
7032 SsaBuilderTask.prototype.compileMethod = function(parameters, body, elements) { 7422 SsaBuilderTask.prototype.compileMethod = function(parameters, body, elements) {
7033 var builder = new SsaBuilder(this.compiler, elements); 7423 var builder = new SsaBuilder(this.compiler, elements);
7034 var graph = builder.build(parameters, body); 7424 var graph = builder.build(parameters, body);
7035 return graph; 7425 return graph;
7036 } 7426 }
7037 // ********** Code for SsaBuilder ************** 7427 // ********** Code for SsaBuilder **************
7038 function SsaBuilder(compiler, elements) { 7428 function SsaBuilder(compiler, elements) {
7039 this.compiler = compiler; 7429 this.compiler = compiler;
7040 this.elements = elements; 7430 this.elements = elements;
7041 // Initializers done 7431 // Initializers done
7042 } 7432 }
7043 SsaBuilder.prototype.is$Visitor = function(){return this;}; 7433 SsaBuilder.prototype.assert$Visitor = function(){return this};
7044 SsaBuilder.prototype.get$definitions = function() { return this.definitions; }; 7434 SsaBuilder.prototype.get$definitions = function() { return this.definitions; };
7045 SsaBuilder.prototype.set$definitions = function(value) { return this.definitions = value; }; 7435 SsaBuilder.prototype.set$definitions = function(value) { return this.definitions = value; };
7046 SsaBuilder.prototype.build = function(parameters, body) { 7436 SsaBuilder.prototype.build = function(parameters, body) {
7047 this.stack = new ListFactory(); 7437 this.stack = new ListFactory();
7048 this.definitions = new HashMapImplementation(); 7438 this.definitions = new HashMapImplementation();
7049 this.graph = new HGraph(); 7439 this.graph = new HGraph();
7050 var block = this.graph.addNewBlock(); 7440 var block = this.graph.addNewBlock();
7051 this.open(this.graph.entry); 7441 this.open(this.graph.entry);
7052 this.visitParameterValues(parameters); 7442 this.visitParameterValues(parameters);
7053 this.close(new HGoto()).addSuccessor(block); 7443 this.close(new HGoto()).addSuccessor(block);
(...skipping 22 matching lines...) Expand all
7076 } 7466 }
7077 SsaBuilder.prototype.add = function(instruction) { 7467 SsaBuilder.prototype.add = function(instruction) {
7078 this.current.add(instruction); 7468 this.current.add(instruction);
7079 } 7469 }
7080 SsaBuilder.prototype.push = function(instruction) { 7470 SsaBuilder.prototype.push = function(instruction) {
7081 this.add(instruction); 7471 this.add(instruction);
7082 this.stack.add(instruction); 7472 this.stack.add(instruction);
7083 } 7473 }
7084 SsaBuilder.prototype.pop = function() { 7474 SsaBuilder.prototype.pop = function() {
7085 var $0; 7475 var $0;
7086 return (($0 = this.stack.removeLast()) && $0.is$HInstruction()); 7476 return (($0 = this.stack.removeLast()) == null ? null : $0.assert$HInstruction ());
7087 } 7477 }
7088 SsaBuilder.prototype.popBoolified = function() { 7478 SsaBuilder.prototype.popBoolified = function() {
7089 var boolified = new HBoolify(this.pop()); 7479 var boolified = new HBoolify(this.pop());
7090 this.add(boolified); 7480 this.add(boolified);
7091 return boolified; 7481 return boolified;
7092 } 7482 }
7093 SsaBuilder.prototype.guard = function(type, value) { 7483 SsaBuilder.prototype.guard = function(type, value) {
7094 if (type != null) { 7484 if (type != null) {
7095 if ($notnull_bool($eq(type.toString(), 'int'))) { 7485 if ($notnull_bool($eq(type.toString(), 'int'))) {
7096 value = new HTypeGuard(2/*HInstruction.TYPE_NUMBER*/, value); 7486 value = new HTypeGuard(2/*HInstruction.TYPE_NUMBER*/, value);
7097 this.add(value); 7487 this.add(value);
7098 } 7488 }
7099 else if ($notnull_bool($eq(type.toString(), 'String'))) { 7489 else if ($notnull_bool($eq(type.toString(), 'String'))) {
7100 value = new HTypeGuard(3/*HInstruction.TYPE_STRING*/, value); 7490 value = new HTypeGuard(3/*HInstruction.TYPE_STRING*/, value);
7101 this.add(value); 7491 this.add(value);
7102 } 7492 }
7103 } 7493 }
7104 return value; 7494 return value;
7105 } 7495 }
7106 SsaBuilder.prototype.visit = function(node) { 7496 SsaBuilder.prototype.visit = function(node) {
7107 if (node != null) node.accept(this); 7497 if (node != null) node.accept(this);
7108 } 7498 }
7109 SsaBuilder.prototype.visitParameterValues = function(parameters) { 7499 SsaBuilder.prototype.visitParameterValues = function(parameters) {
7110 var $0; 7500 var $0;
7111 var parameterIndex = 0; 7501 var parameterIndex = 0;
7112 for (var link = parameters.get$nodes(); 7502 for (var link = parameters.get$nodes();
7113 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_ Node())) { 7503 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == null ? null : $0.assert$Link_Node())) {
7114 var container = (($0 = link.get$head()) && $0.is$VariableDefinitions()); 7504 var container = (($0 = link.get$head()) == null ? null : $0.assert$VariableD efinitions());
7115 var identifierLink = container.definitions.get$nodes(); 7505 var identifierLink = container.definitions.get$nodes();
7116 $assert(!$notnull_bool(identifierLink.isEmpty()) && $notnull_bool(identifier Link.get$tail().isEmpty$0()), "!identifierLink.isEmpty() && identifierLink.tail. isEmpty()", "builder.dart", 135, 14); 7506 $assert(!$notnull_bool(identifierLink.isEmpty()) && $notnull_bool(identifier Link.get$tail().isEmpty$0()), "!identifierLink.isEmpty() && identifierLink.tail. isEmpty()", "builder.dart", 135, 14);
7117 if (!(identifierLink.get$head() instanceof Identifier)) { 7507 if (!(identifierLink.get$head() instanceof Identifier)) {
7118 this.compiler.unimplemented("SsaBuilder.visitParameterValues non-identifie r"); 7508 this.compiler.unimplemented("SsaBuilder.visitParameterValues non-identifie r");
7119 } 7509 }
7120 var parameterId = (($0 = identifierLink.get$head()) && $0.is$Identifier()); 7510 var parameterId = (($0 = identifierLink.get$head()) == null ? null : $0.asse rt$Identifier());
7121 var element = (($0 = this.elements.$index(parameterId)) && $0.is$VariableEle ment()); 7511 var element = (($0 = this.elements.$index(parameterId)) == null ? null : $0. assert$VariableElement());
7122 var parameter = new HParameterValue(element); 7512 var parameter = new HParameterValue(element);
7123 this.add(parameter); 7513 this.add(parameter);
7124 this.definitions.$setindex(element, this.guard(element.type, parameter)); 7514 this.definitions.$setindex(element, this.guard(element.type, parameter));
7125 } 7515 }
7126 } 7516 }
7127 SsaBuilder.prototype.visitBlock = function(node) { 7517 SsaBuilder.prototype.visitBlock = function(node) {
7128 var $0; 7518 var $0;
7129 for (var link = node.statements.get$nodes(); 7519 for (var link = node.statements.get$nodes();
7130 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_ Node())) { 7520 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == null ? null : $0.assert$Link_Node())) {
7131 this.visit((($0 = link.get$head()) && $0.is$Node())); 7521 this.visit((($0 = link.get$head()) == null ? null : $0.assert$Node()));
7132 if ($notnull_bool(this.isAborted())) { 7522 if ($notnull_bool(this.isAborted())) {
7133 if (!this.stack.isEmpty()) this.compiler.cancel('non-empty instruction sta ck'); 7523 if (!this.stack.isEmpty()) this.compiler.cancel('non-empty instruction sta ck');
7134 return; 7524 return;
7135 } 7525 }
7136 } 7526 }
7137 $assert(!$notnull_bool(this.current.isClosed()), "!current.isClosed()", "build er.dart", 158, 12); 7527 $assert(!$notnull_bool(this.current.isClosed()), "!current.isClosed()", "build er.dart", 158, 12);
7138 if (!this.stack.isEmpty()) this.compiler.cancel('non-empty instruction stack') ; 7528 if (!this.stack.isEmpty()) this.compiler.cancel('non-empty instruction stack') ;
7139 } 7529 }
7140 SsaBuilder.prototype.visitClassNode = function(node) { 7530 SsaBuilder.prototype.visitClassNode = function(node) {
7141 unreachable(); 7531 unreachable();
(...skipping 16 matching lines...) Expand all
7158 $this.definitions.$setindex(element, phi); 7548 $this.definitions.$setindex(element, phi);
7159 }) 7549 })
7160 ); 7550 );
7161 return definitionsCopy; 7551 return definitionsCopy;
7162 } 7552 }
7163 SsaBuilder.prototype.endLoop = function(loopEntry, branchBlock, doUpdateDefiniti ons, exitDefinitions) { 7553 SsaBuilder.prototype.endLoop = function(loopEntry, branchBlock, doUpdateDefiniti ons, exitDefinitions) {
7164 var $this = this; // closure support 7554 var $this = this; // closure support
7165 loopEntry.forEachPhi((function (phi) { 7555 loopEntry.forEachPhi((function (phi) {
7166 var $0; 7556 var $0;
7167 var element = phi.element; 7557 var element = phi.element;
7168 var postLoopDefinition = (($0 = $this.definitions.$index(element)) && $0.is$ HInstruction()); 7558 var postLoopDefinition = (($0 = $this.definitions.$index(element)) == null ? null : $0.assert$HInstruction());
7169 phi.addInput(postLoopDefinition); 7559 phi.addInput(postLoopDefinition);
7170 if ($notnull_bool(doUpdateDefinitions) && phi.inputs.$index(0) !== postLoopD efinition && exitDefinitions.containsKey(element)) { 7560 if ($notnull_bool(doUpdateDefinitions) && phi.inputs.$index(0) !== postLoopD efinition && exitDefinitions.containsKey(element)) {
7171 exitDefinitions.$setindex(element, postLoopDefinition); 7561 exitDefinitions.$setindex(element, postLoopDefinition);
7172 } 7562 }
7173 }) 7563 })
7174 ); 7564 );
7175 var loopExitBlock = this.graph.addNewBlock(); 7565 var loopExitBlock = this.graph.addNewBlock();
7176 $assert(branchBlock.successors.length == 1, "branchBlock.successors.length == 1", "builder.dart", 220, 12); 7566 $assert(branchBlock.successors.length == 1, "branchBlock.successors.length == 1", "builder.dart", 220, 12);
7177 branchBlock.addSuccessor(loopExitBlock); 7567 branchBlock.addSuccessor(loopExitBlock);
7178 this.open(loopExitBlock); 7568 this.open(loopExitBlock);
(...skipping 25 matching lines...) Expand all
7204 var updateInstruction = this.pop(); 7594 var updateInstruction = this.pop();
7205 } 7595 }
7206 updateBlock = this.close(new HGoto()); 7596 updateBlock = this.close(new HGoto());
7207 updateBlock.addSuccessor(conditionBlock); 7597 updateBlock.addSuccessor(conditionBlock);
7208 conditionBlock.postProcessLoopHeader(); 7598 conditionBlock.postProcessLoopHeader();
7209 this.endLoop(conditionBlock, conditionExitBlock, false, conditionDefinitions); 7599 this.endLoop(conditionBlock, conditionExitBlock, false, conditionDefinitions);
7210 } 7600 }
7211 SsaBuilder.prototype.visitFor = function(node) { 7601 SsaBuilder.prototype.visitFor = function(node) {
7212 var $0; 7602 var $0;
7213 $assert(node.initializer != null && node.get$condition() != null && node.updat e != null && node.body != null, "node.initializer !== null && node.condition !== null &&\n node.update !== null && node.body !== null", "builder.dart" , 275, 12); 7603 $assert(node.initializer != null && node.get$condition() != null && node.updat e != null && node.body != null, "node.initializer !== null && node.condition !== null &&\n node.update !== null && node.body !== null", "builder.dart" , 275, 12);
7214 this.visitLoop(node.initializer, node.get$condition(), (($0 = node.update) && $0.is$Expression()), node.body); 7604 this.visitLoop(node.initializer, node.get$condition(), (($0 = node.update) == null ? null : $0.assert$Expression()), node.body);
7215 } 7605 }
7216 SsaBuilder.prototype.visitWhile = function(node) { 7606 SsaBuilder.prototype.visitWhile = function(node) {
7217 this.visitLoop(null, node.condition, null, node.body); 7607 this.visitLoop(null, node.condition, null, node.body);
7218 } 7608 }
7219 SsaBuilder.prototype.visitDoWhile = function(node) { 7609 SsaBuilder.prototype.visitDoWhile = function(node) {
7220 var entryDefinitions = this.startLoop(); 7610 var entryDefinitions = this.startLoop();
7221 var loopEntryBlock = this.current; 7611 var loopEntryBlock = this.current;
7222 this.visit(node.body); 7612 this.visit(node.body);
7223 if ($notnull_bool(this.isAborted())) { 7613 if ($notnull_bool(this.isAborted())) {
7224 this.compiler.unimplemented("SsaBuilder for loop with aborting body"); 7614 this.compiler.unimplemented("SsaBuilder for loop with aborting body");
7225 } 7615 }
7226 var bodyExitBlock = this.close(new HGoto()); 7616 var bodyExitBlock = this.close(new HGoto());
7227 var conditionBlock = this.graph.addNewBlock(); 7617 var conditionBlock = this.graph.addNewBlock();
7228 bodyExitBlock.addSuccessor(conditionBlock); 7618 bodyExitBlock.addSuccessor(conditionBlock);
7229 this.open(conditionBlock); 7619 this.open(conditionBlock);
7230 this.visit(node.condition); 7620 this.visit(node.condition);
7231 $assert(!$notnull_bool(this.isAborted()), "!isAborted()", "builder.dart", 300, 12); 7621 $assert(!$notnull_bool(this.isAborted()), "!isAborted()", "builder.dart", 300, 12);
7232 conditionBlock = this.close(new HLoopBranch(this.popBoolified())); 7622 conditionBlock = this.close(new HLoopBranch(this.popBoolified()));
7233 conditionBlock.addSuccessor(loopEntryBlock); 7623 conditionBlock.addSuccessor(loopEntryBlock);
7234 loopEntryBlock.postProcessLoopHeader(); 7624 loopEntryBlock.postProcessLoopHeader();
7235 this.endLoop(loopEntryBlock, conditionBlock, true, entryDefinitions); 7625 this.endLoop(loopEntryBlock, conditionBlock, true, entryDefinitions);
7236 } 7626 }
7237 SsaBuilder.prototype.visitFunctionExpression = function(node) { 7627 SsaBuilder.prototype.visitFunctionExpression = function(node) {
7238 this.compiler.unimplemented('SsaBuilder.visitFunctionExpression'); 7628 this.compiler.unimplemented('SsaBuilder.visitFunctionExpression');
7239 } 7629 }
7240 SsaBuilder.prototype.visitIdentifier = function(node) { 7630 SsaBuilder.prototype.visitIdentifier = function(node) {
7241 var $0; 7631 var $0;
7242 var element = (($0 = this.elements.$index(node)) && $0.is$Element()); 7632 var element = (($0 = this.elements.$index(node)) == null ? null : $0.assert$El ement());
7243 this.compiler.ensure(element != null); 7633 this.compiler.ensure(element != null);
7244 var def = (($0 = this.definitions.$index(element)) && $0.is$HInstruction()); 7634 var def = (($0 = this.definitions.$index(element)) == null ? null : $0.assert$ HInstruction());
7245 $assert(def != null, "def !== null", "builder.dart", 317, 12); 7635 $assert(def != null, "def !== null", "builder.dart", 317, 12);
7246 this.stack.add(def); 7636 this.stack.add(def);
7247 } 7637 }
7248 SsaBuilder.prototype.joinDefinitions = function(joinBlock, incoming1, incoming2) { 7638 SsaBuilder.prototype.joinDefinitions = function(joinBlock, incoming1, incoming2) {
7249 var joinedDefinitions = new HashMapImplementation(); 7639 var joinedDefinitions = new HashMapImplementation();
7250 incoming1.forEach((function (element, instruction) { 7640 incoming1.forEach((function (element, instruction) {
7251 var $0; 7641 var $0;
7252 var other = (($0 = incoming2.$index(element)) && $0.is$HInstruction()); 7642 var other = (($0 = incoming2.$index(element)) == null ? null : $0.assert$HIn struction());
7253 if (other == null) return; 7643 if (other == null) return;
7254 if (instruction === other) { 7644 if (instruction === other) {
7255 joinedDefinitions.$setindex(element, instruction); 7645 joinedDefinitions.$setindex(element, instruction);
7256 } 7646 }
7257 else { 7647 else {
7258 var phi = new HPhi.manyInputs$ctor(element, [instruction, other]); 7648 var phi = new HPhi.manyInputs$ctor(element, [instruction, other]);
7259 joinBlock.addPhi((phi && phi.is$HPhi())); 7649 joinBlock.addPhi((phi == null ? null : phi.assert$HPhi()));
7260 joinedDefinitions.$setindex(element, phi); 7650 joinedDefinitions.$setindex(element, phi);
7261 } 7651 }
7262 }) 7652 })
7263 ); 7653 );
7264 return joinedDefinitions; 7654 return joinedDefinitions;
7265 } 7655 }
7266 SsaBuilder.prototype.visitIf = function(node) { 7656 SsaBuilder.prototype.visitIf = function(node) {
7267 var hasElse = node.get$hasElsePart(); 7657 var hasElse = node.get$hasElsePart();
7268 this.visit(node.condition); 7658 this.visit(node.condition);
7269 var conditionBlock = this.close(new HIf(this.popBoolified(), hasElse)); 7659 var conditionBlock = this.close(new HIf(this.popBoolified(), hasElse));
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
7457 break; 7847 break;
7458 7848
7459 default: 7849 default:
7460 7850
7461 this.compiler.unimplemented("SsaBuilder.visitBinary"); 7851 this.compiler.unimplemented("SsaBuilder.visitBinary");
7462 7852
7463 } 7853 }
7464 } 7854 }
7465 SsaBuilder.prototype.visitSend = function(node) { 7855 SsaBuilder.prototype.visitSend = function(node) {
7466 var $0; 7856 var $0;
7467 var element = (($0 = this.elements.$index(node)) && $0.is$Element()); 7857 var element = (($0 = this.elements.$index(node)) == null ? null : $0.assert$El ement());
7468 if ((node.selector instanceof Operator)) { 7858 if ((node.selector instanceof Operator)) {
7469 var op = (($0 = node.selector) && $0.is$Operator()); 7859 var op = (($0 = node.selector) == null ? null : $0.assert$Operator());
7470 if ($notnull_bool($eq(const$278/*const SourceString("&&")*/, op.get$source() )) || $notnull_bool($eq(const$279/*const SourceString("||")*/, op.get$source())) ) { 7860 if ($notnull_bool($eq(const$278/*const SourceString("&&")*/, op.get$source() )) || $notnull_bool($eq(const$279/*const SourceString("||")*/, op.get$source())) ) {
7471 this.visitLogicalAndOr(node, op); 7861 this.visitLogicalAndOr(node, op);
7472 } 7862 }
7473 else if ($notnull_bool($eq(const$280/*const SourceString("!")*/, op.get$sour ce()))) { 7863 else if ($notnull_bool($eq(const$280/*const SourceString("!")*/, op.get$sour ce()))) {
7474 this.visitLogicalNot(node); 7864 this.visitLogicalNot(node);
7475 } 7865 }
7476 else if ((node.argumentsNode instanceof Prefix) || (node.argumentsNode insta nceof Postfix)) { 7866 else if ((node.argumentsNode instanceof Prefix) || (node.argumentsNode insta nceof Postfix)) {
7477 this.visitUnary(node, op, element); 7867 this.visitUnary(node, op, element);
7478 } 7868 }
7479 else { 7869 else {
7480 this.visit(node.receiver); 7870 this.visit(node.receiver);
7481 this.visit(node.argumentsNode); 7871 this.visit(node.argumentsNode);
7482 var right = this.pop(); 7872 var right = this.pop();
7483 var left = this.pop(); 7873 var left = this.pop();
7484 this.visitBinary((left && left.is$HInstruction()), op, (right && right.is$ HInstruction()), element); 7874 this.visitBinary((left == null ? null : left.assert$HInstruction()), op, ( right == null ? null : right.assert$HInstruction()), element);
7485 } 7875 }
7486 } 7876 }
7487 else if ($notnull_bool(node.get$isPropertyAccess())) { 7877 else if ($notnull_bool(node.get$isPropertyAccess())) {
7488 if (node.receiver != null) { 7878 if (node.receiver != null) {
7489 this.compiler.unimplemented("SsaBuilder.visitSend with receiver"); 7879 this.compiler.unimplemented("SsaBuilder.visitSend with receiver");
7490 } 7880 }
7491 var instruction = (($0 = this.definitions.$index(element)) && $0.is$HInstruc tion()); 7881 var instruction = (($0 = this.definitions.$index(element)) == null ? null : $0.assert$HInstruction());
7492 $assert(instruction != null, "instruction !== null", "builder.dart", 528, 14 ); 7882 $assert(instruction != null, "instruction !== null", "builder.dart", 528, 14 );
7493 this.stack.add(instruction); 7883 this.stack.add(instruction);
7494 } 7884 }
7495 else { 7885 else {
7496 var link = node.get$arguments(); 7886 var link = node.get$arguments();
7497 if (element.kind === const$219/*ElementKind.FOREIGN*/) { 7887 if (element.kind === const$219/*ElementKind.FOREIGN*/) {
7498 link = (($0 = link.get$tail()) && $0.is$Link_Node()); 7888 link = (($0 = link.get$tail()) == null ? null : $0.assert$Link_Node());
7499 } 7889 }
7500 var arguments = []; 7890 var arguments = [];
7501 for (; !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0. is$Link_Node())) { 7891 for (; !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == nul l ? null : $0.assert$Link_Node())) {
7502 this.visit((($0 = link.get$head()) && $0.is$Node())); 7892 this.visit((($0 = link.get$head()) == null ? null : $0.assert$Node()));
7503 arguments.add$1(this.pop()); 7893 arguments.add$1(this.pop());
7504 } 7894 }
7505 if (element.kind === const$219/*ElementKind.FOREIGN*/) { 7895 if (element.kind === const$219/*ElementKind.FOREIGN*/) {
7506 var literal = (($0 = node.get$arguments().get$head()) && $0.is$LiteralStri ng()); 7896 var literal = (($0 = node.get$arguments().get$head()) == null ? null : $0. assert$LiteralString());
7507 this.compiler.ensure((literal instanceof LiteralString)); 7897 this.compiler.ensure((literal instanceof LiteralString));
7508 this.push(new HForeign(arguments, this.unquote(literal))); 7898 this.push(new HForeign(arguments, this.unquote(literal)));
7509 } 7899 }
7510 else { 7900 else {
7511 this.push(new HInvoke(element, arguments)); 7901 this.push(new HInvoke(element, arguments));
7512 } 7902 }
7513 } 7903 }
7514 } 7904 }
7515 SsaBuilder.prototype.updateDefinition = function(node, value) { 7905 SsaBuilder.prototype.updateDefinition = function(node, value) {
7516 var $0; 7906 var $0;
7517 var element = (($0 = this.elements.$index(node)) && $0.is$VariableElement()); 7907 var element = (($0 = this.elements.$index(node)) == null ? null : $0.assert$Va riableElement());
7518 value = this.guard(element.type, value); 7908 value = this.guard(element.type, value);
7519 this.definitions.$setindex(element, value); 7909 this.definitions.$setindex(element, value);
7520 return value; 7910 return value;
7521 } 7911 }
7522 SsaBuilder.prototype.visitSendSet = function(node) { 7912 SsaBuilder.prototype.visitSendSet = function(node) {
7523 var $0; 7913 var $0;
7524 if (node.receiver != null) { 7914 if (node.receiver != null) {
7525 this.compiler.unimplemented("SsaBuilder: property access"); 7915 this.compiler.unimplemented("SsaBuilder: property access");
7526 } 7916 }
7527 var op = node.assignmentOperator; 7917 var op = node.assignmentOperator;
7528 if ($notnull_bool($eq(const$281/*const SourceString("=")*/, op.get$source()))) { 7918 if ($notnull_bool($eq(const$281/*const SourceString("=")*/, op.get$source()))) {
7529 var link = node.get$arguments(); 7919 var link = node.get$arguments();
7530 $assert(!$notnull_bool(link.isEmpty()) && $notnull_bool(link.get$tail().isEm pty$0()), "!link.isEmpty() && link.tail.isEmpty()", "builder.dart", 567, 14); 7920 $assert(!$notnull_bool(link.isEmpty()) && $notnull_bool(link.get$tail().isEm pty$0()), "!link.isEmpty() && link.tail.isEmpty()", "builder.dart", 567, 14);
7531 this.visit((($0 = link.get$head()) && $0.is$Node())); 7921 this.visit((($0 = link.get$head()) == null ? null : $0.assert$Node()));
7532 this.stack.add(this.updateDefinition(node, this.pop())); 7922 this.stack.add(this.updateDefinition(node, this.pop()));
7533 } 7923 }
7534 else { 7924 else {
7535 $assert($notnull_bool($eq(const$284/*const SourceString("++")*/, op.get$sour ce())) || $notnull_bool($eq(const$285/*const SourceString("--")*/, op.get$source ())) || node.assignmentOperator.get$source().get$stringValue().endsWith("="), "c onst SourceString(\"++\") == op.source ||\n const SourceString(\"--\ ") == op.source ||\n node.assignmentOperator.source.stringValue.ends With(\"=\")", "builder.dart", 571, 14); 7925 $assert($notnull_bool($eq(const$284/*const SourceString("++")*/, op.get$sour ce())) || $notnull_bool($eq(const$285/*const SourceString("--")*/, op.get$source ())) || node.assignmentOperator.get$source().get$stringValue().endsWith("="), "c onst SourceString(\"++\") == op.source ||\n const SourceString(\"--\ ") == op.source ||\n node.assignmentOperator.source.stringValue.ends With(\"=\")", "builder.dart", 571, 14);
7536 var isCompoundAssignment = !$notnull_bool(node.get$arguments().isEmpty()); 7926 var isCompoundAssignment = !$notnull_bool(node.get$arguments().isEmpty());
7537 var isPrefix = !$notnull_bool(node.get$isPostfix()); 7927 var isPrefix = !$notnull_bool(node.get$isPostfix());
7538 var getter = (($0 = this.elements.$index(node.selector)) && $0.is$Element()) ; 7928 var getter = (($0 = this.elements.$index(node.selector)) == null ? null : $0 .assert$Element());
7539 var left = (($0 = this.definitions.$index(getter)) && $0.is$HInstruction()); 7929 var left = (($0 = this.definitions.$index(getter)) == null ? null : $0.asser t$HInstruction());
7540 var right; 7930 var right;
7541 if ($notnull_bool(isCompoundAssignment)) { 7931 if ($notnull_bool(isCompoundAssignment)) {
7542 this.visit(node.argumentsNode); 7932 this.visit(node.argumentsNode);
7543 right = this.pop(); 7933 right = this.pop();
7544 } 7934 }
7545 else { 7935 else {
7546 right = new HLiteral(1); 7936 right = new HLiteral(1);
7547 this.add(right); 7937 this.add(right);
7548 } 7938 }
7549 var opElement = (($0 = this.elements.$index(op)) && $0.is$Element()); 7939 var opElement = (($0 = this.elements.$index(op)) == null ? null : $0.assert$ Element());
7550 this.visitBinary(left, op, right, opElement); 7940 this.visitBinary(left, op, right, opElement);
7551 var operation = this.pop(); 7941 var operation = this.pop();
7552 $assert(operation != null, "operation !== null", "builder.dart", 589, 14); 7942 $assert(operation != null, "operation !== null", "builder.dart", 589, 14);
7553 operation = this.updateDefinition(node, operation); 7943 operation = this.updateDefinition(node, operation);
7554 if ($notnull_bool(isPrefix)) { 7944 if ($notnull_bool(isPrefix)) {
7555 this.stack.add(operation); 7945 this.stack.add(operation);
7556 } 7946 }
7557 else { 7947 else {
7558 this.stack.add(left); 7948 this.stack.add(left);
7559 } 7949 }
(...skipping 10 matching lines...) Expand all
7570 } 7960 }
7571 SsaBuilder.prototype.visitLiteralString = function(node) { 7961 SsaBuilder.prototype.visitLiteralString = function(node) {
7572 this.push(new HLiteral(node.get$value())); 7962 this.push(new HLiteral(node.get$value()));
7573 } 7963 }
7574 SsaBuilder.prototype.visitLiteralNull = function(node) { 7964 SsaBuilder.prototype.visitLiteralNull = function(node) {
7575 this.push(new HLiteral(null)); 7965 this.push(new HLiteral(null));
7576 } 7966 }
7577 SsaBuilder.prototype.visitNodeList = function(node) { 7967 SsaBuilder.prototype.visitNodeList = function(node) {
7578 var $0; 7968 var $0;
7579 for (var link = node.get$nodes(); 7969 for (var link = node.get$nodes();
7580 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_ Node())) { 7970 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == null ? null : $0.assert$Link_Node())) {
7581 this.visit((($0 = link.get$head()) && $0.is$Node())); 7971 this.visit((($0 = link.get$head()) == null ? null : $0.assert$Node()));
7582 } 7972 }
7583 } 7973 }
7584 SsaBuilder.prototype.visitParenthesizedExpression = function(node) { 7974 SsaBuilder.prototype.visitParenthesizedExpression = function(node) {
7585 this.visit(node.expression); 7975 this.visit(node.expression);
7586 } 7976 }
7587 SsaBuilder.prototype.visitOperator = function(node) { 7977 SsaBuilder.prototype.visitOperator = function(node) {
7588 unreachable(); 7978 unreachable();
7589 } 7979 }
7590 SsaBuilder.prototype.visitReturn = function(node) { 7980 SsaBuilder.prototype.visitReturn = function(node) {
7591 var value; 7981 var value;
(...skipping 13 matching lines...) Expand all
7605 } 7995 }
7606 this.visit(node.expression); 7996 this.visit(node.expression);
7607 this.close(new HThrow(this.pop())); 7997 this.close(new HThrow(this.pop()));
7608 } 7998 }
7609 SsaBuilder.prototype.visitTypeAnnotation = function(node) { 7999 SsaBuilder.prototype.visitTypeAnnotation = function(node) {
7610 8000
7611 } 8001 }
7612 SsaBuilder.prototype.visitVariableDefinitions = function(node) { 8002 SsaBuilder.prototype.visitVariableDefinitions = function(node) {
7613 var $0; 8003 var $0;
7614 for (var link = node.definitions.get$nodes(); 8004 for (var link = node.definitions.get$nodes();
7615 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_ Node())) { 8005 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == null ? null : $0.assert$Link_Node())) {
7616 var definition = (($0 = link.get$head()) && $0.is$Node()); 8006 var definition = (($0 = link.get$head()) == null ? null : $0.assert$Node());
7617 if ((definition instanceof Identifier)) { 8007 if ((definition instanceof Identifier)) {
7618 var initialValue = new HLiteral(null); 8008 var initialValue = new HLiteral(null);
7619 this.add(initialValue); 8009 this.add(initialValue);
7620 this.updateDefinition(definition, initialValue); 8010 this.updateDefinition(definition, initialValue);
7621 } 8011 }
7622 else { 8012 else {
7623 $assert((definition instanceof SendSet), "definition is SendSet", "builder .dart", 669, 16); 8013 $assert((definition instanceof SendSet), "definition is SendSet", "builder .dart", 669, 16);
7624 this.visitSendSet((definition && definition.is$SendSet())); 8014 this.visitSendSet((definition == null ? null : definition.assert$SendSet() ));
7625 this.pop(); 8015 this.pop();
7626 } 8016 }
7627 } 8017 }
7628 } 8018 }
7629 SsaBuilder.prototype.add$1 = function($0) { 8019 SsaBuilder.prototype.add$1 = function($0) {
7630 return this.add(($0 && $0.is$HInstruction())); 8020 return this.add(($0 == null ? null : $0.assert$HInstruction()));
7631 }; 8021 };
7632 SsaBuilder.prototype.visit$1 = function($0) { 8022 SsaBuilder.prototype.visit$1 = function($0) {
7633 return this.visit(($0 && $0.is$Node())); 8023 return this.visit(($0 == null ? null : $0.assert$Node()));
7634 }; 8024 };
7635 // ********** Code for SsaCodeGeneratorTask ************** 8025 // ********** Code for SsaCodeGeneratorTask **************
7636 function SsaCodeGeneratorTask(compiler) { 8026 function SsaCodeGeneratorTask(compiler) {
7637 // Initializers done 8027 // Initializers done
7638 CompilerTask.call(this, compiler); 8028 CompilerTask.call(this, compiler);
7639 } 8029 }
7640 $inherits(SsaCodeGeneratorTask, CompilerTask); 8030 $inherits(SsaCodeGeneratorTask, CompilerTask);
7641 SsaCodeGeneratorTask.prototype.get$name = function() { 8031 SsaCodeGeneratorTask.prototype.get$name = function() {
7642 return 'SSA code generator'; 8032 return 'SSA code generator';
7643 } 8033 }
7644 SsaCodeGeneratorTask.prototype.generate = function(function_, graph) { 8034 SsaCodeGeneratorTask.prototype.generate = function(function_, graph) {
7645 var $this = this; // closure support 8035 var $this = this; // closure support
7646 return $assert_String(this.measure((function () { 8036 return $assert_String(this.measure((function () {
7647 var $0; 8037 var $0;
7648 var parameterNames = new LinkedHashMapImplementation(); 8038 var parameterNames = new LinkedHashMapImplementation();
7649 for (var link = function_.parameters; 8039 for (var link = function_.parameters;
7650 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Lin k_Element())) { 8040 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == null ? nu ll : $0.assert$Link_Element())) {
7651 var element = (($0 = link.get$head()) && $0.is$Element()); 8041 var element = (($0 = link.get$head()) == null ? null : $0.assert$Element() );
7652 parameterNames.$setindex(element, JsNames.getValid(('' + element.name))); 8042 parameterNames.$setindex(element, JsNames.getValid(('' + element.name)));
7653 } 8043 }
7654 var code = $this.generateMethod(function_.name, parameterNames, graph); 8044 var code = $this.generateMethod(function_.name, parameterNames, graph);
7655 return code; 8045 return code;
7656 }) 8046 })
7657 )); 8047 ));
7658 } 8048 }
7659 SsaCodeGeneratorTask.prototype.preGenerateMethod = function(graph) { 8049 SsaCodeGeneratorTask.prototype.preGenerateMethod = function(graph) {
7660 if (false/*null.GENERATE_SSA_TRACE*/) { 8050 if (false/*null.GENERATE_SSA_TRACE*/) {
7661 HTracer.HTracer$singleton$factory().traceGraph("codegen", graph); 8051 HTracer.HTracer$singleton$factory().traceGraph("codegen", graph);
7662 } 8052 }
7663 new SsaPhiEliminator().visitGraph(graph); 8053 new SsaPhiEliminator().visitGraph(graph);
7664 if (false/*null.GENERATE_SSA_TRACE*/) { 8054 if (false/*null.GENERATE_SSA_TRACE*/) {
7665 HTracer.HTracer$singleton$factory().traceGraph("no-phi", graph); 8055 HTracer.HTracer$singleton$factory().traceGraph("no-phi", graph);
7666 } 8056 }
7667 new SsaTypeGuardUnuser().visitGraph(graph); 8057 new SsaTypeGuardUnuser().visitGraph(graph);
7668 } 8058 }
7669 SsaCodeGeneratorTask.prototype.generateMethod = function(methodName, parameterNa mes, graph) { 8059 SsaCodeGeneratorTask.prototype.generateMethod = function(methodName, parameterNa mes, graph) {
7670 var $0; 8060 var $0;
7671 this.preGenerateMethod(graph); 8061 this.preGenerateMethod(graph);
7672 var buffer = new StringBufferImpl(""); 8062 var buffer = new StringBufferImpl("");
7673 var codegen = new SsaCodeGenerator(this.compiler, buffer, parameterNames); 8063 var codegen = new SsaCodeGenerator(this.compiler, buffer, parameterNames);
7674 codegen.visitGraph(graph); 8064 codegen.visitGraph(graph);
7675 var parameters = new StringBufferImpl(""); 8065 var parameters = new StringBufferImpl("");
7676 var names = (($0 = parameterNames.getValues()) && $0.is$List_String()); 8066 var names = (($0 = parameterNames.getValues()) == null ? null : $0.assert$List _String());
7677 for (var i = 0; 8067 for (var i = 0;
7678 i < $assert_num(names.length); i++) { 8068 i < $assert_num(names.length); i++) {
7679 if (i != 0) parameters.add(', '); 8069 if (i != 0) parameters.add(', ');
7680 parameters.add(names.$index(i)); 8070 parameters.add(names.$index(i));
7681 } 8071 }
7682 return ('function ' + methodName + '(' + parameters + ') {\n' + buffer + '}\n' ); 8072 return ('function ' + methodName + '(' + parameters + ') {\n' + buffer + '}\n' );
7683 } 8073 }
7684 // ********** Code for SsaCodeGenerator ************** 8074 // ********** Code for SsaCodeGenerator **************
7685 function SsaCodeGenerator(compiler, buffer, parameterNames) { 8075 function SsaCodeGenerator(compiler, buffer, parameterNames) {
7686 this.indent = 0 8076 this.indent = 0
7687 this.compiler = compiler; 8077 this.compiler = compiler;
7688 this.buffer = buffer; 8078 this.buffer = buffer;
7689 this.parameterNames = parameterNames; 8079 this.parameterNames = parameterNames;
7690 this.names = new HashMapImplementation(); 8080 this.names = new HashMapImplementation();
7691 this.prefixes = new HashMapImplementation(); 8081 this.prefixes = new HashMapImplementation();
7692 // Initializers done 8082 // Initializers done
7693 var $list = this.parameterNames.getValues(); 8083 var $list = this.parameterNames.getValues();
7694 for (var $i = this.parameterNames.getValues().iterator$0(); $i.hasNext$0(); ) { 8084 for (var $i = this.parameterNames.getValues().iterator$0(); $i.hasNext$0(); ) {
7695 var name = $i.next$0(); 8085 var name = $i.next$0();
7696 this.prefixes.$setindex(name, 0); 8086 this.prefixes.$setindex(name, 0);
7697 } 8087 }
7698 } 8088 }
7699 SsaCodeGenerator.prototype.is$HVisitor = function(){return this;}; 8089 SsaCodeGenerator.prototype.assert$HVisitor = function(){return this};
7700 SsaCodeGenerator.prototype.get$names = function() { return this.names; }; 8090 SsaCodeGenerator.prototype.get$names = function() { return this.names; };
7701 SsaCodeGenerator.prototype.visitGraph = function(graph) { 8091 SsaCodeGenerator.prototype.visitGraph = function(graph) {
7702 this.currentGraph = graph; 8092 this.currentGraph = graph;
7703 this.indent++; 8093 this.indent++;
7704 this.visitBasicBlock(graph.entry); 8094 this.visitBasicBlock(graph.entry);
7705 } 8095 }
7706 SsaCodeGenerator.prototype.parameter = function(parameter) { 8096 SsaCodeGenerator.prototype.parameter = function(parameter) {
7707 return $assert_String(this.parameterNames.$index(parameter.element)); 8097 return $assert_String(this.parameterNames.$index(parameter.element));
7708 } 8098 }
7709 SsaCodeGenerator.prototype.temporary = function(instruction) { 8099 SsaCodeGenerator.prototype.temporary = function(instruction) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
7746 var result = JsNames.getValid(name); 8136 var result = JsNames.getValid(name);
7747 this.names.$setindex(id, result); 8137 this.names.$setindex(id, result);
7748 return result; 8138 return result;
7749 } 8139 }
7750 SsaCodeGenerator.prototype.invoke = function(element, arguments) { 8140 SsaCodeGenerator.prototype.invoke = function(element, arguments) {
7751 var $0; 8141 var $0;
7752 this.buffer.add(('' + element.name + '(')); 8142 this.buffer.add(('' + element.name + '('));
7753 for (var i = 0; 8143 for (var i = 0;
7754 i < arguments.length; i++) { 8144 i < arguments.length; i++) {
7755 if (i != 0) this.buffer.add(', '); 8145 if (i != 0) this.buffer.add(', ');
7756 this.use((($0 = arguments.$index(i)) && $0.is$HInstruction())); 8146 this.use((($0 = arguments.$index(i)) == null ? null : $0.assert$HInstruction ()));
7757 } 8147 }
7758 this.buffer.add(")"); 8148 this.buffer.add(")");
7759 } 8149 }
7760 SsaCodeGenerator.prototype.define = function(instruction) { 8150 SsaCodeGenerator.prototype.define = function(instruction) {
7761 this.buffer.add(('var ' + this.temporary(instruction) + ' = ')); 8151 this.buffer.add(('var ' + this.temporary(instruction) + ' = '));
7762 this.visit(instruction); 8152 this.visit(instruction);
7763 } 8153 }
7764 SsaCodeGenerator.prototype.use = function(argument) { 8154 SsaCodeGenerator.prototype.use = function(argument) {
7765 if ($notnull_bool(argument.generateAtUseSite())) { 8155 if ($notnull_bool(argument.generateAtUseSite())) {
7766 this.visit(argument); 8156 this.visit(argument);
(...skipping 29 matching lines...) Expand all
7796 this.buffer.add(';\n'); 8186 this.buffer.add(';\n');
7797 } 8187 }
7798 } 8188 }
7799 instruction = instruction.next; 8189 instruction = instruction.next;
7800 } 8190 }
7801 } 8191 }
7802 SsaCodeGenerator.prototype.visitInvokeBinary = function(node, useOperator, op) { 8192 SsaCodeGenerator.prototype.visitInvokeBinary = function(node, useOperator, op) {
7803 var $0; 8193 var $0;
7804 if ($notnull_bool(useOperator)) { 8194 if ($notnull_bool(useOperator)) {
7805 this.buffer.add('('); 8195 this.buffer.add('(');
7806 this.use((($0 = node.inputs.$index(0)) && $0.is$HInstruction())); 8196 this.use((($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstructi on()));
7807 this.buffer.add((' ' + op + ' ')); 8197 this.buffer.add((' ' + op + ' '));
7808 this.use((($0 = node.inputs.$index(1)) && $0.is$HInstruction())); 8198 this.use((($0 = node.inputs.$index(1)) == null ? null : $0.assert$HInstructi on()));
7809 this.buffer.add(')'); 8199 this.buffer.add(')');
7810 } 8200 }
7811 else { 8201 else {
7812 this.visitInvoke(node); 8202 this.visitInvoke(node);
7813 } 8203 }
7814 } 8204 }
7815 SsaCodeGenerator.prototype.visitInvokeUnary = function(node, useOperator, op) { 8205 SsaCodeGenerator.prototype.visitInvokeUnary = function(node, useOperator, op) {
7816 var $0; 8206 var $0;
7817 if ($notnull_bool(useOperator)) { 8207 if ($notnull_bool(useOperator)) {
7818 this.buffer.add(('(' + op)); 8208 this.buffer.add(('(' + op));
7819 this.use((($0 = node.inputs.$index(0)) && $0.is$HInstruction())); 8209 this.use((($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstructi on()));
7820 this.buffer.add(')'); 8210 this.buffer.add(')');
7821 } 8211 }
7822 else { 8212 else {
7823 this.visitInvoke(node); 8213 this.visitInvoke(node);
7824 } 8214 }
7825 } 8215 }
7826 SsaCodeGenerator.prototype.visitAdd = function(node) { 8216 SsaCodeGenerator.prototype.visitAdd = function(node) {
7827 return this.visitInvokeBinary(node, node.builtin, '+'); 8217 return this.visitInvokeBinary(node, node.builtin, '+');
7828 } 8218 }
7829 SsaCodeGenerator.prototype.visitDivide = function(node) { 8219 SsaCodeGenerator.prototype.visitDivide = function(node) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
7874 SsaCodeGenerator.prototype.visitGreater = function(node) { 8264 SsaCodeGenerator.prototype.visitGreater = function(node) {
7875 return this.visitInvokeBinary(node, node.builtin, '>'); 8265 return this.visitInvokeBinary(node, node.builtin, '>');
7876 } 8266 }
7877 SsaCodeGenerator.prototype.visitGreaterEqual = function(node) { 8267 SsaCodeGenerator.prototype.visitGreaterEqual = function(node) {
7878 return this.visitInvokeBinary(node, node.builtin, '>='); 8268 return this.visitInvokeBinary(node, node.builtin, '>=');
7879 } 8269 }
7880 SsaCodeGenerator.prototype.visitBoolify = function(node) { 8270 SsaCodeGenerator.prototype.visitBoolify = function(node) {
7881 var $0; 8271 var $0;
7882 $assert(node.inputs.length == 1, "node.inputs.length == 1", "codegen.dart", 24 8, 12); 8272 $assert(node.inputs.length == 1, "node.inputs.length == 1", "codegen.dart", 24 8, 12);
7883 this.buffer.add('('); 8273 this.buffer.add('(');
7884 this.use((($0 = node.inputs.$index(0)) && $0.is$HInstruction())); 8274 this.use((($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstruction ()));
7885 this.buffer.add(' === true)'); 8275 this.buffer.add(' === true)');
7886 } 8276 }
7887 SsaCodeGenerator.prototype.visitExit = function(node) { 8277 SsaCodeGenerator.prototype.visitExit = function(node) {
7888 8278
7889 } 8279 }
7890 SsaCodeGenerator.prototype.visitGoto = function(node) { 8280 SsaCodeGenerator.prototype.visitGoto = function(node) {
7891 var $0; 8281 var $0;
7892 $assert(this.currentBlock.successors.length == 1, "currentBlock.successors.len gth == 1", "codegen.dart", 259, 12); 8282 $assert(this.currentBlock.successors.length == 1, "currentBlock.successors.len gth == 1", "codegen.dart", 259, 12);
7893 var dominated = this.currentBlock.dominatedBlocks; 8283 var dominated = this.currentBlock.dominatedBlocks;
7894 if (dominated.isEmpty()) return; 8284 if (dominated.isEmpty()) return;
7895 if (dominated.length > 2) unreachable(); 8285 if (dominated.length > 2) unreachable();
7896 if (dominated.length == 2 && this.currentBlock !== this.currentGraph.entry) { 8286 if (dominated.length == 2 && this.currentBlock !== this.currentGraph.entry) {
7897 unreachable(); 8287 unreachable();
7898 } 8288 }
7899 $assert($eq(dominated.$index(0), this.currentBlock.successors.$index(0)), "dom inated[0] == currentBlock.successors[0]", "codegen.dart", 271, 12); 8289 $assert($eq(dominated.$index(0), this.currentBlock.successors.$index(0)), "dom inated[0] == currentBlock.successors[0]", "codegen.dart", 271, 12);
7900 this.visitBasicBlock((($0 = dominated.$index(0)) && $0.is$HBasicBlock())); 8290 this.visitBasicBlock((($0 = dominated.$index(0)) == null ? null : $0.assert$HB asicBlock()));
7901 } 8291 }
7902 SsaCodeGenerator.prototype.visitIf = function(node) { 8292 SsaCodeGenerator.prototype.visitIf = function(node) {
7903 var $0; 8293 var $0;
7904 var ifBlock = this.currentBlock; 8294 var ifBlock = this.currentBlock;
7905 this.buffer.add('if ('); 8295 this.buffer.add('if (');
7906 this.use((($0 = node.inputs.$index(0)) && $0.is$HInstruction())); 8296 this.use((($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstruction ()));
7907 this.buffer.add(') {\n'); 8297 this.buffer.add(') {\n');
7908 this.indent++; 8298 this.indent++;
7909 var dominated = this.currentBlock.dominatedBlocks; 8299 var dominated = this.currentBlock.dominatedBlocks;
7910 $assert(dominated.$index(0) === ifBlock.successors.$index(0), "dominated[0] == = ifBlock.successors[0]", "codegen.dart", 284, 12); 8300 $assert(dominated.$index(0) === ifBlock.successors.$index(0), "dominated[0] == = ifBlock.successors[0]", "codegen.dart", 284, 12);
7911 this.visitBasicBlock((($0 = ifBlock.successors.$index(0)) && $0.is$HBasicBlock ())); 8301 this.visitBasicBlock((($0 = ifBlock.successors.$index(0)) == null ? null : $0. assert$HBasicBlock()));
7912 this.indent--; 8302 this.indent--;
7913 this.addIndentation(); 8303 this.addIndentation();
7914 var nextDominatedIndex; 8304 var nextDominatedIndex;
7915 if ($notnull_bool(node.hasElse)) { 8305 if ($notnull_bool(node.hasElse)) {
7916 $assert(dominated.$index(1) === ifBlock.successors.$index(1), "dominated[1] === ifBlock.successors[1]", "codegen.dart", 290, 14); 8306 $assert(dominated.$index(1) === ifBlock.successors.$index(1), "dominated[1] === ifBlock.successors[1]", "codegen.dart", 290, 14);
7917 this.buffer.add('} else {\n'); 8307 this.buffer.add('} else {\n');
7918 this.indent++; 8308 this.indent++;
7919 this.visitBasicBlock((($0 = ifBlock.successors.$index(1)) && $0.is$HBasicBlo ck())); 8309 this.visitBasicBlock((($0 = ifBlock.successors.$index(1)) == null ? null : $ 0.assert$HBasicBlock()));
7920 this.indent--; 8310 this.indent--;
7921 this.addIndentation(); 8311 this.addIndentation();
7922 this.buffer.add("}\n"); 8312 this.buffer.add("}\n");
7923 } 8313 }
7924 else { 8314 else {
7925 this.buffer.add("}\n"); 8315 this.buffer.add("}\n");
7926 } 8316 }
7927 if ($notnull_bool(node.hasElse) && dominated.length == 3) { 8317 if ($notnull_bool(node.hasElse) && dominated.length == 3) {
7928 this.visitBasicBlock((($0 = dominated.$index(2)) && $0.is$HBasicBlock())); 8318 this.visitBasicBlock((($0 = dominated.$index(2)) == null ? null : $0.assert$ HBasicBlock()));
7929 } 8319 }
7930 else if ($notnull_bool(node.hasElse)) { 8320 else if ($notnull_bool(node.hasElse)) {
7931 $assert(dominated.length == 2, "dominated.length == 2", "codegen.dart", 318, 14); 8321 $assert(dominated.length == 2, "dominated.length == 2", "codegen.dart", 318, 14);
7932 return; 8322 return;
7933 } 8323 }
7934 else if (!$notnull_bool(node.hasElse) && dominated.length == 2) { 8324 else if (!$notnull_bool(node.hasElse) && dominated.length == 2) {
7935 $assert(!$notnull_bool(dominated.$index(1).isExitBlock$0()), "!dominated[1]. isExitBlock()", "codegen.dart", 323, 14); 8325 $assert(!$notnull_bool(dominated.$index(1).isExitBlock$0()), "!dominated[1]. isExitBlock()", "codegen.dart", 323, 14);
7936 this.visitBasicBlock((($0 = dominated.$index(1)) && $0.is$HBasicBlock())); 8326 this.visitBasicBlock((($0 = dominated.$index(1)) == null ? null : $0.assert$ HBasicBlock()));
7937 } 8327 }
7938 else { 8328 else {
7939 $assert(!$notnull_bool(node.hasElse), "!node.hasElse", "codegen.dart", 328, 14); 8329 $assert(!$notnull_bool(node.hasElse), "!node.hasElse", "codegen.dart", 328, 14);
7940 $assert(dominated.length == 3, "dominated.length == 3", "codegen.dart", 329, 14); 8330 $assert(dominated.length == 3, "dominated.length == 3", "codegen.dart", 329, 14);
7941 $assert(dominated.$index(2).isExitBlock$0(), "dominated[2].isExitBlock()", " codegen.dart", 330, 14); 8331 $assert(dominated.$index(2).isExitBlock$0(), "dominated[2].isExitBlock()", " codegen.dart", 330, 14);
7942 this.visitBasicBlock((($0 = dominated.$index(1)) && $0.is$HBasicBlock())); 8332 this.visitBasicBlock((($0 = dominated.$index(1)) == null ? null : $0.assert$ HBasicBlock()));
7943 this.visitBasicBlock((($0 = dominated.$index(2)) && $0.is$HBasicBlock())); 8333 this.visitBasicBlock((($0 = dominated.$index(2)) == null ? null : $0.assert$ HBasicBlock()));
7944 } 8334 }
7945 } 8335 }
7946 SsaCodeGenerator.prototype.visitInvoke = function(node) { 8336 SsaCodeGenerator.prototype.visitInvoke = function(node) {
7947 this.compiler.worklist.add(node.element); 8337 this.compiler.worklist.add(node.element);
7948 this.invoke(node.element, node.inputs); 8338 this.invoke(node.element, node.inputs);
7949 } 8339 }
7950 SsaCodeGenerator.prototype.visitForeign = function(node) { 8340 SsaCodeGenerator.prototype.visitForeign = function(node) {
7951 var $0; 8341 var $0;
7952 var code = ('' + node.code); 8342 var code = ('' + node.code);
7953 var inputs = node.inputs; 8343 var inputs = node.inputs;
7954 for (var i = 0; 8344 for (var i = 0;
7955 i < inputs.length; i++) { 8345 i < inputs.length; i++) {
7956 var input = (($0 = inputs.$index(i)) && $0.is$HInstruction()); 8346 var input = (($0 = inputs.$index(i)) == null ? null : $0.assert$HInstruction ());
7957 var name = null; 8347 var name = null;
7958 if ((input instanceof HParameterValue)) { 8348 if ((input instanceof HParameterValue)) {
7959 name = this.parameter((input && input.is$HParameterValue())); 8349 name = this.parameter((input == null ? null : input.assert$HParameterValue ()));
7960 } 8350 }
7961 else { 8351 else {
7962 $assert(!$notnull_bool(input.generateAtUseSite()), "!input.generateAtUseSi te()", "codegen.dart", 350, 16); 8352 $assert(!$notnull_bool(input.generateAtUseSite()), "!input.generateAtUseSi te()", "codegen.dart", 350, 16);
7963 name = this.temporary(input); 8353 name = this.temporary(input);
7964 } 8354 }
7965 code = code.replaceAll(('\$' + i), name); 8355 code = code.replaceAll(('\$' + i), name);
7966 } 8356 }
7967 this.buffer.add(('(' + code + ')')); 8357 this.buffer.add(('(' + code + ')'));
7968 } 8358 }
7969 SsaCodeGenerator.prototype.visitLiteral = function(node) { 8359 SsaCodeGenerator.prototype.visitLiteral = function(node) {
7970 if (node.value == null) { 8360 if (node.value == null) {
7971 this.buffer.add("(void 0)"); 8361 this.buffer.add("(void 0)");
7972 } 8362 }
7973 else if ((typeof(node.value) == 'number') && node.value < 0) { 8363 else if ((typeof(node.value) == 'number') && node.value < 0) {
7974 this.buffer.add(('(' + node.value + ')')); 8364 this.buffer.add(('(' + node.value + ')'));
7975 } 8365 }
7976 else { 8366 else {
7977 this.buffer.add(node.value); 8367 this.buffer.add(node.value);
7978 } 8368 }
7979 } 8369 }
7980 SsaCodeGenerator.prototype.visitLoopBranch = function(node) { 8370 SsaCodeGenerator.prototype.visitLoopBranch = function(node) {
7981 var $0; 8371 var $0;
7982 var branchBlock = this.currentBlock; 8372 var branchBlock = this.currentBlock;
7983 this.buffer.add('if (!('); 8373 this.buffer.add('if (!(');
7984 this.use((($0 = node.inputs.$index(0)) && $0.is$HInstruction())); 8374 this.use((($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstruction ()));
7985 this.buffer.add(')) break;\n'); 8375 this.buffer.add(')) break;\n');
7986 var dominated = this.currentBlock.dominatedBlocks; 8376 var dominated = this.currentBlock.dominatedBlocks;
7987 var loopSuccessor; 8377 var loopSuccessor;
7988 if (dominated.length == 1) { 8378 if (dominated.length == 1) {
7989 $assert(branchBlock.successors.$index(0).get$id() < branchBlock.id, "branchB lock.successors[0].id < branchBlock.id", "codegen.dart", 378, 14); 8379 $assert(branchBlock.successors.$index(0).get$id() < branchBlock.id, "branchB lock.successors[0].id < branchBlock.id", "codegen.dart", 378, 14);
7990 $assert(dominated.$index(0) === branchBlock.successors.$index(1), "dominated [0] === branchBlock.successors[1]", "codegen.dart", 379, 14); 8380 $assert(dominated.$index(0) === branchBlock.successors.$index(1), "dominated [0] === branchBlock.successors[1]", "codegen.dart", 379, 14);
7991 } 8381 }
7992 else { 8382 else {
7993 $assert(dominated.length == 2, "dominated.length == 2", "codegen.dart", 383, 14); 8383 $assert(dominated.length == 2, "dominated.length == 2", "codegen.dart", 383, 14);
7994 $assert(dominated.$index(0) === branchBlock.successors.$index(0), "dominated [0] === branchBlock.successors[0]", "codegen.dart", 384, 14); 8384 $assert(dominated.$index(0) === branchBlock.successors.$index(0), "dominated [0] === branchBlock.successors[0]", "codegen.dart", 384, 14);
7995 $assert(dominated.$index(1) === branchBlock.successors.$index(1), "dominated [1] === branchBlock.successors[1]", "codegen.dart", 385, 14); 8385 $assert(dominated.$index(1) === branchBlock.successors.$index(1), "dominated [1] === branchBlock.successors[1]", "codegen.dart", 385, 14);
7996 this.visit(dominated.$index(0)); 8386 this.visit(dominated.$index(0));
7997 } 8387 }
7998 this.indent--; 8388 this.indent--;
7999 this.addIndentation(); 8389 this.addIndentation();
8000 this.buffer.add('}\n'); 8390 this.buffer.add('}\n');
8001 this.visit(branchBlock.successors.$index(1)); 8391 this.visit(branchBlock.successors.$index(1));
8002 } 8392 }
8003 SsaCodeGenerator.prototype.visitNot = function(node) { 8393 SsaCodeGenerator.prototype.visitNot = function(node) {
8004 var $0; 8394 var $0;
8005 $assert(node.inputs.length == 1, "node.inputs.length == 1", "codegen.dart", 39 5, 12); 8395 $assert(node.inputs.length == 1, "node.inputs.length == 1", "codegen.dart", 39 5, 12);
8006 this.buffer.add('(!'); 8396 this.buffer.add('(!');
8007 this.use((($0 = node.inputs.$index(0)) && $0.is$HInstruction())); 8397 this.use((($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstruction ()));
8008 this.buffer.add(')'); 8398 this.buffer.add(')');
8009 } 8399 }
8010 SsaCodeGenerator.prototype.visitParameterValue = function(node) { 8400 SsaCodeGenerator.prototype.visitParameterValue = function(node) {
8011 this.buffer.add(this.parameter(node)); 8401 this.buffer.add(this.parameter(node));
8012 } 8402 }
8013 SsaCodeGenerator.prototype.visitPhi = function(node) { 8403 SsaCodeGenerator.prototype.visitPhi = function(node) {
8014 unreachable(); 8404 unreachable();
8015 } 8405 }
8016 SsaCodeGenerator.prototype.visitReturn = function(node) { 8406 SsaCodeGenerator.prototype.visitReturn = function(node) {
8017 var $0; 8407 var $0;
8018 $assert(node.inputs.length == 1, "node.inputs.length == 1", "codegen.dart", 41 1, 12); 8408 $assert(node.inputs.length == 1, "node.inputs.length == 1", "codegen.dart", 41 1, 12);
8019 var input = (($0 = node.inputs.$index(0)) && $0.is$HInstruction()); 8409 var input = (($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstruct ion());
8020 if ($notnull_bool(input.isLiteralNull())) { 8410 if ($notnull_bool(input.isLiteralNull())) {
8021 this.buffer.add('return;\n'); 8411 this.buffer.add('return;\n');
8022 } 8412 }
8023 else { 8413 else {
8024 this.buffer.add('return '); 8414 this.buffer.add('return ');
8025 this.use((($0 = node.inputs.$index(0)) && $0.is$HInstruction())); 8415 this.use((($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstructi on()));
8026 this.buffer.add(';\n'); 8416 this.buffer.add(';\n');
8027 } 8417 }
8028 } 8418 }
8029 SsaCodeGenerator.prototype.visitThrow = function(node) { 8419 SsaCodeGenerator.prototype.visitThrow = function(node) {
8030 var $0; 8420 var $0;
8031 this.buffer.add('throw '); 8421 this.buffer.add('throw ');
8032 this.use((($0 = node.inputs.$index(0)) && $0.is$HInstruction())); 8422 this.use((($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstruction ()));
8033 this.buffer.add(';\n'); 8423 this.buffer.add(';\n');
8034 } 8424 }
8035 SsaCodeGenerator.prototype.visitTypeGuard = function(node) { 8425 SsaCodeGenerator.prototype.visitTypeGuard = function(node) {
8036 var $0; 8426 var $0;
8037 var name; 8427 var name;
8038 if ($notnull_bool(node.isNumber())) { 8428 if ($notnull_bool(node.isNumber())) {
8039 name = const$301/*const SourceString('guard\$num')*/; 8429 name = const$301/*const SourceString('guard\$num')*/;
8040 } 8430 }
8041 else if ($notnull_bool(node.isString())) { 8431 else if ($notnull_bool(node.isString())) {
8042 name = const$302/*const SourceString('guard\$string')*/; 8432 name = const$302/*const SourceString('guard\$string')*/;
8043 } 8433 }
8044 else { 8434 else {
8045 unreachable(); 8435 unreachable();
8046 } 8436 }
8047 var element = this.compiler.universe.find(name); 8437 var element = this.compiler.universe.find(name);
8048 this.compiler.worklist.add(element); 8438 this.compiler.worklist.add(element);
8049 this.buffer.add(('' + name + '(')); 8439 this.buffer.add(('' + name + '('));
8050 this.use((($0 = node.inputs.$index(0)) && $0.is$HInstruction())); 8440 this.use((($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstruction ()));
8051 this.buffer.add(')'); 8441 this.buffer.add(')');
8052 } 8442 }
8053 SsaCodeGenerator.prototype.addIndentation = function() { 8443 SsaCodeGenerator.prototype.addIndentation = function() {
8054 for (var i = 0; 8444 for (var i = 0;
8055 i < this.indent; i++) { 8445 i < this.indent; i++) {
8056 this.buffer.add(' '); 8446 this.buffer.add(' ');
8057 } 8447 }
8058 } 8448 }
8059 SsaCodeGenerator.prototype.visitStore = function(node) { 8449 SsaCodeGenerator.prototype.visitStore = function(node) {
8060 if (node.get$local().declaredBy === node) { 8450 if (node.get$local().declaredBy === node) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
8096 // Initializers done 8486 // Initializers done
8097 } 8487 }
8098 HGraphVisitor.prototype.visitDominatorTree = function(graph) { 8488 HGraphVisitor.prototype.visitDominatorTree = function(graph) {
8099 var $this = this; // closure support 8489 var $this = this; // closure support
8100 function visitBasicBlockAndSuccessors(block) { 8490 function visitBasicBlockAndSuccessors(block) {
8101 var $0; 8491 var $0;
8102 $this.visitBasicBlock(block); 8492 $this.visitBasicBlock(block);
8103 var dominated = block.dominatedBlocks; 8493 var dominated = block.dominatedBlocks;
8104 for (var i = 0; 8494 for (var i = 0;
8105 i < dominated.length; i++) { 8495 i < dominated.length; i++) {
8106 visitBasicBlockAndSuccessors((($0 = dominated.$index(i)) && $0.is$HBasicBl ock())); 8496 visitBasicBlockAndSuccessors((($0 = dominated.$index(i)) == null ? null : $0.assert$HBasicBlock()));
8107 } 8497 }
8108 } 8498 }
8109 visitBasicBlockAndSuccessors(graph.entry); 8499 visitBasicBlockAndSuccessors(graph.entry);
8110 } 8500 }
8111 HGraphVisitor.prototype.visitPostDominatorTree = function(graph) { 8501 HGraphVisitor.prototype.visitPostDominatorTree = function(graph) {
8112 var $this = this; // closure support 8502 var $this = this; // closure support
8113 function visitBasicBlockAndSuccessors(block) { 8503 function visitBasicBlockAndSuccessors(block) {
8114 var $0; 8504 var $0;
8115 var dominated = block.dominatedBlocks; 8505 var dominated = block.dominatedBlocks;
8116 for (var i = dominated.length - 1; 8506 for (var i = dominated.length - 1;
8117 i >= 0; i--) { 8507 i >= 0; i--) {
8118 visitBasicBlockAndSuccessors((($0 = dominated.$index(i)) && $0.is$HBasicBl ock())); 8508 visitBasicBlockAndSuccessors((($0 = dominated.$index(i)) == null ? null : $0.assert$HBasicBlock()));
8119 } 8509 }
8120 $this.visitBasicBlock(block); 8510 $this.visitBasicBlock(block);
8121 } 8511 }
8122 visitBasicBlockAndSuccessors(graph.entry); 8512 visitBasicBlockAndSuccessors(graph.entry);
8123 } 8513 }
8124 // ********** Code for HInstructionVisitor ************** 8514 // ********** Code for HInstructionVisitor **************
8125 function HInstructionVisitor() { 8515 function HInstructionVisitor() {
8126 // Initializers done 8516 // Initializers done
8127 HGraphVisitor.call(this); 8517 HGraphVisitor.call(this);
8128 } 8518 }
(...skipping 11 matching lines...) Expand all
8140 this.currentBlock = node; 8530 this.currentBlock = node;
8141 visitInstructionList(node); 8531 visitInstructionList(node);
8142 } 8532 }
8143 // ********** Code for HGraph ************** 8533 // ********** Code for HGraph **************
8144 function HGraph() { 8534 function HGraph() {
8145 this.blocks = new ListFactory(); 8535 this.blocks = new ListFactory();
8146 // Initializers done 8536 // Initializers done
8147 this.entry = this.addNewBlock(); 8537 this.entry = this.addNewBlock();
8148 this.exit = new HBasicBlock(); 8538 this.exit = new HBasicBlock();
8149 } 8539 }
8150 HGraph.prototype.is$HGraph = function(){return this;}; 8540 HGraph.prototype.assert$HGraph = function(){return this};
8151 HGraph.prototype.addBlock = function(block) { 8541 HGraph.prototype.addBlock = function(block) {
8152 var id = this.blocks.length; 8542 var id = this.blocks.length;
8153 block.id = id; 8543 block.id = id;
8154 this.blocks.add(block); 8544 this.blocks.add(block);
8155 $assert(this.blocks.$index(id) === block, "blocks[id] === block", "nodes.dart" , 109, 12); 8545 $assert(this.blocks.$index(id) === block, "blocks[id] === block", "nodes.dart" , 109, 12);
8156 } 8546 }
8157 HGraph.prototype.addNewBlock = function() { 8547 HGraph.prototype.addNewBlock = function() {
8158 var result = new HBasicBlock(); 8548 var result = new HBasicBlock();
8159 this.addBlock(result); 8549 this.addBlock(result);
8160 return result; 8550 return result;
8161 } 8551 }
8162 HGraph.prototype.addNewLoopHeaderBlock = function() { 8552 HGraph.prototype.addNewLoopHeaderBlock = function() {
8163 var result = this.addNewBlock(); 8553 var result = this.addNewBlock();
8164 result.loopInformation = new HLoopInformation(result); 8554 result.loopInformation = new HLoopInformation(result);
8165 return result; 8555 return result;
8166 } 8556 }
8167 HGraph.prototype.finalize = function() { 8557 HGraph.prototype.finalize = function() {
8168 this.addBlock(this.exit); 8558 this.addBlock(this.exit);
8169 this.exit.open(); 8559 this.exit.open();
8170 this.exit.close(new HExit()); 8560 this.exit.close(new HExit());
8171 this.assignDominators(); 8561 this.assignDominators();
8172 } 8562 }
8173 HGraph.prototype.assignDominators = function() { 8563 HGraph.prototype.assignDominators = function() {
8174 var $0; 8564 var $0;
8175 for (var i = 0, length = this.blocks.length; 8565 for (var i = 0, length = this.blocks.length;
8176 i < length; i++) { 8566 i < length; i++) {
8177 var block = (($0 = this.blocks.$index(i)) && $0.is$HBasicBlock()); 8567 var block = (($0 = this.blocks.$index(i)) == null ? null : $0.assert$HBasicB lock());
8178 var predecessors = block.predecessors; 8568 var predecessors = block.predecessors;
8179 if ($notnull_bool(block.isLoopHeader())) { 8569 if ($notnull_bool(block.isLoopHeader())) {
8180 $assert(predecessors.length >= 2, "predecessors.length >= 2", "nodes.dart" , 139, 16); 8570 $assert(predecessors.length >= 2, "predecessors.length >= 2", "nodes.dart" , 139, 16);
8181 block.assignCommonDominator((($0 = predecessors.$index(0)) && $0.is$HBasic Block())); 8571 block.assignCommonDominator((($0 = predecessors.$index(0)) == null ? null : $0.assert$HBasicBlock()));
8182 } 8572 }
8183 else { 8573 else {
8184 for (var j = predecessors.length - 1; 8574 for (var j = predecessors.length - 1;
8185 j >= 0; j--) { 8575 j >= 0; j--) {
8186 block.assignCommonDominator((($0 = predecessors.$index(j)) && $0.is$HBas icBlock())); 8576 block.assignCommonDominator((($0 = predecessors.$index(j)) == null ? nul l : $0.assert$HBasicBlock()));
8187 } 8577 }
8188 } 8578 }
8189 } 8579 }
8190 } 8580 }
8191 HGraph.prototype.isValid = function() { 8581 HGraph.prototype.isValid = function() {
8192 var validator = new HValidator(); 8582 var validator = new HValidator();
8193 validator.visitGraph(this); 8583 validator.visitGraph(this);
8194 return validator.isValid; 8584 return validator.isValid;
8195 } 8585 }
8196 // ********** Code for HBaseVisitor ************** 8586 // ********** Code for HBaseVisitor **************
8197 function HBaseVisitor() { 8587 function HBaseVisitor() {
8198 // Initializers done 8588 // Initializers done
8199 HGraphVisitor.call(this); 8589 HGraphVisitor.call(this);
8200 } 8590 }
8201 $inherits(HBaseVisitor, HGraphVisitor); 8591 $inherits(HBaseVisitor, HGraphVisitor);
8202 HBaseVisitor.prototype.is$HVisitor = function(){return this;}; 8592 HBaseVisitor.prototype.assert$HVisitor = function(){return this};
8203 HBaseVisitor.prototype.visitBasicBlock = function(node) { 8593 HBaseVisitor.prototype.visitBasicBlock = function(node) {
8204 this.currentBlock = node; 8594 this.currentBlock = node;
8205 var instruction = node.first; 8595 var instruction = node.first;
8206 while (instruction != null) { 8596 while (instruction != null) {
8207 instruction.accept(this); 8597 instruction.accept(this);
8208 instruction = instruction.next; 8598 instruction = instruction.next;
8209 } 8599 }
8210 } 8600 }
8211 HBaseVisitor.prototype.visitInstruction = function(HInstruction) { 8601 HBaseVisitor.prototype.visitInstruction = function(HInstruction) {
8212 8602
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
8406 } 8796 }
8407 HInstructionList.prototype.contains = function(instruction) { 8797 HInstructionList.prototype.contains = function(instruction) {
8408 var cursor = this.first; 8798 var cursor = this.first;
8409 while (cursor != null) { 8799 while (cursor != null) {
8410 if (cursor === instruction) return true; 8800 if (cursor === instruction) return true;
8411 cursor = cursor.next; 8801 cursor = cursor.next;
8412 } 8802 }
8413 return false; 8803 return false;
8414 } 8804 }
8415 HInstructionList.prototype.contains$1 = function($0) { 8805 HInstructionList.prototype.contains$1 = function($0) {
8416 return this.contains(($0 && $0.is$HInstruction())); 8806 return this.contains(($0 == null ? null : $0.assert$HInstruction()));
8417 }; 8807 };
8418 HInstructionList.prototype.isEmpty$0 = HInstructionList.prototype.isEmpty; 8808 HInstructionList.prototype.isEmpty$0 = HInstructionList.prototype.isEmpty;
8419 HInstructionList.prototype.last$0 = function() { 8809 HInstructionList.prototype.last$0 = function() {
8420 return this.last(); 8810 return this.last();
8421 }; 8811 };
8422 // ********** Code for HBasicBlock ************** 8812 // ********** Code for HBasicBlock **************
8423 function HBasicBlock() { 8813 function HBasicBlock() {
8424 this.status = 0/*HBasicBlock.STATUS_NEW*/ 8814 this.status = 0/*HBasicBlock.STATUS_NEW*/
8425 this.loopInformation = null 8815 this.loopInformation = null
8426 this.parentLoopHeader = null 8816 this.parentLoopHeader = null
8427 this.dominator = null 8817 this.dominator = null
8428 // Initializers done 8818 // Initializers done
8429 HBasicBlock.withId$ctor.call(this, null); 8819 HBasicBlock.withId$ctor.call(this, null);
8430 } 8820 }
8431 HBasicBlock.withId$ctor = function(id) { 8821 HBasicBlock.withId$ctor = function(id) {
8432 this.status = 0/*HBasicBlock.STATUS_NEW*/ 8822 this.status = 0/*HBasicBlock.STATUS_NEW*/
8433 this.loopInformation = null 8823 this.loopInformation = null
8434 this.parentLoopHeader = null 8824 this.parentLoopHeader = null
8435 this.dominator = null 8825 this.dominator = null
8436 this.id = id; 8826 this.id = id;
8437 this.phis = new HInstructionList(); 8827 this.phis = new HInstructionList();
8438 this.predecessors = []; 8828 this.predecessors = [];
8439 this.successors = const$21/*const []*/; 8829 this.successors = const$21/*const []*/;
8440 this.dominatedBlocks = []; 8830 this.dominatedBlocks = [];
8441 // Initializers done 8831 // Initializers done
8442 HInstructionList.call(this); 8832 HInstructionList.call(this);
8443 } 8833 }
8444 HBasicBlock.withId$ctor.prototype = HBasicBlock.prototype; 8834 HBasicBlock.withId$ctor.prototype = HBasicBlock.prototype;
8445 $inherits(HBasicBlock, HInstructionList); 8835 $inherits(HBasicBlock, HInstructionList);
8446 HBasicBlock.prototype.is$HBasicBlock = function(){return this;}; 8836 HBasicBlock.prototype.assert$HBasicBlock = function(){return this};
8447 HBasicBlock.prototype.get$id = function() { return this.id; }; 8837 HBasicBlock.prototype.get$id = function() { return this.id; };
8448 HBasicBlock.prototype.set$id = function(value) { return this.id = value; }; 8838 HBasicBlock.prototype.set$id = function(value) { return this.id = value; };
8449 HBasicBlock.prototype.get$phis = function() { return this.phis; }; 8839 HBasicBlock.prototype.get$phis = function() { return this.phis; };
8450 HBasicBlock.prototype.set$phis = function(value) { return this.phis = value; }; 8840 HBasicBlock.prototype.set$phis = function(value) { return this.phis = value; };
8451 HBasicBlock.prototype.isNew = function() { 8841 HBasicBlock.prototype.isNew = function() {
8452 return this.status == 0/*HBasicBlock.STATUS_NEW*/; 8842 return this.status == 0/*HBasicBlock.STATUS_NEW*/;
8453 } 8843 }
8454 HBasicBlock.prototype.isOpen = function() { 8844 HBasicBlock.prototype.isOpen = function() {
8455 return this.status == 1/*HBasicBlock.STATUS_OPEN*/; 8845 return this.status == 1/*HBasicBlock.STATUS_OPEN*/;
8456 } 8846 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
8539 else { 8929 else {
8540 this.successors.add(block); 8930 this.successors.add(block);
8541 } 8931 }
8542 block.predecessors.add(this); 8932 block.predecessors.add(this);
8543 } 8933 }
8544 HBasicBlock.prototype.postProcessLoopHeader = function() { 8934 HBasicBlock.prototype.postProcessLoopHeader = function() {
8545 var $0; 8935 var $0;
8546 $assert(this.isLoopHeader(), "isLoopHeader()", "nodes.dart", 425, 12); 8936 $assert(this.isLoopHeader(), "isLoopHeader()", "nodes.dart", 425, 12);
8547 for (var i = 1, length = this.predecessors.length; 8937 for (var i = 1, length = this.predecessors.length;
8548 i < length; i++) { 8938 i < length; i++) {
8549 this.loopInformation.addBackEdge((($0 = this.predecessors.$index(i)) && $0.i s$HBasicBlock())); 8939 this.loopInformation.addBackEdge((($0 = this.predecessors.$index(i)) == null ? null : $0.assert$HBasicBlock()));
8550 } 8940 }
8551 } 8941 }
8552 HBasicBlock.prototype.rewrite = function(from, to) { 8942 HBasicBlock.prototype.rewrite = function(from, to) {
8553 var $list = from.usedBy; 8943 var $list = from.usedBy;
8554 for (var $i = 0;$i < $list.length; $i++) { 8944 for (var $i = 0;$i < $list.length; $i++) {
8555 var use = $list.$index($i); 8945 var use = $list.$index($i);
8556 HBasicBlock.rewriteInput(use, from, to); 8946 HBasicBlock.rewriteInput(use, from, to);
8557 } 8947 }
8558 to.usedBy.addAll(from.usedBy); 8948 to.usedBy.addAll(from.usedBy);
8559 from.usedBy.clear(); 8949 from.usedBy.clear();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
8617 $assert(first != null && second != null, "first !== null && second !== nul l", "nodes.dart", 510, 16); 9007 $assert(first != null && second != null, "first !== null && second !== nul l", "nodes.dart", 510, 16);
8618 } 9008 }
8619 if (this.dominator !== first) { 9009 if (this.dominator !== first) {
8620 this.dominator.removeDominatedBlock(this); 9010 this.dominator.removeDominatedBlock(this);
8621 first.addDominatedBlock(this); 9011 first.addDominatedBlock(this);
8622 } 9012 }
8623 } 9013 }
8624 } 9014 }
8625 HBasicBlock.prototype.forEachPhi = function(f) { 9015 HBasicBlock.prototype.forEachPhi = function(f) {
8626 var $0; 9016 var $0;
8627 var current = (($0 = this.phis.first) && $0.is$HPhi()); 9017 var current = (($0 = this.phis.first) == null ? null : $0.assert$HPhi());
8628 while (current != null) { 9018 while (current != null) {
8629 f(current); 9019 f(current);
8630 current = (($0 = current.next) && $0.is$HPhi()); 9020 current = (($0 = current.next) == null ? null : $0.assert$HPhi());
8631 } 9021 }
8632 } 9022 }
8633 HBasicBlock.prototype.isValid = function() { 9023 HBasicBlock.prototype.isValid = function() {
8634 $assert(this.isClosed(), "isClosed()", "nodes.dart", 528, 12); 9024 $assert(this.isClosed(), "isClosed()", "nodes.dart", 528, 12);
8635 var validator = new HValidator(); 9025 var validator = new HValidator();
8636 validator.visitBasicBlock(this); 9026 validator.visitBasicBlock(this);
8637 return validator.isValid; 9027 return validator.isValid;
8638 } 9028 }
8639 HBasicBlock.prototype.accept$1 = function($0) { 9029 HBasicBlock.prototype.accept$1 = function($0) {
8640 return this.accept(($0 && $0.is$HVisitor())); 9030 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
8641 }; 9031 };
8642 HBasicBlock.prototype.add$1 = function($0) { 9032 HBasicBlock.prototype.add$1 = function($0) {
8643 return this.add(($0 && $0.is$HInstruction())); 9033 return this.add(($0 == null ? null : $0.assert$HInstruction()));
8644 }; 9034 };
8645 HBasicBlock.prototype.forEachPhi$1 = function($0) { 9035 HBasicBlock.prototype.forEachPhi$1 = function($0) {
8646 return this.forEachPhi(to$call$1($0)); 9036 return this.forEachPhi(to$call$1($0));
8647 }; 9037 };
8648 HBasicBlock.prototype.isExitBlock$0 = HBasicBlock.prototype.isExitBlock; 9038 HBasicBlock.prototype.isExitBlock$0 = HBasicBlock.prototype.isExitBlock;
8649 HBasicBlock.prototype.removePhi$1 = function($0) { 9039 HBasicBlock.prototype.removePhi$1 = function($0) {
8650 return this.removePhi(($0 && $0.is$HPhi())); 9040 return this.removePhi(($0 == null ? null : $0.assert$HPhi()));
8651 }; 9041 };
8652 // ********** Code for HLoopInformation ************** 9042 // ********** Code for HLoopInformation **************
8653 function HLoopInformation(header) { 9043 function HLoopInformation(header) {
8654 this.header = header; 9044 this.header = header;
8655 this.blocks = new ListFactory(); 9045 this.blocks = new ListFactory();
8656 this.backEdges = new ListFactory(); 9046 this.backEdges = new ListFactory();
8657 // Initializers done 9047 // Initializers done
8658 } 9048 }
8659 HLoopInformation.prototype.addBackEdge = function(predecessor) { 9049 HLoopInformation.prototype.addBackEdge = function(predecessor) {
8660 this.backEdges.add(predecessor); 9050 this.backEdges.add(predecessor);
8661 this.addBlock(predecessor); 9051 this.addBlock(predecessor);
8662 } 9052 }
8663 HLoopInformation.prototype.addBlock = function(block) { 9053 HLoopInformation.prototype.addBlock = function(block) {
8664 var $0; 9054 var $0;
8665 if (block === this.header) return; 9055 if (block === this.header) return;
8666 var parentHeader = block.parentLoopHeader; 9056 var parentHeader = block.parentLoopHeader;
8667 if (parentHeader === this.header) { 9057 if (parentHeader === this.header) {
8668 } 9058 }
8669 else if (parentHeader != null) { 9059 else if (parentHeader != null) {
8670 this.addBlock(parentHeader); 9060 this.addBlock(parentHeader);
8671 } 9061 }
8672 else { 9062 else {
8673 block.parentLoopHeader = this.header; 9063 block.parentLoopHeader = this.header;
8674 this.blocks.add(block); 9064 this.blocks.add(block);
8675 for (var i = 0, length = block.predecessors.length; 9065 for (var i = 0, length = block.predecessors.length;
8676 i < length; i++) { 9066 i < length; i++) {
8677 this.addBlock((($0 = block.predecessors.$index(i)) && $0.is$HBasicBlock()) ); 9067 this.addBlock((($0 = block.predecessors.$index(i)) == null ? null : $0.ass ert$HBasicBlock()));
8678 } 9068 }
8679 } 9069 }
8680 } 9070 }
8681 HLoopInformation.prototype.getLastBackEdge = function() { 9071 HLoopInformation.prototype.getLastBackEdge = function() {
8682 var $0; 9072 var $0;
8683 var maxId = -1; 9073 var maxId = -1;
8684 var result = null; 9074 var result = null;
8685 for (var i = 0, length = this.backEdges.length; 9075 for (var i = 0, length = this.backEdges.length;
8686 i < length; i++) { 9076 i < length; i++) {
8687 var current = (($0 = this.backEdges.$index(i)) && $0.is$HBasicBlock()); 9077 var current = (($0 = this.backEdges.$index(i)) == null ? null : $0.assert$HB asicBlock());
8688 if (current.id > maxId) { 9078 if (current.id > maxId) {
8689 maxId = current.id; 9079 maxId = current.id;
8690 result = current; 9080 result = current;
8691 } 9081 }
8692 } 9082 }
8693 return result; 9083 return result;
8694 } 9084 }
8695 // ********** Code for HInstruction ************** 9085 // ********** Code for HInstruction **************
8696 function HInstruction(inputs) { 9086 function HInstruction(inputs) {
8697 this.previous = null 9087 this.previous = null
8698 this.next = null 9088 this.next = null
8699 this.flags = 0 9089 this.flags = 0
8700 this.type = 0/*HInstruction.TYPE_UNKNOWN*/ 9090 this.type = 0/*HInstruction.TYPE_UNKNOWN*/
8701 this.inputs = inputs; 9091 this.inputs = inputs;
8702 this.id = $globals.HInstruction_idCounter++; 9092 this.id = $globals.HInstruction_idCounter++;
8703 this.usedBy = []; 9093 this.usedBy = [];
8704 // Initializers done 9094 // Initializers done
8705 } 9095 }
8706 HInstruction.prototype.is$HInstruction = function(){return this;}; 9096 HInstruction.prototype.assert$HInstruction = function(){return this};
8707 HInstruction.prototype.get$id = function() { return this.id; }; 9097 HInstruction.prototype.get$id = function() { return this.id; };
8708 HInstruction.prototype.get$inputs = function() { return this.inputs; }; 9098 HInstruction.prototype.get$inputs = function() { return this.inputs; };
8709 HInstruction.prototype.get$usedBy = function() { return this.usedBy; }; 9099 HInstruction.prototype.get$usedBy = function() { return this.usedBy; };
8710 HInstruction.prototype.get$previous = function() { return this.previous; }; 9100 HInstruction.prototype.get$previous = function() { return this.previous; };
8711 HInstruction.prototype.set$previous = function(value) { return this.previous = v alue; }; 9101 HInstruction.prototype.set$previous = function(value) { return this.previous = v alue; };
8712 HInstruction.prototype.get$type = function() { return this.type; }; 9102 HInstruction.prototype.get$type = function() { return this.type; };
8713 HInstruction.prototype.set$type = function(value) { return this.type = value; }; 9103 HInstruction.prototype.set$type = function(value) { return this.type = value; };
8714 HInstruction.prototype.hashCode = function() { 9104 HInstruction.prototype.hashCode = function() {
8715 return this.id; 9105 return this.id;
8716 } 9106 }
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
8859 this.block = block; 9249 this.block = block;
8860 $assert(this.isValid(), "isValid()", "nodes.dart", 755, 12); 9250 $assert(this.isValid(), "isValid()", "nodes.dart", 755, 12);
8861 } 9251 }
8862 HInstruction.prototype.notifyRemovedFromBlock = function(block) { 9252 HInstruction.prototype.notifyRemovedFromBlock = function(block) {
8863 var $0; 9253 var $0;
8864 $assert(this.isInBasicBlock(), "isInBasicBlock()", "nodes.dart", 759, 12); 9254 $assert(this.isInBasicBlock(), "isInBasicBlock()", "nodes.dart", 759, 12);
8865 $assert(this.usedBy.isEmpty(), "usedBy.isEmpty()", "nodes.dart", 760, 12); 9255 $assert(this.usedBy.isEmpty(), "usedBy.isEmpty()", "nodes.dart", 760, 12);
8866 $assert(this.block === block, "this.block === block", "nodes.dart", 761, 12); 9256 $assert(this.block === block, "this.block === block", "nodes.dart", 761, 12);
8867 for (var i = 0; 9257 for (var i = 0;
8868 i < this.inputs.length; i++) { 9258 i < this.inputs.length; i++) {
8869 var inputUsedBy = (($0 = this.inputs.$index(i).get$usedBy()) && $0.is$List() ); 9259 var inputUsedBy = (($0 = this.inputs.$index(i).get$usedBy()) == null ? null : $0.assert$List());
8870 for (var j = 0; 9260 for (var j = 0;
8871 j < inputUsedBy.length; j++) { 9261 j < inputUsedBy.length; j++) {
8872 if (inputUsedBy.$index(j) === this) { 9262 if (inputUsedBy.$index(j) === this) {
8873 inputUsedBy.$setindex(j, inputUsedBy.$index(inputUsedBy.length - 1)); 9263 inputUsedBy.$setindex(j, inputUsedBy.$index(inputUsedBy.length - 1));
8874 inputUsedBy.removeLast(); 9264 inputUsedBy.removeLast();
8875 break; 9265 break;
8876 } 9266 }
8877 } 9267 }
8878 } 9268 }
8879 this.block = null; 9269 this.block = null;
8880 $assert(this.isValid(), "isValid()", "nodes.dart", 775, 12); 9270 $assert(this.isValid(), "isValid()", "nodes.dart", 775, 12);
8881 } 9271 }
8882 HInstruction.prototype.isLiteralNull = function() { 9272 HInstruction.prototype.isLiteralNull = function() {
8883 return false; 9273 return false;
8884 } 9274 }
8885 HInstruction.prototype.isLiteralNumber = function() { 9275 HInstruction.prototype.isLiteralNumber = function() {
8886 return false; 9276 return false;
8887 } 9277 }
8888 HInstruction.prototype.isLiteralString = function() { 9278 HInstruction.prototype.isLiteralString = function() {
8889 return false; 9279 return false;
8890 } 9280 }
8891 HInstruction.prototype.isValid = function() { 9281 HInstruction.prototype.isValid = function() {
8892 var validator = new HValidator(); 9282 var validator = new HValidator();
8893 validator.currentBlock = this.block; 9283 validator.currentBlock = this.block;
8894 validator.visitInstruction(this); 9284 validator.visitInstruction(this);
8895 return validator.isValid; 9285 return validator.isValid;
8896 } 9286 }
8897 HInstruction.prototype.accept$1 = function($0) { 9287 HInstruction.prototype.accept$1 = function($0) {
8898 return this.accept(($0 && $0.is$HVisitor())); 9288 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
8899 }; 9289 };
8900 HInstruction.prototype.block$0 = function() { 9290 HInstruction.prototype.block$0 = function() {
8901 return this.block(); 9291 return this.block();
8902 }; 9292 };
8903 HInstruction.prototype.clearGenerateAtUseSite$0 = HInstruction.prototype.clearGe nerateAtUseSite; 9293 HInstruction.prototype.clearGenerateAtUseSite$0 = HInstruction.prototype.clearGe nerateAtUseSite;
8904 HInstruction.prototype.computeDesiredInputType$1 = function($0) { 9294 HInstruction.prototype.computeDesiredInputType$1 = function($0) {
8905 return this.computeDesiredInputType(($0 && $0.is$HInstruction())); 9295 return this.computeDesiredInputType(($0 == null ? null : $0.assert$HInstructio n()));
8906 }; 9296 };
8907 HInstruction.prototype.dataEquals$1 = function($0) { 9297 HInstruction.prototype.dataEquals$1 = function($0) {
8908 return this.dataEquals(($0 && $0.is$HInstruction())); 9298 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
8909 }; 9299 };
8910 HInstruction.prototype.hashCode$0 = HInstruction.prototype.hashCode; 9300 HInstruction.prototype.hashCode$0 = HInstruction.prototype.hashCode;
8911 HInstruction.prototype.isInBasicBlock$0 = HInstruction.prototype.isInBasicBlock; 9301 HInstruction.prototype.isInBasicBlock$0 = HInstruction.prototype.isInBasicBlock;
8912 HInstruction.prototype.isLiteralNumber$0 = HInstruction.prototype.isLiteralNumbe r; 9302 HInstruction.prototype.isLiteralNumber$0 = HInstruction.prototype.isLiteralNumbe r;
8913 HInstruction.prototype.isLiteralString$0 = HInstruction.prototype.isLiteralStrin g; 9303 HInstruction.prototype.isLiteralString$0 = HInstruction.prototype.isLiteralStrin g;
8914 HInstruction.prototype.isNumber$0 = HInstruction.prototype.isNumber; 9304 HInstruction.prototype.isNumber$0 = HInstruction.prototype.isNumber;
8915 HInstruction.prototype.isString$0 = HInstruction.prototype.isString; 9305 HInstruction.prototype.isString$0 = HInstruction.prototype.isString;
8916 HInstruction.prototype.isUnknown$0 = HInstruction.prototype.isUnknown; 9306 HInstruction.prototype.isUnknown$0 = HInstruction.prototype.isUnknown;
8917 HInstruction.prototype.next$0 = function() { 9307 HInstruction.prototype.next$0 = function() {
8918 return this.next(); 9308 return this.next();
(...skipping 18 matching lines...) Expand all
8937 HBoolify.prototype.accept = function(visitor) { 9327 HBoolify.prototype.accept = function(visitor) {
8938 return visitor.visitBoolify(this); 9328 return visitor.visitBoolify(this);
8939 } 9329 }
8940 HBoolify.prototype.typeEquals = function(other) { 9330 HBoolify.prototype.typeEquals = function(other) {
8941 return (other instanceof HBoolify); 9331 return (other instanceof HBoolify);
8942 } 9332 }
8943 HBoolify.prototype.dataEquals = function(other) { 9333 HBoolify.prototype.dataEquals = function(other) {
8944 return true; 9334 return true;
8945 } 9335 }
8946 HBoolify.prototype.accept$1 = function($0) { 9336 HBoolify.prototype.accept$1 = function($0) {
8947 return this.accept(($0 && $0.is$HVisitor())); 9337 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
8948 }; 9338 };
8949 HBoolify.prototype.dataEquals$1 = function($0) { 9339 HBoolify.prototype.dataEquals$1 = function($0) {
8950 return this.dataEquals(($0 && $0.is$HInstruction())); 9340 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
8951 }; 9341 };
8952 // ********** Code for HTypeGuard ************** 9342 // ********** Code for HTypeGuard **************
8953 function HTypeGuard(type, value) { 9343 function HTypeGuard(type, value) {
8954 // Initializers done 9344 // Initializers done
8955 HInstruction.call(this, [value]); 9345 HInstruction.call(this, [value]);
8956 this.type = $assert_num(type); 9346 this.type = $assert_num(type);
8957 } 9347 }
8958 $inherits(HTypeGuard, HInstruction); 9348 $inherits(HTypeGuard, HInstruction);
8959 HTypeGuard.prototype.is$HTypeGuard = function(){return this;}; 9349 HTypeGuard.prototype.assert$HTypeGuard = function(){return this};
8960 HTypeGuard.prototype.prepareGvn = function() { 9350 HTypeGuard.prototype.prepareGvn = function() {
8961 $assert(!$notnull_bool(this.hasSideEffects()), "!hasSideEffects()", "nodes.dar t", 811, 12); 9351 $assert(!$notnull_bool(this.hasSideEffects()), "!hasSideEffects()", "nodes.dar t", 811, 12);
8962 this.setUseGvn(); 9352 this.setUseGvn();
8963 } 9353 }
8964 HTypeGuard.prototype.computeType = function() { 9354 HTypeGuard.prototype.computeType = function() {
8965 return this.type; 9355 return this.type;
8966 } 9356 }
8967 HTypeGuard.prototype.hasExpectedType = function() { 9357 HTypeGuard.prototype.hasExpectedType = function() {
8968 return true; 9358 return true;
8969 } 9359 }
8970 HTypeGuard.prototype.accept = function(visitor) { 9360 HTypeGuard.prototype.accept = function(visitor) {
8971 return visitor.visitTypeGuard(this); 9361 return visitor.visitTypeGuard(this);
8972 } 9362 }
8973 HTypeGuard.prototype.typeEquals = function(other) { 9363 HTypeGuard.prototype.typeEquals = function(other) {
8974 return (other instanceof HTypeGuard); 9364 return (other instanceof HTypeGuard);
8975 } 9365 }
8976 HTypeGuard.prototype.dataEquals = function(other) { 9366 HTypeGuard.prototype.dataEquals = function(other) {
8977 return this.type == other.type; 9367 return this.type == other.type;
8978 } 9368 }
8979 HTypeGuard.prototype.accept$1 = function($0) { 9369 HTypeGuard.prototype.accept$1 = function($0) {
8980 return this.accept(($0 && $0.is$HVisitor())); 9370 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
8981 }; 9371 };
8982 HTypeGuard.prototype.dataEquals$1 = function($0) { 9372 HTypeGuard.prototype.dataEquals$1 = function($0) {
8983 return this.dataEquals(($0 && $0.is$HTypeGuard())); 9373 return this.dataEquals(($0 == null ? null : $0.assert$HTypeGuard()));
8984 }; 9374 };
8985 // ********** Code for HConditionalBranch ************** 9375 // ********** Code for HConditionalBranch **************
8986 function HConditionalBranch(inputs) { 9376 function HConditionalBranch(inputs) {
8987 // Initializers done 9377 // Initializers done
8988 HControlFlow.call(this, inputs); 9378 HControlFlow.call(this, inputs);
8989 } 9379 }
8990 $inherits(HConditionalBranch, HControlFlow); 9380 $inherits(HConditionalBranch, HControlFlow);
8991 HConditionalBranch.prototype.toString$0 = HConditionalBranch.prototype.toString; 9381 HConditionalBranch.prototype.toString$0 = HConditionalBranch.prototype.toString;
8992 // ********** Code for HControlFlow ************** 9382 // ********** Code for HControlFlow **************
8993 function HControlFlow(inputs) { 9383 function HControlFlow(inputs) {
(...skipping 10 matching lines...) Expand all
9004 } 9394 }
9005 $inherits(HInvoke, HInstruction); 9395 $inherits(HInvoke, HInstruction);
9006 HInvoke.prototype.get$element = function() { return this.element; }; 9396 HInvoke.prototype.get$element = function() { return this.element; };
9007 HInvoke.prototype.toString = function() { 9397 HInvoke.prototype.toString = function() {
9008 return ('invoke: ' + this.element.name); 9398 return ('invoke: ' + this.element.name);
9009 } 9399 }
9010 HInvoke.prototype.accept = function(visitor) { 9400 HInvoke.prototype.accept = function(visitor) {
9011 return visitor.visitInvoke(this); 9401 return visitor.visitInvoke(this);
9012 } 9402 }
9013 HInvoke.prototype.accept$1 = function($0) { 9403 HInvoke.prototype.accept$1 = function($0) {
9014 return this.accept(($0 && $0.is$HVisitor())); 9404 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9015 }; 9405 };
9016 HInvoke.prototype.toString$0 = HInvoke.prototype.toString; 9406 HInvoke.prototype.toString$0 = HInvoke.prototype.toString;
9017 // ********** Code for HForeign ************** 9407 // ********** Code for HForeign **************
9018 function HForeign(inputs, code) { 9408 function HForeign(inputs, code) {
9019 this.code = code; 9409 this.code = code;
9020 // Initializers done 9410 // Initializers done
9021 HInstruction.call(this, inputs); 9411 HInstruction.call(this, inputs);
9022 } 9412 }
9023 $inherits(HForeign, HInstruction); 9413 $inherits(HForeign, HInstruction);
9024 HForeign.prototype.get$code = function() { return this.code; }; 9414 HForeign.prototype.get$code = function() { return this.code; };
9025 HForeign.prototype.accept = function(visitor) { 9415 HForeign.prototype.accept = function(visitor) {
9026 return visitor.visitForeign(this); 9416 return visitor.visitForeign(this);
9027 } 9417 }
9028 HForeign.prototype.accept$1 = function($0) { 9418 HForeign.prototype.accept$1 = function($0) {
9029 return this.accept(($0 && $0.is$HVisitor())); 9419 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9030 }; 9420 };
9031 // ********** Code for HArithmetic ************** 9421 // ********** Code for HArithmetic **************
9032 function HArithmetic(element, inputs) { 9422 function HArithmetic(element, inputs) {
9033 this.builtin = false 9423 this.builtin = false
9034 // Initializers done 9424 // Initializers done
9035 HInvoke.call(this, element, inputs); 9425 HInvoke.call(this, element, inputs);
9036 } 9426 }
9037 $inherits(HArithmetic, HInvoke); 9427 $inherits(HArithmetic, HInvoke);
9038 HArithmetic.prototype.prepareGvn = function() { 9428 HArithmetic.prototype.prepareGvn = function() {
9039 if ($notnull_bool(this.builtin)) { 9429 if ($notnull_bool(this.builtin)) {
(...skipping 11 matching lines...) Expand all
9051 if (type != 0/*HInstruction.TYPE_UNKNOWN*/) return type; 9441 if (type != 0/*HInstruction.TYPE_UNKNOWN*/) return type;
9052 return HInstruction.prototype.computeType.call(this); 9442 return HInstruction.prototype.computeType.call(this);
9053 } 9443 }
9054 HArithmetic.prototype.computeDesiredInputType = function(input) { 9444 HArithmetic.prototype.computeDesiredInputType = function(input) {
9055 return $notnull_bool(this.inputs.$index(0).isNumber$0()) ? 2/*HInstruction.TYP E_NUMBER*/ : 0/*HInstruction.TYPE_UNKNOWN*/; 9445 return $notnull_bool(this.inputs.$index(0).isNumber$0()) ? 2/*HInstruction.TYP E_NUMBER*/ : 0/*HInstruction.TYPE_UNKNOWN*/;
9056 } 9446 }
9057 HArithmetic.prototype.hasExpectedType = function() { 9447 HArithmetic.prototype.hasExpectedType = function() {
9058 return this.type == 2/*HInstruction.TYPE_NUMBER*/; 9448 return this.type == 2/*HInstruction.TYPE_NUMBER*/;
9059 } 9449 }
9060 HArithmetic.prototype.computeDesiredInputType$1 = function($0) { 9450 HArithmetic.prototype.computeDesiredInputType$1 = function($0) {
9061 return this.computeDesiredInputType(($0 && $0.is$HInstruction())); 9451 return this.computeDesiredInputType(($0 == null ? null : $0.assert$HInstructio n()));
9062 }; 9452 };
9063 // ********** Code for HBinaryArithmetic ************** 9453 // ********** Code for HBinaryArithmetic **************
9064 function HBinaryArithmetic(element, left, right) { 9454 function HBinaryArithmetic(element, left, right) {
9065 // Initializers done 9455 // Initializers done
9066 HArithmetic.call(this, element, [left, right]); 9456 HArithmetic.call(this, element, [left, right]);
9067 } 9457 }
9068 $inherits(HBinaryArithmetic, HArithmetic); 9458 $inherits(HBinaryArithmetic, HArithmetic);
9069 HBinaryArithmetic.prototype.fold = function() { 9459 HBinaryArithmetic.prototype.fold = function() {
9070 var $0; 9460 var $0;
9071 if ($notnull_bool(this.inputs.$index(0).isLiteralNumber$0()) && $notnull_bool( this.inputs.$index(1).isLiteralNumber$0())) { 9461 if ($notnull_bool(this.inputs.$index(0).isLiteralNumber$0()) && $notnull_bool( this.inputs.$index(1).isLiteralNumber$0())) {
9072 var op1 = (($0 = this.inputs.$index(0)) && $0.is$HLiteral()); 9462 var op1 = (($0 = this.inputs.$index(0)) == null ? null : $0.assert$HLiteral( ));
9073 var op2 = (($0 = this.inputs.$index(1)) && $0.is$HLiteral()); 9463 var op2 = (($0 = this.inputs.$index(1)) == null ? null : $0.assert$HLiteral( ));
9074 return new HLiteral(this.evaluate($assert_num(op1.value), $assert_num(op2.va lue))); 9464 return new HLiteral(this.evaluate($assert_num(op1.value), $assert_num(op2.va lue)));
9075 } 9465 }
9076 return this; 9466 return this;
9077 } 9467 }
9078 // ********** Code for HAdd ************** 9468 // ********** Code for HAdd **************
9079 function HAdd(element, left, right) { 9469 function HAdd(element, left, right) {
9080 // Initializers done 9470 // Initializers done
9081 HBinaryArithmetic.call(this, element, left, right); 9471 HBinaryArithmetic.call(this, element, left, right);
9082 } 9472 }
9083 $inherits(HAdd, HBinaryArithmetic); 9473 $inherits(HAdd, HBinaryArithmetic);
(...skipping 20 matching lines...) Expand all
9104 if ($notnull_bool(this.inputs.$index(0).isString$0())) return 3/*HInstruction. TYPE_STRING*/; 9494 if ($notnull_bool(this.inputs.$index(0).isString$0())) return 3/*HInstruction. TYPE_STRING*/;
9105 if ($notnull_bool(this.inputs.$index(0).isNumber$0())) return 2/*HInstruction. TYPE_NUMBER*/; 9495 if ($notnull_bool(this.inputs.$index(0).isNumber$0())) return 2/*HInstruction. TYPE_NUMBER*/;
9106 return 0/*HInstruction.TYPE_UNKNOWN*/; 9496 return 0/*HInstruction.TYPE_UNKNOWN*/;
9107 } 9497 }
9108 HAdd.prototype.hasExpectedType = function() { 9498 HAdd.prototype.hasExpectedType = function() {
9109 if ($notnull_bool(this.inputs.$index(0).isNumber$0())) return this.type == 2/* HInstruction.TYPE_NUMBER*/; 9499 if ($notnull_bool(this.inputs.$index(0).isNumber$0())) return this.type == 2/* HInstruction.TYPE_NUMBER*/;
9110 if ($notnull_bool(this.inputs.$index(0).isString$0())) return this.type == 3/* HInstruction.TYPE_STRING*/; 9500 if ($notnull_bool(this.inputs.$index(0).isString$0())) return this.type == 3/* HInstruction.TYPE_STRING*/;
9111 return this.type == 0/*HInstruction.TYPE_UNKNOWN*/; 9501 return this.type == 0/*HInstruction.TYPE_UNKNOWN*/;
9112 } 9502 }
9113 HAdd.prototype.accept$1 = function($0) { 9503 HAdd.prototype.accept$1 = function($0) {
9114 return this.accept(($0 && $0.is$HVisitor())); 9504 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9115 }; 9505 };
9116 HAdd.prototype.computeDesiredInputType$1 = function($0) { 9506 HAdd.prototype.computeDesiredInputType$1 = function($0) {
9117 return this.computeDesiredInputType(($0 && $0.is$HInstruction())); 9507 return this.computeDesiredInputType(($0 == null ? null : $0.assert$HInstructio n()));
9118 }; 9508 };
9119 HAdd.prototype.dataEquals$1 = function($0) { 9509 HAdd.prototype.dataEquals$1 = function($0) {
9120 return this.dataEquals(($0 && $0.is$HInstruction())); 9510 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9121 }; 9511 };
9122 // ********** Code for HDivide ************** 9512 // ********** Code for HDivide **************
9123 function HDivide(element, left, right) { 9513 function HDivide(element, left, right) {
9124 // Initializers done 9514 // Initializers done
9125 HBinaryArithmetic.call(this, element, left, right); 9515 HBinaryArithmetic.call(this, element, left, right);
9126 } 9516 }
9127 $inherits(HDivide, HBinaryArithmetic); 9517 $inherits(HDivide, HBinaryArithmetic);
9128 HDivide.prototype.accept = function(visitor) { 9518 HDivide.prototype.accept = function(visitor) {
9129 return visitor.visitDivide(this); 9519 return visitor.visitDivide(this);
9130 } 9520 }
9131 HDivide.prototype.evaluate = function(a, b) { 9521 HDivide.prototype.evaluate = function(a, b) {
9132 return a / b; 9522 return a / b;
9133 } 9523 }
9134 HDivide.prototype.typeEquals = function(other) { 9524 HDivide.prototype.typeEquals = function(other) {
9135 return (other instanceof HDivide); 9525 return (other instanceof HDivide);
9136 } 9526 }
9137 HDivide.prototype.dataEquals = function(other) { 9527 HDivide.prototype.dataEquals = function(other) {
9138 return true; 9528 return true;
9139 } 9529 }
9140 HDivide.prototype.accept$1 = function($0) { 9530 HDivide.prototype.accept$1 = function($0) {
9141 return this.accept(($0 && $0.is$HVisitor())); 9531 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9142 }; 9532 };
9143 HDivide.prototype.dataEquals$1 = function($0) { 9533 HDivide.prototype.dataEquals$1 = function($0) {
9144 return this.dataEquals(($0 && $0.is$HInstruction())); 9534 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9145 }; 9535 };
9146 // ********** Code for HModulo ************** 9536 // ********** Code for HModulo **************
9147 function HModulo(element, left, right) { 9537 function HModulo(element, left, right) {
9148 // Initializers done 9538 // Initializers done
9149 HBinaryArithmetic.call(this, element, left, right); 9539 HBinaryArithmetic.call(this, element, left, right);
9150 } 9540 }
9151 $inherits(HModulo, HBinaryArithmetic); 9541 $inherits(HModulo, HBinaryArithmetic);
9152 HModulo.prototype.accept = function(visitor) { 9542 HModulo.prototype.accept = function(visitor) {
9153 return visitor.visitModulo(this); 9543 return visitor.visitModulo(this);
9154 } 9544 }
9155 HModulo.prototype.evaluate = function(a, b) { 9545 HModulo.prototype.evaluate = function(a, b) {
9156 return $mod(a, b); 9546 return $mod(a, b);
9157 } 9547 }
9158 HModulo.prototype.typeEquals = function(other) { 9548 HModulo.prototype.typeEquals = function(other) {
9159 return (other instanceof HModulo); 9549 return (other instanceof HModulo);
9160 } 9550 }
9161 HModulo.prototype.dataEquals = function(other) { 9551 HModulo.prototype.dataEquals = function(other) {
9162 return true; 9552 return true;
9163 } 9553 }
9164 HModulo.prototype.accept$1 = function($0) { 9554 HModulo.prototype.accept$1 = function($0) {
9165 return this.accept(($0 && $0.is$HVisitor())); 9555 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9166 }; 9556 };
9167 HModulo.prototype.dataEquals$1 = function($0) { 9557 HModulo.prototype.dataEquals$1 = function($0) {
9168 return this.dataEquals(($0 && $0.is$HInstruction())); 9558 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9169 }; 9559 };
9170 // ********** Code for HMultiply ************** 9560 // ********** Code for HMultiply **************
9171 function HMultiply(element, left, right) { 9561 function HMultiply(element, left, right) {
9172 // Initializers done 9562 // Initializers done
9173 HBinaryArithmetic.call(this, element, left, right); 9563 HBinaryArithmetic.call(this, element, left, right);
9174 } 9564 }
9175 $inherits(HMultiply, HBinaryArithmetic); 9565 $inherits(HMultiply, HBinaryArithmetic);
9176 HMultiply.prototype.accept = function(visitor) { 9566 HMultiply.prototype.accept = function(visitor) {
9177 return visitor.visitMultiply(this); 9567 return visitor.visitMultiply(this);
9178 } 9568 }
9179 HMultiply.prototype.evaluate = function(a, b) { 9569 HMultiply.prototype.evaluate = function(a, b) {
9180 return a * b; 9570 return a * b;
9181 } 9571 }
9182 HMultiply.prototype.typeEquals = function(other) { 9572 HMultiply.prototype.typeEquals = function(other) {
9183 return (other instanceof HMultiply); 9573 return (other instanceof HMultiply);
9184 } 9574 }
9185 HMultiply.prototype.dataEquals = function(other) { 9575 HMultiply.prototype.dataEquals = function(other) {
9186 return true; 9576 return true;
9187 } 9577 }
9188 HMultiply.prototype.accept$1 = function($0) { 9578 HMultiply.prototype.accept$1 = function($0) {
9189 return this.accept(($0 && $0.is$HVisitor())); 9579 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9190 }; 9580 };
9191 HMultiply.prototype.dataEquals$1 = function($0) { 9581 HMultiply.prototype.dataEquals$1 = function($0) {
9192 return this.dataEquals(($0 && $0.is$HInstruction())); 9582 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9193 }; 9583 };
9194 // ********** Code for HSubtract ************** 9584 // ********** Code for HSubtract **************
9195 function HSubtract(element, left, right) { 9585 function HSubtract(element, left, right) {
9196 // Initializers done 9586 // Initializers done
9197 HBinaryArithmetic.call(this, element, left, right); 9587 HBinaryArithmetic.call(this, element, left, right);
9198 } 9588 }
9199 $inherits(HSubtract, HBinaryArithmetic); 9589 $inherits(HSubtract, HBinaryArithmetic);
9200 HSubtract.prototype.accept = function(visitor) { 9590 HSubtract.prototype.accept = function(visitor) {
9201 return visitor.visitSubtract(this); 9591 return visitor.visitSubtract(this);
9202 } 9592 }
9203 HSubtract.prototype.evaluate = function(a, b) { 9593 HSubtract.prototype.evaluate = function(a, b) {
9204 return a - b; 9594 return a - b;
9205 } 9595 }
9206 HSubtract.prototype.typeEquals = function(other) { 9596 HSubtract.prototype.typeEquals = function(other) {
9207 return (other instanceof HSubtract); 9597 return (other instanceof HSubtract);
9208 } 9598 }
9209 HSubtract.prototype.dataEquals = function(other) { 9599 HSubtract.prototype.dataEquals = function(other) {
9210 return true; 9600 return true;
9211 } 9601 }
9212 HSubtract.prototype.accept$1 = function($0) { 9602 HSubtract.prototype.accept$1 = function($0) {
9213 return this.accept(($0 && $0.is$HVisitor())); 9603 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9214 }; 9604 };
9215 HSubtract.prototype.dataEquals$1 = function($0) { 9605 HSubtract.prototype.dataEquals$1 = function($0) {
9216 return this.dataEquals(($0 && $0.is$HInstruction())); 9606 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9217 }; 9607 };
9218 // ********** Code for HTruncatingDivide ************** 9608 // ********** Code for HTruncatingDivide **************
9219 function HTruncatingDivide(element, left, right) { 9609 function HTruncatingDivide(element, left, right) {
9220 // Initializers done 9610 // Initializers done
9221 HBinaryArithmetic.call(this, element, left, right); 9611 HBinaryArithmetic.call(this, element, left, right);
9222 } 9612 }
9223 $inherits(HTruncatingDivide, HBinaryArithmetic); 9613 $inherits(HTruncatingDivide, HBinaryArithmetic);
9224 HTruncatingDivide.prototype.accept = function(visitor) { 9614 HTruncatingDivide.prototype.accept = function(visitor) {
9225 return visitor.visitTruncatingDivide(this); 9615 return visitor.visitTruncatingDivide(this);
9226 } 9616 }
9227 HTruncatingDivide.prototype.fold = function() { 9617 HTruncatingDivide.prototype.fold = function() {
9228 if ($notnull_bool(this.inputs.$index(1).isLiteralNumber$0()) && $notnull_bool( $eq(this.inputs.$index(1).get$dynamic().get$value(), 0))) { 9618 if ($notnull_bool(this.inputs.$index(1).isLiteralNumber$0()) && $notnull_bool( $eq(this.inputs.$index(1).get$dynamic().get$value(), 0))) {
9229 return this; 9619 return this;
9230 } 9620 }
9231 return HBinaryArithmetic.prototype.fold.call(this); 9621 return HBinaryArithmetic.prototype.fold.call(this);
9232 } 9622 }
9233 HTruncatingDivide.prototype.evaluate = function(a, b) { 9623 HTruncatingDivide.prototype.evaluate = function(a, b) {
9234 return $truncdiv(a, b); 9624 return $truncdiv(a, b);
9235 } 9625 }
9236 HTruncatingDivide.prototype.typeEquals = function(other) { 9626 HTruncatingDivide.prototype.typeEquals = function(other) {
9237 return (other instanceof HTruncatingDivide); 9627 return (other instanceof HTruncatingDivide);
9238 } 9628 }
9239 HTruncatingDivide.prototype.dataEquals = function(other) { 9629 HTruncatingDivide.prototype.dataEquals = function(other) {
9240 return true; 9630 return true;
9241 } 9631 }
9242 HTruncatingDivide.prototype.accept$1 = function($0) { 9632 HTruncatingDivide.prototype.accept$1 = function($0) {
9243 return this.accept(($0 && $0.is$HVisitor())); 9633 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9244 }; 9634 };
9245 HTruncatingDivide.prototype.dataEquals$1 = function($0) { 9635 HTruncatingDivide.prototype.dataEquals$1 = function($0) {
9246 return this.dataEquals(($0 && $0.is$HInstruction())); 9636 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9247 }; 9637 };
9248 // ********** Code for HBinaryBitOp ************** 9638 // ********** Code for HBinaryBitOp **************
9249 function HBinaryBitOp(element, left, right) { 9639 function HBinaryBitOp(element, left, right) {
9250 // Initializers done 9640 // Initializers done
9251 HBinaryArithmetic.call(this, element, left, right); 9641 HBinaryArithmetic.call(this, element, left, right);
9252 } 9642 }
9253 $inherits(HBinaryBitOp, HBinaryArithmetic); 9643 $inherits(HBinaryBitOp, HBinaryArithmetic);
9254 HBinaryBitOp.prototype.fold = function() { 9644 HBinaryBitOp.prototype.fold = function() {
9255 var $0; 9645 var $0;
9256 if ($notnull_bool(this.inputs.$index(0).isLiteralNumber$0()) && $notnull_bool( this.inputs.$index(1).isLiteralNumber$0())) { 9646 if ($notnull_bool(this.inputs.$index(0).isLiteralNumber$0()) && $notnull_bool( this.inputs.$index(1).isLiteralNumber$0())) {
9257 var op1 = (($0 = this.inputs.$index(0)) && $0.is$HLiteral()); 9647 var op1 = (($0 = this.inputs.$index(0)) == null ? null : $0.assert$HLiteral( ));
9258 var op2 = (($0 = this.inputs.$index(1)) && $0.is$HLiteral()); 9648 var op2 = (($0 = this.inputs.$index(1)) == null ? null : $0.assert$HLiteral( ));
9259 if ((typeof(op1.value) == 'number') && (typeof(op2.value) == 'number')) { 9649 if ((typeof(op1.value) == 'number') && (typeof(op2.value) == 'number')) {
9260 return new HLiteral(this.evaluate($assert_num(op1.value), $assert_num(op2. value))); 9650 return new HLiteral(this.evaluate($assert_num(op1.value), $assert_num(op2. value)));
9261 } 9651 }
9262 } 9652 }
9263 return this; 9653 return this;
9264 } 9654 }
9265 // ********** Code for HShiftLeft ************** 9655 // ********** Code for HShiftLeft **************
9266 function HShiftLeft(element, left, right) { 9656 function HShiftLeft(element, left, right) {
9267 // Initializers done 9657 // Initializers done
9268 HBinaryBitOp.call(this, element, left, right); 9658 HBinaryBitOp.call(this, element, left, right);
9269 } 9659 }
9270 $inherits(HShiftLeft, HBinaryBitOp); 9660 $inherits(HShiftLeft, HBinaryBitOp);
9271 HShiftLeft.prototype.accept = function(visitor) { 9661 HShiftLeft.prototype.accept = function(visitor) {
9272 return visitor.visitShiftLeft(this); 9662 return visitor.visitShiftLeft(this);
9273 } 9663 }
9274 HShiftLeft.prototype.fold = function() { 9664 HShiftLeft.prototype.fold = function() {
9275 var $0; 9665 var $0;
9276 if ($notnull_bool(this.inputs.$index(1).isLiteralNumber$0())) { 9666 if ($notnull_bool(this.inputs.$index(1).isLiteralNumber$0())) {
9277 var MAX_SHIFT_LEFT_AMOUNT = 50; 9667 var MAX_SHIFT_LEFT_AMOUNT = 50;
9278 var op2 = (($0 = this.inputs.$index(1)) && $0.is$HLiteral()); 9668 var op2 = (($0 = this.inputs.$index(1)) == null ? null : $0.assert$HLiteral( ));
9279 if (op2.value < 0 || op2.value > MAX_SHIFT_LEFT_AMOUNT) return this; 9669 if (op2.value < 0 || op2.value > MAX_SHIFT_LEFT_AMOUNT) return this;
9280 } 9670 }
9281 return HBinaryBitOp.prototype.fold.call(this); 9671 return HBinaryBitOp.prototype.fold.call(this);
9282 } 9672 }
9283 HShiftLeft.prototype.evaluate = function(a, b) { 9673 HShiftLeft.prototype.evaluate = function(a, b) {
9284 return a << b; 9674 return a << b;
9285 } 9675 }
9286 HShiftLeft.prototype.typeEquals = function(other) { 9676 HShiftLeft.prototype.typeEquals = function(other) {
9287 return (other instanceof HShiftLeft); 9677 return (other instanceof HShiftLeft);
9288 } 9678 }
9289 HShiftLeft.prototype.dataEquals = function(other) { 9679 HShiftLeft.prototype.dataEquals = function(other) {
9290 return true; 9680 return true;
9291 } 9681 }
9292 HShiftLeft.prototype.accept$1 = function($0) { 9682 HShiftLeft.prototype.accept$1 = function($0) {
9293 return this.accept(($0 && $0.is$HVisitor())); 9683 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9294 }; 9684 };
9295 HShiftLeft.prototype.dataEquals$1 = function($0) { 9685 HShiftLeft.prototype.dataEquals$1 = function($0) {
9296 return this.dataEquals(($0 && $0.is$HInstruction())); 9686 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9297 }; 9687 };
9298 // ********** Code for HShiftRight ************** 9688 // ********** Code for HShiftRight **************
9299 function HShiftRight(element, left, right) { 9689 function HShiftRight(element, left, right) {
9300 // Initializers done 9690 // Initializers done
9301 HBinaryBitOp.call(this, element, left, right); 9691 HBinaryBitOp.call(this, element, left, right);
9302 } 9692 }
9303 $inherits(HShiftRight, HBinaryBitOp); 9693 $inherits(HShiftRight, HBinaryBitOp);
9304 HShiftRight.prototype.accept = function(visitor) { 9694 HShiftRight.prototype.accept = function(visitor) {
9305 return visitor.visitShiftRight(this); 9695 return visitor.visitShiftRight(this);
9306 } 9696 }
9307 HShiftRight.prototype.fold = function() { 9697 HShiftRight.prototype.fold = function() {
9308 var $0; 9698 var $0;
9309 if ($notnull_bool(this.inputs.$index(1).isLiteralNumber$0())) { 9699 if ($notnull_bool(this.inputs.$index(1).isLiteralNumber$0())) {
9310 var op2 = (($0 = this.inputs.$index(1)) && $0.is$HLiteral()); 9700 var op2 = (($0 = this.inputs.$index(1)) == null ? null : $0.assert$HLiteral( ));
9311 if (op2.value < 0) return this; 9701 if (op2.value < 0) return this;
9312 } 9702 }
9313 return HBinaryBitOp.prototype.fold.call(this); 9703 return HBinaryBitOp.prototype.fold.call(this);
9314 } 9704 }
9315 HShiftRight.prototype.evaluate = function(a, b) { 9705 HShiftRight.prototype.evaluate = function(a, b) {
9316 return a >> b; 9706 return a >> b;
9317 } 9707 }
9318 HShiftRight.prototype.typeEquals = function(other) { 9708 HShiftRight.prototype.typeEquals = function(other) {
9319 return (other instanceof HShiftRight); 9709 return (other instanceof HShiftRight);
9320 } 9710 }
9321 HShiftRight.prototype.dataEquals = function(other) { 9711 HShiftRight.prototype.dataEquals = function(other) {
9322 return true; 9712 return true;
9323 } 9713 }
9324 HShiftRight.prototype.accept$1 = function($0) { 9714 HShiftRight.prototype.accept$1 = function($0) {
9325 return this.accept(($0 && $0.is$HVisitor())); 9715 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9326 }; 9716 };
9327 HShiftRight.prototype.dataEquals$1 = function($0) { 9717 HShiftRight.prototype.dataEquals$1 = function($0) {
9328 return this.dataEquals(($0 && $0.is$HInstruction())); 9718 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9329 }; 9719 };
9330 // ********** Code for HBitOr ************** 9720 // ********** Code for HBitOr **************
9331 function HBitOr(element, left, right) { 9721 function HBitOr(element, left, right) {
9332 // Initializers done 9722 // Initializers done
9333 HBinaryBitOp.call(this, element, left, right); 9723 HBinaryBitOp.call(this, element, left, right);
9334 } 9724 }
9335 $inherits(HBitOr, HBinaryBitOp); 9725 $inherits(HBitOr, HBinaryBitOp);
9336 HBitOr.prototype.accept = function(visitor) { 9726 HBitOr.prototype.accept = function(visitor) {
9337 return visitor.visitBitOr(this); 9727 return visitor.visitBitOr(this);
9338 } 9728 }
9339 HBitOr.prototype.evaluate = function(a, b) { 9729 HBitOr.prototype.evaluate = function(a, b) {
9340 return a | b; 9730 return a | b;
9341 } 9731 }
9342 HBitOr.prototype.typeEquals = function(other) { 9732 HBitOr.prototype.typeEquals = function(other) {
9343 return (other instanceof HBitOr); 9733 return (other instanceof HBitOr);
9344 } 9734 }
9345 HBitOr.prototype.dataEquals = function(other) { 9735 HBitOr.prototype.dataEquals = function(other) {
9346 return true; 9736 return true;
9347 } 9737 }
9348 HBitOr.prototype.accept$1 = function($0) { 9738 HBitOr.prototype.accept$1 = function($0) {
9349 return this.accept(($0 && $0.is$HVisitor())); 9739 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9350 }; 9740 };
9351 HBitOr.prototype.dataEquals$1 = function($0) { 9741 HBitOr.prototype.dataEquals$1 = function($0) {
9352 return this.dataEquals(($0 && $0.is$HInstruction())); 9742 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9353 }; 9743 };
9354 // ********** Code for HBitAnd ************** 9744 // ********** Code for HBitAnd **************
9355 function HBitAnd(element, left, right) { 9745 function HBitAnd(element, left, right) {
9356 // Initializers done 9746 // Initializers done
9357 HBinaryBitOp.call(this, element, left, right); 9747 HBinaryBitOp.call(this, element, left, right);
9358 } 9748 }
9359 $inherits(HBitAnd, HBinaryBitOp); 9749 $inherits(HBitAnd, HBinaryBitOp);
9360 HBitAnd.prototype.accept = function(visitor) { 9750 HBitAnd.prototype.accept = function(visitor) {
9361 return visitor.visitBitAnd(this); 9751 return visitor.visitBitAnd(this);
9362 } 9752 }
9363 HBitAnd.prototype.evaluate = function(a, b) { 9753 HBitAnd.prototype.evaluate = function(a, b) {
9364 return a & b; 9754 return a & b;
9365 } 9755 }
9366 HBitAnd.prototype.typeEquals = function(other) { 9756 HBitAnd.prototype.typeEquals = function(other) {
9367 return (other instanceof HBitAnd); 9757 return (other instanceof HBitAnd);
9368 } 9758 }
9369 HBitAnd.prototype.dataEquals = function(other) { 9759 HBitAnd.prototype.dataEquals = function(other) {
9370 return true; 9760 return true;
9371 } 9761 }
9372 HBitAnd.prototype.accept$1 = function($0) { 9762 HBitAnd.prototype.accept$1 = function($0) {
9373 return this.accept(($0 && $0.is$HVisitor())); 9763 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9374 }; 9764 };
9375 HBitAnd.prototype.dataEquals$1 = function($0) { 9765 HBitAnd.prototype.dataEquals$1 = function($0) {
9376 return this.dataEquals(($0 && $0.is$HInstruction())); 9766 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9377 }; 9767 };
9378 // ********** Code for HBitXor ************** 9768 // ********** Code for HBitXor **************
9379 function HBitXor(element, left, right) { 9769 function HBitXor(element, left, right) {
9380 // Initializers done 9770 // Initializers done
9381 HBinaryBitOp.call(this, element, left, right); 9771 HBinaryBitOp.call(this, element, left, right);
9382 } 9772 }
9383 $inherits(HBitXor, HBinaryBitOp); 9773 $inherits(HBitXor, HBinaryBitOp);
9384 HBitXor.prototype.accept = function(visitor) { 9774 HBitXor.prototype.accept = function(visitor) {
9385 return visitor.visitBitXor(this); 9775 return visitor.visitBitXor(this);
9386 } 9776 }
9387 HBitXor.prototype.evaluate = function(a, b) { 9777 HBitXor.prototype.evaluate = function(a, b) {
9388 return a ^ b; 9778 return a ^ b;
9389 } 9779 }
9390 HBitXor.prototype.typeEquals = function(other) { 9780 HBitXor.prototype.typeEquals = function(other) {
9391 return (other instanceof HBitXor); 9781 return (other instanceof HBitXor);
9392 } 9782 }
9393 HBitXor.prototype.dataEquals = function(other) { 9783 HBitXor.prototype.dataEquals = function(other) {
9394 return true; 9784 return true;
9395 } 9785 }
9396 HBitXor.prototype.accept$1 = function($0) { 9786 HBitXor.prototype.accept$1 = function($0) {
9397 return this.accept(($0 && $0.is$HVisitor())); 9787 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9398 }; 9788 };
9399 HBitXor.prototype.dataEquals$1 = function($0) { 9789 HBitXor.prototype.dataEquals$1 = function($0) {
9400 return this.dataEquals(($0 && $0.is$HInstruction())); 9790 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9401 }; 9791 };
9402 // ********** Code for HUnaryArithmetic ************** 9792 // ********** Code for HUnaryArithmetic **************
9403 function HUnaryArithmetic(element, input) { 9793 function HUnaryArithmetic(element, input) {
9404 // Initializers done 9794 // Initializers done
9405 HArithmetic.call(this, element, [input]); 9795 HArithmetic.call(this, element, [input]);
9406 } 9796 }
9407 $inherits(HUnaryArithmetic, HArithmetic); 9797 $inherits(HUnaryArithmetic, HArithmetic);
9408 // ********** Code for HNegate ************** 9798 // ********** Code for HNegate **************
9409 function HNegate(element, input) { 9799 function HNegate(element, input) {
9410 // Initializers done 9800 // Initializers done
9411 HUnaryArithmetic.call(this, element, input); 9801 HUnaryArithmetic.call(this, element, input);
9412 } 9802 }
9413 $inherits(HNegate, HUnaryArithmetic); 9803 $inherits(HNegate, HUnaryArithmetic);
9414 HNegate.prototype.accept = function(visitor) { 9804 HNegate.prototype.accept = function(visitor) {
9415 return visitor.visitNegate(this); 9805 return visitor.visitNegate(this);
9416 } 9806 }
9417 HNegate.prototype.fold = function() { 9807 HNegate.prototype.fold = function() {
9418 var $0; 9808 var $0;
9419 if ($notnull_bool(this.inputs.$index(0).isLiteralNumber$0())) { 9809 if ($notnull_bool(this.inputs.$index(0).isLiteralNumber$0())) {
9420 var input = (($0 = this.inputs.$index(0)) && $0.is$HLiteral()); 9810 var input = (($0 = this.inputs.$index(0)) == null ? null : $0.assert$HLitera l());
9421 return new HLiteral(this.evaluate($assert_num(input.value))); 9811 return new HLiteral(this.evaluate($assert_num(input.value)));
9422 } 9812 }
9423 return this; 9813 return this;
9424 } 9814 }
9425 HNegate.prototype.evaluate = function(a) { 9815 HNegate.prototype.evaluate = function(a) {
9426 return -a; 9816 return -a;
9427 } 9817 }
9428 HNegate.prototype.typeEquals = function(other) { 9818 HNegate.prototype.typeEquals = function(other) {
9429 return (other instanceof HNegate); 9819 return (other instanceof HNegate);
9430 } 9820 }
9431 HNegate.prototype.dataEquals = function(other) { 9821 HNegate.prototype.dataEquals = function(other) {
9432 return true; 9822 return true;
9433 } 9823 }
9434 HNegate.prototype.accept$1 = function($0) { 9824 HNegate.prototype.accept$1 = function($0) {
9435 return this.accept(($0 && $0.is$HVisitor())); 9825 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9436 }; 9826 };
9437 HNegate.prototype.dataEquals$1 = function($0) { 9827 HNegate.prototype.dataEquals$1 = function($0) {
9438 return this.dataEquals(($0 && $0.is$HInstruction())); 9828 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9439 }; 9829 };
9440 // ********** Code for HBitNot ************** 9830 // ********** Code for HBitNot **************
9441 function HBitNot(element, input) { 9831 function HBitNot(element, input) {
9442 // Initializers done 9832 // Initializers done
9443 HUnaryArithmetic.call(this, element, input); 9833 HUnaryArithmetic.call(this, element, input);
9444 } 9834 }
9445 $inherits(HBitNot, HUnaryArithmetic); 9835 $inherits(HBitNot, HUnaryArithmetic);
9446 HBitNot.prototype.accept = function(visitor) { 9836 HBitNot.prototype.accept = function(visitor) {
9447 return visitor.visitBitNot(this); 9837 return visitor.visitBitNot(this);
9448 } 9838 }
9449 HBitNot.prototype.fold = function() { 9839 HBitNot.prototype.fold = function() {
9450 var $0; 9840 var $0;
9451 if ($notnull_bool(this.inputs.$index(0).isLiteralNumber$0())) { 9841 if ($notnull_bool(this.inputs.$index(0).isLiteralNumber$0())) {
9452 var input = (($0 = this.inputs.$index(0)) && $0.is$HLiteral()); 9842 var input = (($0 = this.inputs.$index(0)) == null ? null : $0.assert$HLitera l());
9453 if ((typeof(input.value) == 'number')) return new HLiteral(this.evaluate($as sert_num(input.value))); 9843 if ((typeof(input.value) == 'number')) return new HLiteral(this.evaluate($as sert_num(input.value)));
9454 } 9844 }
9455 return this; 9845 return this;
9456 } 9846 }
9457 HBitNot.prototype.evaluate = function(a) { 9847 HBitNot.prototype.evaluate = function(a) {
9458 return ~a; 9848 return ~a;
9459 } 9849 }
9460 HBitNot.prototype.typeEquals = function(other) { 9850 HBitNot.prototype.typeEquals = function(other) {
9461 return (other instanceof HBitNot); 9851 return (other instanceof HBitNot);
9462 } 9852 }
9463 HBitNot.prototype.dataEquals = function(other) { 9853 HBitNot.prototype.dataEquals = function(other) {
9464 return true; 9854 return true;
9465 } 9855 }
9466 HBitNot.prototype.accept$1 = function($0) { 9856 HBitNot.prototype.accept$1 = function($0) {
9467 return this.accept(($0 && $0.is$HVisitor())); 9857 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9468 }; 9858 };
9469 HBitNot.prototype.dataEquals$1 = function($0) { 9859 HBitNot.prototype.dataEquals$1 = function($0) {
9470 return this.dataEquals(($0 && $0.is$HInstruction())); 9860 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9471 }; 9861 };
9472 // ********** Code for HExit ************** 9862 // ********** Code for HExit **************
9473 function HExit() { 9863 function HExit() {
9474 // Initializers done 9864 // Initializers done
9475 HControlFlow.call(this, const$21/*const []*/); 9865 HControlFlow.call(this, const$21/*const []*/);
9476 } 9866 }
9477 $inherits(HExit, HControlFlow); 9867 $inherits(HExit, HControlFlow);
9478 HExit.prototype.toString = function() { 9868 HExit.prototype.toString = function() {
9479 return 'exit'; 9869 return 'exit';
9480 } 9870 }
9481 HExit.prototype.accept = function(visitor) { 9871 HExit.prototype.accept = function(visitor) {
9482 return visitor.visitExit(this); 9872 return visitor.visitExit(this);
9483 } 9873 }
9484 HExit.prototype.accept$1 = function($0) { 9874 HExit.prototype.accept$1 = function($0) {
9485 return this.accept(($0 && $0.is$HVisitor())); 9875 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9486 }; 9876 };
9487 HExit.prototype.toString$0 = HExit.prototype.toString; 9877 HExit.prototype.toString$0 = HExit.prototype.toString;
9488 // ********** Code for HGoto ************** 9878 // ********** Code for HGoto **************
9489 function HGoto() { 9879 function HGoto() {
9490 // Initializers done 9880 // Initializers done
9491 HControlFlow.call(this, const$21/*const []*/); 9881 HControlFlow.call(this, const$21/*const []*/);
9492 } 9882 }
9493 $inherits(HGoto, HControlFlow); 9883 $inherits(HGoto, HControlFlow);
9494 HGoto.prototype.toString = function() { 9884 HGoto.prototype.toString = function() {
9495 return 'goto'; 9885 return 'goto';
9496 } 9886 }
9497 HGoto.prototype.accept = function(visitor) { 9887 HGoto.prototype.accept = function(visitor) {
9498 return visitor.visitGoto(this); 9888 return visitor.visitGoto(this);
9499 } 9889 }
9500 HGoto.prototype.accept$1 = function($0) { 9890 HGoto.prototype.accept$1 = function($0) {
9501 return this.accept(($0 && $0.is$HVisitor())); 9891 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9502 }; 9892 };
9503 HGoto.prototype.toString$0 = HGoto.prototype.toString; 9893 HGoto.prototype.toString$0 = HGoto.prototype.toString;
9504 // ********** Code for HIf ************** 9894 // ********** Code for HIf **************
9505 function HIf(condition, hasElse) { 9895 function HIf(condition, hasElse) {
9506 this.hasElse = hasElse; 9896 this.hasElse = hasElse;
9507 // Initializers done 9897 // Initializers done
9508 HConditionalBranch.call(this, [condition]); 9898 HConditionalBranch.call(this, [condition]);
9509 } 9899 }
9510 $inherits(HIf, HConditionalBranch); 9900 $inherits(HIf, HConditionalBranch);
9511 HIf.prototype.toString = function() { 9901 HIf.prototype.toString = function() {
9512 return 'if'; 9902 return 'if';
9513 } 9903 }
9514 HIf.prototype.accept = function(visitor) { 9904 HIf.prototype.accept = function(visitor) {
9515 return visitor.visitIf(this); 9905 return visitor.visitIf(this);
9516 } 9906 }
9517 HIf.prototype.accept$1 = function($0) { 9907 HIf.prototype.accept$1 = function($0) {
9518 return this.accept(($0 && $0.is$HVisitor())); 9908 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9519 }; 9909 };
9520 HIf.prototype.toString$0 = HIf.prototype.toString; 9910 HIf.prototype.toString$0 = HIf.prototype.toString;
9521 // ********** Code for HLoopBranch ************** 9911 // ********** Code for HLoopBranch **************
9522 function HLoopBranch(condition) { 9912 function HLoopBranch(condition) {
9523 // Initializers done 9913 // Initializers done
9524 HConditionalBranch.call(this, [condition]); 9914 HConditionalBranch.call(this, [condition]);
9525 } 9915 }
9526 $inherits(HLoopBranch, HConditionalBranch); 9916 $inherits(HLoopBranch, HConditionalBranch);
9527 HLoopBranch.prototype.toString = function() { 9917 HLoopBranch.prototype.toString = function() {
9528 return 'loop-branch'; 9918 return 'loop-branch';
9529 } 9919 }
9530 HLoopBranch.prototype.accept = function(visitor) { 9920 HLoopBranch.prototype.accept = function(visitor) {
9531 return visitor.visitLoopBranch(this); 9921 return visitor.visitLoopBranch(this);
9532 } 9922 }
9533 HLoopBranch.prototype.accept$1 = function($0) { 9923 HLoopBranch.prototype.accept$1 = function($0) {
9534 return this.accept(($0 && $0.is$HVisitor())); 9924 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9535 }; 9925 };
9536 HLoopBranch.prototype.toString$0 = HLoopBranch.prototype.toString; 9926 HLoopBranch.prototype.toString$0 = HLoopBranch.prototype.toString;
9537 // ********** Code for HLiteral ************** 9927 // ********** Code for HLiteral **************
9538 function HLiteral(value) { 9928 function HLiteral(value) {
9539 this.value = value; 9929 this.value = value;
9540 // Initializers done 9930 // Initializers done
9541 HInstruction.call(this, []); 9931 HInstruction.call(this, []);
9542 } 9932 }
9543 $inherits(HLiteral, HInstruction); 9933 $inherits(HLiteral, HInstruction);
9544 HLiteral.prototype.is$HLiteral = function(){return this;}; 9934 HLiteral.prototype.assert$HLiteral = function(){return this};
9545 HLiteral.prototype.get$value = function() { return this.value; }; 9935 HLiteral.prototype.get$value = function() { return this.value; };
9546 HLiteral.prototype.prepareGvn = function() { 9936 HLiteral.prototype.prepareGvn = function() {
9547 $assert(!$notnull_bool(this.hasSideEffects()), "!hasSideEffects()", "nodes.dar t", 1139, 12); 9937 $assert(!$notnull_bool(this.hasSideEffects()), "!hasSideEffects()", "nodes.dar t", 1139, 12);
9548 this.setUseGvn(); 9938 this.setUseGvn();
9549 this.setGenerateAtUseSite(); 9939 this.setGenerateAtUseSite();
9550 } 9940 }
9551 HLiteral.prototype.toString = function() { 9941 HLiteral.prototype.toString = function() {
9552 return ('literal: ' + this.value); 9942 return ('literal: ' + this.value);
9553 } 9943 }
9554 HLiteral.prototype.accept = function(visitor) { 9944 HLiteral.prototype.accept = function(visitor) {
(...skipping 20 matching lines...) Expand all
9575 return (typeof(this.value) == 'boolean'); 9965 return (typeof(this.value) == 'boolean');
9576 } 9966 }
9577 HLiteral.prototype.isLiteralNull = function() { 9967 HLiteral.prototype.isLiteralNull = function() {
9578 return this.value == null; 9968 return this.value == null;
9579 } 9969 }
9580 HLiteral.prototype.isLiteralNumber = function() { 9970 HLiteral.prototype.isLiteralNumber = function() {
9581 return (typeof(this.value) == 'number'); 9971 return (typeof(this.value) == 'number');
9582 } 9972 }
9583 HLiteral.prototype.isLiteralString = function() { 9973 HLiteral.prototype.isLiteralString = function() {
9584 var $0; 9974 var $0;
9585 return !!(($0 = this.value) && $0.is$SourceString); 9975 return !!(($0 = this.value) && $0.is$SourceString());
9586 } 9976 }
9587 HLiteral.prototype.typeEquals = function(other) { 9977 HLiteral.prototype.typeEquals = function(other) {
9588 return (other instanceof HLiteral); 9978 return (other instanceof HLiteral);
9589 } 9979 }
9590 HLiteral.prototype.dataEquals = function(other) { 9980 HLiteral.prototype.dataEquals = function(other) {
9591 return $assert_bool($eq(this.value, other.value)); 9981 return $assert_bool($eq(this.value, other.value));
9592 } 9982 }
9593 HLiteral.prototype.accept$1 = function($0) { 9983 HLiteral.prototype.accept$1 = function($0) {
9594 return this.accept(($0 && $0.is$HVisitor())); 9984 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9595 }; 9985 };
9596 HLiteral.prototype.dataEquals$1 = function($0) { 9986 HLiteral.prototype.dataEquals$1 = function($0) {
9597 return this.dataEquals(($0 && $0.is$HLiteral())); 9987 return this.dataEquals(($0 == null ? null : $0.assert$HLiteral()));
9598 }; 9988 };
9599 HLiteral.prototype.isLiteralNumber$0 = HLiteral.prototype.isLiteralNumber; 9989 HLiteral.prototype.isLiteralNumber$0 = HLiteral.prototype.isLiteralNumber;
9600 HLiteral.prototype.isLiteralString$0 = HLiteral.prototype.isLiteralString; 9990 HLiteral.prototype.isLiteralString$0 = HLiteral.prototype.isLiteralString;
9601 HLiteral.prototype.toString$0 = HLiteral.prototype.toString; 9991 HLiteral.prototype.toString$0 = HLiteral.prototype.toString;
9602 // ********** Code for HNot ************** 9992 // ********** Code for HNot **************
9603 function HNot(value) { 9993 function HNot(value) {
9604 // Initializers done 9994 // Initializers done
9605 HInstruction.call(this, [value]); 9995 HInstruction.call(this, [value]);
9606 } 9996 }
9607 $inherits(HNot, HInstruction); 9997 $inherits(HNot, HInstruction);
(...skipping 10 matching lines...) Expand all
9618 HNot.prototype.accept = function(visitor) { 10008 HNot.prototype.accept = function(visitor) {
9619 return visitor.visitNot(this); 10009 return visitor.visitNot(this);
9620 } 10010 }
9621 HNot.prototype.typeEquals = function(other) { 10011 HNot.prototype.typeEquals = function(other) {
9622 return (other instanceof HNot); 10012 return (other instanceof HNot);
9623 } 10013 }
9624 HNot.prototype.dataEquals = function(other) { 10014 HNot.prototype.dataEquals = function(other) {
9625 return true; 10015 return true;
9626 } 10016 }
9627 HNot.prototype.accept$1 = function($0) { 10017 HNot.prototype.accept$1 = function($0) {
9628 return this.accept(($0 && $0.is$HVisitor())); 10018 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9629 }; 10019 };
9630 HNot.prototype.dataEquals$1 = function($0) { 10020 HNot.prototype.dataEquals$1 = function($0) {
9631 return this.dataEquals(($0 && $0.is$HInstruction())); 10021 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9632 }; 10022 };
9633 // ********** Code for HParameterValue ************** 10023 // ********** Code for HParameterValue **************
9634 function HParameterValue(element) { 10024 function HParameterValue(element) {
9635 this.element = element; 10025 this.element = element;
9636 // Initializers done 10026 // Initializers done
9637 HInstruction.call(this, []); 10027 HInstruction.call(this, []);
9638 this.setGenerateAtUseSite(); 10028 this.setGenerateAtUseSite();
9639 } 10029 }
9640 $inherits(HParameterValue, HInstruction); 10030 $inherits(HParameterValue, HInstruction);
9641 HParameterValue.prototype.is$HParameterValue = function(){return this;}; 10031 HParameterValue.prototype.assert$HParameterValue = function(){return this};
9642 HParameterValue.prototype.get$element = function() { return this.element; }; 10032 HParameterValue.prototype.get$element = function() { return this.element; };
9643 HParameterValue.prototype.prepareGvn = function() { 10033 HParameterValue.prototype.prepareGvn = function() {
9644 $assert(!$notnull_bool(this.hasSideEffects()), "!hasSideEffects()", "nodes.dar t", 1191, 12); 10034 $assert(!$notnull_bool(this.hasSideEffects()), "!hasSideEffects()", "nodes.dar t", 1191, 12);
9645 } 10035 }
9646 HParameterValue.prototype.toString = function() { 10036 HParameterValue.prototype.toString = function() {
9647 return ('parameter ' + this.element.name); 10037 return ('parameter ' + this.element.name);
9648 } 10038 }
9649 HParameterValue.prototype.accept = function(visitor) { 10039 HParameterValue.prototype.accept = function(visitor) {
9650 return visitor.visitParameterValue(this); 10040 return visitor.visitParameterValue(this);
9651 } 10041 }
9652 HParameterValue.prototype.accept$1 = function($0) { 10042 HParameterValue.prototype.accept$1 = function($0) {
9653 return this.accept(($0 && $0.is$HVisitor())); 10043 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9654 }; 10044 };
9655 HParameterValue.prototype.toString$0 = HParameterValue.prototype.toString; 10045 HParameterValue.prototype.toString$0 = HParameterValue.prototype.toString;
9656 // ********** Code for HPhi ************** 10046 // ********** Code for HPhi **************
9657 function HPhi() {} 10047 function HPhi() {}
9658 HPhi.singleInput$ctor = function(element, input) { 10048 HPhi.singleInput$ctor = function(element, input) {
9659 this.element = element; 10049 this.element = element;
9660 // Initializers done 10050 // Initializers done
9661 HInstruction.call(this, [input]); 10051 HInstruction.call(this, [input]);
9662 } 10052 }
9663 HPhi.singleInput$ctor.prototype = HPhi.prototype; 10053 HPhi.singleInput$ctor.prototype = HPhi.prototype;
9664 HPhi.manyInputs$ctor = function(element, inputs) { 10054 HPhi.manyInputs$ctor = function(element, inputs) {
9665 this.element = element; 10055 this.element = element;
9666 // Initializers done 10056 // Initializers done
9667 HInstruction.call(this, inputs); 10057 HInstruction.call(this, inputs);
9668 } 10058 }
9669 HPhi.manyInputs$ctor.prototype = HPhi.prototype; 10059 HPhi.manyInputs$ctor.prototype = HPhi.prototype;
9670 $inherits(HPhi, HInstruction); 10060 $inherits(HPhi, HInstruction);
9671 HPhi.prototype.is$HPhi = function(){return this;}; 10061 HPhi.prototype.assert$HPhi = function(){return this};
9672 HPhi.prototype.get$element = function() { return this.element; }; 10062 HPhi.prototype.get$element = function() { return this.element; };
9673 HPhi.prototype.addInput = function(input) { 10063 HPhi.prototype.addInput = function(input) {
9674 $assert(this.isInBasicBlock(), "isInBasicBlock()", "nodes.dart", 1208, 12); 10064 $assert(this.isInBasicBlock(), "isInBasicBlock()", "nodes.dart", 1208, 12);
9675 this.inputs.add(input); 10065 this.inputs.add(input);
9676 input.usedBy.add(this); 10066 input.usedBy.add(this);
9677 } 10067 }
9678 HPhi.prototype.computeType = function() { 10068 HPhi.prototype.computeType = function() {
9679 var type = this.computeInputsType(); 10069 var type = this.computeInputsType();
9680 if (type != 0/*HInstruction.TYPE_UNKNOWN*/) return type; 10070 if (type != 0/*HInstruction.TYPE_UNKNOWN*/) return type;
9681 return HInstruction.prototype.computeType.call(this); 10071 return HInstruction.prototype.computeType.call(this);
(...skipping 14 matching lines...) Expand all
9696 this.type = $assert_num(this.inputs.$index(0).get$type()); 10086 this.type = $assert_num(this.inputs.$index(0).get$type());
9697 return true; 10087 return true;
9698 } 10088 }
9699 HPhi.prototype.toString = function() { 10089 HPhi.prototype.toString = function() {
9700 return 'phi'; 10090 return 'phi';
9701 } 10091 }
9702 HPhi.prototype.accept = function(visitor) { 10092 HPhi.prototype.accept = function(visitor) {
9703 return visitor.visitPhi(this); 10093 return visitor.visitPhi(this);
9704 } 10094 }
9705 HPhi.prototype.accept$1 = function($0) { 10095 HPhi.prototype.accept$1 = function($0) {
9706 return this.accept(($0 && $0.is$HVisitor())); 10096 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9707 }; 10097 };
9708 HPhi.prototype.computeDesiredInputType$1 = function($0) { 10098 HPhi.prototype.computeDesiredInputType$1 = function($0) {
9709 return this.computeDesiredInputType(($0 && $0.is$HInstruction())); 10099 return this.computeDesiredInputType(($0 == null ? null : $0.assert$HInstructio n()));
9710 }; 10100 };
9711 HPhi.prototype.toString$0 = HPhi.prototype.toString; 10101 HPhi.prototype.toString$0 = HPhi.prototype.toString;
9712 // ********** Code for HRelational ************** 10102 // ********** Code for HRelational **************
9713 function HRelational(element, left, right) { 10103 function HRelational(element, left, right) {
9714 this.builtin = false 10104 this.builtin = false
9715 // Initializers done 10105 // Initializers done
9716 HInvoke.call(this, element, [left, right]); 10106 HInvoke.call(this, element, [left, right]);
9717 } 10107 }
9718 $inherits(HRelational, HInvoke); 10108 $inherits(HRelational, HInvoke);
9719 HRelational.prototype.prepareGvn = function() { 10109 HRelational.prototype.prepareGvn = function() {
(...skipping 11 matching lines...) Expand all
9731 if (this.type != 0/*HInstruction.TYPE_UNKNOWN*/) return this.type; 10121 if (this.type != 0/*HInstruction.TYPE_UNKNOWN*/) return this.type;
9732 return HInstruction.prototype.computeType.call(this); 10122 return HInstruction.prototype.computeType.call(this);
9733 } 10123 }
9734 HRelational.prototype.computeDesiredInputType = function(input) { 10124 HRelational.prototype.computeDesiredInputType = function(input) {
9735 return $notnull_bool(this.inputs.$index(0).isNumber$0()) ? 2/*HInstruction.TYP E_NUMBER*/ : 0/*HInstruction.TYPE_UNKNOWN*/; 10125 return $notnull_bool(this.inputs.$index(0).isNumber$0()) ? 2/*HInstruction.TYP E_NUMBER*/ : 0/*HInstruction.TYPE_UNKNOWN*/;
9736 } 10126 }
9737 HRelational.prototype.hasExpectedType = function() { 10127 HRelational.prototype.hasExpectedType = function() {
9738 return this.type == 1/*HInstruction.TYPE_BOOLEAN*/; 10128 return this.type == 1/*HInstruction.TYPE_BOOLEAN*/;
9739 } 10129 }
9740 HRelational.prototype.computeDesiredInputType$1 = function($0) { 10130 HRelational.prototype.computeDesiredInputType$1 = function($0) {
9741 return this.computeDesiredInputType(($0 && $0.is$HInstruction())); 10131 return this.computeDesiredInputType(($0 == null ? null : $0.assert$HInstructio n()));
9742 }; 10132 };
9743 // ********** Code for HEquals ************** 10133 // ********** Code for HEquals **************
9744 function HEquals(element, left, right) { 10134 function HEquals(element, left, right) {
9745 // Initializers done 10135 // Initializers done
9746 HRelational.call(this, element, left, right); 10136 HRelational.call(this, element, left, right);
9747 } 10137 }
9748 $inherits(HEquals, HRelational); 10138 $inherits(HEquals, HRelational);
9749 HEquals.prototype.evaluate = function(a, b) { 10139 HEquals.prototype.evaluate = function(a, b) {
9750 return a == b; 10140 return a == b;
9751 } 10141 }
9752 HEquals.prototype.accept = function(visitor) { 10142 HEquals.prototype.accept = function(visitor) {
9753 return visitor.visitEquals(this); 10143 return visitor.visitEquals(this);
9754 } 10144 }
9755 HEquals.prototype.typeEquals = function(other) { 10145 HEquals.prototype.typeEquals = function(other) {
9756 return (other instanceof HEquals); 10146 return (other instanceof HEquals);
9757 } 10147 }
9758 HEquals.prototype.dataEquals = function(other) { 10148 HEquals.prototype.dataEquals = function(other) {
9759 return true; 10149 return true;
9760 } 10150 }
9761 HEquals.prototype.accept$1 = function($0) { 10151 HEquals.prototype.accept$1 = function($0) {
9762 return this.accept(($0 && $0.is$HVisitor())); 10152 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9763 }; 10153 };
9764 HEquals.prototype.dataEquals$1 = function($0) { 10154 HEquals.prototype.dataEquals$1 = function($0) {
9765 return this.dataEquals(($0 && $0.is$HInstruction())); 10155 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9766 }; 10156 };
9767 // ********** Code for HGreater ************** 10157 // ********** Code for HGreater **************
9768 function HGreater(element, left, right) { 10158 function HGreater(element, left, right) {
9769 // Initializers done 10159 // Initializers done
9770 HRelational.call(this, element, left, right); 10160 HRelational.call(this, element, left, right);
9771 } 10161 }
9772 $inherits(HGreater, HRelational); 10162 $inherits(HGreater, HRelational);
9773 HGreater.prototype.evaluate = function(a, b) { 10163 HGreater.prototype.evaluate = function(a, b) {
9774 return a > b; 10164 return a > b;
9775 } 10165 }
9776 HGreater.prototype.accept = function(visitor) { 10166 HGreater.prototype.accept = function(visitor) {
9777 return visitor.visitGreater(this); 10167 return visitor.visitGreater(this);
9778 } 10168 }
9779 HGreater.prototype.typeEquals = function(other) { 10169 HGreater.prototype.typeEquals = function(other) {
9780 return (other instanceof HGreater); 10170 return (other instanceof HGreater);
9781 } 10171 }
9782 HGreater.prototype.dataEquals = function(other) { 10172 HGreater.prototype.dataEquals = function(other) {
9783 return true; 10173 return true;
9784 } 10174 }
9785 HGreater.prototype.accept$1 = function($0) { 10175 HGreater.prototype.accept$1 = function($0) {
9786 return this.accept(($0 && $0.is$HVisitor())); 10176 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9787 }; 10177 };
9788 HGreater.prototype.dataEquals$1 = function($0) { 10178 HGreater.prototype.dataEquals$1 = function($0) {
9789 return this.dataEquals(($0 && $0.is$HInstruction())); 10179 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9790 }; 10180 };
9791 // ********** Code for HGreaterEqual ************** 10181 // ********** Code for HGreaterEqual **************
9792 function HGreaterEqual(element, left, right) { 10182 function HGreaterEqual(element, left, right) {
9793 // Initializers done 10183 // Initializers done
9794 HRelational.call(this, element, left, right); 10184 HRelational.call(this, element, left, right);
9795 } 10185 }
9796 $inherits(HGreaterEqual, HRelational); 10186 $inherits(HGreaterEqual, HRelational);
9797 HGreaterEqual.prototype.evaluate = function(a, b) { 10187 HGreaterEqual.prototype.evaluate = function(a, b) {
9798 return a >= b; 10188 return a >= b;
9799 } 10189 }
9800 HGreaterEqual.prototype.accept = function(visitor) { 10190 HGreaterEqual.prototype.accept = function(visitor) {
9801 return visitor.visitGreaterEqual(this); 10191 return visitor.visitGreaterEqual(this);
9802 } 10192 }
9803 HGreaterEqual.prototype.typeEquals = function(other) { 10193 HGreaterEqual.prototype.typeEquals = function(other) {
9804 return (other instanceof HGreaterEqual); 10194 return (other instanceof HGreaterEqual);
9805 } 10195 }
9806 HGreaterEqual.prototype.dataEquals = function(other) { 10196 HGreaterEqual.prototype.dataEquals = function(other) {
9807 return true; 10197 return true;
9808 } 10198 }
9809 HGreaterEqual.prototype.accept$1 = function($0) { 10199 HGreaterEqual.prototype.accept$1 = function($0) {
9810 return this.accept(($0 && $0.is$HVisitor())); 10200 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9811 }; 10201 };
9812 HGreaterEqual.prototype.dataEquals$1 = function($0) { 10202 HGreaterEqual.prototype.dataEquals$1 = function($0) {
9813 return this.dataEquals(($0 && $0.is$HInstruction())); 10203 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9814 }; 10204 };
9815 // ********** Code for HLess ************** 10205 // ********** Code for HLess **************
9816 function HLess(element, left, right) { 10206 function HLess(element, left, right) {
9817 // Initializers done 10207 // Initializers done
9818 HRelational.call(this, element, left, right); 10208 HRelational.call(this, element, left, right);
9819 } 10209 }
9820 $inherits(HLess, HRelational); 10210 $inherits(HLess, HRelational);
9821 HLess.prototype.evaluate = function(a, b) { 10211 HLess.prototype.evaluate = function(a, b) {
9822 return a < b; 10212 return a < b;
9823 } 10213 }
9824 HLess.prototype.accept = function(visitor) { 10214 HLess.prototype.accept = function(visitor) {
9825 return visitor.visitLess(this); 10215 return visitor.visitLess(this);
9826 } 10216 }
9827 HLess.prototype.typeEquals = function(other) { 10217 HLess.prototype.typeEquals = function(other) {
9828 return (other instanceof HLess); 10218 return (other instanceof HLess);
9829 } 10219 }
9830 HLess.prototype.dataEquals = function(other) { 10220 HLess.prototype.dataEquals = function(other) {
9831 return true; 10221 return true;
9832 } 10222 }
9833 HLess.prototype.accept$1 = function($0) { 10223 HLess.prototype.accept$1 = function($0) {
9834 return this.accept(($0 && $0.is$HVisitor())); 10224 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9835 }; 10225 };
9836 HLess.prototype.dataEquals$1 = function($0) { 10226 HLess.prototype.dataEquals$1 = function($0) {
9837 return this.dataEquals(($0 && $0.is$HInstruction())); 10227 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9838 }; 10228 };
9839 // ********** Code for HLessEqual ************** 10229 // ********** Code for HLessEqual **************
9840 function HLessEqual(element, left, right) { 10230 function HLessEqual(element, left, right) {
9841 // Initializers done 10231 // Initializers done
9842 HRelational.call(this, element, left, right); 10232 HRelational.call(this, element, left, right);
9843 } 10233 }
9844 $inherits(HLessEqual, HRelational); 10234 $inherits(HLessEqual, HRelational);
9845 HLessEqual.prototype.evaluate = function(a, b) { 10235 HLessEqual.prototype.evaluate = function(a, b) {
9846 return a <= b; 10236 return a <= b;
9847 } 10237 }
9848 HLessEqual.prototype.accept = function(visitor) { 10238 HLessEqual.prototype.accept = function(visitor) {
9849 return visitor.visitLessEqual(this); 10239 return visitor.visitLessEqual(this);
9850 } 10240 }
9851 HLessEqual.prototype.typeEquals = function(other) { 10241 HLessEqual.prototype.typeEquals = function(other) {
9852 return (other instanceof HLessEqual); 10242 return (other instanceof HLessEqual);
9853 } 10243 }
9854 HLessEqual.prototype.dataEquals = function(other) { 10244 HLessEqual.prototype.dataEquals = function(other) {
9855 return true; 10245 return true;
9856 } 10246 }
9857 HLessEqual.prototype.accept$1 = function($0) { 10247 HLessEqual.prototype.accept$1 = function($0) {
9858 return this.accept(($0 && $0.is$HVisitor())); 10248 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9859 }; 10249 };
9860 HLessEqual.prototype.dataEquals$1 = function($0) { 10250 HLessEqual.prototype.dataEquals$1 = function($0) {
9861 return this.dataEquals(($0 && $0.is$HInstruction())); 10251 return this.dataEquals(($0 == null ? null : $0.assert$HInstruction()));
9862 }; 10252 };
9863 // ********** Code for HReturn ************** 10253 // ********** Code for HReturn **************
9864 function HReturn(value) { 10254 function HReturn(value) {
9865 // Initializers done 10255 // Initializers done
9866 HControlFlow.call(this, [value]); 10256 HControlFlow.call(this, [value]);
9867 } 10257 }
9868 $inherits(HReturn, HControlFlow); 10258 $inherits(HReturn, HControlFlow);
9869 HReturn.prototype.toString = function() { 10259 HReturn.prototype.toString = function() {
9870 return 'return'; 10260 return 'return';
9871 } 10261 }
9872 HReturn.prototype.accept = function(visitor) { 10262 HReturn.prototype.accept = function(visitor) {
9873 return visitor.visitReturn(this); 10263 return visitor.visitReturn(this);
9874 } 10264 }
9875 HReturn.prototype.accept$1 = function($0) { 10265 HReturn.prototype.accept$1 = function($0) {
9876 return this.accept(($0 && $0.is$HVisitor())); 10266 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9877 }; 10267 };
9878 HReturn.prototype.toString$0 = HReturn.prototype.toString; 10268 HReturn.prototype.toString$0 = HReturn.prototype.toString;
9879 // ********** Code for HThrow ************** 10269 // ********** Code for HThrow **************
9880 function HThrow(value) { 10270 function HThrow(value) {
9881 // Initializers done 10271 // Initializers done
9882 HControlFlow.call(this, [value]); 10272 HControlFlow.call(this, [value]);
9883 } 10273 }
9884 $inherits(HThrow, HControlFlow); 10274 $inherits(HThrow, HControlFlow);
9885 HThrow.prototype.toString = function() { 10275 HThrow.prototype.toString = function() {
9886 return 'throw'; 10276 return 'throw';
9887 } 10277 }
9888 HThrow.prototype.accept = function(visitor) { 10278 HThrow.prototype.accept = function(visitor) {
9889 return visitor.visitThrow(this); 10279 return visitor.visitThrow(this);
9890 } 10280 }
9891 HThrow.prototype.accept$1 = function($0) { 10281 HThrow.prototype.accept$1 = function($0) {
9892 return this.accept(($0 && $0.is$HVisitor())); 10282 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9893 }; 10283 };
9894 HThrow.prototype.toString$0 = HThrow.prototype.toString; 10284 HThrow.prototype.toString$0 = HThrow.prototype.toString;
9895 // ********** Code for HNonSsaInstruction ************** 10285 // ********** Code for HNonSsaInstruction **************
9896 function HNonSsaInstruction(inputs) { 10286 function HNonSsaInstruction(inputs) {
9897 // Initializers done 10287 // Initializers done
9898 HInstruction.call(this, inputs); 10288 HInstruction.call(this, inputs);
9899 } 10289 }
9900 $inherits(HNonSsaInstruction, HInstruction); 10290 $inherits(HNonSsaInstruction, HInstruction);
9901 HNonSsaInstruction.prototype.prepareGvn = function() { 10291 HNonSsaInstruction.prototype.prepareGvn = function() {
9902 unreachable(); 10292 unreachable();
9903 } 10293 }
9904 HNonSsaInstruction.prototype.useGvn = function() { 10294 HNonSsaInstruction.prototype.useGvn = function() {
9905 unreachable(); 10295 unreachable();
9906 } 10296 }
9907 // ********** Code for HLoad ************** 10297 // ********** Code for HLoad **************
9908 function HLoad(local, type) { 10298 function HLoad(local, type) {
9909 // Initializers done 10299 // Initializers done
9910 HNonSsaInstruction.call(this, [local]); 10300 HNonSsaInstruction.call(this, [local]);
9911 this.type = $assert_num(type); 10301 this.type = $assert_num(type);
9912 } 10302 }
9913 $inherits(HLoad, HNonSsaInstruction); 10303 $inherits(HLoad, HNonSsaInstruction);
9914 HLoad.prototype.get$local = function() { 10304 HLoad.prototype.get$local = function() {
9915 var $0; 10305 var $0;
9916 return (($0 = this.inputs.$index(0)) && $0.is$HLocal()); 10306 return (($0 = this.inputs.$index(0)) == null ? null : $0.assert$HLocal());
9917 } 10307 }
9918 HLoad.prototype.toString = function() { 10308 HLoad.prototype.toString = function() {
9919 return 'load'; 10309 return 'load';
9920 } 10310 }
9921 HLoad.prototype.accept = function(visitor) { 10311 HLoad.prototype.accept = function(visitor) {
9922 return visitor.visitLoad(this); 10312 return visitor.visitLoad(this);
9923 } 10313 }
9924 HLoad.prototype.accept$1 = function($0) { 10314 HLoad.prototype.accept$1 = function($0) {
9925 return this.accept(($0 && $0.is$HVisitor())); 10315 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9926 }; 10316 };
9927 HLoad.prototype.toString$0 = HLoad.prototype.toString; 10317 HLoad.prototype.toString$0 = HLoad.prototype.toString;
9928 // ********** Code for HStore ************** 10318 // ********** Code for HStore **************
9929 function HStore(local, value) { 10319 function HStore(local, value) {
9930 // Initializers done 10320 // Initializers done
9931 HNonSsaInstruction.call(this, [local, value]); 10321 HNonSsaInstruction.call(this, [local, value]);
9932 } 10322 }
9933 $inherits(HStore, HNonSsaInstruction); 10323 $inherits(HStore, HNonSsaInstruction);
9934 HStore.prototype.get$local = function() { 10324 HStore.prototype.get$local = function() {
9935 var $0; 10325 var $0;
9936 return (($0 = this.inputs.$index(0)) && $0.is$HLocal()); 10326 return (($0 = this.inputs.$index(0)) == null ? null : $0.assert$HLocal());
9937 } 10327 }
9938 HStore.prototype.get$value = function() { 10328 HStore.prototype.get$value = function() {
9939 var $0; 10329 var $0;
9940 return (($0 = this.inputs.$index(1)) && $0.is$HInstruction()); 10330 return (($0 = this.inputs.$index(1)) == null ? null : $0.assert$HInstruction() );
9941 } 10331 }
9942 HStore.prototype.toString = function() { 10332 HStore.prototype.toString = function() {
9943 return 'store'; 10333 return 'store';
9944 } 10334 }
9945 HStore.prototype.accept = function(visitor) { 10335 HStore.prototype.accept = function(visitor) {
9946 return visitor.visitStore(this); 10336 return visitor.visitStore(this);
9947 } 10337 }
9948 HStore.prototype.accept$1 = function($0) { 10338 HStore.prototype.accept$1 = function($0) {
9949 return this.accept(($0 && $0.is$HVisitor())); 10339 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9950 }; 10340 };
9951 HStore.prototype.toString$0 = HStore.prototype.toString; 10341 HStore.prototype.toString$0 = HStore.prototype.toString;
9952 // ********** Code for HLocal ************** 10342 // ********** Code for HLocal **************
9953 function HLocal(element) { 10343 function HLocal(element) {
9954 this.element = element; 10344 this.element = element;
9955 // Initializers done 10345 // Initializers done
9956 HNonSsaInstruction.call(this, []); 10346 HNonSsaInstruction.call(this, []);
9957 this.declaredBy = this; 10347 this.declaredBy = this;
9958 } 10348 }
9959 $inherits(HLocal, HNonSsaInstruction); 10349 $inherits(HLocal, HNonSsaInstruction);
9960 HLocal.prototype.is$HLocal = function(){return this;}; 10350 HLocal.prototype.assert$HLocal = function(){return this};
9961 HLocal.prototype.get$element = function() { return this.element; }; 10351 HLocal.prototype.get$element = function() { return this.element; };
9962 HLocal.prototype.set$element = function(value) { return this.element = value; }; 10352 HLocal.prototype.set$element = function(value) { return this.element = value; };
9963 HLocal.prototype.toString = function() { 10353 HLocal.prototype.toString = function() {
9964 return 'local'; 10354 return 'local';
9965 } 10355 }
9966 HLocal.prototype.accept = function(visitor) { 10356 HLocal.prototype.accept = function(visitor) {
9967 return visitor.visitLocal(this); 10357 return visitor.visitLocal(this);
9968 } 10358 }
9969 HLocal.prototype.accept$1 = function($0) { 10359 HLocal.prototype.accept$1 = function($0) {
9970 return this.accept(($0 && $0.is$HVisitor())); 10360 return this.accept(($0 == null ? null : $0.assert$HVisitor()));
9971 }; 10361 };
9972 HLocal.prototype.toString$0 = HLocal.prototype.toString; 10362 HLocal.prototype.toString$0 = HLocal.prototype.toString;
9973 // ********** Code for SsaOptimizerTask ************** 10363 // ********** Code for SsaOptimizerTask **************
9974 function SsaOptimizerTask(compiler) { 10364 function SsaOptimizerTask(compiler) {
9975 // Initializers done 10365 // Initializers done
9976 CompilerTask.call(this, compiler); 10366 CompilerTask.call(this, compiler);
9977 } 10367 }
9978 $inherits(SsaOptimizerTask, CompilerTask); 10368 $inherits(SsaOptimizerTask, CompilerTask);
9979 SsaOptimizerTask.prototype.get$name = function() { 10369 SsaOptimizerTask.prototype.get$name = function() {
9980 return 'SSA optimizer'; 10370 return 'SSA optimizer';
(...skipping 18 matching lines...) Expand all
9999 } 10389 }
10000 $inherits(SsaConstantFolder, HBaseVisitor); 10390 $inherits(SsaConstantFolder, HBaseVisitor);
10001 SsaConstantFolder.prototype.visitGraph = function(graph) { 10391 SsaConstantFolder.prototype.visitGraph = function(graph) {
10002 this.visitDominatorTree(graph); 10392 this.visitDominatorTree(graph);
10003 } 10393 }
10004 SsaConstantFolder.prototype.visitBasicBlock = function(block) { 10394 SsaConstantFolder.prototype.visitBasicBlock = function(block) {
10005 var $0; 10395 var $0;
10006 var instruction = block.first; 10396 var instruction = block.first;
10007 while (instruction != null) { 10397 while (instruction != null) {
10008 var next = instruction.next; 10398 var next = instruction.next;
10009 var replacement = (($0 = instruction.accept(this)) && $0.is$HInstruction()); 10399 var replacement = (($0 = instruction.accept(this)) == null ? null : $0.asser t$HInstruction());
10010 if (replacement !== instruction) { 10400 if (replacement !== instruction) {
10011 if (!$notnull_bool(replacement.isInBasicBlock())) { 10401 if (!$notnull_bool(replacement.isInBasicBlock())) {
10012 block.addAfter(instruction, replacement); 10402 block.addAfter(instruction, replacement);
10013 } 10403 }
10014 block.rewrite(instruction, replacement); 10404 block.rewrite(instruction, replacement);
10015 block.remove(instruction); 10405 block.remove(instruction);
10016 } 10406 }
10017 instruction = next; 10407 instruction = next;
10018 } 10408 }
10019 } 10409 }
10020 SsaConstantFolder.prototype.visitInstruction = function(node) { 10410 SsaConstantFolder.prototype.visitInstruction = function(node) {
10021 return node; 10411 return node;
10022 } 10412 }
10023 SsaConstantFolder.prototype.visitBoolify = function(node) { 10413 SsaConstantFolder.prototype.visitBoolify = function(node) {
10024 var $0; 10414 var $0;
10025 var inputs = node.inputs; 10415 var inputs = node.inputs;
10026 $assert(inputs.length == 1, "inputs.length == 1", "optimize.dart", 56, 12); 10416 $assert(inputs.length == 1, "inputs.length == 1", "optimize.dart", 56, 12);
10027 var input = (($0 = inputs.$index(0)) && $0.is$HInstruction()); 10417 var input = (($0 = inputs.$index(0)) == null ? null : $0.assert$HInstruction() );
10028 if ($notnull_bool(input.isBoolean())) return input; 10418 if ($notnull_bool(input.isBoolean())) return input;
10029 if (!$notnull_bool(input.isUnknown())) return new HLiteral(false); 10419 if (!$notnull_bool(input.isUnknown())) return new HLiteral(false);
10030 return node; 10420 return node;
10031 } 10421 }
10032 SsaConstantFolder.prototype.visitNot = function(node) { 10422 SsaConstantFolder.prototype.visitNot = function(node) {
10033 var $0; 10423 var $0;
10034 var inputs = node.inputs; 10424 var inputs = node.inputs;
10035 $assert(inputs.length == 1, "inputs.length == 1", "optimize.dart", 66, 12); 10425 $assert(inputs.length == 1, "inputs.length == 1", "optimize.dart", 66, 12);
10036 var input = (($0 = inputs.$index(0)) && $0.is$HInstruction()); 10426 var input = (($0 = inputs.$index(0)) == null ? null : $0.assert$HInstruction() );
10037 if ((input instanceof HLiteral)) { 10427 if ((input instanceof HLiteral)) {
10038 var literal = (input && input.is$HLiteral()); 10428 var literal = (input == null ? null : input.assert$HLiteral());
10039 return new HLiteral(literal.value !== true); 10429 return new HLiteral(literal.value !== true);
10040 } 10430 }
10041 return node; 10431 return node;
10042 } 10432 }
10043 SsaConstantFolder.prototype.visitArithmetic = function(node) { 10433 SsaConstantFolder.prototype.visitArithmetic = function(node) {
10044 return node.fold(); 10434 return node.fold();
10045 } 10435 }
10046 SsaConstantFolder.prototype.visitAdd = function(node) { 10436 SsaConstantFolder.prototype.visitAdd = function(node) {
10047 var $0; 10437 var $0;
10048 if ($notnull_bool(node.inputs.$index(0).isLiteralString$0()) && (node.inputs.$ index(1) instanceof HLiteral)) { 10438 if ($notnull_bool(node.inputs.$index(0).isLiteralString$0()) && (node.inputs.$ index(1) instanceof HLiteral)) {
10049 var op1 = (($0 = node.inputs.$index(0)) && $0.is$HLiteral()); 10439 var op1 = (($0 = node.inputs.$index(0)) == null ? null : $0.assert$HLiteral( ));
10050 var op2 = (($0 = node.inputs.$index(1)) && $0.is$HLiteral()); 10440 var op2 = (($0 = node.inputs.$index(1)) == null ? null : $0.assert$HLiteral( ));
10051 return new HLiteral(new StringWrapper(("" + op1.value + " + " + op2.value))) ; 10441 return new HLiteral(new StringWrapper(("" + op1.value + " + " + op2.value))) ;
10052 } 10442 }
10053 return this.visitArithmetic(node); 10443 return this.visitArithmetic(node);
10054 } 10444 }
10055 SsaConstantFolder.prototype.visitRelational = function(node) { 10445 SsaConstantFolder.prototype.visitRelational = function(node) {
10056 var $0; 10446 var $0;
10057 var inputs = node.inputs; 10447 var inputs = node.inputs;
10058 $assert(inputs.length == 2, "inputs.length == 2", "optimize.dart", 93, 12); 10448 $assert(inputs.length == 2, "inputs.length == 2", "optimize.dart", 93, 12);
10059 if ($notnull_bool(inputs.$index(0).isLiteralNumber$0()) && $notnull_bool(input s.$index(1).isLiteralNumber$0())) { 10449 if ($notnull_bool(inputs.$index(0).isLiteralNumber$0()) && $notnull_bool(input s.$index(1).isLiteralNumber$0())) {
10060 var op1 = (($0 = inputs.$index(0)) && $0.is$HLiteral()); 10450 var op1 = (($0 = inputs.$index(0)) == null ? null : $0.assert$HLiteral());
10061 var op2 = (($0 = inputs.$index(1)) && $0.is$HLiteral()); 10451 var op2 = (($0 = inputs.$index(1)) == null ? null : $0.assert$HLiteral());
10062 var folded = node.evaluate($assert_num(op1.value), $assert_num(op2.value)); 10452 var folded = node.evaluate($assert_num(op1.value), $assert_num(op2.value));
10063 return new HLiteral(folded); 10453 return new HLiteral(folded);
10064 } 10454 }
10065 return node; 10455 return node;
10066 } 10456 }
10067 SsaConstantFolder.prototype.visitEquals = function(node) { 10457 SsaConstantFolder.prototype.visitEquals = function(node) {
10068 var $0; 10458 var $0;
10069 var inputs = node.inputs; 10459 var inputs = node.inputs;
10070 if ((inputs.$index(0) instanceof HLiteral) && (inputs.$index(1) instanceof HLi teral)) { 10460 if ((inputs.$index(0) instanceof HLiteral) && (inputs.$index(1) instanceof HLi teral)) {
10071 var op1 = (($0 = inputs.$index(0)) && $0.is$HLiteral()); 10461 var op1 = (($0 = inputs.$index(0)) == null ? null : $0.assert$HLiteral());
10072 var op2 = (($0 = inputs.$index(1)) && $0.is$HLiteral()); 10462 var op2 = (($0 = inputs.$index(1)) == null ? null : $0.assert$HLiteral());
10073 return new HLiteral($eq(op1.value, op2.value)); 10463 return new HLiteral($eq(op1.value, op2.value));
10074 } 10464 }
10075 return node; 10465 return node;
10076 } 10466 }
10077 SsaConstantFolder.prototype.visitTypeGuard = function(node) { 10467 SsaConstantFolder.prototype.visitTypeGuard = function(node) {
10078 var $0; 10468 var $0;
10079 var value = (($0 = node.inputs.$index(0)) && $0.is$HInstruction()); 10469 var value = (($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstruct ion());
10080 return (($0 = (value.type == node.type) ? value : node) && $0.is$HInstruction( )); 10470 return (($0 = (value.type == node.type) ? value : node) == null ? null : $0.as sert$HInstruction());
10081 } 10471 }
10082 // ********** Code for SsaTypePropagator ************** 10472 // ********** Code for SsaTypePropagator **************
10083 function SsaTypePropagator() { 10473 function SsaTypePropagator() {
10084 this.workmap = new HashMapImplementation(); 10474 this.workmap = new HashMapImplementation();
10085 this.worklist = new ListFactory(); 10475 this.worklist = new ListFactory();
10086 // Initializers done 10476 // Initializers done
10087 HGraphVisitor.call(this); 10477 HGraphVisitor.call(this);
10088 } 10478 }
10089 $inherits(SsaTypePropagator, HGraphVisitor); 10479 $inherits(SsaTypePropagator, HGraphVisitor);
10090 SsaTypePropagator.prototype.visitGraph = function(graph) { 10480 SsaTypePropagator.prototype.visitGraph = function(graph) {
(...skipping 18 matching lines...) Expand all
10109 var instruction = block.first; 10499 var instruction = block.first;
10110 while (instruction != null) { 10500 while (instruction != null) {
10111 if ($notnull_bool(instruction.updateType())) this.addUsersAndInputsToWorklis t(instruction); 10501 if ($notnull_bool(instruction.updateType())) this.addUsersAndInputsToWorklis t(instruction);
10112 instruction = instruction.next; 10502 instruction = instruction.next;
10113 } 10503 }
10114 } 10504 }
10115 SsaTypePropagator.prototype.processWorklist = function() { 10505 SsaTypePropagator.prototype.processWorklist = function() {
10116 var $0; 10506 var $0;
10117 while (!this.worklist.isEmpty()) { 10507 while (!this.worklist.isEmpty()) {
10118 var id = $assert_num(this.worklist.removeLast()); 10508 var id = $assert_num(this.worklist.removeLast());
10119 var instruction = (($0 = this.workmap.$index(id)) && $0.is$HInstruction()); 10509 var instruction = (($0 = this.workmap.$index(id)) == null ? null : $0.assert $HInstruction());
10120 $assert(instruction != null, "instruction !== null", "optimize.dart", 156, 1 4); 10510 $assert(instruction != null, "instruction !== null", "optimize.dart", 156, 1 4);
10121 this.workmap.remove(id); 10511 this.workmap.remove(id);
10122 if ($notnull_bool(instruction.updateType())) this.addUsersAndInputsToWorklis t(instruction); 10512 if ($notnull_bool(instruction.updateType())) this.addUsersAndInputsToWorklis t(instruction);
10123 } 10513 }
10124 } 10514 }
10125 SsaTypePropagator.prototype.addUsersAndInputsToWorklist = function(instruction) { 10515 SsaTypePropagator.prototype.addUsersAndInputsToWorklist = function(instruction) {
10126 var $0; 10516 var $0;
10127 for (var i = 0, length = instruction.usedBy.length; 10517 for (var i = 0, length = instruction.usedBy.length;
10128 i < length; i++) { 10518 i < length; i++) {
10129 this.addToWorklist((($0 = instruction.usedBy.$index(i)) && $0.is$HInstructio n())); 10519 this.addToWorklist((($0 = instruction.usedBy.$index(i)) == null ? null : $0. assert$HInstruction()));
10130 } 10520 }
10131 for (var i = 0, length = instruction.inputs.length; 10521 for (var i = 0, length = instruction.inputs.length;
10132 i < length; i++) { 10522 i < length; i++) {
10133 this.addToWorklist((($0 = instruction.inputs.$index(i)) && $0.is$HInstructio n())); 10523 this.addToWorklist((($0 = instruction.inputs.$index(i)) == null ? null : $0. assert$HInstruction()));
10134 } 10524 }
10135 } 10525 }
10136 SsaTypePropagator.prototype.addToWorklist = function(instruction) { 10526 SsaTypePropagator.prototype.addToWorklist = function(instruction) {
10137 var id = instruction.id; 10527 var id = instruction.id;
10138 if (!this.workmap.containsKey(id)) { 10528 if (!this.workmap.containsKey(id)) {
10139 this.worklist.add(id); 10529 this.worklist.add(id);
10140 this.workmap.$setindex(id, instruction); 10530 this.workmap.$setindex(id, instruction);
10141 } 10531 }
10142 } 10532 }
10143 // ********** Code for TypeGuardInserter ************** 10533 // ********** Code for TypeGuardInserter **************
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
10179 return !$notnull_bool(instruction.hasSideEffects()) && instruction.usedBy.isEm pty(); 10569 return !$notnull_bool(instruction.hasSideEffects()) && instruction.usedBy.isEm pty();
10180 } 10570 }
10181 SsaDeadCodeEliminator.prototype.visitGraph = function(graph) { 10571 SsaDeadCodeEliminator.prototype.visitGraph = function(graph) {
10182 this.visitPostDominatorTree(graph); 10572 this.visitPostDominatorTree(graph);
10183 } 10573 }
10184 SsaDeadCodeEliminator.prototype.visitBasicBlock = function(block) { 10574 SsaDeadCodeEliminator.prototype.visitBasicBlock = function(block) {
10185 var instruction = block.last; 10575 var instruction = block.last;
10186 while (instruction != null) { 10576 while (instruction != null) {
10187 var previous = instruction.previous; 10577 var previous = instruction.previous;
10188 if ($notnull_bool(SsaDeadCodeEliminator.isDeadCode(instruction))) block.remo ve(instruction); 10578 if ($notnull_bool(SsaDeadCodeEliminator.isDeadCode(instruction))) block.remo ve(instruction);
10189 instruction = (previous && previous.is$HInstruction()); 10579 instruction = (previous == null ? null : previous.assert$HInstruction());
10190 } 10580 }
10191 } 10581 }
10192 // ********** Code for SsaDeadPhiEliminator ************** 10582 // ********** Code for SsaDeadPhiEliminator **************
10193 function SsaDeadPhiEliminator() { 10583 function SsaDeadPhiEliminator() {
10194 // Initializers done 10584 // Initializers done
10195 } 10585 }
10196 SsaDeadPhiEliminator.prototype.visitGraph = function(graph) { 10586 SsaDeadPhiEliminator.prototype.visitGraph = function(graph) {
10197 var $0; 10587 var $0;
10198 var worklist = []; 10588 var worklist = [];
10199 var livePhis = new HashSetImplementation(); 10589 var livePhis = new HashSetImplementation();
10200 var $list = graph.blocks; 10590 var $list = graph.blocks;
10201 for (var $i = 0;$i < $list.length; $i++) { 10591 for (var $i = 0;$i < $list.length; $i++) {
10202 var block = $list.$index($i); 10592 var block = $list.$index($i);
10203 block.forEachPhi$1((function (phi) { 10593 block.forEachPhi$1((function (phi) {
10204 var $list0 = phi.usedBy; 10594 var $list0 = phi.usedBy;
10205 for (var $i0 = 0;$i0 < $list0.length; $i0++) { 10595 for (var $i0 = 0;$i0 < $list0.length; $i0++) {
10206 var user = $list0.$index($i0); 10596 var user = $list0.$index($i0);
10207 if (!(user instanceof HPhi)) { 10597 if (!(user instanceof HPhi)) {
10208 worklist.add(phi); 10598 worklist.add(phi);
10209 livePhis.add(phi); 10599 livePhis.add(phi);
10210 break; 10600 break;
10211 } 10601 }
10212 } 10602 }
10213 }) 10603 })
10214 ); 10604 );
10215 } 10605 }
10216 while (!worklist.isEmpty()) { 10606 while (!worklist.isEmpty()) {
10217 var phi = (($0 = worklist.removeLast()) && $0.is$HPhi()); 10607 var phi = (($0 = worklist.removeLast()) == null ? null : $0.assert$HPhi());
10218 var $list = phi.inputs; 10608 var $list = phi.inputs;
10219 for (var $i = 0;$i < $list.length; $i++) { 10609 for (var $i = 0;$i < $list.length; $i++) {
10220 var input = $list.$index($i); 10610 var input = $list.$index($i);
10221 if ((input instanceof HPhi) && !livePhis.contains(input)) { 10611 if ((input instanceof HPhi) && !livePhis.contains(input)) {
10222 worklist.add(input); 10612 worklist.add(input);
10223 livePhis.add(input); 10613 livePhis.add(input);
10224 } 10614 }
10225 } 10615 }
10226 } 10616 }
10227 var $list = graph.blocks; 10617 var $list = graph.blocks;
10228 for (var $i = 0;$i < $list.length; $i++) { 10618 for (var $i = 0;$i < $list.length; $i++) {
10229 var block = $list.$index($i); 10619 var block = $list.$index($i);
10230 var current = (($0 = block.get$phis().get$first()) && $0.is$HPhi()); 10620 var current = (($0 = block.get$phis().get$first()) == null ? null : $0.asser t$HPhi());
10231 var next = null; 10621 var next = null;
10232 while (current != null) { 10622 while (current != null) {
10233 next = (($0 = current.next) && $0.is$HPhi()); 10623 next = (($0 = current.next) == null ? null : $0.assert$HPhi());
10234 if (!livePhis.contains(current)) block.removePhi$1(current); 10624 if (!livePhis.contains(current)) block.removePhi$1(current);
10235 current = next; 10625 current = next;
10236 } 10626 }
10237 } 10627 }
10238 } 10628 }
10239 // ********** Code for SsaRedundantPhiEliminator ************** 10629 // ********** Code for SsaRedundantPhiEliminator **************
10240 function SsaRedundantPhiEliminator() { 10630 function SsaRedundantPhiEliminator() {
10241 // Initializers done 10631 // Initializers done
10242 } 10632 }
10243 SsaRedundantPhiEliminator.prototype.visitGraph = function(graph) { 10633 SsaRedundantPhiEliminator.prototype.visitGraph = function(graph) {
10244 var $0; 10634 var $0;
10245 var worklist = []; 10635 var worklist = [];
10246 var $list = graph.blocks; 10636 var $list = graph.blocks;
10247 for (var $i = 0;$i < $list.length; $i++) { 10637 for (var $i = 0;$i < $list.length; $i++) {
10248 var block = $list.$index($i); 10638 var block = $list.$index($i);
10249 block.forEachPhi$1((function (phi) { 10639 block.forEachPhi$1((function (phi) {
10250 return worklist.add(phi); 10640 return worklist.add(phi);
10251 }) 10641 })
10252 ); 10642 );
10253 } 10643 }
10254 while (!worklist.isEmpty()) { 10644 while (!worklist.isEmpty()) {
10255 var phi = (($0 = worklist.removeLast()) && $0.is$HPhi()); 10645 var phi = (($0 = worklist.removeLast()) == null ? null : $0.assert$HPhi());
10256 if (!$notnull_bool(phi.isInBasicBlock())) continue; 10646 if (!$notnull_bool(phi.isInBasicBlock())) continue;
10257 $assert(phi.inputs.$index(0) !== phi, "phi.inputs[0] !== phi", "optimize.dar t", 295, 14); 10647 $assert(phi.inputs.$index(0) !== phi, "phi.inputs[0] !== phi", "optimize.dar t", 295, 14);
10258 var candidate = (($0 = phi.inputs.$index(0)) && $0.is$HInstruction()); 10648 var candidate = (($0 = phi.inputs.$index(0)) == null ? null : $0.assert$HIns truction());
10259 for (var i = 1; 10649 for (var i = 1;
10260 i < phi.inputs.length; i++) { 10650 i < phi.inputs.length; i++) {
10261 var input = (($0 = phi.inputs.$index(i)) && $0.is$HInstruction()); 10651 var input = (($0 = phi.inputs.$index(i)) == null ? null : $0.assert$HInstr uction());
10262 if (input !== candidate && input !== phi) { 10652 if (input !== candidate && input !== phi) {
10263 candidate = null; 10653 candidate = null;
10264 break; 10654 break;
10265 } 10655 }
10266 } 10656 }
10267 if (candidate == null) continue; 10657 if (candidate == null) continue;
10268 var $list = phi.usedBy; 10658 var $list = phi.usedBy;
10269 for (var $i = 0;$i < $list.length; $i++) { 10659 for (var $i = 0;$i < $list.length; $i++) {
10270 var user = $list.$index($i); 10660 var user = $list.$index($i);
10271 if ((user instanceof HPhi)) worklist.add(user); 10661 if ((user instanceof HPhi)) worklist.add(user);
(...skipping 10 matching lines...) Expand all
10282 } 10672 }
10283 SsaGlobalValueNumberer.prototype.visitGraph = function(graph) { 10673 SsaGlobalValueNumberer.prototype.visitGraph = function(graph) {
10284 this.computeChangesFlags(graph); 10674 this.computeChangesFlags(graph);
10285 this.moveLoopInvariantCode(graph); 10675 this.moveLoopInvariantCode(graph);
10286 this.visitBasicBlock(graph.entry, new ValueSet()); 10676 this.visitBasicBlock(graph.entry, new ValueSet());
10287 } 10677 }
10288 SsaGlobalValueNumberer.prototype.moveLoopInvariantCode = function(graph) { 10678 SsaGlobalValueNumberer.prototype.moveLoopInvariantCode = function(graph) {
10289 var $0; 10679 var $0;
10290 for (var i = graph.blocks.length - 1; 10680 for (var i = graph.blocks.length - 1;
10291 i >= 0; i--) { 10681 i >= 0; i--) {
10292 var block = (($0 = graph.blocks.$index(i)) && $0.is$HBasicBlock()); 10682 var block = (($0 = graph.blocks.$index(i)) == null ? null : $0.assert$HBasic Block());
10293 if ($notnull_bool(block.isLoopHeader())) { 10683 if ($notnull_bool(block.isLoopHeader())) {
10294 var changesFlags = $assert_num(this.loopChangesFlags.$index(block.id)); 10684 var changesFlags = $assert_num(this.loopChangesFlags.$index(block.id));
10295 var last = block.loopInformation.getLastBackEdge(); 10685 var last = block.loopInformation.getLastBackEdge();
10296 for (var j = block.id; 10686 for (var j = block.id;
10297 j <= last.id; j++) { 10687 j <= last.id; j++) {
10298 this.moveLoopInvariantCodeFromBlock((($0 = graph.blocks.$index(j)) && $0 .is$HBasicBlock()), block, changesFlags); 10688 this.moveLoopInvariantCodeFromBlock((($0 = graph.blocks.$index(j)) == nu ll ? null : $0.assert$HBasicBlock()), block, changesFlags);
10299 } 10689 }
10300 } 10690 }
10301 } 10691 }
10302 } 10692 }
10303 SsaGlobalValueNumberer.prototype.moveLoopInvariantCodeFromBlock = function(block , loopHeader, changesFlags) { 10693 SsaGlobalValueNumberer.prototype.moveLoopInvariantCodeFromBlock = function(block , loopHeader, changesFlags) {
10304 var $0; 10694 var $0;
10305 var preheader = (($0 = loopHeader.predecessors.$index(0)) && $0.is$HBasicBlock ()); 10695 var preheader = (($0 = loopHeader.predecessors.$index(0)) == null ? null : $0. assert$HBasicBlock());
10306 var dependsFlags = HInstruction.computeDependsOnFlags(changesFlags); 10696 var dependsFlags = HInstruction.computeDependsOnFlags(changesFlags);
10307 var instruction = block.first; 10697 var instruction = block.first;
10308 while (instruction != null) { 10698 while (instruction != null) {
10309 var next = instruction.next; 10699 var next = instruction.next;
10310 if ($notnull_bool(instruction.useGvn()) && (instruction.flags & dependsFlags ) == 0) { 10700 if ($notnull_bool(instruction.useGvn()) && (instruction.flags & dependsFlags ) == 0) {
10311 var loopInvariantInputs = true; 10701 var loopInvariantInputs = true;
10312 var inputs = instruction.inputs; 10702 var inputs = instruction.inputs;
10313 for (var i = 0, length = inputs.length; 10703 for (var i = 0, length = inputs.length;
10314 i < length; i++) { 10704 i < length; i++) {
10315 if ($notnull_bool(this.isInputDefinedAfterDominator((($0 = inputs.$index (i)) && $0.is$HInstruction()), preheader))) { 10705 if ($notnull_bool(this.isInputDefinedAfterDominator((($0 = inputs.$index (i)) == null ? null : $0.assert$HInstruction()), preheader))) {
10316 loopInvariantInputs = false; 10706 loopInvariantInputs = false;
10317 break; 10707 break;
10318 } 10708 }
10319 } 10709 }
10320 if ($notnull_bool(loopInvariantInputs)) { 10710 if ($notnull_bool(loopInvariantInputs)) {
10321 block.detach(instruction); 10711 block.detach(instruction);
10322 preheader.moveAtExit(instruction); 10712 preheader.moveAtExit(instruction);
10323 } 10713 }
10324 } 10714 }
10325 instruction = next; 10715 instruction = next;
(...skipping 20 matching lines...) Expand all
10346 } 10736 }
10347 else { 10737 else {
10348 values.add(instruction); 10738 values.add(instruction);
10349 } 10739 }
10350 } 10740 }
10351 instruction = instruction.next; 10741 instruction = instruction.next;
10352 } 10742 }
10353 var dominatedBlocks = block.dominatedBlocks; 10743 var dominatedBlocks = block.dominatedBlocks;
10354 for (var i = 0, length = dominatedBlocks.length; 10744 for (var i = 0, length = dominatedBlocks.length;
10355 i < length; i++) { 10745 i < length; i++) {
10356 var dominated = (($0 = dominatedBlocks.$index(i)) && $0.is$HBasicBlock()); 10746 var dominated = (($0 = dominatedBlocks.$index(i)) == null ? null : $0.assert $HBasicBlock());
10357 var successorValues = (i == length - 1) ? values : values.copy(); 10747 var successorValues = (i == length - 1) ? values : values.copy();
10358 $assert(block.id < dominated.id, "block.id < dominated.id", "optimize.dart", 414, 14); 10748 $assert(block.id < dominated.id, "block.id < dominated.id", "optimize.dart", 414, 14);
10359 if (!$notnull_bool(successorValues.isEmpty()) && block.id + 1 < dominated.id ) { 10749 if (!$notnull_bool(successorValues.isEmpty()) && block.id + 1 < dominated.id ) {
10360 this.visited.clear(); 10750 this.visited.clear();
10361 var changesFlags = this.getChangesFlagsForDominatedBlock(block, dominated) ; 10751 var changesFlags = this.getChangesFlagsForDominatedBlock(block, dominated) ;
10362 successorValues.kill(changesFlags); 10752 successorValues.kill(changesFlags);
10363 } 10753 }
10364 this.visitBasicBlock(dominated, successorValues); 10754 this.visitBasicBlock(dominated, successorValues);
10365 } 10755 }
10366 } 10756 }
10367 SsaGlobalValueNumberer.prototype.computeChangesFlags = function(graph) { 10757 SsaGlobalValueNumberer.prototype.computeChangesFlags = function(graph) {
10368 var $0, $1; 10758 var $0, $1;
10369 var length = graph.blocks.length; 10759 var length = graph.blocks.length;
10370 this.blockChangesFlags = new ListFactory(length); 10760 this.blockChangesFlags = new ListFactory(length);
10371 this.loopChangesFlags = new ListFactory(length); 10761 this.loopChangesFlags = new ListFactory(length);
10372 for (var i = 0; 10762 for (var i = 0;
10373 i < length; i++) this.loopChangesFlags.$setindex(i, 0); 10763 i < length; i++) this.loopChangesFlags.$setindex(i, 0);
10374 for (var i = length - 1; 10764 for (var i = length - 1;
10375 i >= 0; i--) { 10765 i >= 0; i--) {
10376 var block = (($0 = graph.blocks.$index(i)) && $0.is$HBasicBlock()); 10766 var block = (($0 = graph.blocks.$index(i)) == null ? null : $0.assert$HBasic Block());
10377 var id = block.id; 10767 var id = block.id;
10378 var changesFlags = 0; 10768 var changesFlags = 0;
10379 var instruction = block.first; 10769 var instruction = block.first;
10380 while (instruction != null) { 10770 while (instruction != null) {
10381 instruction.prepareGvn(); 10771 instruction.prepareGvn();
10382 changesFlags |= instruction.getChangesFlags(); 10772 changesFlags |= instruction.getChangesFlags();
10383 instruction = instruction.next; 10773 instruction = instruction.next;
10384 } 10774 }
10385 $assert(this.blockChangesFlags.$index(id) == null, "blockChangesFlags[id] == = null", "optimize.dart", 447, 14); 10775 $assert(this.blockChangesFlags.$index(id) == null, "blockChangesFlags[id] == = null", "optimize.dart", 447, 14);
10386 this.blockChangesFlags.$setindex(id, changesFlags); 10776 this.blockChangesFlags.$setindex(id, changesFlags);
10387 if ($notnull_bool(block.isLoopHeader())) { 10777 if ($notnull_bool(block.isLoopHeader())) {
10388 ($0 = this.loopChangesFlags).$setindex(id, $0.$index(id) | changesFlags); 10778 ($0 = this.loopChangesFlags).$setindex(id, $0.$index(id) | changesFlags);
10389 } 10779 }
10390 var parentLoopHeader = block.parentLoopHeader; 10780 var parentLoopHeader = block.parentLoopHeader;
10391 if (parentLoopHeader != null) { 10781 if (parentLoopHeader != null) {
10392 ($0 = this.loopChangesFlags).$setindex(($1 = parentLoopHeader.id), $0.$ind ex($1) | $assert_num($notnull_bool((block.isLoopHeader())) ? this.loopChangesFla gs.$index(id) : changesFlags)); 10782 ($0 = this.loopChangesFlags).$setindex(($1 = parentLoopHeader.id), $0.$ind ex($1) | $assert_num($notnull_bool((block.isLoopHeader())) ? this.loopChangesFla gs.$index(id) : changesFlags));
10393 } 10783 }
10394 } 10784 }
10395 } 10785 }
10396 SsaGlobalValueNumberer.prototype.getChangesFlagsForDominatedBlock = function(dom inator, dominated) { 10786 SsaGlobalValueNumberer.prototype.getChangesFlagsForDominatedBlock = function(dom inator, dominated) {
10397 var $0; 10787 var $0;
10398 var changesFlags = 0; 10788 var changesFlags = 0;
10399 var predecessors = dominated.predecessors; 10789 var predecessors = dominated.predecessors;
10400 for (var i = 0, length = predecessors.length; 10790 for (var i = 0, length = predecessors.length;
10401 i < length; i++) { 10791 i < length; i++) {
10402 var block = (($0 = predecessors.$index(i)) && $0.is$HBasicBlock()); 10792 var block = (($0 = predecessors.$index(i)) == null ? null : $0.assert$HBasic Block());
10403 var id = block.id; 10793 var id = block.id;
10404 if (dominator.id < id && id < dominated.id && !this.visited.contains(id)) { 10794 if (dominator.id < id && id < dominated.id && !this.visited.contains(id)) {
10405 this.visited.add(id); 10795 this.visited.add(id);
10406 changesFlags |= $assert_num(this.blockChangesFlags.$index(id)); 10796 changesFlags |= $assert_num(this.blockChangesFlags.$index(id));
10407 changesFlags |= this.getChangesFlagsForDominatedBlock(dominator, block); 10797 changesFlags |= this.getChangesFlagsForDominatedBlock(dominator, block);
10408 } 10798 }
10409 } 10799 }
10410 return changesFlags; 10800 return changesFlags;
10411 } 10801 }
10412 // ********** Code for SsaInstructionMerger ************** 10802 // ********** Code for SsaInstructionMerger **************
(...skipping 13 matching lines...) Expand all
10426 return remarkTypeGuardInput; 10816 return remarkTypeGuardInput;
10427 } 10817 }
10428 SsaInstructionMerger.prototype.visitInstruction = function(node) { 10818 SsaInstructionMerger.prototype.visitInstruction = function(node) {
10429 var $0; 10819 var $0;
10430 if ((node instanceof HForeign)) return; 10820 if ((node instanceof HForeign)) return;
10431 var inputs = node.inputs; 10821 var inputs = node.inputs;
10432 var previousUnused = node.previous; 10822 var previousUnused = node.previous;
10433 var i = inputs.length - 1; 10823 var i = inputs.length - 1;
10434 for (; i >= 0; i--) { 10824 for (; i >= 0; i--) {
10435 if (previousUnused == null) break; 10825 if (previousUnused == null) break;
10436 var input = (($0 = inputs.$index(i)) && $0.is$HInstruction()); 10826 var input = (($0 = inputs.$index(i)) == null ? null : $0.assert$HInstruction ());
10437 if (input.usedBy.length != 1) break; 10827 if (input.usedBy.length != 1) break;
10438 if (input !== previousUnused) break; 10828 if (input !== previousUnused) break;
10439 var remarkTypeGuardInput = false; 10829 var remarkTypeGuardInput = false;
10440 if ((input instanceof HTypeGuard)) remarkTypeGuardInput = this.typeGuardChec k((input && input.is$HTypeGuard())); 10830 if ((input instanceof HTypeGuard)) remarkTypeGuardInput = this.typeGuardChec k((input == null ? null : input.assert$HTypeGuard()));
10441 if (!$notnull_bool(input.generateAtUseSite())) { 10831 if (!$notnull_bool(input.generateAtUseSite())) {
10442 this.markedByMerger.add(input); 10832 this.markedByMerger.add(input);
10443 input.setGenerateAtUseSite(); 10833 input.setGenerateAtUseSite();
10444 } 10834 }
10445 if ($notnull_bool(remarkTypeGuardInput)) input.inputs.$index(0).setGenerateA tUseSite$0(); 10835 if ($notnull_bool(remarkTypeGuardInput)) input.inputs.$index(0).setGenerateA tUseSite$0();
10446 previousUnused = previousUnused.previous; 10836 previousUnused = previousUnused.previous;
10447 } 10837 }
10448 for (; i >= 0; i--) { 10838 for (; i >= 0; i--) {
10449 var input = (($0 = inputs.$index(i)) && $0.is$HInstruction()); 10839 var input = (($0 = inputs.$index(i)) == null ? null : $0.assert$HInstruction ());
10450 if ((input instanceof HTypeGuard)) this.typeGuardCheck((input && input.is$HT ypeGuard())); 10840 if ((input instanceof HTypeGuard)) this.typeGuardCheck((input == null ? null : input.assert$HTypeGuard()));
10451 } 10841 }
10452 } 10842 }
10453 // ********** Code for SsaTypeGuardUnuser ************** 10843 // ********** Code for SsaTypeGuardUnuser **************
10454 function SsaTypeGuardUnuser() { 10844 function SsaTypeGuardUnuser() {
10455 // Initializers done 10845 // Initializers done
10456 HBaseVisitor.call(this); 10846 HBaseVisitor.call(this);
10457 } 10847 }
10458 $inherits(SsaTypeGuardUnuser, HBaseVisitor); 10848 $inherits(SsaTypeGuardUnuser, HBaseVisitor);
10459 SsaTypeGuardUnuser.prototype.visitGraph = function(graph) { 10849 SsaTypeGuardUnuser.prototype.visitGraph = function(graph) {
10460 this.visitDominatorTree(graph); 10850 this.visitDominatorTree(graph);
10461 } 10851 }
10462 SsaTypeGuardUnuser.prototype.visitTypeGuard = function(node) { 10852 SsaTypeGuardUnuser.prototype.visitTypeGuard = function(node) {
10463 var $0; 10853 var $0;
10464 if ($notnull_bool(node.generateAtUseSite())) return; 10854 if ($notnull_bool(node.generateAtUseSite())) return;
10465 this.currentBlock.rewrite(node, (($0 = node.inputs.$index(0)) && $0.is$HInstru ction())); 10855 this.currentBlock.rewrite(node, (($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstruction()));
10466 } 10856 }
10467 // ********** Code for SsaPhiEliminator ************** 10857 // ********** Code for SsaPhiEliminator **************
10468 function SsaPhiEliminator() { 10858 function SsaPhiEliminator() {
10469 // Initializers done 10859 // Initializers done
10470 HGraphVisitor.call(this); 10860 HGraphVisitor.call(this);
10471 } 10861 }
10472 $inherits(SsaPhiEliminator, HGraphVisitor); 10862 $inherits(SsaPhiEliminator, HGraphVisitor);
10473 SsaPhiEliminator.prototype.visitGraph = function(graph) { 10863 SsaPhiEliminator.prototype.visitGraph = function(graph) {
10474 this.entry = graph.entry; 10864 this.entry = graph.entry;
10475 this.namedLocals = new HashMapImplementation(); 10865 this.namedLocals = new HashMapImplementation();
(...skipping 27 matching lines...) Expand all
10503 } 10893 }
10504 while ($ne(current, dominator) && !$notnull_bool(current.isLoopHeader())) 10894 while ($ne(current, dominator) && !$notnull_bool(current.isLoopHeader()))
10505 $assert(store != null, "store !== null", "phi_eliminator.dart", 58, 12); 10895 $assert(store != null, "store !== null", "phi_eliminator.dart", 58, 12);
10506 predecessor.addAtExit(store); 10896 predecessor.addAtExit(store);
10507 return store; 10897 return store;
10508 } 10898 }
10509 SsaPhiEliminator.prototype.visitBasicBlock = function(block) { 10899 SsaPhiEliminator.prototype.visitBasicBlock = function(block) {
10510 var $0; 10900 var $0;
10511 this.currentBlock = block; 10901 this.currentBlock = block;
10512 var loads = []; 10902 var loads = [];
10513 var phi = (($0 = block.phis.first) && $0.is$HPhi()); 10903 var phi = (($0 = block.phis.first) == null ? null : $0.assert$HPhi());
10514 while (phi != null) { 10904 while (phi != null) {
10515 var next = (($0 = phi.next) && $0.is$HPhi()); 10905 var next = (($0 = phi.next) == null ? null : $0.assert$HPhi());
10516 this.visitPhi(phi, loads); 10906 this.visitPhi(phi, loads);
10517 phi = next; 10907 phi = next;
10518 } 10908 }
10519 } 10909 }
10520 SsaPhiEliminator.prototype.visitPhi = function(phi, loads) { 10910 SsaPhiEliminator.prototype.visitPhi = function(phi, loads) {
10521 var $this = this; // closure support 10911 var $this = this; // closure support
10522 var $0; 10912 var $0;
10523 $assert(phi != null, "phi !== null", "phi_eliminator.dart", 75, 12); 10913 $assert(phi != null, "phi !== null", "phi_eliminator.dart", 75, 12);
10524 var local; 10914 var local;
10525 if (phi.element != null) { 10915 if (phi.element != null) {
10526 local = (($0 = this.namedLocals.putIfAbsent(phi.element, (function () { 10916 local = (($0 = this.namedLocals.putIfAbsent(phi.element, (function () {
10527 var local0 = new HLocal(phi.element); 10917 var local0 = new HLocal(phi.element);
10528 $this.entry.addAtEntry(local0); 10918 $this.entry.addAtEntry(local0);
10529 if (phi.element.kind === const$232/*ElementKind.PARAMETER*/) { 10919 if (phi.element.kind === const$232/*ElementKind.PARAMETER*/) {
10530 $this.entry.detach(local0); 10920 $this.entry.detach(local0);
10531 } 10921 }
10532 return local0; 10922 return local0;
10533 }) 10923 })
10534 )) && $0.is$HLocal()); 10924 )) == null ? null : $0.assert$HLocal());
10535 } 10925 }
10536 else { 10926 else {
10537 local = new HLocal(null); 10927 local = new HLocal(null);
10538 this.entry.addAtEntry(local); 10928 this.entry.addAtEntry(local);
10539 } 10929 }
10540 var predecessors = this.currentBlock.predecessors; 10930 var predecessors = this.currentBlock.predecessors;
10541 var stores = []; 10931 var stores = [];
10542 for (var i = 0, len = predecessors.length; 10932 for (var i = 0, len = predecessors.length;
10543 i < len; i++) { 10933 i < len; i++) {
10544 var value = (($0 = phi.inputs.$index(i)) && $0.is$HInstruction()); 10934 var value = (($0 = phi.inputs.$index(i)) == null ? null : $0.assert$HInstruc tion());
10545 if ((value instanceof HLoad) && value.get$dynamic().get$local() === local) c ontinue; 10935 if ((value instanceof HLoad) && value.get$dynamic().get$local() === local) c ontinue;
10546 if (((value instanceof HPhi)) && (local.element != null) && (value.get$dynam ic().get$element() === local.element)) continue; 10936 if (((value instanceof HPhi)) && (local.element != null) && (value.get$dynam ic().get$element() === local.element)) continue;
10547 var store = this.addStore((($0 = predecessors.$index(i)) && $0.is$HBasicBloc k()), this.currentBlock.dominator, local, value); 10937 var store = this.addStore((($0 = predecessors.$index(i)) == null ? null : $0 .assert$HBasicBlock()), this.currentBlock.dominator, local, value);
10548 if (store != null) { 10938 if (store != null) {
10549 if (local.declaredBy === local) { 10939 if (local.declaredBy === local) {
10550 var storeBlock = store.block; 10940 var storeBlock = store.block;
10551 if (storeBlock === this.entry || storeBlock === this.entry.successors.$i ndex(0)) { 10941 if (storeBlock === this.entry || storeBlock === this.entry.successors.$i ndex(0)) {
10552 this.entry.detach(local); 10942 this.entry.detach(local);
10553 local.declaredBy = store; 10943 local.declaredBy = store;
10554 } 10944 }
10555 } 10945 }
10556 stores.add(store); 10946 stores.add(store);
10557 } 10947 }
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
10665 $this.printEmptyProperty("flags"); 11055 $this.printEmptyProperty("flags");
10666 if (block.dominator != null) { 11056 if (block.dominator != null) {
10667 $this.printProperty("dominator", ("B" + block.dominator.id)); 11057 $this.printProperty("dominator", ("B" + block.dominator.id));
10668 } 11058 }
10669 $this.tag("states", (function () { 11059 $this.tag("states", (function () {
10670 $this.tag("locals", (function () { 11060 $this.tag("locals", (function () {
10671 $this.printProperty("size", 0); 11061 $this.printProperty("size", 0);
10672 $this.printProperty("method", "None"); 11062 $this.printProperty("method", "None");
10673 block.forEachPhi((function (phi) { 11063 block.forEachPhi((function (phi) {
10674 var $0; 11064 var $0;
10675 var phiId = stringifier.temporaryId((phi && phi.is$HInstruction())); 11065 var phiId = stringifier.temporaryId((phi == null ? null : phi.assert$H Instruction()));
10676 var inputId1 = stringifier.temporaryId((($0 = phi.get$inputs().$index( 0)) && $0.is$HInstruction())); 11066 var inputId1 = stringifier.temporaryId((($0 = phi.get$inputs().$index( 0)) == null ? null : $0.assert$HInstruction()));
10677 var inputId2 = stringifier.temporaryId((($0 = phi.get$inputs().$index( 1)) && $0.is$HInstruction())); 11067 var inputId2 = stringifier.temporaryId((($0 = phi.get$inputs().$index( 1)) == null ? null : $0.assert$HInstruction()));
10678 $this.print(("" + phi.get$id() + " " + phiId + " [ " + inputId1 + " " + inputId2 + " ]")); 11068 $this.print(("" + phi.get$id() + " " + phiId + " [ " + inputId1 + " " + inputId2 + " ]"));
10679 }) 11069 })
10680 ); 11070 );
10681 }) 11071 })
10682 ); 11072 );
10683 }) 11073 })
10684 ); 11074 );
10685 $this.tag("HIR", (function () { 11075 $this.tag("HIR", (function () {
10686 $this.addInstructions(stringifier, block.phis); 11076 $this.addInstructions(stringifier, block.phis);
10687 $this.addInstructions(stringifier, block); 11077 $this.addInstructions(stringifier, block);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
10727 } 11117 }
10728 HTracer.prototype.add$1 = function($0) { 11118 HTracer.prototype.add$1 = function($0) {
10729 return this.add($assert_String($0)); 11119 return this.add($assert_String($0));
10730 }; 11120 };
10731 HTracer.prototype.toString$0 = HTracer.prototype.toString; 11121 HTracer.prototype.toString$0 = HTracer.prototype.toString;
10732 // ********** Code for HInstructionStringifier ************** 11122 // ********** Code for HInstructionStringifier **************
10733 function HInstructionStringifier(currentBlock) { 11123 function HInstructionStringifier(currentBlock) {
10734 this.currentBlock = currentBlock; 11124 this.currentBlock = currentBlock;
10735 // Initializers done 11125 // Initializers done
10736 } 11126 }
10737 HInstructionStringifier.prototype.is$HVisitor = function(){return this;}; 11127 HInstructionStringifier.prototype.assert$HVisitor = function(){return this};
10738 HInstructionStringifier.prototype.visit = function(node) { 11128 HInstructionStringifier.prototype.visit = function(node) {
10739 return node.accept(this); 11129 return node.accept(this);
10740 } 11130 }
10741 HInstructionStringifier.prototype.visitBasicBlock = function(node) { 11131 HInstructionStringifier.prototype.visitBasicBlock = function(node) {
10742 unreachable(); 11132 unreachable();
10743 } 11133 }
10744 HInstructionStringifier.prototype.temporaryId = function(instruction) { 11134 HInstructionStringifier.prototype.temporaryId = function(instruction) {
10745 var prefix; 11135 var prefix;
10746 switch (instruction.type) { 11136 switch (instruction.type) {
10747 case 1/*HInstruction.TYPE_BOOLEAN*/: 11137 case 1/*HInstruction.TYPE_BOOLEAN*/:
(...skipping 23 matching lines...) Expand all
10771 11161
10772 default: 11162 default:
10773 11163
10774 unreachable(); 11164 unreachable();
10775 11165
10776 } 11166 }
10777 return ("" + prefix + instruction.id); 11167 return ("" + prefix + instruction.id);
10778 } 11168 }
10779 HInstructionStringifier.prototype.visitBoolify = function(node) { 11169 HInstructionStringifier.prototype.visitBoolify = function(node) {
10780 var $0; 11170 var $0;
10781 return ("Boolify: " + this.temporaryId((($0 = node.inputs.$index(0)) && $0.is$ HInstruction()))); 11171 return ("Boolify: " + this.temporaryId((($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstruction())));
10782 } 11172 }
10783 HInstructionStringifier.prototype.visitAdd = function(node) { 11173 HInstructionStringifier.prototype.visitAdd = function(node) {
10784 return this.visitInvoke(node); 11174 return this.visitInvoke(node);
10785 } 11175 }
10786 HInstructionStringifier.prototype.visitBitAnd = function(node) { 11176 HInstructionStringifier.prototype.visitBitAnd = function(node) {
10787 return this.visitInvoke(node); 11177 return this.visitInvoke(node);
10788 } 11178 }
10789 HInstructionStringifier.prototype.visitBitNot = function(node) { 11179 HInstructionStringifier.prototype.visitBitNot = function(node) {
10790 return this.visitInvoke(node); 11180 return this.visitInvoke(node);
10791 } 11181 }
10792 HInstructionStringifier.prototype.visitBitOr = function(node) { 11182 HInstructionStringifier.prototype.visitBitOr = function(node) {
10793 return this.visitInvoke(node); 11183 return this.visitInvoke(node);
10794 } 11184 }
10795 HInstructionStringifier.prototype.visitBitXor = function(node) { 11185 HInstructionStringifier.prototype.visitBitXor = function(node) {
10796 return this.visitInvoke(node); 11186 return this.visitInvoke(node);
10797 } 11187 }
10798 HInstructionStringifier.prototype.visitDivide = function(node) { 11188 HInstructionStringifier.prototype.visitDivide = function(node) {
10799 return this.visitInvoke(node); 11189 return this.visitInvoke(node);
10800 } 11190 }
10801 HInstructionStringifier.prototype.visitEquals = function(node) { 11191 HInstructionStringifier.prototype.visitEquals = function(node) {
10802 return this.visitInvoke(node); 11192 return this.visitInvoke(node);
10803 } 11193 }
10804 HInstructionStringifier.prototype.visitExit = function(node) { 11194 HInstructionStringifier.prototype.visitExit = function(node) {
10805 return "exit"; 11195 return "exit";
10806 } 11196 }
10807 HInstructionStringifier.prototype.visitGoto = function(node) { 11197 HInstructionStringifier.prototype.visitGoto = function(node) {
10808 var $0; 11198 var $0;
10809 var target = (($0 = this.currentBlock.successors.$index(0)) && $0.is$HBasicBlo ck()); 11199 var target = (($0 = this.currentBlock.successors.$index(0)) == null ? null : $ 0.assert$HBasicBlock());
10810 return ("Goto: (B" + target.id + ")"); 11200 return ("Goto: (B" + target.id + ")");
10811 } 11201 }
10812 HInstructionStringifier.prototype.visitGreater = function(node) { 11202 HInstructionStringifier.prototype.visitGreater = function(node) {
10813 return this.visitInvoke(node); 11203 return this.visitInvoke(node);
10814 } 11204 }
10815 HInstructionStringifier.prototype.visitGreaterEqual = function(node) { 11205 HInstructionStringifier.prototype.visitGreaterEqual = function(node) {
10816 return this.visitInvoke(node); 11206 return this.visitInvoke(node);
10817 } 11207 }
10818 HInstructionStringifier.prototype.visitIf = function(node) { 11208 HInstructionStringifier.prototype.visitIf = function(node) {
10819 var $0; 11209 var $0;
10820 var thenBlock = (($0 = this.currentBlock.successors.$index(0)) && $0.is$HBasic Block()); 11210 var thenBlock = (($0 = this.currentBlock.successors.$index(0)) == null ? null : $0.assert$HBasicBlock());
10821 var elseBlock = (($0 = this.currentBlock.successors.$index(1)) && $0.is$HBasic Block()); 11211 var elseBlock = (($0 = this.currentBlock.successors.$index(1)) == null ? null : $0.assert$HBasicBlock());
10822 var conditionId = this.temporaryId((($0 = node.inputs.$index(0)) && $0.is$HIns truction())); 11212 var conditionId = this.temporaryId((($0 = node.inputs.$index(0)) == null ? nul l : $0.assert$HInstruction()));
10823 return ("If (" + conditionId + "): (B" + thenBlock.id + ") else (B" + elseBloc k.id + ")"); 11213 return ("If (" + conditionId + "): (B" + thenBlock.id + ") else (B" + elseBloc k.id + ")");
10824 } 11214 }
10825 HInstructionStringifier.prototype.visitGenericInvoke = function(invokeType, func tionName, arguments) { 11215 HInstructionStringifier.prototype.visitGenericInvoke = function(invokeType, func tionName, arguments) {
10826 var $0; 11216 var $0;
10827 var argumentsString = new StringBufferImpl(""); 11217 var argumentsString = new StringBufferImpl("");
10828 for (var i = 0; 11218 for (var i = 0;
10829 i < arguments.length; i++) { 11219 i < arguments.length; i++) {
10830 if (i != 0) argumentsString.add(", "); 11220 if (i != 0) argumentsString.add(", ");
10831 argumentsString.add(this.temporaryId((($0 = arguments.$index(i)) && $0.is$HI nstruction()))); 11221 argumentsString.add(this.temporaryId((($0 = arguments.$index(i)) == null ? n ull : $0.assert$HInstruction())));
10832 } 11222 }
10833 return ("" + invokeType + ": " + functionName + "(" + argumentsString + ")"); 11223 return ("" + invokeType + ": " + functionName + "(" + argumentsString + ")");
10834 } 11224 }
10835 HInstructionStringifier.prototype.visitInvoke = function(invoke) { 11225 HInstructionStringifier.prototype.visitInvoke = function(invoke) {
10836 var target = ("" + invoke.element.name); 11226 var target = ("" + invoke.element.name);
10837 var arguments = invoke.inputs; 11227 var arguments = invoke.inputs;
10838 return this.visitGenericInvoke("Invoke", target, arguments); 11228 return this.visitGenericInvoke("Invoke", target, arguments);
10839 } 11229 }
10840 HInstructionStringifier.prototype.visitForeign = function(foreign) { 11230 HInstructionStringifier.prototype.visitForeign = function(foreign) {
10841 return this.visitGenericInvoke("Foreign", ("" + foreign.code), foreign.inputs) ; 11231 return this.visitGenericInvoke("Foreign", ("" + foreign.code), foreign.inputs) ;
10842 } 11232 }
10843 HInstructionStringifier.prototype.visitLess = function(node) { 11233 HInstructionStringifier.prototype.visitLess = function(node) {
10844 return this.visitInvoke(node); 11234 return this.visitInvoke(node);
10845 } 11235 }
10846 HInstructionStringifier.prototype.visitLessEqual = function(node) { 11236 HInstructionStringifier.prototype.visitLessEqual = function(node) {
10847 return this.visitInvoke(node); 11237 return this.visitInvoke(node);
10848 } 11238 }
10849 HInstructionStringifier.prototype.visitLiteral = function(literal) { 11239 HInstructionStringifier.prototype.visitLiteral = function(literal) {
10850 return ("Literal " + literal.value); 11240 return ("Literal " + literal.value);
10851 } 11241 }
10852 HInstructionStringifier.prototype.visitLoad = function(node) { 11242 HInstructionStringifier.prototype.visitLoad = function(node) {
10853 var $0; 11243 var $0;
10854 return ("Load: " + this.temporaryId((($0 = node.inputs.$index(0)) && $0.is$HIn struction()))); 11244 return ("Load: " + this.temporaryId((($0 = node.inputs.$index(0)) == null ? nu ll : $0.assert$HInstruction())));
10855 } 11245 }
10856 HInstructionStringifier.prototype.visitLocal = function(node) { 11246 HInstructionStringifier.prototype.visitLocal = function(node) {
10857 if (node.element != null) { 11247 if (node.element != null) {
10858 return ("Local: " + node.element.name.get$stringValue()); 11248 return ("Local: " + node.element.name.get$stringValue());
10859 } 11249 }
10860 else { 11250 else {
10861 return "Local"; 11251 return "Local";
10862 } 11252 }
10863 } 11253 }
10864 HInstructionStringifier.prototype.visitLoopBranch = function(branch) { 11254 HInstructionStringifier.prototype.visitLoopBranch = function(branch) {
10865 var $0; 11255 var $0;
10866 var bodyBlock = (($0 = this.currentBlock.successors.$index(0)) && $0.is$HBasic Block()); 11256 var bodyBlock = (($0 = this.currentBlock.successors.$index(0)) == null ? null : $0.assert$HBasicBlock());
10867 var exitBlock = (($0 = this.currentBlock.successors.$index(1)) && $0.is$HBasic Block()); 11257 var exitBlock = (($0 = this.currentBlock.successors.$index(1)) == null ? null : $0.assert$HBasicBlock());
10868 var conditionId = this.temporaryId((($0 = branch.inputs.$index(0)) && $0.is$HI nstruction())); 11258 var conditionId = this.temporaryId((($0 = branch.inputs.$index(0)) == null ? n ull : $0.assert$HInstruction()));
10869 return ("While (" + conditionId + "): (B" + bodyBlock.id + ") then (B" + exitB lock.id + ")"); 11259 return ("While (" + conditionId + "): (B" + bodyBlock.id + ") then (B" + exitB lock.id + ")");
10870 } 11260 }
10871 HInstructionStringifier.prototype.visitModulo = function(node) { 11261 HInstructionStringifier.prototype.visitModulo = function(node) {
10872 return this.visitInvoke(node); 11262 return this.visitInvoke(node);
10873 } 11263 }
10874 HInstructionStringifier.prototype.visitMultiply = function(node) { 11264 HInstructionStringifier.prototype.visitMultiply = function(node) {
10875 return this.visitInvoke(node); 11265 return this.visitInvoke(node);
10876 } 11266 }
10877 HInstructionStringifier.prototype.visitNegate = function(node) { 11267 HInstructionStringifier.prototype.visitNegate = function(node) {
10878 return this.visitInvoke(node); 11268 return this.visitInvoke(node);
10879 } 11269 }
10880 HInstructionStringifier.prototype.visitNot = function(node) { 11270 HInstructionStringifier.prototype.visitNot = function(node) {
10881 var $0; 11271 var $0;
10882 return ("Not: " + this.temporaryId((($0 = node.inputs.$index(0)) && $0.is$HIns truction()))); 11272 return ("Not: " + this.temporaryId((($0 = node.inputs.$index(0)) == null ? nul l : $0.assert$HInstruction())));
10883 } 11273 }
10884 HInstructionStringifier.prototype.visitParameterValue = function(node) { 11274 HInstructionStringifier.prototype.visitParameterValue = function(node) {
10885 return ("p" + node.element.name); 11275 return ("p" + node.element.name);
10886 } 11276 }
10887 HInstructionStringifier.prototype.visitPhi = function(phi) { 11277 HInstructionStringifier.prototype.visitPhi = function(phi) {
10888 var $0; 11278 var $0;
10889 return ("Phi(" + this.temporaryId((($0 = phi.inputs.$index(0)) && $0.is$HInstr uction())) + ", " + this.temporaryId((($0 = phi.inputs.$index(1)) && $0.is$HInst ruction())) + ")"); 11279 return ("Phi(" + this.temporaryId((($0 = phi.inputs.$index(0)) == null ? null : $0.assert$HInstruction())) + ", " + this.temporaryId((($0 = phi.inputs.$index( 1)) == null ? null : $0.assert$HInstruction())) + ")");
10890 } 11280 }
10891 HInstructionStringifier.prototype.visitReturn = function(node) { 11281 HInstructionStringifier.prototype.visitReturn = function(node) {
10892 var $0; 11282 var $0;
10893 return ("Return " + this.temporaryId((($0 = node.inputs.$index(0)) && $0.is$HI nstruction()))); 11283 return ("Return " + this.temporaryId((($0 = node.inputs.$index(0)) == null ? n ull : $0.assert$HInstruction())));
10894 } 11284 }
10895 HInstructionStringifier.prototype.visitShiftLeft = function(node) { 11285 HInstructionStringifier.prototype.visitShiftLeft = function(node) {
10896 return this.visitInvoke(node); 11286 return this.visitInvoke(node);
10897 } 11287 }
10898 HInstructionStringifier.prototype.visitShiftRight = function(node) { 11288 HInstructionStringifier.prototype.visitShiftRight = function(node) {
10899 return this.visitInvoke(node); 11289 return this.visitInvoke(node);
10900 } 11290 }
10901 HInstructionStringifier.prototype.visitStore = function(node) { 11291 HInstructionStringifier.prototype.visitStore = function(node) {
10902 var $0; 11292 var $0;
10903 var localId = this.temporaryId((($0 = node.inputs.$index(0)) && $0.is$HInstruc tion())); 11293 var localId = this.temporaryId((($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstruction()));
10904 var valueId = this.temporaryId((($0 = node.inputs.$index(1)) && $0.is$HInstruc tion())); 11294 var valueId = this.temporaryId((($0 = node.inputs.$index(1)) == null ? null : $0.assert$HInstruction()));
10905 return ("Store: " + localId + " := " + valueId); 11295 return ("Store: " + localId + " := " + valueId);
10906 } 11296 }
10907 HInstructionStringifier.prototype.visitSubtract = function(node) { 11297 HInstructionStringifier.prototype.visitSubtract = function(node) {
10908 return this.visitInvoke(node); 11298 return this.visitInvoke(node);
10909 } 11299 }
10910 HInstructionStringifier.prototype.visitThrow = function(node) { 11300 HInstructionStringifier.prototype.visitThrow = function(node) {
10911 var $0; 11301 var $0;
10912 return ("Throw " + this.temporaryId((($0 = node.inputs.$index(0)) && $0.is$HIn struction()))); 11302 return ("Throw " + this.temporaryId((($0 = node.inputs.$index(0)) == null ? nu ll : $0.assert$HInstruction())));
10913 } 11303 }
10914 HInstructionStringifier.prototype.visitTruncatingDivide = function(node) { 11304 HInstructionStringifier.prototype.visitTruncatingDivide = function(node) {
10915 return this.visitInvoke(node); 11305 return this.visitInvoke(node);
10916 } 11306 }
10917 HInstructionStringifier.prototype.visitTypeGuard = function(node) { 11307 HInstructionStringifier.prototype.visitTypeGuard = function(node) {
10918 var $0; 11308 var $0;
10919 var type; 11309 var type;
10920 switch (node.type) { 11310 switch (node.type) {
10921 case 1/*HInstruction.TYPE_BOOLEAN*/: 11311 case 1/*HInstruction.TYPE_BOOLEAN*/:
10922 11312
10923 type = "bool"; 11313 type = "bool";
10924 break; 11314 break;
10925 11315
10926 case 2/*HInstruction.TYPE_NUMBER*/: 11316 case 2/*HInstruction.TYPE_NUMBER*/:
10927 11317
10928 type = "number"; 11318 type = "number";
10929 break; 11319 break;
10930 11320
10931 default: 11321 default:
10932 11322
10933 unreachable(); 11323 unreachable();
10934 11324
10935 } 11325 }
10936 return ("TypeGuard: " + this.temporaryId((($0 = node.inputs.$index(0)) && $0.i s$HInstruction())) + " is " + type); 11326 return ("TypeGuard: " + this.temporaryId((($0 = node.inputs.$index(0)) == null ? null : $0.assert$HInstruction())) + " is " + type);
10937 } 11327 }
10938 HInstructionStringifier.prototype.visit$1 = function($0) { 11328 HInstructionStringifier.prototype.visit$1 = function($0) {
10939 return this.visit(($0 && $0.is$HInstruction())); 11329 return this.visit(($0 == null ? null : $0.assert$HInstruction()));
10940 }; 11330 };
10941 // ********** Code for HValidator ************** 11331 // ********** Code for HValidator **************
10942 function HValidator() { 11332 function HValidator() {
10943 this.isValid = true 11333 this.isValid = true
10944 // Initializers done 11334 // Initializers done
10945 HInstructionVisitor.call(this); 11335 HInstructionVisitor.call(this);
10946 } 11336 }
10947 $inherits(HValidator, HInstructionVisitor); 11337 $inherits(HValidator, HInstructionVisitor);
10948 HValidator.prototype.visitGraph = function(graph) { 11338 HValidator.prototype.visitGraph = function(graph) {
10949 this.graph = graph; 11339 this.graph = graph;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
11034 } 11424 }
11035 if (!$notnull_bool(f.call$2(current, count))) return false; 11425 if (!$notnull_bool(f.call$2(current, count))) return false;
11036 } 11426 }
11037 return true; 11427 return true;
11038 } 11428 }
11039 HValidator.prototype.visitInstruction = function(instruction) { 11429 HValidator.prototype.visitInstruction = function(instruction) {
11040 var $this = this; // closure support 11430 var $this = this; // closure support
11041 function hasCorrectInputs(instruction) { 11431 function hasCorrectInputs(instruction) {
11042 var $0; 11432 var $0;
11043 var inBasicBlock = $assert_bool(instruction.isInBasicBlock$0()); 11433 var inBasicBlock = $assert_bool(instruction.isInBasicBlock$0());
11044 return HValidator.everyInstruction((($0 = instruction.get$inputs()) && $0.is $List_HInstruction()), (function (input, count) { 11434 return HValidator.everyInstruction((($0 = instruction.get$inputs()) == null ? null : $0.assert$List_HInstruction()), (function (input, count) {
11045 var $0; 11435 var $0;
11046 if ($notnull_bool(inBasicBlock)) { 11436 if ($notnull_bool(inBasicBlock)) {
11047 return HValidator.countInstruction((($0 = input.get$usedBy()) && $0.is$L ist_HInstruction()), (instruction && instruction.is$HInstruction())) == count; 11437 return HValidator.countInstruction((($0 = input.get$usedBy()) == null ? null : $0.assert$List_HInstruction()), (instruction == null ? null : instruction .assert$HInstruction())) == count;
11048 } 11438 }
11049 else { 11439 else {
11050 return HValidator.countInstruction((($0 = input.get$usedBy()) && $0.is$L ist_HInstruction()), (instruction && instruction.is$HInstruction())) == 0; 11440 return HValidator.countInstruction((($0 = input.get$usedBy()) == null ? null : $0.assert$List_HInstruction()), (instruction == null ? null : instruction .assert$HInstruction())) == 0;
11051 } 11441 }
11052 }) 11442 })
11053 ); 11443 );
11054 } 11444 }
11055 function hasCorrectUses(instruction) { 11445 function hasCorrectUses(instruction) {
11056 var $0; 11446 var $0;
11057 if (!$notnull_bool(instruction.isInBasicBlock$0())) return true; 11447 if (!$notnull_bool(instruction.isInBasicBlock$0())) return true;
11058 return HValidator.everyInstruction((($0 = instruction.get$usedBy()) && $0.is $List_HInstruction()), (function (use, count) { 11448 return HValidator.everyInstruction((($0 = instruction.get$usedBy()) == null ? null : $0.assert$List_HInstruction()), (function (use, count) {
11059 var $0; 11449 var $0;
11060 return HValidator.countInstruction((($0 = use.get$inputs()) && $0.is$List_ HInstruction()), (instruction && instruction.is$HInstruction())) == count; 11450 return HValidator.countInstruction((($0 = use.get$inputs()) == null ? null : $0.assert$List_HInstruction()), (instruction == null ? null : instruction.ass ert$HInstruction())) == count;
11061 }) 11451 })
11062 ); 11452 );
11063 } 11453 }
11064 if (instruction.block !== this.currentBlock) { 11454 if (instruction.block !== this.currentBlock) {
11065 this.markInvalid("Instruction in wrong block"); 11455 this.markInvalid("Instruction in wrong block");
11066 } 11456 }
11067 if (!$notnull_bool(hasCorrectInputs(instruction))) { 11457 if (!$notnull_bool(hasCorrectInputs(instruction))) {
11068 this.markInvalid("Incorrect inputs"); 11458 this.markInvalid("Incorrect inputs");
11069 } 11459 }
11070 if (!$notnull_bool(hasCorrectUses(instruction))) { 11460 if (!$notnull_bool(hasCorrectUses(instruction))) {
(...skipping 14 matching lines...) Expand all
11085 } 11475 }
11086 ValueSet.prototype.add = function(instruction) { 11476 ValueSet.prototype.add = function(instruction) {
11087 $assert(this.lookup(instruction) == null, "lookup(instruction) === null", "val ue_set.dart", 15, 12); 11477 $assert(this.lookup(instruction) == null, "lookup(instruction) === null", "val ue_set.dart", 15, 12);
11088 var index = this.tableIndexForInstruction(instruction); 11478 var index = this.tableIndexForInstruction(instruction);
11089 this.table.$setindex(index, new ValueSetNode(instruction, this.table.$index(in dex))); 11479 this.table.$setindex(index, new ValueSetNode(instruction, this.table.$index(in dex)));
11090 this.size++; 11480 this.size++;
11091 } 11481 }
11092 ValueSet.prototype.lookup = function(instruction) { 11482 ValueSet.prototype.lookup = function(instruction) {
11093 var $0; 11483 var $0;
11094 var index = this.tableIndexForInstruction(instruction); 11484 var index = this.tableIndexForInstruction(instruction);
11095 for (var node = (($0 = this.table.$index(index)) && $0.is$ValueSetNode()); 11485 for (var node = (($0 = this.table.$index(index)) == null ? null : $0.assert$Va lueSetNode());
11096 node != null; node = node.next) { 11486 node != null; node = node.next) {
11097 var cached = node.value; 11487 var cached = node.value;
11098 if ($notnull_bool(cached.equals(instruction))) return cached; 11488 if ($notnull_bool(cached.equals(instruction))) return cached;
11099 } 11489 }
11100 return null; 11490 return null;
11101 } 11491 }
11102 ValueSet.prototype.kill = function(flags) { 11492 ValueSet.prototype.kill = function(flags) {
11103 var $0; 11493 var $0;
11104 var depends = HInstruction.computeDependsOnFlags(flags); 11494 var depends = HInstruction.computeDependsOnFlags(flags);
11105 for (var i = 0, length = this.table.length; 11495 for (var i = 0, length = this.table.length;
11106 i < length; i++) { 11496 i < length; i++) {
11107 var previous = null; 11497 var previous = null;
11108 var current = (($0 = this.table.$index(i)) && $0.is$ValueSetNode()); 11498 var current = (($0 = this.table.$index(i)) == null ? null : $0.assert$ValueS etNode());
11109 while (current != null) { 11499 while (current != null) {
11110 var next = current.next; 11500 var next = current.next;
11111 var cached = current.value; 11501 var cached = current.value;
11112 if ((cached.flags & depends) != 0) { 11502 if ((cached.flags & depends) != 0) {
11113 if (previous == null) { 11503 if (previous == null) {
11114 this.table.$setindex(i, next); 11504 this.table.$setindex(i, next);
11115 } 11505 }
11116 else { 11506 else {
11117 previous.next = next; 11507 previous.next = next;
11118 } 11508 }
11119 this.size--; 11509 this.size--;
11120 } 11510 }
11121 else { 11511 else {
11122 previous = current; 11512 previous = current;
11123 } 11513 }
11124 current = next; 11514 current = next;
11125 } 11515 }
11126 } 11516 }
11127 } 11517 }
11128 ValueSet.prototype.copy = function() { 11518 ValueSet.prototype.copy = function() {
11129 var $0; 11519 var $0;
11130 var result = new ValueSet(); 11520 var result = new ValueSet();
11131 for (var i = 0, length = this.table.length; 11521 for (var i = 0, length = this.table.length;
11132 i < length; i++) { 11522 i < length; i++) {
11133 var current = (($0 = this.table.$index(i)) && $0.is$ValueSetNode()); 11523 var current = (($0 = this.table.$index(i)) == null ? null : $0.assert$ValueS etNode());
11134 while (current != null) { 11524 while (current != null) {
11135 result.add(current.value); 11525 result.add(current.value);
11136 current = current.next; 11526 current = current.next;
11137 } 11527 }
11138 } 11528 }
11139 return result; 11529 return result;
11140 } 11530 }
11141 ValueSet.prototype.tableIndexForInstruction = function(instruction) { 11531 ValueSet.prototype.tableIndexForInstruction = function(instruction) {
11142 return 0; 11532 return 0;
11143 } 11533 }
11144 ValueSet.prototype.add$1 = function($0) { 11534 ValueSet.prototype.add$1 = function($0) {
11145 return this.add(($0 && $0.is$HInstruction())); 11535 return this.add(($0 == null ? null : $0.assert$HInstruction()));
11146 }; 11536 };
11147 ValueSet.prototype.isEmpty$0 = ValueSet.prototype.isEmpty; 11537 ValueSet.prototype.isEmpty$0 = ValueSet.prototype.isEmpty;
11148 ValueSet.prototype.lookup$1 = function($0) { 11538 ValueSet.prototype.lookup$1 = function($0) {
11149 return this.lookup(($0 && $0.is$HInstruction())); 11539 return this.lookup(($0 == null ? null : $0.assert$HInstruction()));
11150 }; 11540 };
11151 // ********** Code for ValueSetNode ************** 11541 // ********** Code for ValueSetNode **************
11152 function ValueSetNode(value, next) { 11542 function ValueSetNode(value, next) {
11153 this.value = value; 11543 this.value = value;
11154 this.next = next; 11544 this.next = next;
11155 // Initializers done 11545 // Initializers done
11156 } 11546 }
11157 ValueSetNode.prototype.is$ValueSetNode = function(){return this;}; 11547 ValueSetNode.prototype.assert$ValueSetNode = function(){return this};
11158 ValueSetNode.prototype.get$value = function() { return this.value; }; 11548 ValueSetNode.prototype.get$value = function() { return this.value; };
11159 ValueSetNode.prototype.next$0 = function() { 11549 ValueSetNode.prototype.next$0 = function() {
11160 return this.next(); 11550 return this.next();
11161 }; 11551 };
11162 // ********** Code for top level ************** 11552 // ********** Code for top level **************
11163 // ********** Library leg ************** 11553 // ********** Library leg **************
11164 // ********** Code for Compiler ************** 11554 // ********** Code for Compiler **************
11165 function Compiler(script) { 11555 function Compiler(script) {
11166 this.script = script; 11556 this.script = script;
11167 // Initializers done 11557 // Initializers done
11168 this.universe = new Universe(); 11558 this.universe = new Universe();
11169 this.worklist = new DoubleLinkedQueue(); 11559 this.worklist = new DoubleLinkedQueue();
11170 this.scanner = new ScannerTask(this); 11560 this.scanner = new ScannerTask(this);
11171 this.parser = new ParserTask(this); 11561 this.parser = new ParserTask(this);
11172 this.resolver = new ResolverTask(this); 11562 this.resolver = new ResolverTask(this);
11173 this.checker = new TypeCheckerTask(this); 11563 this.checker = new TypeCheckerTask(this);
11174 this.builder = new SsaBuilderTask(this); 11564 this.builder = new SsaBuilderTask(this);
11175 this.optimizer = new SsaOptimizerTask(this); 11565 this.optimizer = new SsaOptimizerTask(this);
11176 this.generator = new SsaCodeGeneratorTask(this); 11566 this.generator = new SsaCodeGeneratorTask(this);
11177 this.tasks = [this.scanner, this.parser, this.resolver, this.checker, this.bui lder, this.optimizer, this.generator]; 11567 this.tasks = [this.scanner, this.parser, this.resolver, this.checker, this.bui lder, this.optimizer, this.generator];
11178 } 11568 }
11179 Compiler.prototype.is$Compiler = function(){return this;}; 11569 Compiler.prototype.assert$Compiler = function(){return this};
11180 Compiler.prototype.get$generator = function() { return this.generator; }; 11570 Compiler.prototype.get$generator = function() { return this.generator; };
11181 Compiler.prototype.set$generator = function(value) { return this.generator = val ue; }; 11571 Compiler.prototype.set$generator = function(value) { return this.generator = val ue; };
11182 Compiler.prototype.ensure = function(condition) { 11572 Compiler.prototype.ensure = function(condition) {
11183 if (!$notnull_bool(condition)) this.cancel('failed assertion in leg'); 11573 if (!$notnull_bool(condition)) this.cancel('failed assertion in leg');
11184 } 11574 }
11185 Compiler.prototype.unimplemented = function(methodName) { 11575 Compiler.prototype.unimplemented = function(methodName) {
11186 this.cancel(("" + methodName + " not implemented")); 11576 this.cancel(("" + methodName + " not implemented"));
11187 } 11577 }
11188 Compiler.prototype.cancel = function(reason, node, token, instruction) { 11578 Compiler.prototype.cancel = function(reason, node, token, instruction) {
11189 $throw(new CompilerCancelledException(reason)); 11579 $throw(new CompilerCancelledException(reason));
(...skipping 26 matching lines...) Expand all
11216 this.universe.define(element); 11606 this.universe.define(element);
11217 } 11607 }
11218 Compiler.prototype.runCompiler = function() { 11608 Compiler.prototype.runCompiler = function() {
11219 var $0; 11609 var $0;
11220 this.scanCoreLibrary(); 11610 this.scanCoreLibrary();
11221 this.scanner.scan(this.script); 11611 this.scanner.scan(this.script);
11222 var element = this.universe.find(const$221/*Compiler.MAIN*/); 11612 var element = this.universe.find(const$221/*Compiler.MAIN*/);
11223 if (element == null) this.cancel(('Could not find ' + const$221/*Compiler.MAIN */)); 11613 if (element == null) this.cancel(('Could not find ' + const$221/*Compiler.MAIN */));
11224 this.compileMethod(element); 11614 this.compileMethod(element);
11225 while (!this.worklist.isEmpty()) { 11615 while (!this.worklist.isEmpty()) {
11226 this.compileMethod((($0 = this.worklist.removeLast()) && $0.is$Element())); 11616 this.compileMethod((($0 = this.worklist.removeLast()) == null ? null : $0.as sert$Element()));
11227 } 11617 }
11228 } 11618 }
11229 Compiler.prototype.compileMethod = function(element) { 11619 Compiler.prototype.compileMethod = function(element) {
11230 var code = $assert_String(this.universe.generatedCode.$index(element)); 11620 var code = $assert_String(this.universe.generatedCode.$index(element));
11231 if (code != null) return code; 11621 if (code != null) return code;
11232 var tree = this.parser.parse(element); 11622 var tree = this.parser.parse(element);
11233 var elements = this.resolver.resolve((tree && tree.is$FunctionExpression())); 11623 var elements = this.resolver.resolve((tree == null ? null : tree.assert$Functi onExpression()));
11234 this.checker.check(tree, elements); 11624 this.checker.check(tree, elements);
11235 var graph = this.builder.build(tree, elements); 11625 var graph = this.builder.build(tree, elements);
11236 this.optimizer.optimize(graph); 11626 this.optimizer.optimize(graph);
11237 code = this.generator.generate((element && element.is$FunctionElement()), grap h); 11627 code = this.generator.generate((element == null ? null : element.assert$Functi onElement()), graph);
11238 this.universe.addGeneratedCode(element, code); 11628 this.universe.addGeneratedCode(element, code);
11239 return code; 11629 return code;
11240 } 11630 }
11241 Compiler.prototype.resolveType = function(element) { 11631 Compiler.prototype.resolveType = function(element) {
11242 var $0; 11632 var $0;
11243 this.resolver.resolveType((($0 = this.parser.parse(element)) && $0.is$ClassNod e())); 11633 this.resolver.resolveType((($0 = this.parser.parse(element)) == null ? null : $0.assert$ClassNode()));
11244 } 11634 }
11245 Compiler.prototype.resolveSignature = function(element) { 11635 Compiler.prototype.resolveSignature = function(element) {
11246 var $0; 11636 var $0;
11247 this.resolver.resolveSignature((($0 = this.parser.parse(element)) && $0.is$Fun ctionExpression())); 11637 this.resolver.resolveSignature((($0 = this.parser.parse(element)) == null ? nu ll : $0.assert$FunctionExpression()));
11248 } 11638 }
11249 Compiler.prototype.getGeneratedCode = function() { 11639 Compiler.prototype.getGeneratedCode = function() {
11250 var $0; 11640 var $0;
11251 var buffer = new StringBufferImpl(""); 11641 var buffer = new StringBufferImpl("");
11252 var codeBlocks = (($0 = this.universe.generatedCode.getValues()) && $0.is$List _String()); 11642 var codeBlocks = (($0 = this.universe.generatedCode.getValues()) == null ? nul l : $0.assert$List_String());
11253 for (var i = codeBlocks.length - 1; 11643 for (var i = codeBlocks.length - 1;
11254 i >= 0; i--) { 11644 i >= 0; i--) {
11255 buffer.add(codeBlocks.$index(i)); 11645 buffer.add(codeBlocks.$index(i));
11256 } 11646 }
11257 buffer.add('main();\n'); 11647 buffer.add('main();\n');
11258 return buffer.toString(); 11648 return buffer.toString();
11259 } 11649 }
11260 Compiler.prototype.reportWarning = function(node, message) { 11650 Compiler.prototype.reportWarning = function(node, message) {
11261 11651
11262 } 11652 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
11310 return (($0 = this.measure((function () { 11700 return (($0 = this.measure((function () {
11311 var visitor = new SignatureResolverVisitor($this.compiler); 11701 var visitor = new SignatureResolverVisitor($this.compiler);
11312 visitor.visit(tree); 11702 visitor.visit(tree);
11313 visitor = new FullResolverVisitor.from$ctor(visitor); 11703 visitor = new FullResolverVisitor.from$ctor(visitor);
11314 visitor.visit(tree.body); 11704 visitor.visit(tree.body);
11315 while (!$this.toResolve.isEmpty()) { 11705 while (!$this.toResolve.isEmpty()) {
11316 $this.toResolve.removeFirst().resolve$1($this.compiler); 11706 $this.toResolve.removeFirst().resolve$1($this.compiler);
11317 } 11707 }
11318 return visitor.mapping; 11708 return visitor.mapping;
11319 }) 11709 })
11320 )) && $0.is$Map_Node$Element()); 11710 )) == null ? null : $0.assert$Map_Node$Element());
11321 } 11711 }
11322 ResolverTask.prototype.resolveType = function(tree) { 11712 ResolverTask.prototype.resolveType = function(tree) {
11323 var $this = this; // closure support 11713 var $this = this; // closure support
11324 this.measure((function () { 11714 this.measure((function () {
11325 var visitor = new ClassResolverVisitor($this.compiler); 11715 var visitor = new ClassResolverVisitor($this.compiler);
11326 visitor.visit(tree); 11716 visitor.visit(tree);
11327 }) 11717 })
11328 ); 11718 );
11329 } 11719 }
11330 ResolverTask.prototype.resolveSignature = function(node) { 11720 ResolverTask.prototype.resolveSignature = function(node) {
11331 var $this = this; // closure support 11721 var $this = this; // closure support
11332 this.measure((function () { 11722 this.measure((function () {
11333 var visitor = new SignatureResolverVisitor($this.compiler); 11723 var visitor = new SignatureResolverVisitor($this.compiler);
11334 visitor.visitFunctionExpression(node); 11724 visitor.visitFunctionExpression(node);
11335 }) 11725 })
11336 ); 11726 );
11337 } 11727 }
11338 ResolverTask.prototype.resolve$1 = function($0) { 11728 ResolverTask.prototype.resolve$1 = function($0) {
11339 return this.resolve(($0 && $0.is$FunctionExpression())); 11729 return this.resolve(($0 == null ? null : $0.assert$FunctionExpression()));
11340 }; 11730 };
11341 // ********** Code for ResolverVisitor ************** 11731 // ********** Code for ResolverVisitor **************
11342 function ResolverVisitor(compiler) { 11732 function ResolverVisitor(compiler) {
11343 this.compiler = compiler; 11733 this.compiler = compiler;
11344 this.mapping = new LinkedHashMapImplementation(); 11734 this.mapping = new LinkedHashMapImplementation();
11345 this.context = new Scope(new TopScope(compiler.universe)); 11735 this.context = new Scope(new TopScope(compiler.universe));
11346 // Initializers done 11736 // Initializers done
11347 } 11737 }
11348 ResolverVisitor.from$ctor = function(other) { 11738 ResolverVisitor.from$ctor = function(other) {
11349 this.compiler = other.compiler; 11739 this.compiler = other.compiler;
11350 this.mapping = other.mapping; 11740 this.mapping = other.mapping;
11351 this.context = other.context; 11741 this.context = other.context;
11352 // Initializers done 11742 // Initializers done
11353 } 11743 }
11354 ResolverVisitor.from$ctor.prototype = ResolverVisitor.prototype; 11744 ResolverVisitor.from$ctor.prototype = ResolverVisitor.prototype;
11355 ResolverVisitor.prototype.is$Visitor = function(){return this;}; 11745 ResolverVisitor.prototype.assert$Visitor = function(){return this};
11356 ResolverVisitor.prototype.error = function(node, kind, arguments) { 11746 ResolverVisitor.prototype.error = function(node, kind, arguments) {
11357 var error = new ResolutionError(kind, (arguments && arguments.is$List_Type())) ; 11747 var error = new ResolutionError(kind, (arguments == null ? null : arguments.as sert$List_Type()));
11358 this.compiler.cancel(error.toString()); 11748 this.compiler.cancel(error.toString());
11359 } 11749 }
11360 ResolverVisitor.prototype.warning = function(node, kind, arguments) { 11750 ResolverVisitor.prototype.warning = function(node, kind, arguments) {
11361 var warning = new ResolutionWarning(kind, (arguments && arguments.is$List_Type ())); 11751 var warning = new ResolutionWarning(kind, (arguments == null ? null : argument s.assert$List_Type()));
11362 this.compiler.reportWarning(node, warning); 11752 this.compiler.reportWarning(node, warning);
11363 } 11753 }
11364 ResolverVisitor.prototype.cancel = function(node, message) { 11754 ResolverVisitor.prototype.cancel = function(node, message) {
11365 this.compiler.cancel(message); 11755 this.compiler.cancel(message);
11366 } 11756 }
11367 ResolverVisitor.prototype.visit = function(node) { 11757 ResolverVisitor.prototype.visit = function(node) {
11368 if (node == null) return null; 11758 if (node == null) return null;
11369 return node.accept(this); 11759 return node.accept(this);
11370 } 11760 }
11371 ResolverVisitor.prototype.visitIdentifier = function(node) { 11761 ResolverVisitor.prototype.visitIdentifier = function(node) {
11372 var element = this.context.lookup(node.get$source()); 11762 var element = this.context.lookup(node.get$source());
11373 if (element == null) { 11763 if (element == null) {
11374 this.error(node, const$225/*MessageKind.CANNOT_RESOLVE*/, [node]); 11764 this.error(node, const$225/*MessageKind.CANNOT_RESOLVE*/, [node]);
11375 } 11765 }
11376 return this.useElement(node, element); 11766 return this.useElement(node, element);
11377 } 11767 }
11378 ResolverVisitor.prototype.visitTypeAnnotation = function(node) { 11768 ResolverVisitor.prototype.visitTypeAnnotation = function(node) {
11379 var name = node.typeName; 11769 var name = node.typeName;
11380 if ($notnull_bool($eq(name.get$source(), const$227/*const SourceString('var')* /))) return null; 11770 if ($notnull_bool($eq(name.get$source(), const$227/*const SourceString('var')* /))) return null;
11381 if ($notnull_bool($eq(name.get$source(), const$6/*const SourceString('void')*/ ))) return null; 11771 if ($notnull_bool($eq(name.get$source(), const$6/*const SourceString('void')*/ ))) return null;
11382 var element = this.context.lookup(name.get$source()); 11772 var element = this.context.lookup(name.get$source());
11383 if (element == null) { 11773 if (element == null) {
11384 this.warning(node, const$228/*MessageKind.CANNOT_RESOLVE_TYPE*/, [name]); 11774 this.warning(node, const$228/*MessageKind.CANNOT_RESOLVE_TYPE*/, [name]);
11385 } 11775 }
11386 else if (element.kind !== const$214/*ElementKind.CLASS*/) { 11776 else if (element.kind !== const$214/*ElementKind.CLASS*/) {
11387 this.warning(node, const$230/*MessageKind.NOT_A_TYPE*/, [name]); 11777 this.warning(node, const$230/*MessageKind.NOT_A_TYPE*/, [name]);
11388 } 11778 }
11389 else { 11779 else {
11390 var cls = (element && element.is$ClassElement()); 11780 var cls = (element == null ? null : element.assert$ClassElement());
11391 this.compiler.resolver.toResolve.add(element); 11781 this.compiler.resolver.toResolve.add(element);
11392 } 11782 }
11393 return this.useElement(node, element); 11783 return this.useElement(node, element);
11394 } 11784 }
11395 ResolverVisitor.prototype.defineElement = function(node, element) { 11785 ResolverVisitor.prototype.defineElement = function(node, element) {
11396 this.compiler.ensure(element != null); 11786 this.compiler.ensure(element != null);
11397 this.mapping.$setindex(node, element); 11787 this.mapping.$setindex(node, element);
11398 var existing = this.context.add(element); 11788 var existing = this.context.add(element);
11399 if ($ne(existing, element)) { 11789 if ($ne(existing, element)) {
11400 this.error(node, const$234/*MessageKind.DUPLICATE_DEFINITION*/, [node]); 11790 this.error(node, const$234/*MessageKind.DUPLICATE_DEFINITION*/, [node]);
11401 } 11791 }
11402 return element; 11792 return element;
11403 } 11793 }
11404 ResolverVisitor.prototype.useElement = function(node, element) { 11794 ResolverVisitor.prototype.useElement = function(node, element) {
11405 if (element == null) return null; 11795 if (element == null) return null;
11406 this.mapping.$setindex(node, element); 11796 this.mapping.$setindex(node, element);
11407 return element; 11797 return element;
11408 } 11798 }
11409 ResolverVisitor.prototype.visit$1 = function($0) { 11799 ResolverVisitor.prototype.visit$1 = function($0) {
11410 return this.visit(($0 && $0.is$Node())); 11800 return this.visit(($0 == null ? null : $0.assert$Node()));
11411 }; 11801 };
11412 // ********** Code for SignatureResolverVisitor ************** 11802 // ********** Code for SignatureResolverVisitor **************
11413 function SignatureResolverVisitor(compiler) { 11803 function SignatureResolverVisitor(compiler) {
11414 // Initializers done 11804 // Initializers done
11415 ResolverVisitor.call(this, compiler); 11805 ResolverVisitor.call(this, compiler);
11416 } 11806 }
11417 $inherits(SignatureResolverVisitor, ResolverVisitor); 11807 $inherits(SignatureResolverVisitor, ResolverVisitor);
11418 SignatureResolverVisitor.prototype.visitFunctionExpression = function(node) { 11808 SignatureResolverVisitor.prototype.visitFunctionExpression = function(node) {
11419 var $0; 11809 var $0;
11420 var enclosingElement = (($0 = this.context.lookup((($0 = node.name.get$dynamic ().get$source()) && $0.is$SourceString()))) && $0.is$FunctionElement()); 11810 var enclosingElement = (($0 = this.context.lookup((($0 = node.name.get$dynamic ().get$source()) == null ? null : $0.assert$SourceString()))) == null ? null : $ 0.assert$FunctionElement());
11421 this.useElement(node, enclosingElement); 11811 this.useElement(node, enclosingElement);
11422 this.context = new Scope.enclosing$ctor(this.context, enclosingElement); 11812 this.context = new Scope.enclosing$ctor(this.context, enclosingElement);
11423 if (enclosingElement.parameters == null) { 11813 if (enclosingElement.parameters == null) {
11424 var visitor = new ParametersVisitor(this); 11814 var visitor = new ParametersVisitor(this);
11425 visitor.visit(node.parameters); 11815 visitor.visit(node.parameters);
11426 enclosingElement.parameters = (($0 = visitor.elements.toLink()) && $0.is$Lin k_Element()); 11816 enclosingElement.parameters = (($0 = visitor.elements.toLink()) == null ? nu ll : $0.assert$Link_Element());
11427 } 11817 }
11428 else { 11818 else {
11429 var parameterNodes = node.parameters.get$nodes(); 11819 var parameterNodes = node.parameters.get$nodes();
11430 for (var link = enclosingElement.parameters; 11820 for (var link = enclosingElement.parameters;
11431 !$notnull_bool(link.isEmpty()) && !$notnull_bool(parameterNodes.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_Element()), parameterNodes = (($0 = parameterNodes.get$tail()) && $0.is$Link_Node())) { 11821 !$notnull_bool(link.isEmpty()) && !$notnull_bool(parameterNodes.isEmpty()); link = (($0 = link.get$tail()) == null ? null : $0.assert$Link_Element()), para meterNodes = (($0 = parameterNodes.get$tail()) == null ? null : $0.assert$Link_N ode())) {
11432 this.defineElement((($0 = parameterNodes.get$head().get$definitions().get$ nodes().get$head()) && $0.is$Node()), (($0 = link.get$head()) && $0.is$Element() )); 11822 this.defineElement((($0 = parameterNodes.get$head().get$definitions().get$ nodes().get$head()) == null ? null : $0.assert$Node()), (($0 = link.get$head()) == null ? null : $0.assert$Element()));
11433 } 11823 }
11434 } 11824 }
11435 return enclosingElement; 11825 return enclosingElement;
11436 } 11826 }
11437 // ********** Code for FullResolverVisitor ************** 11827 // ********** Code for FullResolverVisitor **************
11438 function FullResolverVisitor() {} 11828 function FullResolverVisitor() {}
11439 FullResolverVisitor.from$ctor = function(other) { 11829 FullResolverVisitor.from$ctor = function(other) {
11440 // Initializers done 11830 // Initializers done
11441 ResolverVisitor.from$ctor.call(this, other); 11831 ResolverVisitor.from$ctor.call(this, other);
11442 } 11832 }
11443 FullResolverVisitor.from$ctor.prototype = FullResolverVisitor.prototype; 11833 FullResolverVisitor.from$ctor.prototype = FullResolverVisitor.prototype;
11444 $inherits(FullResolverVisitor, ResolverVisitor); 11834 $inherits(FullResolverVisitor, ResolverVisitor);
11445 FullResolverVisitor.prototype.visitClassNode = function(node) { 11835 FullResolverVisitor.prototype.visitClassNode = function(node) {
11446 this.cancel(node, "shouldn't be called"); 11836 this.cancel(node, "shouldn't be called");
11447 } 11837 }
11448 FullResolverVisitor.prototype.visitIn = function(node, scope) { 11838 FullResolverVisitor.prototype.visitIn = function(node, scope) {
11449 var $0; 11839 var $0;
11450 this.context = scope; 11840 this.context = scope;
11451 var element = (($0 = this.visit(node)) && $0.is$Element()); 11841 var element = (($0 = this.visit(node)) == null ? null : $0.assert$Element());
11452 this.context = this.context.parent; 11842 this.context = this.context.parent;
11453 return element; 11843 return element;
11454 } 11844 }
11455 FullResolverVisitor.prototype.visitBlock = function(node) { 11845 FullResolverVisitor.prototype.visitBlock = function(node) {
11456 this.visitIn(node.statements, new Scope(this.context)); 11846 this.visitIn(node.statements, new Scope(this.context));
11457 } 11847 }
11458 FullResolverVisitor.prototype.visitDoWhile = function(node) { 11848 FullResolverVisitor.prototype.visitDoWhile = function(node) {
11459 this.visitIn(node.body, new Scope(this.context)); 11849 this.visitIn(node.body, new Scope(this.context));
11460 this.visit(node.condition); 11850 this.visit(node.condition);
11461 } 11851 }
11462 FullResolverVisitor.prototype.visitExpressionStatement = function(node) { 11852 FullResolverVisitor.prototype.visitExpressionStatement = function(node) {
11463 this.visit(node.expression); 11853 this.visit(node.expression);
11464 } 11854 }
11465 FullResolverVisitor.prototype.visitFor = function(node) { 11855 FullResolverVisitor.prototype.visitFor = function(node) {
11466 var scope = new Scope(this.context); 11856 var scope = new Scope(this.context);
11467 this.visitIn(node.initializer, scope); 11857 this.visitIn(node.initializer, scope);
11468 this.visitIn(node.get$condition(), scope); 11858 this.visitIn(node.get$condition(), scope);
11469 this.visitIn(node.update, scope); 11859 this.visitIn(node.update, scope);
11470 this.visitIn(node.body, scope); 11860 this.visitIn(node.body, scope);
11471 } 11861 }
11472 FullResolverVisitor.prototype.visitFunctionExpression = function(node) { 11862 FullResolverVisitor.prototype.visitFunctionExpression = function(node) {
11473 var $0; 11863 var $0;
11474 this.visit(node.returnType); 11864 this.visit(node.returnType);
11475 var enclosingElement = new FunctionElement.node$ctor(node, this.context.enclos ingElement); 11865 var enclosingElement = new FunctionElement.node$ctor(node, this.context.enclos ingElement);
11476 this.defineElement(node, enclosingElement); 11866 this.defineElement(node, enclosingElement);
11477 this.context = new Scope.enclosing$ctor(this.context, enclosingElement); 11867 this.context = new Scope.enclosing$ctor(this.context, enclosingElement);
11478 var visitor = new ParametersVisitor(this); 11868 var visitor = new ParametersVisitor(this);
11479 visitor.visit(node.parameters); 11869 visitor.visit(node.parameters);
11480 enclosingElement.parameters = (($0 = visitor.elements.toLink()) && $0.is$Link_ Element()); 11870 enclosingElement.parameters = (($0 = visitor.elements.toLink()) == null ? null : $0.assert$Link_Element());
11481 this.visit(node.body); 11871 this.visit(node.body);
11482 this.context = this.context.parent; 11872 this.context = this.context.parent;
11483 return enclosingElement; 11873 return enclosingElement;
11484 } 11874 }
11485 FullResolverVisitor.prototype.visitIf = function(node) { 11875 FullResolverVisitor.prototype.visitIf = function(node) {
11486 this.visit(node.condition); 11876 this.visit(node.condition);
11487 this.visit(node.thenPart); 11877 this.visit(node.thenPart);
11488 this.visit(node.elsePart); 11878 this.visit(node.elsePart);
11489 } 11879 }
11490 FullResolverVisitor.prototype.potentiallyMapOperatorToMethodName = function(name , isPrefix) { 11880 FullResolverVisitor.prototype.potentiallyMapOperatorToMethodName = function(name , isPrefix) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
11524 if (name.get$stringValue() === '|=') return const$248/*const SourceString('or' )*/; 11914 if (name.get$stringValue() === '|=') return const$248/*const SourceString('or' )*/;
11525 if (name.get$stringValue() === '&=') return const$249/*const SourceString('and ')*/; 11915 if (name.get$stringValue() === '&=') return const$249/*const SourceString('and ')*/;
11526 if (name.get$stringValue() === '^=') return const$250/*const SourceString('xor ')*/; 11916 if (name.get$stringValue() === '^=') return const$250/*const SourceString('xor ')*/;
11527 if (name.get$stringValue() === '++') return const$240/*const SourceString('add ')*/; 11917 if (name.get$stringValue() === '++') return const$240/*const SourceString('add ')*/;
11528 if (name.get$stringValue() === '--') return const$241/*const SourceString('sub ')*/; 11918 if (name.get$stringValue() === '--') return const$241/*const SourceString('sub ')*/;
11529 this.compiler.unimplemented(("mapAssignmentOperatorToMethodName: " + name)); 11919 this.compiler.unimplemented(("mapAssignmentOperatorToMethodName: " + name));
11530 } 11920 }
11531 FullResolverVisitor.prototype.visitSend = function(node) { 11921 FullResolverVisitor.prototype.visitSend = function(node) {
11532 var $0; 11922 var $0;
11533 this.visit(node.receiver); 11923 this.visit(node.receiver);
11534 var identifier = (($0 = node.selector) && $0.is$Identifier()); 11924 var identifier = (($0 = node.selector) == null ? null : $0.assert$Identifier() );
11535 if (node.receiver != null && !(identifier instanceof Operator)) { 11925 if (node.receiver != null && !(identifier instanceof Operator)) {
11536 this.cancel(node, 'Cannot handle qualified method calls'); 11926 this.cancel(node, 'Cannot handle qualified method calls');
11537 } 11927 }
11538 var name = this.potentiallyMapOperatorToMethodName(identifier.get$source(), no de.get$isPrefix()); 11928 var name = this.potentiallyMapOperatorToMethodName(identifier.get$source(), no de.get$isPrefix());
11539 var target = this.context.lookup(name); 11929 var target = this.context.lookup(name);
11540 if (target == null && !((name.get$stringValue() === '&&' || name.get$stringVal ue() === '||' || name.get$stringValue() === '!'))) { 11930 if (target == null && !((name.get$stringValue() === '&&' || name.get$stringVal ue() === '||' || name.get$stringValue() === '!'))) {
11541 this.error(node, const$225/*MessageKind.CANNOT_RESOLVE*/, [name]); 11931 this.error(node, const$225/*MessageKind.CANNOT_RESOLVE*/, [name]);
11542 } 11932 }
11543 this.visit(node.argumentsNode); 11933 this.visit(node.argumentsNode);
11544 return this.useElement(node, target); 11934 return this.useElement(node, target);
11545 } 11935 }
11546 FullResolverVisitor.prototype.visitSendSet = function(node) { 11936 FullResolverVisitor.prototype.visitSendSet = function(node) {
11547 var $0; 11937 var $0;
11548 var receiver = (($0 = this.visit(node.receiver)) && $0.is$Element()); 11938 var receiver = (($0 = this.visit(node.receiver)) == null ? null : $0.assert$El ement());
11549 var selector = (($0 = node.selector) && $0.is$Identifier()); 11939 var selector = (($0 = node.selector) == null ? null : $0.assert$Identifier());
11550 if (receiver != null) { 11940 if (receiver != null) {
11551 this.compiler.unimplemented('Resolver: property access'); 11941 this.compiler.unimplemented('Resolver: property access');
11552 } 11942 }
11553 var target = this.context.lookup(selector.get$source()); 11943 var target = this.context.lookup(selector.get$source());
11554 if (target == null) { 11944 if (target == null) {
11555 this.error(node, const$225/*MessageKind.CANNOT_RESOLVE*/, [node]); 11945 this.error(node, const$225/*MessageKind.CANNOT_RESOLVE*/, [node]);
11556 } 11946 }
11557 var op = node.assignmentOperator; 11947 var op = node.assignmentOperator;
11558 if (op.get$source().get$stringValue() !== '=') { 11948 if (op.get$source().get$stringValue() !== '=') {
11559 var name = this.mapAssignmentOperatorToMethodName(op.get$source()); 11949 var name = this.mapAssignmentOperatorToMethodName(op.get$source());
(...skipping 16 matching lines...) Expand all
11576 } 11966 }
11577 FullResolverVisitor.prototype.visitLiteralString = function(node) { 11967 FullResolverVisitor.prototype.visitLiteralString = function(node) {
11578 11968
11579 } 11969 }
11580 FullResolverVisitor.prototype.visitLiteralNull = function(node) { 11970 FullResolverVisitor.prototype.visitLiteralNull = function(node) {
11581 11971
11582 } 11972 }
11583 FullResolverVisitor.prototype.visitNodeList = function(node) { 11973 FullResolverVisitor.prototype.visitNodeList = function(node) {
11584 var $0; 11974 var $0;
11585 for (var link = node.get$nodes(); 11975 for (var link = node.get$nodes();
11586 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_ Node())) { 11976 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == null ? null : $0.assert$Link_Node())) {
11587 this.visit((($0 = link.get$head()) && $0.is$Node())); 11977 this.visit((($0 = link.get$head()) == null ? null : $0.assert$Node()));
11588 } 11978 }
11589 } 11979 }
11590 FullResolverVisitor.prototype.visitOperator = function(node) { 11980 FullResolverVisitor.prototype.visitOperator = function(node) {
11591 this.cancel(node, "Unimplemented"); 11981 this.cancel(node, "Unimplemented");
11592 } 11982 }
11593 FullResolverVisitor.prototype.visitReturn = function(node) { 11983 FullResolverVisitor.prototype.visitReturn = function(node) {
11594 this.visit(node.expression); 11984 this.visit(node.expression);
11595 } 11985 }
11596 FullResolverVisitor.prototype.visitThrow = function(node) { 11986 FullResolverVisitor.prototype.visitThrow = function(node) {
11597 this.visit(node.expression); 11987 this.visit(node.expression);
(...skipping 13 matching lines...) Expand all
11611 // ********** Code for ClassResolverVisitor ************** 12001 // ********** Code for ClassResolverVisitor **************
11612 function ClassResolverVisitor(compiler) { 12002 function ClassResolverVisitor(compiler) {
11613 this.compiler = compiler; 12003 this.compiler = compiler;
11614 this.context = new TopScope(compiler.universe); 12004 this.context = new TopScope(compiler.universe);
11615 // Initializers done 12005 // Initializers done
11616 AbstractVisitor_Type.call(this); 12006 AbstractVisitor_Type.call(this);
11617 } 12007 }
11618 $inherits(ClassResolverVisitor, AbstractVisitor_Type); 12008 $inherits(ClassResolverVisitor, AbstractVisitor_Type);
11619 ClassResolverVisitor.prototype.visitClassNode = function(node) { 12009 ClassResolverVisitor.prototype.visitClassNode = function(node) {
11620 var $0; 12010 var $0;
11621 var element = (($0 = this.context.lookup(node.name.get$source())) && $0.is$Cla ssElement()); 12011 var element = (($0 = this.context.lookup(node.name.get$source())) == null ? nu ll : $0.assert$ClassElement());
11622 this.compiler.ensure(element != null); 12012 this.compiler.ensure(element != null);
11623 this.compiler.ensure(!$notnull_bool(element.isResolved)); 12013 this.compiler.ensure(!$notnull_bool(element.isResolved));
11624 element.supertype = this.visit(node.superclass); 12014 element.supertype = this.visit(node.superclass);
11625 for (var link = node.interfaces.get$nodes(); 12015 for (var link = node.interfaces.get$nodes();
11626 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_ Node())) { 12016 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == null ? null : $0.assert$Link_Node())) {
11627 element.interfaces = (($0 = element.interfaces.prepend(this.visit((($0 = lin k.get$head()) && $0.is$Node())))) && $0.is$Link_Type()); 12017 element.interfaces = (($0 = element.interfaces.prepend(this.visit((($0 = lin k.get$head()) == null ? null : $0.assert$Node())))) == null ? null : $0.assert$L ink_Type());
11628 } 12018 }
11629 return element.computeType(this.compiler, null); 12019 return element.computeType(this.compiler, null);
11630 } 12020 }
11631 ClassResolverVisitor.prototype.visitTypeAnnotation = function(node) { 12021 ClassResolverVisitor.prototype.visitTypeAnnotation = function(node) {
11632 var $0; 12022 var $0;
11633 var name = node.typeName; 12023 var name = node.typeName;
11634 var element = this.context.lookup(name.get$source()); 12024 var element = this.context.lookup(name.get$source());
11635 if (element == null) { 12025 if (element == null) {
11636 this.compiler.cancel(new ResolutionError(const$228/*MessageKind.CANNOT_RESOL VE_TYPE*/, [name]).toString()); 12026 this.compiler.cancel(new ResolutionError(const$228/*MessageKind.CANNOT_RESOL VE_TYPE*/, [name]).toString());
11637 } 12027 }
11638 else if (element.kind !== const$214/*ElementKind.CLASS*/) { 12028 else if (element.kind !== const$214/*ElementKind.CLASS*/) {
11639 this.compiler.cancel(new ResolutionError(const$230/*MessageKind.NOT_A_TYPE*/ , [name]).toString()); 12029 this.compiler.cancel(new ResolutionError(const$230/*MessageKind.NOT_A_TYPE*/ , [name]).toString());
11640 } 12030 }
11641 else { 12031 else {
11642 this.compiler.resolver.toResolve.add(element); 12032 this.compiler.resolver.toResolve.add(element);
11643 return (($0 = element.computeType(this.compiler, null)) && $0.is$Type()); 12033 return (($0 = element.computeType(this.compiler, null)) == null ? null : $0. assert$Type());
11644 } 12034 }
11645 return null; 12035 return null;
11646 } 12036 }
11647 ClassResolverVisitor.prototype.visit = function(node) { 12037 ClassResolverVisitor.prototype.visit = function(node) {
11648 var $0; 12038 var $0;
11649 if (node == null) return null; 12039 if (node == null) return null;
11650 return (($0 = node.accept(this)) && $0.is$Type()); 12040 return (($0 = node.accept(this)) == null ? null : $0.assert$Type());
11651 } 12041 }
11652 ClassResolverVisitor.prototype.visitNode = function(node) { 12042 ClassResolverVisitor.prototype.visitNode = function(node) {
11653 this.compiler.cancel('internal error'); 12043 this.compiler.cancel('internal error');
11654 } 12044 }
11655 ClassResolverVisitor.prototype.visit$1 = function($0) { 12045 ClassResolverVisitor.prototype.visit$1 = function($0) {
11656 return this.visit(($0 && $0.is$Node())); 12046 return this.visit(($0 == null ? null : $0.assert$Node()));
11657 }; 12047 };
11658 // ********** Code for VariableDefinitionsVisitor ************** 12048 // ********** Code for VariableDefinitionsVisitor **************
11659 function VariableDefinitionsVisitor(definitions, resolver, kind) { 12049 function VariableDefinitionsVisitor(definitions, resolver, kind) {
11660 this.definitions = definitions; 12050 this.definitions = definitions;
11661 this.resolver = resolver; 12051 this.resolver = resolver;
11662 this.kind = kind; 12052 this.kind = kind;
11663 // Initializers done 12053 // Initializers done
11664 AbstractVisitor_SourceString.call(this); 12054 AbstractVisitor_SourceString.call(this);
11665 } 12055 }
11666 $inherits(VariableDefinitionsVisitor, AbstractVisitor_SourceString); 12056 $inherits(VariableDefinitionsVisitor, AbstractVisitor_SourceString);
11667 VariableDefinitionsVisitor.prototype.get$definitions = function() { return this. definitions; }; 12057 VariableDefinitionsVisitor.prototype.get$definitions = function() { return this. definitions; };
11668 VariableDefinitionsVisitor.prototype.set$definitions = function(value) { return this.definitions = value; }; 12058 VariableDefinitionsVisitor.prototype.set$definitions = function(value) { return this.definitions = value; };
11669 VariableDefinitionsVisitor.prototype.get$kind = function() { return this.kind; } ; 12059 VariableDefinitionsVisitor.prototype.get$kind = function() { return this.kind; } ;
11670 VariableDefinitionsVisitor.prototype.set$kind = function(value) { return this.ki nd = value; }; 12060 VariableDefinitionsVisitor.prototype.set$kind = function(value) { return this.ki nd = value; };
11671 VariableDefinitionsVisitor.prototype.visitSendSet = function(node) { 12061 VariableDefinitionsVisitor.prototype.visitSendSet = function(node) {
11672 var $0; 12062 var $0;
11673 $assert(node.get$arguments().get$tail().isEmpty$0(), "node.arguments.tail.isEm pty()", "resolver.dart", 417, 12); 12063 $assert(node.get$arguments().get$tail().isEmpty$0(), "node.arguments.tail.isEm pty()", "resolver.dart", 417, 12);
11674 if (node.receiver != null) { 12064 if (node.receiver != null) {
11675 this.resolver.cancel(node, "receiver on a variable definition not implemente d"); 12065 this.resolver.cancel(node, "receiver on a variable definition not implemente d");
11676 } 12066 }
11677 var selector = (($0 = node.selector) && $0.is$Identifier()); 12067 var selector = (($0 = node.selector) == null ? null : $0.assert$Identifier());
11678 this.resolver.visit((($0 = node.get$arguments().get$head()) && $0.is$Node())); 12068 this.resolver.visit((($0 = node.get$arguments().get$head()) == null ? null : $ 0.assert$Node()));
11679 return (($0 = this.visit(node.selector)) && $0.is$SourceString()); 12069 return (($0 = this.visit(node.selector)) == null ? null : $0.assert$SourceStri ng());
11680 } 12070 }
11681 VariableDefinitionsVisitor.prototype.visitIdentifier = function(node) { 12071 VariableDefinitionsVisitor.prototype.visitIdentifier = function(node) {
11682 return node.get$source(); 12072 return node.get$source();
11683 } 12073 }
11684 VariableDefinitionsVisitor.prototype.visitNodeList = function(node) { 12074 VariableDefinitionsVisitor.prototype.visitNodeList = function(node) {
11685 var $0; 12075 var $0;
11686 for (var link = node.get$nodes(); 12076 for (var link = node.get$nodes();
11687 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_ Node())) { 12077 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == null ? null : $0.assert$Link_Node())) {
11688 var name = (($0 = this.visit((($0 = link.get$head()) && $0.is$Node()))) && $ 0.is$SourceString()); 12078 var name = (($0 = this.visit((($0 = link.get$head()) == null ? null : $0.ass ert$Node()))) == null ? null : $0.assert$SourceString());
11689 var element = new VariableElement((($0 = link.get$head()) && $0.is$Node()), this.definitions.type, this.kind, name, this.resolver.context.enclosingElement); 12079 var element = new VariableElement((($0 = link.get$head()) == null ? null : $ 0.assert$Node()), this.definitions.type, this.kind, name, this.resolver.context. enclosingElement);
11690 this.resolver.defineElement((($0 = link.get$head()) && $0.is$Node()), elemen t); 12080 this.resolver.defineElement((($0 = link.get$head()) == null ? null : $0.asse rt$Node()), element);
11691 } 12081 }
11692 } 12082 }
11693 VariableDefinitionsVisitor.prototype.visit = function(node) { 12083 VariableDefinitionsVisitor.prototype.visit = function(node) {
11694 return node.accept(this); 12084 return node.accept(this);
11695 } 12085 }
11696 VariableDefinitionsVisitor.prototype.visit$1 = function($0) { 12086 VariableDefinitionsVisitor.prototype.visit$1 = function($0) {
11697 return this.visit(($0 && $0.is$Node())); 12087 return this.visit(($0 == null ? null : $0.assert$Node()));
11698 }; 12088 };
11699 // ********** Code for ParametersVisitor ************** 12089 // ********** Code for ParametersVisitor **************
11700 function ParametersVisitor(resolver) { 12090 function ParametersVisitor(resolver) {
11701 this.resolver = resolver; 12091 this.resolver = resolver;
11702 this.elements = new LinkBuilderImplementation(); 12092 this.elements = new LinkBuilderImplementation();
11703 // Initializers done 12093 // Initializers done
11704 AbstractVisitor_Element.call(this); 12094 AbstractVisitor_Element.call(this);
11705 } 12095 }
11706 $inherits(ParametersVisitor, AbstractVisitor_Element); 12096 $inherits(ParametersVisitor, AbstractVisitor_Element);
11707 ParametersVisitor.prototype.visitNodeList = function(node) { 12097 ParametersVisitor.prototype.visitNodeList = function(node) {
11708 var $0; 12098 var $0;
11709 for (var link = node.get$nodes(); 12099 for (var link = node.get$nodes();
11710 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_ Node())) { 12100 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == null ? null : $0.assert$Link_Node())) {
11711 this.elements.addLast(this.visit((($0 = link.get$head()) && $0.is$Node()))); 12101 this.elements.addLast(this.visit((($0 = link.get$head()) == null ? null : $0 .assert$Node())));
11712 } 12102 }
11713 } 12103 }
11714 ParametersVisitor.prototype.visitVariableDefinitions = function(node) { 12104 ParametersVisitor.prototype.visitVariableDefinitions = function(node) {
11715 this.resolver.visit(node.type); 12105 this.resolver.visit(node.type);
11716 var visitor = new VariableDefinitionsVisitor(node, this.resolver, const$232/*E lementKind.PARAMETER*/); 12106 var visitor = new VariableDefinitionsVisitor(node, this.resolver, const$232/*E lementKind.PARAMETER*/);
11717 visitor.visit(node.definitions); 12107 visitor.visit(node.definitions);
11718 return this.resolver.mapping.$index(node.definitions.get$nodes().get$head()); 12108 return this.resolver.mapping.$index(node.definitions.get$nodes().get$head());
11719 } 12109 }
11720 ParametersVisitor.prototype.visit = function(node) { 12110 ParametersVisitor.prototype.visit = function(node) {
11721 return node.accept(this); 12111 return node.accept(this);
11722 } 12112 }
11723 ParametersVisitor.prototype.visit$1 = function($0) { 12113 ParametersVisitor.prototype.visit$1 = function($0) {
11724 return this.visit(($0 && $0.is$Node())); 12114 return this.visit(($0 == null ? null : $0.assert$Node()));
11725 }; 12115 };
11726 // ********** Code for Scope ************** 12116 // ********** Code for Scope **************
11727 function Scope(parent) { 12117 function Scope(parent) {
11728 // Initializers done 12118 // Initializers done
11729 Scope.enclosing$ctor.call(this, parent, parent.enclosingElement); 12119 Scope.enclosing$ctor.call(this, parent, parent.enclosingElement);
11730 } 12120 }
11731 Scope.top$ctor = function() { 12121 Scope.top$ctor = function() {
11732 this.parent = null; 12122 this.parent = null;
11733 this.elements = const$224/*const {}*/; 12123 this.elements = const$224/*const {}*/;
11734 this.enclosingElement = null; 12124 this.enclosingElement = null;
11735 // Initializers done 12125 // Initializers done
11736 } 12126 }
11737 Scope.top$ctor.prototype = Scope.prototype; 12127 Scope.top$ctor.prototype = Scope.prototype;
11738 Scope.enclosing$ctor = function(parent, enclosingElement) { 12128 Scope.enclosing$ctor = function(parent, enclosingElement) {
11739 this.parent = parent; 12129 this.parent = parent;
11740 this.enclosingElement = enclosingElement; 12130 this.enclosingElement = enclosingElement;
11741 this.elements = $map([]); 12131 this.elements = $map([]);
11742 // Initializers done 12132 // Initializers done
11743 } 12133 }
11744 Scope.enclosing$ctor.prototype = Scope.prototype; 12134 Scope.enclosing$ctor.prototype = Scope.prototype;
11745 Scope.prototype.get$parent = function() { return this.parent; }; 12135 Scope.prototype.get$parent = function() { return this.parent; };
11746 Scope.prototype.get$enclosingElement = function() { return this.enclosingElement ; }; 12136 Scope.prototype.get$enclosingElement = function() { return this.enclosingElement ; };
11747 Scope.prototype.lookup = function(name) { 12137 Scope.prototype.lookup = function(name) {
11748 var $0; 12138 var $0;
11749 var element = (($0 = this.elements.$index(name)) && $0.is$Element()); 12139 var element = (($0 = this.elements.$index(name)) == null ? null : $0.assert$El ement());
11750 if (element != null) return element; 12140 if (element != null) return element;
11751 return this.parent.lookup(name); 12141 return this.parent.lookup(name);
11752 } 12142 }
11753 Scope.prototype.add = function(element) { 12143 Scope.prototype.add = function(element) {
11754 var $0; 12144 var $0;
11755 if (this.elements.containsKey(element.name)) return (($0 = this.elements.$inde x(element.name)) && $0.is$Element()); 12145 if (this.elements.containsKey(element.name)) return (($0 = this.elements.$inde x(element.name)) == null ? null : $0.assert$Element());
11756 this.elements.$setindex(element.name, element); 12146 this.elements.$setindex(element.name, element);
11757 return element; 12147 return element;
11758 } 12148 }
11759 Scope.prototype.add$1 = function($0) { 12149 Scope.prototype.add$1 = function($0) {
11760 return this.add(($0 && $0.is$Element())); 12150 return this.add(($0 == null ? null : $0.assert$Element()));
11761 }; 12151 };
11762 Scope.prototype.lookup$1 = function($0) { 12152 Scope.prototype.lookup$1 = function($0) {
11763 return this.lookup(($0 && $0.is$SourceString())); 12153 return this.lookup(($0 == null ? null : $0.assert$SourceString()));
11764 }; 12154 };
11765 // ********** Code for TopScope ************** 12155 // ********** Code for TopScope **************
11766 function TopScope(universe) { 12156 function TopScope(universe) {
11767 this.universe = universe; 12157 this.universe = universe;
11768 // Initializers done 12158 // Initializers done
11769 Scope.top$ctor.call(this); 12159 Scope.top$ctor.call(this);
11770 } 12160 }
11771 $inherits(TopScope, Scope); 12161 $inherits(TopScope, Scope);
11772 TopScope.prototype.lookup = function(name) { 12162 TopScope.prototype.lookup = function(name) {
11773 return this.universe.find(name); 12163 return this.universe.find(name);
11774 } 12164 }
11775 TopScope.prototype.add = function(element) { 12165 TopScope.prototype.add = function(element) {
11776 $throw("Cannot add an element in the top scope"); 12166 $throw("Cannot add an element in the top scope");
11777 } 12167 }
11778 TopScope.prototype.add$1 = function($0) { 12168 TopScope.prototype.add$1 = function($0) {
11779 return this.add(($0 && $0.is$Element())); 12169 return this.add(($0 == null ? null : $0.assert$Element()));
11780 }; 12170 };
11781 TopScope.prototype.lookup$1 = function($0) { 12171 TopScope.prototype.lookup$1 = function($0) {
11782 return this.lookup(($0 && $0.is$SourceString())); 12172 return this.lookup(($0 == null ? null : $0.assert$SourceString()));
11783 }; 12173 };
11784 // ********** Code for leg_Script ************** 12174 // ********** Code for leg_Script **************
11785 function leg_Script(file) { 12175 function leg_Script(file) {
11786 this.file = file; 12176 this.file = file;
11787 // Initializers done 12177 // Initializers done
11788 } 12178 }
11789 leg_Script.prototype.get$file = function() { return this.file; }; 12179 leg_Script.prototype.get$file = function() { return this.file; };
11790 leg_Script.prototype.get$text = function() { 12180 leg_Script.prototype.get$text = function() {
11791 return $assert_String(this.file.get$text()); 12181 return $assert_String(this.file.get$text());
11792 } 12182 }
(...skipping 28 matching lines...) Expand all
11821 this.name = name; 12211 this.name = name;
11822 this.element = element; 12212 this.element = element;
11823 // Initializers done 12213 // Initializers done
11824 } 12214 }
11825 SimpleType.named$ctor = function(name) { 12215 SimpleType.named$ctor = function(name) {
11826 this.name = name; 12216 this.name = name;
11827 this.element = new Element(name, null, null); 12217 this.element = new Element(name, null, null);
11828 // Initializers done 12218 // Initializers done
11829 } 12219 }
11830 SimpleType.named$ctor.prototype = SimpleType.prototype; 12220 SimpleType.named$ctor.prototype = SimpleType.prototype;
11831 SimpleType.prototype.is$Type = function(){return this;}; 12221 SimpleType.prototype.assert$Type = function(){return this};
11832 SimpleType.prototype.get$name = function() { return this.name; }; 12222 SimpleType.prototype.get$name = function() { return this.name; };
11833 SimpleType.prototype.get$element = function() { return this.element; }; 12223 SimpleType.prototype.get$element = function() { return this.element; };
11834 SimpleType.prototype.toString = function() { 12224 SimpleType.prototype.toString = function() {
11835 return this.name.toString(); 12225 return this.name.toString();
11836 } 12226 }
11837 SimpleType.prototype.toString$0 = SimpleType.prototype.toString; 12227 SimpleType.prototype.toString$0 = SimpleType.prototype.toString;
11838 // ********** Code for FunctionType ************** 12228 // ********** Code for FunctionType **************
11839 function FunctionType(returnType, parameterTypes) { 12229 function FunctionType(returnType, parameterTypes) {
11840 this.returnType = returnType; 12230 this.returnType = returnType;
11841 this.parameterTypes = parameterTypes; 12231 this.parameterTypes = parameterTypes;
11842 // Initializers done 12232 // Initializers done
11843 } 12233 }
11844 FunctionType.prototype.is$FunctionType = function(){return this;}; 12234 FunctionType.prototype.assert$FunctionType = function(){return this};
11845 FunctionType.prototype.is$Type = function(){return this;}; 12235 FunctionType.prototype.assert$Type = function(){return this};
11846 FunctionType.prototype.get$returnType = function() { return this.returnType; }; 12236 FunctionType.prototype.get$returnType = function() { return this.returnType; };
11847 FunctionType.prototype.toString = function() { 12237 FunctionType.prototype.toString = function() {
11848 var sb = new StringBufferImpl(""); 12238 var sb = new StringBufferImpl("");
11849 var first = true; 12239 var first = true;
11850 sb.add('('); 12240 sb.add('(');
11851 this.parameterTypes.printOn(sb, ', '); 12241 this.parameterTypes.printOn(sb, ', ');
11852 sb.add((') -> ' + this.returnType)); 12242 sb.add((') -> ' + this.returnType));
11853 return sb.toString(); 12243 return sb.toString();
11854 } 12244 }
11855 FunctionType.prototype.toString$0 = FunctionType.prototype.toString; 12245 FunctionType.prototype.toString$0 = FunctionType.prototype.toString;
11856 // ********** Code for Types ************** 12246 // ********** Code for Types **************
11857 function Types() { 12247 function Types() {
11858 this.voidType = new SimpleType.named$ctor(const$6/*Types.VOID*/); 12248 this.voidType = new SimpleType.named$ctor(const$6/*Types.VOID*/);
11859 this.intType = new SimpleType.named$ctor(const$8/*Types.INT*/); 12249 this.intType = new SimpleType.named$ctor(const$8/*Types.INT*/);
11860 this.doubleType = new SimpleType.named$ctor(const$10/*Types.DOUBLE*/); 12250 this.doubleType = new SimpleType.named$ctor(const$10/*Types.DOUBLE*/);
11861 this.dynamicType = new SimpleType.named$ctor(const$12/*Types.DYNAMIC*/); 12251 this.dynamicType = new SimpleType.named$ctor(const$12/*Types.DYNAMIC*/);
11862 this.stringType = new SimpleType.named$ctor(const$14/*Types.STRING*/); 12252 this.stringType = new SimpleType.named$ctor(const$14/*Types.STRING*/);
11863 this.boolType = new SimpleType.named$ctor(const$16/*Types.BOOL*/); 12253 this.boolType = new SimpleType.named$ctor(const$16/*Types.BOOL*/);
11864 this.objectType = new SimpleType.named$ctor(const$18/*Types.OBJECT*/); 12254 this.objectType = new SimpleType.named$ctor(const$18/*Types.OBJECT*/);
11865 // Initializers done 12255 // Initializers done
11866 } 12256 }
11867 Types.prototype.is$Types = function(){return this;}; 12257 Types.prototype.assert$Types = function(){return this};
11868 Types.prototype.get$dynamicType = function() { return this.dynamicType; }; 12258 Types.prototype.get$dynamicType = function() { return this.dynamicType; };
11869 Types.prototype.lookup = function(s) { 12259 Types.prototype.lookup = function(s) {
11870 if ($notnull_bool($eq(const$6/*Types.VOID*/, s))) { 12260 if ($notnull_bool($eq(const$6/*Types.VOID*/, s))) {
11871 return this.voidType; 12261 return this.voidType;
11872 } 12262 }
11873 else if ($notnull_bool($eq(const$8/*Types.INT*/, s))) { 12263 else if ($notnull_bool($eq(const$8/*Types.INT*/, s))) {
11874 return this.intType; 12264 return this.intType;
11875 } 12265 }
11876 else if ($notnull_bool($eq(const$10/*Types.DOUBLE*/, s))) { 12266 else if ($notnull_bool($eq(const$10/*Types.DOUBLE*/, s))) {
11877 return this.doubleType; 12267 return this.doubleType;
(...skipping 12 matching lines...) Expand all
11890 } 12280 }
11891 return null; 12281 return null;
11892 } 12282 }
11893 Types.prototype.isSubtype = function(r, s) { 12283 Types.prototype.isSubtype = function(r, s) {
11894 return r === s || r === this.dynamicType || s === this.dynamicType || s === th is.objectType; 12284 return r === s || r === this.dynamicType || s === this.dynamicType || s === th is.objectType;
11895 } 12285 }
11896 Types.prototype.isAssignable = function(r, s) { 12286 Types.prototype.isAssignable = function(r, s) {
11897 return $notnull_bool(this.isSubtype(r, s)) || $notnull_bool(this.isSubtype(s, r)); 12287 return $notnull_bool(this.isSubtype(r, s)) || $notnull_bool(this.isSubtype(s, r));
11898 } 12288 }
11899 Types.prototype.lookup$1 = function($0) { 12289 Types.prototype.lookup$1 = function($0) {
11900 return this.lookup(($0 && $0.is$SourceString())); 12290 return this.lookup(($0 == null ? null : $0.assert$SourceString()));
11901 }; 12291 };
11902 // ********** Code for CancelTypeCheckException ************** 12292 // ********** Code for CancelTypeCheckException **************
11903 function CancelTypeCheckException(node, reason) { 12293 function CancelTypeCheckException(node, reason) {
11904 this.node = node; 12294 this.node = node;
11905 this.reason = reason; 12295 this.reason = reason;
11906 // Initializers done 12296 // Initializers done
11907 } 12297 }
11908 // ********** Code for TypeCheckerVisitor ************** 12298 // ********** Code for TypeCheckerVisitor **************
11909 function TypeCheckerVisitor(compiler, elements, types) { 12299 function TypeCheckerVisitor(compiler, elements, types) {
11910 this.compiler = compiler; 12300 this.compiler = compiler;
11911 this.elements = elements; 12301 this.elements = elements;
11912 this.types = types; 12302 this.types = types;
11913 // Initializers done 12303 // Initializers done
11914 } 12304 }
11915 TypeCheckerVisitor.prototype.is$Visitor = function(){return this;}; 12305 TypeCheckerVisitor.prototype.assert$Visitor = function(){return this};
11916 TypeCheckerVisitor.prototype.get$types = function() { return this.types; }; 12306 TypeCheckerVisitor.prototype.get$types = function() { return this.types; };
11917 TypeCheckerVisitor.prototype.set$types = function(value) { return this.types = v alue; }; 12307 TypeCheckerVisitor.prototype.set$types = function(value) { return this.types = v alue; };
11918 TypeCheckerVisitor.prototype.fail = function(node, reason) { 12308 TypeCheckerVisitor.prototype.fail = function(node, reason) {
11919 var message = 'cannot type-check'; 12309 var message = 'cannot type-check';
11920 if (reason != null) { 12310 if (reason != null) {
11921 message = ('' + message + ': ' + reason); 12311 message = ('' + message + ': ' + reason);
11922 } 12312 }
11923 $throw(new CancelTypeCheckException(node, message)); 12313 $throw(new CancelTypeCheckException(node, message));
11924 } 12314 }
11925 TypeCheckerVisitor.prototype.reportTypeWarning = function(node, kind, arguments) { 12315 TypeCheckerVisitor.prototype.reportTypeWarning = function(node, kind, arguments) {
11926 this.compiler.reportWarning(node, new TypeWarning(kind, arguments)); 12316 this.compiler.reportWarning(node, new TypeWarning(kind, arguments));
11927 } 12317 }
11928 TypeCheckerVisitor.prototype.nonVoidType = function(node) { 12318 TypeCheckerVisitor.prototype.nonVoidType = function(node) {
11929 var type = this.type(node); 12319 var type = this.type(node);
11930 if ($eq(type, this.types.voidType)) { 12320 if ($eq(type, this.types.voidType)) {
11931 this.reportTypeWarning(node, const$270/*MessageKind.VOID_EXPRESSION*/, const $21/*const []*/); 12321 this.reportTypeWarning(node, const$270/*MessageKind.VOID_EXPRESSION*/, const $21/*const []*/);
11932 } 12322 }
11933 return type; 12323 return type;
11934 } 12324 }
11935 TypeCheckerVisitor.prototype.typeWithDefault = function(node, defaultValue) { 12325 TypeCheckerVisitor.prototype.typeWithDefault = function(node, defaultValue) {
11936 return node != null ? this.type(node) : defaultValue; 12326 return node != null ? this.type(node) : defaultValue;
11937 } 12327 }
11938 TypeCheckerVisitor.prototype.type = function(node) { 12328 TypeCheckerVisitor.prototype.type = function(node) {
11939 var $0; 12329 var $0;
11940 if (node == null) this.fail(null, 'unexpected node: null'); 12330 if (node == null) this.fail(null, 'unexpected node: null');
11941 var result = (($0 = node.accept(this)) && $0.is$Type()); 12331 var result = (($0 = node.accept(this)) == null ? null : $0.assert$Type());
11942 return result; 12332 return result;
11943 } 12333 }
11944 TypeCheckerVisitor.prototype.get$type = function() { 12334 TypeCheckerVisitor.prototype.get$type = function() {
11945 return TypeCheckerVisitor.prototype.type.bind(this); 12335 return TypeCheckerVisitor.prototype.type.bind(this);
11946 } 12336 }
11947 TypeCheckerVisitor.prototype.checkAssignable = function(node, s, t) { 12337 TypeCheckerVisitor.prototype.checkAssignable = function(node, s, t) {
11948 if (!$notnull_bool(this.types.isAssignable(s, t))) { 12338 if (!$notnull_bool(this.types.isAssignable(s, t))) {
11949 this.reportTypeWarning(node, const$258/*MessageKind.NOT_ASSIGNABLE*/, [s, t] ); 12339 this.reportTypeWarning(node, const$258/*MessageKind.NOT_ASSIGNABLE*/, [s, t] );
11950 } 12340 }
11951 } 12341 }
(...skipping 19 matching lines...) Expand all
11971 TypeCheckerVisitor.prototype.visitFor = function(node) { 12361 TypeCheckerVisitor.prototype.visitFor = function(node) {
11972 this.type(node.initializer); 12362 this.type(node.initializer);
11973 this.checkCondition(node.get$condition()); 12363 this.checkCondition(node.get$condition());
11974 this.type(node.update); 12364 this.type(node.update);
11975 this.type(node.body); 12365 this.type(node.body);
11976 return this.types.voidType; 12366 return this.types.voidType;
11977 } 12367 }
11978 TypeCheckerVisitor.prototype.visitFunctionExpression = function(node) { 12368 TypeCheckerVisitor.prototype.visitFunctionExpression = function(node) {
11979 var $0; 12369 var $0;
11980 var element = this.elements.$index(node); 12370 var element = this.elements.$index(node);
11981 var functionType = (($0 = element.computeType$2(this.compiler, this.types)) && $0.is$FunctionType()); 12371 var functionType = (($0 = element.computeType$2(this.compiler, this.types)) == null ? null : $0.assert$FunctionType());
11982 var returnType = functionType.returnType; 12372 var returnType = functionType.returnType;
11983 var previous = this.expectedReturnType; 12373 var previous = this.expectedReturnType;
11984 this.expectedReturnType = returnType; 12374 this.expectedReturnType = returnType;
11985 this.type(node.body); 12375 this.type(node.body);
11986 this.expectedReturnType = previous; 12376 this.expectedReturnType = previous;
11987 return functionType; 12377 return functionType;
11988 } 12378 }
11989 TypeCheckerVisitor.prototype.visitIdentifier = function(node) { 12379 TypeCheckerVisitor.prototype.visitIdentifier = function(node) {
11990 this.fail(node); 12380 this.fail(node);
11991 } 12381 }
11992 TypeCheckerVisitor.prototype.visitIf = function(node) { 12382 TypeCheckerVisitor.prototype.visitIf = function(node) {
11993 this.type(node.condition); 12383 this.type(node.condition);
11994 this.type(node.thenPart); 12384 this.type(node.thenPart);
11995 if ($notnull_bool(node.get$hasElsePart())) this.type(node.elsePart); 12385 if ($notnull_bool(node.get$hasElsePart())) this.type(node.elsePart);
11996 return this.types.voidType; 12386 return this.types.voidType;
11997 } 12387 }
11998 TypeCheckerVisitor.prototype.visitSend = function(node) { 12388 TypeCheckerVisitor.prototype.visitSend = function(node) {
11999 var $0; 12389 var $0;
12000 var target = this.elements.$index(node); 12390 var target = this.elements.$index(node);
12001 var selector = (($0 = node.selector) && $0.is$Identifier()); 12391 var selector = (($0 = node.selector) == null ? null : $0.assert$Identifier());
12002 var name = selector.get$source().get$stringValue(); 12392 var name = selector.get$source().get$stringValue();
12003 if (target != null) { 12393 if (target != null) {
12004 if (selector.asOperator() != null) { 12394 if (selector.asOperator() != null) {
12005 this.type(node.receiver); 12395 this.type(node.receiver);
12006 if (node.get$arguments().get$head() != null) this.type((($0 = node.get$arg uments().get$head()) && $0.is$Node())); 12396 if (node.get$arguments().get$head() != null) this.type((($0 = node.get$arg uments().get$head()) == null ? null : $0.assert$Node()));
12007 if (name === '+' || name === '=' || name === '-' || name === '*' || name = == '/' || name === '%' || name === '~/' || name === '|' || name === '&' || name === '^' || name === '~' || name === '<<' || name === '>>') { 12397 if (name === '+' || name === '=' || name === '-' || name === '*' || name = == '/' || name === '%' || name === '~/' || name === '|' || name === '&' || name === '^' || name === '~' || name === '<<' || name === '>>') {
12008 return this.types.dynamicType; 12398 return this.types.dynamicType;
12009 } 12399 }
12010 else if (name === '<' || name === '>' || name === '<=' || name === '>=' || name === '==') { 12400 else if (name === '<' || name === '>' || name === '<=' || name === '>=' || name === '==') {
12011 return this.types.boolType; 12401 return this.types.boolType;
12012 } 12402 }
12013 else { 12403 else {
12014 this.fail(selector, ('unexpected operator ' + name)); 12404 this.fail(selector, ('unexpected operator ' + name));
12015 } 12405 }
12016 } 12406 }
12017 var targetType = target.computeType$2(this.compiler, this.types); 12407 var targetType = target.computeType$2(this.compiler, this.types);
12018 if ($notnull_bool(node.get$isPropertyAccess())) { 12408 if ($notnull_bool(node.get$isPropertyAccess())) {
12019 return (targetType && targetType.is$Type()); 12409 return (targetType == null ? null : targetType.assert$Type());
12020 } 12410 }
12021 else if ($notnull_bool(node.get$isFunctionObjectInvocation())) { 12411 else if ($notnull_bool(node.get$isFunctionObjectInvocation())) {
12022 this.fail(node); 12412 this.fail(node);
12023 } 12413 }
12024 else { 12414 else {
12025 if (!(targetType instanceof FunctionType)) { 12415 if (!(targetType instanceof FunctionType)) {
12026 if ((target instanceof ForeignElement)) { 12416 if ((target instanceof ForeignElement)) {
12027 return this.types.dynamicType; 12417 return this.types.dynamicType;
12028 } 12418 }
12029 this.fail(node, 'can only handle function types'); 12419 this.fail(node, 'can only handle function types');
12030 } 12420 }
12031 var funType = (targetType && targetType.is$FunctionType()); 12421 var funType = (targetType == null ? null : targetType.assert$FunctionType( ));
12032 var formals = funType.parameterTypes; 12422 var formals = funType.parameterTypes;
12033 var arguments = node.get$arguments(); 12423 var arguments = node.get$arguments();
12034 while ((!$notnull_bool(formals.isEmpty())) && (!$notnull_bool(arguments.is Empty()))) { 12424 while ((!$notnull_bool(formals.isEmpty())) && (!$notnull_bool(arguments.is Empty()))) {
12035 var argument = (($0 = arguments.get$head()) && $0.is$Node()); 12425 var argument = (($0 = arguments.get$head()) == null ? null : $0.assert$N ode());
12036 var argumentType = this.type(argument); 12426 var argumentType = this.type(argument);
12037 this.checkAssignable(argument, (($0 = formals.get$head()) && $0.is$Type( )), argumentType); 12427 this.checkAssignable(argument, (($0 = formals.get$head()) == null ? null : $0.assert$Type()), argumentType);
12038 formals = (($0 = formals.get$tail()) && $0.is$Link_Type()); 12428 formals = (($0 = formals.get$tail()) == null ? null : $0.assert$Link_Typ e());
12039 arguments = (($0 = arguments.get$tail()) && $0.is$Link_Node()); 12429 arguments = (($0 = arguments.get$tail()) == null ? null : $0.assert$Link _Node());
12040 } 12430 }
12041 if (!$notnull_bool(formals.isEmpty())) { 12431 if (!$notnull_bool(formals.isEmpty())) {
12042 this.reportTypeWarning(node, const$264/*MessageKind.MISSING_ARGUMENT*/, const$21/*const []*/); 12432 this.reportTypeWarning(node, const$264/*MessageKind.MISSING_ARGUMENT*/, const$21/*const []*/);
12043 } 12433 }
12044 if (!$notnull_bool(arguments.isEmpty())) { 12434 if (!$notnull_bool(arguments.isEmpty())) {
12045 this.reportTypeWarning(node, const$266/*MessageKind.ADDITIONAL_ARGUMENT* /, const$21/*const []*/); 12435 this.reportTypeWarning(node, const$266/*MessageKind.ADDITIONAL_ARGUMENT* /, const$21/*const []*/);
12046 } 12436 }
12047 return funType.returnType; 12437 return funType.returnType;
12048 } 12438 }
12049 } 12439 }
12050 else { 12440 else {
12051 if (name === '||' || name === '&&' || name === '!') { 12441 if (name === '||' || name === '&&' || name === '!') {
12052 var arguments = node.get$arguments(); 12442 var arguments = node.get$arguments();
12053 var firstArgument = node.receiver; 12443 var firstArgument = node.receiver;
12054 this.checkAssignable(firstArgument, this.types.boolType, this.type(firstAr gument)); 12444 this.checkAssignable(firstArgument, this.types.boolType, this.type(firstAr gument));
12055 if (!$notnull_bool(arguments.isEmpty())) { 12445 if (!$notnull_bool(arguments.isEmpty())) {
12056 var secondArgument = (($0 = arguments.get$head()) && $0.is$Node()); 12446 var secondArgument = (($0 = arguments.get$head()) == null ? null : $0.as sert$Node());
12057 this.checkAssignable(secondArgument, this.types.boolType, this.type(seco ndArgument)); 12447 this.checkAssignable(secondArgument, this.types.boolType, this.type(seco ndArgument));
12058 } 12448 }
12059 return this.types.boolType; 12449 return this.types.boolType;
12060 } 12450 }
12061 this.fail(node, ('unresolved send ' + selector.get$source())); 12451 this.fail(node, ('unresolved send ' + selector.get$source()));
12062 } 12452 }
12063 } 12453 }
12064 TypeCheckerVisitor.prototype.visitSendSet = function(node) { 12454 TypeCheckerVisitor.prototype.visitSendSet = function(node) {
12065 var $0; 12455 var $0;
12066 this.compiler.ensure(node.get$arguments() != null); 12456 this.compiler.ensure(node.get$arguments() != null);
12067 var selector = (($0 = node.selector) && $0.is$Identifier()); 12457 var selector = (($0 = node.selector) == null ? null : $0.assert$Identifier());
12068 var name = node.assignmentOperator.get$source().get$stringValue(); 12458 var name = node.assignmentOperator.get$source().get$stringValue();
12069 if (name === '++' || name === '--') { 12459 if (name === '++' || name === '--') {
12070 this.compiler.ensure((node.selector instanceof Identifier)); 12460 this.compiler.ensure((node.selector instanceof Identifier));
12071 var element = (($0 = this.elements.$index(node.selector)) && $0.is$Element() ); 12461 var element = (($0 = this.elements.$index(node.selector)) == null ? null : $ 0.assert$Element());
12072 var receiverType = (($0 = element.computeType(this.compiler, this.types)) && $0.is$Type()); 12462 var receiverType = (($0 = element.computeType(this.compiler, this.types)) == null ? null : $0.assert$Type());
12073 return $notnull_bool(node.get$isPrefix()) ? this.types.intType : receiverTyp e; 12463 return $notnull_bool(node.get$isPrefix()) ? this.types.intType : receiverTyp e;
12074 } 12464 }
12075 else { 12465 else {
12076 this.compiler.ensure(!$notnull_bool(node.get$arguments().isEmpty())); 12466 this.compiler.ensure(!$notnull_bool(node.get$arguments().isEmpty()));
12077 var targetType = (($0 = this.elements.$index(node).computeType$2(this.compil er, this.types)) && $0.is$Type()); 12467 var targetType = (($0 = this.elements.$index(node).computeType$2(this.compil er, this.types)) == null ? null : $0.assert$Type());
12078 var value = (($0 = node.get$arguments().get$head()) && $0.is$Node()); 12468 var value = (($0 = node.get$arguments().get$head()) == null ? null : $0.asse rt$Node());
12079 this.checkAssignable(value, targetType, this.type(value)); 12469 this.checkAssignable(value, targetType, this.type(value));
12080 return targetType; 12470 return targetType;
12081 } 12471 }
12082 } 12472 }
12083 TypeCheckerVisitor.prototype.visitLiteralInt = function(node) { 12473 TypeCheckerVisitor.prototype.visitLiteralInt = function(node) {
12084 return this.types.intType; 12474 return this.types.intType;
12085 } 12475 }
12086 TypeCheckerVisitor.prototype.visitLiteralDouble = function(node) { 12476 TypeCheckerVisitor.prototype.visitLiteralDouble = function(node) {
12087 return this.types.doubleType; 12477 return this.types.doubleType;
12088 } 12478 }
12089 TypeCheckerVisitor.prototype.visitLiteralBool = function(node) { 12479 TypeCheckerVisitor.prototype.visitLiteralBool = function(node) {
12090 return this.types.boolType; 12480 return this.types.boolType;
12091 } 12481 }
12092 TypeCheckerVisitor.prototype.visitLiteralString = function(node) { 12482 TypeCheckerVisitor.prototype.visitLiteralString = function(node) {
12093 return this.types.stringType; 12483 return this.types.stringType;
12094 } 12484 }
12095 TypeCheckerVisitor.prototype.visitLiteralNull = function(node) { 12485 TypeCheckerVisitor.prototype.visitLiteralNull = function(node) {
12096 return this.types.dynamicType; 12486 return this.types.dynamicType;
12097 } 12487 }
12098 TypeCheckerVisitor.prototype.visitNodeList = function(node) { 12488 TypeCheckerVisitor.prototype.visitNodeList = function(node) {
12099 var $0; 12489 var $0;
12100 for (var link = node.get$nodes(); 12490 for (var link = node.get$nodes();
12101 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_ Node())) { 12491 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == null ? null : $0.assert$Link_Node())) {
12102 this.type((($0 = link.get$head()) && $0.is$Node())); 12492 this.type((($0 = link.get$head()) == null ? null : $0.assert$Node()));
12103 } 12493 }
12104 return null; 12494 return null;
12105 } 12495 }
12106 TypeCheckerVisitor.prototype.visitOperator = function(node) { 12496 TypeCheckerVisitor.prototype.visitOperator = function(node) {
12107 return this.types.dynamicType; 12497 return this.types.dynamicType;
12108 } 12498 }
12109 TypeCheckerVisitor.prototype.visitReturn = function(node) { 12499 TypeCheckerVisitor.prototype.visitReturn = function(node) {
12110 var expression = node.expression; 12500 var expression = node.expression;
12111 var isVoidFunction = (this.expectedReturnType === this.types.voidType); 12501 var isVoidFunction = (this.expectedReturnType === this.types.voidType);
12112 if (expression != null) { 12502 if (expression != null) {
(...skipping 11 matching lines...) Expand all
12124 return null; 12514 return null;
12125 } 12515 }
12126 TypeCheckerVisitor.prototype.visitThrow = function(node) { 12516 TypeCheckerVisitor.prototype.visitThrow = function(node) {
12127 if (node.expression != null) this.type(node.expression); 12517 if (node.expression != null) this.type(node.expression);
12128 return this.types.voidType; 12518 return this.types.voidType;
12129 } 12519 }
12130 TypeCheckerVisitor.prototype.visitTypeAnnotation = function(node) { 12520 TypeCheckerVisitor.prototype.visitTypeAnnotation = function(node) {
12131 var $0; 12521 var $0;
12132 if (node.typeName == null) return this.types.dynamicType; 12522 if (node.typeName == null) return this.types.dynamicType;
12133 var name = node.typeName.get$source(); 12523 var name = node.typeName.get$source();
12134 var type = (($0 = this.elements.$index(node)) && $0.is$Type()); 12524 var type = (($0 = this.elements.$index(node)) == null ? null : $0.assert$Type( ));
12135 if (type == null) type = this.types.lookup(name); 12525 if (type == null) type = this.types.lookup(name);
12136 if (type == null) { 12526 if (type == null) {
12137 return this.types.dynamicType; 12527 return this.types.dynamicType;
12138 } 12528 }
12139 return type; 12529 return type;
12140 } 12530 }
12141 TypeCheckerVisitor.prototype.visitVariableDefinitions = function(node) { 12531 TypeCheckerVisitor.prototype.visitVariableDefinitions = function(node) {
12142 var $0; 12532 var $0;
12143 var type = this.typeWithDefault(node.type, this.types.dynamicType); 12533 var type = this.typeWithDefault(node.type, this.types.dynamicType);
12144 if ($eq(type, this.types.voidType)) { 12534 if ($eq(type, this.types.voidType)) {
12145 this.reportTypeWarning(node.type, const$268/*MessageKind.VOID_VARIABLE*/, co nst$21/*const []*/); 12535 this.reportTypeWarning(node.type, const$268/*MessageKind.VOID_VARIABLE*/, co nst$21/*const []*/);
12146 type = this.types.dynamicType; 12536 type = this.types.dynamicType;
12147 } 12537 }
12148 for (var link = node.definitions.get$nodes(); 12538 for (var link = node.definitions.get$nodes();
12149 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_ Node())) { 12539 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) == null ? null : $0.assert$Link_Node())) {
12150 var initialization = (($0 = link.get$head()) && $0.is$Node()); 12540 var initialization = (($0 = link.get$head()) == null ? null : $0.assert$Node ());
12151 this.compiler.ensure((initialization instanceof Identifier) || (initializati on instanceof Send)); 12541 this.compiler.ensure((initialization instanceof Identifier) || (initializati on instanceof Send));
12152 if ((initialization instanceof Send)) { 12542 if ((initialization instanceof Send)) {
12153 var initializer = this.nonVoidType((($0 = link.get$head()) && $0.is$Node() )); 12543 var initializer = this.nonVoidType((($0 = link.get$head()) == null ? null : $0.assert$Node()));
12154 this.checkAssignable(node, type, initializer); 12544 this.checkAssignable(node, type, initializer);
12155 } 12545 }
12156 } 12546 }
12157 return null; 12547 return null;
12158 } 12548 }
12159 TypeCheckerVisitor.prototype.visitWhile = function(node) { 12549 TypeCheckerVisitor.prototype.visitWhile = function(node) {
12160 this.checkCondition(node.condition); 12550 this.checkCondition(node.condition);
12161 this.type(node.body); 12551 this.type(node.body);
12162 } 12552 }
12163 TypeCheckerVisitor.prototype.visitParenthesizedExpression = function(node) { 12553 TypeCheckerVisitor.prototype.visitParenthesizedExpression = function(node) {
12164 return this.type(node.expression); 12554 return this.type(node.expression);
12165 } 12555 }
12166 // ********** Code for Universe ************** 12556 // ********** Code for Universe **************
12167 function Universe() { 12557 function Universe() {
12168 this.elements = $map([]); 12558 this.elements = $map([]);
12169 this.generatedCode = $map([]); 12559 this.generatedCode = $map([]);
12170 this.scope = new Element(const$4, null, null); 12560 this.scope = new Element(const$4, null, null);
12171 // Initializers done 12561 // Initializers done
12172 } 12562 }
12173 Universe.prototype.find = function(name) { 12563 Universe.prototype.find = function(name) {
12174 var $0; 12564 var $0;
12175 return (($0 = this.elements.$index(name)) && $0.is$Element()); 12565 return (($0 = this.elements.$index(name)) == null ? null : $0.assert$Element() );
12176 } 12566 }
12177 Universe.prototype.define = function(element) { 12567 Universe.prototype.define = function(element) {
12178 $assert(this.elements.$index(element.name) == null, "elements[element.name] == null", "universe.dart", 20, 12); 12568 $assert(this.elements.$index(element.name) == null, "elements[element.name] == null", "universe.dart", 20, 12);
12179 this.elements.$setindex(element.name, element); 12569 this.elements.$setindex(element.name, element);
12180 } 12570 }
12181 Universe.prototype.addGeneratedCode = function(element, code) { 12571 Universe.prototype.addGeneratedCode = function(element, code) {
12182 this.generatedCode.$setindex(element, code); 12572 this.generatedCode.$setindex(element, code);
12183 } 12573 }
12184 // ********** Code for MessageKind ************** 12574 // ********** Code for MessageKind **************
12185 function MessageKind(template) { 12575 function MessageKind(template) {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
12275 var end = node.getEndToken(); 12665 var end = node.getEndToken();
12276 if (begin == null || end == null) { 12666 if (begin == null || end == null) {
12277 this.cancel(('cannot find tokens to produce error message for ' + node + '.' )); 12667 this.cancel(('cannot find tokens to produce error message for ' + node + '.' ));
12278 } 12668 }
12279 var startOffset = begin.get$charOffset(); 12669 var startOffset = begin.get$charOffset();
12280 var endOffset = end.get$charOffset() + end.toString$0().length; 12670 var endOffset = end.get$charOffset() + end.toString$0().length;
12281 return new SourceSpan(this.script.file, startOffset, endOffset); 12671 return new SourceSpan(this.script.file, startOffset, endOffset);
12282 } 12672 }
12283 WorldCompiler.prototype.reportWarning = function(node, message) { 12673 WorldCompiler.prototype.reportWarning = function(node, message) {
12284 var $0; 12674 var $0;
12285 this.world.warning(('' + message + '.'), (($0 = this.spanFromNode(node)) && $0 .is$SourceSpan())); 12675 this.world.warning(('' + message + '.'), (($0 = this.spanFromNode(node)) == nu ll ? null : $0.assert$SourceSpan()));
12286 } 12676 }
12287 WorldCompiler.prototype.readScript = function(filename) { 12677 WorldCompiler.prototype.readScript = function(filename) {
12288 var text = $globals.world.files.readAll(filename); 12678 var text = $globals.world.files.readAll(filename);
12289 var sourceFile = new SourceFile(filename, text); 12679 var sourceFile = new SourceFile(filename, text);
12290 return new leg_Script(sourceFile); 12680 return new leg_Script(sourceFile);
12291 } 12681 }
12292 WorldCompiler.prototype.get$legDirectory = function() { 12682 WorldCompiler.prototype.get$legDirectory = function() {
12293 return join([$globals.options.libDir, '..', 'leg']); 12683 return join([$globals.options.libDir, '..', 'leg']);
12294 } 12684 }
12295 WorldCompiler.prototype.cancel = function(reason, node, token, instruction) { 12685 WorldCompiler.prototype.cancel = function(reason, node, token, instruction) {
12296 if (node != null) { 12686 if (node != null) {
12297 print(this.spanFromNode(node).toMessageString$1(("cancel leg: " + reason))); 12687 print(this.spanFromNode(node).toMessageString$1(("cancel leg: " + reason)));
12298 } 12688 }
12299 else if (token != null) { 12689 else if (token != null) {
12300 var tokenString = token.toString$0(); 12690 var tokenString = token.toString$0();
12301 var begin = $assert_num(token.get$charOffset()); 12691 var begin = $assert_num(token.get$charOffset());
12302 var end = begin + tokenString.length; 12692 var end = begin + tokenString.length;
12303 print(this.script.file.getLocationMessage$4(("cancel leg: " + reason), begin , end, true)); 12693 print(this.script.file.getLocationMessage$4(("cancel leg: " + reason), begin , end, true));
12304 } 12694 }
12305 Compiler.prototype.cancel.call(this, reason, node, (token && token.is$Token()) , (instruction && instruction.is$HInstruction())); 12695 Compiler.prototype.cancel.call(this, reason, node, (token == null ? null : tok en.assert$Token()), (instruction == null ? null : instruction.assert$HInstructio n()));
12306 } 12696 }
12307 // ********** Code for top level ************** 12697 // ********** Code for top level **************
12308 function compile(world) { 12698 function compile(world) {
12309 var file = world.readFile($globals.options.dartScript); 12699 var file = world.readFile($globals.options.dartScript);
12310 var script = new leg_Script(file); 12700 var script = new leg_Script(file);
12311 var compiler = new WorldCompiler(world, script); 12701 var compiler = new WorldCompiler(world, script);
12312 return compiler.run(); 12702 return compiler.run();
12313 } 12703 }
12314 // ********** Library lang ************** 12704 // ********** Library lang **************
12315 // ********** Code for CodeWriter ************** 12705 // ********** Code for CodeWriter **************
12316 function CodeWriter() { 12706 function CodeWriter() {
12317 this._indentation = 0 12707 this._indentation = 0
12318 this._pendingIndent = false 12708 this._pendingIndent = false
12319 this.writeComments = true 12709 this.writeComments = true
12320 this._buf = new StringBufferImpl(""); 12710 this._buf = new StringBufferImpl("");
12321 // Initializers done 12711 // Initializers done
12322 } 12712 }
12323 CodeWriter.prototype.is$CodeWriter = function(){return this;}; 12713 CodeWriter.prototype.assert$CodeWriter = function(){return this};
12324 CodeWriter.prototype.get$text = function() { 12714 CodeWriter.prototype.get$text = function() {
12325 return this._buf.toString(); 12715 return this._buf.toString();
12326 } 12716 }
12327 CodeWriter.prototype._indent = function() { 12717 CodeWriter.prototype._indent = function() {
12328 this._pendingIndent = false; 12718 this._pendingIndent = false;
12329 for (var i = 0; 12719 for (var i = 0;
12330 i < this._indentation; i++) { 12720 i < this._indentation; i++) {
12331 this._buf.add(' '/*CodeWriter.INDENTATION*/); 12721 this._buf.add(' '/*CodeWriter.INDENTATION*/);
12332 } 12722 }
12333 } 12723 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
12366 this._indentation--; 12756 this._indentation--;
12367 this.writeln(text); 12757 this.writeln(text);
12368 } 12758 }
12369 CodeWriter.prototype.nextBlock = function(text) { 12759 CodeWriter.prototype.nextBlock = function(text) {
12370 this._indentation--; 12760 this._indentation--;
12371 this.writeln(text); 12761 this.writeln(text);
12372 this._indentation++; 12762 this._indentation++;
12373 } 12763 }
12374 // ********** Code for CoreJs ************** 12764 // ********** Code for CoreJs **************
12375 function CoreJs() { 12765 function CoreJs() {
12376 this.useTypeNameOf = false
12377 this.useStackTraceOf = false 12766 this.useStackTraceOf = false
12378 this.useThrow = false 12767 this.useThrow = false
12379 this.useVarMethod = false
12380 this.useGenStub = false 12768 this.useGenStub = false
12381 this.useMap = false 12769 this.useMap = false
12382 this.useAssert = false 12770 this.useAssert = false
12383 this.useNotNullBool = false 12771 this.useNotNullBool = false
12384 this.useIndex = false 12772 this.useIndex = false
12385 this.useSetIndex = false 12773 this.useSetIndex = false
12386 this.useWrap0 = false 12774 this.useWrap0 = false
12387 this.useWrap1 = false 12775 this.useWrap1 = false
12388 this.useIsolates = false 12776 this.useIsolates = false
12389 this.useToString = false 12777 this.useToString = false
12778 this._generatedTypeNameOf = false
12779 this._generatedDynamicProto = false
12780 this._generatedInherits = false
12390 this._usedOperators = $map([]); 12781 this._usedOperators = $map([]);
12782 this.writer = new CodeWriter();
12391 // Initializers done 12783 // Initializers done
12392 } 12784 }
12393 CoreJs.prototype.useOperator = function(name) { 12785 CoreJs.prototype.useOperator = function(name) {
12394 if ($notnull_bool($ne(this._usedOperators.$index(name), null))) return; 12786 if ($notnull_bool($ne(this._usedOperators.$index(name), null))) return;
12395 var code; 12787 var code;
12396 switch (name) { 12788 switch (name) {
12397 case '\$ne': 12789 case '\$ne':
12398 12790
12399 code = "function $ne(x, y) {\n if (x == null) return y != null;\n return (typeof(x) == 'number' && typeof(y) == 'number') ||\n (typeof(x) == 'bo olean' && typeof(y) == 'boolean') ||\n (typeof(x) == 'string' && typeof( y) == 'string')\n ? x != y : !x.$eq(y);\n}"; 12791 code = "function $ne(x, y) {\n if (x == null) return y != null;\n return (typeof(x) == 'number' && typeof(y) == 'number') ||\n (typeof(x) == 'bo olean' && typeof(y) == 'boolean') ||\n (typeof(x) == 'string' && typeof( y) == 'string')\n ? x != y : !x.$eq(y);\n}";
12400 break; 12792 break;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
12432 12824
12433 default: 12825 default:
12434 12826
12435 var op = TokenKind.rawOperatorFromMethod(name); 12827 var op = TokenKind.rawOperatorFromMethod(name);
12436 code = ("function " + name + "(x, y) {\n return (typeof(x) == 'number' && typeof(y) == 'number')\n ? x " + op + " y : x." + name + "(y);\n}"); 12828 code = ("function " + name + "(x, y) {\n return (typeof(x) == 'number' && typeof(y) == 'number')\n ? x " + op + " y : x." + name + "(y);\n}");
12437 break; 12829 break;
12438 12830
12439 } 12831 }
12440 this._usedOperators.$setindex(name, code); 12832 this._usedOperators.$setindex(name, code);
12441 } 12833 }
12834 CoreJs.prototype.ensureDynamicProto = function() {
12835 if ($notnull_bool(this._generatedDynamicProto)) return;
12836 this._generatedDynamicProto = true;
12837 this.ensureTypeNameOf();
12838 this.writer.writeln("function $dynamic(name) {\n var f = Object.prototype[nam e];\n if (f && f.methods) return f.methods;\n\n var methods = {};\n if (f) me thods.Object = f;\n function $dynamicBind() {\n // Find the target method\n var method;\n var proto = Object.getPrototypeOf(this);\n var obj = prot o;\n do {\n method = methods[obj.$typeNameOf()];\n if (method) brea k;\n obj = Object.getPrototypeOf(obj);\n } while (obj);\n\n // Patch the prototype, but don't overwrite an existing stub, like\n // the one on Obj ect.prototype.\n if (!proto.hasOwnProperty(name)) proto[name] = method || met hods.Object;\n\n return method.apply(this, Array.prototype.slice.call(argumen ts));\n };\n $dynamicBind.methods = methods;\n Object.prototype[name] = $dyna micBind;\n return methods;\n}");
12839 }
12840 CoreJs.prototype.ensureTypeNameOf = function() {
12841 if ($notnull_bool(this._generatedTypeNameOf)) return;
12842 this._generatedTypeNameOf = true;
12843 this.writer.writeln("Object.prototype.$typeNameOf = function() {\n if ((typeo f(window) != 'undefined' && window.constructor.name == 'DOMWindow')\n || ty peof(process) != 'undefined') { // fast-path for Chrome and Node\n return thi s.constructor.name;\n }\n var str = Object.prototype.toString.call(this);\n s tr = str.substring(8, str.length - 1);\n if (str == 'Window') str = 'DOMWindow' ;\n return str;\n}");
12844 }
12845 CoreJs.prototype.ensureInheritsHelper = function() {
12846 if ($notnull_bool(this._generatedInherits)) return;
12847 this._generatedInherits = true;
12848 this.writer.writeln("/** Implements extends for Dart classes on JavaScript pro totypes. */\nfunction $inherits(child, parent) {\n if (child.prototype.__proto_ _) {\n child.prototype.__proto__ = parent.prototype;\n } else {\n functio n tmp() {};\n tmp.prototype = parent.prototype;\n child.prototype = new tm p();\n child.prototype.constructor = child;\n }\n}");
12849 }
12442 CoreJs.prototype.generate = function(w) { 12850 CoreJs.prototype.generate = function(w) {
12443 if ($notnull_bool(this.useVarMethod)) { 12851 w.write(this.writer.get$text());
12444 this.useTypeNameOf = true; 12852 this.writer = w;
12445 w.writeln("function $varMethod(name, methods) {\n Object.prototype[name] = function() {\n $patchMethod(this, name, methods);\n return this[name].appl y(this, Array.prototype.slice.call(arguments));\n };\n}\nfunction $patchMethod( obj, name, methods) {\n // Get the prototype to patch.\n // Don't overwrite an existing stub, like the one on Object.prototype\n var proto = Object.getProtot ypeOf(obj);\n if (!proto || proto.hasOwnProperty(name)) proto = obj;\n var met hod;\n while (obj && !(method = methods[obj.$typeNameOf()])) {\n obj = Objec t.getPrototypeOf(obj);\n }\n obj[name] = method || methods['Object'];\n}");
12446 }
12447 if ($notnull_bool(this.useGenStub)) { 12853 if ($notnull_bool(this.useGenStub)) {
12448 this.useThrow = true; 12854 this.useThrow = true;
12449 w.writeln("/**\n * Generates a dynamic call stub for a function.\n * Our goa l is to create a stub method like this on-the-fly:\n * function($0, $1, captur e) { this($0, $1, true, capture); }\n *\n * This stub then replaces the dynamic one on Function, with one that is\n * specialized for that particular function, taking into account its default\n * arguments.\n */\nFunction.prototype.$genStub = function(argsLength, names) {\n // TODO(jmesserly): only emit $genStub if ac tually needed\n\n // Fast path: if no named arguments and arg count matches\n if (this.length == argsLength && !names) {\n return this;\n }\n\n function $throwArgMismatch() {\n // TODO(jmesserly): better error message\n $throw( new ClosureArgumentMismatchException());\n }\n\n var paramsNamed = this.$optio nal ? (this.$optional.length / 2) : 0;\n var paramsBare = this.length - paramsN amed;\n var argsNamed = names ? names.length : 0;\n var argsBare = argsLength - argsNamed;\n\n // Check we got the right number of arguments\n if (argsBare < paramsBare || argsLength > this.length ||\n argsNamed > paramsNamed) {\n return $throwArgMismatch;\n }\n\n // First, fill in all of the default valu es\n var p = new Array(paramsBare);\n if (paramsNamed) {\n p = p.concat(thi s.$optional.slice(paramsNamed));\n }\n // Fill in positional args\n var a = n ew Array(argsLength);\n for (var i = 0; i < argsBare; i++) {\n p[i] = a[i] = '$' + i;\n }\n // Then overwrite with supplied values for optional args\n va r lastParameterIndex;\n var namesInOrder = true;\n for (var i = 0; i < argsNam ed; i++) {\n var name = names[i];\n a[i + argsBare] = name;\n var j = t his.$optional.indexOf(name, 0);\n if (j < 0 || j >= paramsNamed) {\n ret urn $throwArgMismatch;\n } else if (lastParameterIndex && lastParameterIndex > j) {\n namesInOrder = false;\n }\n p[j + paramsBare] = name;\n l astParameterIndex = j;\n }\n\n if (this.length == argsLength && namesInOrder) {\n // Fast path #2: named arguments, but they're in order.\n return this; \n }\n\n // Note: using Function instead of 'eval' to get a clean scope.\n // TODO(jmesserly): evaluate the performance of these stubs.\n var f = 'function( ' + a.join(',') + '){return $f(' + p.join(',') + ');}';\n return new Function(' $f', 'return ' + f + '').call(null, this);\n}"); 12855 w.writeln("/**\n * Generates a dynamic call stub for a function.\n * Our goa l is to create a stub method like this on-the-fly:\n * function($0, $1, captur e) { return this($0, $1, true, capture); }\n *\n * This stub then replaces the d ynamic one on Function, with one that is\n * specialized for that particular fun ction, taking into account its default\n * arguments.\n */\nFunction.prototype.$ genStub = function(argsLength, names) {\n // Fast path: if no named arguments a nd arg count matches\n if (this.length == argsLength && !names) {\n return t his;\n }\n\n function $throwArgMismatch() {\n // TODO(jmesserly): better er ror message\n $throw(new ClosureArgumentMismatchException());\n }\n\n var p aramsNamed = this.$optional ? (this.$optional.length / 2) : 0;\n var paramsBare = this.length - paramsNamed;\n var argsNamed = names ? names.length : 0;\n va r argsBare = argsLength - argsNamed;\n\n // Check we got the right number of ar guments\n if (argsBare < paramsBare || argsLength > this.length ||\n argsN amed > paramsNamed) {\n return $throwArgMismatch;\n }\n\n // First, fill in all of the default values\n var p = new Array(paramsBare);\n if (paramsNamed) {\n p = p.concat(this.$optional.slice(paramsNamed));\n }\n // Fill in posi tional args\n var a = new Array(argsLength);\n for (var i = 0; i < argsBare; i ++) {\n p[i] = a[i] = '$' + i;\n }\n // Then overwrite with supplied values for optional args\n var lastParameterIndex;\n var namesInOrder = true;\n for (var i = 0; i < argsNamed; i++) {\n var name = names[i];\n a[i + argsBare ] = name;\n var j = this.$optional.indexOf(name, 0);\n if (j < 0 || j >= p aramsNamed) {\n return $throwArgMismatch;\n } else if (lastParameterInde x && lastParameterIndex > j) {\n namesInOrder = false;\n }\n p[j + pa ramsBare] = name;\n lastParameterIndex = j;\n }\n\n if (this.length == args Length && namesInOrder) {\n // Fast path #2: named arguments, but they're in order.\n return this;\n }\n\n // Note: using Function instead of 'eval' to get a clean scope.\n // TODO(jmesserly): evaluate the performance of these stub s.\n var f = 'function(' + a.join(',') + '){return $f(' + p.join(',') + ');}';\ n return new Function('$f', 'return ' + f + '').call(null, this);\n}");
12450 } 12856 }
12451 if ($notnull_bool(this.useStackTraceOf)) { 12857 if ($notnull_bool(this.useStackTraceOf)) {
12452 w.writeln("function $stackTraceOf(e) {\n // TODO(jmesserly): we shouldn't b e relying on the e.stack property.\n // Need to mangle it.\n return (e && e.s tack) ? e.stack : null;\n}"); 12858 w.writeln("function $stackTraceOf(e) {\n // TODO(jmesserly): we shouldn't b e relying on the e.stack property.\n // Need to mangle it.\n return (e && e.s tack) ? e.stack : null;\n}");
12453 } 12859 }
12454 if ($notnull_bool(this.useNotNullBool)) { 12860 if ($notnull_bool(this.useNotNullBool)) {
12455 this.useThrow = true; 12861 this.useThrow = true;
12456 w.writeln("function $notnull_bool(test) {\n return (test === true || test = == false) ? test : test.is$bool(); // TypeError\n}"); 12862 w.writeln("function $notnull_bool(test) {\n if (test === true || test === f alse) return test;\n $throw(new TypeError(test, 'bool'));\n}");
12457 } 12863 }
12458 if ($notnull_bool(this.useAssert)) { 12864 if ($notnull_bool(this.useAssert)) {
12459 this.useThrow = true; 12865 this.useThrow = true;
12460 w.writeln("function $assert(test, text, url, line, column) {\n if (typeof t est == 'function') test = test();\n if (!test) $throw(new AssertError(text, url , line, column));\n}"); 12866 w.writeln("function $assert(test, text, url, line, column) {\n if (typeof t est == 'function') test = test();\n if (!test) $throw(new AssertError(text, url , line, column));\n}");
12461 } 12867 }
12462 if ($notnull_bool(this.useThrow)) { 12868 if ($notnull_bool(this.useThrow)) {
12463 w.writeln("function $throw(e) {\n // If e is not a value, we can use V8's c aptureStackTrace utility method.\n // TODO(jmesserly): capture the stack trace on other JS engines.\n if (e && (typeof e == 'object') && Error.captureStackTra ce) {\n // TODO(jmesserly): this will clobber the e.stack property\n Error .captureStackTrace(e, $throw);\n }\n throw e;\n}"); 12869 w.writeln("function $throw(e) {\n // If e is not a value, we can use V8's c aptureStackTrace utility method.\n // TODO(jmesserly): capture the stack trace on other JS engines.\n if (e && (typeof e == 'object') && Error.captureStackTra ce) {\n // TODO(jmesserly): this will clobber the e.stack property\n Error .captureStackTrace(e, $throw);\n }\n throw e;\n}");
12464 } 12870 }
12465 if ($notnull_bool(this.useMap)) { 12871 if ($notnull_bool(this.useMap)) {
12466 w.writeln("function $map(items) {\n var ret = new HashMapImplementation();\ n for (var i=0; i < items.length;) {\n ret.$setindex(items[i++], items[i++]) ;\n }\n return ret;\n}"); 12872 w.writeln("function $map(items) {\n var ret = new HashMapImplementation();\ n for (var i=0; i < items.length;) {\n ret.$setindex(items[i++], items[i++]) ;\n }\n return ret;\n}");
12467 } 12873 }
12468 if ($notnull_bool(this.useToString)) { 12874 if ($notnull_bool(this.useToString)) {
12469 w.writeln("function $toString(o) {\n if (o == null) return 'null';\n var t = typeof(o);\n if (t == 'object') { return o.toString(); }\n else if (t == 's tring') { return o; }\n else if (t == 'bool') { return ''+o; }\n else if (t == 'number') { return ''+o; }\n else return o.toString();\n}"); 12875 w.writeln("function $toString(o) {\n if (o == null) return 'null';\n var t = typeof(o);\n if (t == 'object') { return o.toString(); }\n else if (t == 's tring') { return o; }\n else if (t == 'bool') { return ''+o; }\n else if (t == 'number') { return ''+o; }\n else return o.toString();\n}");
12470 } 12876 }
12471 if ($notnull_bool(this.useTypeNameOf)) {
12472 w.writeln("Object.prototype.$typeNameOf = function() {\n if ((typeof(window ) != 'undefined' && window.constructor.name == 'DOMWindow')\n || typeof(pro cess) != 'undefined') { // fast-path for Chrome and Node\n return this.constr uctor.name;\n }\n var str = Object.prototype.toString.call(this);\n str = str .substring(8, str.length - 1);\n if (str == 'Window') \n str = 'DOMWindow';\ n return str;\n}");
12473 }
12474 if ($notnull_bool(this.useIndex)) { 12877 if ($notnull_bool(this.useIndex)) {
12475 w.writeln("Object.prototype.$index = function(i) { return this[i]; }\nArray. prototype.$index = function(i) { return this[i]; }\nString.prototype.$index = fu nction(i) { return this[i]; }"); 12878 w.writeln("Object.prototype.$index = function(i) { return this[i]; }\nArray. prototype.$index = function(i) { return this[i]; }\nString.prototype.$index = fu nction(i) { return this[i]; }");
12476 } 12879 }
12477 if ($notnull_bool(this.useSetIndex)) { 12880 if ($notnull_bool(this.useSetIndex)) {
12478 w.writeln("Object.prototype.$setindex = function(i, value) { return this[i] = value; }\nArray.prototype.$setindex = function(i, value) { return this[i] = va lue; }"); 12881 w.writeln("Object.prototype.$setindex = function(i, value) { return this[i] = value; }\nArray.prototype.$setindex = function(i, value) { return this[i] = va lue; }");
12479 } 12882 }
12480 if ($notnull_bool(this.useIsolates)) { 12883 if ($notnull_bool(this.useIsolates)) {
12481 if ($notnull_bool(this.useWrap0)) { 12884 if ($notnull_bool(this.useWrap0)) {
12482 w.writeln("// Wrap a 0-arg dom-callback to bind it with the current isolat e:\nfunction $wrap_call$0(fn) { return fn && fn.wrap$call$0(); }\nFunction.proto type.wrap$call$0 = function() {\n var isolateContext = $globalState.currentCont ext;\n var self = this;\n this.wrap$0 = function() {\n isolateContext.eval( self);\n $globalState.topEventLoop.run();\n };\n this.wrap$call$0 = functio n() { return this.wrap$0; };\n return this.wrap$0;\n}"); 12885 w.writeln("// Wrap a 0-arg dom-callback to bind it with the current isolat e:\nfunction $wrap_call$0(fn) { return fn && fn.wrap$call$0(); }\nFunction.proto type.wrap$call$0 = function() {\n var isolateContext = $globalState.currentCont ext;\n var self = this;\n this.wrap$0 = function() {\n isolateContext.eval( self);\n $globalState.topEventLoop.run();\n };\n this.wrap$call$0 = functio n() { return this.wrap$0; };\n return this.wrap$0;\n}");
12483 } 12886 }
(...skipping 10 matching lines...) Expand all
12494 w.writeln("function $wrap_call$1(fn) { return fn; }"); 12897 w.writeln("function $wrap_call$1(fn) { return fn; }");
12495 } 12898 }
12496 } 12899 }
12497 var $list = orderValuesByKeys(this._usedOperators); 12900 var $list = orderValuesByKeys(this._usedOperators);
12498 for (var $i = 0;$i < $list.length; $i++) { 12901 for (var $i = 0;$i < $list.length; $i++) {
12499 var opImpl = $list.$index($i); 12902 var opImpl = $list.$index($i);
12500 w.writeln($assert_String(opImpl)); 12903 w.writeln($assert_String(opImpl));
12501 } 12904 }
12502 } 12905 }
12503 CoreJs.prototype.generate$1 = function($0) { 12906 CoreJs.prototype.generate$1 = function($0) {
12504 return this.generate(($0 && $0.is$CodeWriter())); 12907 return this.generate(($0 == null ? null : $0.assert$CodeWriter()));
12505 }; 12908 };
12506 // ********** Code for lang_Element ************** 12909 // ********** Code for lang_Element **************
12507 function lang_Element(name, _enclosingElement) { 12910 function lang_Element(name, _enclosingElement) {
12508 this.name = name; 12911 this.name = name;
12509 this._enclosingElement = _enclosingElement; 12912 this._enclosingElement = _enclosingElement;
12510 // Initializers done 12913 // Initializers done
12511 this._jsname = this.name; 12914 this._jsname = this.name;
12512 } 12915 }
12513 lang_Element.prototype.is$lang_Element = function(){return this;}; 12916 lang_Element.prototype.assert$lang_Element = function(){return this};
12514 lang_Element.prototype.get$name = function() { return this.name; }; 12917 lang_Element.prototype.get$name = function() { return this.name; };
12515 lang_Element.prototype.set$name = function(value) { return this.name = value; }; 12918 lang_Element.prototype.set$name = function(value) { return this.name = value; };
12516 lang_Element.prototype.get$library = function() { 12919 lang_Element.prototype.get$library = function() {
12517 return null; 12920 return null;
12518 } 12921 }
12519 lang_Element.prototype.get$span = function() { 12922 lang_Element.prototype.get$span = function() {
12520 return null; 12923 return null;
12521 } 12924 }
12522 lang_Element.prototype.get$isNative = function() { 12925 lang_Element.prototype.get$isNative = function() {
12523 return false; 12926 return false;
12524 } 12927 }
12525 lang_Element.prototype.hashCode = function() { 12928 lang_Element.prototype.hashCode = function() {
12526 return this.name.hashCode(); 12929 return this.name.hashCode();
12527 } 12930 }
12528 lang_Element.prototype.get$jsname = function() { 12931 lang_Element.prototype.get$jsname = function() {
12529 return this._jsname; 12932 return this._jsname;
12530 } 12933 }
12531 lang_Element.prototype.resolve = function() { 12934 lang_Element.prototype.resolve = function() {
12532 12935
12533 } 12936 }
12534 lang_Element.prototype.get$typeParameters = function() { 12937 lang_Element.prototype.get$typeParameters = function() {
12535 return null; 12938 return null;
12536 } 12939 }
12537 lang_Element.prototype.get$enclosingElement = function() { 12940 lang_Element.prototype.get$enclosingElement = function() {
12538 var $0; 12941 var $0;
12539 return (($0 = this._enclosingElement == null ? this.get$library() : this._encl osingElement) && $0.is$lang_Element()); 12942 return (($0 = this._enclosingElement == null ? this.get$library() : this._encl osingElement) == null ? null : $0.assert$lang_Element());
12540 } 12943 }
12541 lang_Element.prototype.set$enclosingElement = function(e) { 12944 lang_Element.prototype.set$enclosingElement = function(e) {
12542 return this._enclosingElement = e; 12945 return this._enclosingElement = e;
12543 } 12946 }
12544 lang_Element.prototype.resolveType = function(node, typeErrors) { 12947 lang_Element.prototype.resolveType = function(node, typeErrors) {
12545 var $0; 12948 var $0;
12546 if (node == null) return $globals.world.varType; 12949 if (node == null) return $globals.world.varType;
12547 if (node.type != null) return node.type; 12950 if (node.type != null) return node.type;
12548 if ((node instanceof NameTypeReference)) { 12951 if ((node instanceof NameTypeReference)) {
12549 var typeRef = (node && node.is$NameTypeReference()); 12952 var typeRef = (node == null ? null : node.assert$NameTypeReference());
12550 var name; 12953 var name;
12551 if (typeRef.names != null) { 12954 if (typeRef.names != null) {
12552 name = $assert_String(typeRef.names.last().get$name()); 12955 name = $assert_String(typeRef.names.last().get$name());
12553 } 12956 }
12554 else { 12957 else {
12555 name = typeRef.name.name; 12958 name = typeRef.name.name;
12556 } 12959 }
12557 if (this.get$typeParameters() != null) { 12960 if (this.get$typeParameters() != null) {
12558 var $list = this.get$typeParameters(); 12961 var $list = this.get$typeParameters();
12559 for (var $i = 0;$i < $list.length; $i++) { 12962 for (var $i = 0;$i < $list.length; $i++) {
12560 var tp = $list.$index($i); 12963 var tp = $list.$index($i);
12561 if ($notnull_bool($eq(tp.get$name(), name))) { 12964 if ($notnull_bool($eq(tp.get$name(), name))) {
12562 typeRef.type = (tp && tp.is$lang_Type()); 12965 typeRef.type = (tp == null ? null : tp.assert$lang_Type());
12563 } 12966 }
12564 } 12967 }
12565 } 12968 }
12566 if (typeRef.type != null) { 12969 if (typeRef.type != null) {
12567 return typeRef.type; 12970 return typeRef.type;
12568 } 12971 }
12569 return this.get$enclosingElement().resolveType(node, typeErrors); 12972 return this.get$enclosingElement().resolveType(node, typeErrors);
12570 } 12973 }
12571 else if ((node instanceof GenericTypeReference)) { 12974 else if ((node instanceof GenericTypeReference)) {
12572 var typeRef = (node && node.is$GenericTypeReference()); 12975 var typeRef = (node == null ? null : node.assert$GenericTypeReference());
12573 var baseType = this.resolveType(typeRef.baseType, typeErrors); 12976 var baseType = this.resolveType(typeRef.baseType, typeErrors);
12574 if (!$notnull_bool(baseType.get$isGeneric())) { 12977 if (!$notnull_bool(baseType.get$isGeneric())) {
12575 $globals.world.error(('' + baseType.get$name() + ' is not generic'), typeR ef.span); 12978 $globals.world.error(('' + baseType.get$name() + ' is not generic'), typeR ef.span);
12576 return null; 12979 return null;
12577 } 12980 }
12578 if (typeRef.typeArguments.length != baseType.get$typeParameters().length) { 12981 if (typeRef.typeArguments.length != baseType.get$typeParameters().length) {
12579 $globals.world.error('wrong number of type arguments', typeRef.span); 12982 $globals.world.error('wrong number of type arguments', typeRef.span);
12580 return null; 12983 return null;
12581 } 12984 }
12582 var typeArgs = []; 12985 var typeArgs = [];
12583 for (var i = 0; 12986 for (var i = 0;
12584 i < typeRef.typeArguments.length; i++) { 12987 i < typeRef.typeArguments.length; i++) {
12585 var extendsType = baseType.get$typeParameters().$index(i).get$extendsType( ); 12988 var extendsType = baseType.get$typeParameters().$index(i).get$extendsType( );
12586 var typeArg = this.resolveType((($0 = typeRef.typeArguments.$index(i)) && $0.is$TypeReference()), typeErrors); 12989 var typeArg = this.resolveType((($0 = typeRef.typeArguments.$index(i)) == null ? null : $0.assert$TypeReference()), typeErrors);
12587 typeArgs.add$1(typeArg); 12990 typeArgs.add$1(typeArg);
12588 if ($notnull_bool($ne(extendsType, null)) && !(typeArg instanceof Paramete rType)) { 12991 if ($notnull_bool($ne(extendsType, null)) && !(typeArg instanceof Paramete rType)) {
12589 typeArg.ensureSubtypeOf$3(extendsType, typeRef.typeArguments.$index(i).g et$span(), typeErrors); 12992 typeArg.ensureSubtypeOf$3(extendsType, typeRef.typeArguments.$index(i).g et$span(), typeErrors);
12590 } 12993 }
12591 } 12994 }
12592 typeRef.type = (($0 = baseType.getOrMakeConcreteType$1(typeArgs)) && $0.is$l ang_Type()); 12995 typeRef.type = (($0 = baseType.getOrMakeConcreteType$1(typeArgs)) == null ? null : $0.assert$lang_Type());
12593 } 12996 }
12594 else if ((node instanceof FunctionTypeReference)) { 12997 else if ((node instanceof FunctionTypeReference)) {
12595 var typeRef = (node && node.is$FunctionTypeReference()); 12998 var typeRef = (node == null ? null : node.assert$FunctionTypeReference());
12596 var name = ''; 12999 var name = '';
12597 if (typeRef.func.name != null) { 13000 if (typeRef.func.name != null) {
12598 name = typeRef.func.name.name; 13001 name = typeRef.func.name.name;
12599 } 13002 }
12600 typeRef.type = this.get$library().getOrAddFunctionType(this, $assert_String( name), typeRef.func); 13003 typeRef.type = this.get$library().getOrAddFunctionType(this, $assert_String( name), typeRef.func);
12601 } 13004 }
12602 else { 13005 else {
12603 $globals.world.internalError('unknown type reference', node.span); 13006 $globals.world.internalError('unknown type reference', node.span);
12604 } 13007 }
12605 return node.type; 13008 return node.type;
12606 } 13009 }
12607 lang_Element.prototype.hashCode$0 = lang_Element.prototype.hashCode; 13010 lang_Element.prototype.hashCode$0 = lang_Element.prototype.hashCode;
12608 lang_Element.prototype.resolve$0 = lang_Element.prototype.resolve; 13011 lang_Element.prototype.resolve$0 = lang_Element.prototype.resolve;
12609 // ********** Code for WorldGenerator ************** 13012 // ********** Code for WorldGenerator **************
12610 function WorldGenerator(main, writer) { 13013 function WorldGenerator(main, writer) {
12611 this.hasStatics = false 13014 this.hasStatics = false
12612 this._inheritsGenerated = false
12613 this.main = main; 13015 this.main = main;
12614 this.writer = writer; 13016 this.writer = writer;
12615 this.globals = $map([]); 13017 this.globals = $map([]);
12616 this.corejs = new CoreJs(); 13018 this.corejs = new CoreJs();
12617 // Initializers done 13019 // Initializers done
12618 } 13020 }
12619 WorldGenerator.prototype.run = function() { 13021 WorldGenerator.prototype.run = function() {
12620 var $0; 13022 var $0;
12621 var metaGen = new MethodGenerator(this.main, null); 13023 var metaGen = new MethodGenerator(this.main, null);
12622 var mainTarget = new Value.type$ctor(this.main.declaringType, this.main.get$sp an()); 13024 var mainTarget = new Value.type$ctor(this.main.declaringType, this.main.get$sp an());
12623 var mainCall = this.main.invoke((metaGen && metaGen.is$MethodGenerator()), nul l, (mainTarget && mainTarget.is$Value()), Arguments.get$EMPTY(), false); 13025 var mainCall = this.main.invoke((metaGen == null ? null : metaGen.assert$Metho dGenerator()), null, (mainTarget == null ? null : mainTarget.assert$Value()), Ar guments.get$EMPTY(), false);
12624 this.main.declaringType.markUsed(); 13026 this.main.declaringType.markUsed();
12625 if ($notnull_bool($globals.options.compileAll)) { 13027 if ($notnull_bool($globals.options.compileAll)) {
12626 this.markLibraryUsed($globals.world.corelib); 13028 this.markLibraryUsed($globals.world.corelib);
12627 this.markLibraryUsed(this.main.declaringType.get$library()); 13029 this.markLibraryUsed(this.main.declaringType.get$library());
12628 } 13030 }
12629 else { 13031 else {
12630 $globals.world.corelib.types.$index('BadNumberFormatException').markUsed$0() ; 13032 $globals.world.corelib.types.$index('BadNumberFormatException').markUsed$0() ;
12631 $globals.world.get$coreimpl().types.$index('NumImplementation').markUsed$0() ; 13033 $globals.world.get$coreimpl().types.$index('NumImplementation').markUsed$0() ;
12632 $globals.world.get$coreimpl().types.$index('StringImplementation').markUsed$ 0(); 13034 $globals.world.get$coreimpl().types.$index('StringImplementation').markUsed$ 0();
12633 this.genMethod((($0 = $globals.world.get$coreimpl().types.$index('StringImpl ementation').getMember$1('contains')) && $0.is$Member())); 13035 this.genMethod((($0 = $globals.world.get$coreimpl().types.$index('StringImpl ementation').getMember$1('contains')) == null ? null : $0.assert$Member()));
12634 } 13036 }
12635 if ($notnull_bool($globals.world.corelib.types.$index('Isolate').get$isUsed()) || $notnull_bool($globals.world.get$coreimpl().types.$index('ReceivePortImpl'). get$isUsed())) { 13037 if ($notnull_bool($globals.world.corelib.types.$index('Isolate').get$isUsed()) || $notnull_bool($globals.world.get$coreimpl().types.$index('ReceivePortImpl'). get$isUsed())) {
12636 if ($notnull_bool(this.corejs.useWrap0) || $notnull_bool(this.corejs.useWrap 1)) { 13038 if ($notnull_bool(this.corejs.useWrap0) || $notnull_bool(this.corejs.useWrap 1)) {
12637 this.genMethod((($0 = $globals.world.get$coreimpl().types.$index('IsolateC ontext').getMember$1('eval')) && $0.is$Member())); 13039 this.genMethod((($0 = $globals.world.get$coreimpl().types.$index('IsolateC ontext').getMember$1('eval')) == null ? null : $0.assert$Member()));
12638 this.genMethod((($0 = $globals.world.get$coreimpl().types.$index('EventLoo p').getMember$1('run')) && $0.is$Member())); 13040 this.genMethod((($0 = $globals.world.get$coreimpl().types.$index('EventLoo p').getMember$1('run')) == null ? null : $0.assert$Member()));
12639 } 13041 }
12640 this.corejs.useIsolates = true; 13042 this.corejs.useIsolates = true;
12641 var isolateMain = (($0 = $globals.world.get$coreimpl().topType.resolveMember ('startRootIsolate').members.$index(0)) && $0.is$MethodMember()); 13043 var isolateMain = (($0 = $globals.world.get$coreimpl().topType.resolveMember ('startRootIsolate').members.$index(0)) == null ? null : $0.assert$MethodMember( ));
12642 var isolateMainTarget = new Value.type$ctor($globals.world.get$coreimpl().to pType, this.main.get$span()); 13044 var isolateMainTarget = new Value.type$ctor($globals.world.get$coreimpl().to pType, this.main.get$span());
12643 mainCall = isolateMain.invoke((metaGen && metaGen.is$MethodGenerator()), nul l, (isolateMainTarget && isolateMainTarget.is$Value()), new Arguments(null, [thi s.main._get((metaGen && metaGen.is$MethodGenerator()), this.main.definition, nul l, false)]), false); 13045 mainCall = isolateMain.invoke((metaGen == null ? null : metaGen.assert$Metho dGenerator()), null, (isolateMainTarget == null ? null : isolateMainTarget.asser t$Value()), new Arguments(null, [this.main._get((metaGen == null ? null : metaGe n.assert$MethodGenerator()), this.main.definition, null, false)]), false);
12644 } 13046 }
12645 this.writeTypes($globals.world.get$coreimpl()); 13047 this.writeTypes($globals.world.get$coreimpl());
12646 this.writeTypes($globals.world.corelib); 13048 this.writeTypes($globals.world.corelib);
12647 this.writeTypes(this.main.declaringType.get$library()); 13049 this.writeTypes(this.main.declaringType.get$library());
12648 if (this._mixins != null) this.writer.write(this._mixins.get$text()); 13050 if (this._mixins != null) this.writer.write(this._mixins.get$text());
12649 this.writeGlobals(); 13051 this.writeGlobals();
12650 this.writer.writeln(('' + mainCall.get$code() + ';')); 13052 this.writer.writeln(('' + mainCall.get$code() + ';'));
12651 } 13053 }
12652 WorldGenerator.prototype.markLibraryUsed = function(l) { 13054 WorldGenerator.prototype.markLibraryUsed = function(l) {
12653 var $this = this; // closure support 13055 var $this = this; // closure support
12654 var $0; 13056 var $0;
12655 if ($notnull_bool(l.isMarked)) return; 13057 if ($notnull_bool(l.isMarked)) return;
12656 l.isMarked = true; 13058 l.isMarked = true;
12657 l.imports.forEach((function (i) { 13059 l.imports.forEach((function (i) {
12658 var $0; 13060 var $0;
12659 return $this.markLibraryUsed((($0 = i.get$library()) && $0.is$Library())); 13061 return $this.markLibraryUsed((($0 = i.get$library()) == null ? null : $0.ass ert$Library()));
12660 }) 13062 })
12661 ); 13063 );
12662 var $list = l.types.getValues(); 13064 var $list = l.types.getValues();
12663 for (var $i = l.types.getValues().iterator$0(); $i.hasNext$0(); ) { 13065 for (var $i = l.types.getValues().iterator$0(); $i.hasNext$0(); ) {
12664 var type = $i.next$0(); 13066 var type = $i.next$0();
12665 if (!$notnull_bool(type.get$isClass())) continue; 13067 if (!$notnull_bool(type.get$isClass())) continue;
12666 type.markUsed$0(); 13068 type.markUsed$0();
12667 type.set$isTested(!$notnull_bool(type.get$isTop()) && !($notnull_bool(type.g et$isNative()) && $notnull_bool(type.get$members().getValues$0().every$1((functi on (m) { 13069 type.set$isTested(!$notnull_bool(type.get$isTop()) && !($notnull_bool(type.g et$isNative()) && $notnull_bool(type.get$members().getValues$0().every$1((functi on (m) {
12668 return $notnull_bool(m.get$isStatic()) && !$notnull_bool(m.get$isFactory() ); 13070 return $notnull_bool(m.get$isStatic()) && !$notnull_bool(m.get$isFactory() );
12669 }) 13071 })
12670 )))); 13072 ))));
12671 var $list0 = type.get$members().getValues$0(); 13073 var $list0 = type.get$members().getValues$0();
12672 for (var $i0 = type.get$members().getValues$0().iterator$0(); $i0.hasNext$0( ); ) { 13074 for (var $i0 = type.get$members().getValues$0().iterator$0(); $i0.hasNext$0( ); ) {
12673 var member = $i0.next$0(); 13075 var member = $i0.next$0();
12674 if ((member instanceof PropertyMember)) { 13076 if ((member instanceof PropertyMember)) {
12675 if ($notnull_bool($ne(member.get$getter(), null))) this.genMethod((($0 = member.get$getter()) && $0.is$Member())); 13077 if ($notnull_bool($ne(member.get$getter(), null))) this.genMethod((($0 = member.get$getter()) == null ? null : $0.assert$Member()));
12676 if ($notnull_bool($ne(member.get$setter(), null))) this.genMethod((($0 = member.get$setter()) && $0.is$Member())); 13078 if ($notnull_bool($ne(member.get$setter(), null))) this.genMethod((($0 = member.get$setter()) == null ? null : $0.assert$Member()));
12677 } 13079 }
12678 if ($notnull_bool(member.get$isMethod())) this.genMethod((member && member .is$Member())); 13080 if ($notnull_bool(member.get$isMethod())) this.genMethod((member == null ? null : member.assert$Member()));
12679 } 13081 }
12680 } 13082 }
12681 } 13083 }
12682 WorldGenerator.prototype.globalForStaticField = function(field, fieldValue, depe ndencies) { 13084 WorldGenerator.prototype.globalForStaticField = function(field, fieldValue, depe ndencies) {
12683 var $0; 13085 var $0;
12684 this.hasStatics = true; 13086 this.hasStatics = true;
12685 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname ()); 13087 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname ());
12686 if (!this.globals.containsKey(fullname)) { 13088 if (!this.globals.containsKey(fullname)) {
12687 this.globals.$setindex(fullname, GlobalValue.GlobalValue$fromStatic$factory( field, fieldValue, dependencies)); 13089 this.globals.$setindex(fullname, GlobalValue.GlobalValue$fromStatic$factory( field, fieldValue, dependencies));
12688 } 13090 }
12689 return (($0 = this.globals.$index(fullname)) && $0.is$GlobalValue()); 13091 return (($0 = this.globals.$index(fullname)) == null ? null : $0.assert$Global Value());
12690 } 13092 }
12691 WorldGenerator.prototype.globalForConst = function(exp, dependencies) { 13093 WorldGenerator.prototype.globalForConst = function(exp, dependencies) {
12692 var $0; 13094 var $0;
12693 var key = exp.type.get$jsname() + ':' + exp.canonicalCode; 13095 var key = exp.type.get$jsname() + ':' + exp.canonicalCode;
12694 if (!this.globals.containsKey(key)) { 13096 if (!this.globals.containsKey(key)) {
12695 this.globals.$setindex(key, GlobalValue.GlobalValue$fromConst$factory(this.g lobals.get$length(), exp, dependencies)); 13097 this.globals.$setindex(key, GlobalValue.GlobalValue$fromConst$factory(this.g lobals.get$length(), exp, dependencies));
12696 } 13098 }
12697 $assert($eq(this.globals.$index(key).get$type(), exp.type), "globals[key].type == exp.type", "gen.dart", 128, 12); 13099 $assert($eq(this.globals.$index(key).get$type(), exp.type), "globals[key].type == exp.type", "gen.dart", 130, 12);
12698 return (($0 = this.globals.$index(key)) && $0.is$GlobalValue()); 13100 return (($0 = this.globals.$index(key)) == null ? null : $0.assert$GlobalValue ());
12699 } 13101 }
12700 WorldGenerator.prototype.writeTypes = function(lib) { 13102 WorldGenerator.prototype.writeTypes = function(lib) {
12701 var $0; 13103 var $0;
12702 if ($notnull_bool(lib.isWritten)) return; 13104 if ($notnull_bool(lib.isWritten)) return;
12703 lib.isWritten = true; 13105 lib.isWritten = true;
12704 var $list = lib.imports; 13106 var $list = lib.imports;
12705 for (var $i = 0;$i < $list.length; $i++) { 13107 for (var $i = 0;$i < $list.length; $i++) {
12706 var import_ = $list.$index($i); 13108 var import_ = $list.$index($i);
12707 this.writeTypes((($0 = import_.get$library()) && $0.is$Library())); 13109 this.writeTypes((($0 = import_.get$library()) == null ? null : $0.assert$Lib rary()));
12708 } 13110 }
12709 for (var i = 0; 13111 for (var i = 0;
12710 i < lib.sources.length; i++) { 13112 i < lib.sources.length; i++) {
12711 lib.sources.$index(i).set$orderInLibrary(i); 13113 lib.sources.$index(i).set$orderInLibrary(i);
12712 } 13114 }
12713 this.writer.comment(('// ********** Library ' + lib.name + ' **************') ); 13115 this.writer.comment(('// ********** Library ' + lib.name + ' **************') );
12714 if ($notnull_bool(lib.get$isCore())) { 13116 if ($notnull_bool(lib.get$isCore())) {
12715 this.writer.comment('// ********** Natives dart:core **************'); 13117 this.writer.comment('// ********** Natives dart:core **************');
12716 this.corejs.generate(this.writer); 13118 this.corejs.generate(this.writer);
12717 } 13119 }
12718 var $list = lib.natives; 13120 var $list = lib.natives;
12719 for (var $i = 0;$i < $list.length; $i++) { 13121 for (var $i = 0;$i < $list.length; $i++) {
12720 var file = $list.$index($i); 13122 var file = $list.$index($i);
12721 var filename = basename($assert_String(file.get$filename())); 13123 var filename = basename($assert_String(file.get$filename()));
12722 this.writer.comment(('// ********** Natives ' + filename + ' ************** ')); 13124 this.writer.comment(('// ********** Natives ' + filename + ' ************** '));
12723 this.writer.writeln($assert_String(file.get$text())); 13125 this.writer.writeln($assert_String(file.get$text()));
12724 } 13126 }
12725 lib.topType.markUsed(); 13127 lib.topType.markUsed();
12726 var $list = this._orderValues(lib.types); 13128 var $list = this._orderValues(lib.types);
12727 for (var $i = 0;$i < $list.length; $i++) { 13129 for (var $i = 0;$i < $list.length; $i++) {
12728 var type = $list.$index($i); 13130 var type = $list.$index($i);
12729 if ($notnull_bool(type.get$isUsed()) && $notnull_bool(type.get$isClass())) { 13131 if (($notnull_bool(type.get$isUsed()) || $notnull_bool(type.get$isHiddenNati veType())) && $notnull_bool(type.get$isClass())) {
12730 this.writeType((type && type.is$lang_Type())); 13132 this.writeType((type == null ? null : type.assert$lang_Type()));
12731 if ($notnull_bool(type.get$isGeneric())) { 13133 if ($notnull_bool(type.get$isGeneric())) {
12732 var $list0 = this._orderValues(type._concreteTypes); 13134 var $list0 = this._orderValues(type._concreteTypes);
12733 for (var $i0 = 0;$i0 < $list0.length; $i0++) { 13135 for (var $i0 = 0;$i0 < $list0.length; $i0++) {
12734 var ct = $list0.$index($i0); 13136 var ct = $list0.$index($i0);
12735 this.writeType((ct && ct.is$lang_Type())); 13137 this.writeType((ct == null ? null : ct.assert$lang_Type()));
12736 } 13138 }
12737 } 13139 }
12738 } 13140 }
12739 if ($notnull_bool(type.get$isFunction()) && $notnull_bool($ne(type.get$varSt ubs(), null))) { 13141 else if ($notnull_bool(type.get$isFunction()) && type.get$varStubs().length > 0) {
12740 this.writer.comment(('// ********** Code for ' + type.get$jsname() + ' *** ***********')); 13142 this.writer.comment(('// ********** Code for ' + type.get$jsname() + ' *** ***********'));
12741 this._writeDynamicStubs((type && type.is$lang_Type())); 13143 this._writeDynamicStubs((type == null ? null : type.assert$lang_Type()));
12742 } 13144 }
12743 if ($notnull_bool($ne(type.get$typeCheckCode(), null))) { 13145 if ($notnull_bool($ne(type.get$typeCheckCode(), null))) {
12744 this.writer.writeln($assert_String(type.get$typeCheckCode())); 13146 this.writer.writeln($assert_String(type.get$typeCheckCode()));
12745 } 13147 }
12746 } 13148 }
12747 } 13149 }
12748 WorldGenerator.prototype.genMethod = function(meth, enclosingMethod) { 13150 WorldGenerator.prototype.genMethod = function(meth, enclosingMethod) {
12749 if (!$notnull_bool(meth.isGenerated) && !$notnull_bool(meth.get$isAbstract()) && $notnull_bool($ne(meth.get$definition(), null))) { 13151 if (!$notnull_bool(meth.isGenerated) && !$notnull_bool(meth.get$isAbstract()) && $notnull_bool($ne(meth.get$definition(), null))) {
12750 new MethodGenerator(meth, enclosingMethod).run(); 13152 new MethodGenerator(meth, enclosingMethod).run();
12751 } 13153 }
12752 } 13154 }
13155 WorldGenerator.prototype._prototypeOf = function(type, name) {
13156 if ($notnull_bool(type.get$isHiddenNativeType())) {
13157 this.corejs.ensureDynamicProto();
13158 return ('\$dynamic("' + name + '").' + type.get$jsname());
13159 }
13160 else {
13161 return ('' + type.get$jsname() + '.prototype.' + name);
13162 }
13163 }
12753 WorldGenerator.prototype._maybeIsTest = function(onType, checkType) { 13164 WorldGenerator.prototype._maybeIsTest = function(onType, checkType) {
12754 if (!$notnull_bool(checkType.isTested)) return; 13165 var isSubtype = onType.isSubtypeOf(checkType);
12755 var value = 'false'; 13166 if ($notnull_bool(checkType.isTested)) {
12756 if ($notnull_bool(onType.isSubtypeOf(checkType))) { 13167 this.writer.writeln(this._prototypeOf(onType, ('is\$' + checkType.get$jsname ())) + (' = function(){return ' + isSubtype + '};'));
12757 value = 'function(){return this;}';
12758 } 13168 }
12759 this.writer.writeln(('' + onType.get$jsname() + '.prototype.is\$' + checkType. get$jsname() + ' = ') + ('' + value + ';')); 13169 if ($notnull_bool(checkType.isChecked)) {
13170 var body = 'return this';
13171 var checkName = ('assert\$' + checkType.get$jsname());
13172 if (!$notnull_bool(isSubtype)) {
13173 body = $assert_String($globals.world.objectType.varStubs.$index(checkName) .get$body());
13174 }
13175 this.writer.writeln(this._prototypeOf(onType, checkName) + (' = function(){' + body + '};'));
13176 }
12760 } 13177 }
12761 WorldGenerator.prototype.writeType = function(type) { 13178 WorldGenerator.prototype.writeType = function(type) {
12762 var $0; 13179 var $0;
12763 if (type.name != null && (type instanceof ConcreteType) && $eq(type.get$librar y(), $globals.world.get$coreimpl()) && type.name.startsWith('ListFactory')) { 13180 if (type.name != null && (type instanceof ConcreteType) && $eq(type.get$librar y(), $globals.world.get$coreimpl()) && type.name.startsWith('ListFactory')) {
12764 this.writer.writeln(('' + type.get$jsname() + ' = ' + type.get$genericType() .get$jsname() + ';')); 13181 this.writer.writeln(('' + type.get$jsname() + ' = ' + type.get$genericType() .get$jsname() + ';'));
12765 return; 13182 return;
12766 } 13183 }
12767 var typeName = type.get$jsname() != null ? type.get$jsname() : 'top level'; 13184 var typeName = type.get$jsname() != null ? type.get$jsname() : 'top level';
12768 this.writer.comment(('// ********** Code for ' + typeName + ' **************') ); 13185 this.writer.comment(('// ********** Code for ' + typeName + ' **************') );
12769 if ($notnull_bool(type.get$isNative()) && !$notnull_bool(type.get$isTop())) { 13186 if ($notnull_bool(type.get$isNative()) && !$notnull_bool(type.get$isTop())) {
12770 var nativeName = type.get$definition().get$nativeType().get$name(); 13187 var nativeName = type.get$definition().get$nativeType().get$name();
12771 if ($notnull_bool($eq(nativeName, ''))) { 13188 if ($notnull_bool($eq(nativeName, ''))) {
12772 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); 13189 this.writer.writeln(('function ' + type.get$jsname() + '() {}'));
12773 } 13190 }
12774 else if (type.get$jsname() != nativeName) { 13191 else if (type.get$jsname() != nativeName) {
12775 this.writer.writeln(('' + type.get$jsname() + ' = ' + nativeName + ';')); 13192 this.writer.writeln(('' + type.get$jsname() + ' = ' + nativeName + ';'));
12776 } 13193 }
12777 } 13194 }
12778 if ($notnull_bool(type.get$isTop())) { 13195 if ($notnull_bool(type.get$isTop())) {
12779 } 13196 }
12780 else if (type.get$constructors().get$length() == 0) { 13197 else if (type.get$constructors().get$length() == 0) {
12781 if (!$notnull_bool(type.get$isNative())) { 13198 if (!$notnull_bool(type.get$isNative())) {
12782 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); 13199 this.writer.writeln(('function ' + type.get$jsname() + '() {}'));
12783 } 13200 }
12784 } 13201 }
12785 else { 13202 else {
12786 var standardConstructor = (($0 = type.get$constructors().$index('')) && $0.i s$Member()); 13203 var standardConstructor = (($0 = type.get$constructors().$index('')) == null ? null : $0.assert$Member());
12787 if (standardConstructor == null || standardConstructor.generator == null) { 13204 if (standardConstructor == null || standardConstructor.generator == null) {
12788 if (!$notnull_bool(type.get$isNative())) { 13205 if (!$notnull_bool(type.get$isNative())) {
12789 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); 13206 this.writer.writeln(('function ' + type.get$jsname() + '() {}'));
12790 } 13207 }
12791 } 13208 }
12792 else { 13209 else {
12793 standardConstructor.generator.writeDefinition(this.writer, null); 13210 standardConstructor.generator.writeDefinition(this.writer, null);
12794 } 13211 }
12795 var $list = type.get$constructors().getValues(); 13212 var $list = type.get$constructors().getValues();
12796 for (var $i = type.get$constructors().getValues().iterator$0(); $i.hasNext$0 (); ) { 13213 for (var $i = type.get$constructors().getValues().iterator$0(); $i.hasNext$0 (); ) {
12797 var c = $i.next$0(); 13214 var c = $i.next$0();
12798 if ($notnull_bool($ne(c.get$generator(), null)) && $notnull_bool($ne(c, st andardConstructor))) { 13215 if ($notnull_bool($ne(c.get$generator(), null)) && $notnull_bool($ne(c, st andardConstructor))) {
12799 c.get$generator().writeDefinition$2(this.writer); 13216 c.get$generator().writeDefinition$2(this.writer);
12800 } 13217 }
12801 } 13218 }
12802 } 13219 }
12803 if (!$notnull_bool(type.get$isTop())) { 13220 if (!$notnull_bool(type.get$isTop())) {
12804 if ((type instanceof ConcreteType)) { 13221 if ((type instanceof ConcreteType)) {
12805 var c = (type && type.is$ConcreteType()); 13222 var c = (type == null ? null : type.assert$ConcreteType());
12806 this._ensureInheritsHelper(); 13223 this.corejs.ensureInheritsHelper();
12807 this.writer.writeln(('\$inherits(' + c.get$jsname() + ', ' + c.genericType .get$jsname() + ');')); 13224 this.writer.writeln(('\$inherits(' + c.get$jsname() + ', ' + c.genericType .get$jsname() + ');'));
12808 for (var p = c._parent; 13225 for (var p = c._parent;
12809 (p instanceof ConcreteType); p = p._parent) { 13226 (p instanceof ConcreteType); p = p._parent) {
12810 this._ensureInheritMembersHelper(); 13227 this._ensureInheritMembersHelper();
12811 this._mixins.writeln(('\$inheritsMembers(' + c.get$jsname() + ', ' + p.g et$jsname() + ');')); 13228 this._mixins.writeln(('\$inheritsMembers(' + c.get$jsname() + ', ' + p.g et$jsname() + ');'));
12812 } 13229 }
12813 } 13230 }
12814 else if (!$notnull_bool(type.get$isNative())) { 13231 else if (!$notnull_bool(type.get$isNative())) {
12815 if (type.get$parent() != null && !$notnull_bool(type.get$parent().get$isOb ject())) { 13232 if (type.get$parent() != null && !$notnull_bool(type.get$parent().get$isOb ject())) {
12816 this._ensureInheritsHelper(); 13233 this.corejs.ensureInheritsHelper();
12817 this.writer.writeln(('\$inherits(' + type.get$jsname() + ', ' + type.get $parent().get$jsname() + ');')); 13234 this.writer.writeln(('\$inherits(' + type.get$jsname() + ', ' + type.get $parent().get$jsname() + ');'));
12818 } 13235 }
12819 } 13236 }
12820 } 13237 }
12821 if (!(type instanceof ConcreteType)) { 13238 if (!(type instanceof ConcreteType)) {
12822 this._maybeIsTest(type, type); 13239 this._maybeIsTest(type, type);
12823 } 13240 }
12824 if (type.get$genericType()._concreteTypes != null) { 13241 if (type.get$genericType()._concreteTypes != null) {
12825 var $list = this._orderValues(type.get$genericType()._concreteTypes); 13242 var $list = this._orderValues(type.get$genericType()._concreteTypes);
12826 for (var $i = 0;$i < $list.length; $i++) { 13243 for (var $i = 0;$i < $list.length; $i++) {
12827 var ct = $list.$index($i); 13244 var ct = $list.$index($i);
12828 this._maybeIsTest(type, (ct && ct.is$lang_Type())); 13245 this._maybeIsTest(type, (ct == null ? null : ct.assert$lang_Type()));
12829 } 13246 }
12830 } 13247 }
12831 if (type.get$interfaces() != null) { 13248 if (type.get$interfaces() != null) {
12832 var seen = new HashSetImplementation(); 13249 var seen = new HashSetImplementation();
12833 var worklist = []; 13250 var worklist = [];
12834 worklist.addAll(type.get$interfaces()); 13251 worklist.addAll(type.get$interfaces());
12835 seen.addAll(type.get$interfaces()); 13252 seen.addAll(type.get$interfaces());
12836 while (!worklist.isEmpty()) { 13253 while (!worklist.isEmpty()) {
12837 var interface_ = worklist.removeLast(); 13254 var interface_ = worklist.removeLast();
12838 this._maybeIsTest(type, (($0 = interface_.get$genericType()) && $0.is$lang _Type())); 13255 this._maybeIsTest(type, (($0 = interface_.get$genericType()) == null ? nul l : $0.assert$lang_Type()));
12839 if (interface_.get$genericType()._concreteTypes != null) { 13256 if (interface_.get$genericType()._concreteTypes != null) {
12840 var $list = this._orderValues(interface_.get$genericType()._concreteType s); 13257 var $list = this._orderValues(interface_.get$genericType()._concreteType s);
12841 for (var $i = 0;$i < $list.length; $i++) { 13258 for (var $i = 0;$i < $list.length; $i++) {
12842 var ct = $list.$index($i); 13259 var ct = $list.$index($i);
12843 this._maybeIsTest(type, (ct && ct.is$lang_Type())); 13260 this._maybeIsTest(type, (ct == null ? null : ct.assert$lang_Type()));
12844 } 13261 }
12845 } 13262 }
12846 var $list = interface_.get$interfaces(); 13263 var $list = interface_.get$interfaces();
12847 for (var $i = interface_.get$interfaces().iterator$0(); $i.hasNext$0(); ) { 13264 for (var $i = interface_.get$interfaces().iterator$0(); $i.hasNext$0(); ) {
12848 var other = $i.next$0(); 13265 var other = $i.next$0();
12849 if (!seen.contains(other)) { 13266 if (!seen.contains(other)) {
12850 worklist.addLast(other); 13267 worklist.addLast(other);
12851 seen.add(other); 13268 seen.add(other);
12852 } 13269 }
12853 } 13270 }
12854 } 13271 }
12855 } 13272 }
12856 type.get$factories().forEach(this.get$_writeMethod()); 13273 type.get$factories().forEach(this.get$_writeMethod());
12857 var $list = this._orderValues(type.get$members()); 13274 var $list = this._orderValues(type.get$members());
12858 for (var $i = 0;$i < $list.length; $i++) { 13275 for (var $i = 0;$i < $list.length; $i++) {
12859 var member = $list.$index($i); 13276 var member = $list.$index($i);
12860 if ((member instanceof FieldMember)) { 13277 if ((member instanceof FieldMember)) {
12861 this._writeField((member && member.is$FieldMember())); 13278 this._writeField((member == null ? null : member.assert$FieldMember()));
12862 } 13279 }
12863 if ((member instanceof PropertyMember)) { 13280 if ((member instanceof PropertyMember)) {
12864 this._writeProperty((member && member.is$PropertyMember())); 13281 this._writeProperty((member == null ? null : member.assert$PropertyMember( )));
12865 } 13282 }
12866 if ($notnull_bool(member.get$isMethod())) { 13283 if ($notnull_bool(member.get$isMethod())) {
12867 this._writeMethod((member && member.is$Member())); 13284 this._writeMethod((member == null ? null : member.assert$Member()));
12868 } 13285 }
12869 } 13286 }
12870 this._writeDynamicStubs(type); 13287 this._writeDynamicStubs(type);
12871 } 13288 }
12872 WorldGenerator.prototype._ensureInheritsHelper = function() {
12873 if ($notnull_bool(this._inheritsGenerated)) return;
12874 this._inheritsGenerated = true;
12875 this.writer.writeln("/** Implements extends for Dart classes on JavaScript pro totypes. */\nfunction $inherits(child, parent) {\n if (child.prototype.__proto_ _) {\n child.prototype.__proto__ = parent.prototype;\n } else {\n functio n tmp() {};\n tmp.prototype = parent.prototype;\n child.prototype = new tm p();\n child.prototype.constructor = child;\n }\n}");
12876 }
12877 WorldGenerator.prototype._ensureInheritMembersHelper = function() { 13289 WorldGenerator.prototype._ensureInheritMembersHelper = function() {
12878 if (this._mixins != null) return; 13290 if (this._mixins != null) return;
12879 this._mixins = new CodeWriter(); 13291 this._mixins = new CodeWriter();
12880 this._mixins.comment('// ********** Generic Type Inheritance **************'); 13292 this._mixins.comment('// ********** Generic Type Inheritance **************');
12881 this._mixins.writeln("/** Implements extends for generic types. */\nfunction $ inheritsMembers(child, parent) {\n child = child.prototype;\n parent = parent. prototype;\n Object.getOwnPropertyNames(parent).forEach(function(name) {\n i f (typeof(child[name]) == 'undefined') child[name] = parent[name];\n });\n}"); 13293 this._mixins.writeln("/** Implements extends for generic types. */\nfunction $ inheritsMembers(child, parent) {\n child = child.prototype;\n parent = parent. prototype;\n Object.getOwnPropertyNames(parent).forEach(function(name) {\n i f (typeof(child[name]) == 'undefined') child[name] = parent[name];\n });\n}");
12882 } 13294 }
12883 WorldGenerator.prototype._writeDynamicStubs = function(type) { 13295 WorldGenerator.prototype._writeDynamicStubs = function(type) {
12884 if (type.varStubs != null) { 13296 var $list = orderValuesByKeys(type.varStubs);
12885 var $list = orderValuesByKeys(type.varStubs); 13297 for (var $i = 0;$i < $list.length; $i++) {
12886 for (var $i = 0;$i < $list.length; $i++) { 13298 var stub = $list.$index($i);
12887 var stub = $list.$index($i); 13299 stub.generate$1(this.writer);
12888 stub.generate$1(this.writer);
12889 }
12890 } 13300 }
12891 } 13301 }
12892 WorldGenerator.prototype._writeStaticField = function(field) { 13302 WorldGenerator.prototype._writeStaticField = function(field) {
12893 if ($notnull_bool(field.isFinal)) return; 13303 if ($notnull_bool(field.isFinal)) return;
12894 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname ()); 13304 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname ());
12895 if (this.globals.containsKey(fullname)) { 13305 if (this.globals.containsKey(fullname)) {
12896 var value = this.globals.$index(fullname); 13306 var value = this.globals.$index(fullname);
12897 if ($notnull_bool(field.declaringType.get$isTop()) && !$notnull_bool(field.i sNative)) { 13307 if ($notnull_bool(field.declaringType.get$isTop()) && !$notnull_bool(field.i sNative)) {
12898 this.writer.writeln(('\$globals.' + field.get$jsname() + ' = ' + value.get $exp().get$code() + ';')); 13308 this.writer.writeln(('\$globals.' + field.get$jsname() + ' = ' + value.get $exp().get$code() + ';'));
12899 } 13309 }
12900 else { 13310 else {
12901 this.writer.writeln(('\$globals.' + field.declaringType.get$jsname() + '_' + field.get$jsname()) + (' = ' + value.get$exp().get$code() + ';')); 13311 this.writer.writeln(('\$globals.' + field.declaringType.get$jsname() + '_' + field.get$jsname()) + (' = ' + value.get$exp().get$code() + ';'));
12902 } 13312 }
12903 } 13313 }
12904 } 13314 }
12905 WorldGenerator.prototype._writeField = function(field) { 13315 WorldGenerator.prototype._writeField = function(field) {
12906 if ($notnull_bool(field.declaringType.get$isTop()) && !$notnull_bool(field.isN ative) && field.value == null) { 13316 if ($notnull_bool(field.declaringType.get$isTop()) && !$notnull_bool(field.isN ative) && field.value == null) {
12907 this.writer.writeln(('var ' + field.get$jsname() + ';')); 13317 this.writer.writeln(('var ' + field.get$jsname() + ';'));
12908 } 13318 }
12909 if ($notnull_bool(field._providePropertySyntax)) { 13319 if ($notnull_bool(field._providePropertySyntax)) {
12910 this.writer.writeln(('' + field.declaringType.get$jsname() + '.prototype.get \$' + field.get$jsname() + ' = ') + ('function() { return this.' + field.get$jsn ame() + '; };')); 13320 this.writer.writeln(this._prototypeOf(field.declaringType, ('get\$' + field. get$jsname())) + (' = function() { return this.' + field.get$jsname() + '; };')) ;
12911 if (!$notnull_bool(field.isFinal)) { 13321 if (!$notnull_bool(field.isFinal)) {
12912 this.writer.writeln(('' + field.declaringType.get$jsname() + '.prototype.s et\$' + field.get$jsname() + ' = ') + ('function(value) { return this.' + field. get$jsname() + ' = value; };')); 13322 this.writer.writeln(this._prototypeOf(field.declaringType, ('set\$' + fiel d.get$jsname())) + (' = function(value) { return this.' + field.get$jsname() + ' = value; };'));
12913 } 13323 }
12914 } 13324 }
12915 } 13325 }
12916 WorldGenerator.prototype._writeProperty = function(property) { 13326 WorldGenerator.prototype._writeProperty = function(property) {
12917 if (property.getter != null) this._writeMethod(property.getter); 13327 if (property.getter != null) this._writeMethod(property.getter);
12918 if (property.setter != null) this._writeMethod(property.setter); 13328 if (property.setter != null) this._writeMethod(property.setter);
12919 if ($notnull_bool(property._provideFieldSyntax)) { 13329 if ($notnull_bool(property._provideFieldSyntax)) {
12920 this.writer.enterBlock('Object.defineProperty(' + ('' + property.declaringTy pe.get$jsname() + '.prototype, "' + property.get$jsname() + '", {')); 13330 this.writer.enterBlock('Object.defineProperty(' + ('' + property.declaringTy pe.get$jsname() + '.prototype, "' + property.get$jsname() + '", {'));
12921 if (property.getter != null) { 13331 if (property.getter != null) {
12922 this.writer.write(('get: ' + property.declaringType.get$jsname() + '.proto type.' + property.getter.get$jsname())); 13332 this.writer.write(('get: ' + property.declaringType.get$jsname() + '.proto type.' + property.getter.get$jsname()));
(...skipping 19 matching lines...) Expand all
12942 this.writer.comment('// ********** Globals **************'); 13352 this.writer.comment('// ********** Globals **************');
12943 var list = this.globals.getValues(); 13353 var list = this.globals.getValues();
12944 list.sort$1((function (a, b) { 13354 list.sort$1((function (a, b) {
12945 return a.compareTo$1(b); 13355 return a.compareTo$1(b);
12946 }) 13356 })
12947 ); 13357 );
12948 this.writer.enterBlock('function \$static_init(){'); 13358 this.writer.enterBlock('function \$static_init(){');
12949 for (var $i = list.iterator$0(); $i.hasNext$0(); ) { 13359 for (var $i = list.iterator$0(); $i.hasNext$0(); ) {
12950 var global = $i.next$0(); 13360 var global = $i.next$0();
12951 if ($notnull_bool($ne(global.get$field(), null))) { 13361 if ($notnull_bool($ne(global.get$field(), null))) {
12952 this._writeStaticField((($0 = global.get$field()) && $0.is$FieldMember() )); 13362 this._writeStaticField((($0 = global.get$field()) == null ? null : $0.as sert$FieldMember()));
12953 } 13363 }
12954 } 13364 }
12955 this.writer.exitBlock('}'); 13365 this.writer.exitBlock('}');
12956 for (var $i = list.iterator$0(); $i.hasNext$0(); ) { 13366 for (var $i = list.iterator$0(); $i.hasNext$0(); ) {
12957 var global0 = $i.next$0(); 13367 var global0 = $i.next$0();
12958 if ($notnull_bool(global0.get$field() == null)) { 13368 if ($notnull_bool(global0.get$field() == null)) {
12959 this.writer.writeln(('var ' + global0.get$name() + ' = ' + global0.get$e xp().get$code() + ';')); 13369 this.writer.writeln(('var ' + global0.get$name() + ' = ' + global0.get$e xp().get$code() + ';'));
12960 } 13370 }
12961 } 13371 }
12962 } 13372 }
12963 if (!$notnull_bool(this.corejs.useIsolates)) { 13373 if (!$notnull_bool(this.corejs.useIsolates)) {
12964 if ($notnull_bool(this.hasStatics)) { 13374 if ($notnull_bool(this.hasStatics)) {
12965 this.writer.writeln('var \$globals = {};'); 13375 this.writer.writeln('var \$globals = {};');
12966 } 13376 }
12967 if (this.globals.get$length() > 0) { 13377 if (this.globals.get$length() > 0) {
12968 this.writer.writeln('\$static_init();'); 13378 this.writer.writeln('\$static_init();');
12969 } 13379 }
12970 } 13380 }
12971 } 13381 }
12972 WorldGenerator.prototype._orderValues = function(map) { 13382 WorldGenerator.prototype._orderValues = function(map) {
12973 var $0; 13383 var $0;
12974 var values = (($0 = map.getValues()) && $0.is$List()); 13384 var values = (($0 = map.getValues()) == null ? null : $0.assert$List());
12975 values.sort(this.get$_compareMembers()); 13385 values.sort(this.get$_compareMembers());
12976 return values; 13386 return values;
12977 } 13387 }
12978 WorldGenerator.prototype._compareMembers = function(x, y) { 13388 WorldGenerator.prototype._compareMembers = function(x, y) {
12979 if ($notnull_bool($ne(x.get$span(), null)) && $notnull_bool($ne(y.get$span(), null))) { 13389 if ($notnull_bool($ne(x.get$span(), null)) && $notnull_bool($ne(y.get$span(), null))) {
12980 var spans = $assert_num(x.get$span().compareTo$1(y.get$span())); 13390 var spans = $assert_num(x.get$span().compareTo$1(y.get$span()));
12981 if (spans != 0) return spans; 13391 if (spans != 0) return spans;
12982 } 13392 }
12983 if ($notnull_bool(x.get$span() == null)) return 1; 13393 if ($notnull_bool(x.get$span() == null)) return 1;
12984 if ($notnull_bool(y.get$span() == null)) return -1; 13394 if ($notnull_bool(y.get$span() == null)) return -1;
12985 return $assert_num(x.get$name().compareTo$1(y.get$name())); 13395 return $assert_num(x.get$name().compareTo$1(y.get$name()));
12986 } 13396 }
12987 WorldGenerator.prototype.get$_compareMembers = function() { 13397 WorldGenerator.prototype.get$_compareMembers = function() {
12988 return WorldGenerator.prototype._compareMembers.bind(this); 13398 return WorldGenerator.prototype._compareMembers.bind(this);
12989 } 13399 }
12990 WorldGenerator.prototype.useMapFactory = function() { 13400 WorldGenerator.prototype.useMapFactory = function() {
12991 var $0; 13401 var $0;
12992 this.corejs.useMap = true; 13402 this.corejs.useMap = true;
12993 var factType = $globals.world.get$coreimpl().types.$index('HashMapImplementati on'); 13403 var factType = $globals.world.get$coreimpl().types.$index('HashMapImplementati on');
12994 var m = factType.resolveMember$1('\$setindex'); 13404 var m = factType.resolveMember$1('\$setindex');
12995 this.genMethod((($0 = m.get$members().$index(0)) && $0.is$Member())); 13405 this.genMethod((($0 = m.get$members().$index(0)) == null ? null : $0.assert$Me mber()));
12996 var c = factType.getConstructor$1(''); 13406 var c = factType.getConstructor$1('');
12997 this.genMethod((c && c.is$Member())); 13407 this.genMethod((c == null ? null : c.assert$Member()));
12998 return (factType && factType.is$lang_Type()); 13408 return (factType == null ? null : factType.assert$lang_Type());
12999 } 13409 }
13000 // ********** Code for BlockScope ************** 13410 // ********** Code for BlockScope **************
13001 function BlockScope(enclosingMethod, parent, reentrant) { 13411 function BlockScope(enclosingMethod, parent, reentrant) {
13002 this.enclosingMethod = enclosingMethod; 13412 this.enclosingMethod = enclosingMethod;
13003 this.parent = parent; 13413 this.parent = parent;
13004 this.reentrant = reentrant; 13414 this.reentrant = reentrant;
13005 this._vars = $map([]); 13415 this._vars = $map([]);
13006 this._jsNames = new HashSetImplementation(); 13416 this._jsNames = new HashSetImplementation();
13007 // Initializers done 13417 // Initializers done
13008 if ($notnull_bool(this.get$isMethodScope())) { 13418 if ($notnull_bool(this.get$isMethodScope())) {
13009 this._closedOver = new HashSetImplementation(); 13419 this._closedOver = new HashSetImplementation();
13010 } 13420 }
13011 else { 13421 else {
13012 this.reentrant = $notnull_bool(reentrant) || $notnull_bool(this.parent.reent rant); 13422 this.reentrant = $notnull_bool(reentrant) || $notnull_bool(this.parent.reent rant);
13013 } 13423 }
13014 } 13424 }
13015 BlockScope.prototype.is$BlockScope = function(){return this;}; 13425 BlockScope.prototype.assert$BlockScope = function(){return this};
13016 BlockScope.prototype.get$enclosingMethod = function() { return this.enclosingMet hod; }; 13426 BlockScope.prototype.get$enclosingMethod = function() { return this.enclosingMet hod; };
13017 BlockScope.prototype.set$enclosingMethod = function(value) { return this.enclosi ngMethod = value; }; 13427 BlockScope.prototype.set$enclosingMethod = function(value) { return this.enclosi ngMethod = value; };
13018 BlockScope.prototype.get$parent = function() { return this.parent; }; 13428 BlockScope.prototype.get$parent = function() { return this.parent; };
13019 BlockScope.prototype.set$parent = function(value) { return this.parent = value; }; 13429 BlockScope.prototype.set$parent = function(value) { return this.parent = value; };
13020 BlockScope.prototype.get$rethrow = function() { return this.rethrow; }; 13430 BlockScope.prototype.get$rethrow = function() { return this.rethrow; };
13021 BlockScope.prototype.set$rethrow = function(value) { return this.rethrow = value ; }; 13431 BlockScope.prototype.set$rethrow = function(value) { return this.rethrow = value ; };
13022 BlockScope.prototype.get$reentrant = function() { return this.reentrant; }; 13432 BlockScope.prototype.get$reentrant = function() { return this.reentrant; };
13023 BlockScope.prototype.set$reentrant = function(value) { return this.reentrant = v alue; }; 13433 BlockScope.prototype.set$reentrant = function(value) { return this.reentrant = v alue; };
13024 BlockScope.prototype.get$isMethodScope = function() { 13434 BlockScope.prototype.get$isMethodScope = function() {
13025 return this.parent == null || $ne(this.parent.enclosingMethod, this.enclosingM ethod); 13435 return this.parent == null || $ne(this.parent.enclosingMethod, this.enclosingM ethod);
13026 } 13436 }
13027 BlockScope.prototype.get$methodScope = function() { 13437 BlockScope.prototype.get$methodScope = function() {
13028 var s = this; 13438 var s = this;
13029 while (!$notnull_bool(s.get$isMethodScope())) s = s.get$parent(); 13439 while (!$notnull_bool(s.get$isMethodScope())) s = s.get$parent();
13030 return (s && s.is$BlockScope()); 13440 return (s == null ? null : s.assert$BlockScope());
13031 } 13441 }
13032 BlockScope.prototype.lookup = function(name) { 13442 BlockScope.prototype.lookup = function(name) {
13033 var ret = this._vars.$index(name); 13443 var ret = this._vars.$index(name);
13034 if ($notnull_bool($ne(ret, null))) return ret; 13444 if ($notnull_bool($ne(ret, null))) return ret;
13035 for (var s = this.parent; 13445 for (var s = this.parent;
13036 $notnull_bool($ne(s, null)); s = s.get$parent()) { 13446 $notnull_bool($ne(s, null)); s = s.get$parent()) {
13037 ret = s._vars.$index(name); 13447 ret = s._vars.$index(name);
13038 if ($notnull_bool($ne(ret, null))) { 13448 if ($notnull_bool($ne(ret, null))) {
13039 if ($notnull_bool($ne(s.get$enclosingMethod(), this.enclosingMethod))) { 13449 if ($notnull_bool($ne(s.get$enclosingMethod(), this.enclosingMethod))) {
13040 s.get$methodScope()._closedOver.add(ret.get$code()); 13450 s.get$methodScope()._closedOver.add(ret.get$code());
(...skipping 25 matching lines...) Expand all
13066 if (!$notnull_bool(isParameter)) { 13476 if (!$notnull_bool(isParameter)) {
13067 var index = 0; 13477 var index = 0;
13068 while ($notnull_bool(this._isDefinedInParent($assert_String(jsName)))) { 13478 while ($notnull_bool(this._isDefinedInParent($assert_String(jsName)))) {
13069 jsName = ('' + name + (index++)); 13479 jsName = ('' + name + (index++));
13070 } 13480 }
13071 } 13481 }
13072 var ret = new Value(type, jsName, span, false); 13482 var ret = new Value(type, jsName, span, false);
13073 ret.set$isFinal(isFinal); 13483 ret.set$isFinal(isFinal);
13074 this._vars.$setindex(name, ret); 13484 this._vars.$setindex(name, ret);
13075 if (name != jsName) this._jsNames.add(jsName); 13485 if (name != jsName) this._jsNames.add(jsName);
13076 return (ret && ret.is$Value()); 13486 return (ret == null ? null : ret.assert$Value());
13077 } 13487 }
13078 BlockScope.prototype.declareParameter = function(p) { 13488 BlockScope.prototype.declareParameter = function(p) {
13079 return this.create(p.name, p.type, p.definition.span, false, true); 13489 return this.create(p.name, p.type, p.definition.span, false, true);
13080 } 13490 }
13081 BlockScope.prototype.declare = function(id) { 13491 BlockScope.prototype.declare = function(id) {
13082 var type = this.enclosingMethod.method.resolveType(id.type, false); 13492 var type = this.enclosingMethod.method.resolveType(id.type, false);
13083 return this.create(id.name.name, (type && type.is$lang_Type()), id.span, false , false); 13493 return this.create(id.name.name, (type == null ? null : type.assert$lang_Type( )), id.span, false, false);
13084 } 13494 }
13085 BlockScope.prototype.getRethrow = function() { 13495 BlockScope.prototype.getRethrow = function() {
13086 var $0; 13496 var $0;
13087 var scope = this; 13497 var scope = this;
13088 while ($notnull_bool(scope.get$rethrow() == null) && $notnull_bool($ne(scope.g et$parent(), null))) { 13498 while ($notnull_bool(scope.get$rethrow() == null) && $notnull_bool($ne(scope.g et$parent(), null))) {
13089 scope = scope.get$parent(); 13499 scope = scope.get$parent();
13090 } 13500 }
13091 return (($0 = scope.get$rethrow()) && $0.is$Value()); 13501 return (($0 = scope.get$rethrow()) == null ? null : $0.assert$Value());
13092 } 13502 }
13093 BlockScope.prototype.lookup$1 = function($0) { 13503 BlockScope.prototype.lookup$1 = function($0) {
13094 return this.lookup($assert_String($0)); 13504 return this.lookup($assert_String($0));
13095 }; 13505 };
13096 // ********** Code for MethodGenerator ************** 13506 // ********** Code for MethodGenerator **************
13097 function MethodGenerator(method, enclosingMethod) { 13507 function MethodGenerator(method, enclosingMethod) {
13098 var $0; 13508 var $0;
13099 this.method = method; 13509 this.method = method;
13100 this.enclosingMethod = enclosingMethod; 13510 this.enclosingMethod = enclosingMethod;
13101 this.writer = new CodeWriter(); 13511 this.writer = new CodeWriter();
13102 this.needsThis = false; 13512 this.needsThis = false;
13103 // Initializers done 13513 // Initializers done
13104 if (this.enclosingMethod != null) { 13514 if (this.enclosingMethod != null) {
13105 this._scope = new BlockScope(this, this.enclosingMethod._scope, false); 13515 this._scope = new BlockScope(this, this.enclosingMethod._scope, false);
13106 this.captures = new HashSetImplementation(); 13516 this.captures = new HashSetImplementation();
13107 } 13517 }
13108 else { 13518 else {
13109 this._scope = new BlockScope(this, null, false); 13519 this._scope = new BlockScope(this, null, false);
13110 } 13520 }
13111 if (this.enclosingMethod != null && this.method.name != '') { 13521 if (this.enclosingMethod != null && this.method.name != '') {
13112 var m = (($0 = this.method) && $0.is$MethodMember()); 13522 var m = (($0 = this.method) == null ? null : $0.assert$MethodMember());
13113 this._scope.create(m.name, m.get$functionType(), m.definition.span, true, fa lse); 13523 this._scope.create(m.name, m.get$functionType(), m.definition.span, true, fa lse);
13114 } 13524 }
13115 this._usedTemps = new HashSetImplementation(); 13525 this._usedTemps = new HashSetImplementation();
13116 this._freeTemps = []; 13526 this._freeTemps = [];
13117 } 13527 }
13118 MethodGenerator.prototype.is$MethodGenerator = function(){return this;}; 13528 MethodGenerator.prototype.assert$MethodGenerator = function(){return this};
13119 MethodGenerator.prototype.is$TreeVisitor = function(){return this;}; 13529 MethodGenerator.prototype.assert$TreeVisitor = function(){return this};
13120 MethodGenerator.prototype.get$enclosingMethod = function() { return this.enclosi ngMethod; }; 13530 MethodGenerator.prototype.get$enclosingMethod = function() { return this.enclosi ngMethod; };
13121 MethodGenerator.prototype.set$enclosingMethod = function(value) { return this.en closingMethod = value; }; 13531 MethodGenerator.prototype.set$enclosingMethod = function(value) { return this.en closingMethod = value; };
13122 MethodGenerator.prototype.get$needsThis = function() { return this.needsThis; }; 13532 MethodGenerator.prototype.get$needsThis = function() { return this.needsThis; };
13123 MethodGenerator.prototype.set$needsThis = function(value) { return this.needsThi s = value; }; 13533 MethodGenerator.prototype.set$needsThis = function(value) { return this.needsThi s = value; };
13124 MethodGenerator.prototype.get$library = function() { 13534 MethodGenerator.prototype.get$library = function() {
13125 return this.method.get$library(); 13535 return this.method.get$library();
13126 } 13536 }
13127 MethodGenerator.prototype.findMembers = function(name) { 13537 MethodGenerator.prototype.findMembers = function(name) {
13128 return this.get$library()._findMembers(name); 13538 return this.get$library()._findMembers(name);
13129 } 13539 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
13185 MethodGenerator.prototype.writeDefinition = function(defWriter, lambda) { 13595 MethodGenerator.prototype.writeDefinition = function(defWriter, lambda) {
13186 var $0; 13596 var $0;
13187 var paramCode = this._paramCode; 13597 var paramCode = this._paramCode;
13188 var names = null; 13598 var names = null;
13189 if (this.captures != null && this.captures.get$length() > 0) { 13599 if (this.captures != null && this.captures.get$length() > 0) {
13190 names = ListFactory.ListFactory$from$factory(this.captures); 13600 names = ListFactory.ListFactory$from$factory(this.captures);
13191 names.sort$1((function (x, y) { 13601 names.sort$1((function (x, y) {
13192 return x.compareTo$1(y); 13602 return x.compareTo$1(y);
13193 }) 13603 })
13194 ); 13604 );
13195 paramCode = ListFactory.ListFactory$from$factory((names && names.is$Iterable ())); 13605 paramCode = ListFactory.ListFactory$from$factory((names == null ? null : nam es.assert$Iterable()));
13196 paramCode.addAll$1(this._paramCode); 13606 paramCode.addAll$1(this._paramCode);
13197 } 13607 }
13198 var _params = ('(' + Strings.join(this._paramCode, ", ") + ')'); 13608 var _params = ('(' + Strings.join(this._paramCode, ", ") + ')');
13199 var params = ('(' + Strings.join((paramCode && paramCode.is$List_String()), ", ") + ')'); 13609 var params = ('(' + Strings.join((paramCode == null ? null : paramCode.assert$ List_String()), ", ") + ')');
13200 if ($notnull_bool(this.method.declaringType.get$isTop()) && !$notnull_bool(thi s.get$isClosure())) { 13610 if ($notnull_bool(this.method.declaringType.get$isTop()) && !$notnull_bool(thi s.get$isClosure())) {
13201 defWriter.enterBlock(('function ' + this.method.get$jsname() + params + ' {' )); 13611 defWriter.enterBlock(('function ' + this.method.get$jsname() + params + ' {' ));
13202 } 13612 }
13203 else if ($notnull_bool(this.get$isClosure())) { 13613 else if ($notnull_bool(this.get$isClosure())) {
13204 if (this.method.name == '') { 13614 if (this.method.name == '') {
13205 defWriter.enterBlock(('(function ' + params + ' {')); 13615 defWriter.enterBlock(('(function ' + params + ' {'));
13206 } 13616 }
13207 else if ($notnull_bool($ne(names, null))) { 13617 else if ($notnull_bool($ne(names, null))) {
13208 if (lambda == null) { 13618 if (lambda == null) {
13209 defWriter.enterBlock(('var ' + this.method.get$jsname() + ' = (function' + params + ' {')); 13619 defWriter.enterBlock(('var ' + this.method.get$jsname() + ' = (function' + params + ' {'));
(...skipping 20 matching lines...) Expand all
13230 else if ($notnull_bool(this.method.get$isStatic())) { 13640 else if ($notnull_bool(this.method.get$isStatic())) {
13231 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + th is.method.get$jsname() + ' = function' + _params + ' {')); 13641 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + th is.method.get$jsname() + ' = function' + _params + ' {'));
13232 } 13642 }
13233 else { 13643 else {
13234 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot ype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {')); 13644 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot ype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {'));
13235 } 13645 }
13236 if ($notnull_bool(this.needsThis)) { 13646 if ($notnull_bool(this.needsThis)) {
13237 defWriter.writeln('var \$this = this; // closure support'); 13647 defWriter.writeln('var \$this = this; // closure support');
13238 } 13648 }
13239 if (this._usedTemps.get$length() > 0 || this._freeTemps.length > 0) { 13649 if (this._usedTemps.get$length() > 0 || this._freeTemps.length > 0) {
13240 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da rt", 817, 14); 13650 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da rt", 812, 14);
13241 this._freeTemps.addAll(this._usedTemps); 13651 this._freeTemps.addAll(this._usedTemps);
13242 this._freeTemps.sort((function (x, y) { 13652 this._freeTemps.sort((function (x, y) {
13243 return x.compareTo$1(y); 13653 return x.compareTo$1(y);
13244 }) 13654 })
13245 ); 13655 );
13246 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';')); 13656 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';'));
13247 } 13657 }
13248 defWriter.writeln(this.writer.get$text()); 13658 defWriter.writeln(this.writer.get$text());
13249 if ($notnull_bool($ne(names, null))) { 13659 if ($notnull_bool($ne(names, null))) {
13250 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List _String()), ", ") + ')')); 13660 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names == null ? null : names.assert$List_String()), ", ") + ')'));
13251 } 13661 }
13252 else if ($notnull_bool(this.get$isClosure()) && this.method.name == '') { 13662 else if ($notnull_bool(this.get$isClosure()) && this.method.name == '') {
13253 defWriter.exitBlock('})'); 13663 defWriter.exitBlock('})');
13254 } 13664 }
13255 else { 13665 else {
13256 defWriter.exitBlock('}'); 13666 defWriter.exitBlock('}');
13257 } 13667 }
13258 if ($notnull_bool(this.method.get$isConstructor()) && this.method.get$construc torName() != '') { 13668 if ($notnull_bool(this.method.get$isConstructor()) && this.method.get$construc torName() != '') {
13259 defWriter.writeln(('' + this.method.declaringType.get$jsname() + '.' + this. method.get$constructorName() + '\$ctor.prototype = ') + ('' + this.method.declar ingType.get$jsname() + '.prototype;')); 13669 defWriter.writeln(('' + this.method.declaringType.get$jsname() + '.' + this. method.get$constructorName() + '\$ctor.prototype = ') + ('' + this.method.declar ingType.get$jsname() + '.prototype;'));
13260 } 13670 }
13261 this._provideOptionalParamInfo(defWriter); 13671 this._provideOptionalParamInfo(defWriter);
13262 if ((this.method instanceof MethodMember)) { 13672 if ((this.method instanceof MethodMember)) {
13263 var m = (($0 = this.method) && $0.is$MethodMember()); 13673 var m = (($0 = this.method) == null ? null : $0.assert$MethodMember());
13264 if ($notnull_bool(m._providePropertySyntax)) { 13674 if ($notnull_bool(m._providePropertySyntax)) {
13265 defWriter.enterBlock(('' + m.declaringType.get$jsname() + '.prototype') + ('.get\$' + m.get$jsname() + ' = function() {')); 13675 defWriter.enterBlock(('' + m.declaringType.get$jsname() + '.prototype') + ('.get\$' + m.get$jsname() + ' = function() {'));
13266 defWriter.writeln(('return ' + m.declaringType.get$jsname() + '.prototype. ') + ('' + m.get$jsname() + '.bind(this);')); 13676 defWriter.writeln(('return ' + m.declaringType.get$jsname() + '.prototype. ') + ('' + m.get$jsname() + '.bind(this);'));
13267 defWriter.exitBlock('}'); 13677 defWriter.exitBlock('}');
13268 if ($notnull_bool(m._provideFieldSyntax)) { 13678 if ($notnull_bool(m._provideFieldSyntax)) {
13269 $globals.world.internalError('bound m accessed with field syntax'); 13679 $globals.world.internalError('bound m accessed with field syntax');
13270 } 13680 }
13271 } 13681 }
13272 } 13682 }
13273 } 13683 }
13274 MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) { 13684 MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) {
13275 var $0; 13685 var $0;
13276 if ((this.method instanceof MethodMember)) { 13686 if ((this.method instanceof MethodMember)) {
13277 var meth = (($0 = this.method) && $0.is$MethodMember()); 13687 var meth = (($0 = this.method) == null ? null : $0.assert$MethodMember());
13278 if ($notnull_bool(meth._provideOptionalParamInfo)) { 13688 if ($notnull_bool(meth._provideOptionalParamInfo)) {
13279 var optNames = []; 13689 var optNames = [];
13280 var optValues = []; 13690 var optValues = [];
13281 meth.genParameterValues(); 13691 meth.genParameterValues();
13282 var $list = meth.parameters; 13692 var $list = meth.parameters;
13283 for (var $i = 0;$i < $list.length; $i++) { 13693 for (var $i = 0;$i < $list.length; $i++) {
13284 var param = $list.$index($i); 13694 var param = $list.$index($i);
13285 if ($notnull_bool(param.get$isOptional())) { 13695 if ($notnull_bool(param.get$isOptional())) {
13286 optNames.add$1(param.get$name()); 13696 optNames.add$1(param.get$name());
13287 optValues.add$1(MethodGenerator._escapeString($assert_String(param.get $value().get$code()))); 13697 optValues.add$1(MethodGenerator._escapeString($assert_String(param.get $value().get$code())));
13288 } 13698 }
13289 } 13699 }
13290 if (optNames.length > 0) { 13700 if (optNames.length > 0) {
13291 var start = ''; 13701 var start = '';
13292 if ($notnull_bool(meth.isStatic)) { 13702 if ($notnull_bool(meth.isStatic)) {
13293 if (!$notnull_bool(meth.declaringType.get$isTop())) { 13703 if (!$notnull_bool(meth.declaringType.get$isTop())) {
13294 start = meth.declaringType.get$jsname() + '.'; 13704 start = meth.declaringType.get$jsname() + '.';
13295 } 13705 }
13296 } 13706 }
13297 else { 13707 else {
13298 start = meth.declaringType.get$jsname() + '.prototype.'; 13708 start = meth.declaringType.get$jsname() + '.prototype.';
13299 } 13709 }
13300 optNames.addAll$1(optValues); 13710 optNames.addAll$1(optValues);
13301 var optional = "['" + Strings.join((optNames && optNames.is$List_String( )), "', '") + "']"; 13711 var optional = "['" + Strings.join((optNames == null ? null : optNames.a ssert$List_String()), "', '") + "']";
13302 defWriter.writeln(('' + start + meth.get$jsname() + '.\$optional = ' + o ptional)); 13712 defWriter.writeln(('' + start + meth.get$jsname() + '.\$optional = ' + o ptional));
13303 } 13713 }
13304 } 13714 }
13305 } 13715 }
13306 } 13716 }
13307 MethodGenerator.prototype.writeBody = function() { 13717 MethodGenerator.prototype.writeBody = function() {
13308 var $0; 13718 var $0;
13309 var initializers = null; 13719 var initializers = null;
13310 var initializedFields = null; 13720 var initializedFields = null;
13311 var allMembers = null; 13721 var allMembers = null;
(...skipping 12 matching lines...) Expand all
13324 } 13734 }
13325 } 13735 }
13326 } 13736 }
13327 this._paramCode = []; 13737 this._paramCode = [];
13328 var $list = this.method.get$parameters(); 13738 var $list = this.method.get$parameters();
13329 for (var $i = 0;$i < $list.length; $i++) { 13739 for (var $i = 0;$i < $list.length; $i++) {
13330 var p = $list.$index($i); 13740 var p = $list.$index($i);
13331 if ($notnull_bool($ne(initializers, null)) && $notnull_bool(p.get$isInitiali zer())) { 13741 if ($notnull_bool($ne(initializers, null)) && $notnull_bool(p.get$isInitiali zer())) {
13332 var field = this.method.declaringType.getMember($assert_String(p.get$name( ))); 13742 var field = this.method.declaringType.getMember($assert_String(p.get$name( )));
13333 if ($notnull_bool(field == null)) { 13743 if ($notnull_bool(field == null)) {
13334 $globals.world.error('bad this parameter - no matching field', (($0 = p. get$definition().get$span()) && $0.is$SourceSpan())); 13744 $globals.world.error('bad this parameter - no matching field', (($0 = p. get$definition().get$span()) == null ? null : $0.assert$SourceSpan()));
13335 } 13745 }
13336 if (!$notnull_bool(field.get$isField())) { 13746 if (!$notnull_bool(field.get$isField())) {
13337 $globals.world.error(('"this.' + p.get$name() + '" does not refer to a f ield'), (($0 = p.get$definition().get$span()) && $0.is$SourceSpan())); 13747 $globals.world.error(('"this.' + p.get$name() + '" does not refer to a f ield'), (($0 = p.get$definition().get$span()) == null ? null : $0.assert$SourceS pan()));
13338 } 13748 }
13339 var paramValue = new Value(field.get$returnType(), p.get$name(), p.get$def inition().get$span(), false); 13749 var paramValue = new Value(field.get$returnType(), p.get$name(), p.get$def inition().get$span(), false);
13340 this._paramCode.add(paramValue.get$code()); 13750 this._paramCode.add(paramValue.get$code());
13341 initializers.add$1(('this.' + field.get$jsname() + ' = ' + paramValue.get$ code() + ';')); 13751 initializers.add$1(('this.' + field.get$jsname() + ' = ' + paramValue.get$ code() + ';'));
13342 initializedFields.add$1(p.get$name()); 13752 initializedFields.add$1(p.get$name());
13343 } 13753 }
13344 else { 13754 else {
13345 var paramValue = this._scope.declareParameter((p && p.is$Parameter())); 13755 var paramValue = this._scope.declareParameter((p == null ? null : p.assert $Parameter()));
13346 this._paramCode.add(paramValue.get$code()); 13756 this._paramCode.add(paramValue.get$code());
13347 } 13757 }
13348 } 13758 }
13349 var body = this.method.get$definition().get$body(); 13759 var body = this.method.get$definition().get$body();
13350 if ($notnull_bool(body == null) && !$notnull_bool(this.method.get$isConstructo r()) && !$notnull_bool(this.method.get$isNative())) { 13760 if ($notnull_bool(body == null) && !$notnull_bool(this.method.get$isConstructo r()) && !$notnull_bool(this.method.get$isNative())) {
13351 $globals.world.error(('unexpected empty body for ' + this.method.name), (($0 = this.method.get$definition().get$span()) && $0.is$SourceSpan())); 13761 $globals.world.error(('unexpected empty body for ' + this.method.name), (($0 = this.method.get$definition().get$span()) == null ? null : $0.assert$SourceSpa n()));
13352 } 13762 }
13353 var initializerCall = null; 13763 var initializerCall = null;
13354 var declaredInitializers = this.method.get$definition().get$initializers(); 13764 var declaredInitializers = this.method.get$definition().get$initializers();
13355 if ($notnull_bool($ne(initializers, null))) { 13765 if ($notnull_bool($ne(initializers, null))) {
13356 for (var $i = initializers.iterator$0(); $i.hasNext$0(); ) { 13766 for (var $i = initializers.iterator$0(); $i.hasNext$0(); ) {
13357 var i = $i.next$0(); 13767 var i = $i.next$0();
13358 this.writer.writeln($assert_String(i)); 13768 this.writer.writeln($assert_String(i));
13359 } 13769 }
13360 if ($notnull_bool($ne(declaredInitializers, null))) { 13770 if ($notnull_bool($ne(declaredInitializers, null))) {
13361 for (var $i = declaredInitializers.iterator$0(); $i.hasNext$0(); ) { 13771 for (var $i = declaredInitializers.iterator$0(); $i.hasNext$0(); ) {
13362 var init = $i.next$0(); 13772 var init = $i.next$0();
13363 if ((init instanceof CallExpression)) { 13773 if ((init instanceof CallExpression)) {
13364 if ($notnull_bool($ne(initializerCall, null))) { 13774 if ($notnull_bool($ne(initializerCall, null))) {
13365 $globals.world.error('only one initializer redirecting call is allow ed', (($0 = init.get$span()) && $0.is$SourceSpan())); 13775 $globals.world.error('only one initializer redirecting call is allow ed', (($0 = init.get$span()) == null ? null : $0.assert$SourceSpan()));
13366 } 13776 }
13367 initializerCall = init; 13777 initializerCall = init;
13368 } 13778 }
13369 else if ((init instanceof BinaryExpression) && TokenKind.kindFromAssign( $assert_num(init.get$op().get$kind())) == 0) { 13779 else if ((init instanceof BinaryExpression) && TokenKind.kindFromAssign( $assert_num(init.get$op().get$kind())) == 0) {
13370 var left = init.get$x(); 13780 var left = init.get$x();
13371 if (!((left instanceof DotExpression) && (left.get$self() instanceof T hisExpression) || (left instanceof VarExpression))) { 13781 if (!((left instanceof DotExpression) && (left.get$self() instanceof T hisExpression) || (left instanceof VarExpression))) {
13372 $globals.world.error('invalid left side of initializer', (($0 = left .get$span()) && $0.is$SourceSpan())); 13782 $globals.world.error('invalid left side of initializer', (($0 = left .get$span()) == null ? null : $0.assert$SourceSpan()));
13373 continue; 13783 continue;
13374 } 13784 }
13375 var f = this.method.declaringType.getMember($assert_String(left.get$na me().get$name())); 13785 var f = this.method.declaringType.getMember($assert_String(left.get$na me().get$name()));
13376 if ($notnull_bool(f == null)) { 13786 if ($notnull_bool(f == null)) {
13377 $globals.world.error('bad initializer - no matching field', (($0 = l eft.get$span()) && $0.is$SourceSpan())); 13787 $globals.world.error('bad initializer - no matching field', (($0 = l eft.get$span()) == null ? null : $0.assert$SourceSpan()));
13378 continue; 13788 continue;
13379 } 13789 }
13380 else if (!$notnull_bool(f.get$isField())) { 13790 else if (!$notnull_bool(f.get$isField())) {
13381 $globals.world.error(('"' + left.get$name().get$name() + '" does not refer to a field'), (($0 = left.get$span()) && $0.is$SourceSpan())); 13791 $globals.world.error(('"' + left.get$name().get$name() + '" does not refer to a field'), (($0 = left.get$span()) == null ? null : $0.assert$SourceSp an()));
13382 continue; 13792 continue;
13383 } 13793 }
13384 initializedFields.add$1(f.get$name()); 13794 initializedFields.add$1(f.get$name());
13385 this.writer.writeln(('this.' + f.get$jsname() + ' = ' + this.visitValu e((($0 = init.get$y()) && $0.is$lang_Expression())).get$code() + ';')); 13795 this.writer.writeln(('this.' + f.get$jsname() + ' = ' + this.visitValu e((($0 = init.get$y()) == null ? null : $0.assert$lang_Expression())).get$code() + ';'));
13386 } 13796 }
13387 else { 13797 else {
13388 $globals.world.error('invalid initializer', (($0 = init.get$span()) && $0.is$SourceSpan())); 13798 $globals.world.error('invalid initializer', (($0 = init.get$span()) == null ? null : $0.assert$SourceSpan()));
13389 } 13799 }
13390 } 13800 }
13391 } 13801 }
13392 this.writer.comment('// Initializers done'); 13802 this.writer.comment('// Initializers done');
13393 } 13803 }
13394 if ($notnull_bool(this.method.get$isConstructor()) && $notnull_bool(initialize rCall == null)) { 13804 if ($notnull_bool(this.method.get$isConstructor()) && $notnull_bool(initialize rCall == null) && !$notnull_bool(this.method.get$isNative())) {
13395 var parentType = this.method.declaringType.get$parent(); 13805 var parentType = this.method.declaringType.get$parent();
13396 if ($notnull_bool($ne(parentType, null)) && !$notnull_bool(parentType.get$is Object())) { 13806 if ($notnull_bool($ne(parentType, null)) && !$notnull_bool(parentType.get$is Object())) {
13397 initializerCall = new CallExpression(new SuperExpression(this.method.get$s pan()), [], this.method.get$span()); 13807 initializerCall = new CallExpression(new SuperExpression(this.method.get$s pan()), [], this.method.get$span());
13398 } 13808 }
13399 } 13809 }
13400 if ($notnull_bool($ne(initializerCall, null))) { 13810 if ($notnull_bool($ne(initializerCall, null))) {
13401 var target = this._writeInitializerCall((initializerCall && initializerCall. is$CallExpression())); 13811 var target = this._writeInitializerCall((initializerCall == null ? null : in itializerCall.assert$CallExpression()));
13402 if (!$notnull_bool(target.get$isSuper())) { 13812 if (!$notnull_bool(target.get$isSuper())) {
13403 if (initializers.length > 0) { 13813 if (initializers.length > 0) {
13404 var $list = this.method.get$parameters(); 13814 var $list = this.method.get$parameters();
13405 for (var $i = 0;$i < $list.length; $i++) { 13815 for (var $i = 0;$i < $list.length; $i++) {
13406 var p = $list.$index($i); 13816 var p = $list.$index($i);
13407 if ($notnull_bool(p.get$isInitializer())) { 13817 if ($notnull_bool(p.get$isInitializer())) {
13408 $globals.world.error('no initialization allowed on redirecting const ructors', (($0 = p.get$definition().get$span()) && $0.is$SourceSpan())); 13818 $globals.world.error('no initialization allowed on redirecting const ructors', (($0 = p.get$definition().get$span()) == null ? null : $0.assert$Sourc eSpan()));
13409 break; 13819 break;
13410 } 13820 }
13411 } 13821 }
13412 } 13822 }
13413 if ($notnull_bool($ne(declaredInitializers, null)) && declaredInitializers .length > 1) { 13823 if ($notnull_bool($ne(declaredInitializers, null)) && declaredInitializers .length > 1) {
13414 var init = $notnull_bool($eq(declaredInitializers.$index(0), initializer Call)) ? declaredInitializers.$index(1) : declaredInitializers.$index(0); 13824 var init = $notnull_bool($eq(declaredInitializers.$index(0), initializer Call)) ? declaredInitializers.$index(1) : declaredInitializers.$index(0);
13415 $globals.world.error('no initialization allowed on redirecting construct ors', (($0 = init.get$span()) && $0.is$SourceSpan())); 13825 $globals.world.error('no initialization allowed on redirecting construct ors', (($0 = init.get$span()) == null ? null : $0.assert$SourceSpan()));
13416 } 13826 }
13417 initializedFields = null; 13827 initializedFields = null;
13418 } 13828 }
13419 } 13829 }
13420 if ($notnull_bool($ne(initializedFields, null))) { 13830 if ($notnull_bool($ne(initializedFields, null))) {
13421 for (var $i = allMembers.iterator$0(); $i.hasNext$0(); ) { 13831 for (var $i = allMembers.iterator$0(); $i.hasNext$0(); ) {
13422 var member = $i.next$0(); 13832 var member = $i.next$0();
13423 if ($notnull_bool(member.get$isField()) && $notnull_bool(member.get$isFina l()) && !$notnull_bool(member.get$isStatic()) && !$notnull_bool(this.method.get$ isNative()) && !$notnull_bool(initializedFields.contains$1(member.get$name()))) { 13833 if ($notnull_bool(member.get$isField()) && $notnull_bool(member.get$isFina l()) && !$notnull_bool(member.get$isStatic()) && !$notnull_bool(this.method.get$ isNative()) && !$notnull_bool(initializedFields.contains$1(member.get$name()))) {
13424 $globals.world.error(('Field "' + member.get$name() + '" is final and wa s not initialized'), (($0 = this.method.get$definition().get$span()) && $0.is$So urceSpan())); 13834 $globals.world.error(('Field "' + member.get$name() + '" is final and wa s not initialized'), (($0 = this.method.get$definition().get$span()) == null ? n ull : $0.assert$SourceSpan()));
13425 } 13835 }
13426 } 13836 }
13427 } 13837 }
13428 this.visitStatementsInBlock((body && body.is$lang_Statement())); 13838 this.visitStatementsInBlock((body == null ? null : body.assert$lang_Statement( )));
13429 } 13839 }
13430 MethodGenerator.prototype._writeInitializerCall = function(node) { 13840 MethodGenerator.prototype._writeInitializerCall = function(node) {
13431 var contructorName = ''; 13841 var contructorName = '';
13432 var targetExp = node.target; 13842 var targetExp = node.target;
13433 if ((targetExp instanceof DotExpression)) { 13843 if ((targetExp instanceof DotExpression)) {
13434 var dot = (targetExp && targetExp.is$DotExpression()); 13844 var dot = (targetExp == null ? null : targetExp.assert$DotExpression());
13435 targetExp = dot.self; 13845 targetExp = dot.self;
13436 contructorName = dot.name.name; 13846 contructorName = dot.name.name;
13437 } 13847 }
13438 var target = null; 13848 var target = null;
13439 if ((targetExp instanceof SuperExpression)) { 13849 if ((targetExp instanceof SuperExpression)) {
13440 target = this._makeSuperValue((targetExp && targetExp.is$lang_Node())); 13850 target = this._makeSuperValue((targetExp == null ? null : targetExp.assert$l ang_Node()));
13441 } 13851 }
13442 else if ((targetExp instanceof ThisExpression)) { 13852 else if ((targetExp instanceof ThisExpression)) {
13443 target = this._makeThisValue((targetExp && targetExp.is$lang_Node())); 13853 target = this._makeThisValue((targetExp == null ? null : targetExp.assert$la ng_Node()));
13444 } 13854 }
13445 else { 13855 else {
13446 $globals.world.error('bad call in initializers', node.span); 13856 $globals.world.error('bad call in initializers', node.span);
13447 } 13857 }
13448 var m = target.get$type().getConstructor$1(contructorName); 13858 var m = target.get$type().getConstructor$1(contructorName);
13449 this.method.set$initDelegate(m); 13859 this.method.set$initDelegate(m);
13450 var other = m; 13860 var other = m;
13451 while ($notnull_bool($ne(other, null))) { 13861 while ($notnull_bool($ne(other, null))) {
13452 if ($notnull_bool($eq(other, this.method))) { 13862 if ($notnull_bool($eq(other, this.method))) {
13453 $globals.world.error('initialization cycle', node.span); 13863 $globals.world.error('initialization cycle', node.span);
13454 break; 13864 break;
13455 } 13865 }
13456 other = other.get$initDelegate(); 13866 other = other.get$initDelegate();
13457 } 13867 }
13458 $globals.world.gen.genMethod((m && m.is$Member())); 13868 $globals.world.gen.genMethod((m == null ? null : m.assert$Member()));
13459 var value = m.invoke$4(this, node, target, this._makeArgs(node.arguments)); 13869 var value = m.invoke$4(this, node, target, this._makeArgs(node.arguments));
13460 if ($notnull_bool($ne(target.get$type(), $globals.world.objectType))) { 13870 if ($notnull_bool($ne(target.get$type(), $globals.world.objectType))) {
13461 this.writer.writeln(('' + value.get$code() + ';')); 13871 this.writer.writeln(('' + value.get$code() + ';'));
13462 } 13872 }
13463 return (target && target.is$Value()); 13873 return (target == null ? null : target.assert$Value());
13464 } 13874 }
13465 MethodGenerator.prototype._makeArgs = function(arguments) { 13875 MethodGenerator.prototype._makeArgs = function(arguments) {
13466 var $0; 13876 var $0;
13467 var args = []; 13877 var args = [];
13468 var seenLabel = false; 13878 var seenLabel = false;
13469 for (var $i = 0;$i < arguments.length; $i++) { 13879 for (var $i = 0;$i < arguments.length; $i++) {
13470 var arg = arguments.$index($i); 13880 var arg = arguments.$index($i);
13471 if ($notnull_bool($ne(arg.get$label(), null))) { 13881 if ($notnull_bool($ne(arg.get$label(), null))) {
13472 seenLabel = true; 13882 seenLabel = true;
13473 } 13883 }
13474 else if ($notnull_bool(seenLabel)) { 13884 else if ($notnull_bool(seenLabel)) {
13475 $globals.world.error('bare argument can not follow named arguments', (($0 = arg.get$span()) && $0.is$SourceSpan())); 13885 $globals.world.error('bare argument can not follow named arguments', (($0 = arg.get$span()) == null ? null : $0.assert$SourceSpan()));
13476 } 13886 }
13477 args.add$1(this.visitValue((($0 = arg.get$value()) && $0.is$lang_Expression( )))); 13887 args.add$1(this.visitValue((($0 = arg.get$value()) == null ? null : $0.asser t$lang_Expression())));
13478 } 13888 }
13479 return new Arguments(arguments, args); 13889 return new Arguments(arguments, args);
13480 } 13890 }
13481 MethodGenerator.prototype._invokeNative = function(name, arguments) { 13891 MethodGenerator.prototype._invokeNative = function(name, arguments) {
13482 var $0; 13892 var $0;
13483 var args = Arguments.get$EMPTY(); 13893 var args = Arguments.get$EMPTY();
13484 if (arguments.length > 0) { 13894 if (arguments.length > 0) {
13485 args = new Arguments(null, arguments); 13895 args = new Arguments(null, arguments);
13486 } 13896 }
13487 var method = $globals.world.corelib.topType.members.$index(name); 13897 var method = $globals.world.corelib.topType.members.$index(name);
13488 return (($0 = method.invoke$4(this, method.get$definition(), new Value($global s.world.corelib.topType, null, null, true), args)) && $0.is$Value()); 13898 return (($0 = method.invoke$4(this, method.get$definition(), new Value($global s.world.corelib.topType, null, null, true), args)) == null ? null : $0.assert$Va lue());
13489 } 13899 }
13490 MethodGenerator._escapeString = function(text) { 13900 MethodGenerator._escapeString = function(text) {
13491 return text.replaceAll('\\', '\\\\').replaceAll('"', '\\"').replaceAll('\n', ' \\n').replaceAll('\r', '\\r'); 13901 return text.replaceAll('\\', '\\\\').replaceAll('"', '\\"').replaceAll('\n', ' \\n').replaceAll('\r', '\\r');
13492 } 13902 }
13493 MethodGenerator.prototype.visitStatementsInBlock = function(body) { 13903 MethodGenerator.prototype.visitStatementsInBlock = function(body) {
13494 if ((body instanceof BlockStatement)) { 13904 if ((body instanceof BlockStatement)) {
13495 var block = (body && body.is$BlockStatement()); 13905 var block = (body == null ? null : body.assert$BlockStatement());
13496 var $list = block.body; 13906 var $list = block.body;
13497 for (var $i = 0;$i < $list.length; $i++) { 13907 for (var $i = 0;$i < $list.length; $i++) {
13498 var stmt = $list.$index($i); 13908 var stmt = $list.$index($i);
13499 stmt.visit$1(this); 13909 stmt.visit$1(this);
13500 } 13910 }
13501 } 13911 }
13502 else { 13912 else {
13503 if (body != null) body.visit(this); 13913 if (body != null) body.visit(this);
13504 } 13914 }
13505 return false; 13915 return false;
13506 } 13916 }
13507 MethodGenerator.prototype._pushBlock = function(reentrant) { 13917 MethodGenerator.prototype._pushBlock = function(reentrant) {
13508 this._scope = new BlockScope(this, this._scope, reentrant); 13918 this._scope = new BlockScope(this, this._scope, reentrant);
13509 } 13919 }
13510 MethodGenerator.prototype._popBlock = function() { 13920 MethodGenerator.prototype._popBlock = function() {
13511 this._scope = this._scope.parent; 13921 this._scope = this._scope.parent;
13512 } 13922 }
13513 MethodGenerator.prototype._makeLambdaMethod = function(name, func) { 13923 MethodGenerator.prototype._makeLambdaMethod = function(name, func) {
13514 var meth = new MethodMember(name, this.method.declaringType, func); 13924 var meth = new MethodMember(name, this.method.declaringType, func);
13515 meth.set$isLambda(true); 13925 meth.set$isLambda(true);
13516 meth.set$enclosingElement(this.method); 13926 meth.set$enclosingElement(this.method);
13517 meth.resolve$0(); 13927 meth.resolve$0();
13518 $globals.world.gen.genMethod((meth && meth.is$Member()), this); 13928 $globals.world.gen.genMethod((meth == null ? null : meth.assert$Member()), thi s);
13519 return (meth && meth.is$MethodMember()); 13929 return (meth == null ? null : meth.assert$MethodMember());
13520 } 13930 }
13521 MethodGenerator.prototype.visitBool = function(node) { 13931 MethodGenerator.prototype.visitBool = function(node) {
13522 return this.visitValue(node).convertTo$3(this, $globals.world.nonNullBool, nod e); 13932 return this.visitValue(node).convertTo$3(this, $globals.world.nonNullBool, nod e);
13523 } 13933 }
13524 MethodGenerator.prototype.visitValue = function(node) { 13934 MethodGenerator.prototype.visitValue = function(node) {
13525 if (node == null) return null; 13935 if (node == null) return null;
13526 var value = node.visit(this); 13936 var value = node.visit(this);
13527 value.checkFirstClass$1(node.span); 13937 value.checkFirstClass$1(node.span);
13528 return value; 13938 return value;
13529 } 13939 }
13530 MethodGenerator.prototype.visitTypedValue = function(node, expectedType) { 13940 MethodGenerator.prototype.visitTypedValue = function(node, expectedType) {
13531 return this.visitValue(node).convertTo$3(this, expectedType, node); 13941 return this.visitValue(node).convertTo$3(this, expectedType, node);
13532 } 13942 }
13533 MethodGenerator.prototype.visitVoid = function(node) { 13943 MethodGenerator.prototype.visitVoid = function(node) {
13534 if ((node instanceof PostfixExpression)) { 13944 if ((node instanceof PostfixExpression)) {
13535 var value = this.visitPostfixExpression((node && node.is$PostfixExpression() ), true); 13945 var value = this.visitPostfixExpression((node == null ? null : node.assert$P ostfixExpression()), true);
13536 value.checkFirstClass$1(node.span); 13946 value.checkFirstClass$1(node.span);
13537 return value; 13947 return value;
13538 } 13948 }
13539 return this.visitValue(node); 13949 return this.visitValue(node);
13540 } 13950 }
13541 MethodGenerator.prototype.visitDietStatement = function(node) { 13951 MethodGenerator.prototype.visitDietStatement = function(node) {
13542 var $0; 13952 var $0;
13543 var parser = new lang_Parser(node.span.file, false, false, false, node.span.st art); 13953 var parser = new lang_Parser(node.span.file, false, false, false, node.span.st art);
13544 this.visitStatementsInBlock((($0 = parser.block$0()) && $0.is$lang_Statement() )); 13954 this.visitStatementsInBlock((($0 = parser.block$0()) == null ? null : $0.asser t$lang_Statement()));
13545 return false; 13955 return false;
13546 } 13956 }
13547 MethodGenerator.prototype.visitVariableDefinition = function(node) { 13957 MethodGenerator.prototype.visitVariableDefinition = function(node) {
13548 var $0; 13958 var $0;
13549 var isFinal = false; 13959 var isFinal = false;
13550 if (node.modifiers != null && $notnull_bool($eq(node.modifiers.$index(0).get$k ind(), 97/*TokenKind.FINAL*/))) { 13960 if (node.modifiers != null && $notnull_bool($eq(node.modifiers.$index(0).get$k ind(), 97/*TokenKind.FINAL*/))) {
13551 isFinal = true; 13961 isFinal = true;
13552 } 13962 }
13553 this.writer.write('var '); 13963 this.writer.write('var ');
13554 var type = this.method.resolveType(node.type, false); 13964 var type = this.method.resolveType(node.type, false);
13555 for (var i = 0; 13965 for (var i = 0;
13556 i < node.names.length; i++) { 13966 i < node.names.length; i++) {
13557 var thisType = type; 13967 var thisType = type;
13558 if (i > 0) { 13968 if (i > 0) {
13559 this.writer.write(', '); 13969 this.writer.write(', ');
13560 } 13970 }
13561 var name = node.names.$index(i).get$name(); 13971 var name = node.names.$index(i).get$name();
13562 var value = this.visitValue((($0 = node.values.$index(i)) && $0.is$lang_Expr ession())); 13972 var value = this.visitValue((($0 = node.values.$index(i)) == null ? null : $ 0.assert$lang_Expression()));
13563 if ($notnull_bool(isFinal)) { 13973 if ($notnull_bool(isFinal)) {
13564 if ($notnull_bool(value == null)) { 13974 if ($notnull_bool(value == null)) {
13565 $globals.world.error('no value specified for final variable', node.span) ; 13975 $globals.world.error('no value specified for final variable', node.span) ;
13566 } 13976 }
13567 else { 13977 else {
13568 if ($notnull_bool(thisType.get$isVar())) thisType = value.get$type(); 13978 if ($notnull_bool(thisType.get$isVar())) thisType = value.get$type();
13569 } 13979 }
13570 } 13980 }
13571 var val = this._scope.create($assert_String(name), (thisType && thisType.is$ lang_Type()), (($0 = node.names.$index(i).get$span()) && $0.is$SourceSpan()), $a ssert_bool(isFinal), false); 13981 var val = this._scope.create($assert_String(name), (thisType == null ? null : thisType.assert$lang_Type()), (($0 = node.names.$index(i).get$span()) == null ? null : $0.assert$SourceSpan()), $assert_bool(isFinal), false);
13572 if ($notnull_bool(value == null)) { 13982 if ($notnull_bool(value == null)) {
13573 if ($notnull_bool(this._scope.reentrant)) { 13983 if ($notnull_bool(this._scope.reentrant)) {
13574 this.writer.write(('' + val.get$code() + ' = null')); 13984 this.writer.write(('' + val.get$code() + ' = null'));
13575 } 13985 }
13576 else { 13986 else {
13577 this.writer.write(('' + val.get$code())); 13987 this.writer.write(('' + val.get$code()));
13578 } 13988 }
13579 } 13989 }
13580 else { 13990 else {
13581 value = value.convertTo$3(this, type, node.values.$index(i)); 13991 value = value.convertTo$3(this, type, node.values.$index(i));
13582 this.writer.write(('' + val.get$code() + ' = ' + value.get$code())); 13992 this.writer.write(('' + val.get$code() + ' = ' + value.get$code()));
13583 } 13993 }
13584 } 13994 }
13585 this.writer.writeln(';'); 13995 this.writer.writeln(';');
13586 return false; 13996 return false;
13587 } 13997 }
13588 MethodGenerator.prototype.visitFunctionDefinition = function(node) { 13998 MethodGenerator.prototype.visitFunctionDefinition = function(node) {
13589 var $0; 13999 var $0;
13590 var name = $globals.world.toJsIdentifier(node.name.name); 14000 var name = $globals.world.toJsIdentifier(node.name.name);
13591 var meth = this._makeLambdaMethod($assert_String(name), node); 14001 var meth = this._makeLambdaMethod($assert_String(name), node);
13592 var funcValue = this._scope.create($assert_String(name), (($0 = meth.get$funct ionType()) && $0.is$lang_Type()), (($0 = this.method.get$definition().get$span() ) && $0.is$SourceSpan()), true, false); 14002 var funcValue = this._scope.create($assert_String(name), (($0 = meth.get$funct ionType()) == null ? null : $0.assert$lang_Type()), (($0 = this.method.get$defin ition().get$span()) == null ? null : $0.assert$SourceSpan()), true, false);
13593 meth.get$generator().writeDefinition$2(this.writer); 14003 meth.get$generator().writeDefinition$2(this.writer);
13594 return false; 14004 return false;
13595 } 14005 }
13596 MethodGenerator.prototype.visitReturnStatement = function(node) { 14006 MethodGenerator.prototype.visitReturnStatement = function(node) {
13597 if (node.value == null) { 14007 if (node.value == null) {
13598 this.writer.writeln('return;'); 14008 this.writer.writeln('return;');
13599 } 14009 }
13600 else { 14010 else {
13601 if ($notnull_bool(this.method.get$isConstructor())) { 14011 if ($notnull_bool(this.method.get$isConstructor())) {
13602 $globals.world.error('return of value not allowed from constructor', node. span); 14012 $globals.world.error('return of value not allowed from constructor', node. span);
(...skipping 19 matching lines...) Expand all
13622 this.writer.writeln(('throw ' + rethrow.get$code() + ';')); 14032 this.writer.writeln(('throw ' + rethrow.get$code() + ';'));
13623 } 14033 }
13624 } 14034 }
13625 return true; 14035 return true;
13626 } 14036 }
13627 MethodGenerator.prototype.visitAssertStatement = function(node) { 14037 MethodGenerator.prototype.visitAssertStatement = function(node) {
13628 var $0; 14038 var $0;
13629 var test = this.visitValue(node.test); 14039 var test = this.visitValue(node.test);
13630 if ($notnull_bool($globals.options.enableAsserts)) { 14040 if ($notnull_bool($globals.options.enableAsserts)) {
13631 var err = $globals.world.corelib.types.$index('AssertError'); 14041 var err = $globals.world.corelib.types.$index('AssertError');
13632 $globals.world.gen.genMethod((($0 = err.getConstructor$1('')) && $0.is$Membe r())); 14042 $globals.world.gen.genMethod((($0 = err.getConstructor$1('_internal')) == nu ll ? null : $0.assert$Member()));
13633 $globals.world.gen.genMethod((($0 = err.get$members().$index('toString')) && $0.is$Member())); 14043 $globals.world.gen.genMethod((($0 = err.get$members().$index('toString')) == null ? null : $0.assert$Member()));
13634 var span = node.test.span; 14044 var span = node.test.span;
13635 var line = span.get$file().getLine$1(span.get$start()); 14045 var line = span.get$file().getLine$1(span.get$start());
13636 var column = span.get$file().getColumn$2(line, span.get$start()); 14046 var column = span.get$file().getColumn$2(line, span.get$start());
13637 this.writer.writeln(('\$assert(' + test.get$code() + ', "' + MethodGenerator ._escapeString($assert_String(span.get$text())) + '",') + (' "' + basename($asse rt_String(span.get$file().get$filename())) + '", ' + (line + 1) + ', ' + (column + 1) + ');')); 14047 this.writer.writeln(('\$assert(' + test.get$code() + ', "' + MethodGenerator ._escapeString($assert_String(span.get$text())) + '",') + (' "' + basename($asse rt_String(span.get$file().get$filename())) + '", ' + (line + 1) + ', ' + (column + 1) + ');'));
13638 $globals.world.gen.corejs.useAssert = true; 14048 $globals.world.gen.corejs.useAssert = true;
13639 } 14049 }
13640 return false; 14050 return false;
13641 } 14051 }
13642 MethodGenerator.prototype.visitBreakStatement = function(node) { 14052 MethodGenerator.prototype.visitBreakStatement = function(node) {
13643 if (node.label == null) { 14053 if (node.label == null) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
13696 this.writer.write((' ' + test.get$code() + '; ')); 14106 this.writer.write((' ' + test.get$code() + '; '));
13697 } 14107 }
13698 else { 14108 else {
13699 this.writer.write('; '); 14109 this.writer.write('; ');
13700 } 14110 }
13701 var needsComma = false; 14111 var needsComma = false;
13702 var $list = node.step; 14112 var $list = node.step;
13703 for (var $i = 0;$i < $list.length; $i++) { 14113 for (var $i = 0;$i < $list.length; $i++) {
13704 var s = $list.$index($i); 14114 var s = $list.$index($i);
13705 if ($notnull_bool(needsComma)) this.writer.write(', '); 14115 if ($notnull_bool(needsComma)) this.writer.write(', ');
13706 var sv = this.visitVoid((s && s.is$lang_Expression())); 14116 var sv = this.visitVoid((s == null ? null : s.assert$lang_Expression()));
13707 this.writer.write($assert_String(sv.get$code())); 14117 this.writer.write($assert_String(sv.get$code()));
13708 needsComma = true; 14118 needsComma = true;
13709 } 14119 }
13710 this.writer.write(') '); 14120 this.writer.write(') ');
13711 this._pushBlock(true); 14121 this._pushBlock(true);
13712 node.body.visit(this); 14122 node.body.visit(this);
13713 this._popBlock(); 14123 this._popBlock();
13714 this._popBlock(); 14124 this._popBlock();
13715 return false; 14125 return false;
13716 } 14126 }
13717 MethodGenerator.prototype._isFinal = function(typeRef) { 14127 MethodGenerator.prototype._isFinal = function(typeRef) {
13718 if ((typeRef instanceof GenericTypeReference)) { 14128 if ((typeRef instanceof GenericTypeReference)) {
13719 typeRef = typeRef.get$baseType(); 14129 typeRef = typeRef.get$baseType();
13720 } 14130 }
13721 return $notnull_bool($ne(typeRef, null)) && $notnull_bool(typeRef.get$isFinal( )); 14131 return $notnull_bool($ne(typeRef, null)) && $notnull_bool(typeRef.get$isFinal( ));
13722 } 14132 }
13723 MethodGenerator.prototype.visitForInStatement = function(node) { 14133 MethodGenerator.prototype.visitForInStatement = function(node) {
13724 var $0; 14134 var $0;
13725 var itemType = this.method.resolveType(node.item.type, false); 14135 var itemType = this.method.resolveType(node.item.type, false);
13726 var itemName = node.item.name.name; 14136 var itemName = node.item.name.name;
13727 var list = node.list.visit(this); 14137 var list = node.list.visit(this);
13728 this._pushBlock(true); 14138 this._pushBlock(true);
13729 var isFinal = this._isFinal(node.item.type); 14139 var isFinal = this._isFinal(node.item.type);
13730 var item = this._scope.create($assert_String(itemName), (itemType && itemType. is$lang_Type()), node.item.name.span, isFinal, false); 14140 var item = this._scope.create($assert_String(itemName), (itemType == null ? nu ll : itemType.assert$lang_Type()), node.item.name.span, isFinal, false);
13731 var listVar = (list && list.is$Value()); 14141 var listVar = (list == null ? null : list.assert$Value());
13732 if ($notnull_bool(list.get$needsTemp())) { 14142 if ($notnull_bool(list.get$needsTemp())) {
13733 listVar = this._scope.create('\$list', (($0 = list.get$type()) && $0.is$lang _Type()), null, false, false); 14143 listVar = this._scope.create('\$list', (($0 = list.get$type()) == null ? nul l : $0.assert$lang_Type()), null, false, false);
13734 this.writer.writeln(('var ' + listVar.code + ' = ' + list.get$code() + ';')) ; 14144 this.writer.writeln(('var ' + listVar.code + ' = ' + list.get$code() + ';')) ;
13735 } 14145 }
13736 if ($notnull_bool(list.get$type().get$isList())) { 14146 if ($notnull_bool(list.get$type().get$isList())) {
13737 var tmpi = this._scope.create('\$i', $globals.world.numType, null, false, fa lse); 14147 var tmpi = this._scope.create('\$i', $globals.world.numType, null, false, fa lse);
13738 this.writer.enterBlock(('for (var ' + tmpi.get$code() + ' = 0;') + ('' + tmp i.get$code() + ' < ' + listVar.code + '.length; ' + tmpi.get$code() + '++) {')); 14148 this.writer.enterBlock(('for (var ' + tmpi.get$code() + ' = 0;') + ('' + tmp i.get$code() + ' < ' + listVar.code + '.length; ' + tmpi.get$code() + '++) {'));
13739 var value = listVar.invoke(this, '\$index', node.list, new Arguments(null, [ tmpi]), false); 14149 var value = listVar.invoke(this, '\$index', node.list, new Arguments(null, [ tmpi]), false);
13740 this.writer.writeln(('var ' + item.get$code() + ' = ' + value.get$code() + ' ;')); 14150 this.writer.writeln(('var ' + item.get$code() + ' = ' + value.get$code() + ' ;'));
13741 } 14151 }
13742 else { 14152 else {
13743 this._pushBlock(false); 14153 this._pushBlock(false);
13744 var iterator = list.invoke$4(this, 'iterator', node.list, Arguments.get$EMPT Y()); 14154 var iterator = list.invoke$4(this, 'iterator', node.list, Arguments.get$EMPT Y());
13745 var tmpi = this._scope.create('\$i', (($0 = iterator.get$type()) && $0.is$la ng_Type()), null, false, false); 14155 var tmpi = this._scope.create('\$i', (($0 = iterator.get$type()) == null ? n ull : $0.assert$lang_Type()), null, false, false);
13746 var hasNext = tmpi.invoke$4(this, 'hasNext', node.list, Arguments.get$EMPTY( )); 14156 var hasNext = tmpi.invoke$4(this, 'hasNext', node.list, Arguments.get$EMPTY( ));
13747 var next = tmpi.invoke$4(this, 'next', node.list, Arguments.get$EMPTY()); 14157 var next = tmpi.invoke$4(this, 'next', node.list, Arguments.get$EMPTY());
13748 this.writer.enterBlock(('for (var ' + tmpi.get$code() + ' = ' + iterator.get $code() + '; ' + hasNext.get$code() + '; ) {')); 14158 this.writer.enterBlock(('for (var ' + tmpi.get$code() + ' = ' + iterator.get $code() + '; ' + hasNext.get$code() + '; ) {'));
13749 this.writer.writeln(('var ' + item.get$code() + ' = ' + next.get$code() + '; ')); 14159 this.writer.writeln(('var ' + item.get$code() + ' = ' + next.get$code() + '; '));
13750 } 14160 }
13751 this.visitStatementsInBlock(node.body); 14161 this.visitStatementsInBlock(node.body);
13752 this.writer.exitBlock('}'); 14162 this.writer.exitBlock('}');
13753 this._popBlock(); 14163 this._popBlock();
13754 return false; 14164 return false;
13755 } 14165 }
13756 MethodGenerator.prototype._genToDartException = function(ex, node) { 14166 MethodGenerator.prototype._genToDartException = function(ex, node) {
13757 var result = this._invokeNative("_toDartException", [ex]); 14167 var result = this._invokeNative("_toDartException", [ex]);
13758 this.writer.writeln(('' + ex.code + ' = ' + result.get$code() + ';')); 14168 this.writer.writeln(('' + ex.code + ' = ' + result.get$code() + ';'));
13759 } 14169 }
13760 MethodGenerator.prototype.visitTryStatement = function(node) { 14170 MethodGenerator.prototype.visitTryStatement = function(node) {
13761 var $0; 14171 var $0;
13762 this.writer.enterBlock('try {'); 14172 this.writer.enterBlock('try {');
13763 this._pushBlock(false); 14173 this._pushBlock(false);
13764 this.visitStatementsInBlock(node.body); 14174 this.visitStatementsInBlock(node.body);
13765 this._popBlock(); 14175 this._popBlock();
13766 if (node.catches.length == 1) { 14176 if (node.catches.length == 1) {
13767 var catch_ = node.catches.$index(0); 14177 var catch_ = node.catches.$index(0);
13768 this._pushBlock(false); 14178 this._pushBlock(false);
13769 var ex = this._scope.declare((($0 = catch_.get$exception()) && $0.is$Declare dIdentifier())); 14179 var ex = this._scope.declare((($0 = catch_.get$exception()) == null ? null : $0.assert$DeclaredIdentifier()));
13770 this._scope.rethrow = (ex && ex.is$Value()); 14180 this._scope.rethrow = (ex == null ? null : ex.assert$Value());
13771 this.writer.nextBlock(('} catch (' + ex.get$code() + ') {')); 14181 this.writer.nextBlock(('} catch (' + ex.get$code() + ') {'));
13772 if ($notnull_bool($ne(catch_.get$trace(), null))) { 14182 if ($notnull_bool($ne(catch_.get$trace(), null))) {
13773 var trace = this._scope.declare((($0 = catch_.get$trace()) && $0.is$Declar edIdentifier())); 14183 var trace = this._scope.declare((($0 = catch_.get$trace()) == null ? null : $0.assert$DeclaredIdentifier()));
13774 this.writer.writeln(('var ' + trace.get$code() + ' = \$stackTraceOf(' + ex .get$code() + ');')); 14184 this.writer.writeln(('var ' + trace.get$code() + ' = \$stackTraceOf(' + ex .get$code() + ');'));
13775 $globals.world.gen.corejs.useStackTraceOf = true; 14185 $globals.world.gen.corejs.useStackTraceOf = true;
13776 } 14186 }
13777 this._genToDartException((ex && ex.is$Value()), node); 14187 this._genToDartException((ex == null ? null : ex.assert$Value()), node);
13778 if (!$notnull_bool(ex.get$type().get$isVarOrObject())) { 14188 if (!$notnull_bool(ex.get$type().get$isVarOrObject())) {
13779 var test = ex.instanceOf$3$isTrue$forceCheck(this, ex.get$type(), catch_.g et$exception().get$span(), false, true); 14189 var test = ex.instanceOf$3$isTrue$forceCheck(this, ex.get$type(), catch_.g et$exception().get$span(), false, true);
13780 this.writer.writeln(('if (' + test.get$code() + ') throw ' + ex.get$code() + ';')); 14190 this.writer.writeln(('if (' + test.get$code() + ') throw ' + ex.get$code() + ';'));
13781 } 14191 }
13782 this.visitStatementsInBlock((($0 = node.catches.$index(0).get$body()) && $0. is$lang_Statement())); 14192 this.visitStatementsInBlock((($0 = node.catches.$index(0).get$body()) == nul l ? null : $0.assert$lang_Statement()));
13783 this._popBlock(); 14193 this._popBlock();
13784 } 14194 }
13785 else if (node.catches.length > 0) { 14195 else if (node.catches.length > 0) {
13786 this._pushBlock(false); 14196 this._pushBlock(false);
13787 var ex = this._scope.create('\$ex', $globals.world.varType, null, false, fal se); 14197 var ex = this._scope.create('\$ex', $globals.world.varType, null, false, fal se);
13788 this._scope.rethrow = (ex && ex.is$Value()); 14198 this._scope.rethrow = (ex == null ? null : ex.assert$Value());
13789 this.writer.nextBlock(('} catch (' + ex.get$code() + ') {')); 14199 this.writer.nextBlock(('} catch (' + ex.get$code() + ') {'));
13790 var trace = null; 14200 var trace = null;
13791 if (node.catches.some((function (c) { 14201 if (node.catches.some((function (c) {
13792 return $ne(c.get$trace(), null); 14202 return $ne(c.get$trace(), null);
13793 }) 14203 })
13794 )) { 14204 )) {
13795 trace = this._scope.create('\$trace', $globals.world.varType, null, false, false); 14205 trace = this._scope.create('\$trace', $globals.world.varType, null, false, false);
13796 this.writer.writeln(('var ' + trace.get$code() + ' = \$stackTraceOf(' + ex .get$code() + ');')); 14206 this.writer.writeln(('var ' + trace.get$code() + ' = \$stackTraceOf(' + ex .get$code() + ');'));
13797 $globals.world.gen.corejs.useStackTraceOf = true; 14207 $globals.world.gen.corejs.useStackTraceOf = true;
13798 } 14208 }
13799 this._genToDartException((ex && ex.is$Value()), node); 14209 this._genToDartException((ex == null ? null : ex.assert$Value()), node);
13800 var needsRethrow = true; 14210 var needsRethrow = true;
13801 for (var i = 0; 14211 for (var i = 0;
13802 i < node.catches.length; i++) { 14212 i < node.catches.length; i++) {
13803 var catch_ = node.catches.$index(i); 14213 var catch_ = node.catches.$index(i);
13804 this._pushBlock(false); 14214 this._pushBlock(false);
13805 var tmp = this._scope.declare((($0 = catch_.get$exception()) && $0.is$Decl aredIdentifier())); 14215 var tmp = this._scope.declare((($0 = catch_.get$exception()) == null ? nul l : $0.assert$DeclaredIdentifier()));
13806 if (!$notnull_bool(tmp.get$type().get$isVarOrObject())) { 14216 if (!$notnull_bool(tmp.get$type().get$isVarOrObject())) {
13807 var test = ex.instanceOf$3$isTrue$forceCheck(this, tmp.get$type(), catch _.get$exception().get$span(), true, true); 14217 var test = ex.instanceOf$3$isTrue$forceCheck(this, tmp.get$type(), catch _.get$exception().get$span(), true, true);
13808 if (i == 0) { 14218 if (i == 0) {
13809 this.writer.enterBlock(('if (' + test.get$code() + ') {')); 14219 this.writer.enterBlock(('if (' + test.get$code() + ') {'));
13810 } 14220 }
13811 else { 14221 else {
13812 this.writer.nextBlock(('} else if (' + test.get$code() + ') {')); 14222 this.writer.nextBlock(('} else if (' + test.get$code() + ') {'));
13813 } 14223 }
13814 } 14224 }
13815 else if (i > 0) { 14225 else if (i > 0) {
13816 this.writer.nextBlock('} else {'); 14226 this.writer.nextBlock('} else {');
13817 } 14227 }
13818 this.writer.writeln(('var ' + tmp.get$code() + ' = ' + ex.get$code() + ';' )); 14228 this.writer.writeln(('var ' + tmp.get$code() + ' = ' + ex.get$code() + ';' ));
13819 if ($notnull_bool($ne(catch_.get$trace(), null))) { 14229 if ($notnull_bool($ne(catch_.get$trace(), null))) {
13820 var tmptrace = this._scope.declare((($0 = catch_.get$trace()) && $0.is$D eclaredIdentifier())); 14230 var tmptrace = this._scope.declare((($0 = catch_.get$trace()) == null ? null : $0.assert$DeclaredIdentifier()));
13821 this.writer.writeln(('var ' + tmptrace.get$code() + ' = ' + trace.get$co de() + ';')); 14231 this.writer.writeln(('var ' + tmptrace.get$code() + ' = ' + trace.get$co de() + ';'));
13822 } 14232 }
13823 this.visitStatementsInBlock((($0 = catch_.get$body()) && $0.is$lang_Statem ent())); 14233 this.visitStatementsInBlock((($0 = catch_.get$body()) == null ? null : $0. assert$lang_Statement()));
13824 this._popBlock(); 14234 this._popBlock();
13825 if ($notnull_bool(tmp.get$type().get$isVarOrObject())) { 14235 if ($notnull_bool(tmp.get$type().get$isVarOrObject())) {
13826 if (i + 1 < node.catches.length) { 14236 if (i + 1 < node.catches.length) {
13827 $globals.world.warning('Unreachable catch clause', (($0 = node.catches .$index(i + 1)) && $0.is$SourceSpan())); 14237 $globals.world.warning('Unreachable catch clause', (($0 = node.catches .$index(i + 1)) == null ? null : $0.assert$SourceSpan()));
13828 } 14238 }
13829 if (i > 0) { 14239 if (i > 0) {
13830 this.writer.exitBlock('}'); 14240 this.writer.exitBlock('}');
13831 } 14241 }
13832 needsRethrow = false; 14242 needsRethrow = false;
13833 break; 14243 break;
13834 } 14244 }
13835 } 14245 }
13836 if ($notnull_bool(needsRethrow)) { 14246 if ($notnull_bool(needsRethrow)) {
13837 this.writer.nextBlock('} else {'); 14247 this.writer.nextBlock('} else {');
(...skipping 12 matching lines...) Expand all
13850 return false; 14260 return false;
13851 } 14261 }
13852 MethodGenerator.prototype.visitSwitchStatement = function(node) { 14262 MethodGenerator.prototype.visitSwitchStatement = function(node) {
13853 var $0; 14263 var $0;
13854 var test = this.visitValue(node.test); 14264 var test = this.visitValue(node.test);
13855 this.writer.enterBlock(('switch (' + test.get$code() + ') {')); 14265 this.writer.enterBlock(('switch (' + test.get$code() + ') {'));
13856 var $list = node.cases; 14266 var $list = node.cases;
13857 for (var $i = 0;$i < $list.length; $i++) { 14267 for (var $i = 0;$i < $list.length; $i++) {
13858 var case_ = $list.$index($i); 14268 var case_ = $list.$index($i);
13859 if ($notnull_bool($ne(case_.get$label(), null))) { 14269 if ($notnull_bool($ne(case_.get$label(), null))) {
13860 $globals.world.error('unimplemented: labeled case statement', (($0 = case_ .get$span()) && $0.is$SourceSpan())); 14270 $globals.world.error('unimplemented: labeled case statement', (($0 = case_ .get$span()) == null ? null : $0.assert$SourceSpan()));
13861 } 14271 }
13862 this._pushBlock(false); 14272 this._pushBlock(false);
13863 for (var i = 0; 14273 for (var i = 0;
13864 i < $assert_num(case_.get$cases().length); i++) { 14274 i < $assert_num(case_.get$cases().length); i++) {
13865 var expr = case_.get$cases().$index(i); 14275 var expr = case_.get$cases().$index(i);
13866 if ($notnull_bool(expr == null)) { 14276 if ($notnull_bool(expr == null)) {
13867 if (i < case_.get$cases().length - 1) { 14277 if (i < case_.get$cases().length - 1) {
13868 $globals.world.error('default clause must be the last case', (($0 = ca se_.get$span()) && $0.is$SourceSpan())); 14278 $globals.world.error('default clause must be the last case', (($0 = ca se_.get$span()) == null ? null : $0.assert$SourceSpan()));
13869 } 14279 }
13870 this.writer.writeln('default:'); 14280 this.writer.writeln('default:');
13871 } 14281 }
13872 else { 14282 else {
13873 var value = this.visitValue((expr && expr.is$lang_Expression())); 14283 var value = this.visitValue((expr == null ? null : expr.assert$lang_Expr ession()));
13874 this.writer.writeln(('case ' + value.get$code() + ':')); 14284 this.writer.writeln(('case ' + value.get$code() + ':'));
13875 } 14285 }
13876 } 14286 }
13877 this.writer.enterBlock(''); 14287 this.writer.enterBlock('');
13878 var caseExits = this._visitAllStatements(case_.get$statements(), false); 14288 var caseExits = this._visitAllStatements(case_.get$statements(), false);
13879 if ($notnull_bool($ne(case_, node.cases.$index(node.cases.length - 1))) && ! $notnull_bool(caseExits)) { 14289 if ($notnull_bool($ne(case_, node.cases.$index(node.cases.length - 1))) && ! $notnull_bool(caseExits)) {
13880 var span = case_.get$statements().$index(case_.get$statements().length - 1 ).get$span(); 14290 var span = case_.get$statements().$index(case_.get$statements().length - 1 ).get$span();
13881 this.writer.writeln('\$throw(new FallThroughError());'); 14291 this.writer.writeln('\$throw(new FallThroughError());');
13882 $globals.world.gen.corejs.useThrow = true; 14292 $globals.world.gen.corejs.useThrow = true;
13883 } 14293 }
13884 this.writer.exitBlock(''); 14294 this.writer.exitBlock('');
13885 this._popBlock(); 14295 this._popBlock();
13886 } 14296 }
13887 this.writer.exitBlock('}'); 14297 this.writer.exitBlock('}');
13888 return false; 14298 return false;
13889 } 14299 }
13890 MethodGenerator.prototype._visitAllStatements = function(statementList, exits) { 14300 MethodGenerator.prototype._visitAllStatements = function(statementList, exits) {
13891 var $0; 14301 var $0;
13892 for (var i = 0; 14302 for (var i = 0;
13893 i < $assert_num(statementList.length); i++) { 14303 i < $assert_num(statementList.length); i++) {
13894 var stmt = statementList.$index(i); 14304 var stmt = statementList.$index(i);
13895 exits = stmt.visit$1(this); 14305 exits = stmt.visit$1(this);
13896 if ($notnull_bool($ne(stmt, statementList.$index(statementList.length - 1))) && $notnull_bool(exits)) { 14306 if ($notnull_bool($ne(stmt, statementList.$index(statementList.length - 1))) && $notnull_bool(exits)) {
13897 $globals.world.warning('unreachable code', (($0 = statementList.$index(i + 1).get$span()) && $0.is$SourceSpan())); 14307 $globals.world.warning('unreachable code', (($0 = statementList.$index(i + 1).get$span()) == null ? null : $0.assert$SourceSpan()));
13898 } 14308 }
13899 } 14309 }
13900 return $assert_bool(exits); 14310 return $assert_bool(exits);
13901 } 14311 }
13902 MethodGenerator.prototype.visitBlockStatement = function(node) { 14312 MethodGenerator.prototype.visitBlockStatement = function(node) {
13903 this._pushBlock(false); 14313 this._pushBlock(false);
13904 this.writer.enterBlock('{'); 14314 this.writer.enterBlock('{');
13905 var exits = this._visitAllStatements(node.body, false); 14315 var exits = this._visitAllStatements(node.body, false);
13906 this.writer.exitBlock('}'); 14316 this.writer.exitBlock('}');
13907 this._popBlock(); 14317 this._popBlock();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
13976 var w = new CodeWriter(); 14386 var w = new CodeWriter();
13977 meth.get$generator().writeDefinition$2(w, node); 14387 meth.get$generator().writeDefinition$2(w, node);
13978 return new Value(meth.get$functionType(), w.get$text(), node.span, true); 14388 return new Value(meth.get$functionType(), w.get$text(), node.span, true);
13979 } 14389 }
13980 MethodGenerator.prototype.visitCallExpression = function(node) { 14390 MethodGenerator.prototype.visitCallExpression = function(node) {
13981 var $0; 14391 var $0;
13982 var target; 14392 var target;
13983 var position = node.target; 14393 var position = node.target;
13984 var name = '\$call'; 14394 var name = '\$call';
13985 if ((node.target instanceof DotExpression)) { 14395 if ((node.target instanceof DotExpression)) {
13986 var dot = (($0 = node.target) && $0.is$DotExpression()); 14396 var dot = (($0 = node.target) == null ? null : $0.assert$DotExpression());
13987 target = dot.self.visit(this); 14397 target = dot.self.visit(this);
13988 name = dot.name.name; 14398 name = dot.name.name;
13989 position = dot.name; 14399 position = dot.name;
13990 } 14400 }
13991 else if ((node.target instanceof VarExpression)) { 14401 else if ((node.target instanceof VarExpression)) {
13992 var varExpr = (($0 = node.target) && $0.is$VarExpression()); 14402 var varExpr = (($0 = node.target) == null ? null : $0.assert$VarExpression() );
13993 name = varExpr.name.name; 14403 name = varExpr.name.name;
13994 target = this._scope.lookup($assert_String(name)); 14404 target = this._scope.lookup($assert_String(name));
13995 if ($notnull_bool($ne(target, null))) { 14405 if ($notnull_bool($ne(target, null))) {
13996 return target.invoke$4(this, '\$call', node, this._makeArgs(node.arguments )); 14406 return target.invoke$4(this, '\$call', node, this._makeArgs(node.arguments ));
13997 } 14407 }
13998 target = this._makeThisOrType(varExpr.span); 14408 target = this._makeThisOrType(varExpr.span);
13999 return target.invoke$4(this, name, node, this._makeArgs(node.arguments)); 14409 return target.invoke$4(this, name, node, this._makeArgs(node.arguments));
14000 } 14410 }
14001 else { 14411 else {
14002 target = node.target.visit(this); 14412 target = node.target.visit(this);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
14066 } 14476 }
14067 } 14477 }
14068 MethodGenerator.prototype._visitAssign = function(kind, xn, yn, position, captur eOriginal) { 14478 MethodGenerator.prototype._visitAssign = function(kind, xn, yn, position, captur eOriginal) {
14069 if (captureOriginal == null) { 14479 if (captureOriginal == null) {
14070 captureOriginal = (function (x) { 14480 captureOriginal = (function (x) {
14071 return x; 14481 return x;
14072 }) 14482 })
14073 ; 14483 ;
14074 } 14484 }
14075 if ((xn instanceof VarExpression)) { 14485 if ((xn instanceof VarExpression)) {
14076 return this._visitVarAssign(kind, (xn && xn.is$VarExpression()), yn, positio n, captureOriginal); 14486 return this._visitVarAssign(kind, (xn == null ? null : xn.assert$VarExpressi on()), yn, position, captureOriginal);
14077 } 14487 }
14078 else if ((xn instanceof IndexExpression)) { 14488 else if ((xn instanceof IndexExpression)) {
14079 return this._visitIndexAssign(kind, (xn && xn.is$IndexExpression()), yn, pos ition, captureOriginal); 14489 return this._visitIndexAssign(kind, (xn == null ? null : xn.assert$IndexExpr ession()), yn, position, captureOriginal);
14080 } 14490 }
14081 else if ((xn instanceof DotExpression)) { 14491 else if ((xn instanceof DotExpression)) {
14082 return this._visitDotAssign(kind, (xn && xn.is$DotExpression()), yn, positio n, captureOriginal); 14492 return this._visitDotAssign(kind, (xn == null ? null : xn.assert$DotExpressi on()), yn, position, captureOriginal);
14083 } 14493 }
14084 else { 14494 else {
14085 $globals.world.error('illegal lhs', position.span); 14495 $globals.world.error('illegal lhs', position.span);
14086 } 14496 }
14087 } 14497 }
14088 MethodGenerator.prototype._visitVarAssign = function(kind, xn, yn, position, cap tureOriginal) { 14498 MethodGenerator.prototype._visitVarAssign = function(kind, xn, yn, position, cap tureOriginal) {
14089 var name = xn.name.name; 14499 var name = xn.name.name;
14090 var x = this._scope.lookup(name); 14500 var x = this._scope.lookup(name);
14091 var y = this.visitValue(yn); 14501 var y = this.visitValue(yn);
14092 if ($notnull_bool(x == null)) { 14502 if ($notnull_bool(x == null)) {
14093 var members = this.method.declaringType.resolveMember(name); 14503 var members = this.method.declaringType.resolveMember(name);
14094 x = this._makeThisOrType(position.span); 14504 x = this._makeThisOrType(position.span);
14095 if ($notnull_bool($ne(members, null))) { 14505 if ($notnull_bool($ne(members, null))) {
14096 if (kind == 0) { 14506 if (kind == 0) {
14097 return x.set_$4(this, name, position, y); 14507 return x.set_$4(this, name, position, y);
14098 } 14508 }
14099 else if (!$notnull_bool(members.get$treatAsField()) || $notnull_bool(membe rs.get$containsMethods())) { 14509 else if (!$notnull_bool(members.get$treatAsField()) || $notnull_bool(membe rs.get$containsMethods())) {
14100 var right = x.get_$3(this, name, position); 14510 var right = x.get_$3(this, name, position);
14101 right = captureOriginal((right && right.is$Value())); 14511 right = captureOriginal((right == null ? null : right.assert$Value()));
14102 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arguments(null, [y])); 14512 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arguments(null, [y]));
14103 return x.set_$4(this, name, position, y); 14513 return x.set_$4(this, name, position, y);
14104 } 14514 }
14105 else { 14515 else {
14106 x = x.get_$3(this, name, position); 14516 x = x.get_$3(this, name, position);
14107 } 14517 }
14108 } 14518 }
14109 else { 14519 else {
14110 var member = this.get$library().lookup(name, xn.name.span); 14520 var member = this.get$library().lookup(name, xn.name.span);
14111 if (member == null) { 14521 if (member == null) {
14112 $globals.world.warning(('can not resolve ' + name), xn.span); 14522 $globals.world.warning(('can not resolve ' + name), xn.span);
14113 return this._makeMissingValue(name); 14523 return this._makeMissingValue(name);
14114 } 14524 }
14115 members = new MemberSet(member, false); 14525 members = new MemberSet(member, false);
14116 if (!$notnull_bool(members.get$treatAsField()) || $notnull_bool(members.ge t$containsMethods())) { 14526 if (!$notnull_bool(members.get$treatAsField()) || $notnull_bool(members.ge t$containsMethods())) {
14117 if (kind != 0) { 14527 if (kind != 0) {
14118 var right = members._get$3(this, position, x); 14528 var right = members._get$3(this, position, x);
14119 right = captureOriginal((right && right.is$Value())); 14529 right = captureOriginal((right == null ? null : right.assert$Value())) ;
14120 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, n ew Arguments(null, [y])); 14530 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, n ew Arguments(null, [y]));
14121 } 14531 }
14122 return members._set$4(this, position, x, y); 14532 return members._set$4(this, position, x, y);
14123 } 14533 }
14124 else { 14534 else {
14125 x = members._get$3(this, position, x); 14535 x = members._get$3(this, position, x);
14126 } 14536 }
14127 } 14537 }
14128 } 14538 }
14129 if ($notnull_bool(x.get$isFinal())) { 14539 if ($notnull_bool(x.get$isFinal())) {
14130 $globals.world.error(('final variable "' + x.get$code() + '" is not assignab le'), position.span); 14540 $globals.world.error(('final variable "' + x.get$code() + '" is not assignab le'), position.span);
14131 } 14541 }
14132 y = y.convertTo$3(this, x.get$type(), yn); 14542 y = y.convertTo$3(this, x.get$type(), yn);
14133 if (kind == 0) { 14543 if (kind == 0) {
14134 x = captureOriginal((x && x.is$Value())); 14544 x = captureOriginal((x == null ? null : x.assert$Value()));
14135 return new Value(y.get$type(), ('' + x.get$code() + ' = ' + y.get$code()), p osition.span, true); 14545 return new Value(y.get$type(), ('' + x.get$code() + ' = ' + y.get$code()), p osition.span, true);
14136 } 14546 }
14137 else if ($notnull_bool(x.get$type().get$isNum()) && $notnull_bool(y.get$type() .get$isNum()) && (kind != 46/*TokenKind.TRUNCDIV*/)) { 14547 else if ($notnull_bool(x.get$type().get$isNum()) && $notnull_bool(y.get$type() .get$isNum()) && (kind != 46/*TokenKind.TRUNCDIV*/)) {
14138 x = captureOriginal((x && x.is$Value())); 14548 x = captureOriginal((x == null ? null : x.assert$Value()));
14139 var op = TokenKind.kindToString(kind); 14549 var op = TokenKind.kindToString(kind);
14140 return new Value(y.get$type(), ('' + x.get$code() + ' ' + op + '= ' + y.get$ code()), position.span, true); 14550 return new Value(y.get$type(), ('' + x.get$code() + ' ' + op + '= ' + y.get$ code()), position.span, true);
14141 } 14551 }
14142 else { 14552 else {
14143 var right = x; 14553 var right = x;
14144 right = captureOriginal((right && right.is$Value())); 14554 right = captureOriginal((right == null ? null : right.assert$Value()));
14145 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arg uments(null, [y])); 14555 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arg uments(null, [y]));
14146 return new Value(y.get$type(), ('' + x.get$code() + ' = ' + y.get$code()), p osition.span, true); 14556 return new Value(y.get$type(), ('' + x.get$code() + ' = ' + y.get$code()), p osition.span, true);
14147 } 14557 }
14148 } 14558 }
14149 MethodGenerator.prototype._visitIndexAssign = function(kind, xn, yn, position, c aptureOriginal) { 14559 MethodGenerator.prototype._visitIndexAssign = function(kind, xn, yn, position, c aptureOriginal) {
14150 var target = this.visitValue(xn.target); 14560 var target = this.visitValue(xn.target);
14151 var index = this.visitValue(xn.index); 14561 var index = this.visitValue(xn.index);
14152 var y = this.visitValue(yn); 14562 var y = this.visitValue(yn);
14153 var tmptarget = target; 14563 var tmptarget = target;
14154 var tmpindex = index; 14564 var tmpindex = index;
14155 if (kind != 0) { 14565 if (kind != 0) {
14156 tmptarget = this.getTemp((target && target.is$Value())); 14566 tmptarget = this.getTemp((target == null ? null : target.assert$Value()));
14157 tmpindex = this.getTemp((index && index.is$Value())); 14567 tmpindex = this.getTemp((index == null ? null : index.assert$Value()));
14158 index = this.assignTemp((tmpindex && tmpindex.is$Value()), (index && index.i s$Value())); 14568 index = this.assignTemp((tmpindex == null ? null : tmpindex.assert$Value()), (index == null ? null : index.assert$Value()));
14159 var right = tmptarget.invoke$4(this, '\$index', position, new Arguments(null , [tmpindex])); 14569 var right = tmptarget.invoke$4(this, '\$index', position, new Arguments(null , [tmpindex]));
14160 right = captureOriginal((right && right.is$Value())); 14570 right = captureOriginal((right == null ? null : right.assert$Value()));
14161 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arg uments(null, [y])); 14571 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arg uments(null, [y]));
14162 } 14572 }
14163 var ret = this.assignTemp((tmptarget && tmptarget.is$Value()), (target && targ et.is$Value())).invoke(this, '\$setindex', position, new Arguments(null, [index, y]), false); 14573 var ret = this.assignTemp((tmptarget == null ? null : tmptarget.assert$Value() ), (target == null ? null : target.assert$Value())).invoke(this, '\$setindex', p osition, new Arguments(null, [index, y]), false);
14164 if ($notnull_bool($ne(tmptarget, target))) this.freeTemp((tmptarget && tmptarg et.is$Value())); 14574 if ($notnull_bool($ne(tmptarget, target))) this.freeTemp((tmptarget == null ? null : tmptarget.assert$Value()));
14165 if ($notnull_bool($ne(tmpindex, index))) this.freeTemp((tmpindex && tmpindex.i s$Value())); 14575 if ($notnull_bool($ne(tmpindex, index))) this.freeTemp((tmpindex == null ? nul l : tmpindex.assert$Value()));
14166 return ret; 14576 return ret;
14167 } 14577 }
14168 MethodGenerator.prototype._visitDotAssign = function(kind, xn, yn, position, cap tureOriginal) { 14578 MethodGenerator.prototype._visitDotAssign = function(kind, xn, yn, position, cap tureOriginal) {
14169 var target = xn.self.visit(this); 14579 var target = xn.self.visit(this);
14170 var y = this.visitValue(yn); 14580 var y = this.visitValue(yn);
14171 var tmptarget = target; 14581 var tmptarget = target;
14172 if (kind != 0) { 14582 if (kind != 0) {
14173 tmptarget = this.getTemp((target && target.is$Value())); 14583 tmptarget = this.getTemp((target == null ? null : target.assert$Value()));
14174 var right = tmptarget.get_$3(this, xn.name.name, xn.name); 14584 var right = tmptarget.get_$3(this, xn.name.name, xn.name);
14175 right = captureOriginal((right && right.is$Value())); 14585 right = captureOriginal((right == null ? null : right.assert$Value()));
14176 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arg uments(null, [y])); 14586 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arg uments(null, [y]));
14177 } 14587 }
14178 var ret = this.assignTemp((tmptarget && tmptarget.is$Value()), (target && targ et.is$Value())).set_(this, xn.name.name, xn.name, (y && y.is$Value()), false); 14588 var ret = this.assignTemp((tmptarget == null ? null : tmptarget.assert$Value() ), (target == null ? null : target.assert$Value())).set_(this, xn.name.name, xn. name, (y == null ? null : y.assert$Value()), false);
14179 if ($notnull_bool($ne(tmptarget, target))) this.freeTemp((tmptarget && tmptarg et.is$Value())); 14589 if ($notnull_bool($ne(tmptarget, target))) this.freeTemp((tmptarget == null ? null : tmptarget.assert$Value()));
14180 return ret; 14590 return ret;
14181 } 14591 }
14182 MethodGenerator.prototype.visitUnaryExpression = function(node) { 14592 MethodGenerator.prototype.visitUnaryExpression = function(node) {
14183 var $0; 14593 var $0;
14184 var value = this.visitValue(node.self); 14594 var value = this.visitValue(node.self);
14185 switch (node.op.kind) { 14595 switch (node.op.kind) {
14186 case 16/*TokenKind.INCR*/: 14596 case 16/*TokenKind.INCR*/:
14187 case 17/*TokenKind.DECR*/: 14597 case 17/*TokenKind.DECR*/:
14188 14598
14189 if ($notnull_bool(value.get$type().get$isNum())) { 14599 if ($notnull_bool(value.get$type().get$isNum())) {
14190 return new Value(value.get$type(), ('' + node.op + value.get$code()), no de.span, true); 14600 return new Value(value.get$type(), ('' + node.op + value.get$code()), no de.span, true);
14191 } 14601 }
14192 else { 14602 else {
14193 var kind = (16/*TokenKind.INCR*/ == node.op.kind ? 42/*TokenKind.ADD*/ : 43/*TokenKind.SUB*/); 14603 var kind = (16/*TokenKind.INCR*/ == node.op.kind ? 42/*TokenKind.ADD*/ : 43/*TokenKind.SUB*/);
14194 var operand = new LiteralExpression(1, new TypeReference(node.span, $glo bals.world.numType), '1', node.span); 14604 var operand = new LiteralExpression(1, new TypeReference(node.span, $glo bals.world.numType), '1', node.span);
14195 return this._visitAssign($assert_num(kind), node.self, (operand && opera nd.is$lang_Expression()), node, to$call$1(null)); 14605 return this._visitAssign($assert_num(kind), node.self, (operand == null ? null : operand.assert$lang_Expression()), node, to$call$1(null));
14196 } 14606 }
14197 14607
14198 case 19/*TokenKind.NOT*/: 14608 case 19/*TokenKind.NOT*/:
14199 14609
14200 if ($notnull_bool(value.get$type().get$isBool()) && $notnull_bool(value.ge t$isConst())) { 14610 if ($notnull_bool(value.get$type().get$isBool()) && $notnull_bool(value.ge t$isConst())) {
14201 var newVal = !$notnull_bool(value.get$actualValue()); 14611 var newVal = !$notnull_bool(value.get$actualValue());
14202 return EvaluatedValue.EvaluatedValue$factory((($0 = value.get$type()) && $0.is$lang_Type()), newVal, ('' + newVal), node.span); 14612 return EvaluatedValue.EvaluatedValue$factory((($0 = value.get$type()) == null ? null : $0.assert$lang_Type()), newVal, ('' + newVal), node.span);
14203 } 14613 }
14204 else { 14614 else {
14205 var newVal = value.convertTo$3(this, $globals.world.nonNullBool, node); 14615 var newVal = value.convertTo$3(this, $globals.world.nonNullBool, node);
14206 return new Value(newVal.get$type(), ('!' + newVal.get$code()), node.span , true); 14616 return new Value(newVal.get$type(), ('!' + newVal.get$code()), node.span , true);
14207 } 14617 }
14208 14618
14209 case 42/*TokenKind.ADD*/: 14619 case 42/*TokenKind.ADD*/:
14210 14620
14211 return value.convertTo$3(this, $globals.world.numType, node); 14621 return value.convertTo$3(this, $globals.world.numType, node);
14212 14622
(...skipping 19 matching lines...) Expand all
14232 } 14642 }
14233 MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) { 14643 MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) {
14234 var $this = this; // closure support 14644 var $this = this; // closure support
14235 var value = this.visitValue(node.body); 14645 var value = this.visitValue(node.body);
14236 if ($notnull_bool(value.get$type().get$isNum())) { 14646 if ($notnull_bool(value.get$type().get$isNum())) {
14237 return new Value(value.get$type(), ('' + value.get$code() + node.op), node.s pan, true); 14647 return new Value(value.get$type(), ('' + value.get$code() + node.op), node.s pan, true);
14238 } 14648 }
14239 var kind = (16/*TokenKind.INCR*/ == node.op.kind) ? 42/*TokenKind.ADD*/ : 43/* TokenKind.SUB*/; 14649 var kind = (16/*TokenKind.INCR*/ == node.op.kind) ? 42/*TokenKind.ADD*/ : 43/* TokenKind.SUB*/;
14240 var operand = new LiteralExpression(1, new TypeReference(node.span, $globals.w orld.numType), '1', node.span); 14650 var operand = new LiteralExpression(1, new TypeReference(node.span, $globals.w orld.numType), '1', node.span);
14241 var tmpleft = null, left = null; 14651 var tmpleft = null, left = null;
14242 var ret = this._visitAssign($assert_num(kind), node.body, (operand && operand. is$lang_Expression()), node, (function (l) { 14652 var ret = this._visitAssign($assert_num(kind), node.body, (operand == null ? n ull : operand.assert$lang_Expression()), node, (function (l) {
14243 if ($notnull_bool(isVoid)) { 14653 if ($notnull_bool(isVoid)) {
14244 return l; 14654 return l;
14245 } 14655 }
14246 else { 14656 else {
14247 left = l; 14657 left = l;
14248 tmpleft = $this.forceTemp((l && l.is$Value())); 14658 tmpleft = $this.forceTemp((l == null ? null : l.assert$Value()));
14249 return $this.assignTemp((tmpleft && tmpleft.is$Value()), (left && left.is$ Value())); 14659 return $this.assignTemp((tmpleft == null ? null : tmpleft.assert$Value()), (left == null ? null : left.assert$Value()));
14250 } 14660 }
14251 }) 14661 })
14252 ); 14662 );
14253 if ($notnull_bool($ne(tmpleft, null))) { 14663 if ($notnull_bool($ne(tmpleft, null))) {
14254 ret = new Value(ret.get$type(), ("(" + ret.get$code() + ", " + tmpleft.get$c ode() + ")"), node.span, true); 14664 ret = new Value(ret.get$type(), ("(" + ret.get$code() + ", " + tmpleft.get$c ode() + ")"), node.span, true);
14255 } 14665 }
14256 if ($notnull_bool($ne(tmpleft, left))) { 14666 if ($notnull_bool($ne(tmpleft, left))) {
14257 this.freeTemp((tmpleft && tmpleft.is$Value())); 14667 this.freeTemp((tmpleft == null ? null : tmpleft.assert$Value()));
14258 } 14668 }
14259 return ret; 14669 return ret;
14260 } 14670 }
14261 MethodGenerator.prototype.visitNewExpression = function(node) { 14671 MethodGenerator.prototype.visitNewExpression = function(node) {
14262 var $0; 14672 var $0;
14263 var typeRef = node.type; 14673 var typeRef = node.type;
14264 var constructorName = ''; 14674 var constructorName = '';
14265 if (node.name != null) { 14675 if (node.name != null) {
14266 constructorName = node.name.name; 14676 constructorName = node.name.name;
14267 } 14677 }
14268 if ($notnull_bool($eq(constructorName, '')) && !(typeRef instanceof GenericTyp eReference) && $notnull_bool($ne(typeRef.get$names(), null))) { 14678 if ($notnull_bool($eq(constructorName, '')) && !(typeRef instanceof GenericTyp eReference) && $notnull_bool($ne(typeRef.get$names(), null))) {
14269 var names = ListFactory.ListFactory$from$factory((($0 = typeRef.get$names()) && $0.is$Iterable())); 14679 var names = ListFactory.ListFactory$from$factory((($0 = typeRef.get$names()) == null ? null : $0.assert$Iterable()));
14270 constructorName = names.removeLast$0().get$name(); 14680 constructorName = names.removeLast$0().get$name();
14271 if ($notnull_bool($eq(names.length, 0))) names = null; 14681 if ($notnull_bool($eq(names.length, 0))) names = null;
14272 typeRef = new NameTypeReference(typeRef.get$isFinal(), typeRef.get$name(), n ames, (($0 = typeRef.get$span()) && $0.is$SourceSpan())); 14682 typeRef = new NameTypeReference(typeRef.get$isFinal(), typeRef.get$name(), n ames, (($0 = typeRef.get$span()) == null ? null : $0.assert$SourceSpan()));
14273 } 14683 }
14274 var type = this.method.resolveType((typeRef && typeRef.is$TypeReference()), tr ue); 14684 var type = this.method.resolveType((typeRef == null ? null : typeRef.assert$Ty peReference()), true);
14275 if ($notnull_bool(type.get$isTop())) { 14685 if ($notnull_bool(type.get$isTop())) {
14276 type = type.get$library().findTypeByName$1(constructorName); 14686 type = type.get$library().findTypeByName$1(constructorName);
14277 constructorName = ''; 14687 constructorName = '';
14278 } 14688 }
14279 var m = type.getConstructor$1(constructorName); 14689 var m = type.getConstructor$1(constructorName);
14280 if ($notnull_bool(m == null)) { 14690 if ($notnull_bool(m == null)) {
14281 var name = type.get$jsname(); 14691 var name = type.get$jsname();
14282 if ($notnull_bool(type.get$isVar())) { 14692 if ($notnull_bool(type.get$isVar())) {
14283 name = typeRef.get$name().get$name(); 14693 name = typeRef.get$name().get$name();
14284 } 14694 }
14285 $globals.world.error(('no matching constructor for ' + name), node.span); 14695 $globals.world.error(('no matching constructor for ' + name), node.span);
14286 return this._makeMissingValue($assert_String(name)); 14696 return this._makeMissingValue($assert_String(name));
14287 } 14697 }
14288 if ($notnull_bool(node.isConst)) { 14698 if ($notnull_bool(node.isConst)) {
14289 if (!$notnull_bool(m.get$isConst())) { 14699 if (!$notnull_bool(m.get$isConst())) {
14290 $globals.world.error('can\'t use const on a non-const constructor', node.s pan); 14700 $globals.world.error('can\'t use const on a non-const constructor', node.s pan);
14291 } 14701 }
14292 var $list = node.arguments; 14702 var $list = node.arguments;
14293 for (var $i = 0;$i < $list.length; $i++) { 14703 for (var $i = 0;$i < $list.length; $i++) {
14294 var arg = $list.$index($i); 14704 var arg = $list.$index($i);
14295 if (!$notnull_bool(this.visitValue((($0 = arg.get$value()) && $0.is$lang_E xpression())).get$isConst())) { 14705 if (!$notnull_bool(this.visitValue((($0 = arg.get$value()) == null ? null : $0.assert$lang_Expression())).get$isConst())) {
14296 $globals.world.error('const constructor expects const arguments', (($0 = arg.get$span()) && $0.is$SourceSpan())); 14706 $globals.world.error('const constructor expects const arguments', (($0 = arg.get$span()) == null ? null : $0.assert$SourceSpan()));
14297 } 14707 }
14298 } 14708 }
14299 } 14709 }
14300 var target = new Value.type$ctor(type, typeRef.get$span()); 14710 var target = new Value.type$ctor(type, typeRef.get$span());
14301 return m.invoke$4(this, node, target, this._makeArgs(node.arguments)); 14711 return m.invoke$4(this, node, target, this._makeArgs(node.arguments));
14302 } 14712 }
14303 MethodGenerator.prototype.visitListExpression = function(node) { 14713 MethodGenerator.prototype.visitListExpression = function(node) {
14304 var $0; 14714 var $0;
14305 var argsCode = []; 14715 var argsCode = [];
14306 var argValues = []; 14716 var argValues = [];
14307 var $list = node.values; 14717 var $list = node.values;
14308 for (var $i = 0;$i < $list.length; $i++) { 14718 for (var $i = 0;$i < $list.length; $i++) {
14309 var item = $list.$index($i); 14719 var item = $list.$index($i);
14310 var arg = this.visitValue((item && item.is$lang_Expression())); 14720 var arg = this.visitValue((item == null ? null : item.assert$lang_Expression ()));
14311 argValues.add$1(arg); 14721 argValues.add$1(arg);
14312 if ($notnull_bool(node.isConst)) { 14722 if ($notnull_bool(node.isConst)) {
14313 if (!$notnull_bool(arg.get$isConst())) { 14723 if (!$notnull_bool(arg.get$isConst())) {
14314 $globals.world.error('const list can only contain const values', (($0 = item.get$span()) && $0.is$SourceSpan())); 14724 $globals.world.error('const list can only contain const values', (($0 = item.get$span()) == null ? null : $0.assert$SourceSpan()));
14315 argsCode.add$1(arg.get$code()); 14725 argsCode.add$1(arg.get$code());
14316 } 14726 }
14317 else { 14727 else {
14318 argsCode.add$1(arg.get$canonicalCode()); 14728 argsCode.add$1(arg.get$canonicalCode());
14319 } 14729 }
14320 } 14730 }
14321 else { 14731 else {
14322 argsCode.add$1(arg.get$code()); 14732 argsCode.add$1(arg.get$code());
14323 } 14733 }
14324 } 14734 }
14325 $globals.world.get$coreimpl().types.$index('ListFactory').markUsed$0(); 14735 $globals.world.get$coreimpl().types.$index('ListFactory').markUsed$0();
14326 var code = ('[' + Strings.join((argsCode && argsCode.is$List_String()), ", ") + ']'); 14736 var code = ('[' + Strings.join((argsCode == null ? null : argsCode.assert$List _String()), ", ") + ']');
14327 var value = new Value($globals.world.listType, code, node.span, true); 14737 var value = new Value($globals.world.listType, code, node.span, true);
14328 if ($notnull_bool(node.isConst)) { 14738 if ($notnull_bool(node.isConst)) {
14329 var immutableList = $globals.world.get$coreimpl().types.$index('ImmutableLis t'); 14739 var immutableList = $globals.world.get$coreimpl().types.$index('ImmutableLis t');
14330 var immutableListCtor = immutableList.getConstructor$1('from'); 14740 var immutableListCtor = immutableList.getConstructor$1('from');
14331 var result = immutableListCtor.invoke$4(this, node, new Value.type$ctor(valu e.get$type(), node.span), new Arguments(null, [value])); 14741 var result = immutableListCtor.invoke$4(this, node, new Value.type$ctor(valu e.get$type(), node.span), new Arguments(null, [value]));
14332 value = $globals.world.gen.globalForConst(ConstListValue.ConstListValue$fact ory((immutableList && immutableList.is$lang_Type()), (argValues && argValues.is$ List_EvaluatedValue()), ('const ' + code), $assert_String(result.get$code()), no de.span), (argValues && argValues.is$List_Value())); 14742 value = $globals.world.gen.globalForConst(ConstListValue.ConstListValue$fact ory((immutableList == null ? null : immutableList.assert$lang_Type()), (argValue s == null ? null : argValues.assert$List_EvaluatedValue()), ('const ' + code), $ assert_String(result.get$code()), node.span), (argValues == null ? null : argVal ues.assert$List_Value()));
14333 } 14743 }
14334 return value; 14744 return value;
14335 } 14745 }
14336 MethodGenerator.prototype.visitMapExpression = function(node) { 14746 MethodGenerator.prototype.visitMapExpression = function(node) {
14337 var $0; 14747 var $0;
14338 var mapImplType = $globals.world.gen.useMapFactory(); 14748 var mapImplType = $globals.world.gen.useMapFactory();
14339 var argValues = []; 14749 var argValues = [];
14340 var argsCode = []; 14750 var argsCode = [];
14341 for (var i = 0; 14751 for (var i = 0;
14342 i < node.items.length; i += 2) { 14752 i < node.items.length; i += 2) {
14343 var key = this.visitTypedValue((($0 = node.items.$index(i)) && $0.is$lang_Ex pression()), $globals.world.stringType); 14753 var key = this.visitTypedValue((($0 = node.items.$index(i)) == null ? null : $0.assert$lang_Expression()), $globals.world.stringType);
14344 var valueItem = node.items.$index(i + 1); 14754 var valueItem = node.items.$index(i + 1);
14345 var value = this.visitValue((valueItem && valueItem.is$lang_Expression())); 14755 var value = this.visitValue((valueItem == null ? null : valueItem.assert$lan g_Expression()));
14346 argValues.add$1(key); 14756 argValues.add$1(key);
14347 argValues.add$1(value); 14757 argValues.add$1(value);
14348 if ($notnull_bool(node.isConst)) { 14758 if ($notnull_bool(node.isConst)) {
14349 if (!$notnull_bool(key.get$isConst()) || !$notnull_bool(value.get$isConst( ))) { 14759 if (!$notnull_bool(key.get$isConst()) || !$notnull_bool(value.get$isConst( ))) {
14350 $globals.world.error('const map can only contain const values', (($0 = v alueItem.get$span()) && $0.is$SourceSpan())); 14760 $globals.world.error('const map can only contain const values', (($0 = v alueItem.get$span()) == null ? null : $0.assert$SourceSpan()));
14351 argsCode.add$1(key.get$code()); 14761 argsCode.add$1(key.get$code());
14352 argsCode.add$1(value.get$code()); 14762 argsCode.add$1(value.get$code());
14353 } 14763 }
14354 else { 14764 else {
14355 argsCode.add$1(key.get$canonicalCode()); 14765 argsCode.add$1(key.get$canonicalCode());
14356 argsCode.add$1(value.get$canonicalCode()); 14766 argsCode.add$1(value.get$canonicalCode());
14357 } 14767 }
14358 } 14768 }
14359 else { 14769 else {
14360 argsCode.add$1(key.get$code()); 14770 argsCode.add$1(key.get$code());
14361 argsCode.add$1(value.get$code()); 14771 argsCode.add$1(value.get$code());
14362 } 14772 }
14363 } 14773 }
14364 var argList = ('[' + Strings.join((argsCode && argsCode.is$List_String()), ", ") + ']'); 14774 var argList = ('[' + Strings.join((argsCode == null ? null : argsCode.assert$L ist_String()), ", ") + ']');
14365 var code = ('\$map(' + argList + ')'); 14775 var code = ('\$map(' + argList + ')');
14366 if ($notnull_bool(node.isConst)) { 14776 if ($notnull_bool(node.isConst)) {
14367 var immutableMap = $globals.world.get$coreimpl().types.$index('ImmutableMap' ); 14777 var immutableMap = $globals.world.get$coreimpl().types.$index('ImmutableMap' );
14368 var immutableMapCtor = immutableMap.getConstructor$1(''); 14778 var immutableMapCtor = immutableMap.getConstructor$1('');
14369 var argsValue = new Value($globals.world.listType, argList, node.span, true) ; 14779 var argsValue = new Value($globals.world.listType, argList, node.span, true) ;
14370 var result = immutableMapCtor.invoke$4(this, node, new Value.type$ctor(immut ableMap, node.span), new Arguments(null, [argsValue])); 14780 var result = immutableMapCtor.invoke$4(this, node, new Value.type$ctor(immut ableMap, node.span), new Arguments(null, [argsValue]));
14371 var value = ConstMapValue.ConstMapValue$factory((immutableMap && immutableMa p.is$lang_Type()), (argValues && argValues.is$List_EvaluatedValue()), code, $ass ert_String(result.get$code()), node.span); 14781 var value = ConstMapValue.ConstMapValue$factory((immutableMap == null ? null : immutableMap.assert$lang_Type()), (argValues == null ? null : argValues.asser t$List_EvaluatedValue()), code, $assert_String(result.get$code()), node.span);
14372 return $globals.world.gen.globalForConst(value, (argValues && argValues.is$L ist_Value())); 14782 return $globals.world.gen.globalForConst(value, (argValues == null ? null : argValues.assert$List_Value()));
14373 } 14783 }
14374 return new Value(mapImplType, code, node.span, true); 14784 return new Value(mapImplType, code, node.span, true);
14375 } 14785 }
14376 MethodGenerator.prototype.visitConditionalExpression = function(node) { 14786 MethodGenerator.prototype.visitConditionalExpression = function(node) {
14377 var $0; 14787 var $0;
14378 var test = this.visitBool(node.test); 14788 var test = this.visitBool(node.test);
14379 var trueBranch = this.visitValue(node.trueBranch); 14789 var trueBranch = this.visitValue(node.trueBranch);
14380 var falseBranch = this.visitValue(node.falseBranch); 14790 var falseBranch = this.visitValue(node.falseBranch);
14381 var code = ('' + test.get$code() + ' ? ' + trueBranch.get$code() + ' : ' + fal seBranch.get$code()); 14791 var code = ('' + test.get$code() + ' ? ' + trueBranch.get$code() + ' : ' + fal seBranch.get$code());
14382 return new Value(lang_Type.union((($0 = trueBranch.get$type()) && $0.is$lang_T ype()), (($0 = falseBranch.get$type()) && $0.is$lang_Type())), code, node.span, true); 14792 return new Value(lang_Type.union((($0 = trueBranch.get$type()) == null ? null : $0.assert$lang_Type()), (($0 = falseBranch.get$type()) == null ? null : $0.ass ert$lang_Type())), code, node.span, true);
14383 } 14793 }
14384 MethodGenerator.prototype.visitIsExpression = function(node) { 14794 MethodGenerator.prototype.visitIsExpression = function(node) {
14385 var value = this.visitValue(node.x); 14795 var value = this.visitValue(node.x);
14386 var type = this.method.resolveType(node.type, false); 14796 var type = this.method.resolveType(node.type, false);
14387 return value.instanceOf$4(this, type, node.span, node.isTrue); 14797 return value.instanceOf$4(this, type, node.span, node.isTrue);
14388 } 14798 }
14389 MethodGenerator.prototype.visitParenExpression = function(node) { 14799 MethodGenerator.prototype.visitParenExpression = function(node) {
14390 var $0; 14800 var $0;
14391 var body = this.visitValue(node.body); 14801 var body = this.visitValue(node.body);
14392 if ($notnull_bool(body.get$isConst())) { 14802 if ($notnull_bool(body.get$isConst())) {
14393 return EvaluatedValue.EvaluatedValue$factory((($0 = body.get$type()) && $0.i s$lang_Type()), body.get$actualValue(), ('(' + body.get$canonicalCode() + ')'), node.span); 14803 return EvaluatedValue.EvaluatedValue$factory((($0 = body.get$type()) == null ? null : $0.assert$lang_Type()), body.get$actualValue(), ('(' + body.get$canoni calCode() + ')'), node.span);
14394 } 14804 }
14395 return new Value(body.get$type(), ('(' + body.get$code() + ')'), node.span, tr ue); 14805 return new Value(body.get$type(), ('(' + body.get$code() + ')'), node.span, tr ue);
14396 } 14806 }
14397 MethodGenerator.prototype.visitDotExpression = function(node) { 14807 MethodGenerator.prototype.visitDotExpression = function(node) {
14398 var target = node.self.visit(this); 14808 var target = node.self.visit(this);
14399 return target.get_$3(this, node.name.name, node.name); 14809 return target.get_$3(this, node.name.name, node.name);
14400 } 14810 }
14401 MethodGenerator.prototype.visitVarExpression = function(node) { 14811 MethodGenerator.prototype.visitVarExpression = function(node) {
14402 var name = node.name.name; 14812 var name = node.name.name;
14403 var ret = this._scope.lookup(name); 14813 var ret = this._scope.lookup(name);
14404 if ($notnull_bool($ne(ret, null))) return ret; 14814 if ($notnull_bool($ne(ret, null))) return ret;
14405 return this._makeThisOrType(node.span).get_$3(this, name, node); 14815 return this._makeThisOrType(node.span).get_$3(this, name, node);
14406 } 14816 }
14407 MethodGenerator.prototype._makeMissingValue = function(name) { 14817 MethodGenerator.prototype._makeMissingValue = function(name) {
14408 return new Value($globals.world.varType, ('' + name + '()/*NotFound*/'), null, true); 14818 return new Value($globals.world.varType, ('' + name + '()/*NotFound*/'), null, true);
14409 } 14819 }
14410 MethodGenerator.prototype._makeThisOrType = function(span) { 14820 MethodGenerator.prototype._makeThisOrType = function(span) {
14411 var $0; 14821 var $0;
14412 return new BareValue(this, (($0 = this._getOutermostMethod()) && $0.is$MethodG enerator()), span); 14822 return new BareValue(this, (($0 = this._getOutermostMethod()) == null ? null : $0.assert$MethodGenerator()), span);
14413 } 14823 }
14414 MethodGenerator.prototype.visitThisExpression = function(node) { 14824 MethodGenerator.prototype.visitThisExpression = function(node) {
14415 return this._makeThisValue(node); 14825 return this._makeThisValue(node);
14416 } 14826 }
14417 MethodGenerator.prototype.visitSuperExpression = function(node) { 14827 MethodGenerator.prototype.visitSuperExpression = function(node) {
14418 return this._makeSuperValue(node); 14828 return this._makeSuperValue(node);
14419 } 14829 }
14420 MethodGenerator.prototype.visitNullExpression = function(node) { 14830 MethodGenerator.prototype.visitNullExpression = function(node) {
14421 return EvaluatedValue.EvaluatedValue$factory($globals.world.varType, null, 'nu ll', null); 14831 return EvaluatedValue.EvaluatedValue$factory($globals.world.varType, null, 'nu ll', null);
14422 } 14832 }
14423 MethodGenerator.prototype._isUnaryIncrement = function(item) { 14833 MethodGenerator.prototype._isUnaryIncrement = function(item) {
14424 if ((item instanceof UnaryExpression)) { 14834 if ((item instanceof UnaryExpression)) {
14425 var u = (item && item.is$UnaryExpression()); 14835 var u = (item == null ? null : item.assert$UnaryExpression());
14426 return u.op.kind == 16/*TokenKind.INCR*/ || u.op.kind == 17/*TokenKind.DECR* /; 14836 return u.op.kind == 16/*TokenKind.INCR*/ || u.op.kind == 17/*TokenKind.DECR* /;
14427 } 14837 }
14428 else { 14838 else {
14429 return false; 14839 return false;
14430 } 14840 }
14431 } 14841 }
14432 MethodGenerator.prototype.visitLiteralExpression = function(node) { 14842 MethodGenerator.prototype.visitLiteralExpression = function(node) {
14433 var $0; 14843 var $0;
14434 var type = node.type.type; 14844 var type = node.type.type;
14435 $assert($ne(type, null), "type != null", "gen.dart", 2269, 12); 14845 $assert($ne(type, null), "type != null", "gen.dart", 2264, 12);
14436 if (!!(($0 = node.value) && $0.is$List)) { 14846 if (!!(($0 = node.value) && $0.is$List())) {
14437 var items = []; 14847 var items = [];
14438 var $list = node.value; 14848 var $list = node.value;
14439 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) { 14849 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) {
14440 var item = $i.next$0(); 14850 var item = $i.next$0();
14441 var val = this.visitValue((item && item.is$lang_Expression())); 14851 var val = this.visitValue((item == null ? null : item.assert$lang_Expressi on()));
14442 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY()); 14852 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY());
14443 var code = val.get$code(); 14853 var code = val.get$code();
14444 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr ession) || (item instanceof PostfixExpression) || $notnull_bool(this._isUnaryInc rement((item && item.is$lang_Expression())))) { 14854 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr ession) || (item instanceof PostfixExpression) || $notnull_bool(this._isUnaryInc rement((item == null ? null : item.assert$lang_Expression())))) {
14445 code = ('(' + code + ')'); 14855 code = ('(' + code + ')');
14446 } 14856 }
14447 if ($notnull_bool($eq(items.length, 0)) || ($notnull_bool($ne(code, "''")) && $notnull_bool($ne(code, '""')))) { 14857 if ($notnull_bool($eq(items.length, 0)) || ($notnull_bool($ne(code, "''")) && $notnull_bool($ne(code, '""')))) {
14448 items.add$1(code); 14858 items.add$1(code);
14449 } 14859 }
14450 } 14860 }
14451 return new Value(type, ('(' + Strings.join((items && items.is$List_String()) , " + ") + ')'), node.span, true); 14861 return new Value(type, ('(' + Strings.join((items == null ? null : items.ass ert$List_String()), " + ") + ')'), node.span, true);
14452 } 14862 }
14453 var text = node.text; 14863 var text = node.text;
14454 if ($notnull_bool(type.get$isString())) { 14864 if ($notnull_bool(type.get$isString())) {
14455 if ($notnull_bool(text.startsWith$1('@'))) { 14865 if ($notnull_bool(text.startsWith$1('@'))) {
14456 text = MethodGenerator._escapeString(parseStringLiteral($assert_String(tex t))); 14866 text = MethodGenerator._escapeString(parseStringLiteral($assert_String(tex t)));
14457 text = ('"' + text + '"'); 14867 text = ('"' + text + '"');
14458 } 14868 }
14459 else if ($notnull_bool(isMultilineString($assert_String(text)))) { 14869 else if ($notnull_bool(isMultilineString($assert_String(text)))) {
14460 text = parseStringLiteral($assert_String(text)); 14870 text = parseStringLiteral($assert_String(text));
14461 text = text.replaceAll$2('\n', '\\n'); 14871 text = text.replaceAll$2('\n', '\\n');
14462 text = toDoubleQuote($assert_String(text)); 14872 text = toDoubleQuote($assert_String(text));
14463 text = ('"' + text + '"'); 14873 text = ('"' + text + '"');
14464 } 14874 }
14465 if (text !== node.text) { 14875 if (text !== node.text) {
14466 node.value = text; 14876 node.value = text;
14467 node.text = $assert_String(text); 14877 node.text = $assert_String(text);
14468 } 14878 }
14469 } 14879 }
14470 return EvaluatedValue.EvaluatedValue$factory((type && type.is$lang_Type()), no de.value, node.text, null); 14880 return EvaluatedValue.EvaluatedValue$factory((type == null ? null : type.asser t$lang_Type()), node.value, node.text, null);
14471 } 14881 }
14472 MethodGenerator.prototype.visitPostfixExpression$1 = function($0) { 14882 MethodGenerator.prototype.visitPostfixExpression$1 = function($0) {
14473 return this.visitPostfixExpression(($0 && $0.is$PostfixExpression()), false); 14883 return this.visitPostfixExpression(($0 == null ? null : $0.assert$PostfixExpre ssion()), false);
14474 }; 14884 };
14475 MethodGenerator.prototype.writeDefinition$2 = function($0, $1) { 14885 MethodGenerator.prototype.writeDefinition$2 = function($0, $1) {
14476 return this.writeDefinition(($0 && $0.is$CodeWriter()), ($1 && $1.is$LambdaExp ression())); 14886 return this.writeDefinition(($0 == null ? null : $0.assert$CodeWriter()), ($1 == null ? null : $1.assert$LambdaExpression()));
14477 }; 14887 };
14478 // ********** Code for Arguments ************** 14888 // ********** Code for Arguments **************
14479 function Arguments(nodes, values) { 14889 function Arguments(nodes, values) {
14480 this.nodes = nodes; 14890 this.nodes = nodes;
14481 this.values = values; 14891 this.values = values;
14482 // Initializers done 14892 // Initializers done
14483 } 14893 }
14484 Arguments.prototype.is$Arguments = function(){return this;}; 14894 Arguments.prototype.assert$Arguments = function(){return this};
14485 Arguments.Arguments$bare$factory = function(arity) { 14895 Arguments.Arguments$bare$factory = function(arity) {
14486 var values = []; 14896 var values = [];
14487 for (var i = 0; 14897 for (var i = 0;
14488 i < arity; i++) { 14898 i < arity; i++) {
14489 values.add$1(new Value($globals.world.varType, ('\$' + i), null, false)); 14899 values.add$1(new Value($globals.world.varType, ('\$' + i), null, false));
14490 } 14900 }
14491 return new Arguments(null, values); 14901 return new Arguments(null, values);
14492 } 14902 }
14493 Arguments.get$EMPTY = function() { 14903 Arguments.get$EMPTY = function() {
14494 if ($globals.Arguments__empty == null) { 14904 if ($globals.Arguments__empty == null) {
(...skipping 25 matching lines...) Expand all
14520 i < this.get$length(); i++) { 14930 i < this.get$length(); i++) {
14521 if (this.getName(i) == name) { 14931 if (this.getName(i) == name) {
14522 return i; 14932 return i;
14523 } 14933 }
14524 } 14934 }
14525 return -1; 14935 return -1;
14526 } 14936 }
14527 Arguments.prototype.getValue = function(name) { 14937 Arguments.prototype.getValue = function(name) {
14528 var $0; 14938 var $0;
14529 var i = this.getIndexOfName(name); 14939 var i = this.getIndexOfName(name);
14530 return (($0 = i >= 0 ? this.values.$index(i) : null) && $0.is$Value()); 14940 return (($0 = i >= 0 ? this.values.$index(i) : null) == null ? null : $0.asser t$Value());
14531 } 14941 }
14532 Arguments.prototype.get$bareCount = function() { 14942 Arguments.prototype.get$bareCount = function() {
14533 if (this._bareCount == null) { 14943 if (this._bareCount == null) {
14534 this._bareCount = this.get$length(); 14944 this._bareCount = this.get$length();
14535 if (this.nodes != null) { 14945 if (this.nodes != null) {
14536 for (var i = 0; 14946 for (var i = 0;
14537 i < this.nodes.length; i++) { 14947 i < this.nodes.length; i++) {
14538 if ($notnull_bool($ne(this.nodes.$index(i).get$label(), null))) { 14948 if ($notnull_bool($ne(this.nodes.$index(i).get$label(), null))) {
14539 this._bareCount = i; 14949 this._bareCount = i;
14540 break; 14950 break;
14541 } 14951 }
14542 } 14952 }
14543 } 14953 }
14544 } 14954 }
14545 return this._bareCount; 14955 return this._bareCount;
14546 } 14956 }
14547 Arguments.prototype.getCode = function() { 14957 Arguments.prototype.getCode = function() {
14548 var argsCode = []; 14958 var argsCode = [];
14549 for (var i = 0; 14959 for (var i = 0;
14550 i < this.get$length(); i++) { 14960 i < this.get$length(); i++) {
14551 argsCode.add$1(this.values.$index(i).get$code()); 14961 argsCode.add$1(this.values.$index(i).get$code());
14552 } 14962 }
14553 Arguments.removeTrailingNulls((argsCode && argsCode.is$List_Value())); 14963 Arguments.removeTrailingNulls((argsCode == null ? null : argsCode.assert$List_ Value()));
14554 return Strings.join((argsCode && argsCode.is$List_String()), ", "); 14964 return Strings.join((argsCode == null ? null : argsCode.assert$List_String()), ", ");
14555 } 14965 }
14556 Arguments.removeTrailingNulls = function(argsCode) { 14966 Arguments.removeTrailingNulls = function(argsCode) {
14557 while (argsCode.length > 0 && $notnull_bool($eq(argsCode.last(), 'null'))) { 14967 while (argsCode.length > 0 && $notnull_bool($eq(argsCode.last(), 'null'))) {
14558 argsCode.removeLast(); 14968 argsCode.removeLast();
14559 } 14969 }
14560 } 14970 }
14561 Arguments.prototype.getNames = function() { 14971 Arguments.prototype.getNames = function() {
14562 var names = []; 14972 var names = [];
14563 for (var i = this.get$bareCount(); 14973 for (var i = this.get$bareCount();
14564 i < this.get$length(); i++) { 14974 i < this.get$length(); i++) {
14565 names.add$1(this.getName(i)); 14975 names.add$1(this.getName(i));
14566 } 14976 }
14567 return (names && names.is$List_String()); 14977 return (names == null ? null : names.assert$List_String());
14568 } 14978 }
14569 Arguments.prototype.toCallStubArgs = function() { 14979 Arguments.prototype.toCallStubArgs = function() {
14570 var result = []; 14980 var result = [];
14571 for (var i = 0; 14981 for (var i = 0;
14572 i < this.get$bareCount(); i++) { 14982 i < this.get$bareCount(); i++) {
14573 result.add$1(new Value($globals.world.varType, ('\$' + i), null, false)); 14983 result.add$1(new Value($globals.world.varType, ('\$' + i), null, false));
14574 } 14984 }
14575 for (var i = this.get$bareCount(); 14985 for (var i = this.get$bareCount();
14576 i < this.get$length(); i++) { 14986 i < this.get$length(); i++) {
14577 var name = this.getName(i); 14987 var name = this.getName(i);
(...skipping 21 matching lines...) Expand all
14599 lang_Element.call(this, null, null); 15009 lang_Element.call(this, null, null);
14600 this.sourceDir = dirname(this.baseSource.filename); 15010 this.sourceDir = dirname(this.baseSource.filename);
14601 this.topType = new DefinedType(null, this, null, true); 15011 this.topType = new DefinedType(null, this, null, true);
14602 this.types = $map(['', this.topType]); 15012 this.types = $map(['', this.topType]);
14603 this.imports = []; 15013 this.imports = [];
14604 this.natives = []; 15014 this.natives = [];
14605 this.sources = []; 15015 this.sources = [];
14606 this._privateMembers = $map([]); 15016 this._privateMembers = $map([]);
14607 } 15017 }
14608 $inherits(Library, lang_Element); 15018 $inherits(Library, lang_Element);
14609 Library.prototype.is$Library = function(){return this;}; 15019 Library.prototype.assert$Library = function(){return this};
14610 Library.prototype.get$baseSource = function() { return this.baseSource; }; 15020 Library.prototype.get$baseSource = function() { return this.baseSource; };
14611 Library.prototype.get$types = function() { return this.types; }; 15021 Library.prototype.get$types = function() { return this.types; };
14612 Library.prototype.set$types = function(value) { return this.types = value; }; 15022 Library.prototype.set$types = function(value) { return this.types = value; };
14613 Library.prototype.get$topType = function() { return this.topType; }; 15023 Library.prototype.get$topType = function() { return this.topType; };
14614 Library.prototype.set$topType = function(value) { return this.topType = value; } ; 15024 Library.prototype.set$topType = function(value) { return this.topType = value; } ;
14615 Library.prototype.get$enclosingElement = function() { 15025 Library.prototype.get$enclosingElement = function() {
14616 return null; 15026 return null;
14617 } 15027 }
14618 Library.prototype.get$library = function() { 15028 Library.prototype.get$library = function() {
14619 return this; 15029 return this;
(...skipping 21 matching lines...) Expand all
14641 var newLib = $globals.world.getOrAddLibrary(fullname); 15051 var newLib = $globals.world.getOrAddLibrary(fullname);
14642 this.imports.add(new LibraryImport(newLib, prefix)); 15052 this.imports.add(new LibraryImport(newLib, prefix));
14643 return newLib; 15053 return newLib;
14644 } 15054 }
14645 Library.prototype.addNative = function(fullname) { 15055 Library.prototype.addNative = function(fullname) {
14646 this.natives.add($globals.world.reader.readFile(fullname)); 15056 this.natives.add($globals.world.reader.readFile(fullname));
14647 } 15057 }
14648 Library.prototype._findMembers = function(name) { 15058 Library.prototype._findMembers = function(name) {
14649 var $0; 15059 var $0;
14650 if (name.startsWith('_')) { 15060 if (name.startsWith('_')) {
14651 return (($0 = this._privateMembers.$index(name)) && $0.is$MemberSet()); 15061 return (($0 = this._privateMembers.$index(name)) == null ? null : $0.assert$ MemberSet());
14652 } 15062 }
14653 else { 15063 else {
14654 return (($0 = $globals.world._members.$index(name)) && $0.is$MemberSet()); 15064 return (($0 = $globals.world._members.$index(name)) == null ? null : $0.asse rt$MemberSet());
14655 } 15065 }
14656 } 15066 }
14657 Library.prototype._addMember = function(member) { 15067 Library.prototype._addMember = function(member) {
14658 if ($notnull_bool(member.get$isPrivate())) { 15068 if ($notnull_bool(member.get$isPrivate())) {
14659 if ($notnull_bool(member.get$isStatic())) { 15069 if ($notnull_bool(member.get$isStatic())) {
14660 if ($notnull_bool(member.declaringType.get$isTop())) { 15070 if ($notnull_bool(member.declaringType.get$isTop())) {
14661 $globals.world._addTopName(member); 15071 $globals.world._addTopName(member);
14662 } 15072 }
14663 return; 15073 return;
14664 } 15074 }
(...skipping 29 matching lines...) Expand all
14694 return type; 15104 return type;
14695 } 15105 }
14696 Library.prototype.addType = function(name, definition, isClass) { 15106 Library.prototype.addType = function(name, definition, isClass) {
14697 var $0; 15107 var $0;
14698 if (this.types.containsKey(name)) { 15108 if (this.types.containsKey(name)) {
14699 var existingType = this.types.$index(name); 15109 var existingType = this.types.$index(name);
14700 if ($notnull_bool(this.get$isCore()) && $notnull_bool(existingType.get$defin ition() == null)) { 15110 if ($notnull_bool(this.get$isCore()) && $notnull_bool(existingType.get$defin ition() == null)) {
14701 existingType.setDefinition$1(definition); 15111 existingType.setDefinition$1(definition);
14702 } 15112 }
14703 else { 15113 else {
14704 $globals.world.warning(('duplicate definition of ' + name), definition.spa n, (($0 = existingType.get$span()) && $0.is$SourceSpan())); 15114 $globals.world.warning(('duplicate definition of ' + name), definition.spa n, (($0 = existingType.get$span()) == null ? null : $0.assert$SourceSpan()));
14705 } 15115 }
14706 } 15116 }
14707 else { 15117 else {
14708 this.types.$setindex(name, new DefinedType(name, this, (definition && defini tion.is$Definition()), isClass)); 15118 this.types.$setindex(name, new DefinedType(name, this, (definition == null ? null : definition.assert$Definition()), isClass));
14709 } 15119 }
14710 return (($0 = this.types.$index(name)) && $0.is$DefinedType()); 15120 return (($0 = this.types.$index(name)) == null ? null : $0.assert$DefinedType( ));
14711 } 15121 }
14712 Library.prototype.findType = function(type) { 15122 Library.prototype.findType = function(type) {
14713 var result = this.findTypeByName(type.name.name); 15123 var result = this.findTypeByName(type.name.name);
14714 if (result == null) return null; 15124 if (result == null) return null;
14715 if (type.names != null) { 15125 if (type.names != null) {
14716 if (type.names.length > 1) { 15126 if (type.names.length > 1) {
14717 return null; 15127 return null;
14718 } 15128 }
14719 if (!$notnull_bool(result.get$isTop())) { 15129 if (!$notnull_bool(result.get$isTop())) {
14720 return null; 15130 return null;
(...skipping 10 matching lines...) Expand all
14731 var imported = $list.$index($i); 15141 var imported = $list.$index($i);
14732 var newRet = null; 15142 var newRet = null;
14733 if ($notnull_bool(imported.get$prefix() == null)) { 15143 if ($notnull_bool(imported.get$prefix() == null)) {
14734 newRet = imported.get$library().get$types().$index(name); 15144 newRet = imported.get$library().get$types().$index(name);
14735 } 15145 }
14736 else if ($notnull_bool($eq(imported.get$prefix(), name))) { 15146 else if ($notnull_bool($eq(imported.get$prefix(), name))) {
14737 newRet = imported.get$library().get$topType(); 15147 newRet = imported.get$library().get$topType();
14738 } 15148 }
14739 if ($notnull_bool($ne(newRet, null))) { 15149 if ($notnull_bool($ne(newRet, null))) {
14740 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { 15150 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) {
14741 $globals.world.error(('conflicting types for "' + name + '"'), (($0 = re t.get$span()) && $0.is$SourceSpan()), (($0 = newRet.get$span()) && $0.is$SourceS pan())); 15151 $globals.world.error(('conflicting types for "' + name + '"'), (($0 = re t.get$span()) == null ? null : $0.assert$SourceSpan()), (($0 = newRet.get$span() ) == null ? null : $0.assert$SourceSpan()));
14742 } 15152 }
14743 else { 15153 else {
14744 ret = newRet; 15154 ret = newRet;
14745 } 15155 }
14746 } 15156 }
14747 } 15157 }
14748 return (ret && ret.is$lang_Type()); 15158 return (ret == null ? null : ret.assert$lang_Type());
14749 } 15159 }
14750 Library.prototype.resolveType = function(node, typeErrors) { 15160 Library.prototype.resolveType = function(node, typeErrors) {
14751 if (node == null) return $globals.world.varType; 15161 if (node == null) return $globals.world.varType;
14752 if (node.type != null) return node.type; 15162 if (node.type != null) return node.type;
14753 node.type = this.findType((node && node.is$NameTypeReference())); 15163 node.type = this.findType((node == null ? null : node.assert$NameTypeReference ()));
14754 if (node.type == null) { 15164 if (node.type == null) {
14755 var message = ('cannot find type ' + Library._getDottedName((node && node.is $NameTypeReference()))); 15165 var message = ('cannot find type ' + Library._getDottedName((node == null ? null : node.assert$NameTypeReference())));
14756 if ($notnull_bool(typeErrors)) { 15166 if ($notnull_bool(typeErrors)) {
14757 $globals.world.error($assert_String(message), node.span); 15167 $globals.world.error($assert_String(message), node.span);
14758 node.type = $globals.world.objectType; 15168 node.type = $globals.world.objectType;
14759 } 15169 }
14760 else { 15170 else {
14761 $globals.world.warning($assert_String(message), node.span); 15171 $globals.world.warning($assert_String(message), node.span);
14762 node.type = $globals.world.varType; 15172 node.type = $globals.world.varType;
14763 } 15173 }
14764 } 15174 }
14765 return node.type; 15175 return node.type;
14766 } 15176 }
14767 Library._getDottedName = function(type) { 15177 Library._getDottedName = function(type) {
14768 if (type.names != null) { 15178 if (type.names != null) {
14769 var names = map(type.names, (function (n) { 15179 var names = map(type.names, (function (n) {
14770 return n.get$name(); 15180 return n.get$name();
14771 }) 15181 })
14772 ); 15182 );
14773 return type.name.name + '.' + Strings.join((names && names.is$List_String()) , '.'); 15183 return type.name.name + '.' + Strings.join((names == null ? null : names.ass ert$List_String()), '.');
14774 } 15184 }
14775 else { 15185 else {
14776 return type.name.name; 15186 return type.name.name;
14777 } 15187 }
14778 } 15188 }
14779 Library.prototype.lookup = function(name, span) { 15189 Library.prototype.lookup = function(name, span) {
14780 var $0; 15190 var $0;
14781 var retType = this.findTypeByName(name); 15191 var retType = this.findTypeByName(name);
14782 var ret = null; 15192 var ret = null;
14783 if ($notnull_bool($ne(retType, null))) { 15193 if ($notnull_bool($ne(retType, null))) {
14784 ret = retType.get$typeMember(); 15194 ret = retType.get$typeMember();
14785 } 15195 }
14786 var newRet = this.topType.getMember(name); 15196 var newRet = this.topType.getMember(name);
14787 if ($notnull_bool($ne(newRet, null))) { 15197 if ($notnull_bool($ne(newRet, null))) {
14788 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { 15198 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) {
14789 $globals.world.error(('conflicting members for "' + name + '"'), span, (($ 0 = ret.get$span()) && $0.is$SourceSpan()), (($0 = newRet.get$span()) && $0.is$S ourceSpan())); 15199 $globals.world.error(('conflicting members for "' + name + '"'), span, (($ 0 = ret.get$span()) == null ? null : $0.assert$SourceSpan()), (($0 = newRet.get$ span()) == null ? null : $0.assert$SourceSpan()));
14790 } 15200 }
14791 else { 15201 else {
14792 ret = newRet; 15202 ret = newRet;
14793 } 15203 }
14794 } 15204 }
14795 var $list = this.imports; 15205 var $list = this.imports;
14796 for (var $i = 0;$i < $list.length; $i++) { 15206 for (var $i = 0;$i < $list.length; $i++) {
14797 var imported = $list.$index($i); 15207 var imported = $list.$index($i);
14798 if ($notnull_bool(imported.get$prefix() == null)) { 15208 if ($notnull_bool(imported.get$prefix() == null)) {
14799 newRet = imported.get$library().get$topType().getMember$1(name); 15209 newRet = imported.get$library().get$topType().getMember$1(name);
14800 if ($notnull_bool($ne(newRet, null))) { 15210 if ($notnull_bool($ne(newRet, null))) {
14801 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { 15211 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) {
14802 $globals.world.error(('conflicting members for "' + name + '"'), span, (($0 = ret.get$span()) && $0.is$SourceSpan()), (($0 = newRet.get$span()) && $0. is$SourceSpan())); 15212 $globals.world.error(('conflicting members for "' + name + '"'), span, (($0 = ret.get$span()) == null ? null : $0.assert$SourceSpan()), (($0 = newRet. get$span()) == null ? null : $0.assert$SourceSpan()));
14803 } 15213 }
14804 else { 15214 else {
14805 ret = newRet; 15215 ret = newRet;
14806 } 15216 }
14807 } 15217 }
14808 } 15218 }
14809 } 15219 }
14810 return (ret && ret.is$Member()); 15220 return (ret == null ? null : ret.assert$Member());
14811 } 15221 }
14812 Library.prototype.resolve = function() { 15222 Library.prototype.resolve = function() {
14813 if (this.name == null) { 15223 if (this.name == null) {
14814 this.name = this.baseSource.filename; 15224 this.name = this.baseSource.filename;
14815 var index = this.name.lastIndexOf('/', this.name.length); 15225 var index = this.name.lastIndexOf('/', this.name.length);
14816 if (index >= 0) { 15226 if (index >= 0) {
14817 this.name = this.name.substring($assert_num(index + 1)); 15227 this.name = this.name.substring($assert_num(index + 1));
14818 } 15228 }
14819 index = this.name.indexOf('.', 0); 15229 index = this.name.indexOf('.', 0);
14820 if (index > 0) { 15230 if (index > 0) {
(...skipping 24 matching lines...) Expand all
14845 function _LibraryVisitor(library) { 15255 function _LibraryVisitor(library) {
14846 this.seenImport = false 15256 this.seenImport = false
14847 this.seenSource = false 15257 this.seenSource = false
14848 this.seenResource = false 15258 this.seenResource = false
14849 this.isTop = true 15259 this.isTop = true
14850 this.library = library; 15260 this.library = library;
14851 // Initializers done 15261 // Initializers done
14852 this.currentType = this.library.topType; 15262 this.currentType = this.library.topType;
14853 this.sources = []; 15263 this.sources = [];
14854 } 15264 }
14855 _LibraryVisitor.prototype.is$TreeVisitor = function(){return this;}; 15265 _LibraryVisitor.prototype.assert$TreeVisitor = function(){return this};
14856 _LibraryVisitor.prototype.get$library = function() { return this.library; }; 15266 _LibraryVisitor.prototype.get$library = function() { return this.library; };
14857 _LibraryVisitor.prototype.get$isTop = function() { return this.isTop; }; 15267 _LibraryVisitor.prototype.get$isTop = function() { return this.isTop; };
14858 _LibraryVisitor.prototype.set$isTop = function(value) { return this.isTop = valu e; }; 15268 _LibraryVisitor.prototype.set$isTop = function(value) { return this.isTop = valu e; };
14859 _LibraryVisitor.prototype.addSourceFromName = function(name, span) { 15269 _LibraryVisitor.prototype.addSourceFromName = function(name, span) {
14860 var filename = this.library.makeFullPath(name); 15270 var filename = this.library.makeFullPath(name);
14861 if ($notnull_bool($eq(filename, this.library.baseSource.filename))) { 15271 if ($notnull_bool($eq(filename, this.library.baseSource.filename))) {
14862 $globals.world.error('library can not source itself', span); 15272 $globals.world.error('library can not source itself', span);
14863 return; 15273 return;
14864 } 15274 }
14865 else if (this.sources.some((function (s) { 15275 else if (this.sources.some((function (s) {
(...skipping 21 matching lines...) Expand all
14887 unit.forEach((function (def) { 15297 unit.forEach((function (def) {
14888 return def.visit$1($this); 15298 return def.visit$1($this);
14889 }) 15299 })
14890 ); 15300 );
14891 $assert(this.sources.length == 0 || $notnull_bool(this.isTop), "sources.length == 0 || isTop", "library.dart", 330, 12); 15301 $assert(this.sources.length == 0 || $notnull_bool(this.isTop), "sources.length == 0 || isTop", "library.dart", 330, 12);
14892 this.isTop = false; 15302 this.isTop = false;
14893 var newSources = this.sources; 15303 var newSources = this.sources;
14894 this.sources = []; 15304 this.sources = [];
14895 for (var $i = newSources.iterator$0(); $i.hasNext$0(); ) { 15305 for (var $i = newSources.iterator$0(); $i.hasNext$0(); ) {
14896 var source0 = $i.next$0(); 15306 var source0 = $i.next$0();
14897 this.addSource((source0 && source0.is$SourceFile())); 15307 this.addSource((source0 == null ? null : source0.assert$SourceFile()));
14898 } 15308 }
14899 } 15309 }
14900 _LibraryVisitor.prototype.visitDirectiveDefinition = function(node) { 15310 _LibraryVisitor.prototype.visitDirectiveDefinition = function(node) {
14901 if (!$notnull_bool(this.isTop)) { 15311 if (!$notnull_bool(this.isTop)) {
14902 $globals.world.error('directives not allowed in sourced file', node.span); 15312 $globals.world.error('directives not allowed in sourced file', node.span);
14903 return; 15313 return;
14904 } 15314 }
14905 var name; 15315 var name;
14906 switch (node.name.name) { 15316 switch (node.name.name) {
14907 case "library": 15317 case "library":
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
14982 return this.getFirstStringArg(node); 15392 return this.getFirstStringArg(node);
14983 } 15393 }
14984 _LibraryVisitor.prototype.getFirstStringArg = function(node) { 15394 _LibraryVisitor.prototype.getFirstStringArg = function(node) {
14985 if (node.arguments.length < 1) { 15395 if (node.arguments.length < 1) {
14986 $globals.world.error(('expected at least one argument but found ' + node.arg uments.length), node.span); 15396 $globals.world.error(('expected at least one argument but found ' + node.arg uments.length), node.span);
14987 } 15397 }
14988 var arg = node.arguments.$index(0); 15398 var arg = node.arguments.$index(0);
14989 if ($notnull_bool($ne(arg.get$label(), null))) { 15399 if ($notnull_bool($ne(arg.get$label(), null))) {
14990 $globals.world.error('label not allowed for directive', node.span); 15400 $globals.world.error('label not allowed for directive', node.span);
14991 } 15401 }
14992 return this._parseStringArgument((arg && arg.is$ArgumentNode())); 15402 return this._parseStringArgument((arg == null ? null : arg.assert$ArgumentNode ()));
14993 } 15403 }
14994 _LibraryVisitor.prototype.tryGetNamedStringArg = function(node, argName) { 15404 _LibraryVisitor.prototype.tryGetNamedStringArg = function(node, argName) {
14995 var args = node.arguments.filter((function (a) { 15405 var args = node.arguments.filter((function (a) {
14996 return $notnull_bool($ne(a.get$label(), null)) && $notnull_bool($eq(a.get$la bel().get$name(), argName)); 15406 return $notnull_bool($ne(a.get$label(), null)) && $notnull_bool($eq(a.get$la bel().get$name(), argName));
14997 }) 15407 })
14998 ); 15408 );
14999 if ($notnull_bool($eq(args.length, 0))) { 15409 if ($notnull_bool($eq(args.length, 0))) {
15000 return null; 15410 return null;
15001 } 15411 }
15002 if (args.length > 1) { 15412 if (args.length > 1) {
15003 $globals.world.error(('expected at most one "' + argName + '" argument but f ound ') + node.arguments.length, node.span); 15413 $globals.world.error(('expected at most one "' + argName + '" argument but f ound ') + node.arguments.length, node.span);
15004 } 15414 }
15005 for (var $i = args.iterator$0(); $i.hasNext$0(); ) { 15415 for (var $i = args.iterator$0(); $i.hasNext$0(); ) {
15006 var arg = $i.next$0(); 15416 var arg = $i.next$0();
15007 return this._parseStringArgument((arg && arg.is$ArgumentNode())); 15417 return this._parseStringArgument((arg == null ? null : arg.assert$ArgumentNo de()));
15008 } 15418 }
15009 } 15419 }
15010 _LibraryVisitor.prototype._parseStringArgument = function(arg) { 15420 _LibraryVisitor.prototype._parseStringArgument = function(arg) {
15011 var $0; 15421 var $0;
15012 var expr = arg.value; 15422 var expr = arg.value;
15013 if (!(expr instanceof LiteralExpression) || !$notnull_bool(expr.get$type().get $type().get$isString())) { 15423 if (!(expr instanceof LiteralExpression) || !$notnull_bool(expr.get$type().get $type().get$isString())) {
15014 $globals.world.error('expected string', (($0 = expr.get$span()) && $0.is$Sou rceSpan())); 15424 $globals.world.error('expected string', (($0 = expr.get$span()) == null ? nu ll : $0.assert$SourceSpan()));
15015 } 15425 }
15016 return parseStringLiteral($assert_String(expr.get$value())); 15426 return parseStringLiteral($assert_String(expr.get$value()));
15017 } 15427 }
15018 _LibraryVisitor.prototype.visitTypeDefinition = function(node) { 15428 _LibraryVisitor.prototype.visitTypeDefinition = function(node) {
15019 var oldType = this.currentType; 15429 var oldType = this.currentType;
15020 this.currentType = this.library.addType(node.name.name, node, node.isClass); 15430 this.currentType = this.library.addType(node.name.name, node, node.isClass);
15021 var $list = node.body; 15431 var $list = node.body;
15022 for (var $i = 0;$i < $list.length; $i++) { 15432 for (var $i = 0;$i < $list.length; $i++) {
15023 var member = $list.$index($i); 15433 var member = $list.$index($i);
15024 member.visit$1(this); 15434 member.visit$1(this);
15025 } 15435 }
15026 this.currentType = (oldType && oldType.is$DefinedType()); 15436 this.currentType = (oldType == null ? null : oldType.assert$DefinedType());
15027 } 15437 }
15028 _LibraryVisitor.prototype.visitVariableDefinition = function(node) { 15438 _LibraryVisitor.prototype.visitVariableDefinition = function(node) {
15029 this.currentType.addField(node); 15439 this.currentType.addField(node);
15030 } 15440 }
15031 _LibraryVisitor.prototype.visitFunctionDefinition = function(node) { 15441 _LibraryVisitor.prototype.visitFunctionDefinition = function(node) {
15032 this.currentType.addMethod(node.name.name, node); 15442 this.currentType.addMethod(node.name.name, node);
15033 } 15443 }
15034 _LibraryVisitor.prototype.visitFunctionTypeDefinition = function(node) { 15444 _LibraryVisitor.prototype.visitFunctionTypeDefinition = function(node) {
15035 var type = this.library.addType(node.func.name.name, node, false); 15445 var type = this.library.addType(node.func.name.name, node, false);
15036 type.addMethod$2('\$call', node.func); 15446 type.addMethod$2('\$call', node.func);
15037 } 15447 }
15038 _LibraryVisitor.prototype.addSource$1 = function($0) { 15448 _LibraryVisitor.prototype.addSource$1 = function($0) {
15039 return this.addSource(($0 && $0.is$SourceFile())); 15449 return this.addSource(($0 == null ? null : $0.assert$SourceFile()));
15040 }; 15450 };
15041 // ********** Code for Parameter ************** 15451 // ********** Code for Parameter **************
15042 function Parameter(definition, method) { 15452 function Parameter(definition, method) {
15043 this.isInitializer = false 15453 this.isInitializer = false
15044 this.definition = definition; 15454 this.definition = definition;
15045 this.method = method; 15455 this.method = method;
15046 // Initializers done 15456 // Initializers done
15047 } 15457 }
15048 Parameter.prototype.is$Parameter = function(){return this;}; 15458 Parameter.prototype.assert$Parameter = function(){return this};
15049 Parameter.prototype.get$definition = function() { return this.definition; }; 15459 Parameter.prototype.get$definition = function() { return this.definition; };
15050 Parameter.prototype.set$definition = function(value) { return this.definition = value; }; 15460 Parameter.prototype.set$definition = function(value) { return this.definition = value; };
15051 Parameter.prototype.get$name = function() { return this.name; }; 15461 Parameter.prototype.get$name = function() { return this.name; };
15052 Parameter.prototype.set$name = function(value) { return this.name = value; }; 15462 Parameter.prototype.set$name = function(value) { return this.name = value; };
15053 Parameter.prototype.get$type = function() { return this.type; }; 15463 Parameter.prototype.get$type = function() { return this.type; };
15054 Parameter.prototype.set$type = function(value) { return this.type = value; }; 15464 Parameter.prototype.set$type = function(value) { return this.type = value; };
15055 Parameter.prototype.get$isInitializer = function() { return this.isInitializer; }; 15465 Parameter.prototype.get$isInitializer = function() { return this.isInitializer; };
15056 Parameter.prototype.set$isInitializer = function(value) { return this.isInitiali zer = value; }; 15466 Parameter.prototype.set$isInitializer = function(value) { return this.isInitiali zer = value; };
15057 Parameter.prototype.get$value = function() { return this.value; }; 15467 Parameter.prototype.get$value = function() { return this.value; };
15058 Parameter.prototype.set$value = function(value) { return this.value = value; }; 15468 Parameter.prototype.set$value = function(value) { return this.value = value; };
(...skipping 23 matching lines...) Expand all
15082 else if ($notnull_bool(this.isInitializer) && !$notnull_bool(this.method.get$i sConstructor())) { 15492 else if ($notnull_bool(this.isInitializer) && !$notnull_bool(this.method.get$i sConstructor())) {
15083 $globals.world.error('initializer parameters only allowed on constructors', this.definition.span); 15493 $globals.world.error('initializer parameters only allowed on constructors', this.definition.span);
15084 } 15494 }
15085 } 15495 }
15086 Parameter.prototype.genValue = function(method, context) { 15496 Parameter.prototype.genValue = function(method, context) {
15087 var $0; 15497 var $0;
15088 if (this.definition.value == null || this.value != null) return; 15498 if (this.definition.value == null || this.value != null) return;
15089 if (context == null) { 15499 if (context == null) {
15090 context = new MethodGenerator(method, null); 15500 context = new MethodGenerator(method, null);
15091 } 15501 }
15092 this.value = (($0 = this.definition.value.visit(context)) && $0.is$Value()); 15502 this.value = (($0 = this.definition.value.visit(context)) == null ? null : $0. assert$Value());
15093 this.value = this.value.convertTo(context, this.type, this.definition.value, f alse); 15503 this.value = this.value.convertTo(context, this.type, this.definition.value, f alse);
15094 } 15504 }
15095 Parameter.prototype.copyWithNewType = function(newMethod, newType) { 15505 Parameter.prototype.copyWithNewType = function(newMethod, newType) {
15096 var $0; 15506 var $0;
15097 var ret = new Parameter(this.definition, newMethod); 15507 var ret = new Parameter(this.definition, newMethod);
15098 ret.set$type(newType); 15508 ret.set$type(newType);
15099 ret.set$name(this.name); 15509 ret.set$name(this.name);
15100 ret.set$isInitializer(this.isInitializer); 15510 ret.set$isInitializer(this.isInitializer);
15101 return (ret && ret.is$Parameter()); 15511 return (ret == null ? null : ret.assert$Parameter());
15102 } 15512 }
15103 Parameter.prototype.get$isOptional = function() { 15513 Parameter.prototype.get$isOptional = function() {
15104 return this.definition != null && this.definition.value != null; 15514 return this.definition != null && this.definition.value != null;
15105 } 15515 }
15106 Parameter.prototype.copyWithNewType$2 = function($0, $1) { 15516 Parameter.prototype.copyWithNewType$2 = function($0, $1) {
15107 return this.copyWithNewType(($0 && $0.is$Member()), ($1 && $1.is$lang_Type())) ; 15517 return this.copyWithNewType(($0 == null ? null : $0.assert$Member()), ($1 == n ull ? null : $1.assert$lang_Type()));
15108 }; 15518 };
15109 Parameter.prototype.genValue$2 = function($0, $1) { 15519 Parameter.prototype.genValue$2 = function($0, $1) {
15110 return this.genValue(($0 && $0.is$MethodMember()), ($1 && $1.is$MethodGenerato r())); 15520 return this.genValue(($0 == null ? null : $0.assert$MethodMember()), ($1 == nu ll ? null : $1.assert$MethodGenerator()));
15111 }; 15521 };
15112 Parameter.prototype.resolve$0 = Parameter.prototype.resolve; 15522 Parameter.prototype.resolve$0 = Parameter.prototype.resolve;
15113 // ********** Code for Member ************** 15523 // ********** Code for Member **************
15114 function Member(name, declaringType) { 15524 function Member(name, declaringType) {
15115 this.isGenerated = false; 15525 this.isGenerated = false;
15116 this.declaringType = declaringType; 15526 this.declaringType = declaringType;
15117 // Initializers done 15527 // Initializers done
15118 lang_Element.call(this, name, declaringType); 15528 lang_Element.call(this, name, declaringType);
15119 } 15529 }
15120 $inherits(Member, lang_Element); 15530 $inherits(Member, lang_Element);
15121 Member.prototype.is$Member = function(){return this;}; 15531 Member.prototype.assert$Member = function(){return this};
15122 Member.prototype.get$declaringType = function() { return this.declaringType; }; 15532 Member.prototype.get$declaringType = function() { return this.declaringType; };
15123 Member.prototype.get$generator = function() { return this.generator; }; 15533 Member.prototype.get$generator = function() { return this.generator; };
15124 Member.prototype.set$generator = function(value) { return this.generator = value ; }; 15534 Member.prototype.set$generator = function(value) { return this.generator = value ; };
15125 Member.prototype.get$library = function() { 15535 Member.prototype.get$library = function() {
15126 return this.declaringType.get$library(); 15536 return this.declaringType.get$library();
15127 } 15537 }
15128 Member.prototype.get$isPrivate = function() { 15538 Member.prototype.get$isPrivate = function() {
15129 return this.name.startsWith('_'); 15539 return this.name.startsWith('_');
15130 } 15540 }
15131 Member.prototype.get$isConstructor = function() { 15541 Member.prototype.get$isConstructor = function() {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
15183 $globals.world.internalError('cannot have initializers', this.get$span()); 15593 $globals.world.internalError('cannot have initializers', this.get$span());
15184 } 15594 }
15185 Member.prototype.computeValue = function() { 15595 Member.prototype.computeValue = function() {
15186 $globals.world.internalError('cannot have value', this.get$span()); 15596 $globals.world.internalError('cannot have value', this.get$span());
15187 } 15597 }
15188 Member.prototype.get$inferredResult = function() { 15598 Member.prototype.get$inferredResult = function() {
15189 var t = this.get$returnType(); 15599 var t = this.get$returnType();
15190 if ($notnull_bool(t.get$isBool()) && ($notnull_bool(this.get$library().get$isC ore()) || $notnull_bool(this.get$library().get$isCoreImpl()))) { 15600 if ($notnull_bool(t.get$isBool()) && ($notnull_bool(this.get$library().get$isC ore()) || $notnull_bool(this.get$library().get$isCoreImpl()))) {
15191 return $globals.world.nonNullBool; 15601 return $globals.world.nonNullBool;
15192 } 15602 }
15193 return (t && t.is$lang_Type()); 15603 return (t == null ? null : t.assert$lang_Type());
15194 } 15604 }
15195 Member.prototype.get$definition = function() { 15605 Member.prototype.get$definition = function() {
15196 return null; 15606 return null;
15197 } 15607 }
15198 Member.prototype.get$parameters = function() { 15608 Member.prototype.get$parameters = function() {
15199 return []; 15609 return [];
15200 } 15610 }
15201 Member.prototype.canInvoke = function(context, args) { 15611 Member.prototype.canInvoke = function(context, args) {
15202 return $notnull_bool(this.get$canGet()) && $notnull_bool(new Value(this.get$re turnType(), null, null, true).canInvoke(context, '\$call', args)); 15612 return $notnull_bool(this.get$canGet()) && $notnull_bool(new Value(this.get$re turnType(), null, null, true).canInvoke(context, '\$call', args));
15203 } 15613 }
15204 Member.prototype.invoke = function(context, node, target, args, isDynamic) { 15614 Member.prototype.invoke = function(context, node, target, args, isDynamic) {
15205 var $0; 15615 var $0;
15206 var newTarget = this._get(context, node, target, isDynamic); 15616 var newTarget = this._get(context, node, target, isDynamic);
15207 return (($0 = newTarget.invoke$5(context, '\$call', node, args, isDynamic)) && $0.is$Value()); 15617 return (($0 = newTarget.invoke$5(context, '\$call', node, args, isDynamic)) == null ? null : $0.assert$Value());
15208 } 15618 }
15209 Member.prototype.override = function(other) { 15619 Member.prototype.override = function(other) {
15210 if ($notnull_bool(this.get$isStatic())) { 15620 if ($notnull_bool(this.get$isStatic())) {
15211 $globals.world.error('static members can not hide parent members', this.get$ span(), other.get$span()); 15621 $globals.world.error('static members can not hide parent members', this.get$ span(), other.get$span());
15212 return false; 15622 return false;
15213 } 15623 }
15214 else if ($notnull_bool(other.get$isStatic())) { 15624 else if ($notnull_bool(other.get$isStatic())) {
15215 $globals.world.error('can not override static member', this.get$span(), othe r.get$span()); 15625 $globals.world.error('can not override static member', this.get$span(), othe r.get$span());
15216 return false; 15626 return false;
15217 } 15627 }
15218 return true; 15628 return true;
15219 } 15629 }
15220 Member.prototype.get$generatedFactoryName = function() { 15630 Member.prototype.get$generatedFactoryName = function() {
15221 $assert(this.get$isFactory(), "this.isFactory", "member.dart", 187, 12); 15631 $assert(this.get$isFactory(), "this.isFactory", "member.dart", 187, 12);
15222 var prefix = ('' + this.declaringType.get$jsname() + '.' + this.get$constructo rName() + '\$'); 15632 var prefix = ('' + this.declaringType.get$jsname() + '.' + this.get$constructo rName() + '\$');
15223 if (this.name == '') { 15633 if (this.name == '') {
15224 return ('' + prefix + 'factory'); 15634 return ('' + prefix + 'factory');
15225 } 15635 }
15226 else { 15636 else {
15227 return ('' + prefix + this.name + '\$factory'); 15637 return ('' + prefix + this.name + '\$factory');
15228 } 15638 }
15229 } 15639 }
15230 Member.prototype.hashCode = function() { 15640 Member.prototype.hashCode = function() {
15231 return (this.declaringType.hashCode() << 4) ^ this.name.hashCode(); 15641 return (this.declaringType.hashCode() << 4) ^ this.name.hashCode();
15232 } 15642 }
15233 Member.prototype._get$3 = function($0, $1, $2) { 15643 Member.prototype._get$3 = function($0, $1, $2) {
15234 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value())); 15644 return this._get(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == nul l ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()));
15235 }; 15645 };
15236 Member.prototype._set$4 = function($0, $1, $2, $3) { 15646 Member.prototype._set$4 = function($0, $1, $2, $3) {
15237 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value())); 15647 return this._set(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == nul l ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($3 == null ? null : $3.assert$Value()));
15238 }; 15648 };
15239 Member.prototype.canInvoke$2 = function($0, $1) { 15649 Member.prototype.canInvoke$2 = function($0, $1) {
15240 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 15650 return this.canInvoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 = = null ? null : $1.assert$Arguments()));
15241 }; 15651 };
15242 Member.prototype.computeValue$0 = Member.prototype.computeValue; 15652 Member.prototype.computeValue$0 = Member.prototype.computeValue;
15243 Member.prototype.hashCode$0 = Member.prototype.hashCode; 15653 Member.prototype.hashCode$0 = Member.prototype.hashCode;
15244 Member.prototype.invoke$4 = function($0, $1, $2, $3) { 15654 Member.prototype.invoke$4 = function($0, $1, $2, $3) {
15245 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); 15655 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), false);
15246 }; 15656 };
15247 Member.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 15657 Member.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) {
15248 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); 15658 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), $assert_bool(isDynamic));
15249 }; 15659 };
15250 Member.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 15660 Member.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
15251 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); 15661 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), $assert_bool($4));
15252 }; 15662 };
15253 Member.prototype.provideFieldSyntax$0 = Member.prototype.provideFieldSyntax; 15663 Member.prototype.provideFieldSyntax$0 = Member.prototype.provideFieldSyntax;
15254 Member.prototype.providePropertySyntax$0 = Member.prototype.providePropertySynta x; 15664 Member.prototype.providePropertySyntax$0 = Member.prototype.providePropertySynta x;
15255 // ********** Code for TypeMember ************** 15665 // ********** Code for TypeMember **************
15256 function TypeMember(type) { 15666 function TypeMember(type) {
15257 this.type = type; 15667 this.type = type;
15258 // Initializers done 15668 // Initializers done
15259 Member.call(this, type.name, type.library.topType); 15669 Member.call(this, type.name, type.library.topType);
15260 } 15670 }
15261 $inherits(TypeMember, Member); 15671 $inherits(TypeMember, Member);
15262 TypeMember.prototype.is$TypeMember = function(){return this;}; 15672 TypeMember.prototype.assert$TypeMember = function(){return this};
15263 TypeMember.prototype.get$type = function() { return this.type; }; 15673 TypeMember.prototype.get$type = function() { return this.type; };
15264 TypeMember.prototype.get$span = function() { 15674 TypeMember.prototype.get$span = function() {
15265 return this.type.definition.span; 15675 return this.type.definition.span;
15266 } 15676 }
15267 TypeMember.prototype.get$isStatic = function() { 15677 TypeMember.prototype.get$isStatic = function() {
15268 return true; 15678 return true;
15269 } 15679 }
15270 TypeMember.prototype.get$returnType = function() { 15680 TypeMember.prototype.get$returnType = function() {
15271 return $globals.world.varType; 15681 return $globals.world.varType;
15272 } 15682 }
15273 TypeMember.prototype.canInvoke = function(context, args) { 15683 TypeMember.prototype.canInvoke = function(context, args) {
15274 return false; 15684 return false;
15275 } 15685 }
15276 TypeMember.prototype.get$canGet = function() { 15686 TypeMember.prototype.get$canGet = function() {
15277 return true; 15687 return true;
15278 } 15688 }
15279 TypeMember.prototype.get$canSet = function() { 15689 TypeMember.prototype.get$canSet = function() {
15280 return false; 15690 return false;
15281 } 15691 }
15282 TypeMember.prototype._get = function(context, node, target, isDynamic) { 15692 TypeMember.prototype._get = function(context, node, target, isDynamic) {
15283 return new Value.type$ctor(this.type, node.span); 15693 return new Value.type$ctor(this.type, node.span);
15284 } 15694 }
15285 TypeMember.prototype._set = function(context, node, target, value, isDynamic) { 15695 TypeMember.prototype._set = function(context, node, target, value, isDynamic) {
15286 $globals.world.error('cannot set type', node.span); 15696 $globals.world.error('cannot set type', node.span);
15287 } 15697 }
15288 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) { 15698 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) {
15289 $globals.world.error('cannot invoke type', node.span); 15699 $globals.world.error('cannot invoke type', node.span);
15290 } 15700 }
15291 TypeMember.prototype._get$3 = function($0, $1, $2) { 15701 TypeMember.prototype._get$3 = function($0, $1, $2) {
15292 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false); 15702 return this._get(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == nul l ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), fals e);
15293 }; 15703 };
15294 TypeMember.prototype._set$4 = function($0, $1, $2, $3) { 15704 TypeMember.prototype._set$4 = function($0, $1, $2, $3) {
15295 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false); 15705 return this._set(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == nul l ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($3 == null ? null : $3.assert$Value()), false);
15296 }; 15706 };
15297 TypeMember.prototype.canInvoke$2 = function($0, $1) { 15707 TypeMember.prototype.canInvoke$2 = function($0, $1) {
15298 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 15708 return this.canInvoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 = = null ? null : $1.assert$Arguments()));
15299 }; 15709 };
15300 TypeMember.prototype.invoke$4 = function($0, $1, $2, $3) { 15710 TypeMember.prototype.invoke$4 = function($0, $1, $2, $3) {
15301 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); 15711 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), false);
15302 }; 15712 };
15303 TypeMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 15713 TypeMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) {
15304 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); 15714 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), $assert_bool(isDynamic));
15305 }; 15715 };
15306 TypeMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 15716 TypeMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
15307 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); 15717 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), $assert_bool($4));
15308 }; 15718 };
15309 // ********** Code for FieldMember ************** 15719 // ********** Code for FieldMember **************
15310 function FieldMember(name, declaringType, definition, value) { 15720 function FieldMember(name, declaringType, definition, value) {
15311 this._providePropertySyntax = false 15721 this._providePropertySyntax = false
15312 this._computing = false 15722 this._computing = false
15313 this.definition = definition; 15723 this.definition = definition;
15314 this.value = value; 15724 this.value = value;
15315 this.isNative = false; 15725 this.isNative = false;
15316 // Initializers done 15726 // Initializers done
15317 Member.call(this, name, declaringType); 15727 Member.call(this, name, declaringType);
15318 } 15728 }
15319 $inherits(FieldMember, Member); 15729 $inherits(FieldMember, Member);
15320 FieldMember.prototype.is$FieldMember = function(){return this;}; 15730 FieldMember.prototype.assert$FieldMember = function(){return this};
15321 FieldMember.prototype.get$definition = function() { return this.definition; }; 15731 FieldMember.prototype.get$definition = function() { return this.definition; };
15322 FieldMember.prototype.get$value = function() { return this.value; }; 15732 FieldMember.prototype.get$value = function() { return this.value; };
15323 FieldMember.prototype.get$type = function() { return this.type; }; 15733 FieldMember.prototype.get$type = function() { return this.type; };
15324 FieldMember.prototype.set$type = function(value) { return this.type = value; }; 15734 FieldMember.prototype.set$type = function(value) { return this.type = value; };
15325 FieldMember.prototype.get$isStatic = function() { return this.isStatic; }; 15735 FieldMember.prototype.get$isStatic = function() { return this.isStatic; };
15326 FieldMember.prototype.set$isStatic = function(value) { return this.isStatic = va lue; }; 15736 FieldMember.prototype.set$isStatic = function(value) { return this.isStatic = va lue; };
15327 FieldMember.prototype.get$isFinal = function() { return this.isFinal; }; 15737 FieldMember.prototype.get$isFinal = function() { return this.isFinal; };
15328 FieldMember.prototype.set$isFinal = function(value) { return this.isFinal = valu e; }; 15738 FieldMember.prototype.set$isFinal = function(value) { return this.isFinal = valu e; };
15329 FieldMember.prototype.get$isNative = function() { return this.isNative; }; 15739 FieldMember.prototype.get$isNative = function() { return this.isNative; };
15330 FieldMember.prototype.set$isNative = function(value) { return this.isNative = va lue; }; 15740 FieldMember.prototype.set$isNative = function(value) { return this.isNative = va lue; };
(...skipping 14 matching lines...) Expand all
15345 return this.isNative; 15755 return this.isNative;
15346 } 15756 }
15347 FieldMember.prototype.provideFieldSyntax = function() { 15757 FieldMember.prototype.provideFieldSyntax = function() {
15348 15758
15349 } 15759 }
15350 FieldMember.prototype.providePropertySyntax = function() { 15760 FieldMember.prototype.providePropertySyntax = function() {
15351 this._providePropertySyntax = true; 15761 this._providePropertySyntax = true;
15352 } 15762 }
15353 FieldMember.prototype.get$span = function() { 15763 FieldMember.prototype.get$span = function() {
15354 var $0; 15764 var $0;
15355 return (($0 = this.definition == null ? null : this.definition.span) && $0.is$ SourceSpan()); 15765 return (($0 = this.definition == null ? null : this.definition.span) == null ? null : $0.assert$SourceSpan());
15356 } 15766 }
15357 FieldMember.prototype.get$returnType = function() { 15767 FieldMember.prototype.get$returnType = function() {
15358 return this.type; 15768 return this.type;
15359 } 15769 }
15360 FieldMember.prototype.get$canGet = function() { 15770 FieldMember.prototype.get$canGet = function() {
15361 return true; 15771 return true;
15362 } 15772 }
15363 FieldMember.prototype.get$canSet = function() { 15773 FieldMember.prototype.get$canSet = function() {
15364 return !$notnull_bool(this.isFinal); 15774 return !$notnull_bool(this.isFinal);
15365 } 15775 }
15366 FieldMember.prototype.get$isField = function() { 15776 FieldMember.prototype.get$isField = function() {
15367 return true; 15777 return true;
15368 } 15778 }
15369 FieldMember.prototype.resolve = function() { 15779 FieldMember.prototype.resolve = function() {
15370 var $0; 15780 var $0;
15371 this.isStatic = this.declaringType.get$isTop(); 15781 this.isStatic = this.declaringType.get$isTop();
15372 this.isFinal = false; 15782 this.isFinal = false;
15373 if (this.definition.modifiers != null) { 15783 if (this.definition.modifiers != null) {
15374 var $list = this.definition.modifiers; 15784 var $list = this.definition.modifiers;
15375 for (var $i = 0;$i < $list.length; $i++) { 15785 for (var $i = 0;$i < $list.length; $i++) {
15376 var mod = $list.$index($i); 15786 var mod = $list.$index($i);
15377 if ($notnull_bool($eq(mod.get$kind(), 86/*TokenKind.STATIC*/))) { 15787 if ($notnull_bool($eq(mod.get$kind(), 86/*TokenKind.STATIC*/))) {
15378 if ($notnull_bool(this.isStatic)) { 15788 if ($notnull_bool(this.isStatic)) {
15379 $globals.world.error('duplicate static modifier', (($0 = mod.get$span( )) && $0.is$SourceSpan())); 15789 $globals.world.error('duplicate static modifier', (($0 = mod.get$span( )) == null ? null : $0.assert$SourceSpan()));
15380 } 15790 }
15381 this.isStatic = true; 15791 this.isStatic = true;
15382 } 15792 }
15383 else if ($notnull_bool($eq(mod.get$kind(), 97/*TokenKind.FINAL*/))) { 15793 else if ($notnull_bool($eq(mod.get$kind(), 97/*TokenKind.FINAL*/))) {
15384 if ($notnull_bool(this.isFinal)) { 15794 if ($notnull_bool(this.isFinal)) {
15385 $globals.world.error('duplicate final modifier', (($0 = mod.get$span() ) && $0.is$SourceSpan())); 15795 $globals.world.error('duplicate final modifier', (($0 = mod.get$span() ) == null ? null : $0.assert$SourceSpan()));
15386 } 15796 }
15387 this.isFinal = true; 15797 this.isFinal = true;
15388 } 15798 }
15389 else { 15799 else {
15390 $globals.world.error(('' + mod + ' modifier not allowed on field'), (($0 = mod.get$span()) && $0.is$SourceSpan())); 15800 $globals.world.error(('' + mod + ' modifier not allowed on field'), (($0 = mod.get$span()) == null ? null : $0.assert$SourceSpan()));
15391 } 15801 }
15392 } 15802 }
15393 } 15803 }
15394 this.type = this.resolveType(this.definition.type, false); 15804 this.type = this.resolveType(this.definition.type, false);
15395 if ($notnull_bool(this.isStatic) && $notnull_bool(this.type.get$hasTypeParams( ))) { 15805 if ($notnull_bool(this.isStatic) && $notnull_bool(this.type.get$hasTypeParams( ))) {
15396 $globals.world.error('using type parameter in static context', this.definiti on.type.span); 15806 $globals.world.error('using type parameter in static context', this.definiti on.type.span);
15397 } 15807 }
15398 if ($notnull_bool(this.isStatic) && $notnull_bool(this.isFinal) && this.value == null) { 15808 if ($notnull_bool(this.isStatic) && $notnull_bool(this.isFinal) && this.value == null) {
15399 $globals.world.error('static final field is missing initializer', this.get$s pan()); 15809 $globals.world.error('static final field is missing initializer', this.get$s pan());
15400 } 15810 }
15401 this.get$library()._addMember(this); 15811 this.get$library()._addMember(this);
15402 } 15812 }
15403 FieldMember.prototype.computeValue = function() { 15813 FieldMember.prototype.computeValue = function() {
15404 var $0; 15814 var $0;
15405 if (this.value == null) return null; 15815 if (this.value == null) return null;
15406 if (this._computedValue == null) { 15816 if (this._computedValue == null) {
15407 if ($notnull_bool(this._computing)) { 15817 if ($notnull_bool(this._computing)) {
15408 $globals.world.error('circular reference', this.value.span); 15818 $globals.world.error('circular reference', this.value.span);
15409 return null; 15819 return null;
15410 } 15820 }
15411 this._computing = true; 15821 this._computing = true;
15412 var finalMethod = new MethodMember('final_context', this.declaringType, null ); 15822 var finalMethod = new MethodMember('final_context', this.declaringType, null );
15413 finalMethod.set$isStatic(true); 15823 finalMethod.set$isStatic(true);
15414 var finalGen = new MethodGenerator(finalMethod, null); 15824 var finalGen = new MethodGenerator(finalMethod, null);
15415 this._computedValue = (($0 = this.value.visit((finalGen && finalGen.is$TreeV isitor()))) && $0.is$Value()); 15825 this._computedValue = (($0 = this.value.visit((finalGen == null ? null : fin alGen.assert$TreeVisitor()))) == null ? null : $0.assert$Value());
15416 if (!$notnull_bool(this._computedValue.get$isConst())) { 15826 if (!$notnull_bool(this._computedValue.get$isConst())) {
15417 if ($notnull_bool(this.isStatic)) { 15827 if ($notnull_bool(this.isStatic)) {
15418 $globals.world.error('non constant static field must be initialized in f unctions', this.value.span); 15828 $globals.world.error('non constant static field must be initialized in f unctions', this.value.span);
15419 } 15829 }
15420 else { 15830 else {
15421 $globals.world.error('non constant field must be initialized in construc tor', this.value.span); 15831 $globals.world.error('non constant field must be initialized in construc tor', this.value.span);
15422 } 15832 }
15423 } 15833 }
15424 if ($notnull_bool(this.isStatic)) { 15834 if ($notnull_bool(this.isStatic)) {
15425 this._computedValue = $globals.world.gen.globalForStaticField(this, this._ computedValue, [this._computedValue]); 15835 this._computedValue = $globals.world.gen.globalForStaticField(this, this._ computedValue, [this._computedValue]);
15426 } 15836 }
15427 this._computing = false; 15837 this._computing = false;
15428 } 15838 }
15429 return this._computedValue; 15839 return this._computedValue;
15430 } 15840 }
15431 FieldMember.prototype._get = function(context, node, target, isDynamic) { 15841 FieldMember.prototype._get = function(context, node, target, isDynamic) {
15432 var $0; 15842 var $0;
15433 if (!$notnull_bool(isDynamic)) { 15843 if (!$notnull_bool(isDynamic)) {
15434 this.declaringType.markUsed(); 15844 this.declaringType.markUsed();
15435 } 15845 }
15436 if ($notnull_bool(this.isStatic)) { 15846 if ($notnull_bool(this.isStatic)) {
15437 var cv = this.computeValue(); 15847 var cv = this.computeValue();
15438 if ($notnull_bool(this.isFinal)) { 15848 if ($notnull_bool(this.isFinal)) {
15439 return (cv && cv.is$Value()); 15849 return (cv == null ? null : cv.assert$Value());
15440 } 15850 }
15441 $globals.world.gen.hasStatics = true; 15851 $globals.world.gen.hasStatics = true;
15442 if ($notnull_bool(this.declaringType.get$isTop())) { 15852 if ($notnull_bool(this.declaringType.get$isTop())) {
15443 if ($eq(this.declaringType.get$library(), $globals.world.get$dom())) { 15853 if ($eq(this.declaringType.get$library(), $globals.world.get$dom())) {
15444 return new Value(this.type, ('' + this.get$jsname()), node.span, true); 15854 return new Value(this.type, ('' + this.get$jsname()), node.span, true);
15445 } 15855 }
15446 else { 15856 else {
15447 return new Value(this.type, ('\$globals.' + this.get$jsname()), node.spa n, true); 15857 return new Value(this.type, ('\$globals.' + this.get$jsname()), node.spa n, true);
15448 } 15858 }
15449 } 15859 }
15450 else if ($notnull_bool(this.declaringType.get$isNative())) { 15860 else if ($notnull_bool(this.declaringType.get$isNative())) {
15451 if ($notnull_bool(this.declaringType.get$isHiddenNativeType())) { 15861 if ($notnull_bool(this.declaringType.get$isHiddenNativeType())) {
15452 $globals.world.error('static field of hidden native type is inaccessible ', node.span); 15862 $globals.world.error('static field of hidden native type is inaccessible ', node.span);
15453 } 15863 }
15454 return new Value(this.type, ('' + this.declaringType.get$jsname() + '.' + this.get$jsname()), node.span, true); 15864 return new Value(this.type, ('' + this.declaringType.get$jsname() + '.' + this.get$jsname()), node.span, true);
15455 } 15865 }
15456 else { 15866 else {
15457 return new Value(this.type, ('\$globals.' + this.declaringType.get$jsname( ) + '_' + this.get$jsname()), node.span, true); 15867 return new Value(this.type, ('\$globals.' + this.declaringType.get$jsname( ) + '_' + this.get$jsname()), node.span, true);
15458 } 15868 }
15459 } 15869 }
15460 else if ($notnull_bool(target.get$isConst()) && $notnull_bool(this.isFinal)) { 15870 else if ($notnull_bool(target.get$isConst()) && $notnull_bool(this.isFinal)) {
15461 var constTarget = (target instanceof GlobalValue) ? target.get$dynamic().get $exp() : target; 15871 var constTarget = (target instanceof GlobalValue) ? target.get$dynamic().get $exp() : target;
15462 if ((constTarget instanceof ConstObjectValue)) { 15872 if ((constTarget instanceof ConstObjectValue)) {
15463 return (($0 = constTarget.get$fields().$index(this.name)) && $0.is$Value() ); 15873 return (($0 = constTarget.get$fields().$index(this.name)) == null ? null : $0.assert$Value());
15464 } 15874 }
15465 else if ($notnull_bool($eq(constTarget.get$type(), $globals.world.stringType )) && this.name == 'length') { 15875 else if ($notnull_bool($eq(constTarget.get$type(), $globals.world.stringType )) && this.name == 'length') {
15466 return new Value(this.type, ('' + constTarget.get$actualValue().length), n ode.span, true); 15876 return new Value(this.type, ('' + constTarget.get$actualValue().length), n ode.span, true);
15467 } 15877 }
15468 } 15878 }
15469 return new Value(this.type, ('' + target.code + '.' + this.get$jsname()), node .span, true); 15879 return new Value(this.type, ('' + target.code + '.' + this.get$jsname()), node .span, true);
15470 } 15880 }
15471 FieldMember.prototype._set = function(context, node, target, value, isDynamic) { 15881 FieldMember.prototype._set = function(context, node, target, value, isDynamic) {
15472 var lhs = this._get(context, node, target, isDynamic); 15882 var lhs = this._get(context, node, target, isDynamic);
15473 value = value.convertTo(context, this.type, node, isDynamic); 15883 value = value.convertTo(context, this.type, node, isDynamic);
15474 return new Value(this.type, ('' + lhs.get$code() + ' = ' + value.code), node.s pan, true); 15884 return new Value(this.type, ('' + lhs.get$code() + ' = ' + value.code), node.s pan, true);
15475 } 15885 }
15476 FieldMember.prototype._get$3 = function($0, $1, $2) { 15886 FieldMember.prototype._get$3 = function($0, $1, $2) {
15477 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false); 15887 return this._get(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == nul l ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), fals e);
15478 }; 15888 };
15479 FieldMember.prototype._set$4 = function($0, $1, $2, $3) { 15889 FieldMember.prototype._set$4 = function($0, $1, $2, $3) {
15480 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false); 15890 return this._set(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == nul l ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($3 == null ? null : $3.assert$Value()), false);
15481 }; 15891 };
15482 FieldMember.prototype.computeValue$0 = FieldMember.prototype.computeValue; 15892 FieldMember.prototype.computeValue$0 = FieldMember.prototype.computeValue;
15483 FieldMember.prototype.provideFieldSyntax$0 = FieldMember.prototype.provideFieldS yntax; 15893 FieldMember.prototype.provideFieldSyntax$0 = FieldMember.prototype.provideFieldS yntax;
15484 FieldMember.prototype.providePropertySyntax$0 = FieldMember.prototype.providePro pertySyntax; 15894 FieldMember.prototype.providePropertySyntax$0 = FieldMember.prototype.providePro pertySyntax;
15485 FieldMember.prototype.resolve$0 = FieldMember.prototype.resolve; 15895 FieldMember.prototype.resolve$0 = FieldMember.prototype.resolve;
15486 // ********** Code for PropertyMember ************** 15896 // ********** Code for PropertyMember **************
15487 function PropertyMember(name, declaringType) { 15897 function PropertyMember(name, declaringType) {
15488 this._provideFieldSyntax = false 15898 this._provideFieldSyntax = false
15489 // Initializers done 15899 // Initializers done
15490 Member.call(this, name, declaringType); 15900 Member.call(this, name, declaringType);
15491 } 15901 }
15492 $inherits(PropertyMember, Member); 15902 $inherits(PropertyMember, Member);
15493 PropertyMember.prototype.is$PropertyMember = function(){return this;}; 15903 PropertyMember.prototype.assert$PropertyMember = function(){return this};
15494 PropertyMember.prototype.get$getter = function() { return this.getter; }; 15904 PropertyMember.prototype.get$getter = function() { return this.getter; };
15495 PropertyMember.prototype.set$getter = function(value) { return this.getter = val ue; }; 15905 PropertyMember.prototype.set$getter = function(value) { return this.getter = val ue; };
15496 PropertyMember.prototype.get$setter = function() { return this.setter; }; 15906 PropertyMember.prototype.get$setter = function() { return this.setter; };
15497 PropertyMember.prototype.set$setter = function(value) { return this.setter = val ue; }; 15907 PropertyMember.prototype.set$setter = function(value) { return this.setter = val ue; };
15498 PropertyMember.prototype.get$span = function() { 15908 PropertyMember.prototype.get$span = function() {
15499 var $0; 15909 var $0;
15500 return (($0 = this.getter != null ? this.getter.get$span() : null) && $0.is$So urceSpan()); 15910 return (($0 = this.getter != null ? this.getter.get$span() : null) == null ? n ull : $0.assert$SourceSpan());
15501 } 15911 }
15502 PropertyMember.prototype.get$canGet = function() { 15912 PropertyMember.prototype.get$canGet = function() {
15503 return this.getter != null; 15913 return this.getter != null;
15504 } 15914 }
15505 PropertyMember.prototype.get$canSet = function() { 15915 PropertyMember.prototype.get$canSet = function() {
15506 return this.setter != null; 15916 return this.setter != null;
15507 } 15917 }
15508 PropertyMember.prototype.get$prefersPropertySyntax = function() { 15918 PropertyMember.prototype.get$prefersPropertySyntax = function() {
15509 return true; 15919 return true;
15510 } 15920 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
15553 return this._overriddenField._set(context, node, target, value, isDynamic) ; 15963 return this._overriddenField._set(context, node, target, value, isDynamic) ;
15554 } 15964 }
15555 return target.invokeNoSuchMethod(context, ('set:' + this.name), node, new Ar guments(null, [value])); 15965 return target.invokeNoSuchMethod(context, ('set:' + this.name), node, new Ar guments(null, [value]));
15556 } 15966 }
15557 return this.setter.invoke(context, node, target, new Arguments(null, [value]), isDynamic); 15967 return this.setter.invoke(context, node, target, new Arguments(null, [value]), isDynamic);
15558 } 15968 }
15559 PropertyMember.prototype.addFromParent = function(parentMember) { 15969 PropertyMember.prototype.addFromParent = function(parentMember) {
15560 var $0; 15970 var $0;
15561 var parent; 15971 var parent;
15562 if ((parentMember instanceof ConcreteMember)) { 15972 if ((parentMember instanceof ConcreteMember)) {
15563 var c = (parentMember && parentMember.is$ConcreteMember()); 15973 var c = (parentMember == null ? null : parentMember.assert$ConcreteMember()) ;
15564 parent = (($0 = c.baseMember) && $0.is$PropertyMember()); 15974 parent = (($0 = c.baseMember) == null ? null : $0.assert$PropertyMember());
15565 } 15975 }
15566 else { 15976 else {
15567 parent = (parentMember && parentMember.is$PropertyMember()); 15977 parent = (parentMember == null ? null : parentMember.assert$PropertyMember() );
15568 } 15978 }
15569 if (this.getter == null) this.getter = parent.getter; 15979 if (this.getter == null) this.getter = parent.getter;
15570 if (this.setter == null) this.setter = parent.setter; 15980 if (this.setter == null) this.setter = parent.setter;
15571 } 15981 }
15572 PropertyMember.prototype.resolve = function() { 15982 PropertyMember.prototype.resolve = function() {
15573 if (this.getter != null) this.getter.resolve(); 15983 if (this.getter != null) this.getter.resolve();
15574 if (this.setter != null) this.setter.resolve(); 15984 if (this.setter != null) this.setter.resolve();
15575 this.get$library()._addMember(this); 15985 this.get$library()._addMember(this);
15576 } 15986 }
15577 PropertyMember.prototype._get$3 = function($0, $1, $2) { 15987 PropertyMember.prototype._get$3 = function($0, $1, $2) {
15578 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false); 15988 return this._get(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == nul l ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), fals e);
15579 }; 15989 };
15580 PropertyMember.prototype._set$4 = function($0, $1, $2, $3) { 15990 PropertyMember.prototype._set$4 = function($0, $1, $2, $3) {
15581 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false); 15991 return this._set(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == nul l ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($3 == null ? null : $3.assert$Value()), false);
15582 }; 15992 };
15583 PropertyMember.prototype.provideFieldSyntax$0 = PropertyMember.prototype.provide FieldSyntax; 15993 PropertyMember.prototype.provideFieldSyntax$0 = PropertyMember.prototype.provide FieldSyntax;
15584 PropertyMember.prototype.providePropertySyntax$0 = PropertyMember.prototype.prov idePropertySyntax; 15994 PropertyMember.prototype.providePropertySyntax$0 = PropertyMember.prototype.prov idePropertySyntax;
15585 PropertyMember.prototype.resolve$0 = PropertyMember.prototype.resolve; 15995 PropertyMember.prototype.resolve$0 = PropertyMember.prototype.resolve;
15586 // ********** Code for ConcreteMember ************** 15996 // ********** Code for ConcreteMember **************
15587 function ConcreteMember(name, declaringType, baseMember) { 15997 function ConcreteMember(name, declaringType, baseMember) {
15588 this.baseMember = baseMember; 15998 this.baseMember = baseMember;
15589 // Initializers done 15999 // Initializers done
15590 Member.call(this, name, declaringType); 16000 Member.call(this, name, declaringType);
15591 this.parameters = []; 16001 this.parameters = [];
15592 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring Type); 16002 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring Type);
15593 var $list = this.baseMember.get$parameters(); 16003 var $list = this.baseMember.get$parameters();
15594 for (var $i = 0;$i < $list.length; $i++) { 16004 for (var $i = 0;$i < $list.length; $i++) {
15595 var p = $list.$index($i); 16005 var p = $list.$index($i);
15596 var newType = p.get$type().resolveTypeParams$1(declaringType); 16006 var newType = p.get$type().resolveTypeParams$1(declaringType);
15597 if ($notnull_bool($ne(newType, p.get$type()))) { 16007 if ($notnull_bool($ne(newType, p.get$type()))) {
15598 this.parameters.add(p.copyWithNewType$2(this, newType)); 16008 this.parameters.add(p.copyWithNewType$2(this, newType));
15599 } 16009 }
15600 else { 16010 else {
15601 this.parameters.add(p); 16011 this.parameters.add(p);
15602 } 16012 }
15603 } 16013 }
15604 } 16014 }
15605 $inherits(ConcreteMember, Member); 16015 $inherits(ConcreteMember, Member);
15606 ConcreteMember.prototype.is$ConcreteMember = function(){return this;}; 16016 ConcreteMember.prototype.assert$ConcreteMember = function(){return this};
15607 ConcreteMember.prototype.get$returnType = function() { return this.returnType; } ; 16017 ConcreteMember.prototype.get$returnType = function() { return this.returnType; } ;
15608 ConcreteMember.prototype.set$returnType = function(value) { return this.returnTy pe = value; }; 16018 ConcreteMember.prototype.set$returnType = function(value) { return this.returnTy pe = value; };
15609 ConcreteMember.prototype.get$parameters = function() { return this.parameters; } ; 16019 ConcreteMember.prototype.get$parameters = function() { return this.parameters; } ;
15610 ConcreteMember.prototype.set$parameters = function(value) { return this.paramete rs = value; }; 16020 ConcreteMember.prototype.set$parameters = function(value) { return this.paramete rs = value; };
15611 ConcreteMember.prototype.get$span = function() { 16021 ConcreteMember.prototype.get$span = function() {
15612 return this.baseMember.get$span(); 16022 return this.baseMember.get$span();
15613 } 16023 }
15614 ConcreteMember.prototype.get$isStatic = function() { 16024 ConcreteMember.prototype.get$isStatic = function() {
15615 return this.baseMember.get$isStatic(); 16025 return this.baseMember.get$isStatic();
15616 } 16026 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
15663 return this.baseMember.providePropertySyntax(); 16073 return this.baseMember.providePropertySyntax();
15664 } 16074 }
15665 ConcreteMember.prototype.get$isConstructor = function() { 16075 ConcreteMember.prototype.get$isConstructor = function() {
15666 return this.name == this.declaringType.name; 16076 return this.name == this.declaringType.name;
15667 } 16077 }
15668 ConcreteMember.prototype.get$constructorName = function() { 16078 ConcreteMember.prototype.get$constructorName = function() {
15669 return this.baseMember.get$constructorName(); 16079 return this.baseMember.get$constructorName();
15670 } 16080 }
15671 ConcreteMember.prototype.get$definition = function() { 16081 ConcreteMember.prototype.get$definition = function() {
15672 var $0; 16082 var $0;
15673 return (($0 = this.baseMember.get$definition()) && $0.is$Definition()); 16083 return (($0 = this.baseMember.get$definition()) == null ? null : $0.assert$Def inition());
15674 } 16084 }
15675 ConcreteMember.prototype.get$initDelegate = function() { 16085 ConcreteMember.prototype.get$initDelegate = function() {
15676 return this.baseMember.get$initDelegate(); 16086 return this.baseMember.get$initDelegate();
15677 } 16087 }
15678 ConcreteMember.prototype.set$initDelegate = function(ctor) { 16088 ConcreteMember.prototype.set$initDelegate = function(ctor) {
15679 this.baseMember.set$initDelegate(ctor); 16089 this.baseMember.set$initDelegate(ctor);
15680 } 16090 }
15681 ConcreteMember.prototype.resolveType = function(node, isRequired) { 16091 ConcreteMember.prototype.resolveType = function(node, isRequired) {
15682 var $0; 16092 var $0;
15683 var type = this.baseMember.resolveType(node, isRequired); 16093 var type = this.baseMember.resolveType(node, isRequired);
15684 return (($0 = type.resolveTypeParams$1(this.declaringType)) && $0.is$lang_Type ()); 16094 return (($0 = type.resolveTypeParams$1(this.declaringType)) == null ? null : $ 0.assert$lang_Type());
15685 } 16095 }
15686 ConcreteMember.prototype.computeValue = function() { 16096 ConcreteMember.prototype.computeValue = function() {
15687 return this.baseMember.computeValue(); 16097 return this.baseMember.computeValue();
15688 } 16098 }
15689 ConcreteMember.prototype.override = function(other) { 16099 ConcreteMember.prototype.override = function(other) {
15690 return this.baseMember.override(other); 16100 return this.baseMember.override(other);
15691 } 16101 }
15692 ConcreteMember.prototype._get = function(context, node, target, isDynamic) { 16102 ConcreteMember.prototype._get = function(context, node, target, isDynamic) {
15693 var ret = this.baseMember._get(context, node, target, isDynamic); 16103 var ret = this.baseMember._get(context, node, target, isDynamic);
15694 return new Value(this.get$inferredResult(), ret.code, node.span, true); 16104 return new Value(this.get$inferredResult(), ret.code, node.span, true);
15695 } 16105 }
15696 ConcreteMember.prototype._set = function(context, node, target, value, isDynamic ) { 16106 ConcreteMember.prototype._set = function(context, node, target, value, isDynamic ) {
15697 var ret = this.baseMember._set(context, node, target, value, isDynamic); 16107 var ret = this.baseMember._set(context, node, target, value, isDynamic);
15698 return new Value(this.returnType, ret.code, node.span, true); 16108 return new Value(this.returnType, ret.code, node.span, true);
15699 } 16109 }
15700 ConcreteMember.prototype.invoke = function(context, node, target, args, isDynami c) { 16110 ConcreteMember.prototype.invoke = function(context, node, target, args, isDynami c) {
15701 var ret = this.baseMember.invoke(context, node, target, args, isDynamic); 16111 var ret = this.baseMember.invoke(context, node, target, args, isDynamic);
15702 var code = ret.code; 16112 var code = ret.code;
15703 if ($notnull_bool(this.get$isConstructor())) { 16113 if ($notnull_bool(this.get$isConstructor())) {
15704 code = code.replaceFirst$2(this.declaringType.get$genericType().get$jsname() , this.declaringType.get$jsname()); 16114 code = code.replaceFirst$2(this.declaringType.get$genericType().get$jsname() , this.declaringType.get$jsname());
15705 } 16115 }
15706 if ((this.baseMember instanceof MethodMember)) { 16116 if ((this.baseMember instanceof MethodMember)) {
15707 this.declaringType.genMethod(this); 16117 this.declaringType.genMethod(this);
15708 } 16118 }
15709 return new Value(this.get$inferredResult(), code, node.span, true); 16119 return new Value(this.get$inferredResult(), code, node.span, true);
15710 } 16120 }
15711 ConcreteMember.prototype._get$3 = function($0, $1, $2) { 16121 ConcreteMember.prototype._get$3 = function($0, $1, $2) {
15712 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false); 16122 return this._get(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == nul l ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), fals e);
15713 }; 16123 };
15714 ConcreteMember.prototype._set$4 = function($0, $1, $2, $3) { 16124 ConcreteMember.prototype._set$4 = function($0, $1, $2, $3) {
15715 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false); 16125 return this._set(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == nul l ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($3 == null ? null : $3.assert$Value()), false);
15716 }; 16126 };
15717 ConcreteMember.prototype.canInvoke$2 = function($0, $1) { 16127 ConcreteMember.prototype.canInvoke$2 = function($0, $1) {
15718 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 16128 return this.canInvoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 = = null ? null : $1.assert$Arguments()));
15719 }; 16129 };
15720 ConcreteMember.prototype.computeValue$0 = ConcreteMember.prototype.computeValue; 16130 ConcreteMember.prototype.computeValue$0 = ConcreteMember.prototype.computeValue;
15721 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) { 16131 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) {
15722 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); 16132 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), false);
15723 }; 16133 };
15724 ConcreteMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic ) { 16134 ConcreteMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic ) {
15725 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); 16135 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), $assert_bool(isDynamic));
15726 }; 16136 };
15727 ConcreteMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 16137 ConcreteMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
15728 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); 16138 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), $assert_bool($4));
15729 }; 16139 };
15730 ConcreteMember.prototype.provideFieldSyntax$0 = ConcreteMember.prototype.provide FieldSyntax; 16140 ConcreteMember.prototype.provideFieldSyntax$0 = ConcreteMember.prototype.provide FieldSyntax;
15731 ConcreteMember.prototype.providePropertySyntax$0 = ConcreteMember.prototype.prov idePropertySyntax; 16141 ConcreteMember.prototype.providePropertySyntax$0 = ConcreteMember.prototype.prov idePropertySyntax;
15732 // ********** Code for MethodMember ************** 16142 // ********** Code for MethodMember **************
15733 function MethodMember(name, declaringType, definition) { 16143 function MethodMember(name, declaringType, definition) {
15734 this.isStatic = false 16144 this.isStatic = false
15735 this.isAbstract = false 16145 this.isAbstract = false
15736 this.isConst = false 16146 this.isConst = false
15737 this.isFactory = false 16147 this.isFactory = false
15738 this.isLambda = false 16148 this.isLambda = false
15739 this._providePropertySyntax = false 16149 this._providePropertySyntax = false
15740 this._provideFieldSyntax = false 16150 this._provideFieldSyntax = false
15741 this._provideOptionalParamInfo = false 16151 this._provideOptionalParamInfo = false
15742 this.definition = definition; 16152 this.definition = definition;
15743 // Initializers done 16153 // Initializers done
15744 Member.call(this, name, declaringType); 16154 Member.call(this, name, declaringType);
15745 } 16155 }
15746 $inherits(MethodMember, Member); 16156 $inherits(MethodMember, Member);
15747 MethodMember.prototype.is$MethodMember = function(){return this;}; 16157 MethodMember.prototype.assert$MethodMember = function(){return this};
15748 MethodMember.prototype.get$definition = function() { return this.definition; }; 16158 MethodMember.prototype.get$definition = function() { return this.definition; };
15749 MethodMember.prototype.set$definition = function(value) { return this.definition = value; }; 16159 MethodMember.prototype.set$definition = function(value) { return this.definition = value; };
15750 MethodMember.prototype.get$returnType = function() { return this.returnType; }; 16160 MethodMember.prototype.get$returnType = function() { return this.returnType; };
15751 MethodMember.prototype.set$returnType = function(value) { return this.returnType = value; }; 16161 MethodMember.prototype.set$returnType = function(value) { return this.returnType = value; };
15752 MethodMember.prototype.get$parameters = function() { return this.parameters; }; 16162 MethodMember.prototype.get$parameters = function() { return this.parameters; };
15753 MethodMember.prototype.set$parameters = function(value) { return this.parameters = value; }; 16163 MethodMember.prototype.set$parameters = function(value) { return this.parameters = value; };
15754 MethodMember.prototype.get$typeParameters = function() { return this.typeParamet ers; }; 16164 MethodMember.prototype.get$typeParameters = function() { return this.typeParamet ers; };
15755 MethodMember.prototype.set$typeParameters = function(value) { return this.typePa rameters = value; }; 16165 MethodMember.prototype.set$typeParameters = function(value) { return this.typePa rameters = value; };
15756 MethodMember.prototype.get$isStatic = function() { return this.isStatic; }; 16166 MethodMember.prototype.get$isStatic = function() { return this.isStatic; };
15757 MethodMember.prototype.set$isStatic = function(value) { return this.isStatic = v alue; }; 16167 MethodMember.prototype.set$isStatic = function(value) { return this.isStatic = v alue; };
(...skipping 17 matching lines...) Expand all
15775 return this.definition.nativeBody != null; 16185 return this.definition.nativeBody != null;
15776 } 16186 }
15777 MethodMember.prototype.get$canGet = function() { 16187 MethodMember.prototype.get$canGet = function() {
15778 return false; 16188 return false;
15779 } 16189 }
15780 MethodMember.prototype.get$canSet = function() { 16190 MethodMember.prototype.get$canSet = function() {
15781 return false; 16191 return false;
15782 } 16192 }
15783 MethodMember.prototype.get$span = function() { 16193 MethodMember.prototype.get$span = function() {
15784 var $0; 16194 var $0;
15785 return (($0 = this.definition == null ? null : this.definition.span) && $0.is$ SourceSpan()); 16195 return (($0 = this.definition == null ? null : this.definition.span) == null ? null : $0.assert$SourceSpan());
15786 } 16196 }
15787 MethodMember.prototype.get$constructorName = function() { 16197 MethodMember.prototype.get$constructorName = function() {
15788 var returnType = this.definition.returnType; 16198 var returnType = this.definition.returnType;
15789 if ($notnull_bool(returnType == null)) return ''; 16199 if ($notnull_bool(returnType == null)) return '';
15790 if ((returnType instanceof GenericTypeReference)) { 16200 if ((returnType instanceof GenericTypeReference)) {
15791 return ''; 16201 return '';
15792 } 16202 }
15793 if ($notnull_bool($ne(returnType.get$names(), null))) { 16203 if ($notnull_bool($ne(returnType.get$names(), null))) {
15794 return $assert_String(returnType.get$names().$index(0).get$name()); 16204 return $assert_String(returnType.get$names().$index(0).get$name());
15795 } 16205 }
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
15992 var p = this.indexOfParameter($assert_String(name)); 16402 var p = this.indexOfParameter($assert_String(name));
15993 if (p < 0) { 16403 if (p < 0) {
15994 return this._argError(context, node, target, args, ('method does not h ave optional parameter "' + name + '"')); 16404 return this._argError(context, node, target, args, ('method does not h ave optional parameter "' + name + '"'));
15995 } 16405 }
15996 else if (p < bareCount) { 16406 else if (p < bareCount) {
15997 return this._argError(context, node, target, args, ('argument "' + nam e + '" passed as positional and named')); 16407 return this._argError(context, node, target, args, ('argument "' + nam e + '" passed as positional and named'));
15998 } 16408 }
15999 } 16409 }
16000 $globals.world.internalError(('wrong named arguments calling ' + this.name ), node.span); 16410 $globals.world.internalError(('wrong named arguments calling ' + this.name ), node.span);
16001 } 16411 }
16002 Arguments.removeTrailingNulls((argsCode && argsCode.is$List_Value())); 16412 Arguments.removeTrailingNulls((argsCode == null ? null : argsCode.assert$Lis t_Value()));
16003 } 16413 }
16004 var argsString = Strings.join((argsCode && argsCode.is$List_String()), ', '); 16414 var argsString = Strings.join((argsCode == null ? null : argsCode.assert$List_ String()), ', ');
16005 if ($notnull_bool(this.get$isConstructor())) { 16415 if ($notnull_bool(this.get$isConstructor())) {
16006 return this._invokeConstructor(context, node, target, args, argsString); 16416 return this._invokeConstructor(context, node, target, args, argsString);
16007 } 16417 }
16008 if ($notnull_bool(target.isSuper)) { 16418 if ($notnull_bool(target.isSuper)) {
16009 return new Value(this.get$inferredResult(), ('' + this.declaringType.get$jsn ame() + '.prototype.' + this.get$jsname() + '.call(' + argsString + ')'), node.s pan, true); 16419 return new Value(this.get$inferredResult(), ('' + this.declaringType.get$jsn ame() + '.prototype.' + this.get$jsname() + '.call(' + argsString + ')'), node.s pan, true);
16010 } 16420 }
16011 if ($notnull_bool(this.get$isOperator())) { 16421 if ($notnull_bool(this.get$isOperator())) {
16012 return this._invokeBuiltin(context, node, target, args, argsCode, isDynamic) ; 16422 return this._invokeBuiltin(context, node, target, args, argsCode, isDynamic) ;
16013 } 16423 }
16014 if ($notnull_bool(this.isFactory)) { 16424 if ($notnull_bool(this.isFactory)) {
16015 $assert(target.isType, "target.isType", "member.dart", 946, 14); 16425 $assert(target.isType, "target.isType", "member.dart", 946, 14);
16016 return new Value(target.type, ('' + this.get$generatedFactoryName() + '(' + argsString + ')'), node.span, true); 16426 return new Value(target.type, ('' + this.get$generatedFactoryName() + '(' + argsString + ')'), node.span, true);
16017 } 16427 }
16018 if ($notnull_bool(this.isStatic)) { 16428 if ($notnull_bool(this.isStatic)) {
16019 if ($notnull_bool(this.declaringType.get$isTop())) { 16429 if ($notnull_bool(this.declaringType.get$isTop())) {
16020 return new Value(this.get$inferredResult(), ('' + this.get$jsname() + '(' + argsString + ')'), node != null ? node.span : node, true); 16430 return new Value(this.get$inferredResult(), ('' + this.get$jsname() + '(' + argsString + ')'), node != null ? node.span : node, true);
16021 } 16431 }
16022 return new Value(this.get$inferredResult(), ('' + this.declaringType.get$jsn ame() + '.' + this.get$jsname() + '(' + argsString + ')'), node.span, true); 16432 return new Value(this.get$inferredResult(), ('' + this.declaringType.get$jsn ame() + '.' + this.get$jsname() + '(' + argsString + ')'), node.span, true);
16023 } 16433 }
16024 var code = ('' + target.code + '.' + this.get$jsname() + '(' + argsString + ') '); 16434 var code = ('' + target.code + '.' + this.get$jsname() + '(' + argsString + ') ');
16025 if ($notnull_bool(target.get$isConst())) { 16435 if ($notnull_bool(target.get$isConst())) {
16026 if ((target instanceof GlobalValue)) { 16436 if ((target instanceof GlobalValue)) {
16027 target = (($0 = target.get$dynamic().get$exp()) && $0.is$Value()); 16437 target = (($0 = target.get$dynamic().get$exp()) == null ? null : $0.assert $Value());
16028 } 16438 }
16029 if (this.name == 'get\$length') { 16439 if (this.name == 'get\$length') {
16030 if ((target instanceof ConstListValue) || (target instanceof ConstMapValue )) { 16440 if ((target instanceof ConstListValue) || (target instanceof ConstMapValue )) {
16031 code = ('' + target.get$dynamic().get$values().length); 16441 code = ('' + target.get$dynamic().get$values().length);
16032 } 16442 }
16033 } 16443 }
16034 else if (this.name == 'isEmpty') { 16444 else if (this.name == 'isEmpty') {
16035 if ((target instanceof ConstListValue) || (target instanceof ConstMapValue )) { 16445 if ((target instanceof ConstListValue) || (target instanceof ConstMapValue )) {
16036 code = ('' + target.get$dynamic().get$values().isEmpty$0()); 16446 code = ('' + target.get$dynamic().get$values().isEmpty$0());
16037 } 16447 }
16038 } 16448 }
16039 } 16449 }
16040 if (this.name == 'get\$typeName' && $eq(this.declaringType.get$library(), $glo bals.world.get$dom())) { 16450 if (this.name == 'get\$typeName' && $eq(this.declaringType.get$library(), $glo bals.world.get$dom())) {
16041 $globals.world.gen.corejs.useTypeNameOf = true; 16451 $globals.world.gen.corejs.ensureTypeNameOf();
16042 } 16452 }
16043 return new Value(this.get$inferredResult(), code, node.span, true); 16453 return new Value(this.get$inferredResult(), code, node.span, true);
16044 } 16454 }
16045 MethodMember.prototype._invokeConstructor = function(context, node, target, args , argsString) { 16455 MethodMember.prototype._invokeConstructor = function(context, node, target, args , argsString) {
16046 this.declaringType.markUsed(); 16456 this.declaringType.markUsed();
16047 if (!$notnull_bool(target.isType)) { 16457 if (!$notnull_bool(target.isType)) {
16048 var code = (this.get$constructorName() != '') ? ('' + this.declaringType.get $jsname() + '.' + this.get$constructorName() + '\$ctor.call(' + argsString + ')' ) : ('' + this.declaringType.get$jsname() + '.call(' + argsString + ')'); 16458 var code = (this.get$constructorName() != '') ? ('' + this.declaringType.get $jsname() + '.' + this.get$constructorName() + '\$ctor.call(' + argsString + ')' ) : ('' + this.declaringType.get$jsname() + '.call(' + argsString + ')');
16049 return new Value(target.type, code, node.span, true); 16459 return new Value(target.type, code, node.span, true);
16050 } 16460 }
16051 else { 16461 else {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
16092 if ($notnull_bool(value == null)) { 16502 if ($notnull_bool(value == null)) {
16093 value = this.parameters.$index(j).get$value(); 16503 value = this.parameters.$index(j).get$value();
16094 } 16504 }
16095 } 16505 }
16096 this.generator._scope._vars.$setindex(name, value); 16506 this.generator._scope._vars.$setindex(name, value);
16097 } 16507 }
16098 var $list = this.definition.initializers; 16508 var $list = this.definition.initializers;
16099 for (var $i = 0;$i < $list.length; $i++) { 16509 for (var $i = 0;$i < $list.length; $i++) {
16100 var init = $list.$index($i); 16510 var init = $list.$index($i);
16101 if ((init instanceof CallExpression)) { 16511 if ((init instanceof CallExpression)) {
16102 var delegateArgs = this.generator._makeArgs((($0 = init.get$arguments()) && $0.is$List_ArgumentNode())); 16512 var delegateArgs = this.generator._makeArgs((($0 = init.get$arguments()) == null ? null : $0.assert$List_ArgumentNode()));
16103 var value = this.initDelegate.invoke(this.generator, node, target, (dele gateArgs && delegateArgs.is$Arguments()), false); 16513 var value = this.initDelegate.invoke(this.generator, node, target, (dele gateArgs == null ? null : delegateArgs.assert$Arguments()), false);
16104 if ((init.get$target() instanceof ThisExpression)) { 16514 if ((init.get$target() instanceof ThisExpression)) {
16105 return (value && value.is$Value()); 16515 return (value == null ? null : value.assert$Value());
16106 } 16516 }
16107 else { 16517 else {
16108 if ((value instanceof GlobalValue)) { 16518 if ((value instanceof GlobalValue)) {
16109 value = value.get$exp(); 16519 value = value.get$exp();
16110 } 16520 }
16111 var $list0 = value.get$fields().getKeys$0(); 16521 var $list0 = value.get$fields().getKeys$0();
16112 for (var $i0 = value.get$fields().getKeys$0().iterator$0(); $i0.hasNex t$0(); ) { 16522 for (var $i0 = value.get$fields().getKeys$0().iterator$0(); $i0.hasNex t$0(); ) {
16113 var fname = $i0.next$0(); 16523 var fname = $i0.next$0();
16114 fields.$setindex(fname, value.get$fields().$index(fname)); 16524 fields.$setindex(fname, value.get$fields().$index(fname));
16115 } 16525 }
16116 } 16526 }
16117 } 16527 }
16118 else { 16528 else {
16119 var assign = (init && init.is$BinaryExpression()); 16529 var assign = (init == null ? null : init.assert$BinaryExpression());
16120 var x = assign.x; 16530 var x = assign.x;
16121 var fname = x.get$name().get$name(); 16531 var fname = x.get$name().get$name();
16122 var val = this.generator.visitValue(assign.y); 16532 var val = this.generator.visitValue(assign.y);
16123 fields.$setindex(fname, val); 16533 fields.$setindex(fname, val);
16124 } 16534 }
16125 } 16535 }
16126 this.generator._popBlock(); 16536 this.generator._popBlock();
16127 } 16537 }
16128 var $list = this.declaringType.get$members().getValues(); 16538 var $list = this.declaringType.get$members().getValues();
16129 for (var $i = this.declaringType.get$members().getValues().iterator$0(); $i.ha sNext$0(); ) { 16539 for (var $i = this.declaringType.get$members().getValues().iterator$0(); $i.ha sNext$0(); ) {
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
16272 } 16682 }
16273 return EvaluatedValue.EvaluatedValue$factory(this.get$inferredResult(), va lue, ("" + value), node.span); 16683 return EvaluatedValue.EvaluatedValue$factory(this.get$inferredResult(), va lue, ("" + value), node.span);
16274 } 16684 }
16275 } 16685 }
16276 else if ($notnull_bool(this.declaringType.get$isString())) { 16686 else if ($notnull_bool(this.declaringType.get$isString())) {
16277 if (this.name == '\$index') { 16687 if (this.name == '\$index') {
16278 return new Value(this.declaringType, ('' + target.code + '[' + argsCode.$i ndex(0) + ']'), node.span, true); 16688 return new Value(this.declaringType, ('' + target.code + '[' + argsCode.$i ndex(0) + ']'), node.span, true);
16279 } 16689 }
16280 else if (this.name == '\$add') { 16690 else if (this.name == '\$add') {
16281 if ($notnull_bool(allConst)) { 16691 if ($notnull_bool(allConst)) {
16282 var value = this._normConcat(target, (($0 = args.values.$index(0)) && $0 .is$Value())); 16692 var value = this._normConcat(target, (($0 = args.values.$index(0)) == nu ll ? null : $0.assert$Value()));
16283 return EvaluatedValue.EvaluatedValue$factory($globals.world.stringType, value, value, node.span); 16693 return EvaluatedValue.EvaluatedValue$factory($globals.world.stringType, value, value, node.span);
16284 } 16694 }
16285 return new Value(this.declaringType, ('' + target.code + ' + ' + argsCode. $index(0)), node.span, true); 16695 return new Value(this.declaringType, ('' + target.code + ' + ' + argsCode. $index(0)), node.span, true);
16286 } 16696 }
16287 } 16697 }
16288 else if ($notnull_bool(this.declaringType.get$isNative())) { 16698 else if ($notnull_bool(this.declaringType.get$isNative())) {
16289 if (this.name == '\$index') { 16699 if (this.name == '\$index') {
16290 return new Value(this.returnType, ('' + target.code + '[' + argsCode.$inde x(0) + ']'), node.span, true); 16700 return new Value(this.returnType, ('' + target.code + '[' + argsCode.$inde x(0) + ']'), node.span, true);
16291 } 16701 }
16292 else if (this.name == '\$setindex') { 16702 else if (this.name == '\$setindex') {
(...skipping 15 matching lines...) Expand all
16308 return new Value(this.get$inferredResult(), ('' + target.code + ' ' + op + ' null'), node.span, true); 16718 return new Value(this.get$inferredResult(), ('' + target.code + ' ' + op + ' null'), node.span, true);
16309 } 16719 }
16310 else if ($notnull_bool(target.type.get$isNum()) || $notnull_bool(target.type .get$isString())) { 16720 else if ($notnull_bool(target.type.get$isNum()) || $notnull_bool(target.type .get$isString())) {
16311 return new Value(this.get$inferredResult(), ('' + target.code + ' ' + op + ' ' + argsCode.$index(0)), node.span, true); 16721 return new Value(this.get$inferredResult(), ('' + target.code + ' ' + op + ' ' + argsCode.$index(0)), node.span, true);
16312 } 16722 }
16313 $globals.world.gen.corejs.useOperator(this.name); 16723 $globals.world.gen.corejs.useOperator(this.name);
16314 return new Value(this.get$inferredResult(), ('' + this.name + '(' + target.c ode + ', ' + argsCode.$index(0) + ')'), node.span, true); 16724 return new Value(this.get$inferredResult(), ('' + this.name + '(' + target.c ode + ', ' + argsCode.$index(0) + ')'), node.span, true);
16315 } 16725 }
16316 if ($notnull_bool(this.get$isCallMethod())) { 16726 if ($notnull_bool(this.get$isCallMethod())) {
16317 this.declaringType.markUsed(); 16727 this.declaringType.markUsed();
16318 return new Value(this.get$inferredResult(), ('' + target.code + '(' + String s.join((argsCode && argsCode.is$List_String()), ", ") + ')'), node.span, true); 16728 return new Value(this.get$inferredResult(), ('' + target.code + '(' + String s.join((argsCode == null ? null : argsCode.assert$List_String()), ", ") + ')'), node.span, true);
16319 } 16729 }
16320 if (this.name == '\$index') { 16730 if (this.name == '\$index') {
16321 $globals.world.gen.corejs.useIndex = true; 16731 $globals.world.gen.corejs.useIndex = true;
16322 } 16732 }
16323 else if (this.name == '\$setindex') { 16733 else if (this.name == '\$setindex') {
16324 $globals.world.gen.corejs.useSetIndex = true; 16734 $globals.world.gen.corejs.useSetIndex = true;
16325 } 16735 }
16326 var argsString = Strings.join((argsCode && argsCode.is$List_String()), ', '); 16736 var argsString = Strings.join((argsCode == null ? null : argsCode.assert$List_ String()), ', ');
16327 return new Value(this.get$inferredResult(), ('' + target.code + '.' + this.get $jsname() + '(' + argsString + ')'), node.span, true); 16737 return new Value(this.get$inferredResult(), ('' + target.code + '.' + this.get $jsname() + '(' + argsString + ')'), node.span, true);
16328 } 16738 }
16329 MethodMember.prototype._normConcat = function(a, b) { 16739 MethodMember.prototype._normConcat = function(a, b) {
16330 $assert(b.type.get$isString(), "b.type.isString", "member.dart", 1250, 12); 16740 $assert(b.type.get$isString(), "b.type.isString", "member.dart", 1250, 12);
16331 var val0 = a.get$dynamic().get$actualValue(); 16741 var val0 = a.get$dynamic().get$actualValue();
16332 var quote0 = val0.$index(0); 16742 var quote0 = val0.$index(0);
16333 val0 = val0.substring$2(1, val0.length - 1); 16743 val0 = val0.substring$2(1, val0.length - 1);
16334 var val1 = b.get$dynamic().get$actualValue(); 16744 var val1 = b.get$dynamic().get$actualValue();
16335 var quote1 = null; 16745 var quote1 = null;
16336 if ($notnull_bool(b.type.get$isString())) { 16746 if ($notnull_bool(b.type.get$isString())) {
(...skipping 19 matching lines...) Expand all
16356 this.isStatic = this.declaringType.get$isTop(); 16766 this.isStatic = this.declaringType.get$isTop();
16357 this.isConst = false; 16767 this.isConst = false;
16358 this.isFactory = false; 16768 this.isFactory = false;
16359 this.isAbstract = !$notnull_bool(this.declaringType.get$isClass()); 16769 this.isAbstract = !$notnull_bool(this.declaringType.get$isClass());
16360 if (this.definition.modifiers != null) { 16770 if (this.definition.modifiers != null) {
16361 var $list = this.definition.modifiers; 16771 var $list = this.definition.modifiers;
16362 for (var $i = 0;$i < $list.length; $i++) { 16772 for (var $i = 0;$i < $list.length; $i++) {
16363 var mod = $list.$index($i); 16773 var mod = $list.$index($i);
16364 if ($notnull_bool($eq(mod.get$kind(), 86/*TokenKind.STATIC*/))) { 16774 if ($notnull_bool($eq(mod.get$kind(), 86/*TokenKind.STATIC*/))) {
16365 if ($notnull_bool(this.isStatic)) { 16775 if ($notnull_bool(this.isStatic)) {
16366 $globals.world.error('duplicate static modifier', (($0 = mod.get$span( )) && $0.is$SourceSpan())); 16776 $globals.world.error('duplicate static modifier', (($0 = mod.get$span( )) == null ? null : $0.assert$SourceSpan()));
16367 } 16777 }
16368 this.isStatic = true; 16778 this.isStatic = true;
16369 } 16779 }
16370 else if ($notnull_bool(this.get$isConstructor()) && $notnull_bool($eq(mod. get$kind(), 91/*TokenKind.CONST*/))) { 16780 else if ($notnull_bool(this.get$isConstructor()) && $notnull_bool($eq(mod. get$kind(), 91/*TokenKind.CONST*/))) {
16371 if ($notnull_bool(this.isConst)) { 16781 if ($notnull_bool(this.isConst)) {
16372 $globals.world.error('duplicate const modifier', (($0 = mod.get$span() ) && $0.is$SourceSpan())); 16782 $globals.world.error('duplicate const modifier', (($0 = mod.get$span() ) == null ? null : $0.assert$SourceSpan()));
16373 } 16783 }
16374 this.isConst = true; 16784 this.isConst = true;
16375 } 16785 }
16376 else if ($notnull_bool($eq(mod.get$kind(), 75/*TokenKind.FACTORY*/))) { 16786 else if ($notnull_bool($eq(mod.get$kind(), 75/*TokenKind.FACTORY*/))) {
16377 if ($notnull_bool(this.isFactory)) { 16787 if ($notnull_bool(this.isFactory)) {
16378 $globals.world.error('duplicate factory modifier', (($0 = mod.get$span ()) && $0.is$SourceSpan())); 16788 $globals.world.error('duplicate factory modifier', (($0 = mod.get$span ()) == null ? null : $0.assert$SourceSpan()));
16379 } 16789 }
16380 this.isFactory = true; 16790 this.isFactory = true;
16381 } 16791 }
16382 else if ($notnull_bool($eq(mod.get$kind(), 71/*TokenKind.ABSTRACT*/))) { 16792 else if ($notnull_bool($eq(mod.get$kind(), 71/*TokenKind.ABSTRACT*/))) {
16383 if ($notnull_bool(this.isAbstract)) { 16793 if ($notnull_bool(this.isAbstract)) {
16384 if ($notnull_bool(this.declaringType.get$isClass())) { 16794 if ($notnull_bool(this.declaringType.get$isClass())) {
16385 $globals.world.error('duplicate abstract modifier', (($0 = mod.get$s pan()) && $0.is$SourceSpan())); 16795 $globals.world.error('duplicate abstract modifier', (($0 = mod.get$s pan()) == null ? null : $0.assert$SourceSpan()));
16386 } 16796 }
16387 else { 16797 else {
16388 $globals.world.error('abstract modifier not allowed on interface mem bers', (($0 = mod.get$span()) && $0.is$SourceSpan())); 16798 $globals.world.error('abstract modifier not allowed on interface mem bers', (($0 = mod.get$span()) == null ? null : $0.assert$SourceSpan()));
16389 } 16799 }
16390 } 16800 }
16391 this.isAbstract = true; 16801 this.isAbstract = true;
16392 } 16802 }
16393 else { 16803 else {
16394 $globals.world.error(('' + mod + ' modifier not allowed on method'), (($ 0 = mod.get$span()) && $0.is$SourceSpan())); 16804 $globals.world.error(('' + mod + ' modifier not allowed on method'), (($ 0 = mod.get$span()) == null ? null : $0.assert$SourceSpan()));
16395 } 16805 }
16396 } 16806 }
16397 } 16807 }
16398 if ($notnull_bool(this.isFactory)) { 16808 if ($notnull_bool(this.isFactory)) {
16399 this.isStatic = true; 16809 this.isStatic = true;
16400 } 16810 }
16401 if (this.definition.typeParameters != null) { 16811 if (this.definition.typeParameters != null) {
16402 if (!$notnull_bool(this.isFactory)) { 16812 if (!$notnull_bool(this.isFactory)) {
16403 $globals.world.error('Only factories are allowed to have explicit type par ameters', (($0 = this.definition.typeParameters.$index(0).get$span()) && $0.is$S ourceSpan())); 16813 $globals.world.error('Only factories are allowed to have explicit type par ameters', (($0 = this.definition.typeParameters.$index(0).get$span()) == null ? null : $0.assert$SourceSpan()));
16404 } 16814 }
16405 else { 16815 else {
16406 this.typeParameters = this.definition.typeParameters; 16816 this.typeParameters = this.definition.typeParameters;
16407 var $list = this.definition.typeParameters; 16817 var $list = this.definition.typeParameters;
16408 for (var $i = 0;$i < $list.length; $i++) { 16818 for (var $i = 0;$i < $list.length; $i++) {
16409 var tp = $list.$index($i); 16819 var tp = $list.$index($i);
16410 tp.set$enclosingElement(this); 16820 tp.set$enclosingElement(this);
16411 tp.resolve$0(); 16821 tp.resolve$0();
16412 } 16822 }
16413 } 16823 }
(...skipping 26 matching lines...) Expand all
16440 var formal = $list.$index($i); 16850 var formal = $list.$index($i);
16441 var param = new Parameter(formal, this); 16851 var param = new Parameter(formal, this);
16442 param.resolve$0(); 16852 param.resolve$0();
16443 this.parameters.add(param); 16853 this.parameters.add(param);
16444 } 16854 }
16445 if (!$notnull_bool(this.isLambda)) { 16855 if (!$notnull_bool(this.isLambda)) {
16446 this.get$library()._addMember(this); 16856 this.get$library()._addMember(this);
16447 } 16857 }
16448 } 16858 }
16449 MethodMember.prototype._get$3 = function($0, $1, $2) { 16859 MethodMember.prototype._get$3 = function($0, $1, $2) {
16450 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false); 16860 return this._get(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == nul l ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), fals e);
16451 }; 16861 };
16452 MethodMember.prototype._set$4 = function($0, $1, $2, $3) { 16862 MethodMember.prototype._set$4 = function($0, $1, $2, $3) {
16453 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false); 16863 return this._set(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == nul l ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($3 == null ? null : $3.assert$Value()), false);
16454 }; 16864 };
16455 MethodMember.prototype.canInvoke$2 = function($0, $1) { 16865 MethodMember.prototype.canInvoke$2 = function($0, $1) {
16456 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 16866 return this.canInvoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 = = null ? null : $1.assert$Arguments()));
16457 }; 16867 };
16458 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) { 16868 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) {
16459 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); 16869 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), false);
16460 }; 16870 };
16461 MethodMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 16871 MethodMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) {
16462 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); 16872 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), $assert_bool(isDynamic));
16463 }; 16873 };
16464 MethodMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 16874 MethodMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
16465 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); 16875 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), $assert_bool($4));
16466 }; 16876 };
16467 MethodMember.prototype.namesInOrder$1 = function($0) { 16877 MethodMember.prototype.namesInOrder$1 = function($0) {
16468 return this.namesInOrder(($0 && $0.is$Arguments())); 16878 return this.namesInOrder(($0 == null ? null : $0.assert$Arguments()));
16469 }; 16879 };
16470 MethodMember.prototype.provideFieldSyntax$0 = MethodMember.prototype.provideFiel dSyntax; 16880 MethodMember.prototype.provideFieldSyntax$0 = MethodMember.prototype.provideFiel dSyntax;
16471 MethodMember.prototype.providePropertySyntax$0 = MethodMember.prototype.provideP ropertySyntax; 16881 MethodMember.prototype.providePropertySyntax$0 = MethodMember.prototype.provideP ropertySyntax;
16472 MethodMember.prototype.resolve$0 = MethodMember.prototype.resolve; 16882 MethodMember.prototype.resolve$0 = MethodMember.prototype.resolve;
16473 // ********** Code for MemberSet ************** 16883 // ********** Code for MemberSet **************
16474 function MemberSet(member, isVar) { 16884 function MemberSet(member, isVar) {
16475 this.name = member.name; 16885 this.name = member.name;
16476 this.members = [member]; 16886 this.members = [member];
16477 this.jsname = member.get$jsname(); 16887 this.jsname = member.get$jsname();
16478 this.isVar = isVar; 16888 this.isVar = isVar;
16479 // Initializers done 16889 // Initializers done
16480 } 16890 }
16481 MemberSet.prototype.is$MemberSet = function(){return this;}; 16891 MemberSet.prototype.assert$MemberSet = function(){return this};
16482 MemberSet.prototype.get$name = function() { return this.name; }; 16892 MemberSet.prototype.get$name = function() { return this.name; };
16483 MemberSet.prototype.get$members = function() { return this.members; }; 16893 MemberSet.prototype.get$members = function() { return this.members; };
16484 MemberSet.prototype.get$jsname = function() { return this.jsname; }; 16894 MemberSet.prototype.get$jsname = function() { return this.jsname; };
16485 MemberSet.prototype.get$isVar = function() { return this.isVar; }; 16895 MemberSet.prototype.get$isVar = function() { return this.isVar; };
16486 MemberSet.prototype.toString = function() { 16896 MemberSet.prototype.toString = function() {
16487 return ('' + this.name + ':' + this.members.length); 16897 return ('' + this.name + ':' + this.members.length);
16488 } 16898 }
16489 MemberSet.prototype.get$containsMethods = function() { 16899 MemberSet.prototype.get$containsMethods = function() {
16490 return this.members.some((function (m) { 16900 return this.members.some((function (m) {
16491 return (m instanceof MethodMember); 16901 return (m instanceof MethodMember);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
16544 var returnValue; 16954 var returnValue;
16545 var targets = this.members.filter((function (m) { 16955 var targets = this.members.filter((function (m) {
16546 return m.get$canGet(); 16956 return m.get$canGet();
16547 }) 16957 })
16548 ); 16958 );
16549 if ($notnull_bool(this.isVar)) { 16959 if ($notnull_bool(this.isVar)) {
16550 targets.forEach$1((function (m) { 16960 targets.forEach$1((function (m) {
16551 return m._get(context, node, target, true); 16961 return m._get(context, node, target, true);
16552 }) 16962 })
16553 ); 16963 );
16554 returnValue = new Value(this._foldTypes((targets && targets.is$List_Member() )), null, node.span, true); 16964 returnValue = new Value(this._foldTypes((targets == null ? null : targets.as sert$List_Member())), null, node.span, true);
16555 } 16965 }
16556 else { 16966 else {
16557 if (this.members.length == 1) { 16967 if (this.members.length == 1) {
16558 return this.members.$index(0)._get(context, node, target, isDynamic); 16968 return this.members.$index(0)._get(context, node, target, isDynamic);
16559 } 16969 }
16560 else if ($notnull_bool($eq(targets.length, 1))) { 16970 else if ($notnull_bool($eq(targets.length, 1))) {
16561 return targets.$index(0)._get(context, node, target, isDynamic); 16971 return targets.$index(0)._get(context, node, target, isDynamic);
16562 } 16972 }
16563 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) { 16973 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) {
16564 var member = $i.next$0(); 16974 var member = $i.next$0();
(...skipping 18 matching lines...) Expand all
16583 var returnValue; 16993 var returnValue;
16584 var targets = this.members.filter((function (m) { 16994 var targets = this.members.filter((function (m) {
16585 return m.get$canSet(); 16995 return m.get$canSet();
16586 }) 16996 })
16587 ); 16997 );
16588 if ($notnull_bool(this.isVar)) { 16998 if ($notnull_bool(this.isVar)) {
16589 targets.forEach$1((function (m) { 16999 targets.forEach$1((function (m) {
16590 return m._set(context, node, target, value, true); 17000 return m._set(context, node, target, value, true);
16591 }) 17001 })
16592 ); 17002 );
16593 returnValue = new Value(this._foldTypes((targets && targets.is$List_Member() )), null, node.span, true); 17003 returnValue = new Value(this._foldTypes((targets == null ? null : targets.as sert$List_Member())), null, node.span, true);
16594 } 17004 }
16595 else { 17005 else {
16596 if (this.members.length == 1) { 17006 if (this.members.length == 1) {
16597 return this.members.$index(0)._set(context, node, target, value, isDynamic ); 17007 return this.members.$index(0)._set(context, node, target, value, isDynamic );
16598 } 17008 }
16599 else if ($notnull_bool($eq(targets.length, 1))) { 17009 else if ($notnull_bool($eq(targets.length, 1))) {
16600 return targets.$index(0)._set(context, node, target, value, isDynamic); 17010 return targets.$index(0)._set(context, node, target, value, isDynamic);
16601 } 17011 }
16602 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) { 17012 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) {
16603 var member = $i.next$0(); 17013 var member = $i.next$0();
(...skipping 13 matching lines...) Expand all
16617 } 17027 }
16618 } 17028 }
16619 return returnValue; 17029 return returnValue;
16620 } 17030 }
16621 MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) { 17031 MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) {
16622 var $0; 17032 var $0;
16623 if ($notnull_bool(this.isVar) && !$notnull_bool(this.get$isOperator())) { 17033 if ($notnull_bool(this.isVar) && !$notnull_bool(this.get$isOperator())) {
16624 return this.invokeOnVar(context, node, target, args); 17034 return this.invokeOnVar(context, node, target, args);
16625 } 17035 }
16626 if (this.members.length == 1) { 17036 if (this.members.length == 1) {
16627 return (($0 = this.members.$index(0).invoke$5(context, node, target, args, i sDynamic)) && $0.is$Value()); 17037 return (($0 = this.members.$index(0).invoke$5(context, node, target, args, i sDynamic)) == null ? null : $0.assert$Value());
16628 } 17038 }
16629 var targets = this.members.filter((function (m) { 17039 var targets = this.members.filter((function (m) {
16630 return m.canInvoke$2(context, args); 17040 return m.canInvoke$2(context, args);
16631 }) 17041 })
16632 ); 17042 );
16633 if ($notnull_bool($eq(targets.length, 1))) { 17043 if ($notnull_bool($eq(targets.length, 1))) {
16634 return (($0 = targets.$index(0).invoke$5(context, node, target, args, isDyna mic)) && $0.is$Value()); 17044 return (($0 = targets.$index(0).invoke$5(context, node, target, args, isDyna mic)) == null ? null : $0.assert$Value());
16635 } 17045 }
16636 var returnValue = null; 17046 var returnValue = null;
16637 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) { 17047 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) {
16638 var member = $i.next$0(); 17048 var member = $i.next$0();
16639 var res = member.invoke$4$isDynamic(context, node, target, args, true); 17049 var res = member.invoke$4$isDynamic(context, node, target, args, true);
16640 returnValue = this._tryUnion(returnValue, (res && res.is$Value()), node); 17050 returnValue = this._tryUnion(returnValue, (res == null ? null : res.assert$V alue()), node);
16641 } 17051 }
16642 if (returnValue == null) { 17052 if (returnValue == null) {
16643 return this._makeError(node, target, 'method'); 17053 return this._makeError(node, target, 'method');
16644 } 17054 }
16645 if (returnValue.code == null) { 17055 if (returnValue.code == null) {
16646 if (this.name == '\$call') { 17056 if (this.name == '\$call') {
16647 return target._varCall(context, args); 17057 return target._varCall(context, args);
16648 } 17058 }
16649 else if ($notnull_bool(this.get$isOperator())) { 17059 else if ($notnull_bool(this.get$isOperator())) {
16650 return target.invokeSpecial(this.name, args, returnValue.type); 17060 return target.invokeSpecial(this.name, args, returnValue.type);
16651 } 17061 }
16652 else { 17062 else {
16653 return this.invokeOnVar(context, node, target, args); 17063 return this.invokeOnVar(context, node, target, args);
16654 } 17064 }
16655 } 17065 }
16656 return returnValue; 17066 return returnValue;
16657 } 17067 }
16658 MemberSet.prototype.invokeOnVar = function(context, node, target, args) { 17068 MemberSet.prototype.invokeOnVar = function(context, node, target, args) {
16659 var $0; 17069 var $0;
16660 var member = this.getVarMember(context, node, args); 17070 var member = this.getVarMember(context, node, args);
16661 return (($0 = member.invoke$4(context, node, target, args)) && $0.is$Value()); 17071 return (($0 = member.invoke$4(context, node, target, args)) == null ? null : $ 0.assert$Value());
16662 } 17072 }
16663 MemberSet.prototype._tryUnion = function(x, y, node) { 17073 MemberSet.prototype._tryUnion = function(x, y, node) {
16664 if (x == null) return y; 17074 if (x == null) return y;
16665 var type = lang_Type.union(x.type, y.type); 17075 var type = lang_Type.union(x.type, y.type);
16666 if (x.code == y.code) { 17076 if (x.code == y.code) {
16667 if ($notnull_bool($eq(type, x.type))) { 17077 if ($notnull_bool($eq(type, x.type))) {
16668 return x; 17078 return x;
16669 } 17079 }
16670 else if ($notnull_bool(x.get$isConst()) || $notnull_bool(y.get$isConst())) { 17080 else if ($notnull_bool(x.get$isConst()) || $notnull_bool(y.get$isConst())) {
16671 $globals.world.internalError("unexpected: union of const values "); 17081 $globals.world.internalError("unexpected: union of const values ");
16672 } 17082 }
16673 else { 17083 else {
16674 var ret = new Value(type, x.code, node.span, true); 17084 var ret = new Value(type, x.code, node.span, true);
16675 ret.set$isSuper($notnull_bool(x.isSuper) && $notnull_bool(y.isSuper)); 17085 ret.set$isSuper($notnull_bool(x.isSuper) && $notnull_bool(y.isSuper));
16676 ret.set$needsTemp($notnull_bool(x.needsTemp) || $notnull_bool(y.needsTemp) ); 17086 ret.set$needsTemp($notnull_bool(x.needsTemp) || $notnull_bool(y.needsTemp) );
16677 ret.set$isType($notnull_bool(x.isType) && $notnull_bool(y.isType)); 17087 ret.set$isType($notnull_bool(x.isType) && $notnull_bool(y.isType));
16678 return (ret && ret.is$Value()); 17088 return (ret == null ? null : ret.assert$Value());
16679 } 17089 }
16680 } 17090 }
16681 else { 17091 else {
16682 return new Value(type, null, node.span, true); 17092 return new Value(type, null, node.span, true);
16683 } 17093 }
16684 } 17094 }
16685 MemberSet.prototype.getVarMember = function(context, node, args) { 17095 MemberSet.prototype.getVarMember = function(context, node, args) {
16686 if ($globals.world.objectType.varStubs == null) { 17096 if ($globals.world.objectType.varStubs == null) {
16687 $globals.world.objectType.varStubs = $map([]); 17097 $globals.world.objectType.varStubs = $map([]);
16688 } 17098 }
16689 var stubName = _getCallStubName(this.name, args); 17099 var stubName = _getCallStubName(this.name, args);
16690 var stub = $globals.world.objectType.varStubs.$index(stubName); 17100 var stub = $globals.world.objectType.varStubs.$index(stubName);
16691 if ($notnull_bool(stub == null)) { 17101 if ($notnull_bool(stub == null)) {
16692 var mset = context.findMembers(this.name).members; 17102 var mset = context.findMembers(this.name).members;
16693 var targets = mset.filter((function (m) { 17103 var targets = mset.filter((function (m) {
16694 return m.canInvoke$2(context, args); 17104 return m.canInvoke$2(context, args);
16695 }) 17105 })
16696 ); 17106 );
16697 stub = new VarMethodSet($assert_String(stubName), targets, args, this._foldT ypes((targets && targets.is$List_Member()))); 17107 stub = new VarMethodSet($assert_String(stubName), targets, args, this._foldT ypes((targets == null ? null : targets.assert$List_Member())));
16698 $globals.world.objectType.varStubs.$setindex(stubName, stub); 17108 $globals.world.objectType.varStubs.$setindex(stubName, stub);
16699 } 17109 }
16700 return (stub && stub.is$VarMember()); 17110 return (stub == null ? null : stub.assert$VarMember());
16701 } 17111 }
16702 MemberSet.prototype._foldTypes = function(targets) { 17112 MemberSet.prototype._foldTypes = function(targets) {
16703 var $0; 17113 var $0;
16704 return (($0 = reduce(map(targets, (function (t) { 17114 return (($0 = reduce(map(targets, (function (t) {
16705 return t.get$returnType(); 17115 return t.get$returnType();
16706 }) 17116 })
16707 ), lang_Type.union, $globals.world.varType)) && $0.is$lang_Type()); 17117 ), lang_Type.union, $globals.world.varType)) == null ? null : $0.assert$lang_T ype());
16708 } 17118 }
16709 MemberSet.prototype._get$3 = function($0, $1, $2) { 17119 MemberSet.prototype._get$3 = function($0, $1, $2) {
16710 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false); 17120 return this._get(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == nul l ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), fals e);
16711 }; 17121 };
16712 MemberSet.prototype._set$4 = function($0, $1, $2, $3) { 17122 MemberSet.prototype._set$4 = function($0, $1, $2, $3) {
16713 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false); 17123 return this._set(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == nul l ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($3 == null ? null : $3.assert$Value()), false);
16714 }; 17124 };
16715 MemberSet.prototype.add$1 = function($0) { 17125 MemberSet.prototype.add$1 = function($0) {
16716 return this.add(($0 && $0.is$Member())); 17126 return this.add(($0 == null ? null : $0.assert$Member()));
16717 }; 17127 };
16718 MemberSet.prototype.canInvoke$2 = function($0, $1) { 17128 MemberSet.prototype.canInvoke$2 = function($0, $1) {
16719 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 17129 return this.canInvoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 = = null ? null : $1.assert$Arguments()));
16720 }; 17130 };
16721 MemberSet.prototype.invoke$4 = function($0, $1, $2, $3) { 17131 MemberSet.prototype.invoke$4 = function($0, $1, $2, $3) {
16722 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); 17132 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), false);
16723 }; 17133 };
16724 MemberSet.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 17134 MemberSet.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) {
16725 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); 17135 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), $assert_bool(isDynamic));
16726 }; 17136 };
16727 MemberSet.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 17137 MemberSet.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
16728 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); 17138 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()), $assert_bool($4));
16729 }; 17139 };
16730 MemberSet.prototype.toString$0 = MemberSet.prototype.toString; 17140 MemberSet.prototype.toString$0 = MemberSet.prototype.toString;
16731 // ********** Code for FactoryMap ************** 17141 // ********** Code for FactoryMap **************
16732 function FactoryMap() { 17142 function FactoryMap() {
16733 this.factories = $map([]); 17143 this.factories = $map([]);
16734 // Initializers done 17144 // Initializers done
16735 } 17145 }
16736 FactoryMap.prototype.getFactoriesFor = function(typeName) { 17146 FactoryMap.prototype.getFactoriesFor = function(typeName) {
16737 var ret = this.factories.$index(typeName); 17147 var ret = this.factories.$index(typeName);
16738 if ($notnull_bool(ret == null)) { 17148 if ($notnull_bool(ret == null)) {
16739 ret = $map([]); 17149 ret = $map([]);
16740 this.factories.$setindex(typeName, ret); 17150 this.factories.$setindex(typeName, ret);
16741 } 17151 }
16742 return (ret && ret.is$Map_String$Member()); 17152 return (ret == null ? null : ret.assert$Map_String$Member());
16743 } 17153 }
16744 FactoryMap.prototype.addFactory = function(typeName, name, member) { 17154 FactoryMap.prototype.addFactory = function(typeName, name, member) {
16745 this.getFactoriesFor(typeName).$setindex(name, member); 17155 this.getFactoriesFor(typeName).$setindex(name, member);
16746 } 17156 }
16747 FactoryMap.prototype.getFactory = function(typeName, name) { 17157 FactoryMap.prototype.getFactory = function(typeName, name) {
16748 var $0; 17158 var $0;
16749 return (($0 = this.getFactoriesFor(typeName).$index(name)) && $0.is$Member()); 17159 return (($0 = this.getFactoriesFor(typeName).$index(name)) == null ? null : $0 .assert$Member());
16750 } 17160 }
16751 FactoryMap.prototype.forEach = function(f) { 17161 FactoryMap.prototype.forEach = function(f) {
16752 this.factories.forEach((function (_, constructors) { 17162 this.factories.forEach((function (_, constructors) {
16753 constructors.forEach((function (_, member) { 17163 constructors.forEach((function (_, member) {
16754 f(member); 17164 f(member);
16755 }) 17165 })
16756 ); 17166 );
16757 }) 17167 })
16758 ); 17168 );
16759 } 17169 }
16760 FactoryMap.prototype.forEach$1 = function($0) { 17170 FactoryMap.prototype.forEach$1 = function($0) {
16761 return this.forEach(to$call$1($0)); 17171 return this.forEach(to$call$1($0));
16762 }; 17172 };
16763 FactoryMap.prototype.getFactory$2 = function($0, $1) { 17173 FactoryMap.prototype.getFactory$2 = function($0, $1) {
16764 return this.getFactory($assert_String($0), $assert_String($1)); 17174 return this.getFactory($assert_String($0), $assert_String($1));
16765 }; 17175 };
16766 // ********** Code for lang_Token ************** 17176 // ********** Code for lang_Token **************
16767 function lang_Token(kind, source, start, end) { 17177 function lang_Token(kind, source, start, end) {
16768 this.kind = kind; 17178 this.kind = kind;
16769 this.source = source; 17179 this.source = source;
16770 this.start = start; 17180 this.start = start;
16771 this.end = end; 17181 this.end = end;
16772 // Initializers done 17182 // Initializers done
16773 } 17183 }
16774 lang_Token.prototype.is$lang_Token = function(){return this;}; 17184 lang_Token.prototype.assert$lang_Token = function(){return this};
16775 lang_Token.prototype.get$kind = function() { return this.kind; }; 17185 lang_Token.prototype.get$kind = function() { return this.kind; };
16776 lang_Token.prototype.get$source = function() { return this.source; }; 17186 lang_Token.prototype.get$source = function() { return this.source; };
16777 lang_Token.prototype.get$end = function() { return this.end; }; 17187 lang_Token.prototype.get$end = function() { return this.end; };
16778 lang_Token.prototype.get$start = function() { return this.start; }; 17188 lang_Token.prototype.get$start = function() { return this.start; };
16779 lang_Token.prototype.get$text = function() { 17189 lang_Token.prototype.get$text = function() {
16780 return this.source.get$text().substring(this.start, this.end); 17190 return this.source.get$text().substring(this.start, this.end);
16781 } 17191 }
16782 lang_Token.prototype.toString = function() { 17192 lang_Token.prototype.toString = function() {
16783 var kindText = TokenKind.kindToString(this.kind); 17193 var kindText = TokenKind.kindToString(this.kind);
16784 var actualText = this.get$text(); 17194 var actualText = this.get$text();
(...skipping 10 matching lines...) Expand all
16795 lang_Token.prototype.get$span = function() { 17205 lang_Token.prototype.get$span = function() {
16796 return new SourceSpan(this.source, this.start, this.end); 17206 return new SourceSpan(this.source, this.start, this.end);
16797 } 17207 }
16798 lang_Token.prototype.toString$0 = lang_Token.prototype.toString; 17208 lang_Token.prototype.toString$0 = lang_Token.prototype.toString;
16799 // ********** Code for SourceFile ************** 17209 // ********** Code for SourceFile **************
16800 function SourceFile(filename, _text) { 17210 function SourceFile(filename, _text) {
16801 this.filename = filename; 17211 this.filename = filename;
16802 this._text = _text; 17212 this._text = _text;
16803 // Initializers done 17213 // Initializers done
16804 } 17214 }
16805 SourceFile.prototype.is$SourceFile = function(){return this;}; 17215 SourceFile.prototype.assert$SourceFile = function(){return this};
16806 SourceFile.prototype.is$Comparable = function(){return this;}; 17216 SourceFile.prototype.assert$Comparable = function(){return this};
16807 SourceFile.prototype.get$filename = function() { return this.filename; }; 17217 SourceFile.prototype.get$filename = function() { return this.filename; };
16808 SourceFile.prototype.get$orderInLibrary = function() { return this.orderInLibrar y; }; 17218 SourceFile.prototype.get$orderInLibrary = function() { return this.orderInLibrar y; };
16809 SourceFile.prototype.set$orderInLibrary = function(value) { return this.orderInL ibrary = value; }; 17219 SourceFile.prototype.set$orderInLibrary = function(value) { return this.orderInL ibrary = value; };
16810 SourceFile.prototype.get$text = function() { 17220 SourceFile.prototype.get$text = function() {
16811 return this._text; 17221 return this._text;
16812 } 17222 }
16813 SourceFile.prototype.get$lineStarts = function() { 17223 SourceFile.prototype.get$lineStarts = function() {
16814 if (this._lineStarts == null) { 17224 if (this._lineStarts == null) {
16815 var starts = [0]; 17225 var starts = [0];
16816 var index = 0; 17226 var index = 0;
16817 while (index < this.get$text().length) { 17227 while (index < this.get$text().length) {
16818 index = this.get$text().indexOf('\n', $assert_num(index)) + 1; 17228 index = this.get$text().indexOf('\n', $assert_num(index)) + 1;
16819 if (index <= 0) break; 17229 if (index <= 0) break;
16820 starts.add$1(index); 17230 starts.add$1(index);
16821 } 17231 }
16822 starts.add$1(this.get$text().length + 1); 17232 starts.add$1(this.get$text().length + 1);
16823 this._lineStarts = (starts && starts.is$List_int()); 17233 this._lineStarts = (starts == null ? null : starts.assert$List_int());
16824 } 17234 }
16825 return this._lineStarts; 17235 return this._lineStarts;
16826 } 17236 }
16827 SourceFile.prototype.getLine = function(position) { 17237 SourceFile.prototype.getLine = function(position) {
16828 var starts = this.get$lineStarts(); 17238 var starts = this.get$lineStarts();
16829 for (var i = 0; 17239 for (var i = 0;
16830 i < $assert_num(starts.length); i++) { 17240 i < $assert_num(starts.length); i++) {
16831 if (starts.$index(i) > position) return i - 1; 17241 if (starts.$index(i) > position) return i - 1;
16832 } 17242 }
16833 $globals.world.internalError('bad position'); 17243 $globals.world.internalError('bad position');
(...skipping 28 matching lines...) Expand all
16862 } 17272 }
16863 SourceFile.prototype.compareTo = function(other) { 17273 SourceFile.prototype.compareTo = function(other) {
16864 if (this.orderInLibrary != null && other.orderInLibrary != null) { 17274 if (this.orderInLibrary != null && other.orderInLibrary != null) {
16865 return this.orderInLibrary - other.orderInLibrary; 17275 return this.orderInLibrary - other.orderInLibrary;
16866 } 17276 }
16867 else { 17277 else {
16868 return this.filename.compareTo(other.filename); 17278 return this.filename.compareTo(other.filename);
16869 } 17279 }
16870 } 17280 }
16871 SourceFile.prototype.compareTo$1 = function($0) { 17281 SourceFile.prototype.compareTo$1 = function($0) {
16872 return this.compareTo(($0 && $0.is$SourceFile())); 17282 return this.compareTo(($0 == null ? null : $0.assert$SourceFile()));
16873 }; 17283 };
16874 SourceFile.prototype.getColumn$2 = function($0, $1) { 17284 SourceFile.prototype.getColumn$2 = function($0, $1) {
16875 return this.getColumn($assert_num($0), $assert_num($1)); 17285 return this.getColumn($assert_num($0), $assert_num($1));
16876 }; 17286 };
16877 SourceFile.prototype.getLine$1 = function($0) { 17287 SourceFile.prototype.getLine$1 = function($0) {
16878 return this.getLine($assert_num($0)); 17288 return this.getLine($assert_num($0));
16879 }; 17289 };
16880 SourceFile.prototype.getLocationMessage$4 = function($0, $1, $2, $3) { 17290 SourceFile.prototype.getLocationMessage$4 = function($0, $1, $2, $3) {
16881 return this.getLocationMessage($assert_String($0), $assert_num($1), $assert_nu m($2), $assert_bool($3)); 17291 return this.getLocationMessage($assert_String($0), $assert_num($1), $assert_nu m($2), $assert_bool($3));
16882 }; 17292 };
16883 // ********** Code for SourceSpan ************** 17293 // ********** Code for SourceSpan **************
16884 function SourceSpan(file, start, end) { 17294 function SourceSpan(file, start, end) {
16885 this.file = file; 17295 this.file = file;
16886 this.start = start; 17296 this.start = start;
16887 this.end = end; 17297 this.end = end;
16888 // Initializers done 17298 // Initializers done
16889 } 17299 }
16890 SourceSpan.prototype.is$SourceSpan = function(){return this;}; 17300 SourceSpan.prototype.assert$SourceSpan = function(){return this};
16891 SourceSpan.prototype.is$Comparable = function(){return this;}; 17301 SourceSpan.prototype.assert$Comparable = function(){return this};
16892 SourceSpan.prototype.get$file = function() { return this.file; }; 17302 SourceSpan.prototype.get$file = function() { return this.file; };
16893 SourceSpan.prototype.get$start = function() { return this.start; }; 17303 SourceSpan.prototype.get$start = function() { return this.start; };
16894 SourceSpan.prototype.get$end = function() { return this.end; }; 17304 SourceSpan.prototype.get$end = function() { return this.end; };
16895 SourceSpan.prototype.get$text = function() { 17305 SourceSpan.prototype.get$text = function() {
16896 return this.file.get$text().substring(this.start, this.end); 17306 return this.file.get$text().substring(this.start, this.end);
16897 } 17307 }
16898 SourceSpan.prototype.toMessageString = function(message) { 17308 SourceSpan.prototype.toMessageString = function(message) {
16899 return this.file.getLocationMessage(message, this.start, this.end, true); 17309 return this.file.getLocationMessage(message, this.start, this.end, true);
16900 } 17310 }
16901 SourceSpan.prototype.get$locationText = function() { 17311 SourceSpan.prototype.get$locationText = function() {
16902 var line = this.file.getLine(this.start); 17312 var line = this.file.getLine(this.start);
16903 var column = this.file.getColumn($assert_num(line), this.start); 17313 var column = this.file.getColumn($assert_num(line), this.start);
16904 return ('' + this.file.filename + ':' + (line + 1) + ':' + (column + 1)); 17314 return ('' + this.file.filename + ':' + (line + 1) + ':' + (column + 1));
16905 } 17315 }
16906 SourceSpan.prototype.compareTo = function(other) { 17316 SourceSpan.prototype.compareTo = function(other) {
16907 if ($eq(this.file, other.file)) { 17317 if ($eq(this.file, other.file)) {
16908 var d = this.start - other.start; 17318 var d = this.start - other.start;
16909 return d == 0 ? (this.end - other.end) : d; 17319 return d == 0 ? (this.end - other.end) : d;
16910 } 17320 }
16911 return this.file.compareTo(other.file); 17321 return this.file.compareTo(other.file);
16912 } 17322 }
16913 SourceSpan.prototype.compareTo$1 = function($0) { 17323 SourceSpan.prototype.compareTo$1 = function($0) {
16914 return this.compareTo(($0 && $0.is$SourceSpan())); 17324 return this.compareTo(($0 == null ? null : $0.assert$SourceSpan()));
16915 }; 17325 };
16916 SourceSpan.prototype.toMessageString$1 = function($0) { 17326 SourceSpan.prototype.toMessageString$1 = function($0) {
16917 return this.toMessageString($assert_String($0)); 17327 return this.toMessageString($assert_String($0));
16918 }; 17328 };
16919 // ********** Code for InterpStack ************** 17329 // ********** Code for InterpStack **************
16920 function InterpStack(previous, quote, isMultiline) { 17330 function InterpStack(previous, quote, isMultiline) {
16921 this.previous = previous; 17331 this.previous = previous;
16922 this.quote = quote; 17332 this.quote = quote;
16923 this.isMultiline = isMultiline; 17333 this.isMultiline = isMultiline;
16924 this.depth = -1; 17334 this.depth = -1;
16925 // Initializers done 17335 // Initializers done
16926 } 17336 }
16927 InterpStack.prototype.is$InterpStack = function(){return this;}; 17337 InterpStack.prototype.assert$InterpStack = function(){return this};
16928 InterpStack.prototype.get$previous = function() { return this.previous; }; 17338 InterpStack.prototype.get$previous = function() { return this.previous; };
16929 InterpStack.prototype.set$previous = function(value) { return this.previous = va lue; }; 17339 InterpStack.prototype.set$previous = function(value) { return this.previous = va lue; };
16930 InterpStack.prototype.get$quote = function() { return this.quote; }; 17340 InterpStack.prototype.get$quote = function() { return this.quote; };
16931 InterpStack.prototype.get$isMultiline = function() { return this.isMultiline; }; 17341 InterpStack.prototype.get$isMultiline = function() { return this.isMultiline; };
16932 InterpStack.prototype.get$depth = function() { return this.depth; }; 17342 InterpStack.prototype.get$depth = function() { return this.depth; };
16933 InterpStack.prototype.set$depth = function(value) { return this.depth = value; } ; 17343 InterpStack.prototype.set$depth = function(value) { return this.depth = value; } ;
16934 InterpStack.prototype.pop = function() { 17344 InterpStack.prototype.pop = function() {
16935 return this.previous; 17345 return this.previous;
16936 } 17346 }
16937 InterpStack.push = function(stack, quote, isMultiline) { 17347 InterpStack.push = function(stack, quote, isMultiline) {
16938 var newStack = new InterpStack(stack, quote, isMultiline); 17348 var newStack = new InterpStack(stack, quote, isMultiline);
16939 if (stack != null) newStack.set$previous(stack); 17349 if (stack != null) newStack.set$previous(stack);
16940 return (newStack && newStack.is$InterpStack()); 17350 return (newStack == null ? null : newStack.assert$InterpStack());
16941 } 17351 }
16942 InterpStack.prototype.next$0 = function() { 17352 InterpStack.prototype.next$0 = function() {
16943 return this.next(); 17353 return this.next();
16944 }; 17354 };
16945 // ********** Code for TokenizerBase ************** 17355 // ********** Code for TokenizerBase **************
16946 function TokenizerBase(_source, _skipWhitespace, index) { 17356 function TokenizerBase(_source, _skipWhitespace, index) {
16947 this._source = _source; 17357 this._source = _source;
16948 this._skipWhitespace = _skipWhitespace; 17358 this._skipWhitespace = _skipWhitespace;
16949 this._lang_index = index; 17359 this._lang_index = index;
16950 // Initializers done 17360 // Initializers done
(...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after
18649 // ********** Code for lang_Parser ************** 19059 // ********** Code for lang_Parser **************
18650 function lang_Parser(source, diet, throwOnIncomplete, optionalSemicolons, startO ffset) { 19060 function lang_Parser(source, diet, throwOnIncomplete, optionalSemicolons, startO ffset) {
18651 var $0; 19061 var $0;
18652 this._afterParensIndex = 0 19062 this._afterParensIndex = 0
18653 this.source = source; 19063 this.source = source;
18654 this.diet = diet; 19064 this.diet = diet;
18655 this.throwOnIncomplete = throwOnIncomplete; 19065 this.throwOnIncomplete = throwOnIncomplete;
18656 this.optionalSemicolons = optionalSemicolons; 19066 this.optionalSemicolons = optionalSemicolons;
18657 // Initializers done 19067 // Initializers done
18658 this.tokenizer = new Tokenizer(this.source, true, startOffset); 19068 this.tokenizer = new Tokenizer(this.source, true, startOffset);
18659 this._peekToken = (($0 = this.tokenizer.next()) && $0.is$lang_Token()); 19069 this._peekToken = (($0 = this.tokenizer.next()) == null ? null : $0.assert$lan g_Token());
18660 this._previousToken = null; 19070 this._previousToken = null;
18661 this._inInitializers = false; 19071 this._inInitializers = false;
18662 this._afterParens = []; 19072 this._afterParens = [];
18663 } 19073 }
18664 lang_Parser.prototype.get$source = function() { return this.source; }; 19074 lang_Parser.prototype.get$source = function() { return this.source; };
18665 lang_Parser.prototype.isPrematureEndOfFile = function() { 19075 lang_Parser.prototype.isPrematureEndOfFile = function() {
18666 if ($notnull_bool(this.throwOnIncomplete) && $notnull_bool(this._maybeEat(1/*T okenKind.END_OF_FILE*/)) || $notnull_bool(this._maybeEat(68/*TokenKind.INCOMPLET E_MULTILINE_STRING_DQ*/)) || $notnull_bool(this._maybeEat(69/*TokenKind.INCOMPLE TE_MULTILINE_STRING_SQ*/))) { 19076 if ($notnull_bool(this.throwOnIncomplete) && $notnull_bool(this._maybeEat(1/*T okenKind.END_OF_FILE*/)) || $notnull_bool(this._maybeEat(68/*TokenKind.INCOMPLET E_MULTILINE_STRING_DQ*/)) || $notnull_bool(this._maybeEat(69/*TokenKind.INCOMPLE TE_MULTILINE_STRING_SQ*/))) {
18667 $throw(new IncompleteSourceException(this._previousToken)); 19077 $throw(new IncompleteSourceException(this._previousToken));
18668 } 19078 }
18669 else if ($notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) { 19079 else if ($notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) {
18670 this._lang_error('unexpected end of file', this._peekToken.get$span()); 19080 this._lang_error('unexpected end of file', this._peekToken.get$span());
18671 return true; 19081 return true;
18672 } 19082 }
18673 else { 19083 else {
18674 return false; 19084 return false;
18675 } 19085 }
18676 } 19086 }
18677 lang_Parser.prototype._peek = function() { 19087 lang_Parser.prototype._peek = function() {
18678 return this._peekToken.kind; 19088 return this._peekToken.kind;
18679 } 19089 }
18680 lang_Parser.prototype._lang_next = function() { 19090 lang_Parser.prototype._lang_next = function() {
18681 var $0; 19091 var $0;
18682 this._previousToken = this._peekToken; 19092 this._previousToken = this._peekToken;
18683 this._peekToken = (($0 = this.tokenizer.next()) && $0.is$lang_Token()); 19093 this._peekToken = (($0 = this.tokenizer.next()) == null ? null : $0.assert$lan g_Token());
18684 return this._previousToken; 19094 return this._previousToken;
18685 } 19095 }
18686 lang_Parser.prototype._peekKind = function(kind) { 19096 lang_Parser.prototype._peekKind = function(kind) {
18687 return this._peekToken.kind == kind; 19097 return this._peekToken.kind == kind;
18688 } 19098 }
18689 lang_Parser.prototype._peekIdentifier = function() { 19099 lang_Parser.prototype._peekIdentifier = function() {
18690 return TokenKind.isIdentifier(this._peekToken.kind); 19100 return TokenKind.isIdentifier(this._peekToken.kind);
18691 } 19101 }
18692 lang_Parser.prototype._maybeEat = function(kind) { 19102 lang_Parser.prototype._maybeEat = function(kind) {
18693 var $0; 19103 var $0;
18694 if (this._peekToken.kind == kind) { 19104 if (this._peekToken.kind == kind) {
18695 this._previousToken = this._peekToken; 19105 this._previousToken = this._peekToken;
18696 this._peekToken = (($0 = this.tokenizer.next()) && $0.is$lang_Token()); 19106 this._peekToken = (($0 = this.tokenizer.next()) == null ? null : $0.assert$l ang_Token());
18697 return true; 19107 return true;
18698 } 19108 }
18699 else { 19109 else {
18700 return false; 19110 return false;
18701 } 19111 }
18702 } 19112 }
18703 lang_Parser.prototype._eat = function(kind) { 19113 lang_Parser.prototype._eat = function(kind) {
18704 if (!$notnull_bool(this._maybeEat(kind))) { 19114 if (!$notnull_bool(this._maybeEat(kind))) {
18705 this._errorExpected(TokenKind.kindToString(kind)); 19115 this._errorExpected(TokenKind.kindToString(kind));
18706 } 19116 }
18707 } 19117 }
18708 lang_Parser.prototype._eatSemicolon = function() { 19118 lang_Parser.prototype._eatSemicolon = function() {
18709 if ($notnull_bool(this.optionalSemicolons) && $notnull_bool(this._peekKind(1/* TokenKind.END_OF_FILE*/))) return; 19119 if ($notnull_bool(this.optionalSemicolons) && $notnull_bool(this._peekKind(1/* TokenKind.END_OF_FILE*/))) return;
18710 this._eat(10/*TokenKind.SEMICOLON*/); 19120 this._eat(10/*TokenKind.SEMICOLON*/);
18711 } 19121 }
18712 lang_Parser.prototype._errorExpected = function(expected) { 19122 lang_Parser.prototype._errorExpected = function(expected) {
18713 var $0; 19123 var $0;
18714 if ($notnull_bool(this.throwOnIncomplete)) this.isPrematureEndOfFile(); 19124 if ($notnull_bool(this.throwOnIncomplete)) this.isPrematureEndOfFile();
18715 var tok = this._lang_next(); 19125 var tok = this._lang_next();
18716 var message = ('expected ' + expected + ', but found ' + tok); 19126 var message = ('expected ' + expected + ', but found ' + tok);
18717 this._lang_error($assert_String(message), (($0 = tok.get$span()) && $0.is$Sour ceSpan())); 19127 this._lang_error($assert_String(message), (($0 = tok.get$span()) == null ? nul l : $0.assert$SourceSpan()));
18718 } 19128 }
18719 lang_Parser.prototype._lang_error = function(message, location) { 19129 lang_Parser.prototype._lang_error = function(message, location) {
18720 if (location == null) { 19130 if (location == null) {
18721 location = this._peekToken.get$span(); 19131 location = this._peekToken.get$span();
18722 } 19132 }
18723 $globals.world.fatal(message, location); 19133 $globals.world.fatal(message, location);
18724 } 19134 }
18725 lang_Parser.prototype._skipBlock = function() { 19135 lang_Parser.prototype._skipBlock = function() {
18726 var $0; 19136 var $0;
18727 var depth = 1; 19137 var depth = 1;
18728 this._eat(6/*TokenKind.LBRACE*/); 19138 this._eat(6/*TokenKind.LBRACE*/);
18729 while (true) { 19139 while (true) {
18730 var tok = this._lang_next(); 19140 var tok = this._lang_next();
18731 if ($notnull_bool($eq(tok.get$kind(), 6/*TokenKind.LBRACE*/))) { 19141 if ($notnull_bool($eq(tok.get$kind(), 6/*TokenKind.LBRACE*/))) {
18732 depth += 1; 19142 depth += 1;
18733 } 19143 }
18734 else if ($notnull_bool($eq(tok.get$kind(), 7/*TokenKind.RBRACE*/))) { 19144 else if ($notnull_bool($eq(tok.get$kind(), 7/*TokenKind.RBRACE*/))) {
18735 depth -= 1; 19145 depth -= 1;
18736 if (depth == 0) return; 19146 if (depth == 0) return;
18737 } 19147 }
18738 else if ($notnull_bool($eq(tok.get$kind(), 1/*TokenKind.END_OF_FILE*/))) { 19148 else if ($notnull_bool($eq(tok.get$kind(), 1/*TokenKind.END_OF_FILE*/))) {
18739 this._lang_error('unexpected end of file during diet parse', (($0 = tok.ge t$span()) && $0.is$SourceSpan())); 19149 this._lang_error('unexpected end of file during diet parse', (($0 = tok.ge t$span()) == null ? null : $0.assert$SourceSpan()));
18740 return; 19150 return;
18741 } 19151 }
18742 } 19152 }
18743 } 19153 }
18744 lang_Parser.prototype._makeSpan = function(start) { 19154 lang_Parser.prototype._makeSpan = function(start) {
18745 return new SourceSpan(this.source, start, this._previousToken.end); 19155 return new SourceSpan(this.source, start, this._previousToken.end);
18746 } 19156 }
18747 lang_Parser.prototype.compilationUnit = function() { 19157 lang_Parser.prototype.compilationUnit = function() {
18748 var ret = []; 19158 var ret = [];
18749 this._maybeEat(13/*TokenKind.HASHBANG*/); 19159 this._maybeEat(13/*TokenKind.HASHBANG*/);
18750 while ($notnull_bool(this._peekKind(12/*TokenKind.HASH*/))) { 19160 while ($notnull_bool(this._peekKind(12/*TokenKind.HASH*/))) {
18751 ret.add$1(this.directive()); 19161 ret.add$1(this.directive());
18752 } 19162 }
18753 while (!$notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) { 19163 while (!$notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) {
18754 ret.add$1(this.topLevelDefinition()); 19164 ret.add$1(this.topLevelDefinition());
18755 } 19165 }
18756 return (ret && ret.is$List_Definition()); 19166 return (ret == null ? null : ret.assert$List_Definition());
18757 } 19167 }
18758 lang_Parser.prototype.directive = function() { 19168 lang_Parser.prototype.directive = function() {
18759 var start = this._peekToken.start; 19169 var start = this._peekToken.start;
18760 this._eat(12/*TokenKind.HASH*/); 19170 this._eat(12/*TokenKind.HASH*/);
18761 var name = this.identifier(); 19171 var name = this.identifier();
18762 var args = this.arguments(); 19172 var args = this.arguments();
18763 this._eatSemicolon(); 19173 this._eatSemicolon();
18764 return new DirectiveDefinition(name, args, this._makeSpan(start)); 19174 return new DirectiveDefinition(name, args, this._makeSpan(start));
18765 } 19175 }
18766 lang_Parser.prototype.topLevelDefinition = function() { 19176 lang_Parser.prototype.topLevelDefinition = function() {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
18926 return null; 19336 return null;
18927 19337
18928 } 19338 }
18929 } 19339 }
18930 lang_Parser.prototype.declaration = function(includeOperators) { 19340 lang_Parser.prototype.declaration = function(includeOperators) {
18931 var start = this._peekToken.start; 19341 var start = this._peekToken.start;
18932 if ($notnull_bool(this._peekKind(75/*TokenKind.FACTORY*/))) { 19342 if ($notnull_bool(this._peekKind(75/*TokenKind.FACTORY*/))) {
18933 return this.factoryConstructorDeclaration(); 19343 return this.factoryConstructorDeclaration();
18934 } 19344 }
18935 var modifiers = this._readModifiers(); 19345 var modifiers = this._readModifiers();
18936 return this.finishDefinition(start, (modifiers && modifiers.is$List_Token()), this.declaredIdentifier(includeOperators), null); 19346 return this.finishDefinition(start, (modifiers == null ? null : modifiers.asse rt$List_Token()), this.declaredIdentifier(includeOperators), null);
18937 } 19347 }
18938 lang_Parser.prototype.factoryConstructorDeclaration = function() { 19348 lang_Parser.prototype.factoryConstructorDeclaration = function() {
18939 var $0; 19349 var $0;
18940 var start = this._peekToken.start; 19350 var start = this._peekToken.start;
18941 var factoryToken = this._lang_next(); 19351 var factoryToken = this._lang_next();
18942 var names = [this.identifier()]; 19352 var names = [this.identifier()];
18943 while ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) { 19353 while ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) {
18944 names.add$1(this.identifier()); 19354 names.add$1(this.identifier());
18945 } 19355 }
18946 var typeParams = null; 19356 var typeParams = null;
18947 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) { 19357 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
18948 typeParams = this.typeParameters(); 19358 typeParams = this.typeParameters();
18949 } 19359 }
18950 var name = null; 19360 var name = null;
18951 var type = null; 19361 var type = null;
18952 if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) { 19362 if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) {
18953 name = this.identifier(); 19363 name = this.identifier();
18954 } 19364 }
18955 else if ($notnull_bool(typeParams == null)) { 19365 else if ($notnull_bool(typeParams == null)) {
18956 if (names.length > 1) { 19366 if (names.length > 1) {
18957 name = names.removeLast$0(); 19367 name = names.removeLast$0();
18958 } 19368 }
18959 else { 19369 else {
18960 name = new lang_Identifier('', (($0 = names.$index(0).get$span()) && $0.is $SourceSpan())); 19370 name = new lang_Identifier('', (($0 = names.$index(0).get$span()) == null ? null : $0.assert$SourceSpan()));
18961 } 19371 }
18962 } 19372 }
18963 else { 19373 else {
18964 name = new lang_Identifier('', (($0 = names.$index(0).get$span()) && $0.is$S ourceSpan())); 19374 name = new lang_Identifier('', (($0 = names.$index(0).get$span()) == null ? null : $0.assert$SourceSpan()));
18965 } 19375 }
18966 if (names.length > 1) { 19376 if (names.length > 1) {
18967 this._lang_error('unsupported qualified name for factory', (($0 = names.$ind ex(0).get$span()) && $0.is$SourceSpan())); 19377 this._lang_error('unsupported qualified name for factory', (($0 = names.$ind ex(0).get$span()) == null ? null : $0.assert$SourceSpan()));
18968 } 19378 }
18969 type = new NameTypeReference(false, names.$index(0), null, (($0 = names.$index (0).get$span()) && $0.is$SourceSpan())); 19379 type = new NameTypeReference(false, names.$index(0), null, (($0 = names.$index (0).get$span()) == null ? null : $0.assert$SourceSpan()));
18970 var di = new DeclaredIdentifier(type, name, this._makeSpan(start)); 19380 var di = new DeclaredIdentifier(type, name, this._makeSpan(start));
18971 return this.finishDefinition(start, [factoryToken], di, (typeParams && typePar ams.is$List_ParameterType())); 19381 return this.finishDefinition(start, [factoryToken], di, (typeParams == null ? null : typeParams.assert$List_ParameterType()));
18972 } 19382 }
18973 lang_Parser.prototype.statement = function() { 19383 lang_Parser.prototype.statement = function() {
18974 var $0; 19384 var $0;
18975 switch (this._peek()) { 19385 switch (this._peek()) {
18976 case 88/*TokenKind.BREAK*/: 19386 case 88/*TokenKind.BREAK*/:
18977 19387
18978 return (($0 = this.breakStatement()) && $0.is$lang_Statement()); 19388 return (($0 = this.breakStatement()) == null ? null : $0.assert$lang_State ment());
18979 19389
18980 case 92/*TokenKind.CONTINUE*/: 19390 case 92/*TokenKind.CONTINUE*/:
18981 19391
18982 return (($0 = this.continueStatement()) && $0.is$lang_Statement()); 19392 return (($0 = this.continueStatement()) == null ? null : $0.assert$lang_St atement());
18983 19393
18984 case 105/*TokenKind.RETURN*/: 19394 case 105/*TokenKind.RETURN*/:
18985 19395
18986 return (($0 = this.returnStatement()) && $0.is$lang_Statement()); 19396 return (($0 = this.returnStatement()) == null ? null : $0.assert$lang_Stat ement());
18987 19397
18988 case 109/*TokenKind.THROW*/: 19398 case 109/*TokenKind.THROW*/:
18989 19399
18990 return (($0 = this.throwStatement()) && $0.is$lang_Statement()); 19400 return (($0 = this.throwStatement()) == null ? null : $0.assert$lang_State ment());
18991 19401
18992 case 72/*TokenKind.ASSERT*/: 19402 case 72/*TokenKind.ASSERT*/:
18993 19403
18994 return (($0 = this.assertStatement()) && $0.is$lang_Statement()); 19404 return (($0 = this.assertStatement()) == null ? null : $0.assert$lang_Stat ement());
18995 19405
18996 case 114/*TokenKind.WHILE*/: 19406 case 114/*TokenKind.WHILE*/:
18997 19407
18998 return this.whileStatement(); 19408 return this.whileStatement();
18999 19409
19000 case 94/*TokenKind.DO*/: 19410 case 94/*TokenKind.DO*/:
19001 19411
19002 return this.doStatement(); 19412 return this.doStatement();
19003 19413
19004 case 99/*TokenKind.FOR*/: 19414 case 99/*TokenKind.FOR*/:
19005 19415
19006 return (($0 = this.forStatement()) && $0.is$lang_Statement()); 19416 return (($0 = this.forStatement()) == null ? null : $0.assert$lang_Stateme nt());
19007 19417
19008 case 100/*TokenKind.IF*/: 19418 case 100/*TokenKind.IF*/:
19009 19419
19010 return this.ifStatement(); 19420 return this.ifStatement();
19011 19421
19012 case 107/*TokenKind.SWITCH*/: 19422 case 107/*TokenKind.SWITCH*/:
19013 19423
19014 return (($0 = this.switchStatement()) && $0.is$lang_Statement()); 19424 return (($0 = this.switchStatement()) == null ? null : $0.assert$lang_Stat ement());
19015 19425
19016 case 111/*TokenKind.TRY*/: 19426 case 111/*TokenKind.TRY*/:
19017 19427
19018 return (($0 = this.tryStatement()) && $0.is$lang_Statement()); 19428 return (($0 = this.tryStatement()) == null ? null : $0.assert$lang_Stateme nt());
19019 19429
19020 case 6/*TokenKind.LBRACE*/: 19430 case 6/*TokenKind.LBRACE*/:
19021 19431
19022 return this.block(); 19432 return this.block();
19023 19433
19024 case 10/*TokenKind.SEMICOLON*/: 19434 case 10/*TokenKind.SEMICOLON*/:
19025 19435
19026 return this.emptyStatement(); 19436 return this.emptyStatement();
19027 19437
19028 case 97/*TokenKind.FINAL*/: 19438 case 97/*TokenKind.FINAL*/:
19029 19439
19030 return (($0 = this.declaration(false)) && $0.is$lang_Statement()); 19440 return (($0 = this.declaration(false)) == null ? null : $0.assert$lang_Sta tement());
19031 19441
19032 case 112/*TokenKind.VAR*/: 19442 case 112/*TokenKind.VAR*/:
19033 19443
19034 return (($0 = this.declaration(false)) && $0.is$lang_Statement()); 19444 return (($0 = this.declaration(false)) == null ? null : $0.assert$lang_Sta tement());
19035 19445
19036 default: 19446 default:
19037 19447
19038 return (($0 = this.finishExpressionAsStatement(this.expression())) && $0.i s$lang_Statement()); 19448 return (($0 = this.finishExpressionAsStatement(this.expression())) == null ? null : $0.assert$lang_Statement());
19039 19449
19040 } 19450 }
19041 } 19451 }
19042 lang_Parser.prototype.finishExpressionAsStatement = function(expr) { 19452 lang_Parser.prototype.finishExpressionAsStatement = function(expr) {
19043 var $0; 19453 var $0;
19044 var start = $assert_num(expr.get$span().get$start()); 19454 var start = $assert_num(expr.get$span().get$start());
19045 if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) { 19455 if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) {
19046 var label = this._makeLabel(expr); 19456 var label = this._makeLabel(expr);
19047 return new LabeledStatement(label, this.statement(), this._makeSpan(start)); 19457 return new LabeledStatement(label, this.statement(), this._makeSpan(start));
19048 } 19458 }
19049 if ((expr instanceof LambdaExpression)) { 19459 if ((expr instanceof LambdaExpression)) {
19050 if (!(expr.get$func().get$body() instanceof BlockStatement)) { 19460 if (!(expr.get$func().get$body() instanceof BlockStatement)) {
19051 this._eatSemicolon(); 19461 this._eatSemicolon();
19052 expr.get$func().set$span(this._makeSpan(start)); 19462 expr.get$func().set$span(this._makeSpan(start));
19053 } 19463 }
19054 return expr.get$func(); 19464 return expr.get$func();
19055 } 19465 }
19056 else if ((expr instanceof DeclaredIdentifier)) { 19466 else if ((expr instanceof DeclaredIdentifier)) {
19057 var value = null; 19467 var value = null;
19058 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { 19468 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
19059 value = this.expression(); 19469 value = this.expression();
19060 } 19470 }
19061 return this.finishField(start, null, null, expr.get$type(), expr.get$name(), value); 19471 return this.finishField(start, null, null, expr.get$type(), expr.get$name(), value);
19062 } 19472 }
19063 else if ($notnull_bool(this._isBin(expr, 20/*TokenKind.ASSIGN*/)) && ((expr.ge t$x() instanceof DeclaredIdentifier))) { 19473 else if ($notnull_bool(this._isBin(expr, 20/*TokenKind.ASSIGN*/)) && ((expr.ge t$x() instanceof DeclaredIdentifier))) {
19064 var di = (($0 = expr.get$x()) && $0.is$DeclaredIdentifier()); 19474 var di = (($0 = expr.get$x()) == null ? null : $0.assert$DeclaredIdentifier( ));
19065 return this.finishField(start, null, null, di.type, di.name, expr.get$y()); 19475 return this.finishField(start, null, null, di.type, di.name, expr.get$y());
19066 } 19476 }
19067 else if ($notnull_bool(this._isBin(expr, 52/*TokenKind.LT*/)) && $notnull_bool (this._maybeEat(11/*TokenKind.COMMA*/))) { 19477 else if ($notnull_bool(this._isBin(expr, 52/*TokenKind.LT*/)) && $notnull_bool (this._maybeEat(11/*TokenKind.COMMA*/))) {
19068 var baseType = this._makeType(expr.get$x()); 19478 var baseType = this._makeType(expr.get$x());
19069 var typeArgs = [this._makeType(expr.get$y())]; 19479 var typeArgs = [this._makeType(expr.get$y())];
19070 var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference()) , 0, typeArgs); 19480 var gt = this._finishTypeArguments((baseType == null ? null : baseType.asser t$TypeReference()), 0, typeArgs);
19071 var name = this.identifier(); 19481 var name = this.identifier();
19072 var value = null; 19482 var value = null;
19073 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { 19483 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
19074 value = this.expression(); 19484 value = this.expression();
19075 } 19485 }
19076 return this.finishField(expr.get$span().get$start(), null, null, gt, name, v alue); 19486 return this.finishField(expr.get$span().get$start(), null, null, gt, name, v alue);
19077 } 19487 }
19078 else { 19488 else {
19079 this._eatSemicolon(); 19489 this._eatSemicolon();
19080 return new lang_ExpressionStatement(expr, this._makeSpan($assert_num(expr.ge t$span().get$start()))); 19490 return new lang_ExpressionStatement(expr, this._makeSpan($assert_num(expr.ge t$span().get$start())));
19081 } 19491 }
19082 } 19492 }
19083 lang_Parser.prototype.testCondition = function() { 19493 lang_Parser.prototype.testCondition = function() {
19084 this._eatLeftParen(); 19494 this._eatLeftParen();
19085 var ret = this.expression(); 19495 var ret = this.expression();
19086 this._eat(3/*TokenKind.RPAREN*/); 19496 this._eat(3/*TokenKind.RPAREN*/);
19087 return (ret && ret.is$lang_Expression()); 19497 return (ret == null ? null : ret.assert$lang_Expression());
19088 } 19498 }
19089 lang_Parser.prototype.block = function() { 19499 lang_Parser.prototype.block = function() {
19090 var start = this._peekToken.start; 19500 var start = this._peekToken.start;
19091 this._eat(6/*TokenKind.LBRACE*/); 19501 this._eat(6/*TokenKind.LBRACE*/);
19092 var stmts = []; 19502 var stmts = [];
19093 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) { 19503 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) {
19094 if ($notnull_bool(this.isPrematureEndOfFile())) break; 19504 if ($notnull_bool(this.isPrematureEndOfFile())) break;
19095 stmts.add$1(this.statement()); 19505 stmts.add$1(this.statement());
19096 } 19506 }
19097 return new BlockStatement(stmts, this._makeSpan(start)); 19507 return new BlockStatement(stmts, this._makeSpan(start));
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
19156 var $0; 19566 var $0;
19157 if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) { 19567 if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) {
19158 return null; 19568 return null;
19159 } 19569 }
19160 else { 19570 else {
19161 var init = this.expression(); 19571 var init = this.expression();
19162 if ($notnull_bool(this._peekKind(11/*TokenKind.COMMA*/)) && $notnull_bool(th is._isBin(init, 52/*TokenKind.LT*/))) { 19572 if ($notnull_bool(this._peekKind(11/*TokenKind.COMMA*/)) && $notnull_bool(th is._isBin(init, 52/*TokenKind.LT*/))) {
19163 this._eat(11/*TokenKind.COMMA*/); 19573 this._eat(11/*TokenKind.COMMA*/);
19164 var baseType = this._makeType(init.get$x()); 19574 var baseType = this._makeType(init.get$x());
19165 var typeArgs = [this._makeType(init.get$y())]; 19575 var typeArgs = [this._makeType(init.get$y())];
19166 var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference( )), 0, typeArgs); 19576 var gt = this._finishTypeArguments((baseType == null ? null : baseType.ass ert$TypeReference()), 0, typeArgs);
19167 var name = this.identifier(); 19577 var name = this.identifier();
19168 init = new DeclaredIdentifier(gt, name, this._makeSpan($assert_num(init.ge t$span().get$start()))); 19578 init = new DeclaredIdentifier(gt, name, this._makeSpan($assert_num(init.ge t$span().get$start())));
19169 } 19579 }
19170 if ($notnull_bool(this._maybeEat(101/*TokenKind.IN*/))) { 19580 if ($notnull_bool(this._maybeEat(101/*TokenKind.IN*/))) {
19171 return this._finishForIn(start, (($0 = this._makeDeclaredIdentifier(init)) && $0.is$DeclaredIdentifier())); 19581 return this._finishForIn(start, (($0 = this._makeDeclaredIdentifier(init)) == null ? null : $0.assert$DeclaredIdentifier()));
19172 } 19582 }
19173 else { 19583 else {
19174 return this.finishExpressionAsStatement(init); 19584 return this.finishExpressionAsStatement(init);
19175 } 19585 }
19176 } 19586 }
19177 } 19587 }
19178 lang_Parser.prototype._finishForIn = function(start, di) { 19588 lang_Parser.prototype._finishForIn = function(start, di) {
19179 var expr = this.expression(); 19589 var expr = this.expression();
19180 this._eat(3/*TokenKind.RPAREN*/); 19590 this._eat(3/*TokenKind.RPAREN*/);
19181 var body = this.statement(); 19591 var body = this.statement();
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
19308 } 19718 }
19309 this._eatSemicolon(); 19719 this._eatSemicolon();
19310 return new ContinueStatement(name, this._makeSpan(start)); 19720 return new ContinueStatement(name, this._makeSpan(start));
19311 } 19721 }
19312 lang_Parser.prototype.expression = function() { 19722 lang_Parser.prototype.expression = function() {
19313 return this.infixExpression(0); 19723 return this.infixExpression(0);
19314 } 19724 }
19315 lang_Parser.prototype._makeType = function(expr) { 19725 lang_Parser.prototype._makeType = function(expr) {
19316 var $0; 19726 var $0;
19317 if ((expr instanceof VarExpression)) { 19727 if ((expr instanceof VarExpression)) {
19318 return new NameTypeReference(false, expr.get$name(), null, (($0 = expr.get$s pan()) && $0.is$SourceSpan())); 19728 return new NameTypeReference(false, expr.get$name(), null, (($0 = expr.get$s pan()) == null ? null : $0.assert$SourceSpan()));
19319 } 19729 }
19320 else if ((expr instanceof DotExpression)) { 19730 else if ((expr instanceof DotExpression)) {
19321 var type = this._makeType(expr.get$self()); 19731 var type = this._makeType(expr.get$self());
19322 if (type.get$names() == null) { 19732 if (type.get$names() == null) {
19323 type.set$names([expr.get$name()]); 19733 type.set$names([expr.get$name()]);
19324 } 19734 }
19325 else { 19735 else {
19326 type.get$names().add$1(expr.get$name()); 19736 type.get$names().add$1(expr.get$name());
19327 } 19737 }
19328 type.set$span(expr.get$span()); 19738 type.set$span(expr.get$span());
19329 return type; 19739 return type;
19330 } 19740 }
19331 else { 19741 else {
19332 this._lang_error('expected type reference'); 19742 this._lang_error('expected type reference');
19333 return null; 19743 return null;
19334 } 19744 }
19335 } 19745 }
19336 lang_Parser.prototype.infixExpression = function(precedence) { 19746 lang_Parser.prototype.infixExpression = function(precedence) {
19337 var $0; 19747 var $0;
19338 return this.finishInfixExpression((($0 = this.unaryExpression()) && $0.is$lang _Expression()), precedence); 19748 return this.finishInfixExpression((($0 = this.unaryExpression()) == null ? nul l : $0.assert$lang_Expression()), precedence);
19339 } 19749 }
19340 lang_Parser.prototype._finishDeclaredId = function(type) { 19750 lang_Parser.prototype._finishDeclaredId = function(type) {
19341 var name = this.identifier(); 19751 var name = this.identifier();
19342 return this.finishPostfixExpression(new DeclaredIdentifier(type, name, this._m akeSpan($assert_num(type.get$span().get$start())))); 19752 return this.finishPostfixExpression(new DeclaredIdentifier(type, name, this._m akeSpan($assert_num(type.get$span().get$start()))));
19343 } 19753 }
19344 lang_Parser.prototype._fixAsType = function(x) { 19754 lang_Parser.prototype._fixAsType = function(x) {
19345 $assert(this._isBin(x, 52/*TokenKind.LT*/), "_isBin(x, TokenKind.LT)", "parser .dart", 799, 12); 19755 $assert(this._isBin(x, 52/*TokenKind.LT*/), "_isBin(x, TokenKind.LT)", "parser .dart", 799, 12);
19346 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) { 19756 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) {
19347 var base = this._makeType(x.x); 19757 var base = this._makeType(x.x);
19348 var typeParam = this._makeType(x.y); 19758 var typeParam = this._makeType(x.y);
19349 var type = new GenericTypeReference(base, [typeParam], 0, this._makeSpan(x.s pan.start)); 19759 var type = new GenericTypeReference(base, [typeParam], 0, this._makeSpan(x.s pan.start));
19350 return this._finishDeclaredId(type); 19760 return this._finishDeclaredId(type);
19351 } 19761 }
19352 else { 19762 else {
19353 $assert(this._peekKind(52/*TokenKind.LT*/), "_peekKind(TokenKind.LT)", "pars er.dart", 810, 14); 19763 $assert(this._peekKind(52/*TokenKind.LT*/), "_peekKind(TokenKind.LT)", "pars er.dart", 810, 14);
19354 var base = this._makeType(x.x); 19764 var base = this._makeType(x.x);
19355 var paramBase = this._makeType(x.y); 19765 var paramBase = this._makeType(x.y);
19356 var firstParam = this.addTypeArguments((paramBase && paramBase.is$TypeRefere nce()), 1); 19766 var firstParam = this.addTypeArguments((paramBase == null ? null : paramBase .assert$TypeReference()), 1);
19357 var type; 19767 var type;
19358 if (firstParam.get$depth() <= 0) { 19768 if (firstParam.get$depth() <= 0) {
19359 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp an.start)); 19769 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp an.start));
19360 } 19770 }
19361 else if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 19771 else if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
19362 type = this._finishTypeArguments((base && base.is$TypeReference()), 0, [fi rstParam]); 19772 type = this._finishTypeArguments((base == null ? null : base.assert$TypeRe ference()), 0, [firstParam]);
19363 } 19773 }
19364 else { 19774 else {
19365 this._eat(53/*TokenKind.GT*/); 19775 this._eat(53/*TokenKind.GT*/);
19366 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp an.start)); 19776 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp an.start));
19367 } 19777 }
19368 return this._finishDeclaredId(type); 19778 return this._finishDeclaredId(type);
19369 } 19779 }
19370 } 19780 }
19371 lang_Parser.prototype.finishInfixExpression = function(x, precedence) { 19781 lang_Parser.prototype.finishInfixExpression = function(x, precedence) {
19372 while (true) { 19782 while (true) {
19373 var kind = this._peek(); 19783 var kind = this._peek();
19374 var prec = TokenKind.infixPrecedence(this._peek()); 19784 var prec = TokenKind.infixPrecedence(this._peek());
19375 if (prec >= precedence) { 19785 if (prec >= precedence) {
19376 if (kind == 52/*TokenKind.LT*/ || kind == 53/*TokenKind.GT*/) { 19786 if (kind == 52/*TokenKind.LT*/ || kind == 53/*TokenKind.GT*/) {
19377 if ($notnull_bool(this._isBin(x, 52/*TokenKind.LT*/))) { 19787 if ($notnull_bool(this._isBin(x, 52/*TokenKind.LT*/))) {
19378 return this._fixAsType((x && x.is$BinaryExpression())); 19788 return this._fixAsType((x == null ? null : x.assert$BinaryExpression() ));
19379 } 19789 }
19380 } 19790 }
19381 var op = this._lang_next(); 19791 var op = this._lang_next();
19382 if ($notnull_bool($eq(op.get$kind(), 102/*TokenKind.IS*/))) { 19792 if ($notnull_bool($eq(op.get$kind(), 102/*TokenKind.IS*/))) {
19383 var isTrue = !$notnull_bool(this._maybeEat(19/*TokenKind.NOT*/)); 19793 var isTrue = !$notnull_bool(this._maybeEat(19/*TokenKind.NOT*/));
19384 var typeRef = this.type(0); 19794 var typeRef = this.type(0);
19385 x = new IsExpression(isTrue, x, typeRef, this._makeSpan(x.span.start)); 19795 x = new IsExpression(isTrue, x, typeRef, this._makeSpan(x.span.start));
19386 continue; 19796 continue;
19387 } 19797 }
19388 var y = this.infixExpression($assert_num($notnull_bool($eq(prec, 2)) ? pre c : prec + 1)); 19798 var y = this.infixExpression($assert_num($notnull_bool($eq(prec, 2)) ? pre c : prec + 1));
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
19500 } 19910 }
19501 lang_Parser.prototype.finishCallOrLambdaExpression = function(expr) { 19911 lang_Parser.prototype.finishCallOrLambdaExpression = function(expr) {
19502 var $0; 19912 var $0;
19503 if ($notnull_bool(this._atClosureParameters())) { 19913 if ($notnull_bool(this._atClosureParameters())) {
19504 var formals = this.formalParameterList(); 19914 var formals = this.formalParameterList();
19505 var body = this.functionBody(true); 19915 var body = this.functionBody(true);
19506 return this._makeFunction(expr, formals, body); 19916 return this._makeFunction(expr, formals, body);
19507 } 19917 }
19508 else { 19918 else {
19509 if ((expr instanceof DeclaredIdentifier)) { 19919 if ((expr instanceof DeclaredIdentifier)) {
19510 this._lang_error('illegal target for call, did you mean to declare a funct ion?', (($0 = expr.get$span()) && $0.is$SourceSpan())); 19920 this._lang_error('illegal target for call, did you mean to declare a funct ion?', (($0 = expr.get$span()) == null ? null : $0.assert$SourceSpan()));
19511 } 19921 }
19512 var args = this.arguments(); 19922 var args = this.arguments();
19513 return this.finishPostfixExpression(new CallExpression(expr, args, this._mak eSpan($assert_num(expr.get$span().get$start())))); 19923 return this.finishPostfixExpression(new CallExpression(expr, args, this._mak eSpan($assert_num(expr.get$span().get$start()))));
19514 } 19924 }
19515 } 19925 }
19516 lang_Parser.prototype._isBin = function(expr, kind) { 19926 lang_Parser.prototype._isBin = function(expr, kind) {
19517 return (expr instanceof BinaryExpression) && $notnull_bool($eq(expr.get$op().g et$kind(), kind)); 19927 return (expr instanceof BinaryExpression) && $notnull_bool($eq(expr.get$op().g et$kind(), kind));
19518 } 19928 }
19519 lang_Parser.prototype._boolTypeRef = function(span) { 19929 lang_Parser.prototype._boolTypeRef = function(span) {
19520 return new TypeReference(span, $globals.world.nonNullBool); 19930 return new TypeReference(span, $globals.world.nonNullBool);
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
19646 startQuote = $add(endQuote, '\n'); 20056 startQuote = $add(endQuote, '\n');
19647 } 20057 }
19648 else { 20058 else {
19649 startQuote = endQuote = text.$index(0); 20059 startQuote = endQuote = text.$index(0);
19650 } 20060 }
19651 text = $add(text.substring$2(0, text.length - 1), endQuote); 20061 text = $add(text.substring$2(0, text.length - 1), endQuote);
19652 } 20062 }
19653 else { 20063 else {
19654 text = $add($add(startQuote, text.substring$2(0, text.length - 1)), endQuo te); 20064 text = $add($add(startQuote, text.substring$2(0, text.length - 1)), endQuo te);
19655 } 20065 }
19656 lits.add$1(this.makeStringLiteral($assert_String(text), (($0 = token.get$spa n()) && $0.is$SourceSpan()))); 20066 lits.add$1(this.makeStringLiteral($assert_String(text), (($0 = token.get$spa n()) == null ? null : $0.assert$SourceSpan())));
19657 if ($notnull_bool(this._maybeEat(6/*TokenKind.LBRACE*/))) { 20067 if ($notnull_bool(this._maybeEat(6/*TokenKind.LBRACE*/))) {
19658 lits.add$1(this.expression()); 20068 lits.add$1(this.expression());
19659 this._eat(7/*TokenKind.RBRACE*/); 20069 this._eat(7/*TokenKind.RBRACE*/);
19660 } 20070 }
19661 else if ($notnull_bool(this._maybeEat(108/*TokenKind.THIS*/))) { 20071 else if ($notnull_bool(this._maybeEat(108/*TokenKind.THIS*/))) {
19662 lits.add$1(new ThisExpression(this._previousToken.get$span())); 20072 lits.add$1(new ThisExpression(this._previousToken.get$span()));
19663 } 20073 }
19664 else { 20074 else {
19665 var id = this.identifier(); 20075 var id = this.identifier();
19666 lits.add$1(new VarExpression(id, (($0 = id.get$span()) && $0.is$SourceSpan ()))); 20076 lits.add$1(new VarExpression(id, (($0 = id.get$span()) == null ? null : $0 .assert$SourceSpan())));
19667 } 20077 }
19668 } 20078 }
19669 var tok = this._lang_next(); 20079 var tok = this._lang_next();
19670 if ($notnull_bool($ne(tok.get$kind(), 58/*TokenKind.STRING*/))) { 20080 if ($notnull_bool($ne(tok.get$kind(), 58/*TokenKind.STRING*/))) {
19671 this._errorExpected('interpolated string'); 20081 this._errorExpected('interpolated string');
19672 } 20082 }
19673 var text = $add(startQuote, tok.get$text()); 20083 var text = $add(startQuote, tok.get$text());
19674 lits.add$1(this.makeStringLiteral($assert_String(text), (($0 = tok.get$span()) && $0.is$SourceSpan()))); 20084 lits.add$1(this.makeStringLiteral($assert_String(text), (($0 = tok.get$span()) == null ? null : $0.assert$SourceSpan())));
19675 var span = this._makeSpan(start); 20085 var span = this._makeSpan(start);
19676 return new LiteralExpression(lits, this._stringTypeRef((span && span.is$Source Span())), '\$\$\$', (span && span.is$SourceSpan())); 20086 return new LiteralExpression(lits, this._stringTypeRef((span == null ? null : span.assert$SourceSpan())), '\$\$\$', (span == null ? null : span.assert$SourceS pan()));
19677 } 20087 }
19678 lang_Parser.prototype.makeStringLiteral = function(text, span) { 20088 lang_Parser.prototype.makeStringLiteral = function(text, span) {
19679 return new LiteralExpression(text, this._stringTypeRef(span), text, span); 20089 return new LiteralExpression(text, this._stringTypeRef(span), text, span);
19680 } 20090 }
19681 lang_Parser.prototype.stringLiteralExpr = function() { 20091 lang_Parser.prototype.stringLiteralExpr = function() {
19682 var $0; 20092 var $0;
19683 var token = this._lang_next(); 20093 var token = this._lang_next();
19684 return this.makeStringLiteral($assert_String(token.get$text()), (($0 = token.g et$span()) && $0.is$SourceSpan())); 20094 return this.makeStringLiteral($assert_String(token.get$text()), (($0 = token.g et$span()) == null ? null : $0.assert$SourceSpan()));
19685 } 20095 }
19686 lang_Parser.prototype.maybeStringLiteral = function() { 20096 lang_Parser.prototype.maybeStringLiteral = function() {
19687 var kind = this._peek(); 20097 var kind = this._peek();
19688 if ($notnull_bool($eq(kind, 58/*TokenKind.STRING*/))) { 20098 if ($notnull_bool($eq(kind, 58/*TokenKind.STRING*/))) {
19689 return parseStringLiteral(this._lang_next().get$text()); 20099 return parseStringLiteral(this._lang_next().get$text());
19690 } 20100 }
19691 else if ($notnull_bool($eq(kind, 59/*TokenKind.STRING_PART*/))) { 20101 else if ($notnull_bool($eq(kind, 59/*TokenKind.STRING_PART*/))) {
19692 this._lang_next(); 20102 this._lang_next();
19693 this._errorExpected('string literal, but found interpolated string start'); 20103 this._errorExpected('string literal, but found interpolated string start');
19694 } 20104 }
19695 else if ($notnull_bool($eq(kind, 66/*TokenKind.INCOMPLETE_STRING*/))) { 20105 else if ($notnull_bool($eq(kind, 66/*TokenKind.INCOMPLETE_STRING*/))) {
19696 this._lang_next(); 20106 this._lang_next();
19697 this._errorExpected('string literal, but found incomplete string'); 20107 this._errorExpected('string literal, but found incomplete string');
19698 } 20108 }
19699 return null; 20109 return null;
19700 } 20110 }
19701 lang_Parser.prototype._parenOrLambda = function() { 20111 lang_Parser.prototype._parenOrLambda = function() {
19702 var $0; 20112 var $0;
19703 var start = this._peekToken.start; 20113 var start = this._peekToken.start;
19704 if ($notnull_bool(this._atClosureParameters())) { 20114 if ($notnull_bool(this._atClosureParameters())) {
19705 var formals = this.formalParameterList(); 20115 var formals = this.formalParameterList();
19706 var body = this.functionBody(true); 20116 var body = this.functionBody(true);
19707 var func = new FunctionDefinition(null, null, null, formals, null, null, nul l, body, this._makeSpan(start)); 20117 var func = new FunctionDefinition(null, null, null, formals, null, null, nul l, body, this._makeSpan(start));
19708 return new LambdaExpression(func, (($0 = func.get$span()) && $0.is$SourceSpa n())); 20118 return new LambdaExpression(func, (($0 = func.get$span()) == null ? null : $ 0.assert$SourceSpan()));
19709 } 20119 }
19710 else { 20120 else {
19711 var saved = this._inInitializers; 20121 var saved = this._inInitializers;
19712 this._inInitializers = false; 20122 this._inInitializers = false;
19713 var args = this.arguments(); 20123 var args = this.arguments();
19714 this._inInitializers = $assert_bool(saved); 20124 this._inInitializers = $assert_bool(saved);
19715 if ($notnull_bool($eq(args.length, 1))) { 20125 if ($notnull_bool($eq(args.length, 1))) {
19716 return new ParenExpression(args.$index(0).get$value(), this._makeSpan(star t)); 20126 return new ParenExpression(args.$index(0).get$value(), this._makeSpan(star t));
19717 } 20127 }
19718 else { 20128 else {
19719 this._lang_error('unexpected comma expression'); 20129 this._lang_error('unexpected comma expression');
19720 return args.$index(0).get$value(); 20130 return args.$index(0).get$value();
19721 } 20131 }
19722 } 20132 }
19723 } 20133 }
19724 lang_Parser.prototype._atClosureParameters = function() { 20134 lang_Parser.prototype._atClosureParameters = function() {
19725 if ($notnull_bool(this._inInitializers)) return false; 20135 if ($notnull_bool(this._inInitializers)) return false;
19726 var after = this._peekAfterCloseParen(); 20136 var after = this._peekAfterCloseParen();
19727 return after.kind == 9/*TokenKind.ARROW*/ || after.kind == 6/*TokenKind.LBRACE */; 20137 return after.kind == 9/*TokenKind.ARROW*/ || after.kind == 6/*TokenKind.LBRACE */;
19728 } 20138 }
19729 lang_Parser.prototype._eatLeftParen = function() { 20139 lang_Parser.prototype._eatLeftParen = function() {
19730 this._eat(2/*TokenKind.LPAREN*/); 20140 this._eat(2/*TokenKind.LPAREN*/);
19731 this._afterParensIndex++; 20141 this._afterParensIndex++;
19732 } 20142 }
19733 lang_Parser.prototype._peekAfterCloseParen = function() { 20143 lang_Parser.prototype._peekAfterCloseParen = function() {
19734 var $0; 20144 var $0;
19735 if (this._afterParensIndex < this._afterParens.length) { 20145 if (this._afterParensIndex < this._afterParens.length) {
19736 return (($0 = this._afterParens.$index(this._afterParensIndex)) && $0.is$lan g_Token()); 20146 return (($0 = this._afterParens.$index(this._afterParensIndex)) == null ? nu ll : $0.assert$lang_Token());
19737 } 20147 }
19738 this._afterParensIndex = 0; 20148 this._afterParensIndex = 0;
19739 this._afterParens.clear(); 20149 this._afterParens.clear();
19740 var tokens = [this._lang_next()]; 20150 var tokens = [this._lang_next()];
19741 this._lookaheadAfterParens((tokens && tokens.is$List_Token())); 20151 this._lookaheadAfterParens((tokens == null ? null : tokens.assert$List_Token() ));
19742 var after = this._peekToken; 20152 var after = this._peekToken;
19743 tokens.add$1(after); 20153 tokens.add$1(after);
19744 this.tokenizer = new DivertedTokenSource(tokens, this, this.tokenizer); 20154 this.tokenizer = new DivertedTokenSource(tokens, this, this.tokenizer);
19745 this._lang_next(); 20155 this._lang_next();
19746 return (after && after.is$lang_Token()); 20156 return (after == null ? null : after.assert$lang_Token());
19747 } 20157 }
19748 lang_Parser.prototype._lookaheadAfterParens = function(tokens) { 20158 lang_Parser.prototype._lookaheadAfterParens = function(tokens) {
19749 var saved = this._afterParens.length; 20159 var saved = this._afterParens.length;
19750 this._afterParens.add(null); 20160 this._afterParens.add(null);
19751 while (true) { 20161 while (true) {
19752 var token = this._lang_next(); 20162 var token = this._lang_next();
19753 tokens.add(token); 20163 tokens.add(token);
19754 var kind = token.kind; 20164 var kind = token.kind;
19755 if (kind == 3/*TokenKind.RPAREN*/ || kind == 1/*TokenKind.END_OF_FILE*/) { 20165 if (kind == 3/*TokenKind.RPAREN*/ || kind == 1/*TokenKind.END_OF_FILE*/) {
19756 this._afterParens.$setindex(saved, this._peekToken); 20166 this._afterParens.$setindex(saved, this._peekToken);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
19913 items.add$1(this.expression()); 20323 items.add$1(this.expression());
19914 if (!$notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 20324 if (!$notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
19915 this._eat(7/*TokenKind.RBRACE*/); 20325 this._eat(7/*TokenKind.RBRACE*/);
19916 break; 20326 break;
19917 } 20327 }
19918 } 20328 }
19919 return new MapExpression(isConst, type, items, this._makeSpan(start)); 20329 return new MapExpression(isConst, type, items, this._makeSpan(start));
19920 } 20330 }
19921 lang_Parser.prototype.finishTypedLiteral = function(start, isConst) { 20331 lang_Parser.prototype.finishTypedLiteral = function(start, isConst) {
19922 var span = this._makeSpan(start); 20332 var span = this._makeSpan(start);
19923 var typeToBeNamedLater = new NameTypeReference(false, null, null, (span && spa n.is$SourceSpan())); 20333 var typeToBeNamedLater = new NameTypeReference(false, null, null, (span == nul l ? null : span.assert$SourceSpan()));
19924 var genericType = this.addTypeArguments((typeToBeNamedLater && typeToBeNamedLa ter.is$TypeReference()), 0); 20334 var genericType = this.addTypeArguments((typeToBeNamedLater == null ? null : t ypeToBeNamedLater.assert$TypeReference()), 0);
19925 if ($notnull_bool(this._peekKind(4/*TokenKind.LBRACK*/)) || $notnull_bool(this ._peekKind(56/*TokenKind.INDEX*/))) { 20335 if ($notnull_bool(this._peekKind(4/*TokenKind.LBRACK*/)) || $notnull_bool(this ._peekKind(56/*TokenKind.INDEX*/))) {
19926 return this.finishListLiteral(start, isConst, (genericType && genericType.is $TypeReference())); 20336 return this.finishListLiteral(start, isConst, (genericType == null ? null : genericType.assert$TypeReference()));
19927 } 20337 }
19928 else if ($notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/))) { 20338 else if ($notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/))) {
19929 return this.finishMapLiteral(start, isConst, (genericType && genericType.is$ TypeReference())); 20339 return this.finishMapLiteral(start, isConst, (genericType == null ? null : g enericType.assert$TypeReference()));
19930 } 20340 }
19931 else { 20341 else {
19932 this._errorExpected('array or map literal'); 20342 this._errorExpected('array or map literal');
19933 } 20343 }
19934 } 20344 }
19935 lang_Parser.prototype._readModifiers = function() { 20345 lang_Parser.prototype._readModifiers = function() {
19936 var modifiers = null; 20346 var modifiers = null;
19937 while (true) { 20347 while (true) {
19938 switch (this._peek()) { 20348 switch (this._peek()) {
19939 case 86/*TokenKind.STATIC*/: 20349 case 86/*TokenKind.STATIC*/:
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
19976 ret.add$1(tp); 20386 ret.add$1(tp);
19977 if ((tp.get$typeParameter().get$extendsType() instanceof GenericTypeReferenc e) && $notnull_bool($eq(tp.get$typeParameter().get$extendsType().get$depth(), 0) )) { 20387 if ((tp.get$typeParameter().get$extendsType() instanceof GenericTypeReferenc e) && $notnull_bool($eq(tp.get$typeParameter().get$extendsType().get$depth(), 0) )) {
19978 closed = true; 20388 closed = true;
19979 break; 20389 break;
19980 } 20390 }
19981 } 20391 }
19982 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) 20392 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
19983 if (!$notnull_bool(closed)) { 20393 if (!$notnull_bool(closed)) {
19984 this._eat(53/*TokenKind.GT*/); 20394 this._eat(53/*TokenKind.GT*/);
19985 } 20395 }
19986 return (ret && ret.is$List_ParameterType()); 20396 return (ret == null ? null : ret.assert$List_ParameterType());
19987 } 20397 }
19988 lang_Parser.prototype.get$typeParameters = function() { 20398 lang_Parser.prototype.get$typeParameters = function() {
19989 return lang_Parser.prototype.typeParameters.bind(this); 20399 return lang_Parser.prototype.typeParameters.bind(this);
19990 } 20400 }
19991 lang_Parser.prototype._eatClosingAngle = function(depth) { 20401 lang_Parser.prototype._eatClosingAngle = function(depth) {
19992 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) { 20402 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) {
19993 return depth; 20403 return depth;
19994 } 20404 }
19995 else if (depth > 0 && $notnull_bool(this._maybeEat(40/*TokenKind.SAR*/))) { 20405 else if (depth > 0 && $notnull_bool(this._maybeEat(40/*TokenKind.SAR*/))) {
19996 return depth - 1; 20406 return depth - 1;
(...skipping 21 matching lines...) Expand all
20018 } 20428 }
20019 } 20429 }
20020 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) 20430 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
20021 if (delta >= 0) { 20431 if (delta >= 0) {
20022 depth -= $assert_num(delta); 20432 depth -= $assert_num(delta);
20023 } 20433 }
20024 else { 20434 else {
20025 depth = this._eatClosingAngle(depth); 20435 depth = this._eatClosingAngle(depth);
20026 } 20436 }
20027 var span = this._makeSpan(baseType.span.start); 20437 var span = this._makeSpan(baseType.span.start);
20028 return new GenericTypeReference(baseType, types, depth, (span && span.is$Sourc eSpan())); 20438 return new GenericTypeReference(baseType, types, depth, (span == null ? null : span.assert$SourceSpan()));
20029 } 20439 }
20030 lang_Parser.prototype.typeList = function() { 20440 lang_Parser.prototype.typeList = function() {
20031 var types = []; 20441 var types = [];
20032 do { 20442 do {
20033 types.add$1(this.type(0)); 20443 types.add$1(this.type(0));
20034 } 20444 }
20035 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) 20445 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
20036 return types; 20446 return types;
20037 } 20447 }
20038 lang_Parser.prototype.type = function(depth) { 20448 lang_Parser.prototype.type = function(depth) {
(...skipping 23 matching lines...) Expand all
20062 name = this.identifier(); 20472 name = this.identifier();
20063 break; 20473 break;
20064 20474
20065 } 20475 }
20066 while ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) { 20476 while ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) {
20067 if (names == null) names = []; 20477 if (names == null) names = [];
20068 names.add$1(this.identifier()); 20478 names.add$1(this.identifier());
20069 } 20479 }
20070 var typeRef = new NameTypeReference(isFinal, name, names, this._makeSpan(start )); 20480 var typeRef = new NameTypeReference(isFinal, name, names, this._makeSpan(start ));
20071 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) { 20481 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
20072 return this.addTypeArguments((typeRef && typeRef.is$TypeReference()), depth) ; 20482 return this.addTypeArguments((typeRef == null ? null : typeRef.assert$TypeRe ference()), depth);
20073 } 20483 }
20074 else { 20484 else {
20075 return typeRef; 20485 return typeRef;
20076 } 20486 }
20077 } 20487 }
20078 lang_Parser.prototype.get$type = function() { 20488 lang_Parser.prototype.get$type = function() {
20079 return lang_Parser.prototype.type.bind(this); 20489 return lang_Parser.prototype.type.bind(this);
20080 } 20490 }
20081 lang_Parser.prototype.formalParameter = function(inOptionalBlock) { 20491 lang_Parser.prototype.formalParameter = function(inOptionalBlock) {
20082 var $0; 20492 var $0;
20083 var start = this._peekToken.start; 20493 var start = this._peekToken.start;
20084 var isThis = false; 20494 var isThis = false;
20085 var isRest = false; 20495 var isRest = false;
20086 var di = this.declaredIdentifier(false); 20496 var di = this.declaredIdentifier(false);
20087 var type = di.get$type(); 20497 var type = di.get$type();
20088 var name = di.get$name(); 20498 var name = di.get$name();
20089 var value = null; 20499 var value = null;
20090 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { 20500 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
20091 if (!$notnull_bool(inOptionalBlock)) { 20501 if (!$notnull_bool(inOptionalBlock)) {
20092 this._lang_error('default values only allowed inside [optional] section'); 20502 this._lang_error('default values only allowed inside [optional] section');
20093 } 20503 }
20094 value = this.expression(); 20504 value = this.expression();
20095 } 20505 }
20096 else if ($notnull_bool(this._peekKind(2/*TokenKind.LPAREN*/))) { 20506 else if ($notnull_bool(this._peekKind(2/*TokenKind.LPAREN*/))) {
20097 var formals = this.formalParameterList(); 20507 var formals = this.formalParameterList();
20098 var func = new FunctionDefinition(null, type, name, formals, null, null, nul l, null, this._makeSpan(start)); 20508 var func = new FunctionDefinition(null, type, name, formals, null, null, nul l, null, this._makeSpan(start));
20099 type = new FunctionTypeReference(false, func, (($0 = func.get$span()) && $0. is$SourceSpan())); 20509 type = new FunctionTypeReference(false, func, (($0 = func.get$span()) == nul l ? null : $0.assert$SourceSpan()));
20100 } 20510 }
20101 if ($notnull_bool(inOptionalBlock) && $notnull_bool(value == null)) { 20511 if ($notnull_bool(inOptionalBlock) && $notnull_bool(value == null)) {
20102 value = new NullExpression(this._makeSpan(start)); 20512 value = new NullExpression(this._makeSpan(start));
20103 } 20513 }
20104 return new FormalNode(isThis, isRest, type, name, value, this._makeSpan(start) ); 20514 return new FormalNode(isThis, isRest, type, name, value, this._makeSpan(start) );
20105 } 20515 }
20106 lang_Parser.prototype.formalParameterList = function() { 20516 lang_Parser.prototype.formalParameterList = function() {
20107 this._eatLeftParen(); 20517 this._eatLeftParen();
20108 var formals = []; 20518 var formals = [];
20109 var inOptionalBlock = false; 20519 var inOptionalBlock = false;
(...skipping 15 matching lines...) Expand all
20125 this._eat(5/*TokenKind.RBRACK*/); 20535 this._eat(5/*TokenKind.RBRACK*/);
20126 } 20536 }
20127 this._eat(3/*TokenKind.RPAREN*/); 20537 this._eat(3/*TokenKind.RPAREN*/);
20128 } 20538 }
20129 return formals; 20539 return formals;
20130 } 20540 }
20131 lang_Parser.prototype.identifier = function() { 20541 lang_Parser.prototype.identifier = function() {
20132 var $0; 20542 var $0;
20133 var tok = this._lang_next(); 20543 var tok = this._lang_next();
20134 if (!$notnull_bool(TokenKind.isIdentifier($assert_num(tok.get$kind())))) { 20544 if (!$notnull_bool(TokenKind.isIdentifier($assert_num(tok.get$kind())))) {
20135 this._lang_error(('expected identifier, but found ' + tok), (($0 = tok.get$s pan()) && $0.is$SourceSpan())); 20545 this._lang_error(('expected identifier, but found ' + tok), (($0 = tok.get$s pan()) == null ? null : $0.assert$SourceSpan()));
20136 } 20546 }
20137 return new lang_Identifier(tok.get$text(), this._makeSpan($assert_num(tok.get$ start()))); 20547 return new lang_Identifier(tok.get$text(), this._makeSpan($assert_num(tok.get$ start())));
20138 } 20548 }
20139 lang_Parser.prototype._makeFunction = function(expr, formals, body) { 20549 lang_Parser.prototype._makeFunction = function(expr, formals, body) {
20140 var $0; 20550 var $0;
20141 var name, type; 20551 var name, type;
20142 if ((expr instanceof VarExpression)) { 20552 if ((expr instanceof VarExpression)) {
20143 name = expr.get$name(); 20553 name = expr.get$name();
20144 type = null; 20554 type = null;
20145 } 20555 }
20146 else if ((expr instanceof DeclaredIdentifier)) { 20556 else if ((expr instanceof DeclaredIdentifier)) {
20147 name = expr.get$name(); 20557 name = expr.get$name();
20148 type = expr.get$type(); 20558 type = expr.get$type();
20149 } 20559 }
20150 else { 20560 else {
20151 this._lang_error('bad function body', (($0 = expr.get$span()) && $0.is$Sourc eSpan())); 20561 this._lang_error('bad function body', (($0 = expr.get$span()) == null ? null : $0.assert$SourceSpan()));
20152 } 20562 }
20153 var span = new SourceSpan(expr.get$span().get$file(), expr.get$span().get$star t(), body.get$span().get$end()); 20563 var span = new SourceSpan(expr.get$span().get$file(), expr.get$span().get$star t(), body.get$span().get$end());
20154 var func = new FunctionDefinition(null, type, name, formals, null, null, null, body, (span && span.is$SourceSpan())); 20564 var func = new FunctionDefinition(null, type, name, formals, null, null, null, body, (span == null ? null : span.assert$SourceSpan()));
20155 return new LambdaExpression(func, (($0 = func.get$span()) && $0.is$SourceSpan( ))); 20565 return new LambdaExpression(func, (($0 = func.get$span()) == null ? null : $0. assert$SourceSpan()));
20156 } 20566 }
20157 lang_Parser.prototype._makeDeclaredIdentifier = function(e) { 20567 lang_Parser.prototype._makeDeclaredIdentifier = function(e) {
20158 var $0; 20568 var $0;
20159 if ((e instanceof VarExpression)) { 20569 if ((e instanceof VarExpression)) {
20160 return new DeclaredIdentifier(null, e.get$name(), (($0 = e.get$span()) && $0 .is$SourceSpan())); 20570 return new DeclaredIdentifier(null, e.get$name(), (($0 = e.get$span()) == nu ll ? null : $0.assert$SourceSpan()));
20161 } 20571 }
20162 else if ((e instanceof DeclaredIdentifier)) { 20572 else if ((e instanceof DeclaredIdentifier)) {
20163 return e; 20573 return e;
20164 } 20574 }
20165 else { 20575 else {
20166 this._lang_error('expected declared identifier'); 20576 this._lang_error('expected declared identifier');
20167 return new DeclaredIdentifier(null, null, (($0 = e.get$span()) && $0.is$Sour ceSpan())); 20577 return new DeclaredIdentifier(null, null, (($0 = e.get$span()) == null ? nul l : $0.assert$SourceSpan()));
20168 } 20578 }
20169 } 20579 }
20170 lang_Parser.prototype._makeLabel = function(expr) { 20580 lang_Parser.prototype._makeLabel = function(expr) {
20171 if ((expr instanceof VarExpression)) { 20581 if ((expr instanceof VarExpression)) {
20172 return expr.get$name(); 20582 return expr.get$name();
20173 } 20583 }
20174 else { 20584 else {
20175 this._errorExpected('label'); 20585 this._errorExpected('label');
20176 return null; 20586 return null;
20177 } 20587 }
(...skipping 24 matching lines...) Expand all
20202 this.parser.tokenizer = this.previousTokenizer; 20612 this.parser.tokenizer = this.previousTokenizer;
20203 } 20613 }
20204 return token; 20614 return token;
20205 } 20615 }
20206 DivertedTokenSource.prototype.next$0 = DivertedTokenSource.prototype.next; 20616 DivertedTokenSource.prototype.next$0 = DivertedTokenSource.prototype.next;
20207 // ********** Code for lang_Node ************** 20617 // ********** Code for lang_Node **************
20208 function lang_Node(span) { 20618 function lang_Node(span) {
20209 this.span = span; 20619 this.span = span;
20210 // Initializers done 20620 // Initializers done
20211 } 20621 }
20212 lang_Node.prototype.is$lang_Node = function(){return this;}; 20622 lang_Node.prototype.assert$lang_Node = function(){return this};
20213 lang_Node.prototype.get$span = function() { return this.span; }; 20623 lang_Node.prototype.get$span = function() { return this.span; };
20214 lang_Node.prototype.set$span = function(value) { return this.span = value; }; 20624 lang_Node.prototype.set$span = function(value) { return this.span = value; };
20215 lang_Node.prototype.visit$1 = function($0) { 20625 lang_Node.prototype.visit$1 = function($0) {
20216 return this.visit(($0 && $0.is$TreeVisitor())); 20626 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20217 }; 20627 };
20218 // ********** Code for Definition ************** 20628 // ********** Code for Definition **************
20219 function Definition(span) { 20629 function Definition(span) {
20220 // Initializers done 20630 // Initializers done
20221 lang_Statement.call(this, span); 20631 lang_Statement.call(this, span);
20222 } 20632 }
20223 $inherits(Definition, lang_Statement); 20633 $inherits(Definition, lang_Statement);
20224 Definition.prototype.is$Definition = function(){return this;}; 20634 Definition.prototype.assert$Definition = function(){return this};
20225 Definition.prototype.get$typeParameters = function() { 20635 Definition.prototype.get$typeParameters = function() {
20226 return null; 20636 return null;
20227 } 20637 }
20228 Definition.prototype.get$nativeType = function() { 20638 Definition.prototype.get$nativeType = function() {
20229 return null; 20639 return null;
20230 } 20640 }
20231 // ********** Code for lang_Statement ************** 20641 // ********** Code for lang_Statement **************
20232 function lang_Statement(span) { 20642 function lang_Statement(span) {
20233 // Initializers done 20643 // Initializers done
20234 lang_Node.call(this, span); 20644 lang_Node.call(this, span);
20235 } 20645 }
20236 $inherits(lang_Statement, lang_Node); 20646 $inherits(lang_Statement, lang_Node);
20237 lang_Statement.prototype.is$lang_Statement = function(){return this;}; 20647 lang_Statement.prototype.assert$lang_Statement = function(){return this};
20238 // ********** Code for lang_Expression ************** 20648 // ********** Code for lang_Expression **************
20239 function lang_Expression(span) { 20649 function lang_Expression(span) {
20240 // Initializers done 20650 // Initializers done
20241 lang_Node.call(this, span); 20651 lang_Node.call(this, span);
20242 } 20652 }
20243 $inherits(lang_Expression, lang_Node); 20653 $inherits(lang_Expression, lang_Node);
20244 lang_Expression.prototype.is$lang_Expression = function(){return this;}; 20654 lang_Expression.prototype.assert$lang_Expression = function(){return this};
20245 // ********** Code for TypeReference ************** 20655 // ********** Code for TypeReference **************
20246 function TypeReference(span, type) { 20656 function TypeReference(span, type) {
20247 this.type = type; 20657 this.type = type;
20248 // Initializers done 20658 // Initializers done
20249 lang_Node.call(this, span); 20659 lang_Node.call(this, span);
20250 } 20660 }
20251 $inherits(TypeReference, lang_Node); 20661 $inherits(TypeReference, lang_Node);
20252 TypeReference.prototype.is$TypeReference = function(){return this;}; 20662 TypeReference.prototype.assert$TypeReference = function(){return this};
20253 TypeReference.prototype.get$type = function() { return this.type; }; 20663 TypeReference.prototype.get$type = function() { return this.type; };
20254 TypeReference.prototype.set$type = function(value) { return this.type = value; } ; 20664 TypeReference.prototype.set$type = function(value) { return this.type = value; } ;
20255 TypeReference.prototype.visit = function(visitor) { 20665 TypeReference.prototype.visit = function(visitor) {
20256 return visitor.visitTypeReference(this); 20666 return visitor.visitTypeReference(this);
20257 } 20667 }
20258 TypeReference.prototype.get$isFinal = function() { 20668 TypeReference.prototype.get$isFinal = function() {
20259 return false; 20669 return false;
20260 } 20670 }
20261 TypeReference.prototype.visit$1 = function($0) { 20671 TypeReference.prototype.visit$1 = function($0) {
20262 return this.visit(($0 && $0.is$TreeVisitor())); 20672 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20263 }; 20673 };
20264 // ********** Code for DirectiveDefinition ************** 20674 // ********** Code for DirectiveDefinition **************
20265 function DirectiveDefinition(name, arguments, span) { 20675 function DirectiveDefinition(name, arguments, span) {
20266 this.name = name; 20676 this.name = name;
20267 this.arguments = arguments; 20677 this.arguments = arguments;
20268 // Initializers done 20678 // Initializers done
20269 Definition.call(this, span); 20679 Definition.call(this, span);
20270 } 20680 }
20271 $inherits(DirectiveDefinition, Definition); 20681 $inherits(DirectiveDefinition, Definition);
20272 DirectiveDefinition.prototype.get$name = function() { return this.name; }; 20682 DirectiveDefinition.prototype.get$name = function() { return this.name; };
20273 DirectiveDefinition.prototype.set$name = function(value) { return this.name = va lue; }; 20683 DirectiveDefinition.prototype.set$name = function(value) { return this.name = va lue; };
20274 DirectiveDefinition.prototype.get$arguments = function() { return this.arguments ; }; 20684 DirectiveDefinition.prototype.get$arguments = function() { return this.arguments ; };
20275 DirectiveDefinition.prototype.set$arguments = function(value) { return this.argu ments = value; }; 20685 DirectiveDefinition.prototype.set$arguments = function(value) { return this.argu ments = value; };
20276 DirectiveDefinition.prototype.visit = function(visitor) { 20686 DirectiveDefinition.prototype.visit = function(visitor) {
20277 return visitor.visitDirectiveDefinition(this); 20687 return visitor.visitDirectiveDefinition(this);
20278 } 20688 }
20279 DirectiveDefinition.prototype.visit$1 = function($0) { 20689 DirectiveDefinition.prototype.visit$1 = function($0) {
20280 return this.visit(($0 && $0.is$TreeVisitor())); 20690 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20281 }; 20691 };
20282 // ********** Code for TypeDefinition ************** 20692 // ********** Code for TypeDefinition **************
20283 function TypeDefinition(isClass, name, typeParameters, extendsTypes, implementsT ypes, nativeType, factoryType, body, span) { 20693 function TypeDefinition(isClass, name, typeParameters, extendsTypes, implementsT ypes, nativeType, factoryType, body, span) {
20284 this.isClass = isClass; 20694 this.isClass = isClass;
20285 this.name = name; 20695 this.name = name;
20286 this.typeParameters = typeParameters; 20696 this.typeParameters = typeParameters;
20287 this.extendsTypes = extendsTypes; 20697 this.extendsTypes = extendsTypes;
20288 this.implementsTypes = implementsTypes; 20698 this.implementsTypes = implementsTypes;
20289 this.nativeType = nativeType; 20699 this.nativeType = nativeType;
20290 this.factoryType = factoryType; 20700 this.factoryType = factoryType;
20291 this.body = body; 20701 this.body = body;
20292 // Initializers done 20702 // Initializers done
20293 Definition.call(this, span); 20703 Definition.call(this, span);
20294 } 20704 }
20295 $inherits(TypeDefinition, Definition); 20705 $inherits(TypeDefinition, Definition);
20296 TypeDefinition.prototype.is$TypeDefinition = function(){return this;}; 20706 TypeDefinition.prototype.assert$TypeDefinition = function(){return this};
20297 TypeDefinition.prototype.get$isClass = function() { return this.isClass; }; 20707 TypeDefinition.prototype.get$isClass = function() { return this.isClass; };
20298 TypeDefinition.prototype.set$isClass = function(value) { return this.isClass = v alue; }; 20708 TypeDefinition.prototype.set$isClass = function(value) { return this.isClass = v alue; };
20299 TypeDefinition.prototype.get$name = function() { return this.name; }; 20709 TypeDefinition.prototype.get$name = function() { return this.name; };
20300 TypeDefinition.prototype.set$name = function(value) { return this.name = value; }; 20710 TypeDefinition.prototype.set$name = function(value) { return this.name = value; };
20301 TypeDefinition.prototype.get$typeParameters = function() { return this.typeParam eters; }; 20711 TypeDefinition.prototype.get$typeParameters = function() { return this.typeParam eters; };
20302 TypeDefinition.prototype.set$typeParameters = function(value) { return this.type Parameters = value; }; 20712 TypeDefinition.prototype.set$typeParameters = function(value) { return this.type Parameters = value; };
20303 TypeDefinition.prototype.get$nativeType = function() { return this.nativeType; } ; 20713 TypeDefinition.prototype.get$nativeType = function() { return this.nativeType; } ;
20304 TypeDefinition.prototype.set$nativeType = function(value) { return this.nativeTy pe = value; }; 20714 TypeDefinition.prototype.set$nativeType = function(value) { return this.nativeTy pe = value; };
20305 TypeDefinition.prototype.get$body = function() { return this.body; }; 20715 TypeDefinition.prototype.get$body = function() { return this.body; };
20306 TypeDefinition.prototype.set$body = function(value) { return this.body = value; }; 20716 TypeDefinition.prototype.set$body = function(value) { return this.body = value; };
20307 TypeDefinition.prototype.visit = function(visitor) { 20717 TypeDefinition.prototype.visit = function(visitor) {
20308 return visitor.visitTypeDefinition(this); 20718 return visitor.visitTypeDefinition(this);
20309 } 20719 }
20310 TypeDefinition.prototype.visit$1 = function($0) { 20720 TypeDefinition.prototype.visit$1 = function($0) {
20311 return this.visit(($0 && $0.is$TreeVisitor())); 20721 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20312 }; 20722 };
20313 // ********** Code for FunctionTypeDefinition ************** 20723 // ********** Code for FunctionTypeDefinition **************
20314 function FunctionTypeDefinition(func, typeParameters, span) { 20724 function FunctionTypeDefinition(func, typeParameters, span) {
20315 this.func = func; 20725 this.func = func;
20316 this.typeParameters = typeParameters; 20726 this.typeParameters = typeParameters;
20317 // Initializers done 20727 // Initializers done
20318 Definition.call(this, span); 20728 Definition.call(this, span);
20319 } 20729 }
20320 $inherits(FunctionTypeDefinition, Definition); 20730 $inherits(FunctionTypeDefinition, Definition);
20321 FunctionTypeDefinition.prototype.get$func = function() { return this.func; }; 20731 FunctionTypeDefinition.prototype.get$func = function() { return this.func; };
20322 FunctionTypeDefinition.prototype.set$func = function(value) { return this.func = value; }; 20732 FunctionTypeDefinition.prototype.set$func = function(value) { return this.func = value; };
20323 FunctionTypeDefinition.prototype.get$typeParameters = function() { return this.t ypeParameters; }; 20733 FunctionTypeDefinition.prototype.get$typeParameters = function() { return this.t ypeParameters; };
20324 FunctionTypeDefinition.prototype.set$typeParameters = function(value) { return t his.typeParameters = value; }; 20734 FunctionTypeDefinition.prototype.set$typeParameters = function(value) { return t his.typeParameters = value; };
20325 FunctionTypeDefinition.prototype.visit = function(visitor) { 20735 FunctionTypeDefinition.prototype.visit = function(visitor) {
20326 return visitor.visitFunctionTypeDefinition(this); 20736 return visitor.visitFunctionTypeDefinition(this);
20327 } 20737 }
20328 FunctionTypeDefinition.prototype.visit$1 = function($0) { 20738 FunctionTypeDefinition.prototype.visit$1 = function($0) {
20329 return this.visit(($0 && $0.is$TreeVisitor())); 20739 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20330 }; 20740 };
20331 // ********** Code for VariableDefinition ************** 20741 // ********** Code for VariableDefinition **************
20332 function VariableDefinition(modifiers, type, names, values, span) { 20742 function VariableDefinition(modifiers, type, names, values, span) {
20333 this.modifiers = modifiers; 20743 this.modifiers = modifiers;
20334 this.type = type; 20744 this.type = type;
20335 this.names = names; 20745 this.names = names;
20336 this.values = values; 20746 this.values = values;
20337 // Initializers done 20747 // Initializers done
20338 Definition.call(this, span); 20748 Definition.call(this, span);
20339 } 20749 }
20340 $inherits(VariableDefinition, Definition); 20750 $inherits(VariableDefinition, Definition);
20341 VariableDefinition.prototype.get$type = function() { return this.type; }; 20751 VariableDefinition.prototype.get$type = function() { return this.type; };
20342 VariableDefinition.prototype.set$type = function(value) { return this.type = val ue; }; 20752 VariableDefinition.prototype.set$type = function(value) { return this.type = val ue; };
20343 VariableDefinition.prototype.get$names = function() { return this.names; }; 20753 VariableDefinition.prototype.get$names = function() { return this.names; };
20344 VariableDefinition.prototype.set$names = function(value) { return this.names = v alue; }; 20754 VariableDefinition.prototype.set$names = function(value) { return this.names = v alue; };
20345 VariableDefinition.prototype.get$values = function() { return this.values; }; 20755 VariableDefinition.prototype.get$values = function() { return this.values; };
20346 VariableDefinition.prototype.set$values = function(value) { return this.values = value; }; 20756 VariableDefinition.prototype.set$values = function(value) { return this.values = value; };
20347 VariableDefinition.prototype.visit = function(visitor) { 20757 VariableDefinition.prototype.visit = function(visitor) {
20348 return visitor.visitVariableDefinition(this); 20758 return visitor.visitVariableDefinition(this);
20349 } 20759 }
20350 VariableDefinition.prototype.visit$1 = function($0) { 20760 VariableDefinition.prototype.visit$1 = function($0) {
20351 return this.visit(($0 && $0.is$TreeVisitor())); 20761 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20352 }; 20762 };
20353 // ********** Code for FunctionDefinition ************** 20763 // ********** Code for FunctionDefinition **************
20354 function FunctionDefinition(modifiers, returnType, name, formals, typeParameters , initializers, nativeBody, body, span) { 20764 function FunctionDefinition(modifiers, returnType, name, formals, typeParameters , initializers, nativeBody, body, span) {
20355 this.modifiers = modifiers; 20765 this.modifiers = modifiers;
20356 this.returnType = returnType; 20766 this.returnType = returnType;
20357 this.name = name; 20767 this.name = name;
20358 this.formals = formals; 20768 this.formals = formals;
20359 this.typeParameters = typeParameters; 20769 this.typeParameters = typeParameters;
20360 this.initializers = initializers; 20770 this.initializers = initializers;
20361 this.nativeBody = nativeBody; 20771 this.nativeBody = nativeBody;
20362 this.body = body; 20772 this.body = body;
20363 // Initializers done 20773 // Initializers done
20364 Definition.call(this, span); 20774 Definition.call(this, span);
20365 } 20775 }
20366 $inherits(FunctionDefinition, Definition); 20776 $inherits(FunctionDefinition, Definition);
20367 FunctionDefinition.prototype.is$FunctionDefinition = function(){return this;}; 20777 FunctionDefinition.prototype.assert$FunctionDefinition = function(){return this} ;
20368 FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp e; }; 20778 FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp e; };
20369 FunctionDefinition.prototype.set$returnType = function(value) { return this.retu rnType = value; }; 20779 FunctionDefinition.prototype.set$returnType = function(value) { return this.retu rnType = value; };
20370 FunctionDefinition.prototype.get$name = function() { return this.name; }; 20780 FunctionDefinition.prototype.get$name = function() { return this.name; };
20371 FunctionDefinition.prototype.set$name = function(value) { return this.name = val ue; }; 20781 FunctionDefinition.prototype.set$name = function(value) { return this.name = val ue; };
20372 FunctionDefinition.prototype.get$typeParameters = function() { return this.typeP arameters; }; 20782 FunctionDefinition.prototype.get$typeParameters = function() { return this.typeP arameters; };
20373 FunctionDefinition.prototype.set$typeParameters = function(value) { return this. typeParameters = value; }; 20783 FunctionDefinition.prototype.set$typeParameters = function(value) { return this. typeParameters = value; };
20374 FunctionDefinition.prototype.get$initializers = function() { return this.initial izers; }; 20784 FunctionDefinition.prototype.get$initializers = function() { return this.initial izers; };
20375 FunctionDefinition.prototype.set$initializers = function(value) { return this.in itializers = value; }; 20785 FunctionDefinition.prototype.set$initializers = function(value) { return this.in itializers = value; };
20376 FunctionDefinition.prototype.get$nativeBody = function() { return this.nativeBod y; }; 20786 FunctionDefinition.prototype.get$nativeBody = function() { return this.nativeBod y; };
20377 FunctionDefinition.prototype.set$nativeBody = function(value) { return this.nati veBody = value; }; 20787 FunctionDefinition.prototype.set$nativeBody = function(value) { return this.nati veBody = value; };
20378 FunctionDefinition.prototype.get$body = function() { return this.body; }; 20788 FunctionDefinition.prototype.get$body = function() { return this.body; };
20379 FunctionDefinition.prototype.set$body = function(value) { return this.body = val ue; }; 20789 FunctionDefinition.prototype.set$body = function(value) { return this.body = val ue; };
20380 FunctionDefinition.prototype.visit = function(visitor) { 20790 FunctionDefinition.prototype.visit = function(visitor) {
20381 return visitor.visitFunctionDefinition(this); 20791 return visitor.visitFunctionDefinition(this);
20382 } 20792 }
20383 FunctionDefinition.prototype.visit$1 = function($0) { 20793 FunctionDefinition.prototype.visit$1 = function($0) {
20384 return this.visit(($0 && $0.is$TreeVisitor())); 20794 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20385 }; 20795 };
20386 // ********** Code for ReturnStatement ************** 20796 // ********** Code for ReturnStatement **************
20387 function ReturnStatement(value, span) { 20797 function ReturnStatement(value, span) {
20388 this.value = value; 20798 this.value = value;
20389 // Initializers done 20799 // Initializers done
20390 lang_Statement.call(this, span); 20800 lang_Statement.call(this, span);
20391 } 20801 }
20392 $inherits(ReturnStatement, lang_Statement); 20802 $inherits(ReturnStatement, lang_Statement);
20393 ReturnStatement.prototype.get$value = function() { return this.value; }; 20803 ReturnStatement.prototype.get$value = function() { return this.value; };
20394 ReturnStatement.prototype.set$value = function(value) { return this.value = valu e; }; 20804 ReturnStatement.prototype.set$value = function(value) { return this.value = valu e; };
20395 ReturnStatement.prototype.visit = function(visitor) { 20805 ReturnStatement.prototype.visit = function(visitor) {
20396 return visitor.visitReturnStatement(this); 20806 return visitor.visitReturnStatement(this);
20397 } 20807 }
20398 ReturnStatement.prototype.visit$1 = function($0) { 20808 ReturnStatement.prototype.visit$1 = function($0) {
20399 return this.visit(($0 && $0.is$TreeVisitor())); 20809 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20400 }; 20810 };
20401 // ********** Code for ThrowStatement ************** 20811 // ********** Code for ThrowStatement **************
20402 function ThrowStatement(value, span) { 20812 function ThrowStatement(value, span) {
20403 this.value = value; 20813 this.value = value;
20404 // Initializers done 20814 // Initializers done
20405 lang_Statement.call(this, span); 20815 lang_Statement.call(this, span);
20406 } 20816 }
20407 $inherits(ThrowStatement, lang_Statement); 20817 $inherits(ThrowStatement, lang_Statement);
20408 ThrowStatement.prototype.get$value = function() { return this.value; }; 20818 ThrowStatement.prototype.get$value = function() { return this.value; };
20409 ThrowStatement.prototype.set$value = function(value) { return this.value = value ; }; 20819 ThrowStatement.prototype.set$value = function(value) { return this.value = value ; };
20410 ThrowStatement.prototype.visit = function(visitor) { 20820 ThrowStatement.prototype.visit = function(visitor) {
20411 return visitor.visitThrowStatement(this); 20821 return visitor.visitThrowStatement(this);
20412 } 20822 }
20413 ThrowStatement.prototype.visit$1 = function($0) { 20823 ThrowStatement.prototype.visit$1 = function($0) {
20414 return this.visit(($0 && $0.is$TreeVisitor())); 20824 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20415 }; 20825 };
20416 // ********** Code for AssertStatement ************** 20826 // ********** Code for AssertStatement **************
20417 function AssertStatement(test, span) { 20827 function AssertStatement(test, span) {
20418 this.test = test; 20828 this.test = test;
20419 // Initializers done 20829 // Initializers done
20420 lang_Statement.call(this, span); 20830 lang_Statement.call(this, span);
20421 } 20831 }
20422 $inherits(AssertStatement, lang_Statement); 20832 $inherits(AssertStatement, lang_Statement);
20423 AssertStatement.prototype.visit = function(visitor) { 20833 AssertStatement.prototype.visit = function(visitor) {
20424 return visitor.visitAssertStatement(this); 20834 return visitor.visitAssertStatement(this);
20425 } 20835 }
20426 AssertStatement.prototype.visit$1 = function($0) { 20836 AssertStatement.prototype.visit$1 = function($0) {
20427 return this.visit(($0 && $0.is$TreeVisitor())); 20837 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20428 }; 20838 };
20429 // ********** Code for BreakStatement ************** 20839 // ********** Code for BreakStatement **************
20430 function BreakStatement(label, span) { 20840 function BreakStatement(label, span) {
20431 this.label = label; 20841 this.label = label;
20432 // Initializers done 20842 // Initializers done
20433 lang_Statement.call(this, span); 20843 lang_Statement.call(this, span);
20434 } 20844 }
20435 $inherits(BreakStatement, lang_Statement); 20845 $inherits(BreakStatement, lang_Statement);
20436 BreakStatement.prototype.get$label = function() { return this.label; }; 20846 BreakStatement.prototype.get$label = function() { return this.label; };
20437 BreakStatement.prototype.set$label = function(value) { return this.label = value ; }; 20847 BreakStatement.prototype.set$label = function(value) { return this.label = value ; };
20438 BreakStatement.prototype.visit = function(visitor) { 20848 BreakStatement.prototype.visit = function(visitor) {
20439 return visitor.visitBreakStatement(this); 20849 return visitor.visitBreakStatement(this);
20440 } 20850 }
20441 BreakStatement.prototype.visit$1 = function($0) { 20851 BreakStatement.prototype.visit$1 = function($0) {
20442 return this.visit(($0 && $0.is$TreeVisitor())); 20852 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20443 }; 20853 };
20444 // ********** Code for ContinueStatement ************** 20854 // ********** Code for ContinueStatement **************
20445 function ContinueStatement(label, span) { 20855 function ContinueStatement(label, span) {
20446 this.label = label; 20856 this.label = label;
20447 // Initializers done 20857 // Initializers done
20448 lang_Statement.call(this, span); 20858 lang_Statement.call(this, span);
20449 } 20859 }
20450 $inherits(ContinueStatement, lang_Statement); 20860 $inherits(ContinueStatement, lang_Statement);
20451 ContinueStatement.prototype.get$label = function() { return this.label; }; 20861 ContinueStatement.prototype.get$label = function() { return this.label; };
20452 ContinueStatement.prototype.set$label = function(value) { return this.label = va lue; }; 20862 ContinueStatement.prototype.set$label = function(value) { return this.label = va lue; };
20453 ContinueStatement.prototype.visit = function(visitor) { 20863 ContinueStatement.prototype.visit = function(visitor) {
20454 return visitor.visitContinueStatement(this); 20864 return visitor.visitContinueStatement(this);
20455 } 20865 }
20456 ContinueStatement.prototype.visit$1 = function($0) { 20866 ContinueStatement.prototype.visit$1 = function($0) {
20457 return this.visit(($0 && $0.is$TreeVisitor())); 20867 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20458 }; 20868 };
20459 // ********** Code for IfStatement ************** 20869 // ********** Code for IfStatement **************
20460 function IfStatement(test, trueBranch, falseBranch, span) { 20870 function IfStatement(test, trueBranch, falseBranch, span) {
20461 this.test = test; 20871 this.test = test;
20462 this.trueBranch = trueBranch; 20872 this.trueBranch = trueBranch;
20463 this.falseBranch = falseBranch; 20873 this.falseBranch = falseBranch;
20464 // Initializers done 20874 // Initializers done
20465 lang_Statement.call(this, span); 20875 lang_Statement.call(this, span);
20466 } 20876 }
20467 $inherits(IfStatement, lang_Statement); 20877 $inherits(IfStatement, lang_Statement);
20468 IfStatement.prototype.visit = function(visitor) { 20878 IfStatement.prototype.visit = function(visitor) {
20469 return visitor.visitIfStatement(this); 20879 return visitor.visitIfStatement(this);
20470 } 20880 }
20471 IfStatement.prototype.visit$1 = function($0) { 20881 IfStatement.prototype.visit$1 = function($0) {
20472 return this.visit(($0 && $0.is$TreeVisitor())); 20882 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20473 }; 20883 };
20474 // ********** Code for WhileStatement ************** 20884 // ********** Code for WhileStatement **************
20475 function WhileStatement(test, body, span) { 20885 function WhileStatement(test, body, span) {
20476 this.test = test; 20886 this.test = test;
20477 this.body = body; 20887 this.body = body;
20478 // Initializers done 20888 // Initializers done
20479 lang_Statement.call(this, span); 20889 lang_Statement.call(this, span);
20480 } 20890 }
20481 $inherits(WhileStatement, lang_Statement); 20891 $inherits(WhileStatement, lang_Statement);
20482 WhileStatement.prototype.get$body = function() { return this.body; }; 20892 WhileStatement.prototype.get$body = function() { return this.body; };
20483 WhileStatement.prototype.set$body = function(value) { return this.body = value; }; 20893 WhileStatement.prototype.set$body = function(value) { return this.body = value; };
20484 WhileStatement.prototype.visit = function(visitor) { 20894 WhileStatement.prototype.visit = function(visitor) {
20485 return visitor.visitWhileStatement(this); 20895 return visitor.visitWhileStatement(this);
20486 } 20896 }
20487 WhileStatement.prototype.visit$1 = function($0) { 20897 WhileStatement.prototype.visit$1 = function($0) {
20488 return this.visit(($0 && $0.is$TreeVisitor())); 20898 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20489 }; 20899 };
20490 // ********** Code for DoStatement ************** 20900 // ********** Code for DoStatement **************
20491 function DoStatement(body, test, span) { 20901 function DoStatement(body, test, span) {
20492 this.body = body; 20902 this.body = body;
20493 this.test = test; 20903 this.test = test;
20494 // Initializers done 20904 // Initializers done
20495 lang_Statement.call(this, span); 20905 lang_Statement.call(this, span);
20496 } 20906 }
20497 $inherits(DoStatement, lang_Statement); 20907 $inherits(DoStatement, lang_Statement);
20498 DoStatement.prototype.get$body = function() { return this.body; }; 20908 DoStatement.prototype.get$body = function() { return this.body; };
20499 DoStatement.prototype.set$body = function(value) { return this.body = value; }; 20909 DoStatement.prototype.set$body = function(value) { return this.body = value; };
20500 DoStatement.prototype.visit = function(visitor) { 20910 DoStatement.prototype.visit = function(visitor) {
20501 return visitor.visitDoStatement(this); 20911 return visitor.visitDoStatement(this);
20502 } 20912 }
20503 DoStatement.prototype.visit$1 = function($0) { 20913 DoStatement.prototype.visit$1 = function($0) {
20504 return this.visit(($0 && $0.is$TreeVisitor())); 20914 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20505 }; 20915 };
20506 // ********** Code for ForStatement ************** 20916 // ********** Code for ForStatement **************
20507 function ForStatement(init, test, step, body, span) { 20917 function ForStatement(init, test, step, body, span) {
20508 this.init = init; 20918 this.init = init;
20509 this.test = test; 20919 this.test = test;
20510 this.step = step; 20920 this.step = step;
20511 this.body = body; 20921 this.body = body;
20512 // Initializers done 20922 // Initializers done
20513 lang_Statement.call(this, span); 20923 lang_Statement.call(this, span);
20514 } 20924 }
20515 $inherits(ForStatement, lang_Statement); 20925 $inherits(ForStatement, lang_Statement);
20516 ForStatement.prototype.get$body = function() { return this.body; }; 20926 ForStatement.prototype.get$body = function() { return this.body; };
20517 ForStatement.prototype.set$body = function(value) { return this.body = value; }; 20927 ForStatement.prototype.set$body = function(value) { return this.body = value; };
20518 ForStatement.prototype.visit = function(visitor) { 20928 ForStatement.prototype.visit = function(visitor) {
20519 return visitor.visitForStatement(this); 20929 return visitor.visitForStatement(this);
20520 } 20930 }
20521 ForStatement.prototype.visit$1 = function($0) { 20931 ForStatement.prototype.visit$1 = function($0) {
20522 return this.visit(($0 && $0.is$TreeVisitor())); 20932 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20523 }; 20933 };
20524 // ********** Code for ForInStatement ************** 20934 // ********** Code for ForInStatement **************
20525 function ForInStatement(item, list, body, span) { 20935 function ForInStatement(item, list, body, span) {
20526 this.item = item; 20936 this.item = item;
20527 this.list = list; 20937 this.list = list;
20528 this.body = body; 20938 this.body = body;
20529 // Initializers done 20939 // Initializers done
20530 lang_Statement.call(this, span); 20940 lang_Statement.call(this, span);
20531 } 20941 }
20532 $inherits(ForInStatement, lang_Statement); 20942 $inherits(ForInStatement, lang_Statement);
20533 ForInStatement.prototype.get$body = function() { return this.body; }; 20943 ForInStatement.prototype.get$body = function() { return this.body; };
20534 ForInStatement.prototype.set$body = function(value) { return this.body = value; }; 20944 ForInStatement.prototype.set$body = function(value) { return this.body = value; };
20535 ForInStatement.prototype.visit = function(visitor) { 20945 ForInStatement.prototype.visit = function(visitor) {
20536 return visitor.visitForInStatement(this); 20946 return visitor.visitForInStatement(this);
20537 } 20947 }
20538 ForInStatement.prototype.visit$1 = function($0) { 20948 ForInStatement.prototype.visit$1 = function($0) {
20539 return this.visit(($0 && $0.is$TreeVisitor())); 20949 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20540 }; 20950 };
20541 // ********** Code for TryStatement ************** 20951 // ********** Code for TryStatement **************
20542 function TryStatement(body, catches, finallyBlock, span) { 20952 function TryStatement(body, catches, finallyBlock, span) {
20543 this.body = body; 20953 this.body = body;
20544 this.catches = catches; 20954 this.catches = catches;
20545 this.finallyBlock = finallyBlock; 20955 this.finallyBlock = finallyBlock;
20546 // Initializers done 20956 // Initializers done
20547 lang_Statement.call(this, span); 20957 lang_Statement.call(this, span);
20548 } 20958 }
20549 $inherits(TryStatement, lang_Statement); 20959 $inherits(TryStatement, lang_Statement);
20550 TryStatement.prototype.get$body = function() { return this.body; }; 20960 TryStatement.prototype.get$body = function() { return this.body; };
20551 TryStatement.prototype.set$body = function(value) { return this.body = value; }; 20961 TryStatement.prototype.set$body = function(value) { return this.body = value; };
20552 TryStatement.prototype.visit = function(visitor) { 20962 TryStatement.prototype.visit = function(visitor) {
20553 return visitor.visitTryStatement(this); 20963 return visitor.visitTryStatement(this);
20554 } 20964 }
20555 TryStatement.prototype.visit$1 = function($0) { 20965 TryStatement.prototype.visit$1 = function($0) {
20556 return this.visit(($0 && $0.is$TreeVisitor())); 20966 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20557 }; 20967 };
20558 // ********** Code for SwitchStatement ************** 20968 // ********** Code for SwitchStatement **************
20559 function SwitchStatement(test, cases, span) { 20969 function SwitchStatement(test, cases, span) {
20560 this.test = test; 20970 this.test = test;
20561 this.cases = cases; 20971 this.cases = cases;
20562 // Initializers done 20972 // Initializers done
20563 lang_Statement.call(this, span); 20973 lang_Statement.call(this, span);
20564 } 20974 }
20565 $inherits(SwitchStatement, lang_Statement); 20975 $inherits(SwitchStatement, lang_Statement);
20566 SwitchStatement.prototype.get$cases = function() { return this.cases; }; 20976 SwitchStatement.prototype.get$cases = function() { return this.cases; };
20567 SwitchStatement.prototype.set$cases = function(value) { return this.cases = valu e; }; 20977 SwitchStatement.prototype.set$cases = function(value) { return this.cases = valu e; };
20568 SwitchStatement.prototype.visit = function(visitor) { 20978 SwitchStatement.prototype.visit = function(visitor) {
20569 return visitor.visitSwitchStatement(this); 20979 return visitor.visitSwitchStatement(this);
20570 } 20980 }
20571 SwitchStatement.prototype.visit$1 = function($0) { 20981 SwitchStatement.prototype.visit$1 = function($0) {
20572 return this.visit(($0 && $0.is$TreeVisitor())); 20982 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20573 }; 20983 };
20574 // ********** Code for BlockStatement ************** 20984 // ********** Code for BlockStatement **************
20575 function BlockStatement(body, span) { 20985 function BlockStatement(body, span) {
20576 this.body = body; 20986 this.body = body;
20577 // Initializers done 20987 // Initializers done
20578 lang_Statement.call(this, span); 20988 lang_Statement.call(this, span);
20579 } 20989 }
20580 $inherits(BlockStatement, lang_Statement); 20990 $inherits(BlockStatement, lang_Statement);
20581 BlockStatement.prototype.is$BlockStatement = function(){return this;}; 20991 BlockStatement.prototype.assert$BlockStatement = function(){return this};
20582 BlockStatement.prototype.get$body = function() { return this.body; }; 20992 BlockStatement.prototype.get$body = function() { return this.body; };
20583 BlockStatement.prototype.set$body = function(value) { return this.body = value; }; 20993 BlockStatement.prototype.set$body = function(value) { return this.body = value; };
20584 BlockStatement.prototype.visit = function(visitor) { 20994 BlockStatement.prototype.visit = function(visitor) {
20585 return visitor.visitBlockStatement(this); 20995 return visitor.visitBlockStatement(this);
20586 } 20996 }
20587 BlockStatement.prototype.visit$1 = function($0) { 20997 BlockStatement.prototype.visit$1 = function($0) {
20588 return this.visit(($0 && $0.is$TreeVisitor())); 20998 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20589 }; 20999 };
20590 // ********** Code for LabeledStatement ************** 21000 // ********** Code for LabeledStatement **************
20591 function LabeledStatement(name, body, span) { 21001 function LabeledStatement(name, body, span) {
20592 this.name = name; 21002 this.name = name;
20593 this.body = body; 21003 this.body = body;
20594 // Initializers done 21004 // Initializers done
20595 lang_Statement.call(this, span); 21005 lang_Statement.call(this, span);
20596 } 21006 }
20597 $inherits(LabeledStatement, lang_Statement); 21007 $inherits(LabeledStatement, lang_Statement);
20598 LabeledStatement.prototype.get$name = function() { return this.name; }; 21008 LabeledStatement.prototype.get$name = function() { return this.name; };
20599 LabeledStatement.prototype.set$name = function(value) { return this.name = value ; }; 21009 LabeledStatement.prototype.set$name = function(value) { return this.name = value ; };
20600 LabeledStatement.prototype.get$body = function() { return this.body; }; 21010 LabeledStatement.prototype.get$body = function() { return this.body; };
20601 LabeledStatement.prototype.set$body = function(value) { return this.body = value ; }; 21011 LabeledStatement.prototype.set$body = function(value) { return this.body = value ; };
20602 LabeledStatement.prototype.visit = function(visitor) { 21012 LabeledStatement.prototype.visit = function(visitor) {
20603 return visitor.visitLabeledStatement(this); 21013 return visitor.visitLabeledStatement(this);
20604 } 21014 }
20605 LabeledStatement.prototype.visit$1 = function($0) { 21015 LabeledStatement.prototype.visit$1 = function($0) {
20606 return this.visit(($0 && $0.is$TreeVisitor())); 21016 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20607 }; 21017 };
20608 // ********** Code for lang_ExpressionStatement ************** 21018 // ********** Code for lang_ExpressionStatement **************
20609 function lang_ExpressionStatement(body, span) { 21019 function lang_ExpressionStatement(body, span) {
20610 this.body = body; 21020 this.body = body;
20611 // Initializers done 21021 // Initializers done
20612 lang_Statement.call(this, span); 21022 lang_Statement.call(this, span);
20613 } 21023 }
20614 $inherits(lang_ExpressionStatement, lang_Statement); 21024 $inherits(lang_ExpressionStatement, lang_Statement);
20615 lang_ExpressionStatement.prototype.get$body = function() { return this.body; }; 21025 lang_ExpressionStatement.prototype.get$body = function() { return this.body; };
20616 lang_ExpressionStatement.prototype.set$body = function(value) { return this.body = value; }; 21026 lang_ExpressionStatement.prototype.set$body = function(value) { return this.body = value; };
20617 lang_ExpressionStatement.prototype.visit = function(visitor) { 21027 lang_ExpressionStatement.prototype.visit = function(visitor) {
20618 return visitor.visitExpressionStatement(this); 21028 return visitor.visitExpressionStatement(this);
20619 } 21029 }
20620 lang_ExpressionStatement.prototype.visit$1 = function($0) { 21030 lang_ExpressionStatement.prototype.visit$1 = function($0) {
20621 return this.visit(($0 && $0.is$TreeVisitor())); 21031 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20622 }; 21032 };
20623 // ********** Code for EmptyStatement ************** 21033 // ********** Code for EmptyStatement **************
20624 function EmptyStatement(span) { 21034 function EmptyStatement(span) {
20625 // Initializers done 21035 // Initializers done
20626 lang_Statement.call(this, span); 21036 lang_Statement.call(this, span);
20627 } 21037 }
20628 $inherits(EmptyStatement, lang_Statement); 21038 $inherits(EmptyStatement, lang_Statement);
20629 EmptyStatement.prototype.visit = function(visitor) { 21039 EmptyStatement.prototype.visit = function(visitor) {
20630 return visitor.visitEmptyStatement(this); 21040 return visitor.visitEmptyStatement(this);
20631 } 21041 }
20632 EmptyStatement.prototype.visit$1 = function($0) { 21042 EmptyStatement.prototype.visit$1 = function($0) {
20633 return this.visit(($0 && $0.is$TreeVisitor())); 21043 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20634 }; 21044 };
20635 // ********** Code for DietStatement ************** 21045 // ********** Code for DietStatement **************
20636 function DietStatement(span) { 21046 function DietStatement(span) {
20637 // Initializers done 21047 // Initializers done
20638 lang_Statement.call(this, span); 21048 lang_Statement.call(this, span);
20639 } 21049 }
20640 $inherits(DietStatement, lang_Statement); 21050 $inherits(DietStatement, lang_Statement);
20641 DietStatement.prototype.visit = function(visitor) { 21051 DietStatement.prototype.visit = function(visitor) {
20642 return visitor.visitDietStatement(this); 21052 return visitor.visitDietStatement(this);
20643 } 21053 }
20644 DietStatement.prototype.visit$1 = function($0) { 21054 DietStatement.prototype.visit$1 = function($0) {
20645 return this.visit(($0 && $0.is$TreeVisitor())); 21055 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20646 }; 21056 };
20647 // ********** Code for LambdaExpression ************** 21057 // ********** Code for LambdaExpression **************
20648 function LambdaExpression(func, span) { 21058 function LambdaExpression(func, span) {
20649 this.func = func; 21059 this.func = func;
20650 // Initializers done 21060 // Initializers done
20651 lang_Expression.call(this, span); 21061 lang_Expression.call(this, span);
20652 } 21062 }
20653 $inherits(LambdaExpression, lang_Expression); 21063 $inherits(LambdaExpression, lang_Expression);
20654 LambdaExpression.prototype.is$LambdaExpression = function(){return this;}; 21064 LambdaExpression.prototype.assert$LambdaExpression = function(){return this};
20655 LambdaExpression.prototype.get$func = function() { return this.func; }; 21065 LambdaExpression.prototype.get$func = function() { return this.func; };
20656 LambdaExpression.prototype.set$func = function(value) { return this.func = value ; }; 21066 LambdaExpression.prototype.set$func = function(value) { return this.func = value ; };
20657 LambdaExpression.prototype.visit = function(visitor) { 21067 LambdaExpression.prototype.visit = function(visitor) {
20658 return visitor.visitLambdaExpression(this); 21068 return visitor.visitLambdaExpression(this);
20659 } 21069 }
20660 LambdaExpression.prototype.visit$1 = function($0) { 21070 LambdaExpression.prototype.visit$1 = function($0) {
20661 return this.visit(($0 && $0.is$TreeVisitor())); 21071 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20662 }; 21072 };
20663 // ********** Code for CallExpression ************** 21073 // ********** Code for CallExpression **************
20664 function CallExpression(target, arguments, span) { 21074 function CallExpression(target, arguments, span) {
20665 this.target = target; 21075 this.target = target;
20666 this.arguments = arguments; 21076 this.arguments = arguments;
20667 // Initializers done 21077 // Initializers done
20668 lang_Expression.call(this, span); 21078 lang_Expression.call(this, span);
20669 } 21079 }
20670 $inherits(CallExpression, lang_Expression); 21080 $inherits(CallExpression, lang_Expression);
20671 CallExpression.prototype.is$CallExpression = function(){return this;}; 21081 CallExpression.prototype.assert$CallExpression = function(){return this};
20672 CallExpression.prototype.get$target = function() { return this.target; }; 21082 CallExpression.prototype.get$target = function() { return this.target; };
20673 CallExpression.prototype.set$target = function(value) { return this.target = val ue; }; 21083 CallExpression.prototype.set$target = function(value) { return this.target = val ue; };
20674 CallExpression.prototype.get$arguments = function() { return this.arguments; }; 21084 CallExpression.prototype.get$arguments = function() { return this.arguments; };
20675 CallExpression.prototype.set$arguments = function(value) { return this.arguments = value; }; 21085 CallExpression.prototype.set$arguments = function(value) { return this.arguments = value; };
20676 CallExpression.prototype.visit = function(visitor) { 21086 CallExpression.prototype.visit = function(visitor) {
20677 return visitor.visitCallExpression(this); 21087 return visitor.visitCallExpression(this);
20678 } 21088 }
20679 CallExpression.prototype.visit$1 = function($0) { 21089 CallExpression.prototype.visit$1 = function($0) {
20680 return this.visit(($0 && $0.is$TreeVisitor())); 21090 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20681 }; 21091 };
20682 // ********** Code for IndexExpression ************** 21092 // ********** Code for IndexExpression **************
20683 function IndexExpression(target, index, span) { 21093 function IndexExpression(target, index, span) {
20684 this.target = target; 21094 this.target = target;
20685 this.index = index; 21095 this.index = index;
20686 // Initializers done 21096 // Initializers done
20687 lang_Expression.call(this, span); 21097 lang_Expression.call(this, span);
20688 } 21098 }
20689 $inherits(IndexExpression, lang_Expression); 21099 $inherits(IndexExpression, lang_Expression);
20690 IndexExpression.prototype.is$IndexExpression = function(){return this;}; 21100 IndexExpression.prototype.assert$IndexExpression = function(){return this};
20691 IndexExpression.prototype.get$target = function() { return this.target; }; 21101 IndexExpression.prototype.get$target = function() { return this.target; };
20692 IndexExpression.prototype.set$target = function(value) { return this.target = va lue; }; 21102 IndexExpression.prototype.set$target = function(value) { return this.target = va lue; };
20693 IndexExpression.prototype.visit = function(visitor) { 21103 IndexExpression.prototype.visit = function(visitor) {
20694 return visitor.visitIndexExpression(this); 21104 return visitor.visitIndexExpression(this);
20695 } 21105 }
20696 IndexExpression.prototype.visit$1 = function($0) { 21106 IndexExpression.prototype.visit$1 = function($0) {
20697 return this.visit(($0 && $0.is$TreeVisitor())); 21107 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20698 }; 21108 };
20699 // ********** Code for BinaryExpression ************** 21109 // ********** Code for BinaryExpression **************
20700 function BinaryExpression(op, x, y, span) { 21110 function BinaryExpression(op, x, y, span) {
20701 this.op = op; 21111 this.op = op;
20702 this.x = x; 21112 this.x = x;
20703 this.y = y; 21113 this.y = y;
20704 // Initializers done 21114 // Initializers done
20705 lang_Expression.call(this, span); 21115 lang_Expression.call(this, span);
20706 } 21116 }
20707 $inherits(BinaryExpression, lang_Expression); 21117 $inherits(BinaryExpression, lang_Expression);
20708 BinaryExpression.prototype.is$BinaryExpression = function(){return this;}; 21118 BinaryExpression.prototype.assert$BinaryExpression = function(){return this};
20709 BinaryExpression.prototype.get$op = function() { return this.op; }; 21119 BinaryExpression.prototype.get$op = function() { return this.op; };
20710 BinaryExpression.prototype.set$op = function(value) { return this.op = value; }; 21120 BinaryExpression.prototype.set$op = function(value) { return this.op = value; };
20711 BinaryExpression.prototype.get$x = function() { return this.x; }; 21121 BinaryExpression.prototype.get$x = function() { return this.x; };
20712 BinaryExpression.prototype.set$x = function(value) { return this.x = value; }; 21122 BinaryExpression.prototype.set$x = function(value) { return this.x = value; };
20713 BinaryExpression.prototype.get$y = function() { return this.y; }; 21123 BinaryExpression.prototype.get$y = function() { return this.y; };
20714 BinaryExpression.prototype.set$y = function(value) { return this.y = value; }; 21124 BinaryExpression.prototype.set$y = function(value) { return this.y = value; };
20715 BinaryExpression.prototype.visit = function(visitor) { 21125 BinaryExpression.prototype.visit = function(visitor) {
20716 return visitor.visitBinaryExpression(this); 21126 return visitor.visitBinaryExpression(this);
20717 } 21127 }
20718 BinaryExpression.prototype.visit$1 = function($0) { 21128 BinaryExpression.prototype.visit$1 = function($0) {
20719 return this.visit(($0 && $0.is$TreeVisitor())); 21129 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20720 }; 21130 };
20721 // ********** Code for UnaryExpression ************** 21131 // ********** Code for UnaryExpression **************
20722 function UnaryExpression(op, self, span) { 21132 function UnaryExpression(op, self, span) {
20723 this.op = op; 21133 this.op = op;
20724 this.self = self; 21134 this.self = self;
20725 // Initializers done 21135 // Initializers done
20726 lang_Expression.call(this, span); 21136 lang_Expression.call(this, span);
20727 } 21137 }
20728 $inherits(UnaryExpression, lang_Expression); 21138 $inherits(UnaryExpression, lang_Expression);
20729 UnaryExpression.prototype.is$UnaryExpression = function(){return this;}; 21139 UnaryExpression.prototype.assert$UnaryExpression = function(){return this};
20730 UnaryExpression.prototype.get$op = function() { return this.op; }; 21140 UnaryExpression.prototype.get$op = function() { return this.op; };
20731 UnaryExpression.prototype.set$op = function(value) { return this.op = value; }; 21141 UnaryExpression.prototype.set$op = function(value) { return this.op = value; };
20732 UnaryExpression.prototype.get$self = function() { return this.self; }; 21142 UnaryExpression.prototype.get$self = function() { return this.self; };
20733 UnaryExpression.prototype.set$self = function(value) { return this.self = value; }; 21143 UnaryExpression.prototype.set$self = function(value) { return this.self = value; };
20734 UnaryExpression.prototype.visit = function(visitor) { 21144 UnaryExpression.prototype.visit = function(visitor) {
20735 return visitor.visitUnaryExpression(this); 21145 return visitor.visitUnaryExpression(this);
20736 } 21146 }
20737 UnaryExpression.prototype.visit$1 = function($0) { 21147 UnaryExpression.prototype.visit$1 = function($0) {
20738 return this.visit(($0 && $0.is$TreeVisitor())); 21148 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20739 }; 21149 };
20740 // ********** Code for PostfixExpression ************** 21150 // ********** Code for PostfixExpression **************
20741 function PostfixExpression(body, op, span) { 21151 function PostfixExpression(body, op, span) {
20742 this.body = body; 21152 this.body = body;
20743 this.op = op; 21153 this.op = op;
20744 // Initializers done 21154 // Initializers done
20745 lang_Expression.call(this, span); 21155 lang_Expression.call(this, span);
20746 } 21156 }
20747 $inherits(PostfixExpression, lang_Expression); 21157 $inherits(PostfixExpression, lang_Expression);
20748 PostfixExpression.prototype.is$PostfixExpression = function(){return this;}; 21158 PostfixExpression.prototype.assert$PostfixExpression = function(){return this};
20749 PostfixExpression.prototype.get$body = function() { return this.body; }; 21159 PostfixExpression.prototype.get$body = function() { return this.body; };
20750 PostfixExpression.prototype.set$body = function(value) { return this.body = valu e; }; 21160 PostfixExpression.prototype.set$body = function(value) { return this.body = valu e; };
20751 PostfixExpression.prototype.get$op = function() { return this.op; }; 21161 PostfixExpression.prototype.get$op = function() { return this.op; };
20752 PostfixExpression.prototype.set$op = function(value) { return this.op = value; } ; 21162 PostfixExpression.prototype.set$op = function(value) { return this.op = value; } ;
20753 PostfixExpression.prototype.visit = function(visitor) { 21163 PostfixExpression.prototype.visit = function(visitor) {
20754 return visitor.visitPostfixExpression$1(this); 21164 return visitor.visitPostfixExpression$1(this);
20755 } 21165 }
20756 PostfixExpression.prototype.visit$1 = function($0) { 21166 PostfixExpression.prototype.visit$1 = function($0) {
20757 return this.visit(($0 && $0.is$TreeVisitor())); 21167 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20758 }; 21168 };
20759 // ********** Code for lang_NewExpression ************** 21169 // ********** Code for lang_NewExpression **************
20760 function lang_NewExpression(isConst, type, name, arguments, span) { 21170 function lang_NewExpression(isConst, type, name, arguments, span) {
20761 this.isConst = isConst; 21171 this.isConst = isConst;
20762 this.type = type; 21172 this.type = type;
20763 this.name = name; 21173 this.name = name;
20764 this.arguments = arguments; 21174 this.arguments = arguments;
20765 // Initializers done 21175 // Initializers done
20766 lang_Expression.call(this, span); 21176 lang_Expression.call(this, span);
20767 } 21177 }
20768 $inherits(lang_NewExpression, lang_Expression); 21178 $inherits(lang_NewExpression, lang_Expression);
20769 lang_NewExpression.prototype.get$isConst = function() { return this.isConst; }; 21179 lang_NewExpression.prototype.get$isConst = function() { return this.isConst; };
20770 lang_NewExpression.prototype.set$isConst = function(value) { return this.isConst = value; }; 21180 lang_NewExpression.prototype.set$isConst = function(value) { return this.isConst = value; };
20771 lang_NewExpression.prototype.get$type = function() { return this.type; }; 21181 lang_NewExpression.prototype.get$type = function() { return this.type; };
20772 lang_NewExpression.prototype.set$type = function(value) { return this.type = val ue; }; 21182 lang_NewExpression.prototype.set$type = function(value) { return this.type = val ue; };
20773 lang_NewExpression.prototype.get$name = function() { return this.name; }; 21183 lang_NewExpression.prototype.get$name = function() { return this.name; };
20774 lang_NewExpression.prototype.set$name = function(value) { return this.name = val ue; }; 21184 lang_NewExpression.prototype.set$name = function(value) { return this.name = val ue; };
20775 lang_NewExpression.prototype.get$arguments = function() { return this.arguments; }; 21185 lang_NewExpression.prototype.get$arguments = function() { return this.arguments; };
20776 lang_NewExpression.prototype.set$arguments = function(value) { return this.argum ents = value; }; 21186 lang_NewExpression.prototype.set$arguments = function(value) { return this.argum ents = value; };
20777 lang_NewExpression.prototype.visit = function(visitor) { 21187 lang_NewExpression.prototype.visit = function(visitor) {
20778 return visitor.visitNewExpression(this); 21188 return visitor.visitNewExpression(this);
20779 } 21189 }
20780 lang_NewExpression.prototype.visit$1 = function($0) { 21190 lang_NewExpression.prototype.visit$1 = function($0) {
20781 return this.visit(($0 && $0.is$TreeVisitor())); 21191 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20782 }; 21192 };
20783 // ********** Code for ListExpression ************** 21193 // ********** Code for ListExpression **************
20784 function ListExpression(isConst, type, values, span) { 21194 function ListExpression(isConst, type, values, span) {
20785 this.isConst = isConst; 21195 this.isConst = isConst;
20786 this.type = type; 21196 this.type = type;
20787 this.values = values; 21197 this.values = values;
20788 // Initializers done 21198 // Initializers done
20789 lang_Expression.call(this, span); 21199 lang_Expression.call(this, span);
20790 } 21200 }
20791 $inherits(ListExpression, lang_Expression); 21201 $inherits(ListExpression, lang_Expression);
20792 ListExpression.prototype.get$isConst = function() { return this.isConst; }; 21202 ListExpression.prototype.get$isConst = function() { return this.isConst; };
20793 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v alue; }; 21203 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v alue; };
20794 ListExpression.prototype.get$type = function() { return this.type; }; 21204 ListExpression.prototype.get$type = function() { return this.type; };
20795 ListExpression.prototype.set$type = function(value) { return this.type = value; }; 21205 ListExpression.prototype.set$type = function(value) { return this.type = value; };
20796 ListExpression.prototype.get$values = function() { return this.values; }; 21206 ListExpression.prototype.get$values = function() { return this.values; };
20797 ListExpression.prototype.set$values = function(value) { return this.values = val ue; }; 21207 ListExpression.prototype.set$values = function(value) { return this.values = val ue; };
20798 ListExpression.prototype.visit = function(visitor) { 21208 ListExpression.prototype.visit = function(visitor) {
20799 return visitor.visitListExpression(this); 21209 return visitor.visitListExpression(this);
20800 } 21210 }
20801 ListExpression.prototype.visit$1 = function($0) { 21211 ListExpression.prototype.visit$1 = function($0) {
20802 return this.visit(($0 && $0.is$TreeVisitor())); 21212 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20803 }; 21213 };
20804 // ********** Code for MapExpression ************** 21214 // ********** Code for MapExpression **************
20805 function MapExpression(isConst, type, items, span) { 21215 function MapExpression(isConst, type, items, span) {
20806 this.isConst = isConst; 21216 this.isConst = isConst;
20807 this.type = type; 21217 this.type = type;
20808 this.items = items; 21218 this.items = items;
20809 // Initializers done 21219 // Initializers done
20810 lang_Expression.call(this, span); 21220 lang_Expression.call(this, span);
20811 } 21221 }
20812 $inherits(MapExpression, lang_Expression); 21222 $inherits(MapExpression, lang_Expression);
20813 MapExpression.prototype.get$isConst = function() { return this.isConst; }; 21223 MapExpression.prototype.get$isConst = function() { return this.isConst; };
20814 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va lue; }; 21224 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va lue; };
20815 MapExpression.prototype.get$type = function() { return this.type; }; 21225 MapExpression.prototype.get$type = function() { return this.type; };
20816 MapExpression.prototype.set$type = function(value) { return this.type = value; } ; 21226 MapExpression.prototype.set$type = function(value) { return this.type = value; } ;
20817 MapExpression.prototype.visit = function(visitor) { 21227 MapExpression.prototype.visit = function(visitor) {
20818 return visitor.visitMapExpression(this); 21228 return visitor.visitMapExpression(this);
20819 } 21229 }
20820 MapExpression.prototype.visit$1 = function($0) { 21230 MapExpression.prototype.visit$1 = function($0) {
20821 return this.visit(($0 && $0.is$TreeVisitor())); 21231 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20822 }; 21232 };
20823 // ********** Code for ConditionalExpression ************** 21233 // ********** Code for ConditionalExpression **************
20824 function ConditionalExpression(test, trueBranch, falseBranch, span) { 21234 function ConditionalExpression(test, trueBranch, falseBranch, span) {
20825 this.test = test; 21235 this.test = test;
20826 this.trueBranch = trueBranch; 21236 this.trueBranch = trueBranch;
20827 this.falseBranch = falseBranch; 21237 this.falseBranch = falseBranch;
20828 // Initializers done 21238 // Initializers done
20829 lang_Expression.call(this, span); 21239 lang_Expression.call(this, span);
20830 } 21240 }
20831 $inherits(ConditionalExpression, lang_Expression); 21241 $inherits(ConditionalExpression, lang_Expression);
20832 ConditionalExpression.prototype.visit = function(visitor) { 21242 ConditionalExpression.prototype.visit = function(visitor) {
20833 return visitor.visitConditionalExpression(this); 21243 return visitor.visitConditionalExpression(this);
20834 } 21244 }
20835 ConditionalExpression.prototype.visit$1 = function($0) { 21245 ConditionalExpression.prototype.visit$1 = function($0) {
20836 return this.visit(($0 && $0.is$TreeVisitor())); 21246 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20837 }; 21247 };
20838 // ********** Code for IsExpression ************** 21248 // ********** Code for IsExpression **************
20839 function IsExpression(isTrue, x, type, span) { 21249 function IsExpression(isTrue, x, type, span) {
20840 this.isTrue = isTrue; 21250 this.isTrue = isTrue;
20841 this.x = x; 21251 this.x = x;
20842 this.type = type; 21252 this.type = type;
20843 // Initializers done 21253 // Initializers done
20844 lang_Expression.call(this, span); 21254 lang_Expression.call(this, span);
20845 } 21255 }
20846 $inherits(IsExpression, lang_Expression); 21256 $inherits(IsExpression, lang_Expression);
20847 IsExpression.prototype.get$x = function() { return this.x; }; 21257 IsExpression.prototype.get$x = function() { return this.x; };
20848 IsExpression.prototype.set$x = function(value) { return this.x = value; }; 21258 IsExpression.prototype.set$x = function(value) { return this.x = value; };
20849 IsExpression.prototype.get$type = function() { return this.type; }; 21259 IsExpression.prototype.get$type = function() { return this.type; };
20850 IsExpression.prototype.set$type = function(value) { return this.type = value; }; 21260 IsExpression.prototype.set$type = function(value) { return this.type = value; };
20851 IsExpression.prototype.visit = function(visitor) { 21261 IsExpression.prototype.visit = function(visitor) {
20852 return visitor.visitIsExpression(this); 21262 return visitor.visitIsExpression(this);
20853 } 21263 }
20854 IsExpression.prototype.visit$1 = function($0) { 21264 IsExpression.prototype.visit$1 = function($0) {
20855 return this.visit(($0 && $0.is$TreeVisitor())); 21265 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20856 }; 21266 };
20857 // ********** Code for ParenExpression ************** 21267 // ********** Code for ParenExpression **************
20858 function ParenExpression(body, span) { 21268 function ParenExpression(body, span) {
20859 this.body = body; 21269 this.body = body;
20860 // Initializers done 21270 // Initializers done
20861 lang_Expression.call(this, span); 21271 lang_Expression.call(this, span);
20862 } 21272 }
20863 $inherits(ParenExpression, lang_Expression); 21273 $inherits(ParenExpression, lang_Expression);
20864 ParenExpression.prototype.get$body = function() { return this.body; }; 21274 ParenExpression.prototype.get$body = function() { return this.body; };
20865 ParenExpression.prototype.set$body = function(value) { return this.body = value; }; 21275 ParenExpression.prototype.set$body = function(value) { return this.body = value; };
20866 ParenExpression.prototype.visit = function(visitor) { 21276 ParenExpression.prototype.visit = function(visitor) {
20867 return visitor.visitParenExpression(this); 21277 return visitor.visitParenExpression(this);
20868 } 21278 }
20869 ParenExpression.prototype.visit$1 = function($0) { 21279 ParenExpression.prototype.visit$1 = function($0) {
20870 return this.visit(($0 && $0.is$TreeVisitor())); 21280 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20871 }; 21281 };
20872 // ********** Code for DotExpression ************** 21282 // ********** Code for DotExpression **************
20873 function DotExpression(self, name, span) { 21283 function DotExpression(self, name, span) {
20874 this.self = self; 21284 this.self = self;
20875 this.name = name; 21285 this.name = name;
20876 // Initializers done 21286 // Initializers done
20877 lang_Expression.call(this, span); 21287 lang_Expression.call(this, span);
20878 } 21288 }
20879 $inherits(DotExpression, lang_Expression); 21289 $inherits(DotExpression, lang_Expression);
20880 DotExpression.prototype.is$DotExpression = function(){return this;}; 21290 DotExpression.prototype.assert$DotExpression = function(){return this};
20881 DotExpression.prototype.get$self = function() { return this.self; }; 21291 DotExpression.prototype.get$self = function() { return this.self; };
20882 DotExpression.prototype.set$self = function(value) { return this.self = value; } ; 21292 DotExpression.prototype.set$self = function(value) { return this.self = value; } ;
20883 DotExpression.prototype.get$name = function() { return this.name; }; 21293 DotExpression.prototype.get$name = function() { return this.name; };
20884 DotExpression.prototype.set$name = function(value) { return this.name = value; } ; 21294 DotExpression.prototype.set$name = function(value) { return this.name = value; } ;
20885 DotExpression.prototype.visit = function(visitor) { 21295 DotExpression.prototype.visit = function(visitor) {
20886 return visitor.visitDotExpression(this); 21296 return visitor.visitDotExpression(this);
20887 } 21297 }
20888 DotExpression.prototype.visit$1 = function($0) { 21298 DotExpression.prototype.visit$1 = function($0) {
20889 return this.visit(($0 && $0.is$TreeVisitor())); 21299 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20890 }; 21300 };
20891 // ********** Code for VarExpression ************** 21301 // ********** Code for VarExpression **************
20892 function VarExpression(name, span) { 21302 function VarExpression(name, span) {
20893 this.name = name; 21303 this.name = name;
20894 // Initializers done 21304 // Initializers done
20895 lang_Expression.call(this, span); 21305 lang_Expression.call(this, span);
20896 } 21306 }
20897 $inherits(VarExpression, lang_Expression); 21307 $inherits(VarExpression, lang_Expression);
20898 VarExpression.prototype.is$VarExpression = function(){return this;}; 21308 VarExpression.prototype.assert$VarExpression = function(){return this};
20899 VarExpression.prototype.get$name = function() { return this.name; }; 21309 VarExpression.prototype.get$name = function() { return this.name; };
20900 VarExpression.prototype.set$name = function(value) { return this.name = value; } ; 21310 VarExpression.prototype.set$name = function(value) { return this.name = value; } ;
20901 VarExpression.prototype.visit = function(visitor) { 21311 VarExpression.prototype.visit = function(visitor) {
20902 return visitor.visitVarExpression(this); 21312 return visitor.visitVarExpression(this);
20903 } 21313 }
20904 VarExpression.prototype.visit$1 = function($0) { 21314 VarExpression.prototype.visit$1 = function($0) {
20905 return this.visit(($0 && $0.is$TreeVisitor())); 21315 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20906 }; 21316 };
20907 // ********** Code for ThisExpression ************** 21317 // ********** Code for ThisExpression **************
20908 function ThisExpression(span) { 21318 function ThisExpression(span) {
20909 // Initializers done 21319 // Initializers done
20910 lang_Expression.call(this, span); 21320 lang_Expression.call(this, span);
20911 } 21321 }
20912 $inherits(ThisExpression, lang_Expression); 21322 $inherits(ThisExpression, lang_Expression);
20913 ThisExpression.prototype.visit = function(visitor) { 21323 ThisExpression.prototype.visit = function(visitor) {
20914 return visitor.visitThisExpression(this); 21324 return visitor.visitThisExpression(this);
20915 } 21325 }
20916 ThisExpression.prototype.visit$1 = function($0) { 21326 ThisExpression.prototype.visit$1 = function($0) {
20917 return this.visit(($0 && $0.is$TreeVisitor())); 21327 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20918 }; 21328 };
20919 // ********** Code for SuperExpression ************** 21329 // ********** Code for SuperExpression **************
20920 function SuperExpression(span) { 21330 function SuperExpression(span) {
20921 // Initializers done 21331 // Initializers done
20922 lang_Expression.call(this, span); 21332 lang_Expression.call(this, span);
20923 } 21333 }
20924 $inherits(SuperExpression, lang_Expression); 21334 $inherits(SuperExpression, lang_Expression);
20925 SuperExpression.prototype.visit = function(visitor) { 21335 SuperExpression.prototype.visit = function(visitor) {
20926 return visitor.visitSuperExpression(this); 21336 return visitor.visitSuperExpression(this);
20927 } 21337 }
20928 SuperExpression.prototype.visit$1 = function($0) { 21338 SuperExpression.prototype.visit$1 = function($0) {
20929 return this.visit(($0 && $0.is$TreeVisitor())); 21339 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20930 }; 21340 };
20931 // ********** Code for NullExpression ************** 21341 // ********** Code for NullExpression **************
20932 function NullExpression(span) { 21342 function NullExpression(span) {
20933 // Initializers done 21343 // Initializers done
20934 lang_Expression.call(this, span); 21344 lang_Expression.call(this, span);
20935 } 21345 }
20936 $inherits(NullExpression, lang_Expression); 21346 $inherits(NullExpression, lang_Expression);
20937 NullExpression.prototype.visit = function(visitor) { 21347 NullExpression.prototype.visit = function(visitor) {
20938 return visitor.visitNullExpression(this); 21348 return visitor.visitNullExpression(this);
20939 } 21349 }
20940 NullExpression.prototype.visit$1 = function($0) { 21350 NullExpression.prototype.visit$1 = function($0) {
20941 return this.visit(($0 && $0.is$TreeVisitor())); 21351 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20942 }; 21352 };
20943 // ********** Code for LiteralExpression ************** 21353 // ********** Code for LiteralExpression **************
20944 function LiteralExpression(value, type, text, span) { 21354 function LiteralExpression(value, type, text, span) {
20945 this.value = value; 21355 this.value = value;
20946 this.type = type; 21356 this.type = type;
20947 this.text = text; 21357 this.text = text;
20948 // Initializers done 21358 // Initializers done
20949 lang_Expression.call(this, span); 21359 lang_Expression.call(this, span);
20950 } 21360 }
20951 $inherits(LiteralExpression, lang_Expression); 21361 $inherits(LiteralExpression, lang_Expression);
20952 LiteralExpression.prototype.get$value = function() { return this.value; }; 21362 LiteralExpression.prototype.get$value = function() { return this.value; };
20953 LiteralExpression.prototype.set$value = function(value) { return this.value = va lue; }; 21363 LiteralExpression.prototype.set$value = function(value) { return this.value = va lue; };
20954 LiteralExpression.prototype.get$type = function() { return this.type; }; 21364 LiteralExpression.prototype.get$type = function() { return this.type; };
20955 LiteralExpression.prototype.set$type = function(value) { return this.type = valu e; }; 21365 LiteralExpression.prototype.set$type = function(value) { return this.type = valu e; };
20956 LiteralExpression.prototype.get$text = function() { return this.text; }; 21366 LiteralExpression.prototype.get$text = function() { return this.text; };
20957 LiteralExpression.prototype.set$text = function(value) { return this.text = valu e; }; 21367 LiteralExpression.prototype.set$text = function(value) { return this.text = valu e; };
20958 LiteralExpression.prototype.visit = function(visitor) { 21368 LiteralExpression.prototype.visit = function(visitor) {
20959 return visitor.visitLiteralExpression(this); 21369 return visitor.visitLiteralExpression(this);
20960 } 21370 }
20961 LiteralExpression.prototype.visit$1 = function($0) { 21371 LiteralExpression.prototype.visit$1 = function($0) {
20962 return this.visit(($0 && $0.is$TreeVisitor())); 21372 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20963 }; 21373 };
20964 // ********** Code for NameTypeReference ************** 21374 // ********** Code for NameTypeReference **************
20965 function NameTypeReference(isFinal, name, names, span) { 21375 function NameTypeReference(isFinal, name, names, span) {
20966 this.isFinal = isFinal; 21376 this.isFinal = isFinal;
20967 this.name = name; 21377 this.name = name;
20968 this.names = names; 21378 this.names = names;
20969 // Initializers done 21379 // Initializers done
20970 TypeReference.call(this, span); 21380 TypeReference.call(this, span);
20971 } 21381 }
20972 $inherits(NameTypeReference, TypeReference); 21382 $inherits(NameTypeReference, TypeReference);
20973 NameTypeReference.prototype.is$NameTypeReference = function(){return this;}; 21383 NameTypeReference.prototype.assert$NameTypeReference = function(){return this};
20974 NameTypeReference.prototype.get$isFinal = function() { return this.isFinal; }; 21384 NameTypeReference.prototype.get$isFinal = function() { return this.isFinal; };
20975 NameTypeReference.prototype.set$isFinal = function(value) { return this.isFinal = value; }; 21385 NameTypeReference.prototype.set$isFinal = function(value) { return this.isFinal = value; };
20976 NameTypeReference.prototype.get$name = function() { return this.name; }; 21386 NameTypeReference.prototype.get$name = function() { return this.name; };
20977 NameTypeReference.prototype.set$name = function(value) { return this.name = valu e; }; 21387 NameTypeReference.prototype.set$name = function(value) { return this.name = valu e; };
20978 NameTypeReference.prototype.get$names = function() { return this.names; }; 21388 NameTypeReference.prototype.get$names = function() { return this.names; };
20979 NameTypeReference.prototype.set$names = function(value) { return this.names = va lue; }; 21389 NameTypeReference.prototype.set$names = function(value) { return this.names = va lue; };
20980 NameTypeReference.prototype.visit = function(visitor) { 21390 NameTypeReference.prototype.visit = function(visitor) {
20981 return visitor.visitNameTypeReference(this); 21391 return visitor.visitNameTypeReference(this);
20982 } 21392 }
20983 NameTypeReference.prototype.visit$1 = function($0) { 21393 NameTypeReference.prototype.visit$1 = function($0) {
20984 return this.visit(($0 && $0.is$TreeVisitor())); 21394 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
20985 }; 21395 };
20986 // ********** Code for GenericTypeReference ************** 21396 // ********** Code for GenericTypeReference **************
20987 function GenericTypeReference(baseType, typeArguments, depth, span) { 21397 function GenericTypeReference(baseType, typeArguments, depth, span) {
20988 this.baseType = baseType; 21398 this.baseType = baseType;
20989 this.typeArguments = typeArguments; 21399 this.typeArguments = typeArguments;
20990 this.depth = depth; 21400 this.depth = depth;
20991 // Initializers done 21401 // Initializers done
20992 TypeReference.call(this, span); 21402 TypeReference.call(this, span);
20993 } 21403 }
20994 $inherits(GenericTypeReference, TypeReference); 21404 $inherits(GenericTypeReference, TypeReference);
20995 GenericTypeReference.prototype.is$GenericTypeReference = function(){return this; }; 21405 GenericTypeReference.prototype.assert$GenericTypeReference = function(){return t his};
20996 GenericTypeReference.prototype.get$baseType = function() { return this.baseType; }; 21406 GenericTypeReference.prototype.get$baseType = function() { return this.baseType; };
20997 GenericTypeReference.prototype.set$baseType = function(value) { return this.base Type = value; }; 21407 GenericTypeReference.prototype.set$baseType = function(value) { return this.base Type = value; };
20998 GenericTypeReference.prototype.get$depth = function() { return this.depth; }; 21408 GenericTypeReference.prototype.get$depth = function() { return this.depth; };
20999 GenericTypeReference.prototype.set$depth = function(value) { return this.depth = value; }; 21409 GenericTypeReference.prototype.set$depth = function(value) { return this.depth = value; };
21000 GenericTypeReference.prototype.visit = function(visitor) { 21410 GenericTypeReference.prototype.visit = function(visitor) {
21001 return visitor.visitGenericTypeReference(this); 21411 return visitor.visitGenericTypeReference(this);
21002 } 21412 }
21003 GenericTypeReference.prototype.visit$1 = function($0) { 21413 GenericTypeReference.prototype.visit$1 = function($0) {
21004 return this.visit(($0 && $0.is$TreeVisitor())); 21414 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
21005 }; 21415 };
21006 // ********** Code for FunctionTypeReference ************** 21416 // ********** Code for FunctionTypeReference **************
21007 function FunctionTypeReference(isFinal, func, span) { 21417 function FunctionTypeReference(isFinal, func, span) {
21008 this.isFinal = isFinal; 21418 this.isFinal = isFinal;
21009 this.func = func; 21419 this.func = func;
21010 // Initializers done 21420 // Initializers done
21011 TypeReference.call(this, span); 21421 TypeReference.call(this, span);
21012 } 21422 }
21013 $inherits(FunctionTypeReference, TypeReference); 21423 $inherits(FunctionTypeReference, TypeReference);
21014 FunctionTypeReference.prototype.is$FunctionTypeReference = function(){return thi s;}; 21424 FunctionTypeReference.prototype.assert$FunctionTypeReference = function(){return this};
21015 FunctionTypeReference.prototype.get$isFinal = function() { return this.isFinal; }; 21425 FunctionTypeReference.prototype.get$isFinal = function() { return this.isFinal; };
21016 FunctionTypeReference.prototype.set$isFinal = function(value) { return this.isFi nal = value; }; 21426 FunctionTypeReference.prototype.set$isFinal = function(value) { return this.isFi nal = value; };
21017 FunctionTypeReference.prototype.get$func = function() { return this.func; }; 21427 FunctionTypeReference.prototype.get$func = function() { return this.func; };
21018 FunctionTypeReference.prototype.set$func = function(value) { return this.func = value; }; 21428 FunctionTypeReference.prototype.set$func = function(value) { return this.func = value; };
21019 FunctionTypeReference.prototype.visit = function(visitor) { 21429 FunctionTypeReference.prototype.visit = function(visitor) {
21020 return visitor.visitFunctionTypeReference(this); 21430 return visitor.visitFunctionTypeReference(this);
21021 } 21431 }
21022 FunctionTypeReference.prototype.visit$1 = function($0) { 21432 FunctionTypeReference.prototype.visit$1 = function($0) {
21023 return this.visit(($0 && $0.is$TreeVisitor())); 21433 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
21024 }; 21434 };
21025 // ********** Code for ArgumentNode ************** 21435 // ********** Code for ArgumentNode **************
21026 function ArgumentNode(label, value, span) { 21436 function ArgumentNode(label, value, span) {
21027 this.label = label; 21437 this.label = label;
21028 this.value = value; 21438 this.value = value;
21029 // Initializers done 21439 // Initializers done
21030 lang_Node.call(this, span); 21440 lang_Node.call(this, span);
21031 } 21441 }
21032 $inherits(ArgumentNode, lang_Node); 21442 $inherits(ArgumentNode, lang_Node);
21033 ArgumentNode.prototype.is$ArgumentNode = function(){return this;}; 21443 ArgumentNode.prototype.assert$ArgumentNode = function(){return this};
21034 ArgumentNode.prototype.get$label = function() { return this.label; }; 21444 ArgumentNode.prototype.get$label = function() { return this.label; };
21035 ArgumentNode.prototype.set$label = function(value) { return this.label = value; }; 21445 ArgumentNode.prototype.set$label = function(value) { return this.label = value; };
21036 ArgumentNode.prototype.get$value = function() { return this.value; }; 21446 ArgumentNode.prototype.get$value = function() { return this.value; };
21037 ArgumentNode.prototype.set$value = function(value) { return this.value = value; }; 21447 ArgumentNode.prototype.set$value = function(value) { return this.value = value; };
21038 ArgumentNode.prototype.visit = function(visitor) { 21448 ArgumentNode.prototype.visit = function(visitor) {
21039 return visitor.visitArgumentNode(this); 21449 return visitor.visitArgumentNode(this);
21040 } 21450 }
21041 ArgumentNode.prototype.visit$1 = function($0) { 21451 ArgumentNode.prototype.visit$1 = function($0) {
21042 return this.visit(($0 && $0.is$TreeVisitor())); 21452 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
21043 }; 21453 };
21044 // ********** Code for FormalNode ************** 21454 // ********** Code for FormalNode **************
21045 function FormalNode(isThis, isRest, type, name, value, span) { 21455 function FormalNode(isThis, isRest, type, name, value, span) {
21046 this.isThis = isThis; 21456 this.isThis = isThis;
21047 this.isRest = isRest; 21457 this.isRest = isRest;
21048 this.type = type; 21458 this.type = type;
21049 this.name = name; 21459 this.name = name;
21050 this.value = value; 21460 this.value = value;
21051 // Initializers done 21461 // Initializers done
21052 lang_Node.call(this, span); 21462 lang_Node.call(this, span);
21053 } 21463 }
21054 $inherits(FormalNode, lang_Node); 21464 $inherits(FormalNode, lang_Node);
21055 FormalNode.prototype.get$type = function() { return this.type; }; 21465 FormalNode.prototype.get$type = function() { return this.type; };
21056 FormalNode.prototype.set$type = function(value) { return this.type = value; }; 21466 FormalNode.prototype.set$type = function(value) { return this.type = value; };
21057 FormalNode.prototype.get$name = function() { return this.name; }; 21467 FormalNode.prototype.get$name = function() { return this.name; };
21058 FormalNode.prototype.set$name = function(value) { return this.name = value; }; 21468 FormalNode.prototype.set$name = function(value) { return this.name = value; };
21059 FormalNode.prototype.get$value = function() { return this.value; }; 21469 FormalNode.prototype.get$value = function() { return this.value; };
21060 FormalNode.prototype.set$value = function(value) { return this.value = value; }; 21470 FormalNode.prototype.set$value = function(value) { return this.value = value; };
21061 FormalNode.prototype.visit = function(visitor) { 21471 FormalNode.prototype.visit = function(visitor) {
21062 return visitor.visitFormalNode(this); 21472 return visitor.visitFormalNode(this);
21063 } 21473 }
21064 FormalNode.prototype.visit$1 = function($0) { 21474 FormalNode.prototype.visit$1 = function($0) {
21065 return this.visit(($0 && $0.is$TreeVisitor())); 21475 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
21066 }; 21476 };
21067 // ********** Code for CatchNode ************** 21477 // ********** Code for CatchNode **************
21068 function CatchNode(exception, trace, body, span) { 21478 function CatchNode(exception, trace, body, span) {
21069 this.exception = exception; 21479 this.exception = exception;
21070 this.trace = trace; 21480 this.trace = trace;
21071 this.body = body; 21481 this.body = body;
21072 // Initializers done 21482 // Initializers done
21073 lang_Node.call(this, span); 21483 lang_Node.call(this, span);
21074 } 21484 }
21075 $inherits(CatchNode, lang_Node); 21485 $inherits(CatchNode, lang_Node);
21076 CatchNode.prototype.get$exception = function() { return this.exception; }; 21486 CatchNode.prototype.get$exception = function() { return this.exception; };
21077 CatchNode.prototype.set$exception = function(value) { return this.exception = va lue; }; 21487 CatchNode.prototype.set$exception = function(value) { return this.exception = va lue; };
21078 CatchNode.prototype.get$trace = function() { return this.trace; }; 21488 CatchNode.prototype.get$trace = function() { return this.trace; };
21079 CatchNode.prototype.set$trace = function(value) { return this.trace = value; }; 21489 CatchNode.prototype.set$trace = function(value) { return this.trace = value; };
21080 CatchNode.prototype.get$body = function() { return this.body; }; 21490 CatchNode.prototype.get$body = function() { return this.body; };
21081 CatchNode.prototype.set$body = function(value) { return this.body = value; }; 21491 CatchNode.prototype.set$body = function(value) { return this.body = value; };
21082 CatchNode.prototype.visit = function(visitor) { 21492 CatchNode.prototype.visit = function(visitor) {
21083 return visitor.visitCatchNode(this); 21493 return visitor.visitCatchNode(this);
21084 } 21494 }
21085 CatchNode.prototype.visit$1 = function($0) { 21495 CatchNode.prototype.visit$1 = function($0) {
21086 return this.visit(($0 && $0.is$TreeVisitor())); 21496 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
21087 }; 21497 };
21088 // ********** Code for CaseNode ************** 21498 // ********** Code for CaseNode **************
21089 function CaseNode(label, cases, statements, span) { 21499 function CaseNode(label, cases, statements, span) {
21090 this.label = label; 21500 this.label = label;
21091 this.cases = cases; 21501 this.cases = cases;
21092 this.statements = statements; 21502 this.statements = statements;
21093 // Initializers done 21503 // Initializers done
21094 lang_Node.call(this, span); 21504 lang_Node.call(this, span);
21095 } 21505 }
21096 $inherits(CaseNode, lang_Node); 21506 $inherits(CaseNode, lang_Node);
21097 CaseNode.prototype.get$label = function() { return this.label; }; 21507 CaseNode.prototype.get$label = function() { return this.label; };
21098 CaseNode.prototype.set$label = function(value) { return this.label = value; }; 21508 CaseNode.prototype.set$label = function(value) { return this.label = value; };
21099 CaseNode.prototype.get$cases = function() { return this.cases; }; 21509 CaseNode.prototype.get$cases = function() { return this.cases; };
21100 CaseNode.prototype.set$cases = function(value) { return this.cases = value; }; 21510 CaseNode.prototype.set$cases = function(value) { return this.cases = value; };
21101 CaseNode.prototype.get$statements = function() { return this.statements; }; 21511 CaseNode.prototype.get$statements = function() { return this.statements; };
21102 CaseNode.prototype.set$statements = function(value) { return this.statements = v alue; }; 21512 CaseNode.prototype.set$statements = function(value) { return this.statements = v alue; };
21103 CaseNode.prototype.visit = function(visitor) { 21513 CaseNode.prototype.visit = function(visitor) {
21104 return visitor.visitCaseNode(this); 21514 return visitor.visitCaseNode(this);
21105 } 21515 }
21106 CaseNode.prototype.visit$1 = function($0) { 21516 CaseNode.prototype.visit$1 = function($0) {
21107 return this.visit(($0 && $0.is$TreeVisitor())); 21517 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
21108 }; 21518 };
21109 // ********** Code for TypeParameter ************** 21519 // ********** Code for TypeParameter **************
21110 function TypeParameter(name, extendsType, span) { 21520 function TypeParameter(name, extendsType, span) {
21111 this.name = name; 21521 this.name = name;
21112 this.extendsType = extendsType; 21522 this.extendsType = extendsType;
21113 // Initializers done 21523 // Initializers done
21114 lang_Node.call(this, span); 21524 lang_Node.call(this, span);
21115 } 21525 }
21116 $inherits(TypeParameter, lang_Node); 21526 $inherits(TypeParameter, lang_Node);
21117 TypeParameter.prototype.get$name = function() { return this.name; }; 21527 TypeParameter.prototype.get$name = function() { return this.name; };
21118 TypeParameter.prototype.set$name = function(value) { return this.name = value; } ; 21528 TypeParameter.prototype.set$name = function(value) { return this.name = value; } ;
21119 TypeParameter.prototype.get$extendsType = function() { return this.extendsType; }; 21529 TypeParameter.prototype.get$extendsType = function() { return this.extendsType; };
21120 TypeParameter.prototype.set$extendsType = function(value) { return this.extendsT ype = value; }; 21530 TypeParameter.prototype.set$extendsType = function(value) { return this.extendsT ype = value; };
21121 TypeParameter.prototype.visit = function(visitor) { 21531 TypeParameter.prototype.visit = function(visitor) {
21122 return visitor.visitTypeParameter(this); 21532 return visitor.visitTypeParameter(this);
21123 } 21533 }
21124 TypeParameter.prototype.visit$1 = function($0) { 21534 TypeParameter.prototype.visit$1 = function($0) {
21125 return this.visit(($0 && $0.is$TreeVisitor())); 21535 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
21126 }; 21536 };
21127 // ********** Code for lang_Identifier ************** 21537 // ********** Code for lang_Identifier **************
21128 function lang_Identifier(name, span) { 21538 function lang_Identifier(name, span) {
21129 this.name = name; 21539 this.name = name;
21130 // Initializers done 21540 // Initializers done
21131 lang_Node.call(this, span); 21541 lang_Node.call(this, span);
21132 } 21542 }
21133 $inherits(lang_Identifier, lang_Node); 21543 $inherits(lang_Identifier, lang_Node);
21134 lang_Identifier.prototype.is$lang_Identifier = function(){return this;}; 21544 lang_Identifier.prototype.assert$lang_Identifier = function(){return this};
21135 lang_Identifier.prototype.get$name = function() { return this.name; }; 21545 lang_Identifier.prototype.get$name = function() { return this.name; };
21136 lang_Identifier.prototype.set$name = function(value) { return this.name = value; }; 21546 lang_Identifier.prototype.set$name = function(value) { return this.name = value; };
21137 lang_Identifier.prototype.visit = function(visitor) { 21547 lang_Identifier.prototype.visit = function(visitor) {
21138 return visitor.visitIdentifier(this); 21548 return visitor.visitIdentifier(this);
21139 } 21549 }
21140 lang_Identifier.prototype.visit$1 = function($0) { 21550 lang_Identifier.prototype.visit$1 = function($0) {
21141 return this.visit(($0 && $0.is$TreeVisitor())); 21551 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
21142 }; 21552 };
21143 // ********** Code for DeclaredIdentifier ************** 21553 // ********** Code for DeclaredIdentifier **************
21144 function DeclaredIdentifier(type, name, span) { 21554 function DeclaredIdentifier(type, name, span) {
21145 this.type = type; 21555 this.type = type;
21146 this.name = name; 21556 this.name = name;
21147 // Initializers done 21557 // Initializers done
21148 lang_Expression.call(this, span); 21558 lang_Expression.call(this, span);
21149 } 21559 }
21150 $inherits(DeclaredIdentifier, lang_Expression); 21560 $inherits(DeclaredIdentifier, lang_Expression);
21151 DeclaredIdentifier.prototype.is$DeclaredIdentifier = function(){return this;}; 21561 DeclaredIdentifier.prototype.assert$DeclaredIdentifier = function(){return this} ;
21152 DeclaredIdentifier.prototype.get$type = function() { return this.type; }; 21562 DeclaredIdentifier.prototype.get$type = function() { return this.type; };
21153 DeclaredIdentifier.prototype.set$type = function(value) { return this.type = val ue; }; 21563 DeclaredIdentifier.prototype.set$type = function(value) { return this.type = val ue; };
21154 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; 21564 DeclaredIdentifier.prototype.get$name = function() { return this.name; };
21155 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val ue; }; 21565 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val ue; };
21156 DeclaredIdentifier.prototype.visit = function(visitor) { 21566 DeclaredIdentifier.prototype.visit = function(visitor) {
21157 return visitor.visitDeclaredIdentifier(this); 21567 return visitor.visitDeclaredIdentifier(this);
21158 } 21568 }
21159 DeclaredIdentifier.prototype.visit$1 = function($0) { 21569 DeclaredIdentifier.prototype.visit$1 = function($0) {
21160 return this.visit(($0 && $0.is$TreeVisitor())); 21570 return this.visit(($0 == null ? null : $0.assert$TreeVisitor()));
21161 }; 21571 };
21162 // ********** Code for lang_Type ************** 21572 // ********** Code for lang_Type **************
21163 function lang_Type(name) { 21573 function lang_Type(name) {
21164 this.isTested = false; 21574 this.isTested = false
21575 this.isChecked = false
21165 this._resolvedMembers = $map([]); 21576 this._resolvedMembers = $map([]);
21577 this.varStubs = $map([]);
21166 // Initializers done 21578 // Initializers done
21167 lang_Element.call(this, name, null); 21579 lang_Element.call(this, name, null);
21168 } 21580 }
21169 $inherits(lang_Type, lang_Element); 21581 $inherits(lang_Type, lang_Element);
21170 lang_Type.prototype.is$lang_Type = function(){return this;}; 21582 lang_Type.prototype.assert$lang_Type = function(){return this};
21171 lang_Type.prototype.get$isTested = function() { return this.isTested; }; 21583 lang_Type.prototype.get$isTested = function() { return this.isTested; };
21172 lang_Type.prototype.set$isTested = function(value) { return this.isTested = valu e; }; 21584 lang_Type.prototype.set$isTested = function(value) { return this.isTested = valu e; };
21173 lang_Type.prototype.get$typeCheckCode = function() { return this.typeCheckCode; }; 21585 lang_Type.prototype.get$typeCheckCode = function() { return this.typeCheckCode; };
21174 lang_Type.prototype.set$typeCheckCode = function(value) { return this.typeCheckC ode = value; }; 21586 lang_Type.prototype.set$typeCheckCode = function(value) { return this.typeCheckC ode = value; };
21175 lang_Type.prototype.get$varStubs = function() { return this.varStubs; }; 21587 lang_Type.prototype.get$varStubs = function() { return this.varStubs; };
21176 lang_Type.prototype.set$varStubs = function(value) { return this.varStubs = valu e; }; 21588 lang_Type.prototype.set$varStubs = function(value) { return this.varStubs = valu e; };
21177 lang_Type.prototype.markUsed = function() { 21589 lang_Type.prototype.markUsed = function() {
21178 21590
21179 } 21591 }
21180 lang_Type.prototype.get$typeMember = function() { 21592 lang_Type.prototype.get$typeMember = function() {
21181 var $0; 21593 var $0;
21182 if (this._typeMember == null) { 21594 if (this._typeMember == null) {
21183 this._typeMember = new TypeMember((this && this.is$DefinedType())); 21595 this._typeMember = new TypeMember((this == null ? null : this.assert$Defined Type()));
21184 } 21596 }
21185 return (($0 = this._typeMember) && $0.is$TypeMember()); 21597 return (($0 = this._typeMember) == null ? null : $0.assert$TypeMember());
21186 } 21598 }
21187 lang_Type.prototype.getMember = function(name) { 21599 lang_Type.prototype.getMember = function(name) {
21188 return null; 21600 return null;
21189 } 21601 }
21190 lang_Type.prototype.get$subtypes = function() { 21602 lang_Type.prototype.get$subtypes = function() {
21191 return null; 21603 return null;
21192 } 21604 }
21193 lang_Type.prototype.get$isVar = function() { 21605 lang_Type.prototype.get$isVar = function() {
21194 return false; 21606 return false;
21195 } 21607 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
21253 lang_Type.prototype.get$definition = function() { 21665 lang_Type.prototype.get$definition = function() {
21254 return null; 21666 return null;
21255 } 21667 }
21256 lang_Type.prototype.get$factories = function() { 21668 lang_Type.prototype.get$factories = function() {
21257 return null; 21669 return null;
21258 } 21670 }
21259 lang_Type.prototype.get$typeArgsInOrder = function() { 21671 lang_Type.prototype.get$typeArgsInOrder = function() {
21260 return null; 21672 return null;
21261 } 21673 }
21262 lang_Type.prototype.get$genericType = function() { 21674 lang_Type.prototype.get$genericType = function() {
21263 return (this && this.is$DefinedType()); 21675 return (this == null ? null : this.assert$DefinedType());
21264 } 21676 }
21265 lang_Type.prototype.get$interfaces = function() { 21677 lang_Type.prototype.get$interfaces = function() {
21266 return null; 21678 return null;
21267 } 21679 }
21268 lang_Type.prototype.get$parent = function() { 21680 lang_Type.prototype.get$parent = function() {
21269 return null; 21681 return null;
21270 } 21682 }
21271 lang_Type.prototype.getAllMembers = function() { 21683 lang_Type.prototype.getAllMembers = function() {
21272 return $map([]); 21684 return $map([]);
21273 } 21685 }
21274 lang_Type.prototype.get$hasNativeSubtypes = function() { 21686 lang_Type.prototype.get$hasNativeSubtypes = function() {
21275 if (this._hasNativeSubtypes == null) { 21687 if (this._hasNativeSubtypes == null) {
21276 this._hasNativeSubtypes = this.get$subtypes().some((function (t) { 21688 this._hasNativeSubtypes = this.get$subtypes().some((function (t) {
21277 return t.get$isNative(); 21689 return t.get$isNative();
21278 }) 21690 })
21279 ); 21691 );
21280 } 21692 }
21281 return this._hasNativeSubtypes; 21693 return this._hasNativeSubtypes;
21282 } 21694 }
21283 lang_Type.prototype._checkOverride = function(member) { 21695 lang_Type.prototype._checkOverride = function(member) {
21284 var parentMember = this._getMemberInParents(member.name); 21696 var parentMember = this._getMemberInParents(member.name);
21285 if ($notnull_bool($ne(parentMember, null))) { 21697 if ($notnull_bool($ne(parentMember, null))) {
21286 if (!$notnull_bool(member.get$isPrivate()) || $eq(member.get$library(), pare ntMember.get$library())) { 21698 if (!$notnull_bool(member.get$isPrivate()) || $eq(member.get$library(), pare ntMember.get$library())) {
21287 member.override((parentMember && parentMember.is$Member())); 21699 member.override((parentMember == null ? null : parentMember.assert$Member( )));
21288 } 21700 }
21289 } 21701 }
21290 } 21702 }
21291 lang_Type.prototype._createNotEqualMember = function() { 21703 lang_Type.prototype._createNotEqualMember = function() {
21292 var $0; 21704 var $0;
21293 var eq = (($0 = this.get$members().$index('\$eq')) && $0.is$MethodMember()); 21705 var eq = (($0 = this.get$members().$index('\$eq')) == null ? null : $0.assert$ MethodMember());
21294 if (eq == null) { 21706 if (eq == null) {
21295 $globals.world.internalError('INTERNAL: object does not define ==', this.get $definition().span); 21707 $globals.world.internalError('INTERNAL: object does not define ==', this.get $definition().span);
21296 } 21708 }
21297 var ne = new MethodMember('\$ne', this, eq.definition); 21709 var ne = new MethodMember('\$ne', this, eq.definition);
21298 ne.isGenerated = true; 21710 ne.isGenerated = true;
21299 ne.returnType = eq.returnType; 21711 ne.returnType = eq.returnType;
21300 ne.parameters = eq.parameters; 21712 ne.parameters = eq.parameters;
21301 ne.isStatic = eq.isStatic; 21713 ne.isStatic = eq.isStatic;
21302 ne.isAbstract = eq.isAbstract; 21714 ne.isAbstract = eq.isAbstract;
21303 return ne; 21715 return ne;
21304 } 21716 }
21305 lang_Type.prototype._getMemberInParents = function(memberName) { 21717 lang_Type.prototype._getMemberInParents = function(memberName) {
21306 if ($notnull_bool(this.get$isClass())) { 21718 if ($notnull_bool(this.get$isClass())) {
21307 if (this.get$parent() != null) { 21719 if (this.get$parent() != null) {
21308 return this.get$parent().getMember(memberName); 21720 return this.get$parent().getMember(memberName);
21309 } 21721 }
21310 else if ($notnull_bool(this.get$isObject())) { 21722 else if ($notnull_bool(this.get$isObject())) {
21311 if (memberName == '\$ne') { 21723 if (memberName == '\$ne') {
21312 var ret = this._createNotEqualMember(); 21724 var ret = this._createNotEqualMember();
21313 this.get$members().$setindex(memberName, ret); 21725 this.get$members().$setindex(memberName, ret);
21314 return (ret && ret.is$Member()); 21726 return (ret == null ? null : ret.assert$Member());
21315 } 21727 }
21316 return null; 21728 return null;
21317 } 21729 }
21318 } 21730 }
21319 else { 21731 else {
21320 if (this.get$interfaces() != null && this.get$interfaces().length > 0) { 21732 if (this.get$interfaces() != null && this.get$interfaces().length > 0) {
21321 var $list = this.get$interfaces(); 21733 var $list = this.get$interfaces();
21322 for (var $i = 0;$i < $list.length; $i++) { 21734 for (var $i = 0;$i < $list.length; $i++) {
21323 var i = $list.$index($i); 21735 var i = $list.$index($i);
21324 var ret = i.getMember$1(memberName); 21736 var ret = i.getMember$1(memberName);
21325 if ($notnull_bool($ne(ret, null))) { 21737 if ($notnull_bool($ne(ret, null))) {
21326 return (ret && ret.is$Member()); 21738 return (ret == null ? null : ret.assert$Member());
21327 } 21739 }
21328 } 21740 }
21329 return null; 21741 return null;
21330 } 21742 }
21331 else { 21743 else {
21332 return $globals.world.objectType.getMember(memberName); 21744 return $globals.world.objectType.getMember(memberName);
21333 } 21745 }
21334 } 21746 }
21335 } 21747 }
21336 lang_Type.prototype.resolveMember = function(memberName) { 21748 lang_Type.prototype.resolveMember = function(memberName) {
21337 var $0; 21749 var $0;
21338 var ret = (($0 = this._resolvedMembers.$index(memberName)) && $0.is$MemberSet( )); 21750 var ret = (($0 = this._resolvedMembers.$index(memberName)) == null ? null : $0 .assert$MemberSet());
21339 if (ret != null) return ret; 21751 if (ret != null) return ret;
21340 var member = this.getMember(memberName); 21752 var member = this.getMember(memberName);
21341 if (member == null) { 21753 if (member == null) {
21342 return null; 21754 return null;
21343 } 21755 }
21344 ret = new MemberSet(member, false); 21756 ret = new MemberSet(member, false);
21345 this._resolvedMembers.$setindex(memberName, ret); 21757 this._resolvedMembers.$setindex(memberName, ret);
21346 if ($notnull_bool(member.get$isStatic())) { 21758 if ($notnull_bool(member.get$isStatic())) {
21347 return ret; 21759 return ret;
21348 } 21760 }
21349 else { 21761 else {
21350 var $list = this.get$subtypes(); 21762 var $list = this.get$subtypes();
21351 for (var $i = this.get$subtypes().iterator(); $i.hasNext$0(); ) { 21763 for (var $i = this.get$subtypes().iterator(); $i.hasNext$0(); ) {
21352 var t = $i.next$0(); 21764 var t = $i.next$0();
21353 if (!$notnull_bool(this.get$isClass()) && $notnull_bool(t.get$isClass())) { 21765 if (!$notnull_bool(this.get$isClass()) && $notnull_bool(t.get$isClass())) {
21354 var m = t.getMember$1(memberName); 21766 var m = t.getMember$1(memberName);
21355 if ($notnull_bool($ne(m, null)) && ret.members.indexOf(m) == -1) { 21767 if ($notnull_bool($ne(m, null)) && ret.members.indexOf(m) == -1) {
21356 ret.add((m && m.is$Member())); 21768 ret.add((m == null ? null : m.assert$Member()));
21357 } 21769 }
21358 } 21770 }
21359 else { 21771 else {
21360 var m = t.get$members().$index(memberName); 21772 var m = t.get$members().$index(memberName);
21361 if ($notnull_bool($ne(m, null))) ret.add((m && m.is$Member())); 21773 if ($notnull_bool($ne(m, null))) ret.add((m == null ? null : m.assert$Me mber()));
21362 } 21774 }
21363 } 21775 }
21364 return ret; 21776 return ret;
21365 } 21777 }
21366 } 21778 }
21367 lang_Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) { 21779 lang_Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) {
21368 if (!$notnull_bool(this.isSubtypeOf(other))) { 21780 if (!$notnull_bool(this.isSubtypeOf(other))) {
21369 var msg = ('type ' + this.name + ' is not a subtype of ' + other.name); 21781 var msg = ('type ' + this.name + ' is not a subtype of ' + other.name);
21370 if ($notnull_bool(typeErrors)) { 21782 if ($notnull_bool(typeErrors)) {
21371 $globals.world.error($assert_String(msg), span); 21783 $globals.world.error($assert_String(msg), span);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
21417 if ((other instanceof ParameterType)) { 21829 if ((other instanceof ParameterType)) {
21418 return true; 21830 return true;
21419 } 21831 }
21420 if ($eq(this, other)) return true; 21832 if ($eq(this, other)) return true;
21421 if ($notnull_bool(this.get$isVar())) return true; 21833 if ($notnull_bool(this.get$isVar())) return true;
21422 if ($notnull_bool(other.get$isVar())) return true; 21834 if ($notnull_bool(other.get$isVar())) return true;
21423 if ($notnull_bool(other._isDirectSupertypeOf(this))) return true; 21835 if ($notnull_bool(other._isDirectSupertypeOf(this))) return true;
21424 var call = this.getCallMethod(); 21836 var call = this.getCallMethod();
21425 var otherCall = other.getCallMethod(); 21837 var otherCall = other.getCallMethod();
21426 if ($notnull_bool($ne(call, null)) && $notnull_bool($ne(otherCall, null))) { 21838 if ($notnull_bool($ne(call, null)) && $notnull_bool($ne(otherCall, null))) {
21427 return lang_Type._isFunctionSubtypeOf((call && call.is$MethodMember()), (oth erCall && otherCall.is$MethodMember())); 21839 return lang_Type._isFunctionSubtypeOf((call == null ? null : call.assert$Met hodMember()), (otherCall == null ? null : otherCall.assert$MethodMember()));
21428 } 21840 }
21429 if ($eq(this.get$genericType(), other.get$genericType()) && $notnull_bool($ne( this.get$typeArgsInOrder(), null)) && $notnull_bool($ne(other.get$typeArgsInOrde r(), null)) && $notnull_bool($eq(this.get$typeArgsInOrder().length, other.get$ty peArgsInOrder().length))) { 21841 if ($eq(this.get$genericType(), other.get$genericType()) && $notnull_bool($ne( this.get$typeArgsInOrder(), null)) && $notnull_bool($ne(other.get$typeArgsInOrde r(), null)) && $notnull_bool($eq(this.get$typeArgsInOrder().length, other.get$ty peArgsInOrder().length))) {
21430 var t = this.get$typeArgsInOrder().iterator$0(); 21842 var t = this.get$typeArgsInOrder().iterator$0();
21431 var s = other.get$typeArgsInOrder().iterator$0(); 21843 var s = other.get$typeArgsInOrder().iterator$0();
21432 while ($notnull_bool(t.hasNext$0())) { 21844 while ($notnull_bool(t.hasNext$0())) {
21433 if (!$notnull_bool(t.next$0().isSubtypeOf$1(s.next$0()))) return false; 21845 if (!$notnull_bool(t.next$0().isSubtypeOf$1(s.next$0()))) return false;
21434 } 21846 }
21435 return true; 21847 return true;
21436 } 21848 }
21437 if (this.get$parent() != null && $notnull_bool(this.get$parent().isSubtypeOf(o ther))) { 21849 if (this.get$parent() != null && $notnull_bool(this.get$parent().isSubtypeOf(o ther))) {
(...skipping 17 matching lines...) Expand all
21455 for (var i = 0; 21867 for (var i = 0;
21456 i < $assert_num(sp.length); i++) { 21868 i < $assert_num(sp.length); i++) {
21457 if ($notnull_bool($ne(tp.$index(i).get$isOptional(), sp.$index(i).get$isOpti onal()))) return false; 21869 if ($notnull_bool($ne(tp.$index(i).get$isOptional(), sp.$index(i).get$isOpti onal()))) return false;
21458 if ($notnull_bool(tp.$index(i).get$isOptional()) && $notnull_bool($ne(tp.$in dex(i).get$name(), sp.$index(i).get$name()))) return false; 21870 if ($notnull_bool(tp.$index(i).get$isOptional()) && $notnull_bool($ne(tp.$in dex(i).get$name(), sp.$index(i).get$name()))) return false;
21459 if (!$notnull_bool(tp.$index(i).get$type().isAssignable$1(sp.$index(i).get$t ype()))) return false; 21871 if (!$notnull_bool(tp.$index(i).get$type().isAssignable$1(sp.$index(i).get$t ype()))) return false;
21460 } 21872 }
21461 if (tp.length > $assert_num(sp.length) && !$notnull_bool(tp.$index(sp.length). get$isOptional())) return false; 21873 if (tp.length > $assert_num(sp.length) && !$notnull_bool(tp.$index(sp.length). get$isOptional())) return false;
21462 return true; 21874 return true;
21463 } 21875 }
21464 lang_Type.prototype.addDirectSubtype$1 = function($0) { 21876 lang_Type.prototype.addDirectSubtype$1 = function($0) {
21465 return this.addDirectSubtype(($0 && $0.is$lang_Type())); 21877 return this.addDirectSubtype(($0 == null ? null : $0.assert$lang_Type()));
21466 }; 21878 };
21467 lang_Type.prototype.ensureSubtypeOf$3 = function($0, $1, $2) { 21879 lang_Type.prototype.ensureSubtypeOf$3 = function($0, $1, $2) {
21468 return this.ensureSubtypeOf(($0 && $0.is$lang_Type()), ($1 && $1.is$SourceSpan ()), $assert_bool($2)); 21880 return this.ensureSubtypeOf(($0 == null ? null : $0.assert$lang_Type()), ($1 = = null ? null : $1.assert$SourceSpan()), $assert_bool($2));
21469 }; 21881 };
21470 lang_Type.prototype.getConstructor$1 = function($0) { 21882 lang_Type.prototype.getConstructor$1 = function($0) {
21471 return this.getConstructor($assert_String($0)); 21883 return this.getConstructor($assert_String($0));
21472 }; 21884 };
21473 lang_Type.prototype.getFactory$2 = function($0, $1) { 21885 lang_Type.prototype.getFactory$2 = function($0, $1) {
21474 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1)); 21886 return this.getFactory(($0 == null ? null : $0.assert$lang_Type()), $assert_St ring($1));
21475 }; 21887 };
21476 lang_Type.prototype.getMember$1 = function($0) { 21888 lang_Type.prototype.getMember$1 = function($0) {
21477 return this.getMember($assert_String($0)); 21889 return this.getMember($assert_String($0));
21478 }; 21890 };
21479 lang_Type.prototype.getOrMakeConcreteType$1 = function($0) { 21891 lang_Type.prototype.getOrMakeConcreteType$1 = function($0) {
21480 return this.getOrMakeConcreteType(($0 && $0.is$List_Type())); 21892 return this.getOrMakeConcreteType(($0 == null ? null : $0.assert$List_Type())) ;
21481 }; 21893 };
21482 lang_Type.prototype.isAssignable$1 = function($0) { 21894 lang_Type.prototype.isAssignable$1 = function($0) {
21483 return this.isAssignable(($0 && $0.is$lang_Type())); 21895 return this.isAssignable(($0 == null ? null : $0.assert$lang_Type()));
21484 }; 21896 };
21485 lang_Type.prototype.isString$0 = function() { 21897 lang_Type.prototype.isString$0 = function() {
21486 return this.get$isString()(); 21898 return this.get$isString()();
21487 }; 21899 };
21488 lang_Type.prototype.isSubtypeOf$1 = function($0) { 21900 lang_Type.prototype.isSubtypeOf$1 = function($0) {
21489 return this.isSubtypeOf(($0 && $0.is$lang_Type())); 21901 return this.isSubtypeOf(($0 == null ? null : $0.assert$lang_Type()));
21490 }; 21902 };
21491 lang_Type.prototype.markUsed$0 = lang_Type.prototype.markUsed; 21903 lang_Type.prototype.markUsed$0 = lang_Type.prototype.markUsed;
21492 lang_Type.prototype.resolveMember$1 = function($0) { 21904 lang_Type.prototype.resolveMember$1 = function($0) {
21493 return this.resolveMember($assert_String($0)); 21905 return this.resolveMember($assert_String($0));
21494 }; 21906 };
21495 lang_Type.prototype.resolveTypeParams$1 = function($0) { 21907 lang_Type.prototype.resolveTypeParams$1 = function($0) {
21496 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); 21908 return this.resolveTypeParams(($0 == null ? null : $0.assert$ConcreteType()));
21497 }; 21909 };
21498 // ********** Code for ParameterType ************** 21910 // ********** Code for ParameterType **************
21499 function ParameterType(name, typeParameter) { 21911 function ParameterType(name, typeParameter) {
21500 this.typeParameter = typeParameter; 21912 this.typeParameter = typeParameter;
21501 // Initializers done 21913 // Initializers done
21502 lang_Type.call(this, name); 21914 lang_Type.call(this, name);
21503 } 21915 }
21504 $inherits(ParameterType, lang_Type); 21916 $inherits(ParameterType, lang_Type);
21505 ParameterType.prototype.is$ParameterType = function(){return this;}; 21917 ParameterType.prototype.assert$ParameterType = function(){return this};
21506 ParameterType.prototype.get$typeParameter = function() { return this.typeParamet er; }; 21918 ParameterType.prototype.get$typeParameter = function() { return this.typeParamet er; };
21507 ParameterType.prototype.set$typeParameter = function(value) { return this.typePa rameter = value; }; 21919 ParameterType.prototype.set$typeParameter = function(value) { return this.typePa rameter = value; };
21508 ParameterType.prototype.get$extendsType = function() { return this.extendsType; }; 21920 ParameterType.prototype.get$extendsType = function() { return this.extendsType; };
21509 ParameterType.prototype.set$extendsType = function(value) { return this.extendsT ype = value; }; 21921 ParameterType.prototype.set$extendsType = function(value) { return this.extendsT ype = value; };
21510 ParameterType.prototype.get$isClass = function() { 21922 ParameterType.prototype.get$isClass = function() {
21511 return false; 21923 return false;
21512 } 21924 }
21513 ParameterType.prototype.get$library = function() { 21925 ParameterType.prototype.get$library = function() {
21514 return null; 21926 return null;
21515 } 21927 }
(...skipping 16 matching lines...) Expand all
21532 return this.extendsType.resolveMember(memberName); 21944 return this.extendsType.resolveMember(memberName);
21533 } 21945 }
21534 ParameterType.prototype.getConstructor = function(constructorName) { 21946 ParameterType.prototype.getConstructor = function(constructorName) {
21535 $globals.world.internalError('no constructors on type parameters yet'); 21947 $globals.world.internalError('no constructors on type parameters yet');
21536 } 21948 }
21537 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) { 21949 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) {
21538 $globals.world.internalError('no concrete types of type parameters yet', this. get$span()); 21950 $globals.world.internalError('no concrete types of type parameters yet', this. get$span());
21539 } 21951 }
21540 ParameterType.prototype.resolveTypeParams = function(inType) { 21952 ParameterType.prototype.resolveTypeParams = function(inType) {
21541 var $0; 21953 var $0;
21542 return (($0 = inType.typeArguments.$index(this.name)) && $0.is$lang_Type()); 21954 return (($0 = inType.typeArguments.$index(this.name)) == null ? null : $0.asse rt$lang_Type());
21543 } 21955 }
21544 ParameterType.prototype.addDirectSubtype = function(type) { 21956 ParameterType.prototype.addDirectSubtype = function(type) {
21545 $globals.world.internalError('no subtypes of type parameters yet', this.get$sp an()); 21957 $globals.world.internalError('no subtypes of type parameters yet', this.get$sp an());
21546 } 21958 }
21547 ParameterType.prototype.resolve = function() { 21959 ParameterType.prototype.resolve = function() {
21548 if (this.typeParameter.extendsType != null) { 21960 if (this.typeParameter.extendsType != null) {
21549 this.extendsType = this.get$enclosingElement().resolveType(this.typeParamete r.extendsType, true); 21961 this.extendsType = this.get$enclosingElement().resolveType(this.typeParamete r.extendsType, true);
21550 } 21962 }
21551 else { 21963 else {
21552 this.extendsType = $globals.world.objectType; 21964 this.extendsType = $globals.world.objectType;
21553 } 21965 }
21554 } 21966 }
21555 ParameterType.prototype.addDirectSubtype$1 = function($0) { 21967 ParameterType.prototype.addDirectSubtype$1 = function($0) {
21556 return this.addDirectSubtype(($0 && $0.is$lang_Type())); 21968 return this.addDirectSubtype(($0 == null ? null : $0.assert$lang_Type()));
21557 }; 21969 };
21558 ParameterType.prototype.getConstructor$1 = function($0) { 21970 ParameterType.prototype.getConstructor$1 = function($0) {
21559 return this.getConstructor($assert_String($0)); 21971 return this.getConstructor($assert_String($0));
21560 }; 21972 };
21561 ParameterType.prototype.getOrMakeConcreteType$1 = function($0) { 21973 ParameterType.prototype.getOrMakeConcreteType$1 = function($0) {
21562 return this.getOrMakeConcreteType(($0 && $0.is$List_Type())); 21974 return this.getOrMakeConcreteType(($0 == null ? null : $0.assert$List_Type())) ;
21563 }; 21975 };
21564 ParameterType.prototype.isSubtypeOf$1 = function($0) { 21976 ParameterType.prototype.isSubtypeOf$1 = function($0) {
21565 return this.isSubtypeOf(($0 && $0.is$lang_Type())); 21977 return this.isSubtypeOf(($0 == null ? null : $0.assert$lang_Type()));
21566 }; 21978 };
21567 ParameterType.prototype.resolve$0 = ParameterType.prototype.resolve; 21979 ParameterType.prototype.resolve$0 = ParameterType.prototype.resolve;
21568 ParameterType.prototype.resolveMember$1 = function($0) { 21980 ParameterType.prototype.resolveMember$1 = function($0) {
21569 return this.resolveMember($assert_String($0)); 21981 return this.resolveMember($assert_String($0));
21570 }; 21982 };
21571 ParameterType.prototype.resolveTypeParams$1 = function($0) { 21983 ParameterType.prototype.resolveTypeParams$1 = function($0) {
21572 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); 21984 return this.resolveTypeParams(($0 == null ? null : $0.assert$ConcreteType()));
21573 }; 21985 };
21574 // ********** Code for NonNullableType ************** 21986 // ********** Code for NonNullableType **************
21575 function NonNullableType(type) { 21987 function NonNullableType(type) {
21576 this.type = type; 21988 this.type = type;
21577 // Initializers done 21989 // Initializers done
21578 lang_Type.call(this, type.name); 21990 lang_Type.call(this, type.name);
21579 } 21991 }
21580 $inherits(NonNullableType, lang_Type); 21992 $inherits(NonNullableType, lang_Type);
21581 NonNullableType.prototype.get$type = function() { return this.type; }; 21993 NonNullableType.prototype.get$type = function() { return this.type; };
21582 NonNullableType.prototype.get$isNullable = function() { 21994 NonNullableType.prototype.get$isNullable = function() {
(...skipping 27 matching lines...) Expand all
21610 return this.type.get$span(); 22022 return this.type.get$span();
21611 } 22023 }
21612 NonNullableType.prototype.resolveMember = function(name) { 22024 NonNullableType.prototype.resolveMember = function(name) {
21613 return this.type.resolveMember(name); 22025 return this.type.resolveMember(name);
21614 } 22026 }
21615 NonNullableType.prototype.getMember = function(name) { 22027 NonNullableType.prototype.getMember = function(name) {
21616 return this.type.getMember(name); 22028 return this.type.getMember(name);
21617 } 22029 }
21618 NonNullableType.prototype.getConstructor = function(name) { 22030 NonNullableType.prototype.getConstructor = function(name) {
21619 var $0; 22031 var $0;
21620 return (($0 = this.type.getConstructor(name)) && $0.is$MethodMember()); 22032 return (($0 = this.type.getConstructor(name)) == null ? null : $0.assert$Metho dMember());
21621 } 22033 }
21622 NonNullableType.prototype.getFactory = function(t, name) { 22034 NonNullableType.prototype.getFactory = function(t, name) {
21623 var $0; 22035 var $0;
21624 return (($0 = this.type.getFactory(t, name)) && $0.is$MethodMember()); 22036 return (($0 = this.type.getFactory(t, name)) == null ? null : $0.assert$Method Member());
21625 } 22037 }
21626 NonNullableType.prototype.getOrMakeConcreteType = function(typeArgs) { 22038 NonNullableType.prototype.getOrMakeConcreteType = function(typeArgs) {
21627 return this.type.getOrMakeConcreteType(typeArgs); 22039 return this.type.getOrMakeConcreteType(typeArgs);
21628 } 22040 }
21629 NonNullableType.prototype.get$constructors = function() { 22041 NonNullableType.prototype.get$constructors = function() {
21630 return this.type.get$constructors(); 22042 return this.type.get$constructors();
21631 } 22043 }
21632 NonNullableType.prototype.get$isClass = function() { 22044 NonNullableType.prototype.get$isClass = function() {
21633 return this.type.get$isClass(); 22045 return this.type.get$isClass();
21634 } 22046 }
(...skipping 19 matching lines...) Expand all
21654 return this.type.get$members(); 22066 return this.type.get$members();
21655 } 22067 }
21656 NonNullableType.prototype.get$definition = function() { 22068 NonNullableType.prototype.get$definition = function() {
21657 return this.type.get$definition(); 22069 return this.type.get$definition();
21658 } 22070 }
21659 NonNullableType.prototype.get$factories = function() { 22071 NonNullableType.prototype.get$factories = function() {
21660 return this.type.get$factories(); 22072 return this.type.get$factories();
21661 } 22073 }
21662 NonNullableType.prototype.get$typeArgsInOrder = function() { 22074 NonNullableType.prototype.get$typeArgsInOrder = function() {
21663 var $0; 22075 var $0;
21664 return (($0 = this.type.get$typeArgsInOrder()) && $0.is$Collection_Type()); 22076 return (($0 = this.type.get$typeArgsInOrder()) == null ? null : $0.assert$Coll ection_Type());
21665 } 22077 }
21666 NonNullableType.prototype.get$genericType = function() { 22078 NonNullableType.prototype.get$genericType = function() {
21667 return this.type.get$genericType(); 22079 return this.type.get$genericType();
21668 } 22080 }
21669 NonNullableType.prototype.get$interfaces = function() { 22081 NonNullableType.prototype.get$interfaces = function() {
21670 return this.type.get$interfaces(); 22082 return this.type.get$interfaces();
21671 } 22083 }
21672 NonNullableType.prototype.get$parent = function() { 22084 NonNullableType.prototype.get$parent = function() {
21673 return this.type.get$parent(); 22085 return this.type.get$parent();
21674 } 22086 }
21675 NonNullableType.prototype.getAllMembers = function() { 22087 NonNullableType.prototype.getAllMembers = function() {
21676 return this.type.getAllMembers(); 22088 return this.type.getAllMembers();
21677 } 22089 }
21678 NonNullableType.prototype.get$isNative = function() { 22090 NonNullableType.prototype.get$isNative = function() {
21679 return this.type.get$isNative(); 22091 return this.type.get$isNative();
21680 } 22092 }
21681 NonNullableType.prototype.addDirectSubtype$1 = function($0) { 22093 NonNullableType.prototype.addDirectSubtype$1 = function($0) {
21682 return this.addDirectSubtype(($0 && $0.is$lang_Type())); 22094 return this.addDirectSubtype(($0 == null ? null : $0.assert$lang_Type()));
21683 }; 22095 };
21684 NonNullableType.prototype.getConstructor$1 = function($0) { 22096 NonNullableType.prototype.getConstructor$1 = function($0) {
21685 return this.getConstructor($assert_String($0)); 22097 return this.getConstructor($assert_String($0));
21686 }; 22098 };
21687 NonNullableType.prototype.getFactory$2 = function($0, $1) { 22099 NonNullableType.prototype.getFactory$2 = function($0, $1) {
21688 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1)); 22100 return this.getFactory(($0 == null ? null : $0.assert$lang_Type()), $assert_St ring($1));
21689 }; 22101 };
21690 NonNullableType.prototype.getMember$1 = function($0) { 22102 NonNullableType.prototype.getMember$1 = function($0) {
21691 return this.getMember($assert_String($0)); 22103 return this.getMember($assert_String($0));
21692 }; 22104 };
21693 NonNullableType.prototype.getOrMakeConcreteType$1 = function($0) { 22105 NonNullableType.prototype.getOrMakeConcreteType$1 = function($0) {
21694 return this.getOrMakeConcreteType(($0 && $0.is$List_Type())); 22106 return this.getOrMakeConcreteType(($0 == null ? null : $0.assert$List_Type())) ;
21695 }; 22107 };
21696 NonNullableType.prototype.isSubtypeOf$1 = function($0) { 22108 NonNullableType.prototype.isSubtypeOf$1 = function($0) {
21697 return this.isSubtypeOf(($0 && $0.is$lang_Type())); 22109 return this.isSubtypeOf(($0 == null ? null : $0.assert$lang_Type()));
21698 }; 22110 };
21699 NonNullableType.prototype.markUsed$0 = NonNullableType.prototype.markUsed; 22111 NonNullableType.prototype.markUsed$0 = NonNullableType.prototype.markUsed;
21700 NonNullableType.prototype.resolveMember$1 = function($0) { 22112 NonNullableType.prototype.resolveMember$1 = function($0) {
21701 return this.resolveMember($assert_String($0)); 22113 return this.resolveMember($assert_String($0));
21702 }; 22114 };
21703 NonNullableType.prototype.resolveTypeParams$1 = function($0) { 22115 NonNullableType.prototype.resolveTypeParams$1 = function($0) {
21704 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); 22116 return this.resolveTypeParams(($0 == null ? null : $0.assert$ConcreteType()));
21705 }; 22117 };
21706 // ********** Code for ConcreteType ************** 22118 // ********** Code for ConcreteType **************
21707 function ConcreteType(name, genericType, typeArguments, typeArgsInOrder) { 22119 function ConcreteType(name, genericType, typeArguments, typeArgsInOrder) {
21708 this.genericType = genericType; 22120 this.genericType = genericType;
21709 this.typeArguments = typeArguments; 22121 this.typeArguments = typeArguments;
21710 this.typeArgsInOrder = typeArgsInOrder; 22122 this.typeArgsInOrder = typeArgsInOrder;
21711 this.constructors = $map([]); 22123 this.constructors = $map([]);
21712 this.members = $map([]); 22124 this.members = $map([]);
21713 this.factories = new FactoryMap(); 22125 this.factories = new FactoryMap();
21714 // Initializers done 22126 // Initializers done
21715 lang_Type.call(this, name); 22127 lang_Type.call(this, name);
21716 } 22128 }
21717 $inherits(ConcreteType, lang_Type); 22129 $inherits(ConcreteType, lang_Type);
21718 ConcreteType.prototype.is$ConcreteType = function(){return this;}; 22130 ConcreteType.prototype.assert$ConcreteType = function(){return this};
21719 ConcreteType.prototype.get$genericType = function() { return this.genericType; } ; 22131 ConcreteType.prototype.get$genericType = function() { return this.genericType; } ;
21720 ConcreteType.prototype.get$typeArgsInOrder = function() { return this.typeArgsIn Order; }; 22132 ConcreteType.prototype.get$typeArgsInOrder = function() { return this.typeArgsIn Order; };
21721 ConcreteType.prototype.set$typeArgsInOrder = function(value) { return this.typeA rgsInOrder = value; }; 22133 ConcreteType.prototype.set$typeArgsInOrder = function(value) { return this.typeA rgsInOrder = value; };
21722 ConcreteType.prototype.get$isList = function() { 22134 ConcreteType.prototype.get$isList = function() {
21723 return this.genericType.get$isList(); 22135 return this.genericType.get$isList();
21724 } 22136 }
21725 ConcreteType.prototype.get$isClass = function() { 22137 ConcreteType.prototype.get$isClass = function() {
21726 return this.genericType.isClass; 22138 return this.genericType.isClass;
21727 } 22139 }
21728 ConcreteType.prototype.get$library = function() { 22140 ConcreteType.prototype.get$library = function() {
(...skipping 18 matching lines...) Expand all
21747 var newTypeArgs = []; 22159 var newTypeArgs = [];
21748 var needsNewType = false; 22160 var needsNewType = false;
21749 var $list = this.typeArgsInOrder; 22161 var $list = this.typeArgsInOrder;
21750 for (var $i = 0;$i < $list.length; $i++) { 22162 for (var $i = 0;$i < $list.length; $i++) {
21751 var t = $list.$index($i); 22163 var t = $list.$index($i);
21752 var newType = t.resolveTypeParams$1(inType); 22164 var newType = t.resolveTypeParams$1(inType);
21753 if ($notnull_bool($ne(newType, t))) needsNewType = true; 22165 if ($notnull_bool($ne(newType, t))) needsNewType = true;
21754 newTypeArgs.add$1(newType); 22166 newTypeArgs.add$1(newType);
21755 } 22167 }
21756 if (!$notnull_bool(needsNewType)) return this; 22168 if (!$notnull_bool(needsNewType)) return this;
21757 return this.genericType.getOrMakeConcreteType((newTypeArgs && newTypeArgs.is$L ist_Type())); 22169 return this.genericType.getOrMakeConcreteType((newTypeArgs == null ? null : ne wTypeArgs.assert$List_Type()));
21758 } 22170 }
21759 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) { 22171 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) {
21760 return this.genericType.getOrMakeConcreteType(typeArgs); 22172 return this.genericType.getOrMakeConcreteType(typeArgs);
21761 } 22173 }
21762 ConcreteType.prototype.get$parent = function() { 22174 ConcreteType.prototype.get$parent = function() {
21763 if (this._parent == null && this.genericType.get$parent() != null) { 22175 if (this._parent == null && this.genericType.get$parent() != null) {
21764 this._parent = this.genericType.get$parent().resolveTypeParams(this); 22176 this._parent = this.genericType.get$parent().resolveTypeParams(this);
21765 } 22177 }
21766 return this._parent; 22178 return this._parent;
21767 } 22179 }
(...skipping 25 matching lines...) Expand all
21793 ConcreteType.prototype.getAllMembers = function() { 22205 ConcreteType.prototype.getAllMembers = function() {
21794 var result = this.genericType.getAllMembers(); 22206 var result = this.genericType.getAllMembers();
21795 var $list = result.getKeys$0(); 22207 var $list = result.getKeys$0();
21796 for (var $i = result.getKeys$0().iterator$0(); $i.hasNext$0(); ) { 22208 for (var $i = result.getKeys$0().iterator$0(); $i.hasNext$0(); ) {
21797 var memberName = $i.next$0(); 22209 var memberName = $i.next$0();
21798 var myMember = this.members.$index(memberName); 22210 var myMember = this.members.$index(memberName);
21799 if ($notnull_bool($ne(myMember, null))) { 22211 if ($notnull_bool($ne(myMember, null))) {
21800 result.$setindex(memberName, myMember); 22212 result.$setindex(memberName, myMember);
21801 } 22213 }
21802 } 22214 }
21803 return (result && result.is$Map_String$Member()); 22215 return (result == null ? null : result.assert$Map_String$Member());
21804 } 22216 }
21805 ConcreteType.prototype.markUsed = function() { 22217 ConcreteType.prototype.markUsed = function() {
21806 this.genericType.markUsed(); 22218 this.genericType.markUsed();
21807 } 22219 }
21808 ConcreteType.prototype.genMethod = function(method) { 22220 ConcreteType.prototype.genMethod = function(method) {
21809 this.genericType.genMethod(method); 22221 this.genericType.genMethod(method);
21810 } 22222 }
21811 ConcreteType.prototype.getFactory = function(type, constructorName) { 22223 ConcreteType.prototype.getFactory = function(type, constructorName) {
21812 return this.genericType.getFactory(type, constructorName); 22224 return this.genericType.getFactory(type, constructorName);
21813 } 22225 }
21814 ConcreteType.prototype.getConstructor = function(constructorName) { 22226 ConcreteType.prototype.getConstructor = function(constructorName) {
21815 var ret = this.constructors.$index(constructorName); 22227 var ret = this.constructors.$index(constructorName);
21816 if ($notnull_bool($ne(ret, null))) return ret; 22228 if ($notnull_bool($ne(ret, null))) return ret;
21817 ret = this.factories.getFactory(this.name, constructorName); 22229 ret = this.factories.getFactory(this.name, constructorName);
21818 if ($notnull_bool($ne(ret, null))) return ret; 22230 if ($notnull_bool($ne(ret, null))) return ret;
21819 var genericMember = this.genericType.getConstructor(constructorName); 22231 var genericMember = this.genericType.getConstructor(constructorName);
21820 if ($notnull_bool(genericMember == null)) return null; 22232 if ($notnull_bool(genericMember == null)) return null;
21821 if ($notnull_bool($ne(genericMember.get$declaringType(), this.genericType))) { 22233 if ($notnull_bool($ne(genericMember.get$declaringType(), this.genericType))) {
21822 if (!$notnull_bool(genericMember.get$declaringType().get$isGeneric())) retur n genericMember; 22234 if (!$notnull_bool(genericMember.get$declaringType().get$isGeneric())) retur n genericMember;
21823 var newDeclaringType = genericMember.get$declaringType().getOrMakeConcreteTy pe$1(this.typeArgsInOrder); 22235 var newDeclaringType = genericMember.get$declaringType().getOrMakeConcreteTy pe$1(this.typeArgsInOrder);
21824 var factory = newDeclaringType.getFactory$2(this.genericType, constructorNam e); 22236 var factory = newDeclaringType.getFactory$2(this.genericType, constructorNam e);
21825 if (factory != null) return factory; 22237 if (factory != null) return factory;
21826 return newDeclaringType.getConstructor$1(constructorName); 22238 return newDeclaringType.getConstructor$1(constructorName);
21827 } 22239 }
21828 if ($notnull_bool(genericMember.get$isFactory())) { 22240 if ($notnull_bool(genericMember.get$isFactory())) {
21829 ret = new ConcreteMember($assert_String(genericMember.get$name()), this, gen ericMember); 22241 ret = new ConcreteMember($assert_String(genericMember.get$name()), this, gen ericMember);
21830 this.factories.addFactory(this.name, constructorName, (ret && ret.is$Member( ))); 22242 this.factories.addFactory(this.name, constructorName, (ret == null ? null : ret.assert$Member()));
21831 } 22243 }
21832 else { 22244 else {
21833 ret = new ConcreteMember(this.name, this, genericMember); 22245 ret = new ConcreteMember(this.name, this, genericMember);
21834 this.constructors.$setindex(constructorName, ret); 22246 this.constructors.$setindex(constructorName, ret);
21835 } 22247 }
21836 return ret; 22248 return ret;
21837 } 22249 }
21838 ConcreteType.prototype.getMember = function(memberName) { 22250 ConcreteType.prototype.getMember = function(memberName) {
21839 var $0; 22251 var $0;
21840 var member = (($0 = this.members.$index(memberName)) && $0.is$Member()); 22252 var member = (($0 = this.members.$index(memberName)) == null ? null : $0.asser t$Member());
21841 if (member != null) { 22253 if (member != null) {
21842 this._checkOverride(member); 22254 this._checkOverride(member);
21843 return member; 22255 return member;
21844 } 22256 }
21845 var genericMember = this.genericType.members.$index(memberName); 22257 var genericMember = this.genericType.members.$index(memberName);
21846 if ($notnull_bool($ne(genericMember, null))) { 22258 if ($notnull_bool($ne(genericMember, null))) {
21847 member = new ConcreteMember($assert_String(genericMember.get$name()), this, genericMember); 22259 member = new ConcreteMember($assert_String(genericMember.get$name()), this, genericMember);
21848 this.members.$setindex(memberName, member); 22260 this.members.$setindex(memberName, member);
21849 return member; 22261 return member;
21850 } 22262 }
21851 return this._getMemberInParents(memberName); 22263 return this._getMemberInParents(memberName);
21852 } 22264 }
21853 ConcreteType.prototype.resolveType = function(node, isRequired) { 22265 ConcreteType.prototype.resolveType = function(node, isRequired) {
21854 var ret = this.genericType.resolveType(node, isRequired); 22266 var ret = this.genericType.resolveType(node, isRequired);
21855 return (ret && ret.is$lang_Type()); 22267 return (ret == null ? null : ret.assert$lang_Type());
21856 } 22268 }
21857 ConcreteType.prototype.addDirectSubtype = function(type) { 22269 ConcreteType.prototype.addDirectSubtype = function(type) {
21858 this.genericType.addDirectSubtype(type); 22270 this.genericType.addDirectSubtype(type);
21859 } 22271 }
21860 ConcreteType.prototype.addDirectSubtype$1 = function($0) { 22272 ConcreteType.prototype.addDirectSubtype$1 = function($0) {
21861 return this.addDirectSubtype(($0 && $0.is$lang_Type())); 22273 return this.addDirectSubtype(($0 == null ? null : $0.assert$lang_Type()));
21862 }; 22274 };
21863 ConcreteType.prototype.getConstructor$1 = function($0) { 22275 ConcreteType.prototype.getConstructor$1 = function($0) {
21864 return this.getConstructor($assert_String($0)); 22276 return this.getConstructor($assert_String($0));
21865 }; 22277 };
21866 ConcreteType.prototype.getFactory$2 = function($0, $1) { 22278 ConcreteType.prototype.getFactory$2 = function($0, $1) {
21867 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1)); 22279 return this.getFactory(($0 == null ? null : $0.assert$lang_Type()), $assert_St ring($1));
21868 }; 22280 };
21869 ConcreteType.prototype.getMember$1 = function($0) { 22281 ConcreteType.prototype.getMember$1 = function($0) {
21870 return this.getMember($assert_String($0)); 22282 return this.getMember($assert_String($0));
21871 }; 22283 };
21872 ConcreteType.prototype.getOrMakeConcreteType$1 = function($0) { 22284 ConcreteType.prototype.getOrMakeConcreteType$1 = function($0) {
21873 return this.getOrMakeConcreteType(($0 && $0.is$List_Type())); 22285 return this.getOrMakeConcreteType(($0 == null ? null : $0.assert$List_Type())) ;
21874 }; 22286 };
21875 ConcreteType.prototype.markUsed$0 = ConcreteType.prototype.markUsed; 22287 ConcreteType.prototype.markUsed$0 = ConcreteType.prototype.markUsed;
21876 ConcreteType.prototype.resolveTypeParams$1 = function($0) { 22288 ConcreteType.prototype.resolveTypeParams$1 = function($0) {
21877 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); 22289 return this.resolveTypeParams(($0 == null ? null : $0.assert$ConcreteType()));
21878 }; 22290 };
21879 // ********** Code for DefinedType ************** 22291 // ********** Code for DefinedType **************
21880 function DefinedType(name, library, definition, isClass) { 22292 function DefinedType(name, library, definition, isClass) {
21881 this.isUsed = false 22293 this.isUsed = false
21882 this.isNative = false 22294 this.isNative = false
21883 this.library = library; 22295 this.library = library;
21884 this.isClass = isClass; 22296 this.isClass = isClass;
21885 this.directSubtypes = new HashSetImplementation(); 22297 this.directSubtypes = new HashSetImplementation();
21886 this.constructors = $map([]); 22298 this.constructors = $map([]);
21887 this.members = $map([]); 22299 this.members = $map([]);
21888 this.factories = new FactoryMap(); 22300 this.factories = new FactoryMap();
21889 // Initializers done 22301 // Initializers done
21890 lang_Type.call(this, name); 22302 lang_Type.call(this, name);
21891 this.setDefinition(definition); 22303 this.setDefinition(definition);
21892 } 22304 }
21893 $inherits(DefinedType, lang_Type); 22305 $inherits(DefinedType, lang_Type);
21894 DefinedType.prototype.is$DefinedType = function(){return this;}; 22306 DefinedType.prototype.assert$DefinedType = function(){return this};
21895 DefinedType.prototype.get$definition = function() { return this.definition; }; 22307 DefinedType.prototype.get$definition = function() { return this.definition; };
21896 DefinedType.prototype.set$definition = function(value) { return this.definition = value; }; 22308 DefinedType.prototype.set$definition = function(value) { return this.definition = value; };
21897 DefinedType.prototype.get$library = function() { return this.library; }; 22309 DefinedType.prototype.get$library = function() { return this.library; };
21898 DefinedType.prototype.get$isClass = function() { return this.isClass; }; 22310 DefinedType.prototype.get$isClass = function() { return this.isClass; };
21899 DefinedType.prototype.get$parent = function() { 22311 DefinedType.prototype.get$parent = function() {
21900 return this._parent; 22312 return this._parent;
21901 } 22313 }
21902 DefinedType.prototype.set$parent = function(p) { 22314 DefinedType.prototype.set$parent = function(p) {
21903 this._parent = p; 22315 this._parent = p;
21904 } 22316 }
21905 DefinedType.prototype.get$interfaces = function() { return this.interfaces; }; 22317 DefinedType.prototype.get$interfaces = function() { return this.interfaces; };
21906 DefinedType.prototype.set$interfaces = function(value) { return this.interfaces = value; }; 22318 DefinedType.prototype.set$interfaces = function(value) { return this.interfaces = value; };
21907 DefinedType.prototype.get$typeParameters = function() { return this.typeParamete rs; }; 22319 DefinedType.prototype.get$typeParameters = function() { return this.typeParamete rs; };
21908 DefinedType.prototype.set$typeParameters = function(value) { return this.typePar ameters = value; }; 22320 DefinedType.prototype.set$typeParameters = function(value) { return this.typePar ameters = value; };
21909 DefinedType.prototype.get$constructors = function() { return this.constructors; }; 22321 DefinedType.prototype.get$constructors = function() { return this.constructors; };
21910 DefinedType.prototype.set$constructors = function(value) { return this.construct ors = value; }; 22322 DefinedType.prototype.set$constructors = function(value) { return this.construct ors = value; };
21911 DefinedType.prototype.get$members = function() { return this.members; }; 22323 DefinedType.prototype.get$members = function() { return this.members; };
21912 DefinedType.prototype.set$members = function(value) { return this.members = valu e; }; 22324 DefinedType.prototype.set$members = function(value) { return this.members = valu e; };
21913 DefinedType.prototype.get$factories = function() { return this.factories; }; 22325 DefinedType.prototype.get$factories = function() { return this.factories; };
21914 DefinedType.prototype.set$factories = function(value) { return this.factories = value; }; 22326 DefinedType.prototype.set$factories = function(value) { return this.factories = value; };
21915 DefinedType.prototype.get$isUsed = function() { return this.isUsed; }; 22327 DefinedType.prototype.get$isUsed = function() { return this.isUsed; };
21916 DefinedType.prototype.set$isUsed = function(value) { return this.isUsed = value; }; 22328 DefinedType.prototype.set$isUsed = function(value) { return this.isUsed = value; };
21917 DefinedType.prototype.get$isNative = function() { return this.isNative; }; 22329 DefinedType.prototype.get$isNative = function() { return this.isNative; };
21918 DefinedType.prototype.set$isNative = function(value) { return this.isNative = va lue; }; 22330 DefinedType.prototype.set$isNative = function(value) { return this.isNative = va lue; };
21919 DefinedType.prototype.setDefinition = function(def) { 22331 DefinedType.prototype.setDefinition = function(def) {
21920 var $0; 22332 var $0;
21921 $assert(this.definition == null, "definition == null", "type.dart", 725, 12); 22333 $assert(this.definition == null, "definition == null", "type.dart", 726, 12);
21922 this.definition = def; 22334 this.definition = def;
21923 if ((this.definition instanceof TypeDefinition) && $notnull_bool($ne(this.defi nition.get$nativeType(), null))) { 22335 if ((this.definition instanceof TypeDefinition) && $notnull_bool($ne(this.defi nition.get$nativeType(), null))) {
21924 this.isNative = true; 22336 this.isNative = true;
21925 } 22337 }
21926 if (this.definition != null && $notnull_bool($ne(this.definition.get$typeParam eters(), null))) { 22338 if (this.definition != null && $notnull_bool($ne(this.definition.get$typeParam eters(), null))) {
21927 this._concreteTypes = $map([]); 22339 this._concreteTypes = $map([]);
21928 this.typeParameters = (($0 = this.definition.get$typeParameters()) && $0.is$ List_ParameterType()); 22340 this.typeParameters = (($0 = this.definition.get$typeParameters()) == null ? null : $0.assert$List_ParameterType());
21929 } 22341 }
21930 } 22342 }
21931 DefinedType.prototype.get$isHiddenNativeType = function() { 22343 DefinedType.prototype.get$isHiddenNativeType = function() {
21932 return $eq(this.library, $globals.world.get$dom()) || ($notnull_bool($ne(this. definition.get$nativeType(), null)) && $notnull_bool(this.definition.get$nativeT ype().get$isConstructorHidden())); 22344 return (this.definition != null && $notnull_bool($ne(this.definition.get$nativ eType(), null)) && $notnull_bool(this.definition.get$nativeType().get$isConstruc torHidden()));
21933 } 22345 }
21934 DefinedType.prototype.get$typeArgsInOrder = function() { 22346 DefinedType.prototype.get$typeArgsInOrder = function() {
21935 if (this.typeParameters == null) return null; 22347 if (this.typeParameters == null) return null;
21936 if (this._typeArgsInOrder == null) { 22348 if (this._typeArgsInOrder == null) {
21937 this._typeArgsInOrder = new FixedCollection_lang_Type($globals.world.varType , this.typeParameters.length); 22349 this._typeArgsInOrder = new FixedCollection_lang_Type($globals.world.varType , this.typeParameters.length);
21938 } 22350 }
21939 return this._typeArgsInOrder; 22351 return this._typeArgsInOrder;
21940 } 22352 }
21941 DefinedType.prototype.get$isVar = function() { 22353 DefinedType.prototype.get$isVar = function() {
21942 return $eq(this, $globals.world.varType); 22354 return $eq(this, $globals.world.varType);
(...skipping 17 matching lines...) Expand all
21960 return $notnull_bool(this.library.get$isCore()) && this.name == 'Function'; 22372 return $notnull_bool(this.library.get$isCore()) && this.name == 'Function';
21961 } 22373 }
21962 DefinedType.prototype.get$isList = function() { 22374 DefinedType.prototype.get$isList = function() {
21963 return $notnull_bool(this.library.get$isCore()) && this.name == 'List'; 22375 return $notnull_bool(this.library.get$isCore()) && this.name == 'List';
21964 } 22376 }
21965 DefinedType.prototype.get$isGeneric = function() { 22377 DefinedType.prototype.get$isGeneric = function() {
21966 return this.typeParameters != null; 22378 return this.typeParameters != null;
21967 } 22379 }
21968 DefinedType.prototype.get$span = function() { 22380 DefinedType.prototype.get$span = function() {
21969 var $0; 22381 var $0;
21970 return (($0 = this.definition == null ? null : this.definition.span) && $0.is$ SourceSpan()); 22382 return (($0 = this.definition == null ? null : this.definition.span) == null ? null : $0.assert$SourceSpan());
21971 } 22383 }
21972 DefinedType.prototype.get$typeofName = function() { 22384 DefinedType.prototype.get$typeofName = function() {
21973 if (!$notnull_bool(this.library.get$isCore())) return null; 22385 if (!$notnull_bool(this.library.get$isCore())) return null;
21974 if ($notnull_bool(this.get$isBool())) return 'boolean'; 22386 if ($notnull_bool(this.get$isBool())) return 'boolean';
21975 else if ($notnull_bool(this.get$isNum())) return 'number'; 22387 else if ($notnull_bool(this.get$isNum())) return 'number';
21976 else if ($notnull_bool(this.get$isString())) return 'string'; 22388 else if ($notnull_bool(this.get$isString())) return 'string';
21977 else if ($notnull_bool(this.get$isFunction())) return 'function'; 22389 else if ($notnull_bool(this.get$isFunction())) return 'function';
21978 else return null; 22390 else return null;
21979 } 22391 }
21980 DefinedType.prototype.get$isNum = function() { 22392 DefinedType.prototype.get$isNum = function() {
21981 return this.library != null && $notnull_bool(this.library.get$isCore()) && (th is.name == 'num' || this.name == 'int' || this.name == 'double'); 22393 return this.library != null && $notnull_bool(this.library.get$isCore()) && (th is.name == 'num' || this.name == 'int' || this.name == 'double');
21982 } 22394 }
21983 DefinedType.prototype.getCallMethod = function() { 22395 DefinedType.prototype.getCallMethod = function() {
21984 var $0; 22396 var $0;
21985 return (($0 = this.members.$index('\$call')) && $0.is$MethodMember()); 22397 return (($0 = this.members.$index('\$call')) == null ? null : $0.assert$Method Member());
21986 } 22398 }
21987 DefinedType.prototype.getAllMembers = function() { 22399 DefinedType.prototype.getAllMembers = function() {
21988 return HashMapImplementation.HashMapImplementation$from$factory(this.members); 22400 return HashMapImplementation.HashMapImplementation$from$factory(this.members);
21989 } 22401 }
21990 DefinedType.prototype.markUsed = function() { 22402 DefinedType.prototype.markUsed = function() {
21991 if ($notnull_bool(this.isUsed)) return; 22403 if ($notnull_bool(this.isUsed)) return;
21992 this.isUsed = true; 22404 this.isUsed = true;
21993 if (this._lazyGenMethods != null) { 22405 if (this._lazyGenMethods != null) {
21994 var $list = orderValuesByKeys(this._lazyGenMethods); 22406 var $list = orderValuesByKeys(this._lazyGenMethods);
21995 for (var $i = 0;$i < $list.length; $i++) { 22407 for (var $i = 0;$i < $list.length; $i++) {
21996 var method = $list.$index($i); 22408 var method = $list.$index($i);
21997 $globals.world.gen.genMethod((method && method.is$Member())); 22409 $globals.world.gen.genMethod((method == null ? null : method.assert$Member ()));
21998 } 22410 }
21999 this._lazyGenMethods = null; 22411 this._lazyGenMethods = null;
22000 } 22412 }
22001 if (this.get$parent() != null) this.get$parent().markUsed(); 22413 if (this.get$parent() != null) this.get$parent().markUsed();
22002 } 22414 }
22003 DefinedType.prototype.genMethod = function(method) { 22415 DefinedType.prototype.genMethod = function(method) {
22004 if ($notnull_bool(this.isUsed)) { 22416 if ($notnull_bool(this.isUsed)) {
22005 $globals.world.gen.genMethod(method); 22417 $globals.world.gen.genMethod(method);
22006 } 22418 }
22007 else if ($notnull_bool(this.isClass)) { 22419 else if ($notnull_bool(this.isClass)) {
22008 if (this._lazyGenMethods == null) this._lazyGenMethods = $map([]); 22420 if (this._lazyGenMethods == null) this._lazyGenMethods = $map([]);
22009 this._lazyGenMethods.$setindex(method.name, method); 22421 this._lazyGenMethods.$setindex(method.name, method);
22010 } 22422 }
22011 } 22423 }
22012 DefinedType.prototype._resolveInterfaces = function(types) { 22424 DefinedType.prototype._resolveInterfaces = function(types) {
22013 var $0; 22425 var $0;
22014 if (types == null) return []; 22426 if (types == null) return [];
22015 var interfaces = []; 22427 var interfaces = [];
22016 for (var $i = 0;$i < types.length; $i++) { 22428 for (var $i = 0;$i < types.length; $i++) {
22017 var type = types.$index($i); 22429 var type = types.$index($i);
22018 var resolvedInterface = this.resolveType((type && type.is$TypeReference()), true); 22430 var resolvedInterface = this.resolveType((type == null ? null : type.assert$ TypeReference()), true);
22019 if ($notnull_bool(resolvedInterface.get$isClosed()) && !($notnull_bool(this. library.get$isCore()) || $notnull_bool(this.library.get$isCoreImpl()))) { 22431 if ($notnull_bool(resolvedInterface.get$isClosed()) && !($notnull_bool(this. library.get$isCore()) || $notnull_bool(this.library.get$isCoreImpl()))) {
22020 $globals.world.error(('can not implement "' + resolvedInterface.get$name() + '": ') + 'only native implementation allowed', (($0 = type.get$span()) && $0. is$SourceSpan())); 22432 $globals.world.error(('can not implement "' + resolvedInterface.get$name() + '": ') + 'only native implementation allowed', (($0 = type.get$span()) == nul l ? null : $0.assert$SourceSpan()));
22021 } 22433 }
22022 resolvedInterface.addDirectSubtype$1(this); 22434 resolvedInterface.addDirectSubtype$1(this);
22023 interfaces.add$1(resolvedInterface); 22435 interfaces.add$1(resolvedInterface);
22024 } 22436 }
22025 return (interfaces && interfaces.is$List_Type()); 22437 return (interfaces == null ? null : interfaces.assert$List_Type());
22026 } 22438 }
22027 DefinedType.prototype.addDirectSubtype = function(type) { 22439 DefinedType.prototype.addDirectSubtype = function(type) {
22028 $assert(this._subtypes == null, "_subtypes == null", "type.dart", 841, 12); 22440 $assert(this._subtypes == null, "_subtypes == null", "type.dart", 841, 12);
22029 this.directSubtypes.add(type); 22441 this.directSubtypes.add(type);
22030 } 22442 }
22031 DefinedType.prototype.get$subtypes = function() { 22443 DefinedType.prototype.get$subtypes = function() {
22032 var $0; 22444 var $0;
22033 if (this._subtypes == null) { 22445 if (this._subtypes == null) {
22034 this._subtypes = new HashSetImplementation(); 22446 this._subtypes = new HashSetImplementation();
22035 var $list = this.directSubtypes; 22447 var $list = this.directSubtypes;
22036 for (var $i = this.directSubtypes.iterator(); $i.hasNext$0(); ) { 22448 for (var $i = this.directSubtypes.iterator(); $i.hasNext$0(); ) {
22037 var st = $i.next$0(); 22449 var st = $i.next$0();
22038 this._subtypes.add(st); 22450 this._subtypes.add(st);
22039 this._subtypes.addAll((($0 = st.get$subtypes()) && $0.is$Collection_E())); 22451 this._subtypes.addAll((($0 = st.get$subtypes()) == null ? null : $0.assert $Collection_E()));
22040 } 22452 }
22041 } 22453 }
22042 return this._subtypes; 22454 return this._subtypes;
22043 } 22455 }
22044 DefinedType.prototype._cycleInClassExtends = function() { 22456 DefinedType.prototype._cycleInClassExtends = function() {
22045 var seen = new HashSetImplementation(); 22457 var seen = new HashSetImplementation();
22046 seen.add(this); 22458 seen.add(this);
22047 var ancestor = this.get$parent(); 22459 var ancestor = this.get$parent();
22048 while ($notnull_bool($ne(ancestor, null))) { 22460 while ($notnull_bool($ne(ancestor, null))) {
22049 if (ancestor === this) { 22461 if (ancestor === this) {
(...skipping 29 matching lines...) Expand all
22079 } 22491 }
22080 for (var i = 0; 22492 for (var i = 0;
22081 i < this.interfaces.length; i++) { 22493 i < this.interfaces.length; i++) {
22082 if ($notnull_bool(_helper(this.interfaces.$index(i)))) return i; 22494 if ($notnull_bool(_helper(this.interfaces.$index(i)))) return i;
22083 } 22495 }
22084 return -1; 22496 return -1;
22085 } 22497 }
22086 DefinedType.prototype.resolve = function() { 22498 DefinedType.prototype.resolve = function() {
22087 var $0; 22499 var $0;
22088 if ((this.definition instanceof TypeDefinition)) { 22500 if ((this.definition instanceof TypeDefinition)) {
22089 var typeDef = (($0 = this.definition) && $0.is$TypeDefinition()); 22501 var typeDef = (($0 = this.definition) == null ? null : $0.assert$TypeDefinit ion());
22090 if ($notnull_bool(this.isClass)) { 22502 if ($notnull_bool(this.isClass)) {
22091 if (typeDef.extendsTypes != null && typeDef.extendsTypes.length > 0) { 22503 if (typeDef.extendsTypes != null && typeDef.extendsTypes.length > 0) {
22092 if (typeDef.extendsTypes.length > 1) { 22504 if (typeDef.extendsTypes.length > 1) {
22093 $globals.world.error('more than one base class', (($0 = typeDef.extend sTypes.$index(1).get$span()) && $0.is$SourceSpan())); 22505 $globals.world.error('more than one base class', (($0 = typeDef.extend sTypes.$index(1).get$span()) == null ? null : $0.assert$SourceSpan()));
22094 } 22506 }
22095 var extendsTypeRef = typeDef.extendsTypes.$index(0); 22507 var extendsTypeRef = typeDef.extendsTypes.$index(0);
22096 if ((extendsTypeRef instanceof GenericTypeReference)) { 22508 if ((extendsTypeRef instanceof GenericTypeReference)) {
22097 var g = (extendsTypeRef && extendsTypeRef.is$GenericTypeReference()); 22509 var g = (extendsTypeRef == null ? null : extendsTypeRef.assert$Generic TypeReference());
22098 this.set$parent(this.resolveType(g.baseType, true)); 22510 this.set$parent(this.resolveType(g.baseType, true));
22099 } 22511 }
22100 this.set$parent(this.resolveType((extendsTypeRef && extendsTypeRef.is$Ty peReference()), true)); 22512 this.set$parent(this.resolveType((extendsTypeRef == null ? null : extend sTypeRef.assert$TypeReference()), true));
22101 if (!$notnull_bool(this.get$parent().get$isClass())) { 22513 if (!$notnull_bool(this.get$parent().get$isClass())) {
22102 $globals.world.error('class may not extend an interface - use implemen ts', (($0 = typeDef.extendsTypes.$index(0).get$span()) && $0.is$SourceSpan())); 22514 $globals.world.error('class may not extend an interface - use implemen ts', (($0 = typeDef.extendsTypes.$index(0).get$span()) == null ? null : $0.asser t$SourceSpan()));
22103 } 22515 }
22104 this.get$parent().addDirectSubtype(this); 22516 this.get$parent().addDirectSubtype(this);
22105 if ($notnull_bool(this._cycleInClassExtends())) { 22517 if ($notnull_bool(this._cycleInClassExtends())) {
22106 $globals.world.error(('class "' + this.name + '" has a cycle in its in heritance chain'), (($0 = extendsTypeRef.get$span()) && $0.is$SourceSpan())); 22518 $globals.world.error(('class "' + this.name + '" has a cycle in its in heritance chain'), (($0 = extendsTypeRef.get$span()) == null ? null : $0.assert$ SourceSpan()));
22107 } 22519 }
22108 } 22520 }
22109 else { 22521 else {
22110 if (!$notnull_bool(this.get$isObject())) { 22522 if (!$notnull_bool(this.get$isObject())) {
22111 this.set$parent($globals.world.objectType); 22523 this.set$parent($globals.world.objectType);
22112 this.get$parent().addDirectSubtype(this); 22524 this.get$parent().addDirectSubtype(this);
22113 } 22525 }
22114 } 22526 }
22115 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes); 22527 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes);
22116 if (typeDef.factoryType != null) { 22528 if (typeDef.factoryType != null) {
22117 $globals.world.error('factory not allowed on classes', typeDef.factoryTy pe.span); 22529 $globals.world.error('factory not allowed on classes', typeDef.factoryTy pe.span);
22118 } 22530 }
22119 } 22531 }
22120 else { 22532 else {
22121 if (typeDef.implementsTypes != null && typeDef.implementsTypes.length > 0) { 22533 if (typeDef.implementsTypes != null && typeDef.implementsTypes.length > 0) {
22122 $globals.world.error('implements not allowed on interfaces (use extends) ', (($0 = typeDef.implementsTypes.$index(0).get$span()) && $0.is$SourceSpan())); 22534 $globals.world.error('implements not allowed on interfaces (use extends) ', (($0 = typeDef.implementsTypes.$index(0).get$span()) == null ? null : $0.asse rt$SourceSpan()));
22123 } 22535 }
22124 this.interfaces = this._resolveInterfaces(typeDef.extendsTypes); 22536 this.interfaces = this._resolveInterfaces(typeDef.extendsTypes);
22125 var res = this._cycleInInterfaceExtends(); 22537 var res = this._cycleInInterfaceExtends();
22126 if (res >= 0) { 22538 if (res >= 0) {
22127 $globals.world.error(('interface "' + this.name + '" has a cycle in its inheritance chain'), (($0 = typeDef.extendsTypes.$index(res).get$span()) && $0.i s$SourceSpan())); 22539 $globals.world.error(('interface "' + this.name + '" has a cycle in its inheritance chain'), (($0 = typeDef.extendsTypes.$index(res).get$span()) == null ? null : $0.assert$SourceSpan()));
22128 } 22540 }
22129 if (typeDef.factoryType != null) { 22541 if (typeDef.factoryType != null) {
22130 this.factory_ = this.resolveType(typeDef.factoryType, true); 22542 this.factory_ = this.resolveType(typeDef.factoryType, true);
22131 if (this.factory_ == null) { 22543 if (this.factory_ == null) {
22132 $globals.world.warning('unresolved factory', typeDef.factoryType.span) ; 22544 $globals.world.warning('unresolved factory', typeDef.factoryType.span) ;
22133 } 22545 }
22134 } 22546 }
22135 } 22547 }
22136 } 22548 }
22137 else if ((this.definition instanceof FunctionTypeDefinition)) { 22549 else if ((this.definition instanceof FunctionTypeDefinition)) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
22170 return; 22582 return;
22171 } 22583 }
22172 this.constructors.$setindex(method.get$constructorName(), method); 22584 this.constructors.$setindex(method.get$constructorName(), method);
22173 return; 22585 return;
22174 } 22586 }
22175 if (definition.modifiers != null && definition.modifiers.length == 1 && $notnu ll_bool($eq(definition.modifiers.$index(0).get$kind(), 75/*TokenKind.FACTORY*/)) ) { 22587 if (definition.modifiers != null && definition.modifiers.length == 1 && $notnu ll_bool($eq(definition.modifiers.$index(0).get$kind(), 75/*TokenKind.FACTORY*/)) ) {
22176 if (this.factories.getFactory($assert_String(method.get$constructorName()), $assert_String(method.get$name())) != null) { 22588 if (this.factories.getFactory($assert_String(method.get$constructorName()), $assert_String(method.get$name())) != null) {
22177 $globals.world.error(('duplicate factory definition of "' + method.get$nam e() + '"'), definition.span); 22589 $globals.world.error(('duplicate factory definition of "' + method.get$nam e() + '"'), definition.span);
22178 return; 22590 return;
22179 } 22591 }
22180 this.factories.addFactory($assert_String(method.get$constructorName()), $ass ert_String(method.get$name()), (method && method.is$Member())); 22592 this.factories.addFactory($assert_String(method.get$constructorName()), $ass ert_String(method.get$name()), (method == null ? null : method.assert$Member())) ;
22181 return; 22593 return;
22182 } 22594 }
22183 if (methodName.startsWith('get\$') || methodName.startsWith('set\$')) { 22595 if (methodName.startsWith('get\$') || methodName.startsWith('set\$')) {
22184 var propName = methodName.substring(4); 22596 var propName = methodName.substring(4);
22185 var prop = this.members.$index(propName); 22597 var prop = this.members.$index(propName);
22186 if ($notnull_bool(prop == null)) { 22598 if ($notnull_bool(prop == null)) {
22187 prop = new PropertyMember($assert_String(propName), this); 22599 prop = new PropertyMember($assert_String(propName), this);
22188 this.members.$setindex(propName, prop); 22600 this.members.$setindex(propName, prop);
22189 } 22601 }
22190 if (!(prop instanceof PropertyMember)) { 22602 if (!(prop instanceof PropertyMember)) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
22255 var $0; 22667 var $0;
22256 if (name == '' && this.definition != null && $notnull_bool(this.isClass) && th is.constructors.get$length() == 0) { 22668 if (name == '' && this.definition != null && $notnull_bool(this.isClass) && th is.constructors.get$length() == 0) {
22257 var span = this.definition.span; 22669 var span = this.definition.span;
22258 var inits = null, native_ = null, body = null; 22670 var inits = null, native_ = null, body = null;
22259 if ($notnull_bool(this.isNative)) { 22671 if ($notnull_bool(this.isNative)) {
22260 native_ = ''; 22672 native_ = '';
22261 inits = null; 22673 inits = null;
22262 } 22674 }
22263 else { 22675 else {
22264 body = null; 22676 body = null;
22265 inits = [new CallExpression(new SuperExpression((span && span.is$SourceSpa n())), [], (span && span.is$SourceSpan()))]; 22677 inits = [new CallExpression(new SuperExpression((span == null ? null : spa n.assert$SourceSpan())), [], (span == null ? null : span.assert$SourceSpan()))];
22266 } 22678 }
22267 var typeDef = (($0 = this.definition) && $0.is$TypeDefinition()); 22679 var typeDef = (($0 = this.definition) == null ? null : $0.assert$TypeDefinit ion());
22268 var c = new FunctionDefinition(null, null, typeDef.name, [], null, inits, na tive_, body, (span && span.is$SourceSpan())); 22680 var c = new FunctionDefinition(null, null, typeDef.name, [], null, inits, na tive_, body, (span == null ? null : span.assert$SourceSpan()));
22269 this.addMethod(null, (c && c.is$FunctionDefinition())); 22681 this.addMethod(null, (c == null ? null : c.assert$FunctionDefinition()));
22270 this.constructors.$index('').resolve$0(); 22682 this.constructors.$index('').resolve$0();
22271 return this.constructors.$index(''); 22683 return this.constructors.$index('');
22272 } 22684 }
22273 return null; 22685 return null;
22274 } 22686 }
22275 DefinedType.prototype.getMember = function(memberName) { 22687 DefinedType.prototype.getMember = function(memberName) {
22276 var $0; 22688 var $0;
22277 var member = (($0 = this.members.$index(memberName)) && $0.is$Member()); 22689 var member = (($0 = this.members.$index(memberName)) == null ? null : $0.asser t$Member());
22278 if (member != null) { 22690 if (member != null) {
22279 this._checkOverride(member); 22691 this._checkOverride(member);
22280 return member; 22692 return member;
22281 } 22693 }
22282 if ($notnull_bool(this.get$isTop())) { 22694 if ($notnull_bool(this.get$isTop())) {
22283 var libType = this.library.findTypeByName(memberName); 22695 var libType = this.library.findTypeByName(memberName);
22284 if ($notnull_bool($ne(libType, null))) { 22696 if ($notnull_bool($ne(libType, null))) {
22285 return (($0 = libType.get$typeMember()) && $0.is$Member()); 22697 return (($0 = libType.get$typeMember()) == null ? null : $0.assert$Member( ));
22286 } 22698 }
22287 } 22699 }
22288 return this._getMemberInParents(memberName); 22700 return this._getMemberInParents(memberName);
22289 } 22701 }
22290 DefinedType.prototype.resolveTypeParams = function(inType) { 22702 DefinedType.prototype.resolveTypeParams = function(inType) {
22291 return this; 22703 return this;
22292 } 22704 }
22293 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { 22705 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) {
22294 $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1157, 12); 22706 $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1157, 12);
22295 var jsnames = []; 22707 var jsnames = [];
22296 var names = []; 22708 var names = [];
22297 var typeMap = $map([]); 22709 var typeMap = $map([]);
22298 for (var i = 0; 22710 for (var i = 0;
22299 i < typeArgs.length; i++) { 22711 i < typeArgs.length; i++) {
22300 var paramName = this.typeParameters.$index(i).get$name(); 22712 var paramName = this.typeParameters.$index(i).get$name();
22301 typeMap.$setindex(paramName, typeArgs.$index(i)); 22713 typeMap.$setindex(paramName, typeArgs.$index(i));
22302 names.add$1(typeArgs.$index(i).get$name()); 22714 names.add$1(typeArgs.$index(i).get$name());
22303 jsnames.add$1(typeArgs.$index(i).get$jsname()); 22715 jsnames.add$1(typeArgs.$index(i).get$jsname());
22304 } 22716 }
22305 var jsname = ('' + this.get$jsname() + '_' + Strings.join((jsnames && jsnames. is$List_String()), '\$')); 22717 var jsname = ('' + this.get$jsname() + '_' + Strings.join((jsnames == null ? n ull : jsnames.assert$List_String()), '\$'));
22306 var simpleName = ('' + this.name + '<' + Strings.join((names && names.is$List_ String()), ', ') + '>'); 22718 var simpleName = ('' + this.name + '<' + Strings.join((names == null ? null : names.assert$List_String()), ', ') + '>');
22307 var key = Strings.join((names && names.is$List_String()), '\$'); 22719 var key = Strings.join((names == null ? null : names.assert$List_String()), '\ $');
22308 var ret = this._concreteTypes.$index(key); 22720 var ret = this._concreteTypes.$index(key);
22309 if ($notnull_bool(ret == null)) { 22721 if ($notnull_bool(ret == null)) {
22310 ret = new ConcreteType($assert_String(simpleName), this, typeMap, typeArgs); 22722 ret = new ConcreteType($assert_String(simpleName), this, typeMap, typeArgs);
22311 ret._jsname = $assert_String(jsname); 22723 ret._jsname = $assert_String(jsname);
22312 this._concreteTypes.$setindex(key, ret); 22724 this._concreteTypes.$setindex(key, ret);
22313 } 22725 }
22314 return (ret && ret.is$lang_Type()); 22726 return (ret == null ? null : ret.assert$lang_Type());
22315 } 22727 }
22316 DefinedType.prototype.getCallStub = function(args) { 22728 DefinedType.prototype.getCallStub = function(args) {
22317 $assert(this.get$isFunction(), "isFunction", "type.dart", 1184, 12); 22729 $assert(this.get$isFunction(), "isFunction", "type.dart", 1184, 12);
22318 var name = _getCallStubName('call', args); 22730 var name = _getCallStubName('call', args);
22319 if (this.varStubs == null) this.varStubs = $map([]);
22320 var stub = this.varStubs.$index(name); 22731 var stub = this.varStubs.$index(name);
22321 if ($notnull_bool(stub == null)) { 22732 if ($notnull_bool(stub == null)) {
22322 stub = new VarFunctionStub($assert_String(name), args); 22733 stub = new VarFunctionStub($assert_String(name), args);
22323 this.varStubs.$setindex(name, stub); 22734 this.varStubs.$setindex(name, stub);
22324 } 22735 }
22325 return (stub && stub.is$VarFunctionStub()); 22736 return (stub == null ? null : stub.assert$VarFunctionStub());
22326 } 22737 }
22327 DefinedType.prototype.addDirectSubtype$1 = function($0) { 22738 DefinedType.prototype.addDirectSubtype$1 = function($0) {
22328 return this.addDirectSubtype(($0 && $0.is$lang_Type())); 22739 return this.addDirectSubtype(($0 == null ? null : $0.assert$lang_Type()));
22329 }; 22740 };
22330 DefinedType.prototype.addMethod$2 = function($0, $1) { 22741 DefinedType.prototype.addMethod$2 = function($0, $1) {
22331 return this.addMethod($assert_String($0), ($1 && $1.is$FunctionDefinition())); 22742 return this.addMethod($assert_String($0), ($1 == null ? null : $1.assert$Funct ionDefinition()));
22332 }; 22743 };
22333 DefinedType.prototype.getConstructor$1 = function($0) { 22744 DefinedType.prototype.getConstructor$1 = function($0) {
22334 return this.getConstructor($assert_String($0)); 22745 return this.getConstructor($assert_String($0));
22335 }; 22746 };
22336 DefinedType.prototype.getFactory$2 = function($0, $1) { 22747 DefinedType.prototype.getFactory$2 = function($0, $1) {
22337 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1)); 22748 return this.getFactory(($0 == null ? null : $0.assert$lang_Type()), $assert_St ring($1));
22338 }; 22749 };
22339 DefinedType.prototype.getMember$1 = function($0) { 22750 DefinedType.prototype.getMember$1 = function($0) {
22340 return this.getMember($assert_String($0)); 22751 return this.getMember($assert_String($0));
22341 }; 22752 };
22342 DefinedType.prototype.getOrMakeConcreteType$1 = function($0) { 22753 DefinedType.prototype.getOrMakeConcreteType$1 = function($0) {
22343 return this.getOrMakeConcreteType(($0 && $0.is$List_Type())); 22754 return this.getOrMakeConcreteType(($0 == null ? null : $0.assert$List_Type())) ;
22344 }; 22755 };
22345 DefinedType.prototype.isString$0 = function() { 22756 DefinedType.prototype.isString$0 = function() {
22346 return this.get$isString()(); 22757 return this.get$isString()();
22347 }; 22758 };
22348 DefinedType.prototype.markUsed$0 = DefinedType.prototype.markUsed; 22759 DefinedType.prototype.markUsed$0 = DefinedType.prototype.markUsed;
22349 DefinedType.prototype.resolve$0 = DefinedType.prototype.resolve; 22760 DefinedType.prototype.resolve$0 = DefinedType.prototype.resolve;
22350 DefinedType.prototype.resolveTypeParams$1 = function($0) { 22761 DefinedType.prototype.resolveTypeParams$1 = function($0) {
22351 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); 22762 return this.resolveTypeParams(($0 == null ? null : $0.assert$ConcreteType()));
22352 }; 22763 };
22353 DefinedType.prototype.setDefinition$1 = function($0) { 22764 DefinedType.prototype.setDefinition$1 = function($0) {
22354 return this.setDefinition(($0 && $0.is$Definition())); 22765 return this.setDefinition(($0 == null ? null : $0.assert$Definition()));
22355 }; 22766 };
22356 // ********** Code for NativeType ************** 22767 // ********** Code for NativeType **************
22357 function NativeType(spec) { 22768 function NativeType(spec) {
22358 // Initializers done 22769 // Initializers done
22359 if (spec.startsWith('*')) { 22770 if (spec.startsWith('*')) {
22360 this.name = spec.substring(1); 22771 this.name = spec.substring(1);
22361 this.isConstructorHidden = true; 22772 this.isConstructorHidden = true;
22362 } 22773 }
22363 else { 22774 else {
22364 this.name = spec; 22775 this.name = spec;
22365 this.isConstructorHidden = false; 22776 this.isConstructorHidden = false;
22366 } 22777 }
22367 } 22778 }
22368 NativeType.prototype.get$name = function() { return this.name; }; 22779 NativeType.prototype.get$name = function() { return this.name; };
22369 NativeType.prototype.set$name = function(value) { return this.name = value; }; 22780 NativeType.prototype.set$name = function(value) { return this.name = value; };
22370 NativeType.prototype.get$isConstructorHidden = function() { return this.isConstr uctorHidden; }; 22781 NativeType.prototype.get$isConstructorHidden = function() { return this.isConstr uctorHidden; };
22371 NativeType.prototype.set$isConstructorHidden = function(value) { return this.isC onstructorHidden = value; }; 22782 NativeType.prototype.set$isConstructorHidden = function(value) { return this.isC onstructorHidden = value; };
22372 // ********** Code for FixedCollection ************** 22783 // ********** Code for FixedCollection **************
22373 function FixedCollection(value, length) { 22784 function FixedCollection(value, length) {
22374 this.value = value; 22785 this.value = value;
22375 this.length = length; 22786 this.length = length;
22376 // Initializers done 22787 // Initializers done
22377 } 22788 }
22378 FixedCollection.prototype.is$Collection_E = function(){return this;}; 22789 FixedCollection.prototype.assert$Collection_E = function(){return this};
22379 FixedCollection.prototype.is$Collection_Object = function(){return this;}; 22790 FixedCollection.prototype.assert$Collection_Object = function(){return this};
22380 FixedCollection.prototype.is$Collection_Type = function(){return this;}; 22791 FixedCollection.prototype.assert$Collection_Type = function(){return this};
22381 FixedCollection.prototype.is$Iterable = function(){return this;}; 22792 FixedCollection.prototype.assert$Iterable = function(){return this};
22382 FixedCollection.prototype.get$value = function() { return this.value; }; 22793 FixedCollection.prototype.get$value = function() { return this.value; };
22383 FixedCollection.prototype.iterator = function() { 22794 FixedCollection.prototype.iterator = function() {
22384 return new FixedIterator_E(this.value, this.length); 22795 return new FixedIterator_E(this.value, this.length);
22385 } 22796 }
22386 FixedCollection.prototype.forEach = function(f) { 22797 FixedCollection.prototype.forEach = function(f) {
22387 Collections.forEach(this, f); 22798 Collections.forEach(this, f);
22388 } 22799 }
22389 FixedCollection.prototype.filter = function(f) { 22800 FixedCollection.prototype.filter = function(f) {
22390 return Collections.filter(this, new ListFactory(), f); 22801 return Collections.filter(this, new ListFactory(), f);
22391 } 22802 }
(...skipping 20 matching lines...) Expand all
22412 FixedCollection.prototype.some$1 = function($0) { 22823 FixedCollection.prototype.some$1 = function($0) {
22413 return this.some(to$call$1($0)); 22824 return this.some(to$call$1($0));
22414 }; 22825 };
22415 // ********** Code for FixedCollection_lang_Type ************** 22826 // ********** Code for FixedCollection_lang_Type **************
22416 function FixedCollection_lang_Type(value, length) { 22827 function FixedCollection_lang_Type(value, length) {
22417 this.value = value; 22828 this.value = value;
22418 this.length = length; 22829 this.length = length;
22419 // Initializers done 22830 // Initializers done
22420 } 22831 }
22421 $inherits(FixedCollection_lang_Type, FixedCollection); 22832 $inherits(FixedCollection_lang_Type, FixedCollection);
22422 FixedCollection_lang_Type.prototype.is$Collection_E = function(){return this;}; 22833 FixedCollection_lang_Type.prototype.assert$Collection_E = function(){return this };
22423 FixedCollection_lang_Type.prototype.is$Collection_Object = function(){return thi s;}; 22834 FixedCollection_lang_Type.prototype.assert$Collection_Object = function(){return this};
22424 FixedCollection_lang_Type.prototype.is$Collection_Type = function(){return this; }; 22835 FixedCollection_lang_Type.prototype.assert$Collection_Type = function(){return t his};
22425 FixedCollection_lang_Type.prototype.is$Iterable = function(){return this;}; 22836 FixedCollection_lang_Type.prototype.assert$Iterable = function(){return this};
22426 // ********** Code for FixedIterator ************** 22837 // ********** Code for FixedIterator **************
22427 function FixedIterator(value, length) { 22838 function FixedIterator(value, length) {
22428 this._index = 0 22839 this._index = 0
22429 this.value = value; 22840 this.value = value;
22430 this.length = length; 22841 this.length = length;
22431 // Initializers done 22842 // Initializers done
22432 } 22843 }
22433 FixedIterator.prototype.is$Iterator_T = function(){return this;}; 22844 FixedIterator.prototype.assert$Iterator_T = function(){return this};
22434 FixedIterator.prototype.get$value = function() { return this.value; }; 22845 FixedIterator.prototype.get$value = function() { return this.value; };
22435 FixedIterator.prototype.hasNext = function() { 22846 FixedIterator.prototype.hasNext = function() {
22436 return this._index < this.length; 22847 return this._index < this.length;
22437 } 22848 }
22438 FixedIterator.prototype.next = function() { 22849 FixedIterator.prototype.next = function() {
22439 this._index++; 22850 this._index++;
22440 return this.value; 22851 return this.value;
22441 } 22852 }
22442 FixedIterator.prototype.hasNext$0 = FixedIterator.prototype.hasNext; 22853 FixedIterator.prototype.hasNext$0 = FixedIterator.prototype.hasNext;
22443 FixedIterator.prototype.next$0 = FixedIterator.prototype.next; 22854 FixedIterator.prototype.next$0 = FixedIterator.prototype.next;
22444 // ********** Code for FixedIterator_E ************** 22855 // ********** Code for FixedIterator_E **************
22445 function FixedIterator_E(value, length) { 22856 function FixedIterator_E(value, length) {
22446 this._index = 0 22857 this._index = 0
22447 this.value = value; 22858 this.value = value;
22448 this.length = length; 22859 this.length = length;
22449 // Initializers done 22860 // Initializers done
22450 } 22861 }
22451 $inherits(FixedIterator_E, FixedIterator); 22862 $inherits(FixedIterator_E, FixedIterator);
22452 FixedIterator_E.prototype.is$Iterator_T = function(){return this;}; 22863 FixedIterator_E.prototype.assert$Iterator_T = function(){return this};
22453 // ********** Code for Value ************** 22864 // ********** Code for Value **************
22454 function Value(type, code, span, needsTemp) { 22865 function Value(type, code, span, needsTemp) {
22455 this.isSuper = false 22866 this.isSuper = false
22456 this.isType = false 22867 this.isType = false
22457 this.isFinal = false 22868 this.isFinal = false
22458 this.type = type; 22869 this.type = type;
22459 this.code = code; 22870 this.code = code;
22460 this.span = span; 22871 this.span = span;
22461 this.needsTemp = needsTemp; 22872 this.needsTemp = needsTemp;
22462 // Initializers done 22873 // Initializers done
22463 if (this.type == null) $globals.world.internalError('type passed as null', thi s.span); 22874 if (this.type == null) $globals.world.internalError('type passed as null', thi s.span);
22464 } 22875 }
22465 Value.type$ctor = function(type, span) { 22876 Value.type$ctor = function(type, span) {
22466 this.isSuper = false 22877 this.isSuper = false
22467 this.isType = false 22878 this.isType = false
22468 this.isFinal = false 22879 this.isFinal = false
22469 this.type = type; 22880 this.type = type;
22470 this.span = span; 22881 this.span = span;
22471 this.code = null; 22882 this.code = null;
22472 this.needsTemp = false; 22883 this.needsTemp = false;
22473 this.isType = true; 22884 this.isType = true;
22474 // Initializers done 22885 // Initializers done
22475 if (this.type == null) $globals.world.internalError('type passed as null', thi s.span); 22886 if (this.type == null) $globals.world.internalError('type passed as null', thi s.span);
22476 } 22887 }
22477 Value.type$ctor.prototype = Value.prototype; 22888 Value.type$ctor.prototype = Value.prototype;
22478 Value.prototype.is$Value = function(){return this;}; 22889 Value.prototype.assert$Value = function(){return this};
22479 Value.prototype.get$type = function() { return this.type; }; 22890 Value.prototype.get$type = function() { return this.type; };
22480 Value.prototype.set$type = function(value) { return this.type = value; }; 22891 Value.prototype.set$type = function(value) { return this.type = value; };
22481 Value.prototype.get$code = function() { return this.code; }; 22892 Value.prototype.get$code = function() { return this.code; };
22482 Value.prototype.set$code = function(value) { return this.code = value; }; 22893 Value.prototype.set$code = function(value) { return this.code = value; };
22483 Value.prototype.get$span = function() { return this.span; }; 22894 Value.prototype.get$span = function() { return this.span; };
22484 Value.prototype.set$span = function(value) { return this.span = value; }; 22895 Value.prototype.set$span = function(value) { return this.span = value; };
22485 Value.prototype.get$isSuper = function() { return this.isSuper; }; 22896 Value.prototype.get$isSuper = function() { return this.isSuper; };
22486 Value.prototype.set$isSuper = function(value) { return this.isSuper = value; }; 22897 Value.prototype.set$isSuper = function(value) { return this.isSuper = value; };
22487 Value.prototype.get$isType = function() { return this.isType; }; 22898 Value.prototype.get$isType = function() { return this.isType; };
22488 Value.prototype.set$isType = function(value) { return this.isType = value; }; 22899 Value.prototype.set$isType = function(value) { return this.isType = value; };
22489 Value.prototype.get$isFinal = function() { return this.isFinal; }; 22900 Value.prototype.get$isFinal = function() { return this.isFinal; };
22490 Value.prototype.set$isFinal = function(value) { return this.isFinal = value; }; 22901 Value.prototype.set$isFinal = function(value) { return this.isFinal = value; };
22491 Value.prototype.get$needsTemp = function() { return this.needsTemp; }; 22902 Value.prototype.get$needsTemp = function() { return this.needsTemp; };
22492 Value.prototype.set$needsTemp = function(value) { return this.needsTemp = value; }; 22903 Value.prototype.set$needsTemp = function(value) { return this.needsTemp = value; };
22493 Value.prototype.get$_typeIsVarOrParameterType = function() { 22904 Value.prototype.get$_typeIsVarOrParameterType = function() {
22494 return $notnull_bool(this.type.get$isVar()) || (this.type instanceof Parameter Type); 22905 return $notnull_bool(this.type.get$isVar()) || (this.type instanceof Parameter Type);
22495 } 22906 }
22496 Value.prototype.get$isConst = function() { 22907 Value.prototype.get$isConst = function() {
22497 return false; 22908 return false;
22498 } 22909 }
22499 Value.prototype.get$canonicalCode = function() { 22910 Value.prototype.get$canonicalCode = function() {
22500 return null; 22911 return null;
22501 } 22912 }
22502 Value.prototype.get_ = function(context, name, node) { 22913 Value.prototype.get_ = function(context, name, node) {
22503 var $0; 22914 var $0;
22504 var member = this._resolveMember(context, name, node, false); 22915 var member = this._resolveMember(context, name, node, false);
22505 if ($notnull_bool($ne(member, null))) { 22916 if ($notnull_bool($ne(member, null))) {
22506 return (($0 = member._get$3(context, node, this)) && $0.is$Value()); 22917 return (($0 = member._get$3(context, node, this)) == null ? null : $0.assert $Value());
22507 } 22918 }
22508 else { 22919 else {
22509 return this.invokeNoSuchMethod(context, ('get:' + name), node); 22920 return this.invokeNoSuchMethod(context, ('get:' + name), node);
22510 } 22921 }
22511 } 22922 }
22512 Value.prototype.set_ = function(context, name, node, value, isDynamic) { 22923 Value.prototype.set_ = function(context, name, node, value, isDynamic) {
22513 var member = this._resolveMember(context, name, node, isDynamic); 22924 var member = this._resolveMember(context, name, node, isDynamic);
22514 if ($notnull_bool($ne(member, null))) { 22925 if ($notnull_bool($ne(member, null))) {
22515 return member._set(context, node, this, value, isDynamic); 22926 return member._set(context, node, this, value, isDynamic);
22516 } 22927 }
(...skipping 17 matching lines...) Expand all
22534 } 22945 }
22535 if ($notnull_bool(this.type.needsVarCall(args))) { 22946 if ($notnull_bool(this.type.needsVarCall(args))) {
22536 return this._varCall(context, args); 22947 return this._varCall(context, args);
22537 } 22948 }
22538 } 22949 }
22539 var member = this._resolveMember(context, name, node, isDynamic); 22950 var member = this._resolveMember(context, name, node, isDynamic);
22540 if ($notnull_bool(member == null)) { 22951 if ($notnull_bool(member == null)) {
22541 return this.invokeNoSuchMethod(context, name, node, args); 22952 return this.invokeNoSuchMethod(context, name, node, args);
22542 } 22953 }
22543 else { 22954 else {
22544 return (($0 = member.invoke$5(context, node, this, args, isDynamic)) && $0.i s$Value()); 22955 return (($0 = member.invoke$5(context, node, this, args, isDynamic)) == null ? null : $0.assert$Value());
22545 } 22956 }
22546 } 22957 }
22547 Value.prototype.canInvoke = function(context, name, args) { 22958 Value.prototype.canInvoke = function(context, name, args) {
22548 if ($notnull_bool(this.get$_typeIsVarOrParameterType()) && name == '\$ne') { 22959 if ($notnull_bool(this.get$_typeIsVarOrParameterType()) && name == '\$ne') {
22549 return true; 22960 return true;
22550 } 22961 }
22551 if ($notnull_bool(this.type.get$isVarOrFunction()) && name == '\$call') { 22962 if ($notnull_bool(this.type.get$isVarOrFunction()) && name == '\$call') {
22552 return true; 22963 return true;
22553 } 22964 }
22554 var member = this._resolveMember(context, name, null, true); 22965 var member = this._resolveMember(context, name, null, true);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
22639 var callMethod = toType.getCallMethod(); 23050 var callMethod = toType.getCallMethod();
22640 if ($notnull_bool($ne(callMethod, null))) { 23051 if ($notnull_bool($ne(callMethod, null))) {
22641 if ($notnull_bool(checked) && !$notnull_bool(toType.isAssignable(this.type)) ) { 23052 if ($notnull_bool(checked) && !$notnull_bool(toType.isAssignable(this.type)) ) {
22642 this.convertWarning(toType, node); 23053 this.convertWarning(toType, node);
22643 } 23054 }
22644 var arity = $assert_num(callMethod.get$parameters().length); 23055 var arity = $assert_num(callMethod.get$parameters().length);
22645 var myCall = this.type.getCallMethod(); 23056 var myCall = this.type.getCallMethod();
22646 if ($notnull_bool(myCall == null) || $notnull_bool($ne(myCall.get$parameters ().length, arity))) { 23057 if ($notnull_bool(myCall == null) || $notnull_bool($ne(myCall.get$parameters ().length, arity))) {
22647 var stub = $globals.world.functionType.getCallStub(Arguments.Arguments$bar e$factory(arity)); 23058 var stub = $globals.world.functionType.getCallStub(Arguments.Arguments$bar e$factory(arity));
22648 var val = new Value(toType, ('to\$' + stub.name + '(' + this.code + ')'), node.span, true); 23059 var val = new Value(toType, ('to\$' + stub.name + '(' + this.code + ')'), node.span, true);
22649 return (($0 = $notnull_bool(this._isDomCallback(toType)) && !$notnull_bool (this._isDomCallback(this.type)) ? val._wrapDomCallback(toType, arity) : val) && $0.is$Value()); 23060 return (($0 = $notnull_bool(this._isDomCallback(toType)) && !$notnull_bool (this._isDomCallback(this.type)) ? val._wrapDomCallback(toType, arity) : val) == null ? null : $0.assert$Value());
22650 } 23061 }
22651 else if ($notnull_bool(this._isDomCallback(toType)) && !$notnull_bool(this._ isDomCallback(this.type))) { 23062 else if ($notnull_bool(this._isDomCallback(toType)) && !$notnull_bool(this._ isDomCallback(this.type))) {
22652 return this._wrapDomCallback(toType, arity); 23063 return this._wrapDomCallback(toType, arity);
22653 } 23064 }
22654 } 23065 }
22655 var fromType = this.type; 23066 var fromType = this.type;
22656 if ($notnull_bool(this.type.get$isVar()) && (this.code != 'null' || !$notnull_ bool(toType.get$isNullable()))) { 23067 if ($notnull_bool(this.type.get$isVar()) && (this.code != 'null' || !$notnull_ bool(toType.get$isNullable()))) {
22657 fromType = $globals.world.objectType; 23068 fromType = $globals.world.objectType;
22658 } 23069 }
22659 var bothNum = $notnull_bool(this.type.get$isNum()) && $notnull_bool(toType.get $isNum()); 23070 var bothNum = $notnull_bool(this.type.get$isNum()) && $notnull_bool(toType.get $isNum());
22660 if ($notnull_bool(fromType.isSubtypeOf(toType)) || $notnull_bool(bothNum)) { 23071 if ($notnull_bool(fromType.isSubtypeOf(toType)) || $notnull_bool(bothNum)) {
22661 return this; 23072 return this;
22662 } 23073 }
22663 if ($notnull_bool(checked) && !$notnull_bool(toType.isSubtypeOf(this.type))) { 23074 if ($notnull_bool(checked) && !$notnull_bool(toType.isSubtypeOf(this.type))) {
22664 this.convertWarning(toType, node); 23075 this.convertWarning(toType, node);
22665 } 23076 }
22666 if ($notnull_bool($globals.options.enableTypeChecks)) { 23077 if ($notnull_bool($globals.options.enableTypeChecks)) {
22667 return this._typeAssert(context, toType, node); 23078 return this._typeAssert(context, toType, node, isDynamic);
22668 } 23079 }
22669 else { 23080 else {
22670 return this; 23081 return this;
22671 } 23082 }
22672 } 23083 }
22673 Value.prototype._isDomCallback = function(toType) { 23084 Value.prototype._isDomCallback = function(toType) {
22674 return ((toType.get$definition() instanceof FunctionTypeDefinition) && $notnul l_bool($eq(toType.get$library(), $globals.world.get$dom()))); 23085 return ((toType.get$definition() instanceof FunctionTypeDefinition) && $notnul l_bool($eq(toType.get$library(), $globals.world.get$dom())));
22675 } 23086 }
22676 Value.prototype._wrapDomCallback = function(toType, arity) { 23087 Value.prototype._wrapDomCallback = function(toType, arity) {
22677 if (arity == 0) { 23088 if (arity == 0) {
22678 $globals.world.gen.corejs.useWrap0 = true; 23089 $globals.world.gen.corejs.useWrap0 = true;
22679 } 23090 }
22680 else { 23091 else {
22681 $globals.world.gen.corejs.useWrap1 = true; 23092 $globals.world.gen.corejs.useWrap1 = true;
22682 } 23093 }
22683 return new Value(toType, ('\$wrap_call\$' + arity + '(' + this.code + ')'), th is.span, true); 23094 return new Value(toType, ('\$wrap_call\$' + arity + '(' + this.code + ')'), th is.span, true);
22684 } 23095 }
22685 Value.prototype._typeAssert = function(context, toType, node) { 23096 Value.prototype._typeAssert = function(context, toType, node, isDynamic) {
22686 if ((toType instanceof ParameterType)) { 23097 if ((toType instanceof ParameterType)) {
22687 var p = (toType && toType.is$ParameterType()); 23098 var p = (toType == null ? null : toType.assert$ParameterType());
22688 toType = p.extendsType; 23099 toType = p.extendsType;
22689 } 23100 }
22690 if (toType.getCallMethod() != null || $eq(toType.get$library(), $globals.world .get$dom())) {
22691 return this;
22692 }
22693 if ($notnull_bool(toType.get$isObject()) || $notnull_bool(toType.get$isVar())) { 23101 if ($notnull_bool(toType.get$isObject()) || $notnull_bool(toType.get$isVar())) {
22694 $globals.world.internalError(('We thought ' + this.type.name + ' is not a su btype of ' + toType.name + '?')); 23102 $globals.world.internalError(('We thought ' + this.type.name + ' is not a su btype of ' + toType.name + '?'));
22695 } 23103 }
23104 var typeError = $globals.world.corelib.types.$index('TypeError');
23105 var typeErrorCtor = typeError.getConstructor$1('_internal');
23106 $globals.world.gen.corejs.ensureTypeNameOf();
23107 var result = typeErrorCtor.invoke$5(context, node, new Value.type$ctor(typeErr or, null), new Arguments(null, [new Value($globals.world.objectType, 'this', nul l, true), new Value($globals.world.stringType, ('"' + toType.name + '"'), null, true)]), isDynamic);
23108 $globals.world.gen.corejs.useThrow = true;
23109 var throwTypeError = ('\$throw(' + result.get$code() + ')');
22696 if ($notnull_bool(toType.get$isNum())) toType = $globals.world.numType; 23110 if ($notnull_bool(toType.get$isNum())) toType = $globals.world.numType;
22697 var check; 23111 var check;
22698 if ($notnull_bool(toType.get$isVoid())) { 23112 if ($notnull_bool(toType.get$isVoid())) {
22699 check = ('\$assert_void(' + this.code + ')'); 23113 check = ('\$assert_void(' + this.code + ')');
22700 if (toType.typeCheckCode == null) { 23114 if (toType.typeCheckCode == null) {
22701 toType.typeCheckCode = "function $assert_void(x) {\n return x == null ? x : x.is$void(); // throws TypeError\n}"; 23115 toType.typeCheckCode = ("function $assert_void(x) {\n if (x == null) retu rn null;\n " + throwTypeError + "\n}");
22702 } 23116 }
22703 } 23117 }
22704 else if ($eq(toType, $globals.world.nonNullBool)) { 23118 else if ($eq(toType, $globals.world.nonNullBool)) {
22705 $globals.world.gen.corejs.useNotNullBool = true; 23119 $globals.world.gen.corejs.useNotNullBool = true;
22706 check = ('\$notnull_bool(' + this.code + ')'); 23120 check = ('\$notnull_bool(' + this.code + ')');
22707 } 23121 }
22708 else if ($notnull_bool(toType.get$library().get$isCore()) && toType.get$typeof Name() != null) { 23122 else if ($notnull_bool(toType.get$library().get$isCore()) && toType.get$typeof Name() != null) {
22709 check = ('\$assert_' + toType.name + '(' + this.code + ')'); 23123 check = ('\$assert_' + toType.name + '(' + this.code + ')');
22710 if (toType.typeCheckCode == null) { 23124 if (toType.typeCheckCode == null) {
22711 toType.typeCheckCode = ("function $assert_" + toType.name + "(x) {\n if ( x == null || typeof(x) == \"" + toType.get$typeofName() + "\") return x;\n thro w new TypeError(\"'\" + x + \"' is not a " + toType.name + ".\");\n}"); 23125 toType.typeCheckCode = ("function $assert_" + toType.name + "(x) {\n if ( x == null || typeof(x) == \"" + toType.get$typeofName() + "\") return x;\n " + throwTypeError + "\n}");
22712 } 23126 }
22713 } 23127 }
22714 else { 23128 else {
22715 toType.isTested = true; 23129 toType.isChecked = true;
23130 var checkName = 'assert\$' + toType.get$jsname();
22716 var temp = context.getTemp(this); 23131 var temp = context.getTemp(this);
22717 check = ('(' + context.assignTemp((temp && temp.is$Value()), this).code + ' &&'); 23132 check = ('(' + context.assignTemp((temp == null ? null : temp.assert$Value() ), this).code + ' == null ? null :');
22718 check = check + (' ' + temp.get$code() + '.is\$' + toType.get$jsname() + '() )'); 23133 check = check + (' ' + temp.get$code() + '.' + checkName + '())');
22719 if ($ne(this, temp)) context.freeTemp((temp && temp.is$Value())); 23134 if ($ne(this, temp)) context.freeTemp((temp == null ? null : temp.assert$Val ue()));
23135 if (!$globals.world.objectType.varStubs.containsKey(checkName)) {
23136 $globals.world.objectType.varStubs.$setindex(checkName, new VarMethodStub( checkName, null, Arguments.get$EMPTY(), throwTypeError));
23137 }
22720 } 23138 }
22721 return new Value(toType, check, this.span, true); 23139 return new Value(toType, check, this.span, true);
22722 } 23140 }
22723 Value.prototype.instanceOf = function(context, toType, span, isTrue, forceCheck) { 23141 Value.prototype.instanceOf = function(context, toType, span, isTrue, forceCheck) {
22724 if ($notnull_bool(toType.get$isVar())) { 23142 if ($notnull_bool(toType.get$isVar())) {
22725 $globals.world.error('can not resolve type', span); 23143 $globals.world.error('can not resolve type', span);
22726 } 23144 }
22727 var testCode = null; 23145 var testCode = null;
22728 if ($notnull_bool(toType.get$isVar()) || $notnull_bool(toType.get$isObject()) || (toType instanceof ParameterType)) { 23146 if ($notnull_bool(toType.get$isVar()) || $notnull_bool(toType.get$isObject()) || (toType instanceof ParameterType)) {
22729 if ($notnull_bool(this.needsTemp)) { 23147 if ($notnull_bool(this.needsTemp)) {
22730 return new Value($globals.world.nonNullBool, ('(' + this.code + ', true)') , span, true); 23148 return new Value($globals.world.nonNullBool, ('(' + this.code + ', true)') , span, true);
22731 } 23149 }
22732 else { 23150 else {
22733 return EvaluatedValue.EvaluatedValue$factory($globals.world.nonNullBool, t rue, 'true', null); 23151 return EvaluatedValue.EvaluatedValue$factory($globals.world.nonNullBool, t rue, 'true', null);
22734 } 23152 }
22735 } 23153 }
22736 if ($notnull_bool(toType.get$library().get$isCore())) { 23154 if ($notnull_bool(toType.get$library().get$isCore())) {
22737 var typeofName = toType.get$typeofName(); 23155 var typeofName = toType.get$typeofName();
22738 if ($notnull_bool($ne(typeofName, null))) { 23156 if ($notnull_bool($ne(typeofName, null))) {
22739 testCode = ("(typeof(" + this.code + ") " + ($notnull_bool(isTrue) ? '==' : '!=') + " '" + typeofName + "')"); 23157 testCode = ("(typeof(" + this.code + ") " + ($notnull_bool(isTrue) ? '==' : '!=') + " '" + typeofName + "')");
22740 } 23158 }
22741 } 23159 }
22742 if ($notnull_bool(toType.get$isClass()) && !(toType instanceof ConcreteType)) { 23160 if ($notnull_bool(toType.get$isClass()) && !(toType instanceof ConcreteType) & & !$notnull_bool(toType.get$isHiddenNativeType())) {
22743 toType.markUsed(); 23161 toType.markUsed();
22744 testCode = ('(' + this.code + ' instanceof ' + toType.get$jsname() + ')'); 23162 testCode = ('(' + this.code + ' instanceof ' + toType.get$jsname() + ')');
22745 if (!$notnull_bool(isTrue)) { 23163 if (!$notnull_bool(isTrue)) {
22746 testCode = '!' + testCode; 23164 testCode = '!' + testCode;
22747 } 23165 }
22748 } 23166 }
22749 if (testCode == null) { 23167 if (testCode == null) {
22750 toType.isTested = true; 23168 toType.isTested = true;
22751 var temp = context.getTemp(this); 23169 var temp = context.getTemp(this);
22752 testCode = ('(' + context.assignTemp((temp && temp.is$Value()), this).code + ' &&'); 23170 var checkName = ('is\$' + toType.get$jsname());
22753 testCode = testCode + (' ' + temp.get$code() + '.is\$' + toType.get$jsname() + ')'); 23171 testCode = ('(' + context.assignTemp((temp == null ? null : temp.assert$Valu e()), this).code + ' &&');
23172 testCode = testCode + (' ' + temp.get$code() + '.' + checkName + '())');
22754 if ($notnull_bool(isTrue)) { 23173 if ($notnull_bool(isTrue)) {
22755 testCode = '!!' + testCode; 23174 testCode = '!!' + testCode;
22756 } 23175 }
22757 else { 23176 else {
22758 testCode = '!' + testCode; 23177 testCode = '!' + testCode;
22759 } 23178 }
22760 if ($ne(this, temp)) context.freeTemp((temp && temp.is$Value())); 23179 if ($ne(this, temp)) context.freeTemp((temp == null ? null : temp.assert$Val ue()));
23180 if (!$globals.world.objectType.varStubs.containsKey(checkName)) {
23181 $globals.world.objectType.varStubs.$setindex(checkName, new VarMethodStub( checkName, null, Arguments.get$EMPTY(), 'return false'));
23182 }
22761 } 23183 }
22762 return new Value($globals.world.nonNullBool, testCode, span, true); 23184 return new Value($globals.world.nonNullBool, testCode, span, true);
22763 } 23185 }
22764 Value.prototype.convertWarning = function(toType, node) { 23186 Value.prototype.convertWarning = function(toType, node) {
22765 $globals.world.warning(('type "' + this.type.name + '" is not assignable to "' + toType.name + '"'), node.span); 23187 $globals.world.warning(('type "' + this.type.name + '" is not assignable to "' + toType.name + '"'), node.span);
22766 } 23188 }
22767 Value.prototype.invokeNoSuchMethod = function(context, name, node, args) { 23189 Value.prototype.invokeNoSuchMethod = function(context, name, node, args) {
22768 var $0; 23190 var $0;
22769 var pos = ''; 23191 var pos = '';
22770 if (args != null) { 23192 if (args != null) {
22771 var argsCode = []; 23193 var argsCode = [];
22772 for (var i = 0; 23194 for (var i = 0;
22773 i < args.get$length(); i++) { 23195 i < args.get$length(); i++) {
22774 argsCode.add$1(args.values.$index(i).get$code()); 23196 argsCode.add$1(args.values.$index(i).get$code());
22775 } 23197 }
22776 pos = Strings.join((argsCode && argsCode.is$List_String()), ", "); 23198 pos = Strings.join((argsCode == null ? null : argsCode.assert$List_String()) , ", ");
22777 } 23199 }
22778 var noSuchArgs = [new Value($globals.world.stringType, ('"' + name + '"'), nod e.span, true), new Value($globals.world.listType, ('[' + pos + ']'), node.span, true)]; 23200 var noSuchArgs = [new Value($globals.world.stringType, ('"' + name + '"'), nod e.span, true), new Value($globals.world.listType, ('[' + pos + ']'), node.span, true)];
22779 return (($0 = this._resolveMember(context, 'noSuchMethod', node, false).invoke $4(context, node, this, new Arguments(null, noSuchArgs))) && $0.is$Value()); 23201 return (($0 = this._resolveMember(context, 'noSuchMethod', node, false).invoke $4(context, node, this, new Arguments(null, noSuchArgs))) == null ? null : $0.as sert$Value());
22780 } 23202 }
22781 Value.prototype.invokeSpecial = function(name, args, returnType) { 23203 Value.prototype.invokeSpecial = function(name, args, returnType) {
22782 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 496, 12 ); 23204 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 519, 12 );
22783 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4 97, 12); 23205 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 5 20, 12);
22784 var argsString = args.getCode(); 23206 var argsString = args.getCode();
22785 if (name == '\$index' || name == '\$setindex') { 23207 if (name == '\$index' || name == '\$setindex') {
22786 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString + ')'), this.span, true); 23208 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString + ')'), this.span, true);
22787 } 23209 }
22788 else { 23210 else {
22789 if (argsString.length > 0) argsString = (', ' + argsString); 23211 if (argsString.length > 0) argsString = (', ' + argsString);
22790 $globals.world.gen.corejs.useOperator(name); 23212 $globals.world.gen.corejs.useOperator(name);
22791 return new Value(returnType, ('' + name + '(' + this.code + argsString + ')' ), this.span, true); 23213 return new Value(returnType, ('' + name + '(' + this.code + argsString + ')' ), this.span, true);
22792 } 23214 }
22793 } 23215 }
22794 Value.prototype.checkFirstClass$1 = function($0) { 23216 Value.prototype.checkFirstClass$1 = function($0) {
22795 return this.checkFirstClass(($0 && $0.is$SourceSpan())); 23217 return this.checkFirstClass(($0 == null ? null : $0.assert$SourceSpan()));
22796 }; 23218 };
22797 Value.prototype.convertTo$3 = function($0, $1, $2) { 23219 Value.prototype.convertTo$3 = function($0, $1, $2) {
22798 return this.convertTo(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Type( )), ($2 && $2.is$lang_Node()), false); 23220 return this.convertTo(($0 == null ? null : $0.assert$MethodGenerator()), ($1 = = null ? null : $1.assert$lang_Type()), ($2 == null ? null : $2.assert$lang_Node ()), false);
22799 }; 23221 };
22800 Value.prototype.convertTo$4 = function($0, $1, $2, $3) { 23222 Value.prototype.convertTo$4 = function($0, $1, $2, $3) {
22801 return this.convertTo(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Type( )), ($2 && $2.is$lang_Node()), $assert_bool($3)); 23223 return this.convertTo(($0 == null ? null : $0.assert$MethodGenerator()), ($1 = = null ? null : $1.assert$lang_Type()), ($2 == null ? null : $2.assert$lang_Node ()), $assert_bool($3));
22802 }; 23224 };
22803 Value.prototype.get_$3 = function($0, $1, $2) { 23225 Value.prototype.get_$3 = function($0, $1, $2) {
22804 return this.get_(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $ 2.is$lang_Node())); 23226 return this.get_(($0 == null ? null : $0.assert$MethodGenerator()), $assert_St ring($1), ($2 == null ? null : $2.assert$lang_Node()));
22805 }; 23227 };
22806 Value.prototype.instanceOf$3$isTrue$forceCheck = function($0, $1, $2, isTrue, fo rceCheck) { 23228 Value.prototype.instanceOf$3$isTrue$forceCheck = function($0, $1, $2, isTrue, fo rceCheck) {
22807 return this.instanceOf(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Type ()), ($2 && $2.is$SourceSpan()), $assert_bool(isTrue), $assert_bool(forceCheck)) ; 23229 return this.instanceOf(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == null ? null : $1.assert$lang_Type()), ($2 == null ? null : $2.assert$SourceSp an()), $assert_bool(isTrue), $assert_bool(forceCheck));
22808 }; 23230 };
22809 Value.prototype.instanceOf$4 = function($0, $1, $2, $3) { 23231 Value.prototype.instanceOf$4 = function($0, $1, $2, $3) {
22810 return this.instanceOf(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Type ()), ($2 && $2.is$SourceSpan()), $assert_bool($3), false); 23232 return this.instanceOf(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == null ? null : $1.assert$lang_Type()), ($2 == null ? null : $2.assert$SourceSp an()), $assert_bool($3), false);
22811 }; 23233 };
22812 Value.prototype.invoke$4 = function($0, $1, $2, $3) { 23234 Value.prototype.invoke$4 = function($0, $1, $2, $3) {
22813 return this.invoke(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$lang_Node()), ($3 && $3.is$Arguments()), false); 23235 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), $assert_ String($1), ($2 == null ? null : $2.assert$lang_Node()), ($3 == null ? null : $3 .assert$Arguments()), false);
22814 }; 23236 };
22815 Value.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 23237 Value.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) {
22816 return this.invoke(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$lang_Node()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); 23238 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), $assert_ String($1), ($2 == null ? null : $2.assert$lang_Node()), ($3 == null ? null : $3 .assert$Arguments()), $assert_bool(isDynamic));
22817 }; 23239 };
22818 Value.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 23240 Value.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
22819 return this.invoke(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$lang_Node()), ($3 && $3.is$Arguments()), $assert_bool($4)); 23241 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), $assert_ String($1), ($2 == null ? null : $2.assert$lang_Node()), ($3 == null ? null : $3 .assert$Arguments()), $assert_bool($4));
22820 }; 23242 };
22821 Value.prototype.needsConversion$1 = function($0) { 23243 Value.prototype.needsConversion$1 = function($0) {
22822 return this.needsConversion(($0 && $0.is$lang_Type())); 23244 return this.needsConversion(($0 == null ? null : $0.assert$lang_Type()));
22823 }; 23245 };
22824 Value.prototype.set_$4 = function($0, $1, $2, $3) { 23246 Value.prototype.set_$4 = function($0, $1, $2, $3) {
22825 return this.set_(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $ 2.is$lang_Node()), ($3 && $3.is$Value()), false); 23247 return this.set_(($0 == null ? null : $0.assert$MethodGenerator()), $assert_St ring($1), ($2 == null ? null : $2.assert$lang_Node()), ($3 == null ? null : $3.a ssert$Value()), false);
22826 }; 23248 };
22827 // ********** Code for EvaluatedValue ************** 23249 // ********** Code for EvaluatedValue **************
22828 function EvaluatedValue() {} 23250 function EvaluatedValue() {}
22829 EvaluatedValue._internal$ctor = function(type, actualValue, canonicalCode, span, code) { 23251 EvaluatedValue._internal$ctor = function(type, actualValue, canonicalCode, span, code) {
22830 this.actualValue = actualValue; 23252 this.actualValue = actualValue;
22831 this.canonicalCode = canonicalCode; 23253 this.canonicalCode = canonicalCode;
22832 // Initializers done 23254 // Initializers done
22833 Value.call(this, type, code, span, false); 23255 Value.call(this, type, code, span, false);
22834 } 23256 }
22835 EvaluatedValue._internal$ctor.prototype = EvaluatedValue.prototype; 23257 EvaluatedValue._internal$ctor.prototype = EvaluatedValue.prototype;
22836 $inherits(EvaluatedValue, Value); 23258 $inherits(EvaluatedValue, Value);
22837 EvaluatedValue.EvaluatedValue$factory = function(type, actualValue, canonicalCod e, span) { 23259 EvaluatedValue.EvaluatedValue$factory = function(type, actualValue, canonicalCod e, span) {
22838 return new EvaluatedValue._internal$ctor(type, actualValue, canonicalCode, spa n, EvaluatedValue.codeWithComments(canonicalCode, span)); 23260 return new EvaluatedValue._internal$ctor(type, actualValue, canonicalCode, spa n, EvaluatedValue.codeWithComments(canonicalCode, span));
22839 } 23261 }
22840 EvaluatedValue.prototype.get$actualValue = function() { return this.actualValue; }; 23262 EvaluatedValue.prototype.get$actualValue = function() { return this.actualValue; };
22841 EvaluatedValue.prototype.set$actualValue = function(value) { return this.actualV alue = value; }; 23263 EvaluatedValue.prototype.set$actualValue = function(value) { return this.actualV alue = value; };
22842 EvaluatedValue.prototype.get$isConst = function() { 23264 EvaluatedValue.prototype.get$isConst = function() {
22843 return true; 23265 return true;
22844 } 23266 }
22845 EvaluatedValue.prototype.get$canonicalCode = function() { return this.canonicalC ode; }; 23267 EvaluatedValue.prototype.get$canonicalCode = function() { return this.canonicalC ode; };
22846 EvaluatedValue.prototype.set$canonicalCode = function(value) { return this.canon icalCode = value; }; 23268 EvaluatedValue.prototype.set$canonicalCode = function(value) { return this.canon icalCode = value; };
22847 EvaluatedValue.codeWithComments = function(canonicalCode, span) { 23269 EvaluatedValue.codeWithComments = function(canonicalCode, span) {
22848 return (span != null && span.get$text() != canonicalCode) ? ('' + canonicalCod e + '/*' + span.get$text() + '*/') : canonicalCode; 23270 return (span != null && span.get$text() != canonicalCode) ? ('' + canonicalCod e + '/*' + span.get$text() + '*/') : canonicalCode;
22849 } 23271 }
22850 // ********** Code for ConstListValue ************** 23272 // ********** Code for ConstListValue **************
22851 function ConstListValue() {} 23273 function ConstListValue() {}
22852 ConstListValue._internal$ctor = function(type, values, actualValue, canonicalCod e, span, code) { 23274 ConstListValue._internal$ctor = function(type, values, actualValue, canonicalCod e, span, code) {
22853 this.values = values; 23275 this.values = values;
22854 // Initializers done 23276 // Initializers done
22855 EvaluatedValue._internal$ctor.call(this, (type && type.is$lang_Type()), actual Value, canonicalCode, (span && span.is$SourceSpan()), $assert_String(code)); 23277 EvaluatedValue._internal$ctor.call(this, (type == null ? null : type.assert$la ng_Type()), actualValue, canonicalCode, (span == null ? null : span.assert$Sourc eSpan()), $assert_String(code));
22856 } 23278 }
22857 ConstListValue._internal$ctor.prototype = ConstListValue.prototype; 23279 ConstListValue._internal$ctor.prototype = ConstListValue.prototype;
22858 $inherits(ConstListValue, EvaluatedValue); 23280 $inherits(ConstListValue, EvaluatedValue);
22859 ConstListValue.ConstListValue$factory = function(type, values, actualValue, cano nicalCode, span) { 23281 ConstListValue.ConstListValue$factory = function(type, values, actualValue, cano nicalCode, span) {
22860 return new ConstListValue._internal$ctor(type, values, actualValue, canonicalC ode, span, EvaluatedValue.codeWithComments(canonicalCode, span)); 23282 return new ConstListValue._internal$ctor(type, values, actualValue, canonicalC ode, span, EvaluatedValue.codeWithComments(canonicalCode, span));
22861 } 23283 }
22862 ConstListValue.prototype.get$values = function() { return this.values; }; 23284 ConstListValue.prototype.get$values = function() { return this.values; };
22863 ConstListValue.prototype.set$values = function(value) { return this.values = val ue; }; 23285 ConstListValue.prototype.set$values = function(value) { return this.values = val ue; };
22864 // ********** Code for ConstMapValue ************** 23286 // ********** Code for ConstMapValue **************
22865 function ConstMapValue() {} 23287 function ConstMapValue() {}
22866 ConstMapValue._internal$ctor = function(type, values, actualValue, canonicalCode , span, code) { 23288 ConstMapValue._internal$ctor = function(type, values, actualValue, canonicalCode , span, code) {
22867 this.values = values; 23289 this.values = values;
22868 // Initializers done 23290 // Initializers done
22869 EvaluatedValue._internal$ctor.call(this, (type && type.is$lang_Type()), actual Value, canonicalCode, (span && span.is$SourceSpan()), $assert_String(code)); 23291 EvaluatedValue._internal$ctor.call(this, (type == null ? null : type.assert$la ng_Type()), actualValue, canonicalCode, (span == null ? null : span.assert$Sourc eSpan()), $assert_String(code));
22870 } 23292 }
22871 ConstMapValue._internal$ctor.prototype = ConstMapValue.prototype; 23293 ConstMapValue._internal$ctor.prototype = ConstMapValue.prototype;
22872 $inherits(ConstMapValue, EvaluatedValue); 23294 $inherits(ConstMapValue, EvaluatedValue);
22873 ConstMapValue.ConstMapValue$factory = function(type, keyValuePairs, actualValue, canonicalCode, span) { 23295 ConstMapValue.ConstMapValue$factory = function(type, keyValuePairs, actualValue, canonicalCode, span) {
22874 var values = new HashMapImplementation(); 23296 var values = new HashMapImplementation();
22875 for (var i = 0; 23297 for (var i = 0;
22876 i < keyValuePairs.length; i += 2) { 23298 i < keyValuePairs.length; i += 2) {
22877 values.$setindex(keyValuePairs.$index(i).get$actualValue(), keyValuePairs.$i ndex(i + 1)); 23299 values.$setindex(keyValuePairs.$index(i).get$actualValue(), keyValuePairs.$i ndex(i + 1));
22878 } 23300 }
22879 return new ConstMapValue._internal$ctor(type, values, actualValue, canonicalCo de, span, EvaluatedValue.codeWithComments(canonicalCode, span)); 23301 return new ConstMapValue._internal$ctor(type, values, actualValue, canonicalCo de, span, EvaluatedValue.codeWithComments(canonicalCode, span));
22880 } 23302 }
22881 ConstMapValue.prototype.get$values = function() { return this.values; }; 23303 ConstMapValue.prototype.get$values = function() { return this.values; };
22882 ConstMapValue.prototype.set$values = function(value) { return this.values = valu e; }; 23304 ConstMapValue.prototype.set$values = function(value) { return this.values = valu e; };
22883 // ********** Code for ConstObjectValue ************** 23305 // ********** Code for ConstObjectValue **************
22884 function ConstObjectValue() {} 23306 function ConstObjectValue() {}
22885 ConstObjectValue._internal$ctor = function(type, fields, actualValue, canonicalC ode, span, code) { 23307 ConstObjectValue._internal$ctor = function(type, fields, actualValue, canonicalC ode, span, code) {
22886 this.fields = fields; 23308 this.fields = fields;
22887 // Initializers done 23309 // Initializers done
22888 EvaluatedValue._internal$ctor.call(this, (type && type.is$lang_Type()), actual Value, canonicalCode, (span && span.is$SourceSpan()), $assert_String(code)); 23310 EvaluatedValue._internal$ctor.call(this, (type == null ? null : type.assert$la ng_Type()), actualValue, canonicalCode, (span == null ? null : span.assert$Sourc eSpan()), $assert_String(code));
22889 } 23311 }
22890 ConstObjectValue._internal$ctor.prototype = ConstObjectValue.prototype; 23312 ConstObjectValue._internal$ctor.prototype = ConstObjectValue.prototype;
22891 $inherits(ConstObjectValue, EvaluatedValue); 23313 $inherits(ConstObjectValue, EvaluatedValue);
22892 ConstObjectValue.ConstObjectValue$factory = function(type, fields, canonicalCode , span) { 23314 ConstObjectValue.ConstObjectValue$factory = function(type, fields, canonicalCode , span) {
22893 var fieldValues = []; 23315 var fieldValues = [];
22894 var $list = fields.getKeys(); 23316 var $list = fields.getKeys();
22895 for (var $i = fields.getKeys().iterator$0(); $i.hasNext$0(); ) { 23317 for (var $i = fields.getKeys().iterator$0(); $i.hasNext$0(); ) {
22896 var f = $i.next$0(); 23318 var f = $i.next$0();
22897 fieldValues.add(('' + f + ' = ' + fields.$index(f).get$actualValue())); 23319 fieldValues.add(('' + f + ' = ' + fields.$index(f).get$actualValue()));
22898 } 23320 }
(...skipping 12 matching lines...) Expand all
22911 this.field = field; 23333 this.field = field;
22912 this.name = name; 23334 this.name = name;
22913 this.exp = exp; 23335 this.exp = exp;
22914 this.canonicalCode = canonicalCode; 23336 this.canonicalCode = canonicalCode;
22915 this.dependencies = []; 23337 this.dependencies = [];
22916 // Initializers done 23338 // Initializers done
22917 Value.call(this, type, code, span, !$notnull_bool(isConst)); 23339 Value.call(this, type, code, span, !$notnull_bool(isConst));
22918 for (var $i = 0;$i < _dependencies.length; $i++) { 23340 for (var $i = 0;$i < _dependencies.length; $i++) {
22919 var dep = _dependencies.$index($i); 23341 var dep = _dependencies.$index($i);
22920 this.dependencies.add(dep); 23342 this.dependencies.add(dep);
22921 this.dependencies.addAll((($0 = dep.get$dependencies()) && $0.is$Collection_ E())); 23343 this.dependencies.addAll((($0 = dep.get$dependencies()) == null ? null : $0. assert$Collection_E()));
22922 } 23344 }
22923 } 23345 }
22924 $inherits(GlobalValue, Value); 23346 $inherits(GlobalValue, Value);
22925 GlobalValue.prototype.is$GlobalValue = function(){return this;}; 23347 GlobalValue.prototype.assert$GlobalValue = function(){return this};
22926 GlobalValue.prototype.is$Comparable = function(){return this;}; 23348 GlobalValue.prototype.assert$Comparable = function(){return this};
22927 GlobalValue.GlobalValue$fromStatic$factory = function(field, exp, dependencies) { 23349 GlobalValue.GlobalValue$fromStatic$factory = function(field, exp, dependencies) {
22928 var $0; 23350 var $0;
22929 var code = ($notnull_bool(exp.get$isConst()) ? exp.get$canonicalCode() : exp.c ode); 23351 var code = ($notnull_bool(exp.get$isConst()) ? exp.get$canonicalCode() : exp.c ode);
22930 var codeWithComment = ('' + code + '/*' + field.get$declaringType().get$name() + '.' + field.get$name() + '*/'); 23352 var codeWithComment = ('' + code + '/*' + field.get$declaringType().get$name() + '.' + field.get$name() + '*/');
22931 return new GlobalValue(exp.type, $assert_String(codeWithComment), $assert_bool (field.get$isFinal()), field, null, exp, code, exp.span, (($0 = dependencies.fil ter$1((function (d) { 23353 return new GlobalValue(exp.type, $assert_String(codeWithComment), $assert_bool (field.get$isFinal()), field, null, exp, code, exp.span, (($0 = dependencies.fil ter$1((function (d) {
22932 return (d instanceof GlobalValue); 23354 return (d instanceof GlobalValue);
22933 }) 23355 })
22934 )) && $0.is$List_GlobalValue())); 23356 )) == null ? null : $0.assert$List_GlobalValue()));
22935 } 23357 }
22936 GlobalValue.GlobalValue$fromConst$factory = function(uniqueId, exp, dependencies ) { 23358 GlobalValue.GlobalValue$fromConst$factory = function(uniqueId, exp, dependencies ) {
22937 var $0; 23359 var $0;
22938 var name = ("const\$" + uniqueId); 23360 var name = ("const\$" + uniqueId);
22939 var codeWithComment = ("" + name + "/*" + exp.span.get$text() + "*/"); 23361 var codeWithComment = ("" + name + "/*" + exp.span.get$text() + "*/");
22940 return new GlobalValue(exp.type, $assert_String(codeWithComment), true, null, name, exp, name, exp.span, (($0 = dependencies.filter$1((function (d) { 23362 return new GlobalValue(exp.type, $assert_String(codeWithComment), true, null, name, exp, name, exp.span, (($0 = dependencies.filter$1((function (d) {
22941 return (d instanceof GlobalValue); 23363 return (d instanceof GlobalValue);
22942 }) 23364 })
22943 )) && $0.is$List_GlobalValue())); 23365 )) == null ? null : $0.assert$List_GlobalValue()));
22944 } 23366 }
22945 GlobalValue.prototype.get$field = function() { return this.field; }; 23367 GlobalValue.prototype.get$field = function() { return this.field; };
22946 GlobalValue.prototype.set$field = function(value) { return this.field = value; } ; 23368 GlobalValue.prototype.set$field = function(value) { return this.field = value; } ;
22947 GlobalValue.prototype.get$name = function() { return this.name; }; 23369 GlobalValue.prototype.get$name = function() { return this.name; };
22948 GlobalValue.prototype.set$name = function(value) { return this.name = value; }; 23370 GlobalValue.prototype.set$name = function(value) { return this.name = value; };
22949 GlobalValue.prototype.get$exp = function() { return this.exp; }; 23371 GlobalValue.prototype.get$exp = function() { return this.exp; };
22950 GlobalValue.prototype.set$exp = function(value) { return this.exp = value; }; 23372 GlobalValue.prototype.set$exp = function(value) { return this.exp = value; };
22951 GlobalValue.prototype.get$canonicalCode = function() { return this.canonicalCode ; }; 23373 GlobalValue.prototype.get$canonicalCode = function() { return this.canonicalCode ; };
22952 GlobalValue.prototype.set$canonicalCode = function(value) { return this.canonica lCode = value; }; 23374 GlobalValue.prototype.set$canonicalCode = function(value) { return this.canonica lCode = value; };
22953 GlobalValue.prototype.get$isConst = function() { 23375 GlobalValue.prototype.get$isConst = function() {
(...skipping 27 matching lines...) Expand all
22981 return -1; 23403 return -1;
22982 } 23404 }
22983 else if (this.name != null) { 23405 else if (this.name != null) {
22984 return this.name.compareTo(other.name); 23406 return this.name.compareTo(other.name);
22985 } 23407 }
22986 else { 23408 else {
22987 return this.field.name.compareTo(other.field.name); 23409 return this.field.name.compareTo(other.field.name);
22988 } 23410 }
22989 } 23411 }
22990 GlobalValue.prototype.compareTo$1 = function($0) { 23412 GlobalValue.prototype.compareTo$1 = function($0) {
22991 return this.compareTo(($0 && $0.is$GlobalValue())); 23413 return this.compareTo(($0 == null ? null : $0.assert$GlobalValue()));
22992 }; 23414 };
22993 // ********** Code for BareValue ************** 23415 // ********** Code for BareValue **************
22994 function BareValue(home, outermost, span) { 23416 function BareValue(home, outermost, span) {
22995 this.home = home; 23417 this.home = home;
22996 // Initializers done 23418 // Initializers done
22997 Value.call(this, outermost.method.declaringType, null, span, false); 23419 Value.call(this, outermost.method.declaringType, null, span, false);
22998 this.isType = outermost.get$isStatic(); 23420 this.isType = outermost.get$isStatic();
22999 } 23421 }
23000 $inherits(BareValue, Value); 23422 $inherits(BareValue, Value);
23001 BareValue.prototype._ensureCode = function() { 23423 BareValue.prototype._ensureCode = function() {
23002 if (this.code != null) return; 23424 if (this.code != null) return;
23003 if ($notnull_bool(this.isType)) { 23425 if ($notnull_bool(this.isType)) {
23004 this.code = this.type.get$jsname(); 23426 this.code = this.type.get$jsname();
23005 } 23427 }
23006 else { 23428 else {
23007 this.code = this.home._makeThisCode(); 23429 this.code = this.home._makeThisCode();
23008 } 23430 }
23009 } 23431 }
23010 BareValue.prototype._tryResolveMember = function(context, name) { 23432 BareValue.prototype._tryResolveMember = function(context, name) {
23011 $assert($eq(context, this.home), "context == home", "value.dart", 717, 12); 23433 $assert($eq(context, this.home), "context == home", "value.dart", 740, 12);
23012 var member = this.type.resolveMember(name); 23434 var member = this.type.resolveMember(name);
23013 if ($notnull_bool($ne(member, null))) { 23435 if ($notnull_bool($ne(member, null))) {
23014 this._ensureCode(); 23436 this._ensureCode();
23015 return member; 23437 return member;
23016 } 23438 }
23017 member = this.home.get$library().lookup(name, this.span); 23439 member = this.home.get$library().lookup(name, this.span);
23018 if ($notnull_bool($ne(member, null))) { 23440 if ($notnull_bool($ne(member, null))) {
23019 return member; 23441 return member;
23020 } 23442 }
23021 this._ensureCode(); 23443 this._ensureCode();
(...skipping 24 matching lines...) Expand all
23046 this.files = files; 23468 this.files = files;
23047 this.libraries = $map([]); 23469 this.libraries = $map([]);
23048 this._todo = []; 23470 this._todo = [];
23049 this._members = $map([]); 23471 this._members = $map([]);
23050 this._topNames = $map([]); 23472 this._topNames = $map([]);
23051 this.reader = new LibraryReader(); 23473 this.reader = new LibraryReader();
23052 // Initializers done 23474 // Initializers done
23053 } 23475 }
23054 World.prototype.get$coreimpl = function() { 23476 World.prototype.get$coreimpl = function() {
23055 var $0; 23477 var $0;
23056 return (($0 = this.libraries.$index('dart:coreimpl')) && $0.is$Library()); 23478 return (($0 = this.libraries.$index('dart:coreimpl')) == null ? null : $0.asse rt$Library());
23057 } 23479 }
23058 World.prototype.get$dom = function() { 23480 World.prototype.get$dom = function() {
23059 var $0; 23481 var $0;
23060 return (($0 = this.libraries.$index('dart:dom')) && $0.is$Library()); 23482 return (($0 = this.libraries.$index('dart:dom')) == null ? null : $0.assert$Li brary());
23061 } 23483 }
23062 World.prototype.get$dynamicType = function() { return this.dynamicType; }; 23484 World.prototype.get$dynamicType = function() { return this.dynamicType; };
23063 World.prototype.set$dynamicType = function(value) { return this.dynamicType = va lue; }; 23485 World.prototype.set$dynamicType = function(value) { return this.dynamicType = va lue; };
23064 World.prototype.get$functionType = function() { return this.functionType; }; 23486 World.prototype.get$functionType = function() { return this.functionType; };
23065 World.prototype.set$functionType = function(value) { return this.functionType = value; }; 23487 World.prototype.set$functionType = function(value) { return this.functionType = value; };
23066 World.prototype.init = function() { 23488 World.prototype.init = function() {
23067 var $0; 23489 var $0;
23068 this.corelib = new Library(this.readFile('dart:core')); 23490 this.corelib = new Library(this.readFile('dart:core'));
23069 this.libraries.$setindex('dart:core', this.corelib); 23491 this.libraries.$setindex('dart:core', this.corelib);
23070 this._todo.add(this.corelib); 23492 this._todo.add(this.corelib);
23071 this.voidType = (($0 = this._addToCoreLib('void', false)) && $0.is$DefinedType ()); 23493 this.voidType = (($0 = this._addToCoreLib('void', false)) == null ? null : $0. assert$DefinedType());
23072 this.dynamicType = (($0 = this._addToCoreLib('Dynamic', false)) && $0.is$Defin edType()); 23494 this.dynamicType = (($0 = this._addToCoreLib('Dynamic', false)) == null ? null : $0.assert$DefinedType());
23073 this.varType = this.dynamicType; 23495 this.varType = this.dynamicType;
23074 this.objectType = (($0 = this._addToCoreLib('Object', true)) && $0.is$DefinedT ype()); 23496 this.objectType = (($0 = this._addToCoreLib('Object', true)) == null ? null : $0.assert$DefinedType());
23075 this.numType = (($0 = this._addToCoreLib('num', false)) && $0.is$DefinedType() ); 23497 this.numType = (($0 = this._addToCoreLib('num', false)) == null ? null : $0.as sert$DefinedType());
23076 this.intType = (($0 = this._addToCoreLib('int', false)) && $0.is$DefinedType() ); 23498 this.intType = (($0 = this._addToCoreLib('int', false)) == null ? null : $0.as sert$DefinedType());
23077 this.doubleType = (($0 = this._addToCoreLib('double', false)) && $0.is$Defined Type()); 23499 this.doubleType = (($0 = this._addToCoreLib('double', false)) == null ? null : $0.assert$DefinedType());
23078 this.boolType = (($0 = this._addToCoreLib('bool', false)) && $0.is$DefinedType ()); 23500 this.boolType = (($0 = this._addToCoreLib('bool', false)) == null ? null : $0. assert$DefinedType());
23079 this.stringType = (($0 = this._addToCoreLib('String', false)) && $0.is$Defined Type()); 23501 this.stringType = (($0 = this._addToCoreLib('String', false)) == null ? null : $0.assert$DefinedType());
23080 this.listType = (($0 = this._addToCoreLib('List', false)) && $0.is$DefinedType ()); 23502 this.listType = (($0 = this._addToCoreLib('List', false)) == null ? null : $0. assert$DefinedType());
23081 this.mapType = (($0 = this._addToCoreLib('Map', false)) && $0.is$DefinedType() ); 23503 this.mapType = (($0 = this._addToCoreLib('Map', false)) == null ? null : $0.as sert$DefinedType());
23082 this.functionType = (($0 = this._addToCoreLib('Function', false)) && $0.is$Def inedType()); 23504 this.functionType = (($0 = this._addToCoreLib('Function', false)) == null ? nu ll : $0.assert$DefinedType());
23083 this.nonNullBool = new NonNullableType(this.boolType); 23505 this.nonNullBool = new NonNullableType(this.boolType);
23084 } 23506 }
23085 World.prototype._addMember = function(member) { 23507 World.prototype._addMember = function(member) {
23086 $assert(!$notnull_bool(member.get$isPrivate()), "!member.isPrivate", "world.da rt", 145, 12); 23508 $assert(!$notnull_bool(member.get$isPrivate()), "!member.isPrivate", "world.da rt", 145, 12);
23087 if ($notnull_bool(member.get$isStatic())) { 23509 if ($notnull_bool(member.get$isStatic())) {
23088 if ($notnull_bool(member.declaringType.get$isTop())) { 23510 if ($notnull_bool(member.declaringType.get$isTop())) {
23089 this._addTopName(member); 23511 this._addTopName(member);
23090 } 23512 }
23091 return; 23513 return;
23092 } 23514 }
23093 var mset = this._members.$index(member.name); 23515 var mset = this._members.$index(member.name);
23094 if ($notnull_bool(mset == null)) { 23516 if ($notnull_bool(mset == null)) {
23095 mset = new MemberSet(member, true); 23517 mset = new MemberSet(member, true);
23096 this._members.$setindex(mset.get$name(), mset); 23518 this._members.$setindex(mset.get$name(), mset);
23097 } 23519 }
23098 else { 23520 else {
23099 mset.get$members().add$1(member); 23521 mset.get$members().add$1(member);
23100 } 23522 }
23101 } 23523 }
23102 World.prototype._addTopName = function(named) { 23524 World.prototype._addTopName = function(named) {
23103 var existing = this._topNames.$index(named.get$jsname()); 23525 var existing = this._topNames.$index(named.get$jsname());
23104 if ($notnull_bool($ne(existing, null))) { 23526 if ($notnull_bool($ne(existing, null))) {
23105 this.info(('mangling matching top level name "' + named.get$jsname() + '" in ') + ('both "' + named.get$library().get$jsname() + '" and "' + existing.get$li brary().get$jsname() + '"')); 23527 this.info(('mangling matching top level name "' + named.get$jsname() + '" in ') + ('both "' + named.get$library().get$jsname() + '" and "' + existing.get$li brary().get$jsname() + '"'));
23106 if ($notnull_bool(named.get$isNative())) { 23528 if ($notnull_bool(named.get$isNative())) {
23107 if ($notnull_bool(existing.get$isNative())) { 23529 if ($notnull_bool(existing.get$isNative())) {
23108 $globals.world.internalError(('conflicting native names "' + named.get$j sname() + '" ') + ('(already defined in ' + existing.get$span().get$locationText () + ')'), named.get$span()); 23530 $globals.world.internalError(('conflicting native names "' + named.get$j sname() + '" ') + ('(already defined in ' + existing.get$span().get$locationText () + ')'), named.get$span());
23109 } 23531 }
23110 else { 23532 else {
23111 this._topNames.$setindex(named.get$jsname(), named); 23533 this._topNames.$setindex(named.get$jsname(), named);
23112 this._addJavascriptTopName((existing && existing.is$lang_Element())); 23534 this._addJavascriptTopName((existing == null ? null : existing.assert$la ng_Element()));
23113 } 23535 }
23114 } 23536 }
23115 else if ($notnull_bool(named.get$library().get$isCore())) { 23537 else if ($notnull_bool(named.get$library().get$isCore())) {
23116 if ($notnull_bool(existing.get$library().get$isCore())) { 23538 if ($notnull_bool(existing.get$library().get$isCore())) {
23117 $globals.world.internalError(('conflicting top-level names in core "' + named.get$jsname() + '" ') + ('(previously defined in ' + existing.get$span().ge t$locationText() + ')'), named.get$span()); 23539 $globals.world.internalError(('conflicting top-level names in core "' + named.get$jsname() + '" ') + ('(previously defined in ' + existing.get$span().ge t$locationText() + ')'), named.get$span());
23118 } 23540 }
23119 else { 23541 else {
23120 this._topNames.$setindex(named.get$jsname(), named); 23542 this._topNames.$setindex(named.get$jsname(), named);
23121 this._addJavascriptTopName((existing && existing.is$lang_Element())); 23543 this._addJavascriptTopName((existing == null ? null : existing.assert$la ng_Element()));
23122 } 23544 }
23123 } 23545 }
23124 else { 23546 else {
23125 this._addJavascriptTopName(named); 23547 this._addJavascriptTopName(named);
23126 } 23548 }
23127 } 23549 }
23128 else { 23550 else {
23129 this._topNames.$setindex(named.get$jsname(), named); 23551 this._topNames.$setindex(named.get$jsname(), named);
23130 } 23552 }
23131 } 23553 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
23203 var mainMembers = lib.get$topType().resolveMember$1('main'); 23625 var mainMembers = lib.get$topType().resolveMember$1('main');
23204 var main = null; 23626 var main = null;
23205 if ($notnull_bool(mainMembers == null) || $notnull_bool($eq(mainMembers.get$ members().length, 0))) { 23627 if ($notnull_bool(mainMembers == null) || $notnull_bool($eq(mainMembers.get$ members().length, 0))) {
23206 $this.fatal('no main method specified'); 23628 $this.fatal('no main method specified');
23207 } 23629 }
23208 else if (mainMembers.get$members().length > 1) { 23630 else if (mainMembers.get$members().length > 1) {
23209 var $list = mainMembers.get$members(); 23631 var $list = mainMembers.get$members();
23210 for (var $i = mainMembers.get$members().iterator$0(); $i.hasNext$0(); ) { 23632 for (var $i = mainMembers.get$members().iterator$0(); $i.hasNext$0(); ) {
23211 var m = $i.next$0(); 23633 var m = $i.next$0();
23212 main = m; 23634 main = m;
23213 $this.error('more than one main member (using last?)', (($0 = main.get$s pan()) && $0.is$SourceSpan())); 23635 $this.error('more than one main member (using last?)', (($0 = main.get$s pan()) == null ? null : $0.assert$SourceSpan()));
23214 } 23636 }
23215 } 23637 }
23216 else { 23638 else {
23217 main = mainMembers.get$members().$index(0); 23639 main = mainMembers.get$members().$index(0);
23218 } 23640 }
23219 var codeWriter = new CodeWriter(); 23641 var codeWriter = new CodeWriter();
23220 $this.gen = new WorldGenerator(main, codeWriter); 23642 $this.gen = new WorldGenerator(main, codeWriter);
23221 $this.gen.run(); 23643 $this.gen.run();
23222 $this.jsBytesWritten = $assert_num(codeWriter.get$text().length); 23644 $this.jsBytesWritten = $assert_num(codeWriter.get$text().length);
23223 }) 23645 })
(...skipping 14 matching lines...) Expand all
23238 this.dartBytesRead += sourceFile.get$text().length; 23660 this.dartBytesRead += sourceFile.get$text().length;
23239 return sourceFile; 23661 return sourceFile;
23240 } catch (e) { 23662 } catch (e) {
23241 e = _toDartException(e); 23663 e = _toDartException(e);
23242 this.warning(('Error reading file: ' + filename)); 23664 this.warning(('Error reading file: ' + filename));
23243 return new SourceFile(filename, ''); 23665 return new SourceFile(filename, '');
23244 } 23666 }
23245 } 23667 }
23246 World.prototype.getOrAddLibrary = function(filename) { 23668 World.prototype.getOrAddLibrary = function(filename) {
23247 var $0; 23669 var $0;
23248 var library = (($0 = this.libraries.$index(filename)) && $0.is$Library()); 23670 var library = (($0 = this.libraries.$index(filename)) == null ? null : $0.asse rt$Library());
23249 if (library == null) { 23671 if (library == null) {
23250 library = new Library(this.readFile(filename)); 23672 library = new Library(this.readFile(filename));
23251 this.info(('read library ' + filename)); 23673 this.info(('read library ' + filename));
23252 if (!$notnull_bool(library.get$isCore()) && !library.imports.some((function (li) { 23674 if (!$notnull_bool(library.get$isCore()) && !library.imports.some((function (li) {
23253 return li.get$library().get$isCore(); 23675 return li.get$library().get$isCore();
23254 }) 23676 })
23255 )) { 23677 )) {
23256 library.imports.add(new LibraryImport(this.corelib)); 23678 library.imports.add(new LibraryImport(this.corelib));
23257 } 23679 }
23258 this.libraries.$setindex(filename, library); 23680 this.libraries.$setindex(filename, library);
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
23446 23868
23447 case '--compile-only': 23869 case '--compile-only':
23448 23870
23449 this.compileOnly = true; 23871 this.compileOnly = true;
23450 continue loop; 23872 continue loop;
23451 23873
23452 default: 23874 default:
23453 23875
23454 if ($notnull_bool(arg.endsWith$1('.dart'))) { 23876 if ($notnull_bool(arg.endsWith$1('.dart'))) {
23455 this.dartScript = $assert_String(arg); 23877 this.dartScript = $assert_String(arg);
23456 this.childArgs = (($0 = args.getRange(i + 1, args.length - i - 1)) && $0.is$List_String()); 23878 this.childArgs = (($0 = args.getRange(i + 1, args.length - i - 1)) == null ? null : $0.assert$List_String());
23457 break loop; 23879 break loop;
23458 } 23880 }
23459 else if ($notnull_bool(arg.startsWith$1('--out='))) { 23881 else if ($notnull_bool(arg.startsWith$1('--out='))) {
23460 this.outfile = $assert_String(arg.substring$1('--out='.length)); 23882 this.outfile = $assert_String(arg.substring$1('--out='.length));
23461 } 23883 }
23462 else if ($notnull_bool(arg.startsWith$1('--libdir='))) { 23884 else if ($notnull_bool(arg.startsWith$1('--libdir='))) {
23463 this.libDir = $assert_String(arg.substring$1('--libdir='.length)); 23885 this.libDir = $assert_String(arg.substring$1('--libdir='.length));
23464 passedLibDir = true; 23886 passedLibDir = true;
23465 } 23887 }
23466 else { 23888 else {
(...skipping 30 matching lines...) Expand all
23497 else { 23919 else {
23498 $globals.world.error(('File not found: ' + filename)); 23920 $globals.world.error(('File not found: ' + filename));
23499 return new SourceFile(filename, ''); 23921 return new SourceFile(filename, '');
23500 } 23922 }
23501 } 23923 }
23502 // ********** Code for VarMember ************** 23924 // ********** Code for VarMember **************
23503 function VarMember(name) { 23925 function VarMember(name) {
23504 this.name = name; 23926 this.name = name;
23505 // Initializers done 23927 // Initializers done
23506 } 23928 }
23507 VarMember.prototype.is$VarMember = function(){return this;}; 23929 VarMember.prototype.assert$VarMember = function(){return this};
23508 VarMember.prototype.get$name = function() { return this.name; }; 23930 VarMember.prototype.get$name = function() { return this.name; };
23509 VarMember.prototype.get$returnType = function() { 23931 VarMember.prototype.get$returnType = function() {
23510 return $globals.world.varType; 23932 return $globals.world.varType;
23511 } 23933 }
23512 VarMember.prototype.invoke = function(context, node, target, args) { 23934 VarMember.prototype.invoke = function(context, node, target, args) {
23513 return new Value(this.get$returnType(), ('' + target.code + '.' + this.name + '(' + args.getCode() + ')'), node.span, true); 23935 return new Value(this.get$returnType(), ('' + target.code + '.' + this.name + '(' + args.getCode() + ')'), node.span, true);
23514 } 23936 }
23515 VarMember.prototype.generate$1 = function($0) { 23937 VarMember.prototype.generate$1 = function($0) {
23516 return this.generate(($0 && $0.is$CodeWriter())); 23938 return this.generate(($0 == null ? null : $0.assert$CodeWriter()));
23517 }; 23939 };
23518 VarMember.prototype.invoke$4 = function($0, $1, $2, $3) { 23940 VarMember.prototype.invoke$4 = function($0, $1, $2, $3) {
23519 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments())); 23941 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()));
23520 }; 23942 };
23521 // ********** Code for VarFunctionStub ************** 23943 // ********** Code for VarFunctionStub **************
23522 function VarFunctionStub(name, callArgs) { 23944 function VarFunctionStub(name, callArgs) {
23523 this.args = callArgs.toCallStubArgs(); 23945 this.args = callArgs.toCallStubArgs();
23524 // Initializers done 23946 // Initializers done
23525 VarMember.call(this, name); 23947 VarMember.call(this, name);
23526 $globals.world.gen.corejs.useGenStub = true; 23948 $globals.world.gen.corejs.useGenStub = true;
23527 } 23949 }
23528 $inherits(VarFunctionStub, VarMember); 23950 $inherits(VarFunctionStub, VarMember);
23529 VarFunctionStub.prototype.is$VarFunctionStub = function(){return this;}; 23951 VarFunctionStub.prototype.assert$VarFunctionStub = function(){return this};
23530 VarFunctionStub.prototype.generate = function(code) { 23952 VarFunctionStub.prototype.generate = function(code) {
23531 if ($notnull_bool(this.args.get$hasNames())) { 23953 if ($notnull_bool(this.args.get$hasNames())) {
23532 this.generateNamed(code); 23954 this.generateNamed(code);
23533 } 23955 }
23534 else { 23956 else {
23535 this.generatePositional(code); 23957 this.generatePositional(code);
23536 } 23958 }
23537 } 23959 }
23538 VarFunctionStub.prototype.generatePositional = function(w) { 23960 VarFunctionStub.prototype.generatePositional = function(w) {
23539 var arity = this.args.get$length(); 23961 var arity = this.args.get$length();
(...skipping 10 matching lines...) Expand all
23550 } 23972 }
23551 VarFunctionStub.prototype.generateNamed = function(w) { 23973 VarFunctionStub.prototype.generateNamed = function(w) {
23552 var named = Strings.join(this.args.getNames(), '", "'); 23974 var named = Strings.join(this.args.getNames(), '", "');
23553 var argsCode = this.args.getCode(); 23975 var argsCode = this.args.getCode();
23554 w.enterBlock(('Function.prototype.' + this.name + ' = function(' + argsCode + ') {')); 23976 w.enterBlock(('Function.prototype.' + this.name + ' = function(' + argsCode + ') {'));
23555 w.writeln(('this.' + this.name + ' = this.\$genStub(' + this.args.get$length() + ', ["' + named + '"]);')); 23977 w.writeln(('this.' + this.name + ' = this.\$genStub(' + this.args.get$length() + ', ["' + named + '"]);'));
23556 w.writeln(('return this.' + this.name + '(' + argsCode + ');')); 23978 w.writeln(('return this.' + this.name + '(' + argsCode + ');'));
23557 w.exitBlock('}'); 23979 w.exitBlock('}');
23558 } 23980 }
23559 VarFunctionStub.prototype.generate$1 = function($0) { 23981 VarFunctionStub.prototype.generate$1 = function($0) {
23560 return this.generate(($0 && $0.is$CodeWriter())); 23982 return this.generate(($0 == null ? null : $0.assert$CodeWriter()));
23561 }; 23983 };
23562 // ********** Code for VarMethodStub ************** 23984 // ********** Code for VarMethodStub **************
23563 function VarMethodStub(name, member, args, body) { 23985 function VarMethodStub(name, member, args, body) {
23564 this.member = member; 23986 this.member = member;
23565 this.args = args; 23987 this.args = args;
23566 this.body = body; 23988 this.body = body;
23567 // Initializers done 23989 // Initializers done
23568 VarMember.call(this, name); 23990 VarMember.call(this, name);
23569 } 23991 }
23570 $inherits(VarMethodStub, VarMember); 23992 $inherits(VarMethodStub, VarMember);
23571 VarMethodStub.prototype.get$body = function() { return this.body; }; 23993 VarMethodStub.prototype.get$body = function() { return this.body; };
23994 VarMethodStub.prototype.get$isHidden = function() {
23995 return $assert_bool(this.member != null ? this.member.declaringType.get$isHidd enNativeType() : false);
23996 }
23572 VarMethodStub.prototype.get$returnType = function() { 23997 VarMethodStub.prototype.get$returnType = function() {
23573 var $0; 23998 var $0;
23574 return (($0 = this.member != null ? this.member.get$returnType() : $globals.wo rld.varType) && $0.is$lang_Type()); 23999 return (($0 = this.member != null ? this.member.get$returnType() : $globals.wo rld.varType) == null ? null : $0.assert$lang_Type());
23575 } 24000 }
23576 VarMethodStub.prototype.get$typeName = function() { 24001 VarMethodStub.prototype.get$declaringType = function() {
23577 return this.member != null ? this.member.declaringType.get$jsname() : 'Object' ; 24002 var $0;
24003 return (($0 = this.member != null ? this.member.declaringType : $globals.world .objectType) == null ? null : $0.assert$lang_Type());
23578 } 24004 }
23579 VarMethodStub.prototype.generate = function(code) { 24005 VarMethodStub.prototype.generate = function(code) {
23580 code.write(('' + this.get$typeName() + '.prototype.' + this.name + ' = ')); 24006 code.write($globals.world.gen._prototypeOf(this.get$declaringType(), this.name ) + ' = ');
23581 this.generateBody(code, ';'); 24007 if (!$notnull_bool(this.get$isHidden()) && $notnull_bool(this._useDirectCall(t his.args))) {
23582 } 24008 code.writeln(('' + this.get$declaringType().get$jsname() + '.prototype.' + t his.member.get$jsname() + ';'));
23583 VarMethodStub.prototype.generateBody = function(code, end) { 24009 }
23584 if ($notnull_bool(this._useDirectCall(this.member, this.args))) { 24010 else if ($notnull_bool(this._needsExactTypeCheck())) {
23585 code.writeln(('' + this.get$typeName() + '.prototype.' + this.member.get$jsn ame() + end)); 24011 code.enterBlock(('function(' + this.args.getCode() + ') {'));
24012 code.enterBlock(('if (Object.getPrototypeOf(this).hasOwnProperty("' + this.n ame + '")) {'));
24013 code.writeln(('' + this.body + ';'));
24014 code.exitBlock('}');
24015 var argsCode = this.args.getCode();
24016 if (argsCode != '') argsCode = ', ' + argsCode;
24017 code.writeln(('return Object.prototype.' + this.name + '.call(this' + argsCo de + ');'));
24018 code.exitBlock('};');
23586 } 24019 }
23587 else { 24020 else {
23588 code.enterBlock(('function(' + this.args.getCode() + ') {')); 24021 code.enterBlock(('function(' + this.args.getCode() + ') {'));
23589 code.writeln(('return ' + this.body.code + ';')); 24022 code.writeln(('' + this.body + ';'));
23590 code.exitBlock(('}' + end)); 24023 code.exitBlock('};');
23591 } 24024 }
23592 } 24025 }
23593 VarMethodStub.prototype._useDirectCall = function(member, args) { 24026 VarMethodStub.prototype._needsExactTypeCheck = function() {
23594 if ((member instanceof MethodMember) && !$notnull_bool(member.declaringType.ge t$isHiddenNativeType()) && !$notnull_bool(member.declaringType.get$hasNativeSubt ypes())) { 24027 var $this = this; // closure support
23595 var method = (member && member.is$MethodMember()); 24028 if (this.member == null || $notnull_bool(this.member.declaringType.get$isObjec t())) return false;
24029 var members = this.member.declaringType.resolveMember(this.member.name).member s;
24030 return members.filter$1((function (m) {
24031 return $notnull_bool($ne(m, $this.member)) && $notnull_bool(m.get$declaringT ype().get$isHiddenNativeType());
24032 })
24033 ).length >= 1;
24034 }
24035 VarMethodStub.prototype._useDirectCall = function(args) {
24036 var $0;
24037 if ((this.member instanceof MethodMember) && !$notnull_bool(this.member.declar ingType.get$hasNativeSubtypes())) {
24038 var method = (($0 = this.member) == null ? null : $0.assert$MethodMember());
23596 if ($notnull_bool(method.needsArgumentConversion(args))) { 24039 if ($notnull_bool(method.needsArgumentConversion(args))) {
23597 return false; 24040 return false;
23598 } 24041 }
23599 for (var i = args.get$length(); 24042 for (var i = args.get$length();
23600 i < method.parameters.length; i++) { 24043 i < method.parameters.length; i++) {
23601 if ($notnull_bool($ne(method.parameters.$index(i).get$value().get$code(), 'null'))) { 24044 if ($notnull_bool($ne(method.parameters.$index(i).get$value().get$code(), 'null'))) {
23602 return false; 24045 return false;
23603 } 24046 }
23604 } 24047 }
23605 return method.namesInOrder(args); 24048 return method.namesInOrder(args);
23606 } 24049 }
23607 else { 24050 else {
23608 return false; 24051 return false;
23609 } 24052 }
23610 } 24053 }
23611 VarMethodStub.prototype.generate$1 = function($0) { 24054 VarMethodStub.prototype.generate$1 = function($0) {
23612 return this.generate(($0 && $0.is$CodeWriter())); 24055 return this.generate(($0 == null ? null : $0.assert$CodeWriter()));
23613 };
23614 VarMethodStub.prototype.generateBody$2 = function($0, $1) {
23615 return this.generateBody(($0 && $0.is$CodeWriter()), $assert_String($1));
23616 }; 24056 };
23617 // ********** Code for VarMethodSet ************** 24057 // ********** Code for VarMethodSet **************
23618 function VarMethodSet(name, members, callArgs, returnType) { 24058 function VarMethodSet(name, members, callArgs, returnType) {
24059 this.invoked = false
23619 this.members = members; 24060 this.members = members;
23620 this.returnType = returnType; 24061 this.returnType = returnType;
23621 this.args = callArgs.toCallStubArgs(); 24062 this.args = callArgs.toCallStubArgs();
23622 // Initializers done 24063 // Initializers done
23623 VarMember.call(this, name); 24064 VarMember.call(this, name);
23624 } 24065 }
23625 $inherits(VarMethodSet, VarMember); 24066 $inherits(VarMethodSet, VarMember);
23626 VarMethodSet.prototype.get$members = function() { return this.members; }; 24067 VarMethodSet.prototype.get$members = function() { return this.members; };
23627 VarMethodSet.prototype.get$returnType = function() { return this.returnType; }; 24068 VarMethodSet.prototype.get$returnType = function() { return this.returnType; };
23628 VarMethodSet.prototype.get$baseName = function() { 24069 VarMethodSet.prototype.get$baseName = function() {
23629 return $assert_String(this.members.$index(0).get$name()); 24070 return $assert_String(this.members.$index(0).get$name());
23630 } 24071 }
23631 VarMethodSet.prototype.invoke = function(context, node, target, args) { 24072 VarMethodSet.prototype.invoke = function(context, node, target, args) {
23632 this._invokeMembers(context, node); 24073 this._invokeMembers(context, node);
23633 return VarMember.prototype.invoke.call(this, context, node, target, args); 24074 return VarMember.prototype.invoke.call(this, context, node, target, args);
23634 } 24075 }
23635 VarMethodSet.prototype._invokeMembers = function(context, node) { 24076 VarMethodSet.prototype._invokeMembers = function(context, node) {
23636 if (this._fallbackStubs != null) return; 24077 if ($notnull_bool(this.invoked)) return;
23637 var objectStub = null; 24078 this.invoked = true;
23638 this._fallbackStubs = []; 24079 var hasObjectType = false;
23639 var $list = this.members; 24080 var $list = this.members;
23640 for (var $i = 0;$i < $list.length; $i++) { 24081 for (var $i = 0;$i < $list.length; $i++) {
23641 var member = $list.$index($i); 24082 var member = $list.$index($i);
23642 var target = new Value(member.get$declaringType(), 'this', node.span, true); 24083 var type = member.get$declaringType();
24084 var target = new Value(type, 'this', node.span, true);
23643 var result = member.invoke$4$isDynamic(context, node, target, this.args, tru e); 24085 var result = member.invoke$4$isDynamic(context, node, target, this.args, tru e);
23644 var stub = new VarMethodStub(this.name, member, this.args, result); 24086 var stub = new VarMethodStub(this.name, member, this.args, 'return ' + resul t.get$code());
23645 var type = member.get$declaringType(); 24087 type.get$varStubs().$setindex(stub.get$name(), stub);
23646 if ($notnull_bool(type.get$isObject())) { 24088 if ($notnull_bool(type.get$isObject())) hasObjectType = true;
23647 objectStub = stub;
23648 }
23649 else if (!$notnull_bool(type.get$isHiddenNativeType())) {
23650 VarMethodSet._addVarStub((type && type.is$lang_Type()), (stub && stub.is$V arMember()));
23651 }
23652 else {
23653 this._fallbackStubs.add(stub);
23654 }
23655 } 24089 }
23656 if ($notnull_bool(objectStub == null)) { 24090 if (!$notnull_bool(hasObjectType)) {
23657 var target = new Value($globals.world.objectType, 'this', node.span, true); 24091 var target = new Value($globals.world.objectType, 'this', node.span, true);
23658 var result = target.invokeNoSuchMethod(context, this.get$baseName(), node, t his.args); 24092 var result = target.invokeNoSuchMethod(context, this.get$baseName(), node, t his.args);
23659 objectStub = new VarMethodStub(this.name, null, this.args, result); 24093 var stub = new VarMethodStub(this.name, null, this.args, 'return ' + result. get$code());
23660 } 24094 $globals.world.objectType.varStubs.$setindex(stub.get$name(), stub);
23661 if (this._fallbackStubs.length == 0) {
23662 VarMethodSet._addVarStub($globals.world.objectType, (objectStub && objectStu b.is$VarMember()));
23663 }
23664 else {
23665 this._fallbackStubs.add(objectStub);
23666 $globals.world.gen.corejs.useVarMethod = true;
23667 } 24095 }
23668 } 24096 }
23669 VarMethodSet._addVarStub = function(type, stub) {
23670 if (type.varStubs == null) type.varStubs = $map([]);
23671 type.varStubs.$setindex(stub.name, stub);
23672 }
23673 VarMethodSet.prototype.generate = function(code) { 24097 VarMethodSet.prototype.generate = function(code) {
23674 if (this._fallbackStubs.length == 0) return; 24098
23675 code.enterBlock(('\$varMethod("' + this.name + '", {'));
23676 var lastOne = this._fallbackStubs.last();
23677 var $list = this._fallbackStubs;
23678 for (var $i = 0;$i < $list.length; $i++) {
23679 var stub = $list.$index($i);
23680 code.write(('"' + stub.get$typeName() + '": '));
23681 stub.generateBody$2(code, $notnull_bool($eq(stub, lastOne)) ? '' : ',');
23682 }
23683 code.exitBlock('});');
23684 } 24099 }
23685 VarMethodSet.prototype.generate$1 = function($0) { 24100 VarMethodSet.prototype.generate$1 = function($0) {
23686 return this.generate(($0 && $0.is$CodeWriter())); 24101 return this.generate(($0 == null ? null : $0.assert$CodeWriter()));
23687 }; 24102 };
23688 VarMethodSet.prototype.invoke$4 = function($0, $1, $2, $3) { 24103 VarMethodSet.prototype.invoke$4 = function($0, $1, $2, $3) {
23689 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments())); 24104 return this.invoke(($0 == null ? null : $0.assert$MethodGenerator()), ($1 == n ull ? null : $1.assert$lang_Node()), ($2 == null ? null : $2.assert$Value()), ($ 3 == null ? null : $3.assert$Arguments()));
23690 }; 24105 };
23691 // ********** Code for top level ************** 24106 // ********** Code for top level **************
23692 function map(source, mapper) { 24107 function map(source, mapper) {
23693 var result = new ListFactory(); 24108 var result = new ListFactory();
23694 if (!!(source && source.is$List)) { 24109 if (!!(source && source.is$List())) {
23695 var list = (source && source.is$List()); 24110 var list = (source == null ? null : source.assert$List());
23696 result.length = list.length; 24111 result.length = list.length;
23697 for (var i = 0; 24112 for (var i = 0;
23698 i < list.length; i++) { 24113 i < list.length; i++) {
23699 result.$setindex(i, mapper(list.$index(i))); 24114 result.$setindex(i, mapper(list.$index(i)));
23700 } 24115 }
23701 } 24116 }
23702 else { 24117 else {
23703 for (var $i = source.iterator(); $i.hasNext$0(); ) { 24118 for (var $i = source.iterator(); $i.hasNext$0(); ) {
23704 var item = $i.next$0(); 24119 var item = $i.next$0();
23705 result.add(mapper(item)); 24120 result.add(mapper(item));
23706 } 24121 }
23707 } 24122 }
23708 return result; 24123 return result;
23709 } 24124 }
23710 function reduce(source, callback, initialValue) { 24125 function reduce(source, callback, initialValue) {
23711 var i = source.iterator(); 24126 var i = source.iterator();
23712 var current = initialValue; 24127 var current = initialValue;
23713 if ($notnull_bool(current == null) && $notnull_bool(i.hasNext$0())) { 24128 if ($notnull_bool(current == null) && $notnull_bool(i.hasNext$0())) {
23714 current = i.next$0(); 24129 current = i.next$0();
23715 } 24130 }
23716 while ($notnull_bool(i.hasNext$0())) { 24131 while ($notnull_bool(i.hasNext$0())) {
23717 current = callback.call$2(current, i.next$0()); 24132 current = callback.call$2(current, i.next$0());
23718 } 24133 }
23719 return current; 24134 return current;
23720 } 24135 }
23721 function orderValuesByKeys(map) { 24136 function orderValuesByKeys(map) {
23722 var $0; 24137 var $0;
23723 var keys = (($0 = map.getKeys()) && $0.is$List()); 24138 var keys = (($0 = map.getKeys()) == null ? null : $0.assert$List());
23724 keys.sort((function (x, y) { 24139 keys.sort((function (x, y) {
23725 return x.compareTo$1(y); 24140 return x.compareTo$1(y);
23726 }) 24141 })
23727 ); 24142 );
23728 var values = []; 24143 var values = [];
23729 for (var $i = 0;$i < keys.length; $i++) { 24144 for (var $i = 0;$i < keys.length; $i++) {
23730 var k = keys.$index($i); 24145 var k = keys.$index($i);
23731 values.add(map.$index(k)); 24146 values.add(map.$index(k));
23732 } 24147 }
23733 return values; 24148 return values;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
23809 i < args.get$length(); i++) { 24224 i < args.get$length(); i++) {
23810 nameBuilder.add('\$').add(args.getName(i)); 24225 nameBuilder.add('\$').add(args.getName(i));
23811 } 24226 }
23812 return nameBuilder.toString(); 24227 return nameBuilder.toString();
23813 } 24228 }
23814 // ********** Library frog ************** 24229 // ********** Library frog **************
23815 // ********** Code for top level ************** 24230 // ********** Code for top level **************
23816 function main() { 24231 function main() {
23817 var homedir = path.dirname(fs.realpathSync($assert_String(process.argv.$index( 1)))); 24232 var homedir = path.dirname(fs.realpathSync($assert_String(process.argv.$index( 1))));
23818 var argv = ListFactory.ListFactory$from$factory(process.argv); 24233 var argv = ListFactory.ListFactory$from$factory(process.argv);
23819 if ($notnull_bool(lang_compile($assert_String(homedir), (argv && argv.is$List_ String()), new NodeFileSystem()))) { 24234 if ($notnull_bool(lang_compile($assert_String(homedir), (argv == null ? null : argv.assert$List_String()), new NodeFileSystem()))) {
23820 var code = $globals.world.getGeneratedCode(); 24235 var code = $globals.world.getGeneratedCode();
23821 if (!$notnull_bool($globals.options.compileOnly)) { 24236 if (!$notnull_bool($globals.options.compileOnly)) {
23822 process.argv = [argv.$index(0), argv.$index(1)]; 24237 process.argv = [argv.$index(0), argv.$index(1)];
23823 process.argv.addAll($globals.options.childArgs); 24238 process.argv.addAll($globals.options.childArgs);
23824 vm.runInNewContext($assert_String(code), createSandbox()); 24239 vm.runInNewContext($assert_String(code), createSandbox());
23825 } 24240 }
23826 } 24241 }
23827 else { 24242 else {
23828 process.exit(1); 24243 process.exit(1);
23829 } 24244 }
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
24155 NATIVE, 24570 NATIVE,
24156 NEGATE, 24571 NEGATE,
24157 OPERATOR, 24572 OPERATOR,
24158 SET, 24573 SET,
24159 SOURCE, 24574 SOURCE,
24160 STATIC, 24575 STATIC,
24161 TYPEDEF ]*/; 24576 TYPEDEF ]*/;
24162 var $globals = {}; 24577 var $globals = {};
24163 $static_init(); 24578 $static_init();
24164 main(); 24579 main();
OLDNEW
« no previous file with comments | « frog/corejs.dart ('k') | frog/gen.dart » ('j') | frog/lib/corelib.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698