| OLD | NEW |
| 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 /** | 4 /** |
| 5 * Generates a dynamic call stub for a function. | 5 * Generates a dynamic call stub for a function. |
| 6 * Our goal is to create a stub method like this on-the-fly: | 6 * Our goal is to create a stub method like this on-the-fly: |
| 7 * function($0, $1, capture) { this($0, $1, true, capture); } | 7 * function($0, $1, capture) { this($0, $1, true, capture); } |
| 8 * | 8 * |
| 9 * This stub then replaces the dynamic one on Function, with one that is | 9 * This stub then replaces the dynamic one on Function, with one that is |
| 10 * specialized for that particular function, taking into account its default | 10 * specialized for that particular function, taking into account its default |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 res = new StackOverflowException(); | 102 res = new StackOverflowException(); |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 // TODO(jmesserly): setting the stack property is not a long term solution. | 105 // TODO(jmesserly): setting the stack property is not a long term solution. |
| 106 // Also it causes the exception to print as if it were a TypeError or | 106 // Also it causes the exception to print as if it were a TypeError or |
| 107 // RangeError, instead of using the proper toString. | 107 // RangeError, instead of using the proper toString. |
| 108 res.stack = e.stack; | 108 res.stack = e.stack; |
| 109 return res; | 109 return res; |
| 110 } | 110 } |
| 111 function $notnull_bool(test) { | 111 function $notnull_bool(test) { |
| 112 return (test === true || test === false) ? test : test.is$bool(); | 112 return (test === true || test === false) ? test : test.is$bool(); // TypeError |
| 113 } | 113 } |
| 114 function $assert(test, text, url, line, column) { | 114 function $assert(test, text, url, line, column) { |
| 115 if (typeof test == 'function') test = test(); | 115 if (typeof test == 'function') test = test(); |
| 116 if (!test) $throw(new AssertError(text, url, line, column)); | 116 if (!test) $throw(new AssertError(text, url, line, column)); |
| 117 } | 117 } |
| 118 function $throw(e) { | 118 function $throw(e) { |
| 119 // If e is not a value, we can use V8's captureStackTrace utility method. | 119 // If e is not a value, we can use V8's captureStackTrace utility method. |
| 120 // TODO(jmesserly): capture the stack trace on other JS engines. | 120 // TODO(jmesserly): capture the stack trace on other JS engines. |
| 121 if (e && (typeof e == 'object') && Error.captureStackTrace) { | 121 if (e && (typeof e == 'object') && Error.captureStackTrace) { |
| 122 // TODO(jmesserly): this will clobber the e.stack property | 122 // TODO(jmesserly): this will clobber the e.stack property |
| 123 Error.captureStackTrace(e, $throw); | 123 Error.captureStackTrace(e, $throw); |
| 124 } | 124 } |
| 125 throw e; | 125 throw e; |
| 126 } | 126 } |
| 127 function $map(items) { | 127 function $map(items) { |
| 128 var ret = new HashMapImplementation(); | 128 var ret = new HashMapImplementation(); |
| 129 for (var i=0; i < items.length;) { | 129 for (var i=0; i < items.length;) { |
| 130 ret.$setindex(items[i++], items[i++]); | 130 ret.$setindex(items[i++], items[i++]); |
| 131 } | 131 } |
| 132 return ret; | 132 return ret; |
| 133 } | 133 } |
| 134 Object.prototype.$index = function(i) { return this[i]; } | 134 Object.prototype.$index = function(i) { return this[i]; } |
| 135 Array.prototype.$index = function(i) { return this[i]; } | 135 Array.prototype.$index = function(i) { return this[i]; } |
| 136 String.prototype.$index = function(i) { return this[i]; } | 136 String.prototype.$index = function(i) { return this[i]; } |
| 137 Object.prototype.$setindex = function(i, value) { return this[i] = value; } | 137 Object.prototype.$setindex = function(i, value) { return this[i] = value; } |
| 138 Array.prototype.$setindex = function(i, value) { return this[i] = value; } | 138 Array.prototype.$setindex = function(i, value) { return this[i] = value; } |
| 139 function $add(x, y) { |
| 140 return ((typeof(x) == 'number' && typeof(y) == 'number') || |
| 141 (typeof(x) == 'string' && typeof(y) == 'string')) |
| 142 ? x + y : x.$add(y); |
| 143 } |
| 139 function $eq(x, y) { | 144 function $eq(x, y) { |
| 140 if (x == null) return y == null; | 145 if (x == null) return y == null; |
| 141 return (typeof(x) == 'number' && typeof(y) == 'number') || | 146 return (typeof(x) == 'number' && typeof(y) == 'number') || |
| 142 (typeof(x) == 'boolean' && typeof(y) == 'boolean') || | 147 (typeof(x) == 'boolean' && typeof(y) == 'boolean') || |
| 143 (typeof(x) == 'string' && typeof(y) == 'string') | 148 (typeof(x) == 'string' && typeof(y) == 'string') |
| 144 ? x == y : x.$eq(y); | 149 ? x == y : x.$eq(y); |
| 145 } | 150 } |
| 146 // TODO(jimhug): Should this or should it not match equals? | 151 // TODO(jimhug): Should this or should it not match equals? |
| 147 Object.prototype.$eq = function(other) { return this === other; } | 152 Object.prototype.$eq = function(other) { return this === other; } |
| 148 function $mod(x, y) { | 153 function $mod(x, y) { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 }; | 229 }; |
| 225 Object.prototype.addDirectSubtype$1 = function($0) { | 230 Object.prototype.addDirectSubtype$1 = function($0) { |
| 226 return this.noSuchMethod("addDirectSubtype", [$0]); | 231 return this.noSuchMethod("addDirectSubtype", [$0]); |
| 227 }; | 232 }; |
| 228 Object.prototype.addMethod$2 = function($0, $1) { | 233 Object.prototype.addMethod$2 = function($0, $1) { |
| 229 return this.noSuchMethod("addMethod", [$0, $1]); | 234 return this.noSuchMethod("addMethod", [$0, $1]); |
| 230 }; | 235 }; |
| 231 Object.prototype.addSource$1 = function($0) { | 236 Object.prototype.addSource$1 = function($0) { |
| 232 return this.noSuchMethod("addSource", [$0]); | 237 return this.noSuchMethod("addSource", [$0]); |
| 233 }; | 238 }; |
| 239 Object.prototype.appendByteStringToken$2 = function($0, $1) { |
| 240 return this.noSuchMethod("appendByteStringToken", [$0, $1]); |
| 241 }; |
| 234 Object.prototype.beginArguments$1 = function($0) { | 242 Object.prototype.beginArguments$1 = function($0) { |
| 235 return this.noSuchMethod("beginArguments", [$0]); | 243 return this.noSuchMethod("beginArguments", [$0]); |
| 236 }; | 244 }; |
| 237 Object.prototype.beginBlock$1 = function($0) { | 245 Object.prototype.beginBlock$1 = function($0) { |
| 238 return this.noSuchMethod("beginBlock", [$0]); | 246 return this.noSuchMethod("beginBlock", [$0]); |
| 239 }; | 247 }; |
| 240 Object.prototype.beginClass$1 = function($0) { | 248 Object.prototype.beginClass$1 = function($0) { |
| 241 return this.noSuchMethod("beginClass", [$0]); | 249 return this.noSuchMethod("beginClass", [$0]); |
| 242 }; | 250 }; |
| 243 Object.prototype.beginExpressionStatement$1 = function($0) { | 251 Object.prototype.beginExpressionStatement$1 = function($0) { |
| (...skipping 2134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2378 } | 2386 } |
| 2379 Object.defineProperty(DoubleLinkedQueue.prototype, "length", { | 2387 Object.defineProperty(DoubleLinkedQueue.prototype, "length", { |
| 2380 get: DoubleLinkedQueue.prototype.get$length | 2388 get: DoubleLinkedQueue.prototype.get$length |
| 2381 }); | 2389 }); |
| 2382 DoubleLinkedQueue.prototype.isEmpty = function() { | 2390 DoubleLinkedQueue.prototype.isEmpty = function() { |
| 2383 return (this._sentinel._next === this._sentinel); | 2391 return (this._sentinel._next === this._sentinel); |
| 2384 } | 2392 } |
| 2385 DoubleLinkedQueue.prototype.forEach = function(f) { | 2393 DoubleLinkedQueue.prototype.forEach = function(f) { |
| 2386 var entry = this._sentinel._next; | 2394 var entry = this._sentinel._next; |
| 2387 while (entry !== this._sentinel) { | 2395 while (entry !== this._sentinel) { |
| 2396 var nextEntry = entry._next; |
| 2388 f(entry._element); | 2397 f(entry._element); |
| 2389 entry = entry._next; | 2398 entry = nextEntry; |
| 2390 } | 2399 } |
| 2391 } | 2400 } |
| 2392 DoubleLinkedQueue.prototype.some = function(f) { | 2401 DoubleLinkedQueue.prototype.some = function(f) { |
| 2393 var entry = this._sentinel._next; | 2402 var entry = this._sentinel._next; |
| 2394 while (entry !== this._sentinel) { | 2403 while (entry !== this._sentinel) { |
| 2404 var nextEntry = entry._next; |
| 2395 if (f(entry._element)) return true; | 2405 if (f(entry._element)) return true; |
| 2396 entry = entry._next; | 2406 entry = nextEntry; |
| 2397 } | 2407 } |
| 2398 return false; | 2408 return false; |
| 2399 } | 2409 } |
| 2400 DoubleLinkedQueue.prototype.filter = function(f) { | 2410 DoubleLinkedQueue.prototype.filter = function(f) { |
| 2401 var other = new DoubleLinkedQueue(); | 2411 var other = new DoubleLinkedQueue(); |
| 2402 var entry = this._sentinel._next; | 2412 var entry = this._sentinel._next; |
| 2403 while (entry !== this._sentinel) { | 2413 while (entry !== this._sentinel) { |
| 2414 var nextEntry = entry._next; |
| 2404 if (f(entry._element)) other.addLast(entry._element); | 2415 if (f(entry._element)) other.addLast(entry._element); |
| 2405 entry = entry._next; | 2416 entry = nextEntry; |
| 2406 } | 2417 } |
| 2407 return other; | 2418 return other; |
| 2408 } | 2419 } |
| 2409 DoubleLinkedQueue.prototype.iterator = function() { | 2420 DoubleLinkedQueue.prototype.iterator = function() { |
| 2410 return new _DoubleLinkedQueueIterator$E(this._sentinel); | 2421 return new _DoubleLinkedQueueIterator$E(this._sentinel); |
| 2411 } | 2422 } |
| 2412 DoubleLinkedQueue.prototype.add$1 = DoubleLinkedQueue.prototype.add; | 2423 DoubleLinkedQueue.prototype.add$1 = DoubleLinkedQueue.prototype.add; |
| 2413 DoubleLinkedQueue.prototype.addAll$1 = function($0) { | 2424 DoubleLinkedQueue.prototype.addAll$1 = function($0) { |
| 2414 return this.addAll(($0 && $0.is$Collection$E())); | 2425 return this.addAll(($0 && $0.is$Collection$E())); |
| 2415 }; | 2426 }; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2453 DoubleLinkedQueue$KeyValuePair$K$V.prototype.is$Iterable = function(){return thi
s;}; | 2464 DoubleLinkedQueue$KeyValuePair$K$V.prototype.is$Iterable = function(){return thi
s;}; |
| 2454 DoubleLinkedQueue$KeyValuePair$K$V.prototype.addLast = function(value) { | 2465 DoubleLinkedQueue$KeyValuePair$K$V.prototype.addLast = function(value) { |
| 2455 this._sentinel.prepend(value); | 2466 this._sentinel.prepend(value); |
| 2456 } | 2467 } |
| 2457 DoubleLinkedQueue$KeyValuePair$K$V.prototype.lastEntry = function() { | 2468 DoubleLinkedQueue$KeyValuePair$K$V.prototype.lastEntry = function() { |
| 2458 return this._sentinel.previousEntry(); | 2469 return this._sentinel.previousEntry(); |
| 2459 } | 2470 } |
| 2460 DoubleLinkedQueue$KeyValuePair$K$V.prototype.forEach = function(f) { | 2471 DoubleLinkedQueue$KeyValuePair$K$V.prototype.forEach = function(f) { |
| 2461 var entry = this._sentinel._next; | 2472 var entry = this._sentinel._next; |
| 2462 while (entry !== this._sentinel) { | 2473 while (entry !== this._sentinel) { |
| 2474 var nextEntry = entry._next; |
| 2463 f(entry._element); | 2475 f(entry._element); |
| 2464 entry = entry._next; | 2476 entry = nextEntry; |
| 2465 } | 2477 } |
| 2466 } | 2478 } |
| 2467 // ********** Code for DoubleLinkedQueue$SourceString ************** | 2479 // ********** Code for DoubleLinkedQueue$SourceString ************** |
| 2468 function DoubleLinkedQueue$SourceString() {} | 2480 function DoubleLinkedQueue$SourceString() {} |
| 2469 $inherits(DoubleLinkedQueue$SourceString, DoubleLinkedQueue); | 2481 $inherits(DoubleLinkedQueue$SourceString, DoubleLinkedQueue); |
| 2470 DoubleLinkedQueue$SourceString.prototype.is$Collection$E = function(){return thi
s;}; | 2482 DoubleLinkedQueue$SourceString.prototype.is$Collection$E = function(){return thi
s;}; |
| 2471 DoubleLinkedQueue$SourceString.prototype.is$Collection$Object = function(){retur
n this;}; | 2483 DoubleLinkedQueue$SourceString.prototype.is$Collection$Object = function(){retur
n this;}; |
| 2472 DoubleLinkedQueue$SourceString.prototype.is$Collection$Type = false; | 2484 DoubleLinkedQueue$SourceString.prototype.is$Collection$Type = false; |
| 2473 DoubleLinkedQueue$SourceString.prototype.is$Iterable = function(){return this;}; | 2485 DoubleLinkedQueue$SourceString.prototype.is$Iterable = function(){return this;}; |
| 2474 // ********** Code for _DoubleLinkedQueueIterator ************** | 2486 // ********** Code for _DoubleLinkedQueueIterator ************** |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2729 } | 2741 } |
| 2730 DateImplementation.now$ctor.prototype = DateImplementation.prototype; | 2742 DateImplementation.now$ctor.prototype = DateImplementation.prototype; |
| 2731 DateImplementation.prototype.is$Date = function(){return this;}; | 2743 DateImplementation.prototype.is$Date = function(){return this;}; |
| 2732 DateImplementation.prototype.is$Comparable = function(){return this;}; | 2744 DateImplementation.prototype.is$Comparable = function(){return this;}; |
| 2733 DateImplementation.prototype.get$value = function() { return this.value; }; | 2745 DateImplementation.prototype.get$value = function() { return this.value; }; |
| 2734 DateImplementation.prototype.$eq = function(other) { | 2746 DateImplementation.prototype.$eq = function(other) { |
| 2735 if (!((other instanceof DateImplementation))) return false; | 2747 if (!((other instanceof DateImplementation))) return false; |
| 2736 return (this.value == other.get$value()) && ($eq(this.timeZone, other.timeZone
)); | 2748 return (this.value == other.get$value()) && ($eq(this.timeZone, other.timeZone
)); |
| 2737 } | 2749 } |
| 2738 DateImplementation.prototype.compareTo = function(other) { | 2750 DateImplementation.prototype.compareTo = function(other) { |
| 2739 return this.value.compareTo(other.value); | 2751 var $0; |
| 2752 return $assert_num(this.value.compareTo$1(other.value)); |
| 2740 } | 2753 } |
| 2741 DateImplementation.prototype.get$year = function() { | 2754 DateImplementation.prototype.get$year = function() { |
| 2742 return this.isUtc ? this._asJs().getUTCFullYear() : | 2755 return this.isUtc ? this._asJs().getUTCFullYear() : |
| 2743 this._asJs().getFullYear(); | 2756 this._asJs().getFullYear(); |
| 2744 } | 2757 } |
| 2745 DateImplementation.prototype.get$month = function() { | 2758 DateImplementation.prototype.get$month = function() { |
| 2746 return this.isUtc ? this._asJs().getMonth() + 1 : | 2759 return this.isUtc ? this._asJs().getMonth() + 1 : |
| 2747 this._asJs().getMonth() + 1; | 2760 this._asJs().getMonth() + 1; |
| 2748 } | 2761 } |
| 2749 DateImplementation.prototype.get$day = function() { | 2762 DateImplementation.prototype.get$day = function() { |
| (...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4560 return this.select(61/*null.$EQ*/, "<<=", "<<"); | 4573 return this.select(61/*null.$EQ*/, "<<=", "<<"); |
| 4561 | 4574 |
| 4562 default: | 4575 default: |
| 4563 | 4576 |
| 4564 this.appendBeginGroup(60/*null.LT_TOKEN*/, "<"); | 4577 this.appendBeginGroup(60/*null.LT_TOKEN*/, "<"); |
| 4565 return next; | 4578 return next; |
| 4566 | 4579 |
| 4567 } | 4580 } |
| 4568 } | 4581 } |
| 4569 AbstractScanner.prototype.tokenizeNumber = function(next) { | 4582 AbstractScanner.prototype.tokenizeNumber = function(next) { |
| 4583 var $0; |
| 4570 var start = this.get$byteOffset(); | 4584 var start = this.get$byteOffset(); |
| 4571 while (true) { | 4585 while (true) { |
| 4572 next = this.advance(); | 4586 next = this.advance(); |
| 4573 switch (next) { | 4587 switch (next) { |
| 4574 case 48/*null.$0*/: | 4588 case 48/*null.$0*/: |
| 4575 case 49/*null.$1*/: | 4589 case 49/*null.$1*/: |
| 4576 case 50/*null.$2*/: | 4590 case 50/*null.$2*/: |
| 4577 case 51/*null.$3*/: | 4591 case 51/*null.$3*/: |
| 4578 case 52/*null.$4*/: | 4592 case 52/*null.$4*/: |
| 4579 case 53/*null.$5*/: | 4593 case 53/*null.$5*/: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 4590 | 4604 |
| 4591 case 101/*null.$e*/: | 4605 case 101/*null.$e*/: |
| 4592 case 69/*null.$E*/: | 4606 case 69/*null.$E*/: |
| 4593 case 100/*null.$d*/: | 4607 case 100/*null.$d*/: |
| 4594 case 68/*null.$D*/: | 4608 case 68/*null.$D*/: |
| 4595 | 4609 |
| 4596 return this.tokenizeFractionPart(next, start); | 4610 return this.tokenizeFractionPart(next, start); |
| 4597 | 4611 |
| 4598 default: | 4612 default: |
| 4599 | 4613 |
| 4600 this.appendByteStringToken(105/*null.INT_TOKEN*/, this.asciiString(start
)); | 4614 this.appendByteStringToken$2(105/*null.INT_TOKEN*/, this.asciiString(sta
rt)); |
| 4601 return next; | 4615 return next; |
| 4602 | 4616 |
| 4603 } | 4617 } |
| 4604 } | 4618 } |
| 4605 } | 4619 } |
| 4606 AbstractScanner.prototype.tokenizeHexOrNumber = function(next) { | 4620 AbstractScanner.prototype.tokenizeHexOrNumber = function(next) { |
| 4607 var x = this.peek(); | 4621 var x = this.peek(); |
| 4608 if (x == 120/*null.$x*/ || x == 88/*null.$X*/) { | 4622 if (x == 120/*null.$x*/ || x == 88/*null.$X*/) { |
| 4609 this.advance(); | 4623 this.advance(); |
| 4610 return this.tokenizeHex(x); | 4624 return this.tokenizeHex(x); |
| 4611 } | 4625 } |
| 4612 return this.tokenizeNumber(next); | 4626 return this.tokenizeNumber(next); |
| 4613 } | 4627 } |
| 4614 AbstractScanner.prototype.tokenizeHex = function(next) { | 4628 AbstractScanner.prototype.tokenizeHex = function(next) { |
| 4629 var $0; |
| 4615 var start = this.get$byteOffset(); | 4630 var start = this.get$byteOffset(); |
| 4616 var hasDigits = false; | 4631 var hasDigits = false; |
| 4617 while (true) { | 4632 while (true) { |
| 4618 next = this.advance(); | 4633 next = this.advance(); |
| 4619 switch (next) { | 4634 switch (next) { |
| 4620 case 48/*null.$0*/: | 4635 case 48/*null.$0*/: |
| 4621 case 49/*null.$1*/: | 4636 case 49/*null.$1*/: |
| 4622 case 50/*null.$2*/: | 4637 case 50/*null.$2*/: |
| 4623 case 51/*null.$3*/: | 4638 case 51/*null.$3*/: |
| 4624 case 52/*null.$4*/: | 4639 case 52/*null.$4*/: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4641 case 102/*null.$f*/: | 4656 case 102/*null.$f*/: |
| 4642 | 4657 |
| 4643 hasDigits = true; | 4658 hasDigits = true; |
| 4644 break; | 4659 break; |
| 4645 | 4660 |
| 4646 default: | 4661 default: |
| 4647 | 4662 |
| 4648 if (!$notnull_bool(hasDigits)) { | 4663 if (!$notnull_bool(hasDigits)) { |
| 4649 $throw(new MalformedInputException(this.get$charOffset())); | 4664 $throw(new MalformedInputException(this.get$charOffset())); |
| 4650 } | 4665 } |
| 4651 this.appendByteStringToken(120/*null.HEXADECIMAL_TOKEN*/, this.asciiStri
ng(start)); | 4666 this.appendByteStringToken$2(120/*null.HEXADECIMAL_TOKEN*/, this.asciiSt
ring(start)); |
| 4652 return next; | 4667 return next; |
| 4653 | 4668 |
| 4654 } | 4669 } |
| 4655 } | 4670 } |
| 4656 } | 4671 } |
| 4657 AbstractScanner.prototype.tokenizeDotOrNumber = function(next) { | 4672 AbstractScanner.prototype.tokenizeDotOrNumber = function(next) { |
| 4658 var start = this.get$byteOffset(); | 4673 var start = this.get$byteOffset(); |
| 4659 next = this.advance(); | 4674 next = this.advance(); |
| 4660 switch (next) { | 4675 switch (next) { |
| 4661 case 48/*null.$0*/: | 4676 case 48/*null.$0*/: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4678 return this.select(46/*null.$PERIOD*/, "...", ".."); | 4693 return this.select(46/*null.$PERIOD*/, "...", ".."); |
| 4679 | 4694 |
| 4680 default: | 4695 default: |
| 4681 | 4696 |
| 4682 this.appendStringToken(46/*null.PERIOD_TOKEN*/, "."); | 4697 this.appendStringToken(46/*null.PERIOD_TOKEN*/, "."); |
| 4683 return next; | 4698 return next; |
| 4684 | 4699 |
| 4685 } | 4700 } |
| 4686 } | 4701 } |
| 4687 AbstractScanner.prototype.tokenizeFractionPart = function(next, start) { | 4702 AbstractScanner.prototype.tokenizeFractionPart = function(next, start) { |
| 4703 var $0; |
| 4688 var done = false; | 4704 var done = false; |
| 4689 LOOP: | 4705 LOOP: |
| 4690 while (!$notnull_bool(done)) { | 4706 while (!$notnull_bool(done)) { |
| 4691 switch (next) { | 4707 switch (next) { |
| 4692 case 48/*null.$0*/: | 4708 case 48/*null.$0*/: |
| 4693 case 49/*null.$1*/: | 4709 case 49/*null.$1*/: |
| 4694 case 50/*null.$2*/: | 4710 case 50/*null.$2*/: |
| 4695 case 51/*null.$3*/: | 4711 case 51/*null.$3*/: |
| 4696 case 52/*null.$4*/: | 4712 case 52/*null.$4*/: |
| 4697 case 53/*null.$5*/: | 4713 case 53/*null.$5*/: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 4713 | 4729 |
| 4714 done = true; | 4730 done = true; |
| 4715 continue LOOP; | 4731 continue LOOP; |
| 4716 | 4732 |
| 4717 } | 4733 } |
| 4718 next = this.advance(); | 4734 next = this.advance(); |
| 4719 } | 4735 } |
| 4720 if (next == 100/*null.$d*/ || next == 68/*null.$D*/) { | 4736 if (next == 100/*null.$d*/ || next == 68/*null.$D*/) { |
| 4721 next = this.advance(); | 4737 next = this.advance(); |
| 4722 } | 4738 } |
| 4723 this.appendByteStringToken(100/*null.DOUBLE_TOKEN*/, this.asciiString(start)); | 4739 this.appendByteStringToken$2(100/*null.DOUBLE_TOKEN*/, this.asciiString(start)
); |
| 4724 return next; | 4740 return next; |
| 4725 } | 4741 } |
| 4726 AbstractScanner.prototype.tokenizeExponent = function(next) { | 4742 AbstractScanner.prototype.tokenizeExponent = function(next) { |
| 4727 if (next == 43/*null.$PLUS*/ || next == 45/*null.$MINUS*/) { | 4743 if (next == 43/*null.$PLUS*/ || next == 45/*null.$MINUS*/) { |
| 4728 next = this.advance(); | 4744 next = this.advance(); |
| 4729 } | 4745 } |
| 4730 var hasDigits = false; | 4746 var hasDigits = false; |
| 4731 while (true) { | 4747 while (true) { |
| 4732 switch (next) { | 4748 switch (next) { |
| 4733 case 48/*null.$0*/: | 4749 case 48/*null.$0*/: |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4812 | 4828 |
| 4813 default: | 4829 default: |
| 4814 | 4830 |
| 4815 next = this.advance(); | 4831 next = this.advance(); |
| 4816 break; | 4832 break; |
| 4817 | 4833 |
| 4818 } | 4834 } |
| 4819 } | 4835 } |
| 4820 } | 4836 } |
| 4821 AbstractScanner.prototype.tokenizeIdentifier = function(next) { | 4837 AbstractScanner.prototype.tokenizeIdentifier = function(next) { |
| 4838 var $0; |
| 4822 var start = this.get$byteOffset(); | 4839 var start = this.get$byteOffset(); |
| 4823 var state = null; | 4840 var state = null; |
| 4824 if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) { | 4841 if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) { |
| 4825 state = KeywordState.get$KEYWORD_STATE().next(next); | 4842 state = KeywordState.get$KEYWORD_STATE().next(next); |
| 4826 next = this.advance(); | 4843 next = this.advance(); |
| 4827 } | 4844 } |
| 4828 var isAscii = true; | 4845 var isAscii = true; |
| 4829 while (true) { | 4846 while (true) { |
| 4830 if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) { | 4847 if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) { |
| 4831 if (state != null) { | 4848 if (state != null) { |
| 4832 state = state.next(next); | 4849 state = state.next(next); |
| 4833 } | 4850 } |
| 4834 } | 4851 } |
| 4835 else if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/) || (65/*null.$A*/
<= next && next <= 90/*null.$Z*/) || next == 95/*null.$_*/ || next == 36/*null.$
DOLLAR*/) { | 4852 else if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/) || (65/*null.$A*/
<= next && next <= 90/*null.$Z*/) || next == 95/*null.$_*/ || next == 36/*null.$
DOLLAR*/) { |
| 4836 state = null; | 4853 state = null; |
| 4837 } | 4854 } |
| 4838 else if (next < 128) { | 4855 else if (next < 128) { |
| 4839 if ($notnull_bool(state != null && state.isLeaf())) { | 4856 if ($notnull_bool(state != null && state.isLeaf())) { |
| 4840 this.appendKeywordToken(state.get$keyword()); | 4857 this.appendKeywordToken(state.get$keyword()); |
| 4841 } | 4858 } |
| 4842 else if ($notnull_bool(isAscii)) { | 4859 else if ($notnull_bool(isAscii)) { |
| 4843 this.appendByteStringToken(97/*null.IDENTIFIER_TOKEN*/, this.asciiString
(start)); | 4860 this.appendByteStringToken$2(97/*null.IDENTIFIER_TOKEN*/, this.asciiStri
ng(start)); |
| 4844 } | 4861 } |
| 4845 else { | 4862 else { |
| 4846 this.appendByteStringToken(97/*null.IDENTIFIER_TOKEN*/, this.utf8String(
start, -1)); | 4863 this.appendByteStringToken$2(97/*null.IDENTIFIER_TOKEN*/, this.utf8Strin
g(start, -1)); |
| 4847 } | 4864 } |
| 4848 return next; | 4865 return next; |
| 4849 } | 4866 } |
| 4850 else { | 4867 else { |
| 4851 var nonAsciiStart = this.get$byteOffset(); | 4868 var nonAsciiStart = this.get$byteOffset(); |
| 4852 do { | 4869 do { |
| 4853 next = this.nextByte(); | 4870 next = this.nextByte(); |
| 4854 } | 4871 } |
| 4855 while (next > 127) | 4872 while (next > 127) |
| 4856 var string = this.utf8String(nonAsciiStart, -1).toString$0(); | 4873 var string = this.utf8String(nonAsciiStart, -1).toString$0(); |
| 4857 isAscii = false; | 4874 isAscii = false; |
| 4858 this.addToCharOffset(string.length); | 4875 this.addToCharOffset(string.length); |
| 4859 return next; | 4876 return next; |
| 4860 } | 4877 } |
| 4861 next = this.advance(); | 4878 next = this.advance(); |
| 4862 } | 4879 } |
| 4863 } | 4880 } |
| 4864 AbstractScanner.prototype.tokenizeRawString = function(next) { | 4881 AbstractScanner.prototype.tokenizeRawString = function(next) { |
| 4865 var start = this.get$byteOffset(); | 4882 var start = this.get$byteOffset(); |
| 4866 next = this.advance(); | 4883 next = this.advance(); |
| 4867 if (next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/) { | 4884 if (next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/) { |
| 4868 return this.tokenizeString(next, start, true); | 4885 return this.tokenizeString(next, start, true); |
| 4869 } | 4886 } |
| 4870 else { | 4887 else { |
| 4871 $throw(new MalformedInputException(this.get$charOffset())); | 4888 $throw(new MalformedInputException(this.get$charOffset())); |
| 4872 } | 4889 } |
| 4873 } | 4890 } |
| 4874 AbstractScanner.prototype.tokenizeString = function(next, start, raw) { | 4891 AbstractScanner.prototype.tokenizeString = function(next, start, raw) { |
| 4892 var $0; |
| 4875 var q = next; | 4893 var q = next; |
| 4876 next = this.advance(); | 4894 next = this.advance(); |
| 4877 if (q == next) { | 4895 if (q == next) { |
| 4878 next = this.advance(); | 4896 next = this.advance(); |
| 4879 if (q == next) { | 4897 if (q == next) { |
| 4880 return this.tokenizeMultiLineString(q, start, raw); | 4898 return this.tokenizeMultiLineString(q, start, raw); |
| 4881 } | 4899 } |
| 4882 else { | 4900 else { |
| 4883 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start,
-1)); | 4901 this.appendByteStringToken$2(39/*null.STRING_TOKEN*/, this.utf8String(star
t, -1)); |
| 4884 return next; | 4902 return next; |
| 4885 } | 4903 } |
| 4886 } | 4904 } |
| 4887 if ($notnull_bool(raw)) { | 4905 if ($notnull_bool(raw)) { |
| 4888 return this.tokenizeSingleLineRawString(next, q, start); | 4906 return this.tokenizeSingleLineRawString(next, q, start); |
| 4889 } | 4907 } |
| 4890 else { | 4908 else { |
| 4891 return this.tokenizeSingleLineString(next, q, start); | 4909 return this.tokenizeSingleLineString(next, q, start); |
| 4892 } | 4910 } |
| 4893 } | 4911 } |
| 4894 AbstractScanner.prototype.tokenizeSingleLineString = function(next, q1, start) { | 4912 AbstractScanner.prototype.tokenizeSingleLineString = function(next, q1, start) { |
| 4913 var $0; |
| 4895 while (next != -1) { | 4914 while (next != -1) { |
| 4896 if (next == q1) { | 4915 if (next == q1) { |
| 4897 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start,
0)); | 4916 this.appendByteStringToken$2(39/*null.STRING_TOKEN*/, this.utf8String(star
t, 0)); |
| 4898 return this.advance(); | 4917 return this.advance(); |
| 4899 } | 4918 } |
| 4900 else if (next == 92/*null.$BACKSLASH*/) { | 4919 else if (next == 92/*null.$BACKSLASH*/) { |
| 4901 next = this.advance(); | 4920 next = this.advance(); |
| 4902 if (next == -1) { | 4921 if (next == -1) { |
| 4903 $throw(new MalformedInputException(this.get$charOffset())); | 4922 $throw(new MalformedInputException(this.get$charOffset())); |
| 4904 } | 4923 } |
| 4905 } | 4924 } |
| 4906 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { | 4925 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { |
| 4907 $throw(new MalformedInputException(this.get$charOffset())); | 4926 $throw(new MalformedInputException(this.get$charOffset())); |
| 4908 } | 4927 } |
| 4909 next = this.advance(); | 4928 next = this.advance(); |
| 4910 } | 4929 } |
| 4911 $throw(new MalformedInputException(this.get$charOffset())); | 4930 $throw(new MalformedInputException(this.get$charOffset())); |
| 4912 } | 4931 } |
| 4913 AbstractScanner.prototype.tokenizeSingleLineRawString = function(next, q1, start
) { | 4932 AbstractScanner.prototype.tokenizeSingleLineRawString = function(next, q1, start
) { |
| 4933 var $0; |
| 4914 next = this.advance(); | 4934 next = this.advance(); |
| 4915 while (next != -1) { | 4935 while (next != -1) { |
| 4916 if (next == q1) { | 4936 if (next == q1) { |
| 4917 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start,
0)); | 4937 this.appendByteStringToken$2(39/*null.STRING_TOKEN*/, this.utf8String(star
t, 0)); |
| 4918 return this.advance(); | 4938 return this.advance(); |
| 4919 } | 4939 } |
| 4920 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { | 4940 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { |
| 4921 $throw(new MalformedInputException(this.get$charOffset())); | 4941 $throw(new MalformedInputException(this.get$charOffset())); |
| 4922 } | 4942 } |
| 4923 next = this.advance(); | 4943 next = this.advance(); |
| 4924 } | 4944 } |
| 4925 $throw(new MalformedInputException(this.get$charOffset())); | 4945 $throw(new MalformedInputException(this.get$charOffset())); |
| 4926 } | 4946 } |
| 4927 AbstractScanner.prototype.tokenizeMultiLineString = function(q, start, raw) { | 4947 AbstractScanner.prototype.tokenizeMultiLineString = function(q, start, raw) { |
| 4948 var $0; |
| 4928 var next = this.advance(); | 4949 var next = this.advance(); |
| 4929 while (next != -1) { | 4950 while (next != -1) { |
| 4930 if (next == q) { | 4951 if (next == q) { |
| 4931 next = this.advance(); | 4952 next = this.advance(); |
| 4932 if (next == q) { | 4953 if (next == q) { |
| 4933 next = this.advance(); | 4954 next = this.advance(); |
| 4934 if (next == q) { | 4955 if (next == q) { |
| 4935 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(st
art, 0)); | 4956 this.appendByteStringToken$2(39/*null.STRING_TOKEN*/, this.utf8String(
start, 0)); |
| 4936 return this.advance(); | 4957 return this.advance(); |
| 4937 } | 4958 } |
| 4938 } | 4959 } |
| 4939 } | 4960 } |
| 4940 next = this.advance(); | 4961 next = this.advance(); |
| 4941 } | 4962 } |
| 4942 return next; | 4963 return next; |
| 4943 } | 4964 } |
| 4965 AbstractScanner.prototype.appendByteStringToken$2 = AbstractScanner.prototype.ap
pendByteStringToken; |
| 4944 // ********** Code for AbstractScanner$S ************** | 4966 // ********** Code for AbstractScanner$S ************** |
| 4945 function AbstractScanner$S() {} | 4967 function AbstractScanner$S() {} |
| 4946 $inherits(AbstractScanner$S, AbstractScanner); | 4968 $inherits(AbstractScanner$S, AbstractScanner); |
| 4947 AbstractScanner$S.prototype.tokenize = function() { | 4969 AbstractScanner$S.prototype.tokenize = function() { |
| 4948 var next = this.advance(); | 4970 var next = this.advance(); |
| 4949 while (next != -1) { | 4971 while (next != -1) { |
| 4950 next = this.bigSwitch(next); | 4972 next = this.bigSwitch(next); |
| 4951 } | 4973 } |
| 4952 this.appendEofToken(); | 4974 this.appendEofToken(); |
| 4953 return this.firstToken(); | 4975 return this.firstToken(); |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5373 return this.select(61/*null.$EQ*/, "<<=", "<<"); | 5395 return this.select(61/*null.$EQ*/, "<<=", "<<"); |
| 5374 | 5396 |
| 5375 default: | 5397 default: |
| 5376 | 5398 |
| 5377 this.appendBeginGroup(60/*null.LT_TOKEN*/, "<"); | 5399 this.appendBeginGroup(60/*null.LT_TOKEN*/, "<"); |
| 5378 return next; | 5400 return next; |
| 5379 | 5401 |
| 5380 } | 5402 } |
| 5381 } | 5403 } |
| 5382 AbstractScanner$S.prototype.tokenizeNumber = function(next) { | 5404 AbstractScanner$S.prototype.tokenizeNumber = function(next) { |
| 5405 var $0; |
| 5383 var start = this.get$byteOffset(); | 5406 var start = this.get$byteOffset(); |
| 5384 while (true) { | 5407 while (true) { |
| 5385 next = this.advance(); | 5408 next = this.advance(); |
| 5386 switch (next) { | 5409 switch (next) { |
| 5387 case 48/*null.$0*/: | 5410 case 48/*null.$0*/: |
| 5388 case 49/*null.$1*/: | 5411 case 49/*null.$1*/: |
| 5389 case 50/*null.$2*/: | 5412 case 50/*null.$2*/: |
| 5390 case 51/*null.$3*/: | 5413 case 51/*null.$3*/: |
| 5391 case 52/*null.$4*/: | 5414 case 52/*null.$4*/: |
| 5392 case 53/*null.$5*/: | 5415 case 53/*null.$5*/: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 5403 | 5426 |
| 5404 case 101/*null.$e*/: | 5427 case 101/*null.$e*/: |
| 5405 case 69/*null.$E*/: | 5428 case 69/*null.$E*/: |
| 5406 case 100/*null.$d*/: | 5429 case 100/*null.$d*/: |
| 5407 case 68/*null.$D*/: | 5430 case 68/*null.$D*/: |
| 5408 | 5431 |
| 5409 return this.tokenizeFractionPart(next, start); | 5432 return this.tokenizeFractionPart(next, start); |
| 5410 | 5433 |
| 5411 default: | 5434 default: |
| 5412 | 5435 |
| 5413 this.appendByteStringToken(105/*null.INT_TOKEN*/, this.asciiString(start
)); | 5436 this.appendByteStringToken$2(105/*null.INT_TOKEN*/, this.asciiString(sta
rt)); |
| 5414 return next; | 5437 return next; |
| 5415 | 5438 |
| 5416 } | 5439 } |
| 5417 } | 5440 } |
| 5418 } | 5441 } |
| 5419 AbstractScanner$S.prototype.tokenizeHexOrNumber = function(next) { | 5442 AbstractScanner$S.prototype.tokenizeHexOrNumber = function(next) { |
| 5420 var x = this.peek(); | 5443 var x = this.peek(); |
| 5421 if (x == 120/*null.$x*/ || x == 88/*null.$X*/) { | 5444 if (x == 120/*null.$x*/ || x == 88/*null.$X*/) { |
| 5422 this.advance(); | 5445 this.advance(); |
| 5423 return this.tokenizeHex(x); | 5446 return this.tokenizeHex(x); |
| 5424 } | 5447 } |
| 5425 return this.tokenizeNumber(next); | 5448 return this.tokenizeNumber(next); |
| 5426 } | 5449 } |
| 5427 AbstractScanner$S.prototype.tokenizeHex = function(next) { | 5450 AbstractScanner$S.prototype.tokenizeHex = function(next) { |
| 5451 var $0; |
| 5428 var start = this.get$byteOffset(); | 5452 var start = this.get$byteOffset(); |
| 5429 var hasDigits = false; | 5453 var hasDigits = false; |
| 5430 while (true) { | 5454 while (true) { |
| 5431 next = this.advance(); | 5455 next = this.advance(); |
| 5432 switch (next) { | 5456 switch (next) { |
| 5433 case 48/*null.$0*/: | 5457 case 48/*null.$0*/: |
| 5434 case 49/*null.$1*/: | 5458 case 49/*null.$1*/: |
| 5435 case 50/*null.$2*/: | 5459 case 50/*null.$2*/: |
| 5436 case 51/*null.$3*/: | 5460 case 51/*null.$3*/: |
| 5437 case 52/*null.$4*/: | 5461 case 52/*null.$4*/: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 5454 case 102/*null.$f*/: | 5478 case 102/*null.$f*/: |
| 5455 | 5479 |
| 5456 hasDigits = true; | 5480 hasDigits = true; |
| 5457 break; | 5481 break; |
| 5458 | 5482 |
| 5459 default: | 5483 default: |
| 5460 | 5484 |
| 5461 if (!$notnull_bool(hasDigits)) { | 5485 if (!$notnull_bool(hasDigits)) { |
| 5462 $throw(new MalformedInputException(this.get$charOffset())); | 5486 $throw(new MalformedInputException(this.get$charOffset())); |
| 5463 } | 5487 } |
| 5464 this.appendByteStringToken(120/*null.HEXADECIMAL_TOKEN*/, this.asciiStri
ng(start)); | 5488 this.appendByteStringToken$2(120/*null.HEXADECIMAL_TOKEN*/, this.asciiSt
ring(start)); |
| 5465 return next; | 5489 return next; |
| 5466 | 5490 |
| 5467 } | 5491 } |
| 5468 } | 5492 } |
| 5469 } | 5493 } |
| 5470 AbstractScanner$S.prototype.tokenizeDotOrNumber = function(next) { | 5494 AbstractScanner$S.prototype.tokenizeDotOrNumber = function(next) { |
| 5471 var start = this.get$byteOffset(); | 5495 var start = this.get$byteOffset(); |
| 5472 next = this.advance(); | 5496 next = this.advance(); |
| 5473 switch (next) { | 5497 switch (next) { |
| 5474 case 48/*null.$0*/: | 5498 case 48/*null.$0*/: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 5491 return this.select(46/*null.$PERIOD*/, "...", ".."); | 5515 return this.select(46/*null.$PERIOD*/, "...", ".."); |
| 5492 | 5516 |
| 5493 default: | 5517 default: |
| 5494 | 5518 |
| 5495 this.appendStringToken(46/*null.PERIOD_TOKEN*/, "."); | 5519 this.appendStringToken(46/*null.PERIOD_TOKEN*/, "."); |
| 5496 return next; | 5520 return next; |
| 5497 | 5521 |
| 5498 } | 5522 } |
| 5499 } | 5523 } |
| 5500 AbstractScanner$S.prototype.tokenizeFractionPart = function(next, start) { | 5524 AbstractScanner$S.prototype.tokenizeFractionPart = function(next, start) { |
| 5525 var $0; |
| 5501 var done = false; | 5526 var done = false; |
| 5502 LOOP: | 5527 LOOP: |
| 5503 while (!$notnull_bool(done)) { | 5528 while (!$notnull_bool(done)) { |
| 5504 switch (next) { | 5529 switch (next) { |
| 5505 case 48/*null.$0*/: | 5530 case 48/*null.$0*/: |
| 5506 case 49/*null.$1*/: | 5531 case 49/*null.$1*/: |
| 5507 case 50/*null.$2*/: | 5532 case 50/*null.$2*/: |
| 5508 case 51/*null.$3*/: | 5533 case 51/*null.$3*/: |
| 5509 case 52/*null.$4*/: | 5534 case 52/*null.$4*/: |
| 5510 case 53/*null.$5*/: | 5535 case 53/*null.$5*/: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 5526 | 5551 |
| 5527 done = true; | 5552 done = true; |
| 5528 continue LOOP; | 5553 continue LOOP; |
| 5529 | 5554 |
| 5530 } | 5555 } |
| 5531 next = this.advance(); | 5556 next = this.advance(); |
| 5532 } | 5557 } |
| 5533 if (next == 100/*null.$d*/ || next == 68/*null.$D*/) { | 5558 if (next == 100/*null.$d*/ || next == 68/*null.$D*/) { |
| 5534 next = this.advance(); | 5559 next = this.advance(); |
| 5535 } | 5560 } |
| 5536 this.appendByteStringToken(100/*null.DOUBLE_TOKEN*/, this.asciiString(start)); | 5561 this.appendByteStringToken$2(100/*null.DOUBLE_TOKEN*/, this.asciiString(start)
); |
| 5537 return next; | 5562 return next; |
| 5538 } | 5563 } |
| 5539 AbstractScanner$S.prototype.tokenizeExponent = function(next) { | 5564 AbstractScanner$S.prototype.tokenizeExponent = function(next) { |
| 5540 if (next == 43/*null.$PLUS*/ || next == 45/*null.$MINUS*/) { | 5565 if (next == 43/*null.$PLUS*/ || next == 45/*null.$MINUS*/) { |
| 5541 next = this.advance(); | 5566 next = this.advance(); |
| 5542 } | 5567 } |
| 5543 var hasDigits = false; | 5568 var hasDigits = false; |
| 5544 while (true) { | 5569 while (true) { |
| 5545 switch (next) { | 5570 switch (next) { |
| 5546 case 48/*null.$0*/: | 5571 case 48/*null.$0*/: |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5625 | 5650 |
| 5626 default: | 5651 default: |
| 5627 | 5652 |
| 5628 next = this.advance(); | 5653 next = this.advance(); |
| 5629 break; | 5654 break; |
| 5630 | 5655 |
| 5631 } | 5656 } |
| 5632 } | 5657 } |
| 5633 } | 5658 } |
| 5634 AbstractScanner$S.prototype.tokenizeIdentifier = function(next) { | 5659 AbstractScanner$S.prototype.tokenizeIdentifier = function(next) { |
| 5660 var $0; |
| 5635 var start = this.get$byteOffset(); | 5661 var start = this.get$byteOffset(); |
| 5636 var state = null; | 5662 var state = null; |
| 5637 if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) { | 5663 if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) { |
| 5638 state = KeywordState.get$KEYWORD_STATE().next(next); | 5664 state = KeywordState.get$KEYWORD_STATE().next(next); |
| 5639 next = this.advance(); | 5665 next = this.advance(); |
| 5640 } | 5666 } |
| 5641 var isAscii = true; | 5667 var isAscii = true; |
| 5642 while (true) { | 5668 while (true) { |
| 5643 if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) { | 5669 if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) { |
| 5644 if (state != null) { | 5670 if (state != null) { |
| 5645 state = state.next(next); | 5671 state = state.next(next); |
| 5646 } | 5672 } |
| 5647 } | 5673 } |
| 5648 else if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/) || (65/*null.$A*/
<= next && next <= 90/*null.$Z*/) || next == 95/*null.$_*/ || next == 36/*null.$
DOLLAR*/) { | 5674 else if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/) || (65/*null.$A*/
<= next && next <= 90/*null.$Z*/) || next == 95/*null.$_*/ || next == 36/*null.$
DOLLAR*/) { |
| 5649 state = null; | 5675 state = null; |
| 5650 } | 5676 } |
| 5651 else if (next < 128) { | 5677 else if (next < 128) { |
| 5652 if ($notnull_bool(state != null && state.isLeaf())) { | 5678 if ($notnull_bool(state != null && state.isLeaf())) { |
| 5653 this.appendKeywordToken(state.get$keyword()); | 5679 this.appendKeywordToken(state.get$keyword()); |
| 5654 } | 5680 } |
| 5655 else if ($notnull_bool(isAscii)) { | 5681 else if ($notnull_bool(isAscii)) { |
| 5656 this.appendByteStringToken(97/*null.IDENTIFIER_TOKEN*/, this.asciiString
(start)); | 5682 this.appendByteStringToken$2(97/*null.IDENTIFIER_TOKEN*/, this.asciiStri
ng(start)); |
| 5657 } | 5683 } |
| 5658 else { | 5684 else { |
| 5659 this.appendByteStringToken(97/*null.IDENTIFIER_TOKEN*/, this.utf8String(
start, -1)); | 5685 this.appendByteStringToken$2(97/*null.IDENTIFIER_TOKEN*/, this.utf8Strin
g(start, -1)); |
| 5660 } | 5686 } |
| 5661 return next; | 5687 return next; |
| 5662 } | 5688 } |
| 5663 else { | 5689 else { |
| 5664 var nonAsciiStart = this.get$byteOffset(); | 5690 var nonAsciiStart = this.get$byteOffset(); |
| 5665 do { | 5691 do { |
| 5666 next = this.nextByte(); | 5692 next = this.nextByte(); |
| 5667 } | 5693 } |
| 5668 while (next > 127) | 5694 while (next > 127) |
| 5669 var string = this.utf8String(nonAsciiStart, -1).toString$0(); | 5695 var string = this.utf8String(nonAsciiStart, -1).toString$0(); |
| 5670 isAscii = false; | 5696 isAscii = false; |
| 5671 this.addToCharOffset(string.length); | 5697 this.addToCharOffset(string.length); |
| 5672 return next; | 5698 return next; |
| 5673 } | 5699 } |
| 5674 next = this.advance(); | 5700 next = this.advance(); |
| 5675 } | 5701 } |
| 5676 } | 5702 } |
| 5677 AbstractScanner$S.prototype.tokenizeRawString = function(next) { | 5703 AbstractScanner$S.prototype.tokenizeRawString = function(next) { |
| 5678 var start = this.get$byteOffset(); | 5704 var start = this.get$byteOffset(); |
| 5679 next = this.advance(); | 5705 next = this.advance(); |
| 5680 if (next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/) { | 5706 if (next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/) { |
| 5681 return this.tokenizeString(next, start, true); | 5707 return this.tokenizeString(next, start, true); |
| 5682 } | 5708 } |
| 5683 else { | 5709 else { |
| 5684 $throw(new MalformedInputException(this.get$charOffset())); | 5710 $throw(new MalformedInputException(this.get$charOffset())); |
| 5685 } | 5711 } |
| 5686 } | 5712 } |
| 5687 AbstractScanner$S.prototype.tokenizeString = function(next, start, raw) { | 5713 AbstractScanner$S.prototype.tokenizeString = function(next, start, raw) { |
| 5714 var $0; |
| 5688 var q = next; | 5715 var q = next; |
| 5689 next = this.advance(); | 5716 next = this.advance(); |
| 5690 if (q == next) { | 5717 if (q == next) { |
| 5691 next = this.advance(); | 5718 next = this.advance(); |
| 5692 if (q == next) { | 5719 if (q == next) { |
| 5693 return this.tokenizeMultiLineString(q, start, raw); | 5720 return this.tokenizeMultiLineString(q, start, raw); |
| 5694 } | 5721 } |
| 5695 else { | 5722 else { |
| 5696 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start,
-1)); | 5723 this.appendByteStringToken$2(39/*null.STRING_TOKEN*/, this.utf8String(star
t, -1)); |
| 5697 return next; | 5724 return next; |
| 5698 } | 5725 } |
| 5699 } | 5726 } |
| 5700 if ($notnull_bool(raw)) { | 5727 if ($notnull_bool(raw)) { |
| 5701 return this.tokenizeSingleLineRawString(next, q, start); | 5728 return this.tokenizeSingleLineRawString(next, q, start); |
| 5702 } | 5729 } |
| 5703 else { | 5730 else { |
| 5704 return this.tokenizeSingleLineString(next, q, start); | 5731 return this.tokenizeSingleLineString(next, q, start); |
| 5705 } | 5732 } |
| 5706 } | 5733 } |
| 5707 AbstractScanner$S.prototype.tokenizeSingleLineString = function(next, q1, start)
{ | 5734 AbstractScanner$S.prototype.tokenizeSingleLineString = function(next, q1, start)
{ |
| 5735 var $0; |
| 5708 while (next != -1) { | 5736 while (next != -1) { |
| 5709 if (next == q1) { | 5737 if (next == q1) { |
| 5710 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start,
0)); | 5738 this.appendByteStringToken$2(39/*null.STRING_TOKEN*/, this.utf8String(star
t, 0)); |
| 5711 return this.advance(); | 5739 return this.advance(); |
| 5712 } | 5740 } |
| 5713 else if (next == 92/*null.$BACKSLASH*/) { | 5741 else if (next == 92/*null.$BACKSLASH*/) { |
| 5714 next = this.advance(); | 5742 next = this.advance(); |
| 5715 if (next == -1) { | 5743 if (next == -1) { |
| 5716 $throw(new MalformedInputException(this.get$charOffset())); | 5744 $throw(new MalformedInputException(this.get$charOffset())); |
| 5717 } | 5745 } |
| 5718 } | 5746 } |
| 5719 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { | 5747 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { |
| 5720 $throw(new MalformedInputException(this.get$charOffset())); | 5748 $throw(new MalformedInputException(this.get$charOffset())); |
| 5721 } | 5749 } |
| 5722 next = this.advance(); | 5750 next = this.advance(); |
| 5723 } | 5751 } |
| 5724 $throw(new MalformedInputException(this.get$charOffset())); | 5752 $throw(new MalformedInputException(this.get$charOffset())); |
| 5725 } | 5753 } |
| 5726 AbstractScanner$S.prototype.tokenizeSingleLineRawString = function(next, q1, sta
rt) { | 5754 AbstractScanner$S.prototype.tokenizeSingleLineRawString = function(next, q1, sta
rt) { |
| 5755 var $0; |
| 5727 next = this.advance(); | 5756 next = this.advance(); |
| 5728 while (next != -1) { | 5757 while (next != -1) { |
| 5729 if (next == q1) { | 5758 if (next == q1) { |
| 5730 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start,
0)); | 5759 this.appendByteStringToken$2(39/*null.STRING_TOKEN*/, this.utf8String(star
t, 0)); |
| 5731 return this.advance(); | 5760 return this.advance(); |
| 5732 } | 5761 } |
| 5733 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { | 5762 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { |
| 5734 $throw(new MalformedInputException(this.get$charOffset())); | 5763 $throw(new MalformedInputException(this.get$charOffset())); |
| 5735 } | 5764 } |
| 5736 next = this.advance(); | 5765 next = this.advance(); |
| 5737 } | 5766 } |
| 5738 $throw(new MalformedInputException(this.get$charOffset())); | 5767 $throw(new MalformedInputException(this.get$charOffset())); |
| 5739 } | 5768 } |
| 5740 AbstractScanner$S.prototype.tokenizeMultiLineString = function(q, start, raw) { | 5769 AbstractScanner$S.prototype.tokenizeMultiLineString = function(q, start, raw) { |
| 5770 var $0; |
| 5741 var next = this.advance(); | 5771 var next = this.advance(); |
| 5742 while (next != -1) { | 5772 while (next != -1) { |
| 5743 if (next == q) { | 5773 if (next == q) { |
| 5744 next = this.advance(); | 5774 next = this.advance(); |
| 5745 if (next == q) { | 5775 if (next == q) { |
| 5746 next = this.advance(); | 5776 next = this.advance(); |
| 5747 if (next == q) { | 5777 if (next == q) { |
| 5748 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(st
art, 0)); | 5778 this.appendByteStringToken$2(39/*null.STRING_TOKEN*/, this.utf8String(
start, 0)); |
| 5749 return this.advance(); | 5779 return this.advance(); |
| 5750 } | 5780 } |
| 5751 } | 5781 } |
| 5752 } | 5782 } |
| 5753 next = this.advance(); | 5783 next = this.advance(); |
| 5754 } | 5784 } |
| 5755 return next; | 5785 return next; |
| 5756 } | 5786 } |
| 5757 // ********** Code for MalformedInputException ************** | 5787 // ********** Code for MalformedInputException ************** |
| 5758 function MalformedInputException(message) { | 5788 function MalformedInputException(message) { |
| (...skipping 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7602 // Initializers done | 7632 // Initializers done |
| 7603 } | 7633 } |
| 7604 $inherits(StringScanner, ArrayBasedScanner$SourceString); | 7634 $inherits(StringScanner, ArrayBasedScanner$SourceString); |
| 7605 StringScanner.prototype.nextByte = function() { | 7635 StringScanner.prototype.nextByte = function() { |
| 7606 return this.charAt(++this.byteOffset); | 7636 return this.charAt(++this.byteOffset); |
| 7607 } | 7637 } |
| 7608 StringScanner.prototype.peek = function() { | 7638 StringScanner.prototype.peek = function() { |
| 7609 return this.charAt(this.byteOffset + 1); | 7639 return this.charAt(this.byteOffset + 1); |
| 7610 } | 7640 } |
| 7611 StringScanner.prototype.charAt = function(index) { | 7641 StringScanner.prototype.charAt = function(index) { |
| 7612 return (this.string.length > $assert_num(index)) ? this.string.charCodeAt(inde
x) : -1; | 7642 return (this.string.length > $assert_num(index)) ? this.string.charCodeAt($ass
ert_num(index)) : -1; |
| 7613 } | 7643 } |
| 7614 StringScanner.prototype.asciiString = function(start) { | 7644 StringScanner.prototype.asciiString = function(start) { |
| 7615 return new SubstringWrapper(this.string, start, this.byteOffset); | 7645 return new SubstringWrapper(this.string, start, this.byteOffset); |
| 7616 } | 7646 } |
| 7617 StringScanner.prototype.utf8String = function(start, offset) { | 7647 StringScanner.prototype.utf8String = function(start, offset) { |
| 7618 return new SubstringWrapper(this.string, start, this.byteOffset + offset + 1); | 7648 return new SubstringWrapper(this.string, start, this.byteOffset + offset + 1); |
| 7619 } | 7649 } |
| 7620 StringScanner.prototype.appendByteStringToken = function(kind, value) { | 7650 StringScanner.prototype.appendByteStringToken = function(kind, value) { |
| 7621 this.tail.next = new StringToken.fromSource$ctor(kind, value, this.tokenStart)
; | 7651 this.tail.next = new StringToken.fromSource$ctor(kind, value, this.tokenStart)
; |
| 7622 this.tail = this.tail.next; | 7652 this.tail = this.tail.next; |
| 7623 } | 7653 } |
| 7654 StringScanner.prototype.appendByteStringToken$2 = function($0, $1) { |
| 7655 return this.appendByteStringToken($assert_num($0), ($1 && $1.is$SourceString()
)); |
| 7656 }; |
| 7624 // ********** Code for SubstringWrapper ************** | 7657 // ********** Code for SubstringWrapper ************** |
| 7625 function SubstringWrapper(internalString, begin, end) { | 7658 function SubstringWrapper(internalString, begin, end) { |
| 7626 this.internalString = internalString; | 7659 this.internalString = internalString; |
| 7627 this.begin = begin; | 7660 this.begin = begin; |
| 7628 this.end = end; | 7661 this.end = end; |
| 7629 // Initializers done | 7662 // Initializers done |
| 7630 } | 7663 } |
| 7631 SubstringWrapper.prototype.is$SourceString = function(){return this;}; | 7664 SubstringWrapper.prototype.is$SourceString = function(){return this;}; |
| 7632 SubstringWrapper.prototype.hashCode = function() { | 7665 SubstringWrapper.prototype.hashCode = function() { |
| 7633 return this.toString().hashCode(); | 7666 return this.toString().hashCode(); |
| (...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8503 // ********** Code for VariableDefinitions ************** | 8536 // ********** Code for VariableDefinitions ************** |
| 8504 function VariableDefinitions(type, modifiers, definitions, endToken) { | 8537 function VariableDefinitions(type, modifiers, definitions, endToken) { |
| 8505 this.type = type; | 8538 this.type = type; |
| 8506 this.modifiers = modifiers; | 8539 this.modifiers = modifiers; |
| 8507 this.definitions = definitions; | 8540 this.definitions = definitions; |
| 8508 this.endToken = endToken; | 8541 this.endToken = endToken; |
| 8509 // Initializers done | 8542 // Initializers done |
| 8510 } | 8543 } |
| 8511 $inherits(VariableDefinitions, Statement); | 8544 $inherits(VariableDefinitions, Statement); |
| 8512 VariableDefinitions.prototype.is$VariableDefinitions = function(){return this;}; | 8545 VariableDefinitions.prototype.is$VariableDefinitions = function(){return this;}; |
| 8546 VariableDefinitions.prototype.get$type = function() { return this.type; }; |
| 8513 VariableDefinitions.prototype.accept = function(visitor) { | 8547 VariableDefinitions.prototype.accept = function(visitor) { |
| 8514 return visitor.visitVariableDefinitions(this); | 8548 return visitor.visitVariableDefinitions(this); |
| 8515 } | 8549 } |
| 8516 VariableDefinitions.prototype.getBeginToken = function() { | 8550 VariableDefinitions.prototype.getBeginToken = function() { |
| 8517 return firstBeginToken(this.type, this.definitions); | 8551 return firstBeginToken(this.type, this.definitions); |
| 8518 } | 8552 } |
| 8519 VariableDefinitions.prototype.getEndToken = function() { | 8553 VariableDefinitions.prototype.getEndToken = function() { |
| 8520 return this.endToken; | 8554 return this.endToken; |
| 8521 } | 8555 } |
| 8522 VariableDefinitions.prototype.accept$1 = function($0) { | 8556 VariableDefinitions.prototype.accept$1 = function($0) { |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8704 return this.hashCode(); | 8738 return this.hashCode(); |
| 8705 }; | 8739 }; |
| 8706 // ********** Code for VariableElement ************** | 8740 // ********** Code for VariableElement ************** |
| 8707 function VariableElement(node, typeAnnotation, name, enclosingElement) { | 8741 function VariableElement(node, typeAnnotation, name, enclosingElement) { |
| 8708 this.node = node; | 8742 this.node = node; |
| 8709 this.typeAnnotation = typeAnnotation; | 8743 this.typeAnnotation = typeAnnotation; |
| 8710 Element.call(this, name, const$260, enclosingElement); | 8744 Element.call(this, name, const$260, enclosingElement); |
| 8711 // Initializers done | 8745 // Initializers done |
| 8712 } | 8746 } |
| 8713 $inherits(VariableElement, Element); | 8747 $inherits(VariableElement, Element); |
| 8748 VariableElement.prototype.get$type = function() { return this.type; }; |
| 8749 VariableElement.prototype.set$type = function(value) { return this.type = value;
}; |
| 8714 VariableElement.prototype.parseNode = function(canceler, logger) { | 8750 VariableElement.prototype.parseNode = function(canceler, logger) { |
| 8715 return this.node; | 8751 return this.node; |
| 8716 } | 8752 } |
| 8717 VariableElement.prototype.computeType = function(compiler, types) { | 8753 VariableElement.prototype.computeType = function(compiler, types) { |
| 8718 return getType(this.typeAnnotation, types); | 8754 return getType(this.typeAnnotation, types); |
| 8719 } | 8755 } |
| 8720 VariableElement.prototype.computeType$2 = function($0, $1) { | 8756 VariableElement.prototype.computeType$2 = function($0, $1) { |
| 8721 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); | 8757 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); |
| 8722 }; | 8758 }; |
| 8723 // ********** Code for ForeignElement ************** | 8759 // ********** Code for ForeignElement ************** |
| 8724 function ForeignElement(name) { | 8760 function ForeignElement(name) { |
| 8725 Element.call(this, name, const$242, null); | 8761 Element.call(this, name, const$242, null); |
| 8726 // Initializers done | 8762 // Initializers done |
| 8727 } | 8763 } |
| 8728 $inherits(ForeignElement, Element); | 8764 $inherits(ForeignElement, Element); |
| 8729 ForeignElement.prototype.computeType = function(compiler, types) { | 8765 ForeignElement.prototype.computeType = function(compiler, types) { |
| 8730 return types.dynamicType; | 8766 return types.dynamicType; |
| 8731 } | 8767 } |
| 8732 ForeignElement.prototype.computeType$2 = function($0, $1) { | 8768 ForeignElement.prototype.computeType$2 = function($0, $1) { |
| 8733 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); | 8769 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); |
| 8734 }; | 8770 }; |
| 8735 // ********** Code for FunctionElement ************** | 8771 // ********** Code for FunctionElement ************** |
| 8736 function FunctionElement(name) { | 8772 function FunctionElement(name) { |
| 8737 Element.call(this, name, const$239, null); | 8773 Element.call(this, name, const$239, null); |
| 8738 // Initializers done | 8774 // Initializers done |
| 8739 } | 8775 } |
| 8740 $inherits(FunctionElement, Element); | 8776 $inherits(FunctionElement, Element); |
| 8777 FunctionElement.prototype.get$type = function() { return this.type; }; |
| 8778 FunctionElement.prototype.set$type = function(value) { return this.type = value;
}; |
| 8741 FunctionElement.prototype.computeType = function(compiler, types) { | 8779 FunctionElement.prototype.computeType = function(compiler, types) { |
| 8742 var $0; | 8780 var $0; |
| 8743 if (this.type != null) return (($0 = this.type) && $0.is$FunctionType()); | 8781 if (this.type != null) return (($0 = this.type) && $0.is$FunctionType()); |
| 8744 var node = (($0 = this.parseNode(compiler, compiler)) && $0.is$FunctionExpress
ion()); | 8782 var node = (($0 = this.parseNode(compiler, compiler)) && $0.is$FunctionExpress
ion()); |
| 8745 var returnType = getType(node.returnType, types); | 8783 var returnType = getType(node.returnType, types); |
| 8746 if (returnType == null) compiler.cancel(('unknown type ' + returnType + '')); | 8784 if (returnType == null) compiler.cancel(('unknown type ' + returnType + '')); |
| 8747 var parameterTypes = new LinkBuilderImplementation(); | 8785 var parameterTypes = new LinkBuilderImplementation(); |
| 8748 for (var link = node.parameters.nodes; | 8786 for (var link = node.parameters.nodes; |
| 8749 !$notnull_bool(link.isEmpty$0()); link = link.get$tail()) { | 8787 !$notnull_bool(link.isEmpty$0()); link = link.get$tail()) { |
| 8750 var parameter = (($0 = link.get$head()) && $0.is$VariableDefinitions()); | 8788 var parameter = (($0 = link.get$head()) && $0.is$VariableDefinitions()); |
| 8751 parameterTypes.addLast(getType(parameter.type, types)); | 8789 parameterTypes.addLast(getType(parameter.type, types)); |
| 8752 } | 8790 } |
| 8753 this.type = new FunctionType(returnType, (($0 = parameterTypes.toLink()) && $0
.is$Link$Type())); | 8791 this.type = new FunctionType(returnType, (($0 = parameterTypes.toLink()) && $0
.is$Link$Type())); |
| 8754 return (($0 = this.type) && $0.is$FunctionType()); | 8792 return (($0 = this.type) && $0.is$FunctionType()); |
| 8755 } | 8793 } |
| 8756 FunctionElement.prototype.computeType$2 = FunctionElement.prototype.computeType; | 8794 FunctionElement.prototype.computeType$2 = FunctionElement.prototype.computeType; |
| 8757 // ********** Code for ClassElement ************** | 8795 // ********** Code for ClassElement ************** |
| 8758 function ClassElement(name) { | 8796 function ClassElement(name) { |
| 8759 this.interfaces = const$14/*const EmptyLink()*/ | 8797 this.interfaces = const$14/*const EmptyLink()*/ |
| 8760 this.isResolved = false | 8798 this.isResolved = false |
| 8761 Element.call(this, name, const$237, null); | 8799 Element.call(this, name, const$237, null); |
| 8762 // Initializers done | 8800 // Initializers done |
| 8763 } | 8801 } |
| 8764 $inherits(ClassElement, Element); | 8802 $inherits(ClassElement, Element); |
| 8765 ClassElement.prototype.is$ClassElement = function(){return this;}; | 8803 ClassElement.prototype.is$ClassElement = function(){return this;}; |
| 8804 ClassElement.prototype.get$type = function() { return this.type; }; |
| 8805 ClassElement.prototype.set$type = function(value) { return this.type = value; }; |
| 8766 ClassElement.prototype.get$interfaces = function() { return this.interfaces; }; | 8806 ClassElement.prototype.get$interfaces = function() { return this.interfaces; }; |
| 8767 ClassElement.prototype.set$interfaces = function(value) { return this.interfaces
= value; }; | 8807 ClassElement.prototype.set$interfaces = function(value) { return this.interfaces
= value; }; |
| 8768 ClassElement.prototype.computeType = function(compiler, types) { | 8808 ClassElement.prototype.computeType = function(compiler, types) { |
| 8769 if (this.type == null) { | 8809 if (this.type == null) { |
| 8770 this.type = new SimpleType(this.name, this); | 8810 this.type = new SimpleType(this.name, this); |
| 8771 } | 8811 } |
| 8772 return this.type; | 8812 return this.type; |
| 8773 } | 8813 } |
| 8774 ClassElement.prototype.resolve = function(compiler) { | 8814 ClassElement.prototype.resolve = function(compiler) { |
| 8775 if ($notnull_bool(this.isResolved)) return; | 8815 if ($notnull_bool(this.isResolved)) return; |
| (...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10368 return node; | 10408 return node; |
| 10369 } | 10409 } |
| 10370 SsaConstantFolder.prototype.visitArithmetic = function(node) { | 10410 SsaConstantFolder.prototype.visitArithmetic = function(node) { |
| 10371 var $0; | 10411 var $0; |
| 10372 var inputs = node.inputs; | 10412 var inputs = node.inputs; |
| 10373 $assert(inputs.length == 2, "inputs.length == 2", "optimize.dart", 57, 12); | 10413 $assert(inputs.length == 2, "inputs.length == 2", "optimize.dart", 57, 12); |
| 10374 if ($notnull_bool(inputs.$index(0).isLiteralNumber$0() && inputs.$index(1).isL
iteralNumber$0())) { | 10414 if ($notnull_bool(inputs.$index(0).isLiteralNumber$0() && inputs.$index(1).isL
iteralNumber$0())) { |
| 10375 var op1 = (($0 = inputs.$index(0)) && $0.is$HLiteral()); | 10415 var op1 = (($0 = inputs.$index(0)) && $0.is$HLiteral()); |
| 10376 var op2 = (($0 = inputs.$index(1)) && $0.is$HLiteral()); | 10416 var op2 = (($0 = inputs.$index(1)) && $0.is$HLiteral()); |
| 10377 try { | 10417 try { |
| 10378 var folded = node.evaluate(op1.value, op2.value); | 10418 var folded = node.evaluate($assert_num(op1.value), $assert_num(op2.value))
; |
| 10379 return new HLiteral(folded); | 10419 return new HLiteral(folded); |
| 10380 } catch (e) { | 10420 } catch (e) { |
| 10381 e = $toDartException(e); | 10421 e = $toDartException(e); |
| 10382 if (!(e instanceof IntegerDivisionByZeroException)) throw e; | 10422 if (!(e instanceof IntegerDivisionByZeroException)) throw e; |
| 10383 return node; | 10423 return node; |
| 10384 } | 10424 } |
| 10385 } | 10425 } |
| 10386 return node; | 10426 return node; |
| 10387 } | 10427 } |
| 10388 SsaConstantFolder.prototype.visitAdd = function(node) { | 10428 SsaConstantFolder.prototype.visitAdd = function(node) { |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10783 } | 10823 } |
| 10784 function hasCorrectUses(instruction) { | 10824 function hasCorrectUses(instruction) { |
| 10785 if (!$notnull_bool(instruction.isInBasicBlock$0())) return true; | 10825 if (!$notnull_bool(instruction.isInBasicBlock$0())) return true; |
| 10786 return HValidator.everyInstruction(instruction.get$usedBy(), (function (use,
count) { | 10826 return HValidator.everyInstruction(instruction.get$usedBy(), (function (use,
count) { |
| 10787 return HValidator.countInstruction(use.inputs, (instruction && instruction
.is$HInstruction())) == count; | 10827 return HValidator.countInstruction(use.inputs, (instruction && instruction
.is$HInstruction())) == count; |
| 10788 }) | 10828 }) |
| 10789 ); | 10829 ); |
| 10790 } | 10830 } |
| 10791 this.isValid = $notnull_bool($notnull_bool(this.isValid && hasCorrectInputs(in
struction)) && hasCorrectUses(instruction)); | 10831 this.isValid = $notnull_bool($notnull_bool(this.isValid && hasCorrectInputs(in
struction)) && hasCorrectUses(instruction)); |
| 10792 } | 10832 } |
| 10793 // ********** Code for ValueSetNode ************** | |
| 10794 function ValueSetNode() {} | |
| 10795 ValueSetNode.prototype.get$value = function() { return this.value; }; | |
| 10796 ValueSetNode.prototype.next$0 = function() { | |
| 10797 return this.next(); | |
| 10798 }; | |
| 10799 // ********** Code for top level ************** | 10833 // ********** Code for top level ************** |
| 10800 // ********** Library leg ************** | 10834 // ********** Library leg ************** |
| 10801 // ********** Code for WorldCompiler ************** | 10835 // ********** Code for WorldCompiler ************** |
| 10802 function WorldCompiler(world, script) { | 10836 function WorldCompiler(world, script) { |
| 10803 this.world = world; | 10837 this.world = world; |
| 10804 Compiler.call(this, script); | 10838 Compiler.call(this, script); |
| 10805 // Initializers done | 10839 // Initializers done |
| 10806 } | 10840 } |
| 10807 $inherits(WorldCompiler, Compiler); | 10841 $inherits(WorldCompiler, Compiler); |
| 10808 WorldCompiler.prototype.log = function(message) { | 10842 WorldCompiler.prototype.log = function(message) { |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11450 } | 11484 } |
| 11451 TypeCheckerVisitor.prototype.typeWithDefault = function(node, defaultValue) { | 11485 TypeCheckerVisitor.prototype.typeWithDefault = function(node, defaultValue) { |
| 11452 return node != null ? this.type(node) : defaultValue; | 11486 return node != null ? this.type(node) : defaultValue; |
| 11453 } | 11487 } |
| 11454 TypeCheckerVisitor.prototype.type = function(node) { | 11488 TypeCheckerVisitor.prototype.type = function(node) { |
| 11455 var $0; | 11489 var $0; |
| 11456 if (node == null) this.fail(null, 'unexpected node: null'); | 11490 if (node == null) this.fail(null, 'unexpected node: null'); |
| 11457 var result = (($0 = node.accept(this)) && $0.is$Type()); | 11491 var result = (($0 = node.accept(this)) && $0.is$Type()); |
| 11458 return result; | 11492 return result; |
| 11459 } | 11493 } |
| 11494 TypeCheckerVisitor.prototype.get$type = function() { |
| 11495 return TypeCheckerVisitor.prototype.type.bind(this); |
| 11496 } |
| 11460 TypeCheckerVisitor.prototype.checkAssignable = function(node, s, t) { | 11497 TypeCheckerVisitor.prototype.checkAssignable = function(node, s, t) { |
| 11461 if (!$notnull_bool(this.types.isAssignable(s, t))) { | 11498 if (!$notnull_bool(this.types.isAssignable(s, t))) { |
| 11462 var error = CompilerError.notAssignable(s, t); | 11499 var error = CompilerError.notAssignable(s, t); |
| 11463 this.compiler.reportWarning(node, error); | 11500 this.compiler.reportWarning(node, $assert_String(error)); |
| 11464 } | 11501 } |
| 11465 } | 11502 } |
| 11466 TypeCheckerVisitor.prototype.visitBlock = function(node) { | 11503 TypeCheckerVisitor.prototype.visitBlock = function(node) { |
| 11467 this.type(node.statements); | 11504 this.type(node.statements); |
| 11468 return this.types.voidType; | 11505 return this.types.voidType; |
| 11469 } | 11506 } |
| 11470 TypeCheckerVisitor.prototype.visitClassNode = function(node) { | 11507 TypeCheckerVisitor.prototype.visitClassNode = function(node) { |
| 11471 this.fail(node); | 11508 this.fail(node); |
| 11472 } | 11509 } |
| 11473 TypeCheckerVisitor.prototype.visitExpressionStatement = function(node) { | 11510 TypeCheckerVisitor.prototype.visitExpressionStatement = function(node) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11525 var argument = (($0 = arguments.get$head()) && $0.is$Node()); | 11562 var argument = (($0 = arguments.get$head()) && $0.is$Node()); |
| 11526 var argumentType = this.type(argument); | 11563 var argumentType = this.type(argument); |
| 11527 this.checkAssignable(argument, argumentType, (($0 = formals.get$head())
&& $0.is$Type())); | 11564 this.checkAssignable(argument, argumentType, (($0 = formals.get$head())
&& $0.is$Type())); |
| 11528 formals = (($0 = formals.get$tail()) && $0.is$Link$Type()); | 11565 formals = (($0 = formals.get$tail()) && $0.is$Link$Type()); |
| 11529 arguments = (($0 = arguments.get$tail()) && $0.is$Link$Node()); | 11566 arguments = (($0 = arguments.get$tail()) && $0.is$Link$Node()); |
| 11530 } | 11567 } |
| 11531 if (!$notnull_bool(formals.isEmpty())) { | 11568 if (!$notnull_bool(formals.isEmpty())) { |
| 11532 this.compiler.reportWarning(node, 'missing argument'); | 11569 this.compiler.reportWarning(node, 'missing argument'); |
| 11533 } | 11570 } |
| 11534 if (!$notnull_bool(arguments.isEmpty())) { | 11571 if (!$notnull_bool(arguments.isEmpty())) { |
| 11535 this.compiler.reportWarning(arguments.get$head(), 'additional arguments'
); | 11572 this.compiler.reportWarning((($0 = arguments.get$head()) && $0.is$Node()
), 'additional arguments'); |
| 11536 } | 11573 } |
| 11537 return funType.returnType; | 11574 return funType.returnType; |
| 11538 } | 11575 } |
| 11539 } | 11576 } |
| 11540 else { | 11577 else { |
| 11541 this.fail(node, ('unresolved send ' + selector.get$source() + '')); | 11578 this.fail(node, ('unresolved send ' + selector.get$source() + '')); |
| 11542 } | 11579 } |
| 11543 } | 11580 } |
| 11544 TypeCheckerVisitor.prototype.visitSendSet = function(node) { | 11581 TypeCheckerVisitor.prototype.visitSendSet = function(node) { |
| 11545 var $0; | 11582 var $0; |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11783 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}"); | 11820 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}"); |
| 11784 } | 11821 } |
| 11785 if ($notnull_bool(this.useStackTraceOf)) { | 11822 if ($notnull_bool(this.useStackTraceOf)) { |
| 11786 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.stack ?
e.stack : null;\n}"); | 11823 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.stack ?
e.stack : null;\n}"); |
| 11787 } | 11824 } |
| 11788 if ($notnull_bool(this.useToDartException)) { | 11825 if ($notnull_bool(this.useToDartException)) { |
| 11789 w.writeln("// Translate a JavaScript exception to a Dart exception\n// TODO(
jmesserly): cross browser support. This is Chrome specific.\nfunction $toDartExc
eption(e) {\n var res = e;\n if (e instanceof TypeError) {\n switch(e.type)
{\n case 'property_not_function':\n case 'called_non_callable':\n
if (e.arguments[0] == null) {\n res = new NullPointerException();\n
} else {\n res = new ObjectNotClosureException();\n }\n
break;\n case 'non_object_property_call':\n case 'non_object_pr
operty_load':\n res = new NullPointerException();\n break;\n
case 'undefined_method':\n if (e.arguments[0] == 'call' || e.arguments[0]
== 'apply') {\n res = new ObjectNotClosureException();\n } else
{\n // TODO(jmesserly): can this ever happen?\n res = new NoS
uchMethodException('', e.arguments[0], []);\n }\n break;\n }\n
} else if (e instanceof RangeError) {\n if (e.message.indexOf('call stack')
>= 0) {\n res = new StackOverflowException();\n }\n }\n // TODO(jmesse
rly): setting the stack property is not a long term solution.\n // Also it caus
es the exception to print as if it were a TypeError or\n // RangeError, instead
of using the proper toString.\n res.stack = e.stack;\n return res;\n}"); | 11826 w.writeln("// Translate a JavaScript exception to a Dart exception\n// TODO(
jmesserly): cross browser support. This is Chrome specific.\nfunction $toDartExc
eption(e) {\n var res = e;\n if (e instanceof TypeError) {\n switch(e.type)
{\n case 'property_not_function':\n case 'called_non_callable':\n
if (e.arguments[0] == null) {\n res = new NullPointerException();\n
} else {\n res = new ObjectNotClosureException();\n }\n
break;\n case 'non_object_property_call':\n case 'non_object_pr
operty_load':\n res = new NullPointerException();\n break;\n
case 'undefined_method':\n if (e.arguments[0] == 'call' || e.arguments[0]
== 'apply') {\n res = new ObjectNotClosureException();\n } else
{\n // TODO(jmesserly): can this ever happen?\n res = new NoS
uchMethodException('', e.arguments[0], []);\n }\n break;\n }\n
} else if (e instanceof RangeError) {\n if (e.message.indexOf('call stack')
>= 0) {\n res = new StackOverflowException();\n }\n }\n // TODO(jmesse
rly): setting the stack property is not a long term solution.\n // Also it caus
es the exception to print as if it were a TypeError or\n // RangeError, instead
of using the proper toString.\n res.stack = e.stack;\n return res;\n}"); |
| 11790 } | 11827 } |
| 11791 if ($notnull_bool(this.useNotNullBool)) { | 11828 if ($notnull_bool(this.useNotNullBool)) { |
| 11792 this.useThrow = true; | 11829 this.useThrow = true; |
| 11793 w.writeln("function $notnull_bool(test) {\n return (test === true || test =
== false) ? test : test.is$bool();\n}"); | 11830 w.writeln("function $notnull_bool(test) {\n return (test === true || test =
== false) ? test : test.is$bool(); // TypeError\n}"); |
| 11794 } | 11831 } |
| 11795 if ($notnull_bool(this.useAssert)) { | 11832 if ($notnull_bool(this.useAssert)) { |
| 11796 this.useThrow = true; | 11833 this.useThrow = true; |
| 11797 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}"); | 11834 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}"); |
| 11798 } | 11835 } |
| 11799 if ($notnull_bool(this.useThrow)) { | 11836 if ($notnull_bool(this.useThrow)) { |
| 11800 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}"); | 11837 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}"); |
| 11801 } | 11838 } |
| 11802 if ($notnull_bool(this.useMap)) { | 11839 if ($notnull_bool(this.useMap)) { |
| 11803 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}"); | 11840 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}"); |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12446 initializedFields.add$1(f.get$name()); | 12483 initializedFields.add$1(f.get$name()); |
| 12447 } | 12484 } |
| 12448 } | 12485 } |
| 12449 } | 12486 } |
| 12450 } | 12487 } |
| 12451 this._paramCode = []; | 12488 this._paramCode = []; |
| 12452 var $list = this.method.get$parameters(); | 12489 var $list = this.method.get$parameters(); |
| 12453 for (var $i = 0;$i < $list.length; $i++) { | 12490 for (var $i = 0;$i < $list.length; $i++) { |
| 12454 var p = $list.$index($i); | 12491 var p = $list.$index($i); |
| 12455 if ($notnull_bool($ne(initializers, null) && p.isInitializer)) { | 12492 if ($notnull_bool($ne(initializers, null) && p.isInitializer)) { |
| 12456 var field = this.method.declaringType.getMember(p.get$name()); | 12493 var field = this.method.declaringType.getMember($assert_String(p.get$name(
))); |
| 12457 if ($notnull_bool(field == null)) { | 12494 if ($notnull_bool(field == null)) { |
| 12458 world.error('bad this parameter - no matching field', p.get$definition()
.get$span()); | 12495 world.error('bad this parameter - no matching field', p.get$definition()
.get$span()); |
| 12459 } | 12496 } |
| 12460 if (!$notnull_bool(field.get$isField())) { | 12497 if (!$notnull_bool(field.get$isField())) { |
| 12461 world.error(('"this.' + p.get$name() + '" does not refer to a field'), p
.get$definition().get$span()); | 12498 world.error(('"this.' + p.get$name() + '" does not refer to a field'), p
.get$definition().get$span()); |
| 12462 } | 12499 } |
| 12463 var paramValue = new Value(field.get$returnType(), p.get$name(), p.get$def
inition().get$span(), false); | 12500 var paramValue = new Value(field.get$returnType(), p.get$name(), p.get$def
inition().get$span(), false); |
| 12464 this._paramCode.add(paramValue.code); | 12501 this._paramCode.add(paramValue.code); |
| 12465 initializers.add$1(('this.' + field.get$jsname() + ' = ' + paramValue.code
+ ';')); | 12502 initializers.add$1(('this.' + field.get$jsname() + ' = ' + paramValue.code
+ ';')); |
| 12466 initializedFields.add$1(p.get$name()); | 12503 initializedFields.add$1(p.get$name()); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 12489 world.error('only one initializer redirecting call is allowed', init
.get$span()); | 12526 world.error('only one initializer redirecting call is allowed', init
.get$span()); |
| 12490 } | 12527 } |
| 12491 initializerCall = init; | 12528 initializerCall = init; |
| 12492 } | 12529 } |
| 12493 else if ((init instanceof BinaryExpression) && TokenKind.kindFromAssign(
init.op.kind) == 0) { | 12530 else if ((init instanceof BinaryExpression) && TokenKind.kindFromAssign(
init.op.kind) == 0) { |
| 12494 var left = init.x; | 12531 var left = init.x; |
| 12495 if (!((left instanceof DotExpression) && (left.self instanceof ThisExp
ression) || (left instanceof VarExpression))) { | 12532 if (!((left instanceof DotExpression) && (left.self instanceof ThisExp
ression) || (left instanceof VarExpression))) { |
| 12496 world.error('invalid left side of initializer', left.get$span()); | 12533 world.error('invalid left side of initializer', left.get$span()); |
| 12497 continue; | 12534 continue; |
| 12498 } | 12535 } |
| 12499 var f = this.method.declaringType.getMember(left.get$name().get$name()
); | 12536 var f = this.method.declaringType.getMember($assert_String(left.get$na
me().get$name())); |
| 12500 if ($notnull_bool(f == null)) { | 12537 if ($notnull_bool(f == null)) { |
| 12501 world.error('bad initializer - no matching field', left.get$span()); | 12538 world.error('bad initializer - no matching field', left.get$span()); |
| 12502 continue; | 12539 continue; |
| 12503 } | 12540 } |
| 12504 else if (!$notnull_bool(f.get$isField())) { | 12541 else if (!$notnull_bool(f.get$isField())) { |
| 12505 world.error(('"' + left.get$name().get$name() + '" does not refer to
a field'), left.get$span()); | 12542 world.error(('"' + left.get$name().get$name() + '" does not refer to
a field'), left.get$span()); |
| 12506 continue; | 12543 continue; |
| 12507 } | 12544 } |
| 12508 initializedFields.add$1(f.get$name()); | 12545 initializedFields.add$1(f.get$name()); |
| 12509 this.writer.writeln(('this.' + f.get$jsname() + ' = ' + this.visitValu
e(init.y).code + ';')); | 12546 this.writer.writeln(('this.' + f.get$jsname() + ' = ' + this.visitValu
e(init.y).code + ';')); |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13357 var constructorName = ''; | 13394 var constructorName = ''; |
| 13358 if (node.name != null) { | 13395 if (node.name != null) { |
| 13359 constructorName = node.name.name; | 13396 constructorName = node.name.name; |
| 13360 } | 13397 } |
| 13361 if ($notnull_bool($eq(constructorName, '') && !(typeRef instanceof GenericType
Reference)) && typeRef.names != null) { | 13398 if ($notnull_bool($eq(constructorName, '') && !(typeRef instanceof GenericType
Reference)) && typeRef.names != null) { |
| 13362 var names = ListFactory.ListFactory$from$factory(typeRef.names); | 13399 var names = ListFactory.ListFactory$from$factory(typeRef.names); |
| 13363 constructorName = names.removeLast$0().get$name(); | 13400 constructorName = names.removeLast$0().get$name(); |
| 13364 if (names.length == 0) names = null; | 13401 if (names.length == 0) names = null; |
| 13365 typeRef = new NameTypeReference(typeRef.isFinal, typeRef.get$name(), names,
typeRef.get$span()); | 13402 typeRef = new NameTypeReference(typeRef.isFinal, typeRef.get$name(), names,
typeRef.get$span()); |
| 13366 } | 13403 } |
| 13367 var type = this.method.resolveType(typeRef, true); | 13404 var type = this.method.resolveType((typeRef && typeRef.is$TypeReference()), tr
ue); |
| 13368 if ($notnull_bool(type.get$isTop())) { | 13405 if ($notnull_bool(type.get$isTop())) { |
| 13369 type = type.get$library().findTypeByName($assert_String(constructorName)); | 13406 type = type.get$library().findTypeByName($assert_String(constructorName)); |
| 13370 constructorName = ''; | 13407 constructorName = ''; |
| 13371 } | 13408 } |
| 13372 var m = type.getConstructor$1(constructorName); | 13409 var m = type.getConstructor$1(constructorName); |
| 13373 if ($notnull_bool(m == null)) { | 13410 if ($notnull_bool(m == null)) { |
| 13374 var name = type.get$jsname(); | 13411 var name = type.get$jsname(); |
| 13375 if ($notnull_bool(type.get$isVar())) { | 13412 if ($notnull_bool(type.get$isVar())) { |
| 13376 name = typeRef.get$name().get$name(); | 13413 name = typeRef.get$name().get$name(); |
| 13377 } | 13414 } |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13839 } | 13876 } |
| 13840 } | 13877 } |
| 13841 } | 13878 } |
| 13842 return (ret && ret.is$Member()); | 13879 return (ret && ret.is$Member()); |
| 13843 } | 13880 } |
| 13844 Library.prototype.resolve = function() { | 13881 Library.prototype.resolve = function() { |
| 13845 if (this.name == null) { | 13882 if (this.name == null) { |
| 13846 this.name = this.baseSource.filename; | 13883 this.name = this.baseSource.filename; |
| 13847 var index = this.name.lastIndexOf('/', this.name.length); | 13884 var index = this.name.lastIndexOf('/', this.name.length); |
| 13848 if (index >= 0) { | 13885 if (index >= 0) { |
| 13849 this.name = this.name.substring(index + 1); | 13886 this.name = this.name.substring($assert_num(index + 1)); |
| 13850 } | 13887 } |
| 13851 index = this.name.indexOf('.', 0); | 13888 index = this.name.indexOf('.', 0); |
| 13852 if (index > 0) { | 13889 if (index > 0) { |
| 13853 this.name = this.name.substring(0, index); | 13890 this.name = this.name.substring(0, $assert_num(index)); |
| 13854 } | 13891 } |
| 13855 } | 13892 } |
| 13856 var $list = this.types.getValues(); | 13893 var $list = this.types.getValues(); |
| 13857 for (var $i = this.types.getValues().iterator$0(); $i.hasNext$0(); ) { | 13894 for (var $i = this.types.getValues().iterator$0(); $i.hasNext$0(); ) { |
| 13858 var type = $i.next$0(); | 13895 var type = $i.next$0(); |
| 13859 type.resolve$0(); | 13896 type.resolve$0(); |
| 13860 } | 13897 } |
| 13861 } | 13898 } |
| 13862 Library.prototype.visitSources = function() { | 13899 Library.prototype.visitSources = function() { |
| 13863 var visitor = new _LibraryVisitor(this); | 13900 var visitor = new _LibraryVisitor(this); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 13890 _LibraryVisitor.prototype.get$library = function() { return this.library; }; | 13927 _LibraryVisitor.prototype.get$library = function() { return this.library; }; |
| 13891 _LibraryVisitor.prototype.get$isTop = function() { return this.isTop; }; | 13928 _LibraryVisitor.prototype.get$isTop = function() { return this.isTop; }; |
| 13892 _LibraryVisitor.prototype.set$isTop = function(value) { return this.isTop = valu
e; }; | 13929 _LibraryVisitor.prototype.set$isTop = function(value) { return this.isTop = valu
e; }; |
| 13893 _LibraryVisitor.prototype.addSourceFromName = function(name, span) { | 13930 _LibraryVisitor.prototype.addSourceFromName = function(name, span) { |
| 13894 var filename = this.library.makeFullPath(name); | 13931 var filename = this.library.makeFullPath(name); |
| 13895 if ($notnull_bool($eq(filename, this.library.baseSource.filename))) { | 13932 if ($notnull_bool($eq(filename, this.library.baseSource.filename))) { |
| 13896 world.error('library can not source itself', span); | 13933 world.error('library can not source itself', span); |
| 13897 return; | 13934 return; |
| 13898 } | 13935 } |
| 13899 else if (this.sources.some((function (s) { | 13936 else if (this.sources.some((function (s) { |
| 13900 return s.filename == filename; | 13937 return $eq(s.filename, filename); |
| 13901 }) | 13938 }) |
| 13902 )) { | 13939 )) { |
| 13903 world.error(('file "' + filename + '" has already been sourced'), span); | 13940 world.error(('file "' + filename + '" has already been sourced'), span); |
| 13904 return; | 13941 return; |
| 13905 } | 13942 } |
| 13906 var source = world.readFile(this.library.makeFullPath(name)); | 13943 var source = world.readFile(this.library.makeFullPath(name)); |
| 13907 this.sources.add(source); | 13944 this.sources.add(source); |
| 13908 } | 13945 } |
| 13909 _LibraryVisitor.prototype.addSource = function(source) { | 13946 _LibraryVisitor.prototype.addSource = function(source) { |
| 13910 var $this = this; // closure support | 13947 var $this = this; // closure support |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14075 function Parameter(definition) { | 14112 function Parameter(definition) { |
| 14076 this.isInitializer = false | 14113 this.isInitializer = false |
| 14077 this.definition = definition; | 14114 this.definition = definition; |
| 14078 // Initializers done | 14115 // Initializers done |
| 14079 } | 14116 } |
| 14080 Parameter.prototype.is$Parameter = function(){return this;}; | 14117 Parameter.prototype.is$Parameter = function(){return this;}; |
| 14081 Parameter.prototype.get$definition = function() { return this.definition; }; | 14118 Parameter.prototype.get$definition = function() { return this.definition; }; |
| 14082 Parameter.prototype.set$definition = function(value) { return this.definition =
value; }; | 14119 Parameter.prototype.set$definition = function(value) { return this.definition =
value; }; |
| 14083 Parameter.prototype.get$name = function() { return this.name; }; | 14120 Parameter.prototype.get$name = function() { return this.name; }; |
| 14084 Parameter.prototype.set$name = function(value) { return this.name = value; }; | 14121 Parameter.prototype.set$name = function(value) { return this.name = value; }; |
| 14122 Parameter.prototype.get$type = function() { return this.type; }; |
| 14123 Parameter.prototype.set$type = function(value) { return this.type = value; }; |
| 14085 Parameter.prototype.get$value = function() { return this.value; }; | 14124 Parameter.prototype.get$value = function() { return this.value; }; |
| 14086 Parameter.prototype.set$value = function(value) { return this.value = value; }; | 14125 Parameter.prototype.set$value = function(value) { return this.value = value; }; |
| 14087 Parameter.prototype.resolve = function(method, inType) { | 14126 Parameter.prototype.resolve = function(method, inType) { |
| 14088 this.name = this.definition.name.name; | 14127 this.name = this.definition.name.name; |
| 14089 if (this.name.startsWith('this.')) { | 14128 if (this.name.startsWith('this.')) { |
| 14090 this.name = this.name.substring(5); | 14129 this.name = this.name.substring(5); |
| 14091 this.isInitializer = true; | 14130 this.isInitializer = true; |
| 14092 } | 14131 } |
| 14093 this.type = inType.resolveType(this.definition.type, false); | 14132 this.type = inType.resolveType(this.definition.type, false); |
| 14094 if ($notnull_bool(method.get$isStatic() && this.type.get$hasTypeParams())) { | 14133 if ($notnull_bool(method.get$isStatic() && this.type.get$hasTypeParams())) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 14112 Parameter.prototype.genValue = function(method, context) { | 14151 Parameter.prototype.genValue = function(method, context) { |
| 14113 var $0; | 14152 var $0; |
| 14114 if (this.definition.value == null || this.value != null) return; | 14153 if (this.definition.value == null || this.value != null) return; |
| 14115 if (context == null) { | 14154 if (context == null) { |
| 14116 context = new MethodGenerator(method, null); | 14155 context = new MethodGenerator(method, null); |
| 14117 } | 14156 } |
| 14118 this.value = (($0 = this.definition.value.visit(context)) && $0.is$Value()); | 14157 this.value = (($0 = this.definition.value.visit(context)) && $0.is$Value()); |
| 14119 this.value = this.value.convertTo(context, this.type, this.definition.value, f
alse); | 14158 this.value = this.value.convertTo(context, this.type, this.definition.value, f
alse); |
| 14120 } | 14159 } |
| 14121 Parameter.prototype.copyWithNewType = function(newType) { | 14160 Parameter.prototype.copyWithNewType = function(newType) { |
| 14161 var $0; |
| 14122 var ret = new Parameter(this.definition); | 14162 var ret = new Parameter(this.definition); |
| 14123 ret.type = newType; | 14163 ret.set$type(newType); |
| 14124 ret.name = this.name; | 14164 ret.set$name(this.name); |
| 14125 ret.isInitializer = this.isInitializer; | 14165 ret.isInitializer = this.isInitializer; |
| 14126 return (ret && ret.is$Parameter()); | 14166 return (ret && ret.is$Parameter()); |
| 14127 } | 14167 } |
| 14128 Parameter.prototype.get$isOptional = function() { | 14168 Parameter.prototype.get$isOptional = function() { |
| 14129 return this.definition != null && this.definition.value != null; | 14169 return this.definition != null && this.definition.value != null; |
| 14130 } | 14170 } |
| 14131 Parameter.prototype.copyWithNewType$1 = function($0) { | 14171 Parameter.prototype.copyWithNewType$1 = function($0) { |
| 14132 return this.copyWithNewType(($0 && $0.is$lang_Type())); | 14172 return this.copyWithNewType(($0 && $0.is$lang_Type())); |
| 14133 }; | 14173 }; |
| 14134 Parameter.prototype.genValue$2 = function($0, $1) { | 14174 Parameter.prototype.genValue$2 = function($0, $1) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14220 Member.prototype.get$definition = function() { | 14260 Member.prototype.get$definition = function() { |
| 14221 return null; | 14261 return null; |
| 14222 } | 14262 } |
| 14223 Member.prototype.get$parameters = function() { | 14263 Member.prototype.get$parameters = function() { |
| 14224 return []; | 14264 return []; |
| 14225 } | 14265 } |
| 14226 Member.prototype.canInvoke = function(context, args) { | 14266 Member.prototype.canInvoke = function(context, args) { |
| 14227 return $notnull_bool(this.get$canGet() && new Value(this.get$returnType(), nul
l, null, true).canInvoke(context, '\$call', args)); | 14267 return $notnull_bool(this.get$canGet() && new Value(this.get$returnType(), nul
l, null, true).canInvoke(context, '\$call', args)); |
| 14228 } | 14268 } |
| 14229 Member.prototype.invoke = function(context, node, target, args, isDynamic) { | 14269 Member.prototype.invoke = function(context, node, target, args, isDynamic) { |
| 14270 var $0; |
| 14230 var newTarget = this._get(context, node, target, isDynamic); | 14271 var newTarget = this._get(context, node, target, isDynamic); |
| 14231 return newTarget.invoke$5(context, '\$call', node, args, isDynamic); | 14272 return (($0 = newTarget.invoke$5(context, '\$call', node, args, isDynamic)) &&
$0.is$Value()); |
| 14232 } | 14273 } |
| 14233 Member.prototype.override = function(other) { | 14274 Member.prototype.override = function(other) { |
| 14234 if ($notnull_bool(this.get$isStatic())) { | 14275 if ($notnull_bool(this.get$isStatic())) { |
| 14235 world.error('static members can not hide parent members', this.get$span(), o
ther.get$span()); | 14276 world.error('static members can not hide parent members', this.get$span(), o
ther.get$span()); |
| 14236 return false; | 14277 return false; |
| 14237 } | 14278 } |
| 14238 else if ($notnull_bool(other.get$isStatic())) { | 14279 else if ($notnull_bool(other.get$isStatic())) { |
| 14239 world.error('can not override static member', this.get$span(), other.get$spa
n()); | 14280 world.error('can not override static member', this.get$span(), other.get$spa
n()); |
| 14240 return false; | 14281 return false; |
| 14241 } | 14282 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14286 return this.resolve(($0 && $0.is$lang_Type())); | 14327 return this.resolve(($0 && $0.is$lang_Type())); |
| 14287 }; | 14328 }; |
| 14288 // ********** Code for TypeMember ************** | 14329 // ********** Code for TypeMember ************** |
| 14289 function TypeMember(type) { | 14330 function TypeMember(type) { |
| 14290 this.type = type; | 14331 this.type = type; |
| 14291 Member.call(this, type.name, type.library.topType); | 14332 Member.call(this, type.name, type.library.topType); |
| 14292 // Initializers done | 14333 // Initializers done |
| 14293 } | 14334 } |
| 14294 $inherits(TypeMember, Member); | 14335 $inherits(TypeMember, Member); |
| 14295 TypeMember.prototype.is$TypeMember = function(){return this;}; | 14336 TypeMember.prototype.is$TypeMember = function(){return this;}; |
| 14337 TypeMember.prototype.get$type = function() { return this.type; }; |
| 14296 TypeMember.prototype.get$span = function() { | 14338 TypeMember.prototype.get$span = function() { |
| 14297 return this.type.definition.span; | 14339 return this.type.definition.span; |
| 14298 } | 14340 } |
| 14299 TypeMember.prototype.get$isStatic = function() { | 14341 TypeMember.prototype.get$isStatic = function() { |
| 14300 return true; | 14342 return true; |
| 14301 } | 14343 } |
| 14302 TypeMember.prototype.get$returnType = function() { | 14344 TypeMember.prototype.get$returnType = function() { |
| 14303 return world.varType; | 14345 return world.varType; |
| 14304 } | 14346 } |
| 14305 TypeMember.prototype.canInvoke = function(context, args) { | 14347 TypeMember.prototype.canInvoke = function(context, args) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14353 this.definition = definition; | 14395 this.definition = definition; |
| 14354 this.value = value; | 14396 this.value = value; |
| 14355 this.isNative = false; | 14397 this.isNative = false; |
| 14356 Member.call(this, name, declaringType); | 14398 Member.call(this, name, declaringType); |
| 14357 // Initializers done | 14399 // Initializers done |
| 14358 } | 14400 } |
| 14359 $inherits(FieldMember, Member); | 14401 $inherits(FieldMember, Member); |
| 14360 FieldMember.prototype.is$FieldMember = function(){return this;}; | 14402 FieldMember.prototype.is$FieldMember = function(){return this;}; |
| 14361 FieldMember.prototype.get$definition = function() { return this.definition; }; | 14403 FieldMember.prototype.get$definition = function() { return this.definition; }; |
| 14362 FieldMember.prototype.get$value = function() { return this.value; }; | 14404 FieldMember.prototype.get$value = function() { return this.value; }; |
| 14405 FieldMember.prototype.get$type = function() { return this.type; }; |
| 14406 FieldMember.prototype.set$type = function(value) { return this.type = value; }; |
| 14363 FieldMember.prototype.get$isStatic = function() { return this.isStatic; }; | 14407 FieldMember.prototype.get$isStatic = function() { return this.isStatic; }; |
| 14364 FieldMember.prototype.set$isStatic = function(value) { return this.isStatic = va
lue; }; | 14408 FieldMember.prototype.set$isStatic = function(value) { return this.isStatic = va
lue; }; |
| 14365 FieldMember.prototype.get$isNative = function() { return this.isNative; }; | 14409 FieldMember.prototype.get$isNative = function() { return this.isNative; }; |
| 14366 FieldMember.prototype.set$isNative = function(value) { return this.isNative = va
lue; }; | 14410 FieldMember.prototype.set$isNative = function(value) { return this.isNative = va
lue; }; |
| 14367 FieldMember.prototype.override = function(other) { | 14411 FieldMember.prototype.override = function(other) { |
| 14368 if (!$notnull_bool(Member.prototype.override.call(this, other))) return false; | 14412 if (!$notnull_bool(Member.prototype.override.call(this, other))) return false; |
| 14369 if ($notnull_bool(other.get$isProperty())) { | 14413 if ($notnull_bool(other.get$isProperty())) { |
| 14370 return true; | 14414 return true; |
| 14371 } | 14415 } |
| 14372 else { | 14416 else { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14440 if (this.value == null) return null; | 14484 if (this.value == null) return null; |
| 14441 if (this._computedValue == null) { | 14485 if (this._computedValue == null) { |
| 14442 if ($notnull_bool(this._computing)) { | 14486 if ($notnull_bool(this._computing)) { |
| 14443 world.error('circular reference', this.value.span); | 14487 world.error('circular reference', this.value.span); |
| 14444 return null; | 14488 return null; |
| 14445 } | 14489 } |
| 14446 this._computing = true; | 14490 this._computing = true; |
| 14447 var finalMethod = new MethodMember('final_context', this.declaringType, null
); | 14491 var finalMethod = new MethodMember('final_context', this.declaringType, null
); |
| 14448 finalMethod.isStatic = true; | 14492 finalMethod.isStatic = true; |
| 14449 var finalGen = new MethodGenerator(finalMethod, null); | 14493 var finalGen = new MethodGenerator(finalMethod, null); |
| 14450 this._computedValue = (($0 = this.value.visit(finalGen)) && $0.is$Value()); | 14494 this._computedValue = (($0 = this.value.visit((finalGen && finalGen.is$TreeV
isitor()))) && $0.is$Value()); |
| 14451 if (!$notnull_bool(this._computedValue.get$isConst())) { | 14495 if (!$notnull_bool(this._computedValue.get$isConst())) { |
| 14452 if ($notnull_bool(this.isStatic)) { | 14496 if ($notnull_bool(this.isStatic)) { |
| 14453 world.error('non constant static field must be initialized in functions'
, this.value.span); | 14497 world.error('non constant static field must be initialized in functions'
, this.value.span); |
| 14454 } | 14498 } |
| 14455 else { | 14499 else { |
| 14456 world.error('non constant field must be initialized in constructor', thi
s.value.span); | 14500 world.error('non constant field must be initialized in constructor', thi
s.value.span); |
| 14457 } | 14501 } |
| 14458 } | 14502 } |
| 14459 if ($notnull_bool(this.isStatic)) { | 14503 if ($notnull_bool(this.isStatic)) { |
| 14460 this._computedValue = world.gen.globalForStaticField(this, this._computedV
alue, [this._computedValue]); | 14504 this._computedValue = world.gen.globalForStaticField(this, this._computedV
alue, [this._computedValue]); |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15113 value = this.parameters.$index(j).get$value(); | 15157 value = this.parameters.$index(j).get$value(); |
| 15114 } | 15158 } |
| 15115 } | 15159 } |
| 15116 this.generator._scope._vars.$setindex(name, value); | 15160 this.generator._scope._vars.$setindex(name, value); |
| 15117 } | 15161 } |
| 15118 var $list = this.definition.initializers; | 15162 var $list = this.definition.initializers; |
| 15119 for (var $i = 0;$i < $list.length; $i++) { | 15163 for (var $i = 0;$i < $list.length; $i++) { |
| 15120 var init = $list.$index($i); | 15164 var init = $list.$index($i); |
| 15121 if ((init instanceof CallExpression)) { | 15165 if ((init instanceof CallExpression)) { |
| 15122 var delegateArgs = this.generator._makeArgs((($0 = init.get$arguments())
&& $0.is$List$ArgumentNode())); | 15166 var delegateArgs = this.generator._makeArgs((($0 = init.get$arguments())
&& $0.is$List$ArgumentNode())); |
| 15123 var value = this.initDelegate.invoke(this.generator, node, target, deleg
ateArgs, false); | 15167 var value = this.initDelegate.invoke(this.generator, node, target, (dele
gateArgs && delegateArgs.is$Arguments()), false); |
| 15124 if ((init.target instanceof ThisExpression)) { | 15168 if ((init.target instanceof ThisExpression)) { |
| 15125 return (value && value.is$Value()); | 15169 return (value && value.is$Value()); |
| 15126 } | 15170 } |
| 15127 else { | 15171 else { |
| 15128 if ((value instanceof GlobalValue)) { | 15172 if ((value instanceof GlobalValue)) { |
| 15129 value = value.exp; | 15173 value = value.exp; |
| 15130 } | 15174 } |
| 15131 var $list0 = value.fields.getKeys(); | 15175 var $list0 = value.fields.getKeys(); |
| 15132 for (var $i0 = value.fields.getKeys().iterator$0(); $i0.hasNext$0(); )
{ | 15176 for (var $i0 = value.fields.getKeys().iterator$0(); $i0.hasNext$0(); )
{ |
| 15133 var fname = $i0.next$0(); | 15177 var fname = $i0.next$0(); |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15595 } | 15639 } |
| 15596 } | 15640 } |
| 15597 return returnValue; | 15641 return returnValue; |
| 15598 } | 15642 } |
| 15599 MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) { | 15643 MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) { |
| 15600 var $0; | 15644 var $0; |
| 15601 if ($notnull_bool(this.isVar && !$notnull_bool(this.get$isOperator()))) { | 15645 if ($notnull_bool(this.isVar && !$notnull_bool(this.get$isOperator()))) { |
| 15602 return this.invokeOnVar(context, node, target, args); | 15646 return this.invokeOnVar(context, node, target, args); |
| 15603 } | 15647 } |
| 15604 if (this.members.length == 1) { | 15648 if (this.members.length == 1) { |
| 15605 return this.members.$index(0).invoke$5(context, node, target, args, isDynami
c); | 15649 return (($0 = this.members.$index(0).invoke$5(context, node, target, args, i
sDynamic)) && $0.is$Value()); |
| 15606 } | 15650 } |
| 15607 var targets = this.members.filter((function (m) { | 15651 var targets = this.members.filter((function (m) { |
| 15608 return m.canInvoke$2(context, args); | 15652 return m.canInvoke$2(context, args); |
| 15609 }) | 15653 }) |
| 15610 ); | 15654 ); |
| 15611 if (targets.length == 1) { | 15655 if (targets.length == 1) { |
| 15612 return (($0 = targets.$index(0).invoke$5(context, node, target, args, isDyna
mic)) && $0.is$Value()); | 15656 return (($0 = targets.$index(0).invoke$5(context, node, target, args, isDyna
mic)) && $0.is$Value()); |
| 15613 } | 15657 } |
| 15614 var returnValue = null; | 15658 var returnValue = null; |
| 15615 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) { | 15659 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) { |
| 15616 var member = $i.next$0(); | 15660 var member = $i.next$0(); |
| 15617 var res = member.invoke$4$isDynamic(context, node, target, args, true); | 15661 var res = member.invoke$4$isDynamic(context, node, target, args, true); |
| 15618 returnValue = this._tryUnion(returnValue, res, node); | 15662 returnValue = this._tryUnion(returnValue, (res && res.is$Value()), node); |
| 15619 } | 15663 } |
| 15620 if (returnValue == null) { | 15664 if (returnValue == null) { |
| 15621 return this._makeError(node, target, 'method'); | 15665 return this._makeError(node, target, 'method'); |
| 15622 } | 15666 } |
| 15623 if (returnValue.code == null) { | 15667 if (returnValue.code == null) { |
| 15624 if ($notnull_bool(this.get$isOperator())) { | 15668 if ($notnull_bool(this.get$isOperator())) { |
| 15625 return target.invokeSpecial(this.name, args, returnValue.type); | 15669 return target.invokeSpecial(this.name, args, returnValue.type); |
| 15626 } | 15670 } |
| 15627 else { | 15671 else { |
| 15628 return this.invokeOnVar(context, node, target, args); | 15672 return this.invokeOnVar(context, node, target, args); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15772 SourceFile.prototype.is$SourceFile = function(){return this;}; | 15816 SourceFile.prototype.is$SourceFile = function(){return this;}; |
| 15773 SourceFile.prototype.is$Comparable = function(){return this;}; | 15817 SourceFile.prototype.is$Comparable = function(){return this;}; |
| 15774 SourceFile.prototype.get$text = function() { | 15818 SourceFile.prototype.get$text = function() { |
| 15775 return this._text; | 15819 return this._text; |
| 15776 } | 15820 } |
| 15777 SourceFile.prototype.get$lineStarts = function() { | 15821 SourceFile.prototype.get$lineStarts = function() { |
| 15778 if (this._lineStarts == null) { | 15822 if (this._lineStarts == null) { |
| 15779 var starts = [0]; | 15823 var starts = [0]; |
| 15780 var index = 0; | 15824 var index = 0; |
| 15781 while (index < this.get$text().length) { | 15825 while (index < this.get$text().length) { |
| 15782 index = this.get$text().indexOf('\n', index) + 1; | 15826 index = this.get$text().indexOf('\n', $assert_num(index)) + 1; |
| 15783 if (index <= 0) break; | 15827 if (index <= 0) break; |
| 15784 starts.add$1(index); | 15828 starts.add$1(index); |
| 15785 } | 15829 } |
| 15786 starts.add$1(this.get$text().length + 1); | 15830 starts.add$1(this.get$text().length + 1); |
| 15787 this._lineStarts = (starts && starts.is$List$int()); | 15831 this._lineStarts = (starts && starts.is$List$int()); |
| 15788 } | 15832 } |
| 15789 return this._lineStarts; | 15833 return this._lineStarts; |
| 15790 } | 15834 } |
| 15791 SourceFile.prototype.getLine = function(position) { | 15835 SourceFile.prototype.getLine = function(position) { |
| 15792 var starts = this.get$lineStarts(); | 15836 var starts = this.get$lineStarts(); |
| 15793 for (var i = 0; | 15837 for (var i = 0; |
| 15794 i < starts.length; i++) { | 15838 i < starts.length; i++) { |
| 15795 if (starts.$index(i) > position) return i - 1; | 15839 if (starts.$index(i) > position) return i - 1; |
| 15796 } | 15840 } |
| 15797 world.internalError('bad position'); | 15841 world.internalError('bad position'); |
| 15798 } | 15842 } |
| 15799 SourceFile.prototype.getColumn = function(line, position) { | 15843 SourceFile.prototype.getColumn = function(line, position) { |
| 15800 return position - $assert_num(this.get$lineStarts().$index(line)); | 15844 return position - $assert_num(this.get$lineStarts().$index(line)); |
| 15801 } | 15845 } |
| 15802 SourceFile.prototype.getLocationMessage = function(message, start, end, includeT
ext) { | 15846 SourceFile.prototype.getLocationMessage = function(message, start, end, includeT
ext) { |
| 15803 var line = this.getLine(start); | 15847 var line = this.getLine(start); |
| 15804 var column = this.getColumn($assert_num(line), start); | 15848 var column = this.getColumn($assert_num(line), start); |
| 15805 var buf = new StringBufferImpl(('' + this.filename + ':' + (line + 1) + ':' +
(column + 1) + ': ' + message + '')); | 15849 var buf = new StringBufferImpl(('' + this.filename + ':' + (line + 1) + ':' +
(column + 1) + ': ' + message + '')); |
| 15806 if ($notnull_bool(includeText)) { | 15850 if ($notnull_bool(includeText)) { |
| 15807 buf.add$1('\n'); | 15851 buf.add$1('\n'); |
| 15808 var textLine; | 15852 var textLine; |
| 15809 if ((line + 2) < this._lineStarts.length) { | 15853 if ((line + 2) < this._lineStarts.length) { |
| 15810 textLine = this.get$text().substring(this._lineStarts.$index(line), this._
lineStarts.$index(line + 1)); | 15854 textLine = this.get$text().substring($assert_num(this._lineStarts.$index(l
ine)), $assert_num(this._lineStarts.$index(line + 1))); |
| 15811 } | 15855 } |
| 15812 else { | 15856 else { |
| 15813 textLine = this.get$text().substring(this._lineStarts.$index(line)) + '\n'
; | 15857 textLine = this.get$text().substring($assert_num(this._lineStarts.$index(l
ine))) + '\n'; |
| 15814 } | 15858 } |
| 15815 buf.add$1(textLine); | 15859 buf.add$1(textLine); |
| 15816 var i = 0; | 15860 var i = 0; |
| 15817 for (; i < $assert_num(column); i++) { | 15861 for (; i < $assert_num(column); i++) { |
| 15818 buf.add$1(' '); | 15862 buf.add$1(' '); |
| 15819 } | 15863 } |
| 15820 var toColumn = Math.min($assert_num(column + (end - start)), textLine.length
); | 15864 var toColumn = Math.min($assert_num(column + (end - start)), textLine.length
); |
| 15821 for (; i < toColumn; i++) { | 15865 for (; i < toColumn; i++) { |
| 15822 buf.add$1('^'); | 15866 buf.add$1('^'); |
| 15823 } | 15867 } |
| (...skipping 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17802 values.add$1(this.expression()); | 17846 values.add$1(this.expression()); |
| 17803 } | 17847 } |
| 17804 else { | 17848 else { |
| 17805 values.add$1(); | 17849 values.add$1(); |
| 17806 } | 17850 } |
| 17807 } | 17851 } |
| 17808 this._eatSemicolon(); | 17852 this._eatSemicolon(); |
| 17809 return new VariableDefinition(modifiers, type, names, values, this._makeSpan($
assert_num(start))); | 17853 return new VariableDefinition(modifiers, type, names, values, this._makeSpan($
assert_num(start))); |
| 17810 } | 17854 } |
| 17811 lang_Parser.prototype.finishDefinition = function(start, modifiers, di) { | 17855 lang_Parser.prototype.finishDefinition = function(start, modifiers, di) { |
| 17856 var $0; |
| 17812 switch (this._peek()) { | 17857 switch (this._peek()) { |
| 17813 case 2/*TokenKind.LPAREN*/: | 17858 case 2/*TokenKind.LPAREN*/: |
| 17814 | 17859 |
| 17815 var formals = this.formalParameterList(); | 17860 var formals = this.formalParameterList(); |
| 17816 var inits = null; | 17861 var inits = null; |
| 17817 if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) { | 17862 if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) { |
| 17818 inits = this.initializers(); | 17863 inits = this.initializers(); |
| 17819 } | 17864 } |
| 17820 var body = this.functionBody(false); | 17865 var body = this.functionBody(false); |
| 17821 if ($notnull_bool(di.get$name() == null)) { | 17866 if ($notnull_bool(di.get$name() == null)) { |
| 17822 di.name = di.type.get$name(); | 17867 di.set$name(di.type.get$name()); |
| 17823 } | 17868 } |
| 17824 return new FunctionDefinition(modifiers, di.type, di.get$name(), formals,
inits, body, this._makeSpan($assert_num(start))); | 17869 return new FunctionDefinition(modifiers, di.type, di.get$name(), formals,
inits, body, this._makeSpan($assert_num(start))); |
| 17825 | 17870 |
| 17826 case 20/*TokenKind.ASSIGN*/: | 17871 case 20/*TokenKind.ASSIGN*/: |
| 17827 | 17872 |
| 17828 this._eat(20/*TokenKind.ASSIGN*/); | 17873 this._eat(20/*TokenKind.ASSIGN*/); |
| 17829 var value = this.expression(); | 17874 var value = this.expression(); |
| 17830 return this.finishField(start, modifiers, di.type, di.get$name(), value); | 17875 return this.finishField(start, modifiers, di.type, di.get$name(), value); |
| 17831 | 17876 |
| 17832 case 11/*TokenKind.COMMA*/: | 17877 case 11/*TokenKind.COMMA*/: |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18534 lang_Parser.prototype.stringInterpolation = function() { | 18579 lang_Parser.prototype.stringInterpolation = function() { |
| 18535 var start = this._peekToken.start; | 18580 var start = this._peekToken.start; |
| 18536 var lits = []; | 18581 var lits = []; |
| 18537 var startQuote = null, endQuote = null; | 18582 var startQuote = null, endQuote = null; |
| 18538 while ($notnull_bool(this._peekKind(66/*TokenKind.INCOMPLETE_STRING*/))) { | 18583 while ($notnull_bool(this._peekKind(66/*TokenKind.INCOMPLETE_STRING*/))) { |
| 18539 var token = this._lang_next(); | 18584 var token = this._lang_next(); |
| 18540 var text = token.get$text(); | 18585 var text = token.get$text(); |
| 18541 if ($notnull_bool(startQuote == null)) { | 18586 if ($notnull_bool(startQuote == null)) { |
| 18542 if ($notnull_bool(isMultilineString($assert_String(text)))) { | 18587 if ($notnull_bool(isMultilineString($assert_String(text)))) { |
| 18543 endQuote = text.substring$2(0, 3); | 18588 endQuote = text.substring$2(0, 3); |
| 18544 startQuote = endQuote + '\n'; | 18589 startQuote = $add(endQuote, '\n'); |
| 18545 } | 18590 } |
| 18546 else { | 18591 else { |
| 18547 startQuote = endQuote = text.$index(0); | 18592 startQuote = endQuote = text.$index(0); |
| 18548 } | 18593 } |
| 18549 text = text.substring$2(0, text.length - 1) + endQuote; | 18594 text = $add(text.substring$2(0, text.length - 1), endQuote); |
| 18550 } | 18595 } |
| 18551 else { | 18596 else { |
| 18552 text = startQuote + text.substring$2(0, text.length - 1) + endQuote; | 18597 text = $add($add(startQuote, text.substring$2(0, text.length - 1)), endQuo
te); |
| 18553 } | 18598 } |
| 18554 lits.add$1(this.makeStringLiteral($assert_String(text), token.get$span())); | 18599 lits.add$1(this.makeStringLiteral($assert_String(text), token.get$span())); |
| 18555 if ($notnull_bool(this._maybeEat(6/*TokenKind.LBRACE*/))) { | 18600 if ($notnull_bool(this._maybeEat(6/*TokenKind.LBRACE*/))) { |
| 18556 lits.add$1(this.expression()); | 18601 lits.add$1(this.expression()); |
| 18557 this._eat(7/*TokenKind.RBRACE*/); | 18602 this._eat(7/*TokenKind.RBRACE*/); |
| 18558 } | 18603 } |
| 18559 else { | 18604 else { |
| 18560 var id = this.identifier(); | 18605 var id = this.identifier(); |
| 18561 lits.add$1(new VarExpression(id, id.get$span())); | 18606 lits.add$1(new VarExpression(id, id.get$span())); |
| 18562 } | 18607 } |
| 18563 } | 18608 } |
| 18564 var tok = this._lang_next(); | 18609 var tok = this._lang_next(); |
| 18565 if ($notnull_bool($ne(tok.kind, 58/*TokenKind.STRING*/))) { | 18610 if ($notnull_bool($ne(tok.kind, 58/*TokenKind.STRING*/))) { |
| 18566 this._errorExpected('interpolated string'); | 18611 this._errorExpected('interpolated string'); |
| 18567 } | 18612 } |
| 18568 var text = startQuote + tok.get$text(); | 18613 var text = $add(startQuote, tok.get$text()); |
| 18569 lits.add$1(this.makeStringLiteral($assert_String(text), tok.get$span())); | 18614 lits.add$1(this.makeStringLiteral($assert_String(text), tok.get$span())); |
| 18570 var span = this._makeSpan(start); | 18615 var span = this._makeSpan(start); |
| 18571 return new LiteralExpression(lits, this._stringTypeRef((span && span.is$Source
Span())), '\$\$\$', (span && span.is$SourceSpan())); | 18616 return new LiteralExpression(lits, this._stringTypeRef((span && span.is$Source
Span())), '\$\$\$', (span && span.is$SourceSpan())); |
| 18572 } | 18617 } |
| 18573 lang_Parser.prototype.makeStringLiteral = function(text, span) { | 18618 lang_Parser.prototype.makeStringLiteral = function(text, span) { |
| 18574 return new LiteralExpression(text, this._stringTypeRef(span), text, span); | 18619 return new LiteralExpression(text, this._stringTypeRef(span), text, span); |
| 18575 } | 18620 } |
| 18576 lang_Parser.prototype.stringLiteralExpr = function() { | 18621 lang_Parser.prototype.stringLiteralExpr = function() { |
| 18577 var token = this._lang_next(); | 18622 var token = this._lang_next(); |
| 18578 return this.makeStringLiteral(token.get$text(), token.get$span()); | 18623 return this.makeStringLiteral(token.get$text(), token.get$span()); |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18914 names.add$1(this.identifier()); | 18959 names.add$1(this.identifier()); |
| 18915 } | 18960 } |
| 18916 var typeRef = new NameTypeReference(isFinal, name, names, this._makeSpan(start
)); | 18961 var typeRef = new NameTypeReference(isFinal, name, names, this._makeSpan(start
)); |
| 18917 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) { | 18962 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) { |
| 18918 return this.addTypeArguments((typeRef && typeRef.is$TypeReference()), depth)
; | 18963 return this.addTypeArguments((typeRef && typeRef.is$TypeReference()), depth)
; |
| 18919 } | 18964 } |
| 18920 else { | 18965 else { |
| 18921 return typeRef; | 18966 return typeRef; |
| 18922 } | 18967 } |
| 18923 } | 18968 } |
| 18969 lang_Parser.prototype.get$type = function() { |
| 18970 return lang_Parser.prototype.type.bind(this); |
| 18971 } |
| 18924 lang_Parser.prototype.formalParameter = function(inOptionalBlock) { | 18972 lang_Parser.prototype.formalParameter = function(inOptionalBlock) { |
| 18925 var start = this._peekToken.start; | 18973 var start = this._peekToken.start; |
| 18926 var isThis = false; | 18974 var isThis = false; |
| 18927 var isRest = false; | 18975 var isRest = false; |
| 18928 var di = this.declaredIdentifier(false); | 18976 var di = this.declaredIdentifier(false); |
| 18929 var type = di.type; | 18977 var type = di.type; |
| 18930 var name = di.get$name(); | 18978 var name = di.get$name(); |
| 18931 var value = null; | 18979 var value = null; |
| 18932 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { | 18980 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { |
| 18933 if (!$notnull_bool(inOptionalBlock)) { | 18981 if (!$notnull_bool(inOptionalBlock)) { |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19162 $inherits(lang_Expression, lang_Node); | 19210 $inherits(lang_Expression, lang_Node); |
| 19163 lang_Expression.prototype.is$lang_Expression = function(){return this;}; | 19211 lang_Expression.prototype.is$lang_Expression = function(){return this;}; |
| 19164 // ********** Code for TypeReference ************** | 19212 // ********** Code for TypeReference ************** |
| 19165 function TypeReference(span, type) { | 19213 function TypeReference(span, type) { |
| 19166 this.type = type; | 19214 this.type = type; |
| 19167 lang_Node.call(this, span); | 19215 lang_Node.call(this, span); |
| 19168 // Initializers done | 19216 // Initializers done |
| 19169 } | 19217 } |
| 19170 $inherits(TypeReference, lang_Node); | 19218 $inherits(TypeReference, lang_Node); |
| 19171 TypeReference.prototype.is$TypeReference = function(){return this;}; | 19219 TypeReference.prototype.is$TypeReference = function(){return this;}; |
| 19220 TypeReference.prototype.get$type = function() { return this.type; }; |
| 19221 TypeReference.prototype.set$type = function(value) { return this.type = value; }
; |
| 19172 TypeReference.prototype.visit = function(visitor) { | 19222 TypeReference.prototype.visit = function(visitor) { |
| 19173 return visitor.visitTypeReference(this); | 19223 return visitor.visitTypeReference(this); |
| 19174 } | 19224 } |
| 19175 TypeReference.prototype.visit$1 = function($0) { | 19225 TypeReference.prototype.visit$1 = function($0) { |
| 19176 return this.visit(($0 && $0.is$TreeVisitor())); | 19226 return this.visit(($0 && $0.is$TreeVisitor())); |
| 19177 }; | 19227 }; |
| 19178 // ********** Code for DirectiveDefinition ************** | 19228 // ********** Code for DirectiveDefinition ************** |
| 19179 function DirectiveDefinition(name, arguments, span) { | 19229 function DirectiveDefinition(name, arguments, span) { |
| 19180 this.name = name; | 19230 this.name = name; |
| 19181 this.arguments = arguments; | 19231 this.arguments = arguments; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19241 // ********** Code for VariableDefinition ************** | 19291 // ********** Code for VariableDefinition ************** |
| 19242 function VariableDefinition(modifiers, type, names, values, span) { | 19292 function VariableDefinition(modifiers, type, names, values, span) { |
| 19243 this.modifiers = modifiers; | 19293 this.modifiers = modifiers; |
| 19244 this.type = type; | 19294 this.type = type; |
| 19245 this.names = names; | 19295 this.names = names; |
| 19246 this.values = values; | 19296 this.values = values; |
| 19247 Definition.call(this, span); | 19297 Definition.call(this, span); |
| 19248 // Initializers done | 19298 // Initializers done |
| 19249 } | 19299 } |
| 19250 $inherits(VariableDefinition, Definition); | 19300 $inherits(VariableDefinition, Definition); |
| 19301 VariableDefinition.prototype.get$type = function() { return this.type; }; |
| 19302 VariableDefinition.prototype.set$type = function(value) { return this.type = val
ue; }; |
| 19251 VariableDefinition.prototype.visit = function(visitor) { | 19303 VariableDefinition.prototype.visit = function(visitor) { |
| 19252 return visitor.visitVariableDefinition(this); | 19304 return visitor.visitVariableDefinition(this); |
| 19253 } | 19305 } |
| 19254 VariableDefinition.prototype.visit$1 = function($0) { | 19306 VariableDefinition.prototype.visit$1 = function($0) { |
| 19255 return this.visit(($0 && $0.is$TreeVisitor())); | 19307 return this.visit(($0 && $0.is$TreeVisitor())); |
| 19256 }; | 19308 }; |
| 19257 // ********** Code for FunctionDefinition ************** | 19309 // ********** Code for FunctionDefinition ************** |
| 19258 function FunctionDefinition(modifiers, returnType, name, formals, initializers,
body, span) { | 19310 function FunctionDefinition(modifiers, returnType, name, formals, initializers,
body, span) { |
| 19259 this.modifiers = modifiers; | 19311 this.modifiers = modifiers; |
| 19260 this.returnType = returnType; | 19312 this.returnType = returnType; |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19625 this.isConst = isConst; | 19677 this.isConst = isConst; |
| 19626 this.type = type; | 19678 this.type = type; |
| 19627 this.name = name; | 19679 this.name = name; |
| 19628 this.arguments = arguments; | 19680 this.arguments = arguments; |
| 19629 lang_Expression.call(this, span); | 19681 lang_Expression.call(this, span); |
| 19630 // Initializers done | 19682 // Initializers done |
| 19631 } | 19683 } |
| 19632 $inherits(lang_NewExpression, lang_Expression); | 19684 $inherits(lang_NewExpression, lang_Expression); |
| 19633 lang_NewExpression.prototype.get$isConst = function() { return this.isConst; }; | 19685 lang_NewExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 19634 lang_NewExpression.prototype.set$isConst = function(value) { return this.isConst
= value; }; | 19686 lang_NewExpression.prototype.set$isConst = function(value) { return this.isConst
= value; }; |
| 19687 lang_NewExpression.prototype.get$type = function() { return this.type; }; |
| 19688 lang_NewExpression.prototype.set$type = function(value) { return this.type = val
ue; }; |
| 19635 lang_NewExpression.prototype.get$name = function() { return this.name; }; | 19689 lang_NewExpression.prototype.get$name = function() { return this.name; }; |
| 19636 lang_NewExpression.prototype.set$name = function(value) { return this.name = val
ue; }; | 19690 lang_NewExpression.prototype.set$name = function(value) { return this.name = val
ue; }; |
| 19637 lang_NewExpression.prototype.get$arguments = function() { return this.arguments;
}; | 19691 lang_NewExpression.prototype.get$arguments = function() { return this.arguments;
}; |
| 19638 lang_NewExpression.prototype.set$arguments = function(value) { return this.argum
ents = value; }; | 19692 lang_NewExpression.prototype.set$arguments = function(value) { return this.argum
ents = value; }; |
| 19639 lang_NewExpression.prototype.visit = function(visitor) { | 19693 lang_NewExpression.prototype.visit = function(visitor) { |
| 19640 return visitor.visitNewExpression(this); | 19694 return visitor.visitNewExpression(this); |
| 19641 } | 19695 } |
| 19642 lang_NewExpression.prototype.visit$1 = function($0) { | 19696 lang_NewExpression.prototype.visit$1 = function($0) { |
| 19643 return this.visit(($0 && $0.is$TreeVisitor())); | 19697 return this.visit(($0 && $0.is$TreeVisitor())); |
| 19644 }; | 19698 }; |
| 19645 // ********** Code for ListExpression ************** | 19699 // ********** Code for ListExpression ************** |
| 19646 function ListExpression(isConst, type, values, span) { | 19700 function ListExpression(isConst, type, values, span) { |
| 19647 this.isConst = isConst; | 19701 this.isConst = isConst; |
| 19648 this.type = type; | 19702 this.type = type; |
| 19649 this.values = values; | 19703 this.values = values; |
| 19650 lang_Expression.call(this, span); | 19704 lang_Expression.call(this, span); |
| 19651 // Initializers done | 19705 // Initializers done |
| 19652 } | 19706 } |
| 19653 $inherits(ListExpression, lang_Expression); | 19707 $inherits(ListExpression, lang_Expression); |
| 19654 ListExpression.prototype.get$isConst = function() { return this.isConst; }; | 19708 ListExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 19655 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v
alue; }; | 19709 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v
alue; }; |
| 19710 ListExpression.prototype.get$type = function() { return this.type; }; |
| 19711 ListExpression.prototype.set$type = function(value) { return this.type = value;
}; |
| 19656 ListExpression.prototype.visit = function(visitor) { | 19712 ListExpression.prototype.visit = function(visitor) { |
| 19657 return visitor.visitListExpression(this); | 19713 return visitor.visitListExpression(this); |
| 19658 } | 19714 } |
| 19659 ListExpression.prototype.visit$1 = function($0) { | 19715 ListExpression.prototype.visit$1 = function($0) { |
| 19660 return this.visit(($0 && $0.is$TreeVisitor())); | 19716 return this.visit(($0 && $0.is$TreeVisitor())); |
| 19661 }; | 19717 }; |
| 19662 // ********** Code for MapExpression ************** | 19718 // ********** Code for MapExpression ************** |
| 19663 function MapExpression(isConst, type, items, span) { | 19719 function MapExpression(isConst, type, items, span) { |
| 19664 this.isConst = isConst; | 19720 this.isConst = isConst; |
| 19665 this.type = type; | 19721 this.type = type; |
| 19666 this.items = items; | 19722 this.items = items; |
| 19667 lang_Expression.call(this, span); | 19723 lang_Expression.call(this, span); |
| 19668 // Initializers done | 19724 // Initializers done |
| 19669 } | 19725 } |
| 19670 $inherits(MapExpression, lang_Expression); | 19726 $inherits(MapExpression, lang_Expression); |
| 19671 MapExpression.prototype.get$isConst = function() { return this.isConst; }; | 19727 MapExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 19672 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; | 19728 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; |
| 19729 MapExpression.prototype.get$type = function() { return this.type; }; |
| 19730 MapExpression.prototype.set$type = function(value) { return this.type = value; }
; |
| 19673 MapExpression.prototype.visit = function(visitor) { | 19731 MapExpression.prototype.visit = function(visitor) { |
| 19674 return visitor.visitMapExpression(this); | 19732 return visitor.visitMapExpression(this); |
| 19675 } | 19733 } |
| 19676 MapExpression.prototype.visit$1 = function($0) { | 19734 MapExpression.prototype.visit$1 = function($0) { |
| 19677 return this.visit(($0 && $0.is$TreeVisitor())); | 19735 return this.visit(($0 && $0.is$TreeVisitor())); |
| 19678 }; | 19736 }; |
| 19679 // ********** Code for ConditionalExpression ************** | 19737 // ********** Code for ConditionalExpression ************** |
| 19680 function ConditionalExpression(test, trueBranch, falseBranch, span) { | 19738 function ConditionalExpression(test, trueBranch, falseBranch, span) { |
| 19681 this.test = test; | 19739 this.test = test; |
| 19682 this.trueBranch = trueBranch; | 19740 this.trueBranch = trueBranch; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 19693 }; | 19751 }; |
| 19694 // ********** Code for IsExpression ************** | 19752 // ********** Code for IsExpression ************** |
| 19695 function IsExpression(isTrue, x, type, span) { | 19753 function IsExpression(isTrue, x, type, span) { |
| 19696 this.isTrue = isTrue; | 19754 this.isTrue = isTrue; |
| 19697 this.x = x; | 19755 this.x = x; |
| 19698 this.type = type; | 19756 this.type = type; |
| 19699 lang_Expression.call(this, span); | 19757 lang_Expression.call(this, span); |
| 19700 // Initializers done | 19758 // Initializers done |
| 19701 } | 19759 } |
| 19702 $inherits(IsExpression, lang_Expression); | 19760 $inherits(IsExpression, lang_Expression); |
| 19761 IsExpression.prototype.get$type = function() { return this.type; }; |
| 19762 IsExpression.prototype.set$type = function(value) { return this.type = value; }; |
| 19703 IsExpression.prototype.visit = function(visitor) { | 19763 IsExpression.prototype.visit = function(visitor) { |
| 19704 return visitor.visitIsExpression(this); | 19764 return visitor.visitIsExpression(this); |
| 19705 } | 19765 } |
| 19706 IsExpression.prototype.visit$1 = function($0) { | 19766 IsExpression.prototype.visit$1 = function($0) { |
| 19707 return this.visit(($0 && $0.is$TreeVisitor())); | 19767 return this.visit(($0 && $0.is$TreeVisitor())); |
| 19708 }; | 19768 }; |
| 19709 // ********** Code for ParenExpression ************** | 19769 // ********** Code for ParenExpression ************** |
| 19710 function ParenExpression(body, span) { | 19770 function ParenExpression(body, span) { |
| 19711 this.body = body; | 19771 this.body = body; |
| 19712 lang_Expression.call(this, span); | 19772 lang_Expression.call(this, span); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19792 function LiteralExpression(value, type, text, span) { | 19852 function LiteralExpression(value, type, text, span) { |
| 19793 this.value = value; | 19853 this.value = value; |
| 19794 this.type = type; | 19854 this.type = type; |
| 19795 this.text = text; | 19855 this.text = text; |
| 19796 lang_Expression.call(this, span); | 19856 lang_Expression.call(this, span); |
| 19797 // Initializers done | 19857 // Initializers done |
| 19798 } | 19858 } |
| 19799 $inherits(LiteralExpression, lang_Expression); | 19859 $inherits(LiteralExpression, lang_Expression); |
| 19800 LiteralExpression.prototype.get$value = function() { return this.value; }; | 19860 LiteralExpression.prototype.get$value = function() { return this.value; }; |
| 19801 LiteralExpression.prototype.set$value = function(value) { return this.value = va
lue; }; | 19861 LiteralExpression.prototype.set$value = function(value) { return this.value = va
lue; }; |
| 19862 LiteralExpression.prototype.get$type = function() { return this.type; }; |
| 19863 LiteralExpression.prototype.set$type = function(value) { return this.type = valu
e; }; |
| 19802 LiteralExpression.prototype.get$text = function() { return this.text; }; | 19864 LiteralExpression.prototype.get$text = function() { return this.text; }; |
| 19803 LiteralExpression.prototype.set$text = function(value) { return this.text = valu
e; }; | 19865 LiteralExpression.prototype.set$text = function(value) { return this.text = valu
e; }; |
| 19804 LiteralExpression.prototype.visit = function(visitor) { | 19866 LiteralExpression.prototype.visit = function(visitor) { |
| 19805 return visitor.visitLiteralExpression(this); | 19867 return visitor.visitLiteralExpression(this); |
| 19806 } | 19868 } |
| 19807 LiteralExpression.prototype.visit$1 = function($0) { | 19869 LiteralExpression.prototype.visit$1 = function($0) { |
| 19808 return this.visit(($0 && $0.is$TreeVisitor())); | 19870 return this.visit(($0 && $0.is$TreeVisitor())); |
| 19809 }; | 19871 }; |
| 19810 // ********** Code for NameTypeReference ************** | 19872 // ********** Code for NameTypeReference ************** |
| 19811 function NameTypeReference(isFinal, name, names, span) { | 19873 function NameTypeReference(isFinal, name, names, span) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19877 function FormalNode(isThis, isRest, type, name, value, span) { | 19939 function FormalNode(isThis, isRest, type, name, value, span) { |
| 19878 this.isThis = isThis; | 19940 this.isThis = isThis; |
| 19879 this.isRest = isRest; | 19941 this.isRest = isRest; |
| 19880 this.type = type; | 19942 this.type = type; |
| 19881 this.name = name; | 19943 this.name = name; |
| 19882 this.value = value; | 19944 this.value = value; |
| 19883 lang_Node.call(this, span); | 19945 lang_Node.call(this, span); |
| 19884 // Initializers done | 19946 // Initializers done |
| 19885 } | 19947 } |
| 19886 $inherits(FormalNode, lang_Node); | 19948 $inherits(FormalNode, lang_Node); |
| 19949 FormalNode.prototype.get$type = function() { return this.type; }; |
| 19950 FormalNode.prototype.set$type = function(value) { return this.type = value; }; |
| 19887 FormalNode.prototype.get$name = function() { return this.name; }; | 19951 FormalNode.prototype.get$name = function() { return this.name; }; |
| 19888 FormalNode.prototype.set$name = function(value) { return this.name = value; }; | 19952 FormalNode.prototype.set$name = function(value) { return this.name = value; }; |
| 19889 FormalNode.prototype.get$value = function() { return this.value; }; | 19953 FormalNode.prototype.get$value = function() { return this.value; }; |
| 19890 FormalNode.prototype.set$value = function(value) { return this.value = value; }; | 19954 FormalNode.prototype.set$value = function(value) { return this.value = value; }; |
| 19891 FormalNode.prototype.visit = function(visitor) { | 19955 FormalNode.prototype.visit = function(visitor) { |
| 19892 return visitor.visitFormalNode(this); | 19956 return visitor.visitFormalNode(this); |
| 19893 } | 19957 } |
| 19894 FormalNode.prototype.visit$1 = function($0) { | 19958 FormalNode.prototype.visit$1 = function($0) { |
| 19895 return this.visit(($0 && $0.is$TreeVisitor())); | 19959 return this.visit(($0 && $0.is$TreeVisitor())); |
| 19896 }; | 19960 }; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19942 TypeParameter.prototype.visit$1 = function($0) { | 20006 TypeParameter.prototype.visit$1 = function($0) { |
| 19943 return this.visit(($0 && $0.is$TreeVisitor())); | 20007 return this.visit(($0 && $0.is$TreeVisitor())); |
| 19944 }; | 20008 }; |
| 19945 // ********** Code for lang_Identifier ************** | 20009 // ********** Code for lang_Identifier ************** |
| 19946 function lang_Identifier(name, span) { | 20010 function lang_Identifier(name, span) { |
| 19947 this.name = name; | 20011 this.name = name; |
| 19948 lang_Node.call(this, span); | 20012 lang_Node.call(this, span); |
| 19949 // Initializers done | 20013 // Initializers done |
| 19950 } | 20014 } |
| 19951 $inherits(lang_Identifier, lang_Node); | 20015 $inherits(lang_Identifier, lang_Node); |
| 20016 lang_Identifier.prototype.is$lang_Identifier = function(){return this;}; |
| 19952 lang_Identifier.prototype.get$name = function() { return this.name; }; | 20017 lang_Identifier.prototype.get$name = function() { return this.name; }; |
| 19953 lang_Identifier.prototype.set$name = function(value) { return this.name = value;
}; | 20018 lang_Identifier.prototype.set$name = function(value) { return this.name = value;
}; |
| 19954 lang_Identifier.prototype.visit = function(visitor) { | 20019 lang_Identifier.prototype.visit = function(visitor) { |
| 19955 return visitor.visitIdentifier(this); | 20020 return visitor.visitIdentifier(this); |
| 19956 } | 20021 } |
| 19957 lang_Identifier.prototype.visit$1 = function($0) { | 20022 lang_Identifier.prototype.visit$1 = function($0) { |
| 19958 return this.visit(($0 && $0.is$TreeVisitor())); | 20023 return this.visit(($0 && $0.is$TreeVisitor())); |
| 19959 }; | 20024 }; |
| 19960 // ********** Code for DeclaredIdentifier ************** | 20025 // ********** Code for DeclaredIdentifier ************** |
| 19961 function DeclaredIdentifier(type, name, span) { | 20026 function DeclaredIdentifier(type, name, span) { |
| 19962 this.type = type; | 20027 this.type = type; |
| 19963 this.name = name; | 20028 this.name = name; |
| 19964 lang_Expression.call(this, span); | 20029 lang_Expression.call(this, span); |
| 19965 // Initializers done | 20030 // Initializers done |
| 19966 } | 20031 } |
| 19967 $inherits(DeclaredIdentifier, lang_Expression); | 20032 $inherits(DeclaredIdentifier, lang_Expression); |
| 19968 DeclaredIdentifier.prototype.is$DeclaredIdentifier = function(){return this;}; | 20033 DeclaredIdentifier.prototype.is$DeclaredIdentifier = function(){return this;}; |
| 20034 DeclaredIdentifier.prototype.get$type = function() { return this.type; }; |
| 20035 DeclaredIdentifier.prototype.set$type = function(value) { return this.type = val
ue; }; |
| 19969 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; | 20036 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; |
| 19970 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val
ue; }; | 20037 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val
ue; }; |
| 19971 DeclaredIdentifier.prototype.visit = function(visitor) { | 20038 DeclaredIdentifier.prototype.visit = function(visitor) { |
| 19972 return visitor.visitDeclaredIdentifier(this); | 20039 return visitor.visitDeclaredIdentifier(this); |
| 19973 } | 20040 } |
| 19974 DeclaredIdentifier.prototype.visit$1 = function($0) { | 20041 DeclaredIdentifier.prototype.visit$1 = function($0) { |
| 19975 return this.visit(($0 && $0.is$TreeVisitor())); | 20042 return this.visit(($0 && $0.is$TreeVisitor())); |
| 19976 }; | 20043 }; |
| 19977 // ********** Code for lang_Type ************** | 20044 // ********** Code for lang_Type ************** |
| 19978 function lang_Type(name) { | 20045 function lang_Type(name) { |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20293 ParameterType.prototype.resolveTypeParams$1 = function($0) { | 20360 ParameterType.prototype.resolveTypeParams$1 = function($0) { |
| 20294 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); | 20361 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); |
| 20295 }; | 20362 }; |
| 20296 // ********** Code for NonNullableType ************** | 20363 // ********** Code for NonNullableType ************** |
| 20297 function NonNullableType(type) { | 20364 function NonNullableType(type) { |
| 20298 this.type = type; | 20365 this.type = type; |
| 20299 lang_Type.call(this, type.name); | 20366 lang_Type.call(this, type.name); |
| 20300 // Initializers done | 20367 // Initializers done |
| 20301 } | 20368 } |
| 20302 $inherits(NonNullableType, lang_Type); | 20369 $inherits(NonNullableType, lang_Type); |
| 20370 NonNullableType.prototype.get$type = function() { return this.type; }; |
| 20303 NonNullableType.prototype.get$isNullable = function() { | 20371 NonNullableType.prototype.get$isNullable = function() { |
| 20304 return false; | 20372 return false; |
| 20305 } | 20373 } |
| 20306 NonNullableType.prototype.get$isBool = function() { | 20374 NonNullableType.prototype.get$isBool = function() { |
| 20307 return this.type.get$isBool(); | 20375 return this.type.get$isBool(); |
| 20308 } | 20376 } |
| 20309 NonNullableType.prototype.get$isUsed = function() { | 20377 NonNullableType.prototype.get$isUsed = function() { |
| 20310 return false; | 20378 return false; |
| 20311 } | 20379 } |
| 20312 NonNullableType.prototype.isSubtypeOf = function(other) { | 20380 NonNullableType.prototype.isSubtypeOf = function(other) { |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20997 } | 21065 } |
| 20998 return null; | 21066 return null; |
| 20999 } | 21067 } |
| 21000 DefinedType.prototype.getMember = function(memberName) { | 21068 DefinedType.prototype.getMember = function(memberName) { |
| 21001 var $0; | 21069 var $0; |
| 21002 var member = (($0 = this.members.$index(memberName)) && $0.is$Member()); | 21070 var member = (($0 = this.members.$index(memberName)) && $0.is$Member()); |
| 21003 if (member != null) { | 21071 if (member != null) { |
| 21004 var parentMember = this.getMemberInParents(memberName); | 21072 var parentMember = this.getMemberInParents(memberName); |
| 21005 if ($notnull_bool($ne(parentMember, null))) { | 21073 if ($notnull_bool($ne(parentMember, null))) { |
| 21006 if (!$notnull_bool(member.get$isPrivate()) || $eq(member.get$library(), pa
rentMember.get$library())) { | 21074 if (!$notnull_bool(member.get$isPrivate()) || $eq(member.get$library(), pa
rentMember.get$library())) { |
| 21007 member.override(parentMember); | 21075 member.override((parentMember && parentMember.is$Member())); |
| 21008 } | 21076 } |
| 21009 } | 21077 } |
| 21010 return member; | 21078 return member; |
| 21011 } | 21079 } |
| 21012 if ($notnull_bool(this.get$isTop())) { | 21080 if ($notnull_bool(this.get$isTop())) { |
| 21013 var libType = this.library.findTypeByName(memberName); | 21081 var libType = this.library.findTypeByName(memberName); |
| 21014 if ($notnull_bool($ne(libType, null))) { | 21082 if ($notnull_bool($ne(libType, null))) { |
| 21015 return libType.get$typeMember(); | 21083 return libType.get$typeMember(); |
| 21016 } | 21084 } |
| 21017 } | 21085 } |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21320 this.isSuper = false | 21388 this.isSuper = false |
| 21321 this.isType = false | 21389 this.isType = false |
| 21322 this.type = type; | 21390 this.type = type; |
| 21323 this.code = code; | 21391 this.code = code; |
| 21324 this.span = span; | 21392 this.span = span; |
| 21325 this.needsTemp = needsTemp; | 21393 this.needsTemp = needsTemp; |
| 21326 // Initializers done | 21394 // Initializers done |
| 21327 if (this.type == null) world.internalError('type passed as null', this.span); | 21395 if (this.type == null) world.internalError('type passed as null', this.span); |
| 21328 } | 21396 } |
| 21329 Value.prototype.is$Value = function(){return this;}; | 21397 Value.prototype.is$Value = function(){return this;}; |
| 21398 Value.prototype.get$type = function() { return this.type; }; |
| 21399 Value.prototype.set$type = function(value) { return this.type = value; }; |
| 21330 Value.prototype.get$span = function() { return this.span; }; | 21400 Value.prototype.get$span = function() { return this.span; }; |
| 21331 Value.prototype.set$span = function(value) { return this.span = value; }; | 21401 Value.prototype.set$span = function(value) { return this.span = value; }; |
| 21332 Value.prototype.get$_typeIsVarOrParameterType = function() { | 21402 Value.prototype.get$_typeIsVarOrParameterType = function() { |
| 21333 return $notnull_bool(this.type.get$isVar() || (this.type instanceof ParameterT
ype)); | 21403 return $notnull_bool(this.type.get$isVar() || (this.type instanceof ParameterT
ype)); |
| 21334 } | 21404 } |
| 21335 Value.prototype.get$isConst = function() { | 21405 Value.prototype.get$isConst = function() { |
| 21336 return false; | 21406 return false; |
| 21337 } | 21407 } |
| 21338 Value.prototype.get$canonicalCode = function() { | 21408 Value.prototype.get$canonicalCode = function() { |
| 21339 return null; | 21409 return null; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21450 var callMethod = toType.getCallMethod(); | 21520 var callMethod = toType.getCallMethod(); |
| 21451 if ($notnull_bool($ne(callMethod, null))) { | 21521 if ($notnull_bool($ne(callMethod, null))) { |
| 21452 var arity = callMethod.get$parameters().length; | 21522 var arity = callMethod.get$parameters().length; |
| 21453 var myCall = this.type.getCallMethod(); | 21523 var myCall = this.type.getCallMethod(); |
| 21454 if ($notnull_bool(myCall == null || myCall.get$parameters().length != arity)
) { | 21524 if ($notnull_bool(myCall == null || myCall.get$parameters().length != arity)
) { |
| 21455 return true; | 21525 return true; |
| 21456 } | 21526 } |
| 21457 } | 21527 } |
| 21458 if ($notnull_bool(options.enableTypeChecks)) { | 21528 if ($notnull_bool(options.enableTypeChecks)) { |
| 21459 var fromType = this.type; | 21529 var fromType = this.type; |
| 21460 if ($notnull_bool(this.type.get$isVar() && this.code != 'null')) { | 21530 if ($notnull_bool(this.type.get$isVar() && (this.code != 'null' || !$notnull
_bool(toType.get$isNullable())))) { |
| 21461 fromType = world.objectType; | 21531 fromType = world.objectType; |
| 21462 } | 21532 } |
| 21463 var bothNum = $notnull_bool(this.type.get$isNum() && toType.get$isNum()); | 21533 var bothNum = $notnull_bool(this.type.get$isNum() && toType.get$isNum()); |
| 21464 return $notnull_bool(fromType.isSubtypeOf(toType) || bothNum); | 21534 return $notnull_bool(fromType.isSubtypeOf(toType) || bothNum); |
| 21465 } | 21535 } |
| 21466 return false; | 21536 return false; |
| 21467 } | 21537 } |
| 21468 Value.prototype.convertTo = function(context, toType, node, isDynamic) { | 21538 Value.prototype.convertTo = function(context, toType, node, isDynamic) { |
| 21469 var $0; | 21539 var $0; |
| 21470 var checked = !$notnull_bool(isDynamic); | 21540 var checked = !$notnull_bool(isDynamic); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 21482 } | 21552 } |
| 21483 else if ($notnull_bool(this._isDomCallback(toType) && !$notnull_bool(this._i
sDomCallback(this.type)))) { | 21553 else if ($notnull_bool(this._isDomCallback(toType) && !$notnull_bool(this._i
sDomCallback(this.type)))) { |
| 21484 return this._wrapDomCallback(toType, arity); | 21554 return this._wrapDomCallback(toType, arity); |
| 21485 } | 21555 } |
| 21486 } | 21556 } |
| 21487 var fromType = this.type; | 21557 var fromType = this.type; |
| 21488 if ($notnull_bool(this.type.get$isVar() && (this.code != 'null' || !$notnull_b
ool(toType.get$isNullable())))) { | 21558 if ($notnull_bool(this.type.get$isVar() && (this.code != 'null' || !$notnull_b
ool(toType.get$isNullable())))) { |
| 21489 fromType = world.objectType; | 21559 fromType = world.objectType; |
| 21490 } | 21560 } |
| 21491 var bothNum = $notnull_bool(this.type.get$isNum() && toType.get$isNum()); | 21561 var bothNum = $notnull_bool(this.type.get$isNum() && toType.get$isNum()); |
| 21492 if ($notnull_bool($notnull_bool(!$notnull_bool(checked) || fromType.isSubtypeO
f(toType)) || bothNum)) { | 21562 if ($notnull_bool(fromType.isSubtypeOf(toType) || bothNum)) { |
| 21493 return this; | 21563 return this; |
| 21494 } | 21564 } |
| 21495 if ($notnull_bool(checked && !$notnull_bool(toType.isSubtypeOf(this.type)))) { | 21565 if ($notnull_bool(checked && !$notnull_bool(toType.isSubtypeOf(this.type)))) { |
| 21496 this.convertWarning(toType, node); | 21566 this.convertWarning(toType, node); |
| 21497 } | 21567 } |
| 21498 if ($notnull_bool(options.enableTypeChecks)) { | 21568 if ($notnull_bool(options.enableTypeChecks)) { |
| 21499 return this._typeAssert(context, toType, node); | 21569 return this._typeAssert(context, toType, node); |
| 21500 } | 21570 } |
| 21501 else { | 21571 else { |
| 21502 return this; | 21572 return this; |
| 21503 } | 21573 } |
| 21504 } | 21574 } |
| 21505 Value.prototype._isDomCallback = function(toType) { | 21575 Value.prototype._isDomCallback = function(toType) { |
| 21506 return ((toType.get$definition() instanceof FunctionTypeDefinition) && $eq(toT
ype.get$library(), world.get$dom())); | 21576 return ((toType.get$definition() instanceof FunctionTypeDefinition) && $eq(toT
ype.get$library(), world.get$dom())); |
| 21507 } | 21577 } |
| 21508 Value.prototype._wrapDomCallback = function(toType, arity) { | 21578 Value.prototype._wrapDomCallback = function(toType, arity) { |
| 21509 return new Value(toType, ('\$wrap_call\$' + arity + '(' + this.code + ')'), th
is.span, true); | 21579 return new Value(toType, ('\$wrap_call\$' + arity + '(' + this.code + ')'), th
is.span, true); |
| 21510 } | 21580 } |
| 21511 Value.prototype._typeAssert = function(context, toType, node) { | 21581 Value.prototype._typeAssert = function(context, toType, node) { |
| 21512 if ((toType instanceof ParameterType)) { | 21582 if ((toType instanceof ParameterType)) { |
| 21513 var p = (toType && toType.is$ParameterType()); | 21583 var p = (toType && toType.is$ParameterType()); |
| 21514 toType = p.extendsType; | 21584 toType = p.extendsType; |
| 21515 } | 21585 } |
| 21586 if (toType.getCallMethod() != null) { |
| 21587 return this; |
| 21588 } |
| 21516 if ($notnull_bool(toType.get$isObject() || toType.get$isVar())) { | 21589 if ($notnull_bool(toType.get$isObject() || toType.get$isVar())) { |
| 21517 world.internalError(('We thought ' + this.type.name + ' is not a subtype of
' + toType.name + '?')); | 21590 world.internalError(('We thought ' + this.type.name + ' is not a subtype of
' + toType.name + '?')); |
| 21518 } | 21591 } |
| 21519 if ($notnull_bool(toType.get$isNum())) toType = world.numType; | 21592 if ($notnull_bool(toType.get$isNum())) toType = world.numType; |
| 21520 var check; | 21593 var check; |
| 21521 if ($notnull_bool(toType.get$isVoid())) { | 21594 if ($notnull_bool(toType.get$isVoid())) { |
| 21522 check = ('\$assert_void(' + this.code + ')'); | 21595 check = ('\$assert_void(' + this.code + ')'); |
| 21523 if (toType.typeCheckCode == null) { | 21596 if (toType.typeCheckCode == null) { |
| 21524 toType.typeCheckCode = "function $assert_void(x) {\n return x == null ? x
: x.is$void(); // throws TypeError\n}"; | 21597 toType.typeCheckCode = "function $assert_void(x) {\n return x == null ? x
: x.is$void(); // throws TypeError\n}"; |
| 21525 } | 21598 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21590 for (var i = 0; | 21663 for (var i = 0; |
| 21591 i < args.get$length(); i++) { | 21664 i < args.get$length(); i++) { |
| 21592 argsCode.add$1(args.values.$index(i).code); | 21665 argsCode.add$1(args.values.$index(i).code); |
| 21593 } | 21666 } |
| 21594 pos = Strings.join((argsCode && argsCode.is$List$String()), ", "); | 21667 pos = Strings.join((argsCode && argsCode.is$List$String()), ", "); |
| 21595 } | 21668 } |
| 21596 var noSuchArgs = [new Value(world.stringType, ('"' + name + '"'), node.span, t
rue), new Value(world.listType, ('[' + pos + ']'), node.span, true)]; | 21669 var noSuchArgs = [new Value(world.stringType, ('"' + name + '"'), node.span, t
rue), new Value(world.listType, ('[' + pos + ']'), node.span, true)]; |
| 21597 return this._resolveMember(context, 'noSuchMethod', node, false).invoke$4(cont
ext, node, this, new Arguments(null, noSuchArgs)); | 21670 return this._resolveMember(context, 'noSuchMethod', node, false).invoke$4(cont
ext, node, this, new Arguments(null, noSuchArgs)); |
| 21598 } | 21671 } |
| 21599 Value.prototype.invokeSpecial = function(name, args, returnType) { | 21672 Value.prototype.invokeSpecial = function(name, args, returnType) { |
| 21600 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 449, 12
); | 21673 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 455, 12
); |
| 21601 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4
50, 12); | 21674 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4
56, 12); |
| 21602 var argsString = args.getCode(); | 21675 var argsString = args.getCode(); |
| 21603 if (name == '\$index' || name == '\$setindex') { | 21676 if (name == '\$index' || name == '\$setindex') { |
| 21604 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString
+ ')'), this.span, true); | 21677 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString
+ ')'), this.span, true); |
| 21605 } | 21678 } |
| 21606 else { | 21679 else { |
| 21607 if (argsString.length > 0) argsString = (', ' + argsString + ''); | 21680 if (argsString.length > 0) argsString = (', ' + argsString + ''); |
| 21608 world.gen.corejs.useOperator(name); | 21681 world.gen.corejs.useOperator(name); |
| 21609 return new Value(returnType, ('' + name + '(' + this.code + '' + argsString
+ ')'), this.span, true); | 21682 return new Value(returnType, ('' + name + '(' + this.code + '' + argsString
+ ')'), this.span, true); |
| 21610 } | 21683 } |
| 21611 } | 21684 } |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21790 }; | 21863 }; |
| 21791 // ********** Code for BareValue ************** | 21864 // ********** Code for BareValue ************** |
| 21792 function BareValue(home, outermost, span) { | 21865 function BareValue(home, outermost, span) { |
| 21793 this.home = home; | 21866 this.home = home; |
| 21794 Value.call(this, outermost.method.declaringType, null, span, false); | 21867 Value.call(this, outermost.method.declaringType, null, span, false); |
| 21795 // Initializers done | 21868 // Initializers done |
| 21796 this.isType = outermost.get$isStatic(); | 21869 this.isType = outermost.get$isStatic(); |
| 21797 } | 21870 } |
| 21798 $inherits(BareValue, Value); | 21871 $inherits(BareValue, Value); |
| 21799 BareValue.prototype._tryResolveMember = function(context, name) { | 21872 BareValue.prototype._tryResolveMember = function(context, name) { |
| 21800 $assert($eq(context, this.home), "context == home", "value.dart", 654, 12); | 21873 $assert($eq(context, this.home), "context == home", "value.dart", 660, 12); |
| 21801 var member = this.type.resolveMember(name); | 21874 var member = this.type.resolveMember(name); |
| 21802 if ($notnull_bool($ne(member, null))) { | 21875 if ($notnull_bool($ne(member, null))) { |
| 21803 $assert(this.code == null, "code == null", "value.dart", 659, 14); | 21876 $assert(this.code == null, "code == null", "value.dart", 665, 14); |
| 21804 if ($notnull_bool(this.isType)) { | 21877 if ($notnull_bool(this.isType)) { |
| 21805 this.code = this.type.get$jsname(); | 21878 this.code = this.type.get$jsname(); |
| 21806 } | 21879 } |
| 21807 else { | 21880 else { |
| 21808 this.code = this.home._makeThisCode(); | 21881 this.code = this.home._makeThisCode(); |
| 21809 } | 21882 } |
| 21810 return member; | 21883 return member; |
| 21811 } | 21884 } |
| 21812 member = this.home.get$library().lookup(name, this.span); | 21885 member = this.home.get$library().lookup(name, this.span); |
| 21813 if ($notnull_bool($ne(member, null))) { | 21886 if ($notnull_bool($ne(member, null))) { |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22249 else { | 22322 else { |
| 22250 if (!$notnull_bool(ignoreUnrecognizedFlags)) { | 22323 if (!$notnull_bool(ignoreUnrecognizedFlags)) { |
| 22251 print(('unrecognized flag: "' + arg + '"')); | 22324 print(('unrecognized flag: "' + arg + '"')); |
| 22252 } | 22325 } |
| 22253 } | 22326 } |
| 22254 | 22327 |
| 22255 } | 22328 } |
| 22256 } | 22329 } |
| 22257 if (!$notnull_bool(passedLibDir) && !$notnull_bool(files.fileExists(this.libDi
r))) { | 22330 if (!$notnull_bool(passedLibDir) && !$notnull_bool(files.fileExists(this.libDi
r))) { |
| 22258 var temp = 'frog/lib'; | 22331 var temp = 'frog/lib'; |
| 22259 if ($notnull_bool(files.fileExists(temp))) { | 22332 if ($notnull_bool(files.fileExists($assert_String(temp)))) { |
| 22260 this.libDir = $assert_String(temp); | 22333 this.libDir = $assert_String(temp); |
| 22261 } | 22334 } |
| 22262 else { | 22335 else { |
| 22263 this.libDir = 'lib'; | 22336 this.libDir = 'lib'; |
| 22264 } | 22337 } |
| 22265 } | 22338 } |
| 22266 } | 22339 } |
| 22267 // ********** Code for LibraryReader ************** | 22340 // ********** Code for LibraryReader ************** |
| 22268 function LibraryReader() { | 22341 function LibraryReader() { |
| 22269 // Initializers done | 22342 // Initializers done |
| 22270 this._specialLibs = $map(['dart:core', joinPaths(options.libDir, 'corelib.dart
'), 'dart:coreimpl', joinPaths(options.libDir, 'corelib_impl.dart'), 'dart:html'
, joinPaths(options.libDir, '../../client/html/release/html.dart'), 'dart:dom',
joinPaths(options.libDir, 'dom/dom.dart'), 'dart:json', joinPaths(options.libDir
, 'json.dart')]); | 22343 this._specialLibs = $map(['dart:core', joinPaths(options.libDir, 'corelib.dart
'), 'dart:coreimpl', joinPaths(options.libDir, 'corelib_impl.dart'), 'dart:html'
, joinPaths(options.libDir, '../../client/html/release/html.dart'), 'dart:dom',
joinPaths(options.libDir, 'dom/dom.dart'), 'dart:json', joinPaths(options.libDir
, 'json.dart')]); |
| 22271 } | 22344 } |
| 22272 LibraryReader.prototype.readFile = function(fullname) { | 22345 LibraryReader.prototype.readFile = function(fullname) { |
| 22273 var filename = this._specialLibs.$index(fullname); | 22346 var filename = this._specialLibs.$index(fullname); |
| 22274 if ($notnull_bool(filename == null)) { | 22347 if ($notnull_bool(filename == null)) { |
| 22275 filename = fullname; | 22348 filename = fullname; |
| 22276 } | 22349 } |
| 22277 if ($notnull_bool(world.files.fileExists(filename))) { | 22350 if ($notnull_bool(world.files.fileExists($assert_String(filename)))) { |
| 22278 return new SourceFile(filename, world.files.readAll(filename)); | 22351 return new SourceFile(filename, world.files.readAll($assert_String(filename)
)); |
| 22279 } | 22352 } |
| 22280 else { | 22353 else { |
| 22281 world.error(('File not found: ' + filename + '')); | 22354 world.error(('File not found: ' + filename + '')); |
| 22282 return new SourceFile(filename, ''); | 22355 return new SourceFile(filename, ''); |
| 22283 } | 22356 } |
| 22284 } | 22357 } |
| 22285 // ********** Code for VarMember ************** | 22358 // ********** Code for VarMember ************** |
| 22286 function VarMember(name) { | 22359 function VarMember(name) { |
| 22287 this.name = name; | 22360 this.name = name; |
| 22288 // Initializers done | 22361 // Initializers done |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22415 return VarMember.prototype.invoke.call(this, context, node, target, args); | 22488 return VarMember.prototype.invoke.call(this, context, node, target, args); |
| 22416 } | 22489 } |
| 22417 VarMethodSet.prototype._invokeMembers = function(context, node) { | 22490 VarMethodSet.prototype._invokeMembers = function(context, node) { |
| 22418 if (this._fallbackStubs != null) return; | 22491 if (this._fallbackStubs != null) return; |
| 22419 var objectStub = null; | 22492 var objectStub = null; |
| 22420 this._fallbackStubs = []; | 22493 this._fallbackStubs = []; |
| 22421 var $list = this.members; | 22494 var $list = this.members; |
| 22422 for (var $i = 0;$i < $list.length; $i++) { | 22495 for (var $i = 0;$i < $list.length; $i++) { |
| 22423 var member = $list.$index($i); | 22496 var member = $list.$index($i); |
| 22424 var target = new Value(member.declaringType, 'this', node.span, true); | 22497 var target = new Value(member.declaringType, 'this', node.span, true); |
| 22425 var result = member.invoke$4(context, node, target, this.args); | 22498 var result = member.invoke$4$isDynamic(context, node, target, this.args, tru
e); |
| 22426 var stub = new VarMethodStub(this.name, member, this.args, result); | 22499 var stub = new VarMethodStub(this.name, member, this.args, result); |
| 22427 var type = member.declaringType; | 22500 var type = member.declaringType; |
| 22428 if ($notnull_bool(type.get$isObject())) { | 22501 if ($notnull_bool(type.get$isObject())) { |
| 22429 objectStub = stub; | 22502 objectStub = stub; |
| 22430 } | 22503 } |
| 22431 else if ($ne(type.get$library(), world.get$dom())) { | 22504 else if ($ne(type.get$library(), world.get$dom())) { |
| 22432 VarMethodSet._addVarStub((type && type.is$lang_Type()), (stub && stub.is$V
arMember())); | 22505 VarMethodSet._addVarStub((type && type.is$lang_Type()), (stub && stub.is$V
arMember())); |
| 22433 } | 22506 } |
| 22434 else { | 22507 else { |
| 22435 this._fallbackStubs.add(stub); | 22508 this._fallbackStubs.add(stub); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22562 function lang_compile(homedir, args, files) { | 22635 function lang_compile(homedir, args, files) { |
| 22563 parseOptions(homedir, args, files); | 22636 parseOptions(homedir, args, files); |
| 22564 initializeWorld(files); | 22637 initializeWorld(files); |
| 22565 var success = world.compile(); | 22638 var success = world.compile(); |
| 22566 if (options.outfile != null) { | 22639 if (options.outfile != null) { |
| 22567 if ($notnull_bool(success)) { | 22640 if ($notnull_bool(success)) { |
| 22568 var code = world.getGeneratedCode(); | 22641 var code = world.getGeneratedCode(); |
| 22569 if (!options.outfile.endsWith('.js')) { | 22642 if (!options.outfile.endsWith('.js')) { |
| 22570 code = '#!/usr/bin/env node\n' + code; | 22643 code = '#!/usr/bin/env node\n' + code; |
| 22571 } | 22644 } |
| 22572 world.files.writeString(options.outfile, code); | 22645 world.files.writeString(options.outfile, $assert_String(code)); |
| 22573 } | 22646 } |
| 22574 else { | 22647 else { |
| 22575 world.files.writeString(options.outfile, "throw 'Sorry, but I could not ge
nerate reasonable code to run.\\n';"); | 22648 world.files.writeString(options.outfile, "throw 'Sorry, but I could not ge
nerate reasonable code to run.\\n';"); |
| 22576 } | 22649 } |
| 22577 } | 22650 } |
| 22578 return $assert_bool(success); | 22651 return $assert_bool(success); |
| 22579 } | 22652 } |
| 22580 var options; | 22653 var options; |
| 22581 function parseOptions(homedir, args, files) { | 22654 function parseOptions(homedir, args, files) { |
| 22582 $assert(options == null, "options == null", "frog_options.dart", 10, 10); | 22655 $assert(options == null, "options == null", "frog_options.dart", 10, 10); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22735 INTERFACE, | 22808 INTERFACE, |
| 22736 LIBRARY, | 22809 LIBRARY, |
| 22737 NATIVE, | 22810 NATIVE, |
| 22738 NEGATE, | 22811 NEGATE, |
| 22739 OPERATOR, | 22812 OPERATOR, |
| 22740 SET, | 22813 SET, |
| 22741 SOURCE, | 22814 SOURCE, |
| 22742 STATIC, | 22815 STATIC, |
| 22743 TYPEDEF ]*/; | 22816 TYPEDEF ]*/; |
| 22744 RunEntry(function () {main();}, []); | 22817 RunEntry(function () {main();}, []); |
| OLD | NEW |