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

Side by Side Diff: frog/frogsh

Issue 8588060: Fixes to get Swarm demo working again. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env node 1 #!/usr/bin/env node
2 // ********** Library dart:core ************** 2 // ********** Library dart:core **************
3 // ********** Natives dart:core ************** 3 // ********** Natives dart:core **************
4 /** 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 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after
1838 this._previous = null; 1838 this._previous = null;
1839 return this._element; 1839 return this._element;
1840 } 1840 }
1841 DoubleLinkedQueueEntry$E.prototype._asNonSentinelEntry = function() { 1841 DoubleLinkedQueueEntry$E.prototype._asNonSentinelEntry = function() {
1842 return this; 1842 return this;
1843 } 1843 }
1844 DoubleLinkedQueueEntry$E.prototype.previousEntry = function() { 1844 DoubleLinkedQueueEntry$E.prototype.previousEntry = function() {
1845 return this._previous._asNonSentinelEntry(); 1845 return this._previous._asNonSentinelEntry();
1846 } 1846 }
1847 // ********** Code for DoubleLinkedQueueEntry$KeyValuePair$K$V ************** 1847 // ********** Code for DoubleLinkedQueueEntry$KeyValuePair$K$V **************
1848 function DoubleLinkedQueueEntry$KeyValuePair$K$V() {} 1848 function DoubleLinkedQueueEntry$KeyValuePair$K$V(e) {
1849 // Initializers done
1850 this._element = e;
1851 }
1849 $inherits(DoubleLinkedQueueEntry$KeyValuePair$K$V, DoubleLinkedQueueEntry); 1852 $inherits(DoubleLinkedQueueEntry$KeyValuePair$K$V, DoubleLinkedQueueEntry);
1850 DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype.is$DoubleLinkedQueueEntry$KeyV aluePair$K$V = function(){return this;}; 1853 DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype.is$DoubleLinkedQueueEntry$KeyV aluePair$K$V = function(){return this;};
1854 DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype._link = function(p, n) {
1855 this._next = n;
1856 this._previous = p;
1857 p._next = this;
1858 n._previous = this;
1859 }
1860 DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype.prepend = function(e) {
1861 new DoubleLinkedQueueEntry$KeyValuePair$K$V(e)._link(this._previous, this);
1862 }
1863 DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype._asNonSentinelEntry = function () {
1864 return this;
1865 }
1866 DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype.previousEntry = function() {
1867 var $0;
1868 return (($0 = this._previous._asNonSentinelEntry()) && $0.is$DoubleLinkedQueue Entry$KeyValuePair$K$V());
1869 }
1851 // ********** Code for _DoubleLinkedQueueEntrySentinel ************** 1870 // ********** Code for _DoubleLinkedQueueEntrySentinel **************
1852 function _DoubleLinkedQueueEntrySentinel() { 1871 function _DoubleLinkedQueueEntrySentinel() {
1853 // Initializers done 1872 // Initializers done
1854 DoubleLinkedQueueEntry$E.call(this, null); 1873 DoubleLinkedQueueEntry$E.call(this, null);
1855 this._link(this, this); 1874 this._link(this, this);
1856 } 1875 }
1857 $inherits(_DoubleLinkedQueueEntrySentinel, DoubleLinkedQueueEntry$E); 1876 $inherits(_DoubleLinkedQueueEntrySentinel, DoubleLinkedQueueEntry$E);
1858 _DoubleLinkedQueueEntrySentinel.prototype.remove = function() { 1877 _DoubleLinkedQueueEntrySentinel.prototype.remove = function() {
1859 $throw(const$5/*const EmptyQueueException()*/); 1878 $throw(const$5/*const EmptyQueueException()*/);
1860 } 1879 }
1861 _DoubleLinkedQueueEntrySentinel.prototype._asNonSentinelEntry = function() { 1880 _DoubleLinkedQueueEntrySentinel.prototype._asNonSentinelEntry = function() {
1862 return null; 1881 return null;
1863 } 1882 }
1864 _DoubleLinkedQueueEntrySentinel.prototype.get$element = function() { 1883 _DoubleLinkedQueueEntrySentinel.prototype.get$element = function() {
1865 $throw(const$5/*const EmptyQueueException()*/); 1884 $throw(const$5/*const EmptyQueueException()*/);
1866 } 1885 }
1867 // ********** Code for _DoubleLinkedQueueEntrySentinel$E ************** 1886 // ********** Code for _DoubleLinkedQueueEntrySentinel$E **************
1868 function _DoubleLinkedQueueEntrySentinel$E() { 1887 function _DoubleLinkedQueueEntrySentinel$E() {
1869 // Initializers done 1888 // Initializers done
1870 DoubleLinkedQueueEntry$E.call(this, null); 1889 DoubleLinkedQueueEntry$E.call(this, null);
1871 this._link(this, this); 1890 this._link(this, this);
1872 } 1891 }
1873 $inherits(_DoubleLinkedQueueEntrySentinel$E, _DoubleLinkedQueueEntrySentinel); 1892 $inherits(_DoubleLinkedQueueEntrySentinel$E, _DoubleLinkedQueueEntrySentinel);
1874 // ********** Code for _DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V ******** ****** 1893 // ********** Code for _DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V ******** ******
1875 function _DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V() { 1894 function _DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V() {
1876 // Initializers done 1895 // Initializers done
1877 DoubleLinkedQueueEntry$E.call(this, null); 1896 DoubleLinkedQueueEntry$KeyValuePair$K$V.call(this, null);
1878 this._link(this, this); 1897 this._link(this, this);
1879 } 1898 }
1880 $inherits(_DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V, _DoubleLinkedQueueEn trySentinel); 1899 $inherits(_DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V, _DoubleLinkedQueueEn trySentinel);
1881 // ********** Code for DoubleLinkedQueue ************** 1900 // ********** Code for DoubleLinkedQueue **************
1882 function DoubleLinkedQueue() { 1901 function DoubleLinkedQueue() {
1883 // Initializers done 1902 // Initializers done
1884 this._sentinel = new _DoubleLinkedQueueEntrySentinel$E(); 1903 this._sentinel = new _DoubleLinkedQueueEntrySentinel$E();
1885 } 1904 }
1886 DoubleLinkedQueue.prototype.is$Collection$E = function(){return this;}; 1905 DoubleLinkedQueue.prototype.is$Collection$E = function(){return this;};
1887 DoubleLinkedQueue.prototype.is$Collection$Object = function(){return this;}; 1906 DoubleLinkedQueue.prototype.is$Collection$Object = function(){return this;};
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
2118 } 2137 }
2119 return this; 2138 return this;
2120 } 2139 }
2121 StringBufferImpl.prototype.clear = function() { 2140 StringBufferImpl.prototype.clear = function() {
2122 this._buffer = new ListFactory(); 2141 this._buffer = new ListFactory();
2123 this._length = 0; 2142 this._length = 0;
2124 return this; 2143 return this;
2125 } 2144 }
2126 StringBufferImpl.prototype.toString = function() { 2145 StringBufferImpl.prototype.toString = function() {
2127 if (this._buffer.length == 0) return ""; 2146 if (this._buffer.length == 0) return "";
2128 if (this._buffer.length == 1) return $assert_String(this._buffer.$index(0)); 2147 if ($notnull_bool($eq(this._buffer.length, 1))) return $assert_String(this._bu ffer.$index(0));
2129 var result = StringBase.concatAll(this._buffer); 2148 var result = StringBase.concatAll(this._buffer);
2130 this._buffer.clear(); 2149 this._buffer.clear();
2131 this._buffer.add(result); 2150 this._buffer.add(result);
2132 return result; 2151 return result;
2133 } 2152 }
2134 StringBufferImpl.prototype.add$1 = StringBufferImpl.prototype.add; 2153 StringBufferImpl.prototype.add$1 = StringBufferImpl.prototype.add;
2135 StringBufferImpl.prototype.addAll$1 = function($0) { 2154 StringBufferImpl.prototype.addAll$1 = function($0) {
2136 return this.addAll(($0 && $0.is$Collection$Object())); 2155 return this.addAll(($0 && $0.is$Collection$Object()));
2137 }; 2156 };
2138 StringBufferImpl.prototype.isEmpty$0 = function() { 2157 StringBufferImpl.prototype.isEmpty$0 = function() {
2139 return this.isEmpty(); 2158 return this.isEmpty();
2140 }; 2159 };
2141 StringBufferImpl.prototype.toString$0 = function() { 2160 StringBufferImpl.prototype.toString$0 = function() {
2142 return this.toString(); 2161 return this.toString();
2143 }; 2162 };
2144 // ********** Code for StringBase ************** 2163 // ********** Code for StringBase **************
2145 function StringBase() {} 2164 function StringBase() {}
2146 StringBase.createFromCharCodes = function(charCodes) { 2165 StringBase.createFromCharCodes = function(charCodes) {
2147 if (Object.getPrototypeOf(charCodes) !== Array.prototype) { 2166 if (Object.getPrototypeOf(charCodes) !== Array.prototype) {
2148 var length = charCodes.length; 2167 var length = charCodes.length;
2149 var tmp = new Array(length); 2168 var tmp = new Array(length);
2150 for (var i = 0; i < length; i++) { 2169 for (var i = 0; i < length; i++) {
2151 tmp[i] = charCodes.$index(i); 2170 tmp[i] = charCodes.$index(i);
2152 } 2171 }
2153 charCodes = tmp; 2172 charCodes = tmp;
2154 } 2173 }
2155 return String.fromCharCode.apply(null, charCodes); 2174 return String.fromCharCode.apply(null, charCodes);
2156 } 2175 }
2157 StringBase.join = function(strings, separator) { 2176 StringBase.join = function(strings, separator) {
2158 if (strings.length == 0) return ''; 2177 if ($notnull_bool($eq(strings.length, 0))) return '';
2159 var s = $assert_String(strings.$index(0)); 2178 var s = $assert_String(strings.$index(0));
2160 for (var i = 1; 2179 for (var i = 1;
2161 i < strings.length; i++) { 2180 i < $assert_num(strings.length); i++) {
2162 s = s + separator + strings.$index(i); 2181 s = s + separator + strings.$index(i);
2163 } 2182 }
2164 return s; 2183 return s;
2165 } 2184 }
2166 StringBase.concatAll = function(strings) { 2185 StringBase.concatAll = function(strings) {
2167 return StringBase.join(strings, ""); 2186 return StringBase.join(strings, "");
2168 } 2187 }
2169 // ********** Code for StringImplementation ************** 2188 // ********** Code for StringImplementation **************
2170 StringImplementation = String; 2189 StringImplementation = String;
2171 StringImplementation.prototype.is$Pattern = function(){return this;}; 2190 StringImplementation.prototype.is$Pattern = function(){return this;};
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
2509 }; 2528 };
2510 AbstractLink.prototype.iterator$0 = function() { 2529 AbstractLink.prototype.iterator$0 = function() {
2511 return this.iterator(); 2530 return this.iterator();
2512 }; 2531 };
2513 AbstractLink.prototype.printOn$1 = function($0) { 2532 AbstractLink.prototype.printOn$1 = function($0) {
2514 return this.printOn(($0 && $0.is$StringBuffer())); 2533 return this.printOn(($0 && $0.is$StringBuffer()));
2515 }; 2534 };
2516 AbstractLink.prototype.toString$0 = function() { 2535 AbstractLink.prototype.toString$0 = function() {
2517 return this.toString(); 2536 return this.toString();
2518 }; 2537 };
2538 // ********** Code for AbstractLink$Dynamic **************
2539 function AbstractLink$Dynamic() {
2540 // Initializers done
2541 }
2542 $inherits(AbstractLink$Dynamic, AbstractLink);
2543 AbstractLink$Dynamic.prototype.is$Link = function(){return this;};
2544 AbstractLink$Dynamic.prototype.is$Link$Element = function(){return this;};
2545 AbstractLink$Dynamic.prototype.is$Link$Node = function(){return this;};
2546 AbstractLink$Dynamic.prototype.is$Link$T = function(){return this;};
2547 AbstractLink$Dynamic.prototype.is$Link$Token = function(){return this;};
2548 AbstractLink$Dynamic.prototype.is$Link$Type = function(){return this;};
2549 AbstractLink$Dynamic.prototype.is$Iterable = function(){return this;};
2519 // ********** Code for AbstractLink$T ************** 2550 // ********** Code for AbstractLink$T **************
2520 function AbstractLink$T() { 2551 function AbstractLink$T() {
2521 // Initializers done 2552 // Initializers done
2522 } 2553 }
2523 $inherits(AbstractLink$T, AbstractLink); 2554 $inherits(AbstractLink$T, AbstractLink);
2524 AbstractLink$T.prototype.is$Link = function(){return this;}; 2555 AbstractLink$T.prototype.is$Link = function(){return this;};
2525 AbstractLink$T.prototype.is$Link$Element = function(){return this;}; 2556 AbstractLink$T.prototype.is$Link$Element = function(){return this;};
2526 AbstractLink$T.prototype.is$Link$Node = function(){return this;}; 2557 AbstractLink$T.prototype.is$Link$Node = function(){return this;};
2527 AbstractLink$T.prototype.is$Link$T = function(){return this;}; 2558 AbstractLink$T.prototype.is$Link$T = function(){return this;};
2528 AbstractLink$T.prototype.is$Link$Token = function(){return this;}; 2559 AbstractLink$T.prototype.is$Link$Token = function(){return this;};
(...skipping 27 matching lines...) Expand all
2556 } 2587 }
2557 LinkTail.prototype.isEmpty = function() { 2588 LinkTail.prototype.isEmpty = function() {
2558 return true; 2589 return true;
2559 } 2590 }
2560 LinkTail.prototype.isEmpty$0 = function() { 2591 LinkTail.prototype.isEmpty$0 = function() {
2561 return this.isEmpty(); 2592 return this.isEmpty();
2562 }; 2593 };
2563 // ********** Code for LinkTail$Dynamic ************** 2594 // ********** Code for LinkTail$Dynamic **************
2564 function LinkTail$Dynamic() { 2595 function LinkTail$Dynamic() {
2565 // Initializers done 2596 // Initializers done
2566 AbstractLink$T.call(this); 2597 AbstractLink$Dynamic.call(this);
2567 } 2598 }
2568 $inherits(LinkTail$Dynamic, LinkTail); 2599 $inherits(LinkTail$Dynamic, LinkTail);
2569 LinkTail$Dynamic.prototype.is$Link = function(){return this;}; 2600 LinkTail$Dynamic.prototype.is$Link = function(){return this;};
2570 LinkTail$Dynamic.prototype.is$Link$Element = function(){return this;}; 2601 LinkTail$Dynamic.prototype.is$Link$Element = function(){return this;};
2571 LinkTail$Dynamic.prototype.is$Link$Node = function(){return this;}; 2602 LinkTail$Dynamic.prototype.is$Link$Node = function(){return this;};
2572 LinkTail$Dynamic.prototype.is$Link$T = function(){return this;}; 2603 LinkTail$Dynamic.prototype.is$Link$T = function(){return this;};
2573 LinkTail$Dynamic.prototype.is$Link$Token = function(){return this;}; 2604 LinkTail$Dynamic.prototype.is$Link$Token = function(){return this;};
2574 LinkTail$Dynamic.prototype.is$Link$Type = function(){return this;}; 2605 LinkTail$Dynamic.prototype.is$Link$Type = function(){return this;};
2575 LinkTail$Dynamic.prototype.is$Iterable = function(){return this;}; 2606 LinkTail$Dynamic.prototype.is$Iterable = function(){return this;};
2576 // ********** Code for LinkTail$Element ************** 2607 // ********** Code for LinkTail$Element **************
2577 function LinkTail$Element() {} 2608 function LinkTail$Element() {}
2578 $inherits(LinkTail$Element, LinkTail); 2609 $inherits(LinkTail$Element, LinkTail);
2579 LinkTail$Element.prototype.is$Link = function(){return this;}; 2610 LinkTail$Element.prototype.is$Link = function(){return this;};
2580 LinkTail$Element.prototype.is$Link$Element = function(){return this;}; 2611 LinkTail$Element.prototype.is$Link$Element = function(){return this;};
2581 LinkTail$Element.prototype.is$Link$Node = function(){return this;}; 2612 LinkTail$Element.prototype.is$Link$Node = false;
2582 LinkTail$Element.prototype.is$Link$T = function(){return this;}; 2613 LinkTail$Element.prototype.is$Link$T = function(){return this;};
2583 LinkTail$Element.prototype.is$Link$Token = function(){return this;}; 2614 LinkTail$Element.prototype.is$Link$Token = false;
2584 LinkTail$Element.prototype.is$Link$Type = function(){return this;}; 2615 LinkTail$Element.prototype.is$Link$Type = false;
2585 LinkTail$Element.prototype.is$Iterable = function(){return this;}; 2616 LinkTail$Element.prototype.is$Iterable = function(){return this;};
2586 // ********** Code for LinkTail$Node ************** 2617 // ********** Code for LinkTail$Node **************
2587 function LinkTail$Node() {} 2618 function LinkTail$Node() {}
2588 $inherits(LinkTail$Node, LinkTail); 2619 $inherits(LinkTail$Node, LinkTail);
2589 LinkTail$Node.prototype.is$Link = function(){return this;}; 2620 LinkTail$Node.prototype.is$Link = function(){return this;};
2590 LinkTail$Node.prototype.is$Link$Element = function(){return this;}; 2621 LinkTail$Node.prototype.is$Link$Element = false;
2591 LinkTail$Node.prototype.is$Link$Node = function(){return this;}; 2622 LinkTail$Node.prototype.is$Link$Node = function(){return this;};
2592 LinkTail$Node.prototype.is$Link$T = function(){return this;}; 2623 LinkTail$Node.prototype.is$Link$T = function(){return this;};
2593 LinkTail$Node.prototype.is$Link$Token = function(){return this;}; 2624 LinkTail$Node.prototype.is$Link$Token = false;
2594 LinkTail$Node.prototype.is$Link$Type = function(){return this;}; 2625 LinkTail$Node.prototype.is$Link$Type = false;
2595 LinkTail$Node.prototype.is$Iterable = function(){return this;}; 2626 LinkTail$Node.prototype.is$Iterable = function(){return this;};
2596 // ********** Code for LinkTail$T ************** 2627 // ********** Code for LinkTail$T **************
2597 function LinkTail$T() {} 2628 function LinkTail$T() {}
2598 $inherits(LinkTail$T, LinkTail); 2629 $inherits(LinkTail$T, LinkTail);
2599 LinkTail$T.prototype.is$Link = function(){return this;}; 2630 LinkTail$T.prototype.is$Link = function(){return this;};
2600 LinkTail$T.prototype.is$Link$Element = function(){return this;}; 2631 LinkTail$T.prototype.is$Link$Element = function(){return this;};
2601 LinkTail$T.prototype.is$Link$Node = function(){return this;}; 2632 LinkTail$T.prototype.is$Link$Node = function(){return this;};
2602 LinkTail$T.prototype.is$Link$T = function(){return this;}; 2633 LinkTail$T.prototype.is$Link$T = function(){return this;};
2603 LinkTail$T.prototype.is$Link$Token = function(){return this;}; 2634 LinkTail$T.prototype.is$Link$Token = function(){return this;};
2604 LinkTail$T.prototype.is$Link$Type = function(){return this;}; 2635 LinkTail$T.prototype.is$Link$Type = function(){return this;};
2605 LinkTail$T.prototype.is$Iterable = function(){return this;}; 2636 LinkTail$T.prototype.is$Iterable = function(){return this;};
2606 // ********** Code for LinkTail$Token ************** 2637 // ********** Code for LinkTail$Token **************
2607 function LinkTail$Token() {} 2638 function LinkTail$Token() {}
2608 $inherits(LinkTail$Token, LinkTail); 2639 $inherits(LinkTail$Token, LinkTail);
2609 LinkTail$Token.prototype.is$Link = function(){return this;}; 2640 LinkTail$Token.prototype.is$Link = function(){return this;};
2610 LinkTail$Token.prototype.is$Link$Element = function(){return this;}; 2641 LinkTail$Token.prototype.is$Link$Element = false;
2611 LinkTail$Token.prototype.is$Link$Node = function(){return this;}; 2642 LinkTail$Token.prototype.is$Link$Node = false;
2612 LinkTail$Token.prototype.is$Link$T = function(){return this;}; 2643 LinkTail$Token.prototype.is$Link$T = function(){return this;};
2613 LinkTail$Token.prototype.is$Link$Token = function(){return this;}; 2644 LinkTail$Token.prototype.is$Link$Token = function(){return this;};
2614 LinkTail$Token.prototype.is$Link$Type = function(){return this;}; 2645 LinkTail$Token.prototype.is$Link$Type = false;
2615 LinkTail$Token.prototype.is$Iterable = function(){return this;}; 2646 LinkTail$Token.prototype.is$Iterable = function(){return this;};
2616 // ********** Code for LinkTail$Type ************** 2647 // ********** Code for LinkTail$Type **************
2617 function LinkTail$Type() {} 2648 function LinkTail$Type() {}
2618 $inherits(LinkTail$Type, LinkTail); 2649 $inherits(LinkTail$Type, LinkTail);
2619 LinkTail$Type.prototype.is$Link = function(){return this;}; 2650 LinkTail$Type.prototype.is$Link = function(){return this;};
2620 LinkTail$Type.prototype.is$Link$Element = function(){return this;}; 2651 LinkTail$Type.prototype.is$Link$Element = false;
2621 LinkTail$Type.prototype.is$Link$Node = function(){return this;}; 2652 LinkTail$Type.prototype.is$Link$Node = false;
2622 LinkTail$Type.prototype.is$Link$T = function(){return this;}; 2653 LinkTail$Type.prototype.is$Link$T = function(){return this;};
2623 LinkTail$Type.prototype.is$Link$Token = function(){return this;}; 2654 LinkTail$Type.prototype.is$Link$Token = false;
2624 LinkTail$Type.prototype.is$Link$Type = function(){return this;}; 2655 LinkTail$Type.prototype.is$Link$Type = function(){return this;};
2625 LinkTail$Type.prototype.is$Iterable = function(){return this;}; 2656 LinkTail$Type.prototype.is$Iterable = function(){return this;};
2626 // ********** Code for LinkEntry ************** 2657 // ********** Code for LinkEntry **************
2627 function LinkEntry(head, realTail) { 2658 function LinkEntry(head, realTail) {
2628 this.head = head; 2659 this.head = head;
2629 this.realTail = realTail; 2660 this.realTail = realTail;
2630 // Initializers done 2661 // Initializers done
2631 AbstractLink$T.call(this); 2662 AbstractLink$T.call(this);
2632 } 2663 }
2633 $inherits(LinkEntry, AbstractLink$T); 2664 $inherits(LinkEntry, AbstractLink$T);
(...skipping 14 matching lines...) Expand all
2648 return list; 2679 return list;
2649 } 2680 }
2650 LinkEntry.prototype.isEmpty$0 = function() { 2681 LinkEntry.prototype.isEmpty$0 = function() {
2651 return this.isEmpty(); 2682 return this.isEmpty();
2652 }; 2683 };
2653 // ********** Code for LinkEntry$Dynamic ************** 2684 // ********** Code for LinkEntry$Dynamic **************
2654 function LinkEntry$Dynamic(head, realTail) { 2685 function LinkEntry$Dynamic(head, realTail) {
2655 this.head = head; 2686 this.head = head;
2656 this.realTail = realTail; 2687 this.realTail = realTail;
2657 // Initializers done 2688 // Initializers done
2658 AbstractLink$T.call(this); 2689 AbstractLink$Dynamic.call(this);
2659 } 2690 }
2660 $inherits(LinkEntry$Dynamic, LinkEntry); 2691 $inherits(LinkEntry$Dynamic, LinkEntry);
2661 // ********** Code for LinkEntry$T ************** 2692 // ********** Code for LinkEntry$T **************
2662 function LinkEntry$T(head, realTail) { 2693 function LinkEntry$T(head, realTail) {
2663 this.head = head; 2694 this.head = head;
2664 this.realTail = realTail; 2695 this.realTail = realTail;
2665 // Initializers done 2696 // Initializers done
2666 AbstractLink$T.call(this); 2697 AbstractLink$T.call(this);
2667 } 2698 }
2668 $inherits(LinkEntry$T, LinkEntry); 2699 $inherits(LinkEntry$T, LinkEntry);
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2821 } 2852 }
2822 } 2853 }
2823 // ********** Code for ArrayBasedScanner$SourceString ************** 2854 // ********** Code for ArrayBasedScanner$SourceString **************
2824 function ArrayBasedScanner$SourceString() { 2855 function ArrayBasedScanner$SourceString() {
2825 this.groupingStack = const$16/*const EmptyLink<Token>()*/ 2856 this.groupingStack = const$16/*const EmptyLink<Token>()*/
2826 this.extraCharOffset = 0; 2857 this.extraCharOffset = 0;
2827 this.tokenStart = -1; 2858 this.tokenStart = -1;
2828 this.byteOffset = -1; 2859 this.byteOffset = -1;
2829 this.tokens = new Token(0/*null.EOF_TOKEN*/, -1); 2860 this.tokens = new Token(0/*null.EOF_TOKEN*/, -1);
2830 // Initializers done 2861 // Initializers done
2831 AbstractScanner$S.call(this); 2862 AbstractScanner$SourceString.call(this);
2832 this.tail = this.tokens; 2863 this.tail = this.tokens;
2833 } 2864 }
2834 $inherits(ArrayBasedScanner$SourceString, ArrayBasedScanner); 2865 $inherits(ArrayBasedScanner$SourceString, ArrayBasedScanner);
2835 // ********** Code for top level ************** 2866 // ********** Code for top level **************
2836 // ********** Library scanner ************** 2867 // ********** Library scanner **************
2837 // ********** Code for AbstractScanner ************** 2868 // ********** Code for AbstractScanner **************
2838 function AbstractScanner() { 2869 function AbstractScanner() {
2839 // Initializers done 2870 // Initializers done
2840 } 2871 }
2841 AbstractScanner.prototype.tokenize = function() { 2872 AbstractScanner.prototype.tokenize = function() {
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
3415 next = this.advance(); 3446 next = this.advance();
3416 } 3447 }
3417 return next; 3448 return next;
3418 } 3449 }
3419 AbstractScanner.prototype.appendByteStringToken$2 = AbstractScanner.prototype.ap pendByteStringToken; 3450 AbstractScanner.prototype.appendByteStringToken$2 = AbstractScanner.prototype.ap pendByteStringToken;
3420 // ********** Code for AbstractScanner$S ************** 3451 // ********** Code for AbstractScanner$S **************
3421 function AbstractScanner$S() { 3452 function AbstractScanner$S() {
3422 // Initializers done 3453 // Initializers done
3423 } 3454 }
3424 $inherits(AbstractScanner$S, AbstractScanner); 3455 $inherits(AbstractScanner$S, AbstractScanner);
3425 AbstractScanner$S.prototype.tokenize = function() { 3456 // ********** Code for AbstractScanner$SourceString **************
3457 function AbstractScanner$SourceString() {
3458 // Initializers done
3459 }
3460 $inherits(AbstractScanner$SourceString, AbstractScanner);
3461 AbstractScanner$SourceString.prototype.tokenize = function() {
3426 var next = this.advance(); 3462 var next = this.advance();
3427 while (next != -1) { 3463 while (next != -1) {
3428 next = this.bigSwitch(next); 3464 next = this.bigSwitch(next);
3429 } 3465 }
3430 this.appendEofToken(); 3466 this.appendEofToken();
3431 return this.firstToken(); 3467 return this.firstToken();
3432 } 3468 }
3433 AbstractScanner$S.prototype.bigSwitch = function(next) { 3469 AbstractScanner$SourceString.prototype.bigSwitch = function(next) {
3434 this.beginToken(); 3470 this.beginToken();
3435 if (next === 9/*null.$TAB*/ || next === 10/*null.$LF*/ || next === 13/*null.$C R*/ || next === 32/*null.$SPACE*/) { 3471 if (next === 9/*null.$TAB*/ || next === 10/*null.$LF*/ || next === 13/*null.$C R*/ || next === 32/*null.$SPACE*/) {
3436 this.appendWhiteSpace(next); 3472 this.appendWhiteSpace(next);
3437 return this.advance(); 3473 return this.advance();
3438 } 3474 }
3439 if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) { 3475 if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) {
3440 return this.tokenizeKeywordOrIdentifier(next); 3476 return this.tokenizeKeywordOrIdentifier(next);
3441 } 3477 }
3442 if ((65/*null.$A*/ <= next && next <= 90/*null.$Z*/) || next === 95/*null.$_*/ || next === 36/*null.$DOLLAR*/) { 3478 if ((65/*null.$A*/ <= next && next <= 90/*null.$Z*/) || next === 95/*null.$_*/ || next === 36/*null.$DOLLAR*/) {
3443 return this.tokenizeIdentifier(next, this.get$byteOffset()); 3479 return this.tokenizeIdentifier(next, this.get$byteOffset());
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
3547 return this.tokenizeNumber(next); 3583 return this.tokenizeNumber(next);
3548 } 3584 }
3549 if (next === -1) { 3585 if (next === -1) {
3550 return -1; 3586 return -1;
3551 } 3587 }
3552 if (next < 0x1f) { 3588 if (next < 0x1f) {
3553 $throw(new MalformedInputException(this.get$charOffset())); 3589 $throw(new MalformedInputException(this.get$charOffset()));
3554 } 3590 }
3555 return this.tokenizeIdentifier(next, this.get$byteOffset()); 3591 return this.tokenizeIdentifier(next, this.get$byteOffset());
3556 } 3592 }
3557 AbstractScanner$S.prototype.tokenizeTag = function(next) { 3593 AbstractScanner$SourceString.prototype.tokenizeTag = function(next) {
3558 if (this.get$byteOffset() === 0) { 3594 if (this.get$byteOffset() === 0) {
3559 if (this.peek() === 33/*null.$BANG*/) { 3595 if (this.peek() === 33/*null.$BANG*/) {
3560 do { 3596 do {
3561 next = this.advance(); 3597 next = this.advance();
3562 } 3598 }
3563 while (next != 10/*null.$LF*/ && next != 13/*null.$CR*/) 3599 while (next != 10/*null.$LF*/ && next != 13/*null.$CR*/)
3564 return next; 3600 return next;
3565 } 3601 }
3566 } 3602 }
3567 this.appendStringToken(35/*null.HASH_TOKEN*/, "#"); 3603 this.appendStringToken(35/*null.HASH_TOKEN*/, "#");
3568 return this.advance(); 3604 return this.advance();
3569 } 3605 }
3570 AbstractScanner$S.prototype.tokenizeTilde = function(next) { 3606 AbstractScanner$SourceString.prototype.tokenizeTilde = function(next) {
3571 next = this.advance(); 3607 next = this.advance();
3572 if (next === 47/*null.$SLASH*/) { 3608 if (next === 47/*null.$SLASH*/) {
3573 return this.select(61/*null.$EQ*/, "~/=", "~/"); 3609 return this.select(61/*null.$EQ*/, "~/=", "~/");
3574 } 3610 }
3575 else { 3611 else {
3576 this.appendStringToken(126/*null.TILDE_TOKEN*/, "~"); 3612 this.appendStringToken(126/*null.TILDE_TOKEN*/, "~");
3577 return next; 3613 return next;
3578 } 3614 }
3579 } 3615 }
3580 AbstractScanner$S.prototype.tokenizeOpenBracket = function(next) { 3616 AbstractScanner$SourceString.prototype.tokenizeOpenBracket = function(next) {
3581 next = this.advance(); 3617 next = this.advance();
3582 if (next === 93/*null.$RBRACKET*/) { 3618 if (next === 93/*null.$RBRACKET*/) {
3583 return this.select(61/*null.$EQ*/, "[]=", "[]"); 3619 return this.select(61/*null.$EQ*/, "[]=", "[]");
3584 } 3620 }
3585 else { 3621 else {
3586 this.appendBeginGroup(91/*null.LBRACKET_TOKEN*/, "["); 3622 this.appendBeginGroup(91/*null.LBRACKET_TOKEN*/, "[");
3587 return next; 3623 return next;
3588 } 3624 }
3589 } 3625 }
3590 AbstractScanner$S.prototype.tokenizeCaret = function(next) { 3626 AbstractScanner$SourceString.prototype.tokenizeCaret = function(next) {
3591 return this.select(61/*null.$EQ*/, "^=", "^"); 3627 return this.select(61/*null.$EQ*/, "^=", "^");
3592 } 3628 }
3593 AbstractScanner$S.prototype.tokenizeBar = function(next) { 3629 AbstractScanner$SourceString.prototype.tokenizeBar = function(next) {
3594 next = this.advance(); 3630 next = this.advance();
3595 if (next === 124/*null.$BAR*/) { 3631 if (next === 124/*null.$BAR*/) {
3596 this.appendStringToken(124/*null.BAR_TOKEN*/, "||"); 3632 this.appendStringToken(124/*null.BAR_TOKEN*/, "||");
3597 return this.advance(); 3633 return this.advance();
3598 } 3634 }
3599 else if (next === 61/*null.$EQ*/) { 3635 else if (next === 61/*null.$EQ*/) {
3600 this.appendStringToken(124/*null.BAR_TOKEN*/, "|="); 3636 this.appendStringToken(124/*null.BAR_TOKEN*/, "|=");
3601 return this.advance(); 3637 return this.advance();
3602 } 3638 }
3603 else { 3639 else {
3604 this.appendStringToken(124/*null.BAR_TOKEN*/, "|"); 3640 this.appendStringToken(124/*null.BAR_TOKEN*/, "|");
3605 return next; 3641 return next;
3606 } 3642 }
3607 } 3643 }
3608 AbstractScanner$S.prototype.tokenizeAmpersand = function(next) { 3644 AbstractScanner$SourceString.prototype.tokenizeAmpersand = function(next) {
3609 next = this.advance(); 3645 next = this.advance();
3610 if (next === 38/*null.$AMPERSAND*/) { 3646 if (next === 38/*null.$AMPERSAND*/) {
3611 this.appendStringToken(38/*null.AMPERSAND_TOKEN*/, "&&"); 3647 this.appendStringToken(38/*null.AMPERSAND_TOKEN*/, "&&");
3612 return this.advance(); 3648 return this.advance();
3613 } 3649 }
3614 else if (next === 61/*null.$EQ*/) { 3650 else if (next === 61/*null.$EQ*/) {
3615 this.appendStringToken(38/*null.AMPERSAND_TOKEN*/, "&="); 3651 this.appendStringToken(38/*null.AMPERSAND_TOKEN*/, "&=");
3616 return this.advance(); 3652 return this.advance();
3617 } 3653 }
3618 else { 3654 else {
3619 this.appendStringToken(38/*null.AMPERSAND_TOKEN*/, "&"); 3655 this.appendStringToken(38/*null.AMPERSAND_TOKEN*/, "&");
3620 return next; 3656 return next;
3621 } 3657 }
3622 } 3658 }
3623 AbstractScanner$S.prototype.tokenizePercent = function(next) { 3659 AbstractScanner$SourceString.prototype.tokenizePercent = function(next) {
3624 return this.select(61/*null.$EQ*/, "%=", "%"); 3660 return this.select(61/*null.$EQ*/, "%=", "%");
3625 } 3661 }
3626 AbstractScanner$S.prototype.tokenizeMultiply = function(next) { 3662 AbstractScanner$SourceString.prototype.tokenizeMultiply = function(next) {
3627 return this.select(61/*null.$EQ*/, "*=", "*"); 3663 return this.select(61/*null.$EQ*/, "*=", "*");
3628 } 3664 }
3629 AbstractScanner$S.prototype.tokenizeMinus = function(next) { 3665 AbstractScanner$SourceString.prototype.tokenizeMinus = function(next) {
3630 next = this.advance(); 3666 next = this.advance();
3631 if (next === 45/*null.$MINUS*/) { 3667 if (next === 45/*null.$MINUS*/) {
3632 this.appendStringToken(45/*null.MINUS_TOKEN*/, "--"); 3668 this.appendStringToken(45/*null.MINUS_TOKEN*/, "--");
3633 return this.advance(); 3669 return this.advance();
3634 } 3670 }
3635 else if (next === 61/*null.$EQ*/) { 3671 else if (next === 61/*null.$EQ*/) {
3636 this.appendStringToken(45/*null.MINUS_TOKEN*/, "-="); 3672 this.appendStringToken(45/*null.MINUS_TOKEN*/, "-=");
3637 return this.advance(); 3673 return this.advance();
3638 } 3674 }
3639 else { 3675 else {
3640 this.appendStringToken(45/*null.MINUS_TOKEN*/, "-"); 3676 this.appendStringToken(45/*null.MINUS_TOKEN*/, "-");
3641 return next; 3677 return next;
3642 } 3678 }
3643 } 3679 }
3644 AbstractScanner$S.prototype.tokenizePlus = function(next) { 3680 AbstractScanner$SourceString.prototype.tokenizePlus = function(next) {
3645 next = this.advance(); 3681 next = this.advance();
3646 if (43/*null.$PLUS*/ === next) { 3682 if (43/*null.$PLUS*/ === next) {
3647 this.appendStringToken(43/*null.PLUS_TOKEN*/, "++"); 3683 this.appendStringToken(43/*null.PLUS_TOKEN*/, "++");
3648 return this.advance(); 3684 return this.advance();
3649 } 3685 }
3650 else if (61/*null.$EQ*/ === next) { 3686 else if (61/*null.$EQ*/ === next) {
3651 this.appendStringToken(43/*null.PLUS_TOKEN*/, "+="); 3687 this.appendStringToken(43/*null.PLUS_TOKEN*/, "+=");
3652 return this.advance(); 3688 return this.advance();
3653 } 3689 }
3654 else { 3690 else {
3655 this.appendStringToken(43/*null.PLUS_TOKEN*/, "+"); 3691 this.appendStringToken(43/*null.PLUS_TOKEN*/, "+");
3656 return next; 3692 return next;
3657 } 3693 }
3658 } 3694 }
3659 AbstractScanner$S.prototype.tokenizeExclamation = function(next) { 3695 AbstractScanner$SourceString.prototype.tokenizeExclamation = function(next) {
3660 next = this.advance(); 3696 next = this.advance();
3661 if (next === 61/*null.$EQ*/) { 3697 if (next === 61/*null.$EQ*/) {
3662 return this.select(61/*null.$EQ*/, "!==", "!="); 3698 return this.select(61/*null.$EQ*/, "!==", "!=");
3663 } 3699 }
3664 this.appendStringToken(33/*null.BANG_TOKEN*/, "!"); 3700 this.appendStringToken(33/*null.BANG_TOKEN*/, "!");
3665 return next; 3701 return next;
3666 } 3702 }
3667 AbstractScanner$S.prototype.tokenizeEquals = function(next) { 3703 AbstractScanner$SourceString.prototype.tokenizeEquals = function(next) {
3668 next = this.advance(); 3704 next = this.advance();
3669 if (next === 61/*null.$EQ*/) { 3705 if (next === 61/*null.$EQ*/) {
3670 return this.select(61/*null.$EQ*/, "===", "=="); 3706 return this.select(61/*null.$EQ*/, "===", "==");
3671 } 3707 }
3672 this.appendStringToken(61/*null.EQ_TOKEN*/, "="); 3708 this.appendStringToken(61/*null.EQ_TOKEN*/, "=");
3673 return next; 3709 return next;
3674 } 3710 }
3675 AbstractScanner$S.prototype.tokenizeGreaterThan = function(next) { 3711 AbstractScanner$SourceString.prototype.tokenizeGreaterThan = function(next) {
3676 next = this.advance(); 3712 next = this.advance();
3677 if (61/*null.$EQ*/ === next) { 3713 if (61/*null.$EQ*/ === next) {
3678 this.appendStringToken(62/*null.GT_TOKEN*/, ">="); 3714 this.appendStringToken(62/*null.GT_TOKEN*/, ">=");
3679 return this.advance(); 3715 return this.advance();
3680 } 3716 }
3681 else if (62/*null.$GT*/ === next) { 3717 else if (62/*null.$GT*/ === next) {
3682 next = this.advance(); 3718 next = this.advance();
3683 if (61/*null.$EQ*/ === next) { 3719 if (61/*null.$EQ*/ === next) {
3684 this.appendStringToken(62/*null.GT_TOKEN*/, ">>="); 3720 this.appendStringToken(62/*null.GT_TOKEN*/, ">>=");
3685 return this.advance(); 3721 return this.advance();
(...skipping 12 matching lines...) Expand all
3698 else { 3734 else {
3699 this.appendGtGt(62/*null.GT_TOKEN*/, ">>"); 3735 this.appendGtGt(62/*null.GT_TOKEN*/, ">>");
3700 return next; 3736 return next;
3701 } 3737 }
3702 } 3738 }
3703 else { 3739 else {
3704 this.appendEndGroup(62/*null.GT_TOKEN*/, ">", 60/*null.LT_TOKEN*/); 3740 this.appendEndGroup(62/*null.GT_TOKEN*/, ">", 60/*null.LT_TOKEN*/);
3705 return next; 3741 return next;
3706 } 3742 }
3707 } 3743 }
3708 AbstractScanner$S.prototype.tokenizeLessThan = function(next) { 3744 AbstractScanner$SourceString.prototype.tokenizeLessThan = function(next) {
3709 next = this.advance(); 3745 next = this.advance();
3710 if (61/*null.$EQ*/ === next) { 3746 if (61/*null.$EQ*/ === next) {
3711 this.appendStringToken(188/*null.LT_EQ_TOKEN*/, "<="); 3747 this.appendStringToken(188/*null.LT_EQ_TOKEN*/, "<=");
3712 return this.advance(); 3748 return this.advance();
3713 } 3749 }
3714 else if (60/*null.$LT*/ === next) { 3750 else if (60/*null.$LT*/ === next) {
3715 return this.select(61/*null.$EQ*/, "<<=", "<<"); 3751 return this.select(61/*null.$EQ*/, "<<=", "<<");
3716 } 3752 }
3717 else { 3753 else {
3718 this.appendBeginGroup(60/*null.LT_TOKEN*/, "<"); 3754 this.appendBeginGroup(60/*null.LT_TOKEN*/, "<");
3719 return next; 3755 return next;
3720 } 3756 }
3721 } 3757 }
3722 AbstractScanner$S.prototype.tokenizeNumber = function(next) { 3758 AbstractScanner$SourceString.prototype.tokenizeNumber = function(next) {
3723 var $0;
3724 var start = this.get$byteOffset(); 3759 var start = this.get$byteOffset();
3725 while (true) { 3760 while (true) {
3726 next = this.advance(); 3761 next = this.advance();
3727 if (48/*null.$0*/ <= next && next <= 57/*null.$9*/) { 3762 if (48/*null.$0*/ <= next && next <= 57/*null.$9*/) {
3728 continue; 3763 continue;
3729 } 3764 }
3730 else if (next === 46/*null.$PERIOD*/) { 3765 else if (next === 46/*null.$PERIOD*/) {
3731 return this.tokenizeFractionPart(this.advance(), start); 3766 return this.tokenizeFractionPart(this.advance(), start);
3732 } 3767 }
3733 else if (next === 101/*null.$e*/ || next === 69/*null.$E*/ || next === 100/* null.$d*/ || next === 68/*null.$D*/) { 3768 else if (next === 101/*null.$e*/ || next === 69/*null.$E*/ || next === 100/* null.$d*/ || next === 68/*null.$D*/) {
3734 return this.tokenizeFractionPart(next, start); 3769 return this.tokenizeFractionPart(next, start);
3735 } 3770 }
3736 else { 3771 else {
3737 this.appendByteStringToken$2(105/*null.INT_TOKEN*/, this.asciiString(start )); 3772 this.appendByteStringToken(105/*null.INT_TOKEN*/, this.asciiString(start)) ;
3738 return next; 3773 return next;
3739 } 3774 }
3740 } 3775 }
3741 } 3776 }
3742 AbstractScanner$S.prototype.tokenizeHexOrNumber = function(next) { 3777 AbstractScanner$SourceString.prototype.tokenizeHexOrNumber = function(next) {
3743 var x = this.peek(); 3778 var x = this.peek();
3744 if (x === 120/*null.$x*/ || x === 88/*null.$X*/) { 3779 if (x === 120/*null.$x*/ || x === 88/*null.$X*/) {
3745 this.advance(); 3780 this.advance();
3746 return this.tokenizeHex(x); 3781 return this.tokenizeHex(x);
3747 } 3782 }
3748 return this.tokenizeNumber(next); 3783 return this.tokenizeNumber(next);
3749 } 3784 }
3750 AbstractScanner$S.prototype.tokenizeHex = function(next) { 3785 AbstractScanner$SourceString.prototype.tokenizeHex = function(next) {
3751 var $0;
3752 var start = this.get$byteOffset(); 3786 var start = this.get$byteOffset();
3753 var hasDigits = false; 3787 var hasDigits = false;
3754 while (true) { 3788 while (true) {
3755 next = this.advance(); 3789 next = this.advance();
3756 if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/) || (65/*null.$A*/ <= ne xt && next <= 70/*null.$F*/) || (97/*null.$a*/ <= next && next <= 102/*null.$f*/ )) { 3790 if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/) || (65/*null.$A*/ <= ne xt && next <= 70/*null.$F*/) || (97/*null.$a*/ <= next && next <= 102/*null.$f*/ )) {
3757 hasDigits = true; 3791 hasDigits = true;
3758 } 3792 }
3759 else { 3793 else {
3760 if (!$notnull_bool(hasDigits)) { 3794 if (!$notnull_bool(hasDigits)) {
3761 $throw(new MalformedInputException(this.get$charOffset())); 3795 $throw(new MalformedInputException(this.get$charOffset()));
3762 } 3796 }
3763 this.appendByteStringToken$2(120/*null.HEXADECIMAL_TOKEN*/, this.asciiStri ng(start)); 3797 this.appendByteStringToken(120/*null.HEXADECIMAL_TOKEN*/, this.asciiString (start));
3764 return next; 3798 return next;
3765 } 3799 }
3766 } 3800 }
3767 } 3801 }
3768 AbstractScanner$S.prototype.tokenizeDotOrNumber = function(next) { 3802 AbstractScanner$SourceString.prototype.tokenizeDotOrNumber = function(next) {
3769 var start = this.get$byteOffset(); 3803 var start = this.get$byteOffset();
3770 next = this.advance(); 3804 next = this.advance();
3771 if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/)) { 3805 if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/)) {
3772 return this.tokenizeFractionPart(next, start); 3806 return this.tokenizeFractionPart(next, start);
3773 } 3807 }
3774 else if (46/*null.$PERIOD*/ === next) { 3808 else if (46/*null.$PERIOD*/ === next) {
3775 return this.select(46/*null.$PERIOD*/, "...", ".."); 3809 return this.select(46/*null.$PERIOD*/, "...", "..");
3776 } 3810 }
3777 else { 3811 else {
3778 this.appendStringToken(46/*null.PERIOD_TOKEN*/, "."); 3812 this.appendStringToken(46/*null.PERIOD_TOKEN*/, ".");
3779 return next; 3813 return next;
3780 } 3814 }
3781 } 3815 }
3782 AbstractScanner$S.prototype.tokenizeFractionPart = function(next, start) { 3816 AbstractScanner$SourceString.prototype.tokenizeFractionPart = function(next, sta rt) {
3783 var $0;
3784 var done = false; 3817 var done = false;
3785 LOOP: 3818 LOOP:
3786 while (!$notnull_bool(done)) { 3819 while (!$notnull_bool(done)) {
3787 if (48/*null.$0*/ <= next && next <= 57/*null.$9*/) { 3820 if (48/*null.$0*/ <= next && next <= 57/*null.$9*/) {
3788 } 3821 }
3789 else if (101/*null.$e*/ === next || 69/*null.$E*/ === next) { 3822 else if (101/*null.$e*/ === next || 69/*null.$E*/ === next) {
3790 next = this.tokenizeExponent(this.advance()); 3823 next = this.tokenizeExponent(this.advance());
3791 done = true; 3824 done = true;
3792 continue LOOP; 3825 continue LOOP;
3793 } 3826 }
3794 else { 3827 else {
3795 done = true; 3828 done = true;
3796 continue LOOP; 3829 continue LOOP;
3797 } 3830 }
3798 next = this.advance(); 3831 next = this.advance();
3799 } 3832 }
3800 if (next === 100/*null.$d*/ || next === 68/*null.$D*/) { 3833 if (next === 100/*null.$d*/ || next === 68/*null.$D*/) {
3801 next = this.advance(); 3834 next = this.advance();
3802 } 3835 }
3803 this.appendByteStringToken$2(100/*null.DOUBLE_TOKEN*/, this.asciiString(start) ); 3836 this.appendByteStringToken(100/*null.DOUBLE_TOKEN*/, this.asciiString(start));
3804 return next; 3837 return next;
3805 } 3838 }
3806 AbstractScanner$S.prototype.tokenizeExponent = function(next) { 3839 AbstractScanner$SourceString.prototype.tokenizeExponent = function(next) {
3807 if (next === 43/*null.$PLUS*/ || next === 45/*null.$MINUS*/) { 3840 if (next === 43/*null.$PLUS*/ || next === 45/*null.$MINUS*/) {
3808 next = this.advance(); 3841 next = this.advance();
3809 } 3842 }
3810 var hasDigits = false; 3843 var hasDigits = false;
3811 while (true) { 3844 while (true) {
3812 if (48/*null.$0*/ <= next && next <= 57/*null.$9*/) { 3845 if (48/*null.$0*/ <= next && next <= 57/*null.$9*/) {
3813 hasDigits = true; 3846 hasDigits = true;
3814 } 3847 }
3815 else { 3848 else {
3816 if (!$notnull_bool(hasDigits)) { 3849 if (!$notnull_bool(hasDigits)) {
3817 $throw(new MalformedInputException(this.get$charOffset())); 3850 $throw(new MalformedInputException(this.get$charOffset()));
3818 } 3851 }
3819 return next; 3852 return next;
3820 } 3853 }
3821 next = this.advance(); 3854 next = this.advance();
3822 } 3855 }
3823 } 3856 }
3824 AbstractScanner$S.prototype.tokenizeSlashOrComment = function(next) { 3857 AbstractScanner$SourceString.prototype.tokenizeSlashOrComment = function(next) {
3825 next = this.advance(); 3858 next = this.advance();
3826 if (42/*null.$STAR*/ === next) { 3859 if (42/*null.$STAR*/ === next) {
3827 return this.tokenizeMultiLineComment(next); 3860 return this.tokenizeMultiLineComment(next);
3828 } 3861 }
3829 else if (47/*null.$SLASH*/ === next) { 3862 else if (47/*null.$SLASH*/ === next) {
3830 return this.tokenizeSingleLineComment(next); 3863 return this.tokenizeSingleLineComment(next);
3831 } 3864 }
3832 else if (61/*null.$EQ*/ === next) { 3865 else if (61/*null.$EQ*/ === next) {
3833 this.appendStringToken(47/*null.SLASH_TOKEN*/, "/="); 3866 this.appendStringToken(47/*null.SLASH_TOKEN*/, "/=");
3834 return this.advance(); 3867 return this.advance();
3835 } 3868 }
3836 else { 3869 else {
3837 this.appendStringToken(47/*null.SLASH_TOKEN*/, "/"); 3870 this.appendStringToken(47/*null.SLASH_TOKEN*/, "/");
3838 return next; 3871 return next;
3839 } 3872 }
3840 } 3873 }
3841 AbstractScanner$S.prototype.tokenizeSingleLineComment = function(next) { 3874 AbstractScanner$SourceString.prototype.tokenizeSingleLineComment = function(next ) {
3842 while (true) { 3875 while (true) {
3843 next = this.advance(); 3876 next = this.advance();
3844 if (10/*null.$LF*/ === next || 13/*null.$CR*/ === next || -1 === next) { 3877 if (10/*null.$LF*/ === next || 13/*null.$CR*/ === next || -1 === next) {
3845 return next; 3878 return next;
3846 } 3879 }
3847 } 3880 }
3848 } 3881 }
3849 AbstractScanner$S.prototype.tokenizeMultiLineComment = function(next) { 3882 AbstractScanner$SourceString.prototype.tokenizeMultiLineComment = function(next) {
3850 next = this.advance(); 3883 next = this.advance();
3851 while (true) { 3884 while (true) {
3852 if (-1 === next) { 3885 if (-1 === next) {
3853 return next; 3886 return next;
3854 } 3887 }
3855 else if (42/*null.$STAR*/ === next) { 3888 else if (42/*null.$STAR*/ === next) {
3856 next = this.advance(); 3889 next = this.advance();
3857 if (next === 47/*null.$SLASH*/) { 3890 if (next === 47/*null.$SLASH*/) {
3858 return this.advance(); 3891 return this.advance();
3859 } 3892 }
3860 else if (next === -1) { 3893 else if (next === -1) {
3861 return next; 3894 return next;
3862 } 3895 }
3863 } 3896 }
3864 else { 3897 else {
3865 next = this.advance(); 3898 next = this.advance();
3866 } 3899 }
3867 } 3900 }
3868 } 3901 }
3869 AbstractScanner$S.prototype.tokenizeKeywordOrIdentifier = function(next) { 3902 AbstractScanner$SourceString.prototype.tokenizeKeywordOrIdentifier = function(ne xt) {
3870 var state = KeywordState.get$KEYWORD_STATE(); 3903 var state = KeywordState.get$KEYWORD_STATE();
3871 var start = this.get$byteOffset(); 3904 var start = this.get$byteOffset();
3872 while (state != null && 97/*null.$a*/ <= next && next <= 122/*null.$z*/) { 3905 while (state != null && 97/*null.$a*/ <= next && next <= 122/*null.$z*/) {
3873 state = state.next(next); 3906 state = state.next(next);
3874 next = this.advance(); 3907 next = this.advance();
3875 } 3908 }
3876 if (state == null || !$notnull_bool(state.isLeaf())) { 3909 if (state == null || !$notnull_bool(state.isLeaf())) {
3877 return this.tokenizeIdentifier(next, start); 3910 return this.tokenizeIdentifier(next, start);
3878 } 3911 }
3879 if ((65/*null.$A*/ <= next && next <= 90/*null.$Z*/) || (48/*null.$0*/ <= next && next <= 57/*null.$9*/) || next === 95/*null.$_*/ || next === 36/*null.$DOLLA R*/) { 3912 if ((65/*null.$A*/ <= next && next <= 90/*null.$Z*/) || (48/*null.$0*/ <= next && next <= 57/*null.$9*/) || next === 95/*null.$_*/ || next === 36/*null.$DOLLA R*/) {
3880 return this.tokenizeIdentifier(next, start); 3913 return this.tokenizeIdentifier(next, start);
3881 } 3914 }
3882 else if (next < 128) { 3915 else if (next < 128) {
3883 this.appendKeywordToken(state.get$keyword()); 3916 this.appendKeywordToken(state.get$keyword());
3884 return next; 3917 return next;
3885 } 3918 }
3886 else { 3919 else {
3887 return this.tokenizeIdentifier(next, start); 3920 return this.tokenizeIdentifier(next, start);
3888 } 3921 }
3889 } 3922 }
3890 AbstractScanner$S.prototype.tokenizeIdentifier = function(next, start) { 3923 AbstractScanner$SourceString.prototype.tokenizeIdentifier = function(next, start ) {
3891 var $0;
3892 var isAscii = true; 3924 var isAscii = true;
3893 while (true) { 3925 while (true) {
3894 if ((97/*null.$a*/ <= next && next <= 122/*null.$z*/) || (65/*null.$A*/ <= n ext && next <= 90/*null.$Z*/) || (48/*null.$0*/ <= next && next <= 57/*null.$9*/ ) || next === 95/*null.$_*/ || next === 36/*null.$DOLLAR*/) { 3926 if ((97/*null.$a*/ <= next && next <= 122/*null.$z*/) || (65/*null.$A*/ <= n ext && next <= 90/*null.$Z*/) || (48/*null.$0*/ <= next && next <= 57/*null.$9*/ ) || next === 95/*null.$_*/ || next === 36/*null.$DOLLAR*/) {
3895 next = this.advance(); 3927 next = this.advance();
3896 } 3928 }
3897 else if (next < 128) { 3929 else if (next < 128) {
3898 if ($notnull_bool(isAscii)) { 3930 if ($notnull_bool(isAscii)) {
3899 this.appendByteStringToken$2(97/*null.IDENTIFIER_TOKEN*/, this.asciiStri ng(start)); 3931 this.appendByteStringToken(97/*null.IDENTIFIER_TOKEN*/, this.asciiString (start));
3900 } 3932 }
3901 else { 3933 else {
3902 this.appendByteStringToken$2(97/*null.IDENTIFIER_TOKEN*/, this.utf8Strin g(start, -1)); 3934 this.appendByteStringToken(97/*null.IDENTIFIER_TOKEN*/, this.utf8String( start, -1));
3903 } 3935 }
3904 return next; 3936 return next;
3905 } 3937 }
3906 else { 3938 else {
3907 var nonAsciiStart = this.get$byteOffset(); 3939 var nonAsciiStart = this.get$byteOffset();
3908 do { 3940 do {
3909 next = this.nextByte(); 3941 next = this.nextByte();
3910 } 3942 }
3911 while (next > 127) 3943 while (next > 127)
3912 var string = this.utf8String(nonAsciiStart, -1).toString$0(); 3944 var string = this.utf8String(nonAsciiStart, -1).toString();
3913 isAscii = false; 3945 isAscii = false;
3914 var byteLength = nonAsciiStart - this.get$byteOffset(); 3946 var byteLength = nonAsciiStart - this.get$byteOffset();
3915 this.addToCharOffset(string.length - byteLength); 3947 this.addToCharOffset(string.length - byteLength);
3916 } 3948 }
3917 } 3949 }
3918 } 3950 }
3919 AbstractScanner$S.prototype.tokenizeRawString = function(next) { 3951 AbstractScanner$SourceString.prototype.tokenizeRawString = function(next) {
3920 var start = this.get$byteOffset(); 3952 var start = this.get$byteOffset();
3921 next = this.advance(); 3953 next = this.advance();
3922 if (next === 34/*null.$DQ*/ || next === 39/*null.$SQ*/) { 3954 if (next === 34/*null.$DQ*/ || next === 39/*null.$SQ*/) {
3923 return this.tokenizeString(next, start, true); 3955 return this.tokenizeString(next, start, true);
3924 } 3956 }
3925 else { 3957 else {
3926 $throw(new MalformedInputException(this.get$charOffset())); 3958 $throw(new MalformedInputException(this.get$charOffset()));
3927 } 3959 }
3928 } 3960 }
3929 AbstractScanner$S.prototype.tokenizeString = function(next, start, raw) { 3961 AbstractScanner$SourceString.prototype.tokenizeString = function(next, start, ra w) {
3930 var $0;
3931 var q = next; 3962 var q = next;
3932 next = this.advance(); 3963 next = this.advance();
3933 if (q === next) { 3964 if (q === next) {
3934 next = this.advance(); 3965 next = this.advance();
3935 if (q === next) { 3966 if (q === next) {
3936 return this.tokenizeMultiLineString(q, start, raw); 3967 return this.tokenizeMultiLineString(q, start, raw);
3937 } 3968 }
3938 else { 3969 else {
3939 this.appendByteStringToken$2(39/*null.STRING_TOKEN*/, this.utf8String(star t, -1)); 3970 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start, -1));
3940 return next; 3971 return next;
3941 } 3972 }
3942 } 3973 }
3943 if ($notnull_bool(raw)) { 3974 if ($notnull_bool(raw)) {
3944 return this.tokenizeSingleLineRawString(next, q, start); 3975 return this.tokenizeSingleLineRawString(next, q, start);
3945 } 3976 }
3946 else { 3977 else {
3947 return this.tokenizeSingleLineString(next, q, start); 3978 return this.tokenizeSingleLineString(next, q, start);
3948 } 3979 }
3949 } 3980 }
3950 AbstractScanner$S.prototype.tokenizeSingleLineString = function(next, q1, start) { 3981 AbstractScanner$SourceString.prototype.tokenizeSingleLineString = function(next, q1, start) {
3951 var $0;
3952 while (next != -1) { 3982 while (next != -1) {
3953 if (next === q1) { 3983 if (next === q1) {
3954 this.appendByteStringToken$2(39/*null.STRING_TOKEN*/, this.utf8String(star t, 0)); 3984 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start, 0));
3955 return this.advance(); 3985 return this.advance();
3956 } 3986 }
3957 else if (next === 92/*null.$BACKSLASH*/) { 3987 else if (next === 92/*null.$BACKSLASH*/) {
3958 next = this.advance(); 3988 next = this.advance();
3959 if (next === -1) { 3989 if (next === -1) {
3960 $throw(new MalformedInputException(this.get$charOffset())); 3990 $throw(new MalformedInputException(this.get$charOffset()));
3961 } 3991 }
3962 } 3992 }
3963 else if (next === 10/*null.$LF*/ || next === 13/*null.$CR*/) { 3993 else if (next === 10/*null.$LF*/ || next === 13/*null.$CR*/) {
3964 $throw(new MalformedInputException(this.get$charOffset())); 3994 $throw(new MalformedInputException(this.get$charOffset()));
3965 } 3995 }
3966 next = this.advance(); 3996 next = this.advance();
3967 } 3997 }
3968 $throw(new MalformedInputException(this.get$charOffset())); 3998 $throw(new MalformedInputException(this.get$charOffset()));
3969 } 3999 }
3970 AbstractScanner$S.prototype.tokenizeSingleLineRawString = function(next, q1, sta rt) { 4000 AbstractScanner$SourceString.prototype.tokenizeSingleLineRawString = function(ne xt, q1, start) {
3971 var $0;
3972 next = this.advance(); 4001 next = this.advance();
3973 while (next != -1) { 4002 while (next != -1) {
3974 if (next === q1) { 4003 if (next === q1) {
3975 this.appendByteStringToken$2(39/*null.STRING_TOKEN*/, this.utf8String(star t, 0)); 4004 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start, 0));
3976 return this.advance(); 4005 return this.advance();
3977 } 4006 }
3978 else if (next === 10/*null.$LF*/ || next === 13/*null.$CR*/) { 4007 else if (next === 10/*null.$LF*/ || next === 13/*null.$CR*/) {
3979 $throw(new MalformedInputException(this.get$charOffset())); 4008 $throw(new MalformedInputException(this.get$charOffset()));
3980 } 4009 }
3981 next = this.advance(); 4010 next = this.advance();
3982 } 4011 }
3983 $throw(new MalformedInputException(this.get$charOffset())); 4012 $throw(new MalformedInputException(this.get$charOffset()));
3984 } 4013 }
3985 AbstractScanner$S.prototype.tokenizeMultiLineString = function(q, start, raw) { 4014 AbstractScanner$SourceString.prototype.tokenizeMultiLineString = function(q, sta rt, raw) {
3986 var $0;
3987 var next = this.advance(); 4015 var next = this.advance();
3988 while (next != -1) { 4016 while (next != -1) {
3989 if (next === q) { 4017 if (next === q) {
3990 next = this.advance(); 4018 next = this.advance();
3991 if (next === q) { 4019 if (next === q) {
3992 next = this.advance(); 4020 next = this.advance();
3993 if (next === q) { 4021 if (next === q) {
3994 this.appendByteStringToken$2(39/*null.STRING_TOKEN*/, this.utf8String( start, 0)); 4022 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(st art, 0));
3995 return this.advance(); 4023 return this.advance();
3996 } 4024 }
3997 } 4025 }
3998 } 4026 }
3999 next = this.advance(); 4027 next = this.advance();
4000 } 4028 }
4001 return next; 4029 return next;
4002 } 4030 }
4003 // ********** Code for MalformedInputException ************** 4031 // ********** Code for MalformedInputException **************
4004 function MalformedInputException(message) { 4032 function MalformedInputException(message) {
(...skipping 2127 matching lines...) Expand 10 before | Expand all | Expand 10 after
6132 if ($globals.KeywordState__KEYWORD_STATE == null) { 6160 if ($globals.KeywordState__KEYWORD_STATE == null) {
6133 var strings = new ListFactory(const$112/*Keyword.values*/.get$length()); 6161 var strings = new ListFactory(const$112/*Keyword.values*/.get$length());
6134 for (var i = 0; 6162 for (var i = 0;
6135 i < const$112/*Keyword.values*/.get$length(); i++) { 6163 i < const$112/*Keyword.values*/.get$length(); i++) {
6136 strings.$setindex(i, const$112/*Keyword.values*/[i].get$syntax()); 6164 strings.$setindex(i, const$112/*Keyword.values*/[i].get$syntax());
6137 } 6165 }
6138 strings.sort((function (a, b) { 6166 strings.sort((function (a, b) {
6139 return a.compareTo$1(b); 6167 return a.compareTo$1(b);
6140 }) 6168 })
6141 ); 6169 );
6142 $globals.KeywordState__KEYWORD_STATE = KeywordState.computeKeywordStateTable (0, strings, 0, strings.length); 6170 $globals.KeywordState__KEYWORD_STATE = KeywordState.computeKeywordStateTable (0, strings, 0, $assert_num(strings.length));
6143 } 6171 }
6144 return $globals.KeywordState__KEYWORD_STATE; 6172 return $globals.KeywordState__KEYWORD_STATE;
6145 } 6173 }
6146 KeywordState.computeKeywordStateTable = function(start, strings, offset, length) { 6174 KeywordState.computeKeywordStateTable = function(start, strings, offset, length) {
6147 var result = new ListFactory(26); 6175 var result = new ListFactory(26);
6148 $assert(length != 0, "length != 0", "keyword.dart", 161, 12); 6176 $assert(length != 0, "length != 0", "keyword.dart", 161, 12);
6149 var chunk = 0; 6177 var chunk = 0;
6150 var chunkStart = -1; 6178 var chunkStart = -1;
6151 for (var i = offset; 6179 for (var i = offset;
6152 i < offset + length; i++) { 6180 i < offset + length; i++) {
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
7645 }) 7673 })
7646 )); 7674 ));
7647 } 7675 }
7648 SsaCodeGeneratorTask.prototype.generateMethod = function(methodName, parameterNa mes, graph) { 7676 SsaCodeGeneratorTask.prototype.generateMethod = function(methodName, parameterNa mes, graph) {
7649 new SsaPhiEliminator().visitGraph(graph); 7677 new SsaPhiEliminator().visitGraph(graph);
7650 var buffer = new StringBufferImpl(""); 7678 var buffer = new StringBufferImpl("");
7651 var codegen = new SsaCodeGenerator(this.compiler, buffer, parameterNames); 7679 var codegen = new SsaCodeGenerator(this.compiler, buffer, parameterNames);
7652 codegen.visitGraph(graph); 7680 codegen.visitGraph(graph);
7653 var parameters = new StringBufferImpl(""); 7681 var parameters = new StringBufferImpl("");
7654 for (var i = 0; 7682 for (var i = 0;
7655 i < parameterNames.length; i++) { 7683 i < $assert_num(parameterNames.length); i++) {
7656 if (i != 0) parameters.add(', '); 7684 if (i != 0) parameters.add(', ');
7657 parameters.add(parameterNames.$index(i)); 7685 parameters.add(parameterNames.$index(i));
7658 } 7686 }
7659 return ('function ' + methodName + '(' + parameters + ') {\n' + buffer + '}\n' ); 7687 return ('function ' + methodName + '(' + parameters + ') {\n' + buffer + '}\n' );
7660 } 7688 }
7661 // ********** Code for SsaCodeGenerator ************** 7689 // ********** Code for SsaCodeGenerator **************
7662 function SsaCodeGenerator(compiler, buffer, parameterNames) { 7690 function SsaCodeGenerator(compiler, buffer, parameterNames) {
7663 this.indent = 0 7691 this.indent = 0
7664 this.compiler = compiler; 7692 this.compiler = compiler;
7665 this.buffer = buffer; 7693 this.buffer = buffer;
(...skipping 3137 matching lines...) Expand 10 before | Expand all | Expand 10 after
10803 $globals.world.get$coreimpl().types.$index('StringImplementation').markUsed$0( ); 10831 $globals.world.get$coreimpl().types.$index('StringImplementation').markUsed$0( );
10804 this.genMethod((($0 = $globals.world.get$coreimpl().types.$index('StringImplem entation').getMember$1('contains')) && $0.is$Member())); 10832 this.genMethod((($0 = $globals.world.get$coreimpl().types.$index('StringImplem entation').getMember$1('contains')) && $0.is$Member()));
10805 if ($notnull_bool($globals.world.corelib.types.$index('Isolate').get$isUsed()) || $notnull_bool($globals.world.get$coreimpl().types.$index('ReceivePortImpl'). get$isUsed())) { 10833 if ($notnull_bool($globals.world.corelib.types.$index('Isolate').get$isUsed()) || $notnull_bool($globals.world.get$coreimpl().types.$index('ReceivePortImpl'). get$isUsed())) {
10806 this.corejs.useIsolates = true; 10834 this.corejs.useIsolates = true;
10807 var isolateMain = (($0 = $globals.world.get$coreimpl().topType.resolveMember ('startRootIsolate').members.$index(0)) && $0.is$MethodMember()); 10835 var isolateMain = (($0 = $globals.world.get$coreimpl().topType.resolveMember ('startRootIsolate').members.$index(0)) && $0.is$MethodMember());
10808 mainCall = isolateMain.invoke((metaGen && metaGen.is$MethodGenerator()), nul l, null, new Arguments(null, [this.main._get((metaGen && metaGen.is$MethodGenera tor()), this.main.definition, null, false)]), false); 10836 mainCall = isolateMain.invoke((metaGen && metaGen.is$MethodGenerator()), nul l, null, new Arguments(null, [this.main._get((metaGen && metaGen.is$MethodGenera tor()), this.main.definition, null, false)]), false);
10809 } 10837 }
10810 this.writeTypes($globals.world.get$coreimpl()); 10838 this.writeTypes($globals.world.get$coreimpl());
10811 this.writeTypes($globals.world.corelib); 10839 this.writeTypes($globals.world.corelib);
10812 this.writeTypes(this.main.declaringType.get$library()); 10840 this.writeTypes(this.main.declaringType.get$library());
10841 if (this._mixins != null) this.writer.write(this._mixins.get$text());
10813 this.writeGlobals(); 10842 this.writeGlobals();
10814 this.writer.writeln(('' + mainCall.get$code() + ';')); 10843 this.writer.writeln(('' + mainCall.get$code() + ';'));
10815 } 10844 }
10816 WorldGenerator.prototype.globalForStaticField = function(field, fieldValue, depe ndencies) { 10845 WorldGenerator.prototype.globalForStaticField = function(field, fieldValue, depe ndencies) {
10817 var $0; 10846 var $0;
10818 this.hasStatics = true; 10847 this.hasStatics = true;
10819 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname ()); 10848 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname ());
10820 if (!this.globals.containsKey(fullname)) { 10849 if (!this.globals.containsKey(fullname)) {
10821 this.globals.$setindex(fullname, GlobalValue.GlobalValue$fromStatic$factory( field, fieldValue, dependencies)); 10850 this.globals.$setindex(fullname, GlobalValue.GlobalValue$fromStatic$factory( field, fieldValue, dependencies));
10822 } 10851 }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
10928 var $list = type.get$constructors().getValues(); 10957 var $list = type.get$constructors().getValues();
10929 for (var $i = type.get$constructors().getValues().iterator$0(); $i.hasNext$0 (); ) { 10958 for (var $i = type.get$constructors().getValues().iterator$0(); $i.hasNext$0 (); ) {
10930 var c = $i.next$0(); 10959 var c = $i.next$0();
10931 if ($notnull_bool($ne(c.get$generator(), null)) && $notnull_bool($ne(c, st andardConstructor))) { 10960 if ($notnull_bool($ne(c.get$generator(), null)) && $notnull_bool($ne(c, st andardConstructor))) {
10932 c.get$generator().writeDefinition$2(this.writer); 10961 c.get$generator().writeDefinition$2(this.writer);
10933 } 10962 }
10934 } 10963 }
10935 } 10964 }
10936 if (!$notnull_bool(type.get$isTop())) { 10965 if (!$notnull_bool(type.get$isTop())) {
10937 if ((type instanceof ConcreteType)) { 10966 if ((type instanceof ConcreteType)) {
10967 var c = (type && type.is$ConcreteType());
10938 this._ensureInheritsHelper(); 10968 this._ensureInheritsHelper();
10939 this.writer.writeln(('\$inherits(' + type.get$jsname() + ', ' + type.get$g enericType().get$jsname() + ');')); 10969 this.writer.writeln(('\$inherits(' + c.get$jsname() + ', ' + c.genericType .get$jsname() + ');'));
10970 for (var p = c._parent;
10971 (p instanceof ConcreteType); p = p._parent) {
10972 this._ensureInheritMembersHelper();
10973 this._mixins.writeln(('\$inheritsMembers(' + c.get$jsname() + ', ' + p.g et$jsname() + ');'));
10974 }
10940 } 10975 }
10941 else if (!$notnull_bool(type.get$isNativeType())) { 10976 else if (!$notnull_bool(type.get$isNativeType())) {
10942 if (type.get$parent() != null && !$notnull_bool(type.get$parent().get$isOb ject())) { 10977 if (type.get$parent() != null && !$notnull_bool(type.get$parent().get$isOb ject())) {
10943 this._ensureInheritsHelper(); 10978 this._ensureInheritsHelper();
10944 this.writer.writeln(('\$inherits(' + type.get$jsname() + ', ' + type.get $parent().get$jsname() + ');')); 10979 this.writer.writeln(('\$inherits(' + type.get$jsname() + ', ' + type.get $parent().get$jsname() + ');'));
10945 } 10980 }
10946 } 10981 }
10947 } 10982 }
10948 if (!(type instanceof ConcreteType)) { 10983 if (!(type instanceof ConcreteType)) {
10949 this._maybeIsTest(type, type); 10984 this._maybeIsTest(type, type);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
10994 this._writeMethod((member && member.is$Member())); 11029 this._writeMethod((member && member.is$Member()));
10995 } 11030 }
10996 } 11031 }
10997 this._writeDynamicStubs(type); 11032 this._writeDynamicStubs(type);
10998 } 11033 }
10999 WorldGenerator.prototype._ensureInheritsHelper = function() { 11034 WorldGenerator.prototype._ensureInheritsHelper = function() {
11000 if ($notnull_bool(this._inheritsGenerated)) return; 11035 if ($notnull_bool(this._inheritsGenerated)) return;
11001 this._inheritsGenerated = true; 11036 this._inheritsGenerated = true;
11002 this.writer.writeln("/** Implements extends for Dart classes on JavaScript pro totypes. */\nfunction $inherits(child, parent) {\n if (child.prototype.__proto_ _) {\n child.prototype.__proto__ = parent.prototype;\n } else {\n functio n tmp() {};\n tmp.prototype = parent.prototype;\n child.prototype = new tm p();\n child.prototype.constructor = child;\n }\n}"); 11037 this.writer.writeln("/** Implements extends for Dart classes on JavaScript pro totypes. */\nfunction $inherits(child, parent) {\n if (child.prototype.__proto_ _) {\n child.prototype.__proto__ = parent.prototype;\n } else {\n functio n tmp() {};\n tmp.prototype = parent.prototype;\n child.prototype = new tm p();\n child.prototype.constructor = child;\n }\n}");
11003 } 11038 }
11039 WorldGenerator.prototype._ensureInheritMembersHelper = function() {
11040 if (this._mixins != null) return;
11041 this._mixins = new CodeWriter();
11042 this._mixins.comment('// ********** Generic Type Inheritance **************');
11043 this._mixins.writeln("/** Implements extends for generic types. */\nfunction $ inheritsMembers(child, parent) {\n child = child.prototype;\n parent = parent. prototype;\n Object.getOwnPropertyNames(parent).forEach(function(name) {\n i f (typeof(child[name]) == 'undefined') child[name] = parent[name];\n });\n}");
11044 }
11004 WorldGenerator.prototype._writeDynamicStubs = function(type) { 11045 WorldGenerator.prototype._writeDynamicStubs = function(type) {
11005 if (type.varStubs != null) { 11046 if (type.varStubs != null) {
11006 var $list = orderValuesByKeys(type.varStubs); 11047 var $list = orderValuesByKeys(type.varStubs);
11007 for (var $i = 0;$i < $list.length; $i++) { 11048 for (var $i = 0;$i < $list.length; $i++) {
11008 var stub = $list.$index($i); 11049 var stub = $list.$index($i);
11009 stub.generate$1(this.writer); 11050 stub.generate$1(this.writer);
11010 } 11051 }
11011 } 11052 }
11012 } 11053 }
11013 WorldGenerator.prototype._writeStaticField = function(field) { 11054 WorldGenerator.prototype._writeStaticField = function(field) {
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
11349 else if ($notnull_bool(this.method.get$isStatic())) { 11390 else if ($notnull_bool(this.method.get$isStatic())) {
11350 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + th is.method.get$jsname() + ' = function' + _params + ' {')); 11391 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + th is.method.get$jsname() + ' = function' + _params + ' {'));
11351 } 11392 }
11352 else { 11393 else {
11353 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot ype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {')); 11394 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot ype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {'));
11354 } 11395 }
11355 if ($notnull_bool(this.needsThis)) { 11396 if ($notnull_bool(this.needsThis)) {
11356 defWriter.writeln('var \$this = this; // closure support'); 11397 defWriter.writeln('var \$this = this; // closure support');
11357 } 11398 }
11358 if (this._usedTemps.get$length() > 0 || this._freeTemps.length > 0) { 11399 if (this._usedTemps.get$length() > 0 || this._freeTemps.length > 0) {
11359 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da rt", 736, 14); 11400 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da rt", 769, 14);
11360 this._freeTemps.addAll(this._usedTemps); 11401 this._freeTemps.addAll(this._usedTemps);
11361 this._freeTemps.sort((function (x, y) { 11402 this._freeTemps.sort((function (x, y) {
11362 return x.compareTo$1(y); 11403 return x.compareTo$1(y);
11363 }) 11404 })
11364 ); 11405 );
11365 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';')); 11406 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';'));
11366 } 11407 }
11367 defWriter.writeln(this.writer.get$text()); 11408 defWriter.writeln(this.writer.get$text());
11368 if ($notnull_bool($ne(names, null))) { 11409 if ($notnull_bool($ne(names, null))) {
11369 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List $String()), ", ") + ')')); 11410 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List $String()), ", ") + ')'));
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
11420 var optional = "['" + Strings.join((optNames && optNames.is$List$String( )), "', '") + "']"; 11461 var optional = "['" + Strings.join((optNames && optNames.is$List$String( )), "', '") + "']";
11421 defWriter.writeln(('' + start + meth.get$jsname() + '.\$optional = ' + o ptional)); 11462 defWriter.writeln(('' + start + meth.get$jsname() + '.\$optional = ' + o ptional));
11422 } 11463 }
11423 } 11464 }
11424 } 11465 }
11425 } 11466 }
11426 MethodGenerator.prototype.writeBody = function() { 11467 MethodGenerator.prototype.writeBody = function() {
11427 var $0; 11468 var $0;
11428 var initializers = null; 11469 var initializers = null;
11429 var initializedFields = null; 11470 var initializedFields = null;
11471 var allMembers = null;
11430 if ($notnull_bool(this.method.get$isConstructor())) { 11472 if ($notnull_bool(this.method.get$isConstructor())) {
11431 initializers = []; 11473 initializers = [];
11432 initializedFields = new HashSetImplementation(); 11474 initializedFields = new HashSetImplementation();
11433 var $list = $globals.world.gen._orderValues(this.method.declaringType.getAll Members()); 11475 allMembers = $globals.world.gen._orderValues(this.method.declaringType.getAl lMembers());
11434 for (var $i = 0;$i < $list.length; $i++) { 11476 for (var $i = allMembers.iterator$0(); $i.hasNext$0(); ) {
11435 var f = $list.$index($i); 11477 var f = $i.next$0();
11436 if ((f instanceof FieldMember) && !$notnull_bool(f.get$isStatic())) { 11478 if ($notnull_bool(f.get$isField()) && !$notnull_bool(f.get$isStatic())) {
11437 var cv = f.computeValue$0(); 11479 var cv = f.computeValue$0();
11438 if ($notnull_bool($ne(cv, null))) { 11480 if ($notnull_bool($ne(cv, null))) {
11439 initializers.add$1(('this.' + f.get$jsname() + ' = ' + cv.get$code())) ; 11481 initializers.add$1(('this.' + f.get$jsname() + ' = ' + cv.get$code())) ;
11440 initializedFields.add$1(f.get$name()); 11482 initializedFields.add$1(f.get$name());
11441 } 11483 }
11442 } 11484 }
11443 } 11485 }
11444 } 11486 }
11445 this._paramCode = []; 11487 this._paramCode = [];
11446 var $list = this.method.get$parameters(); 11488 var $list = this.method.get$parameters();
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
11529 } 11571 }
11530 } 11572 }
11531 if ($notnull_bool($ne(declaredInitializers, null)) && declaredInitializers .length > 1) { 11573 if ($notnull_bool($ne(declaredInitializers, null)) && declaredInitializers .length > 1) {
11532 var init = $notnull_bool($eq(declaredInitializers.$index(0), initializer Call)) ? declaredInitializers.$index(1) : declaredInitializers.$index(0); 11574 var init = $notnull_bool($eq(declaredInitializers.$index(0), initializer Call)) ? declaredInitializers.$index(1) : declaredInitializers.$index(0);
11533 $globals.world.error('no initialization allowed on redirecting construct ors', (($0 = init.get$span()) && $0.is$SourceSpan())); 11575 $globals.world.error('no initialization allowed on redirecting construct ors', (($0 = init.get$span()) && $0.is$SourceSpan()));
11534 } 11576 }
11535 initializedFields = null; 11577 initializedFields = null;
11536 } 11578 }
11537 } 11579 }
11538 if ($notnull_bool($ne(initializedFields, null))) { 11580 if ($notnull_bool($ne(initializedFields, null))) {
11539 var $list = this.method.declaringType.get$members().getKeys(); 11581 for (var $i = allMembers.iterator$0(); $i.hasNext$0(); ) {
11540 for (var $i = this.method.declaringType.get$members().getKeys().iterator$0() ; $i.hasNext$0(); ) { 11582 var member = $i.next$0();
11541 var name = $i.next$0(); 11583 if ($notnull_bool(member.get$isField()) && $notnull_bool(member.get$isFina l()) && !$notnull_bool(member.get$isStatic()) && !$notnull_bool(initializedField s.contains$1(member.get$name()))) {
11542 var member = this.method.declaringType.get$members().$index(name); 11584 $globals.world.error(('Field "' + member.get$name() + '" is final and wa s not initialized'), (($0 = this.method.get$definition().get$span()) && $0.is$So urceSpan()));
11543 if ((member instanceof FieldMember) && $notnull_bool(member.get$isFinal()) && !$notnull_bool(member.get$isStatic()) && !$notnull_bool(initializedFields.co ntains$1(name))) {
11544 $globals.world.error(('Field "' + name + '" is final and was not initial ized'), (($0 = this.method.get$definition().get$span()) && $0.is$SourceSpan()));
11545 } 11585 }
11546 } 11586 }
11547 } 11587 }
11548 this.visitStatementsInBlock((body && body.is$lang_Statement())); 11588 this.visitStatementsInBlock((body && body.is$lang_Statement()));
11549 } 11589 }
11550 MethodGenerator.prototype._writeInitializerCall = function(node) { 11590 MethodGenerator.prototype._writeInitializerCall = function(node) {
11551 var contructorName = ''; 11591 var contructorName = '';
11552 var targetExp = node.target; 11592 var targetExp = node.target;
11553 if ((targetExp instanceof DotExpression)) { 11593 if ((targetExp instanceof DotExpression)) {
11554 var dot = (targetExp && targetExp.is$DotExpression()); 11594 var dot = (targetExp && targetExp.is$DotExpression());
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
12531 var u = (item && item.is$UnaryExpression()); 12571 var u = (item && item.is$UnaryExpression());
12532 return u.op.kind == 16/*TokenKind.INCR*/ || u.op.kind == 17/*TokenKind.DECR* /; 12572 return u.op.kind == 16/*TokenKind.INCR*/ || u.op.kind == 17/*TokenKind.DECR* /;
12533 } 12573 }
12534 else { 12574 else {
12535 return false; 12575 return false;
12536 } 12576 }
12537 } 12577 }
12538 MethodGenerator.prototype.visitLiteralExpression = function(node) { 12578 MethodGenerator.prototype.visitLiteralExpression = function(node) {
12539 var $0; 12579 var $0;
12540 var type = node.type.type; 12580 var type = node.type.type;
12541 $assert($ne(type, null), "type != null", "gen.dart", 2158, 12); 12581 $assert($ne(type, null), "type != null", "gen.dart", 2192, 12);
12542 if (!!(($0 = node.value) && $0.is$List)) { 12582 if (!!(($0 = node.value) && $0.is$List)) {
12543 var items = []; 12583 var items = [];
12544 var $list = node.value; 12584 var $list = node.value;
12545 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) { 12585 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) {
12546 var item = $i.next$0(); 12586 var item = $i.next$0();
12547 var val = this.visitValue((item && item.is$lang_Expression())); 12587 var val = this.visitValue((item && item.is$lang_Expression()));
12548 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY()); 12588 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY());
12549 var code = val.get$code(); 12589 var code = val.get$code();
12550 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr ession) || (item instanceof PostfixExpression) || $notnull_bool(this._isUnaryInc rement((item && item.is$lang_Expression())))) { 12590 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr ession) || (item instanceof PostfixExpression) || $notnull_bool(this._isUnaryInc rement((item && item.is$lang_Expression())))) {
12551 code = ('(' + code + ')'); 12591 code = ('(' + code + ')');
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
13216 } 13256 }
13217 Member.prototype.get$isMethod = function() { 13257 Member.prototype.get$isMethod = function() {
13218 return false; 13258 return false;
13219 } 13259 }
13220 Member.prototype.get$isProperty = function() { 13260 Member.prototype.get$isProperty = function() {
13221 return false; 13261 return false;
13222 } 13262 }
13223 Member.prototype.get$isAbstract = function() { 13263 Member.prototype.get$isAbstract = function() {
13224 return false; 13264 return false;
13225 } 13265 }
13266 Member.prototype.get$isFinal = function() {
13267 return false;
13268 }
13226 Member.prototype.get$isConst = function() { 13269 Member.prototype.get$isConst = function() {
13227 return false; 13270 return false;
13228 } 13271 }
13229 Member.prototype.get$isFactory = function() { 13272 Member.prototype.get$isFactory = function() {
13230 return false; 13273 return false;
13231 } 13274 }
13232 Member.prototype.get$isOperator = function() { 13275 Member.prototype.get$isOperator = function() {
13233 return this.name.startsWith('\$'); 13276 return this.name.startsWith('\$');
13234 } 13277 }
13235 Member.prototype.get$isCallMethod = function() { 13278 Member.prototype.get$isCallMethod = function() {
(...skipping 16 matching lines...) Expand all
13252 } 13295 }
13253 Member.prototype.providePropertySyntax = function() { 13296 Member.prototype.providePropertySyntax = function() {
13254 13297
13255 } 13298 }
13256 Member.prototype.get$initDelegate = function() { 13299 Member.prototype.get$initDelegate = function() {
13257 $globals.world.internalError('cannot have initializers', this.get$span()); 13300 $globals.world.internalError('cannot have initializers', this.get$span());
13258 } 13301 }
13259 Member.prototype.set$initDelegate = function(ctor) { 13302 Member.prototype.set$initDelegate = function(ctor) {
13260 $globals.world.internalError('cannot have initializers', this.get$span()); 13303 $globals.world.internalError('cannot have initializers', this.get$span());
13261 } 13304 }
13305 Member.prototype.computeValue = function() {
13306 $globals.world.internalError('cannot have value', this.get$span());
13307 }
13262 Member.prototype.get$inferredResult = function() { 13308 Member.prototype.get$inferredResult = function() {
13263 var t = this.get$returnType(); 13309 var t = this.get$returnType();
13264 if ($notnull_bool(t.get$isBool()) && ($notnull_bool(this.get$library().get$isC ore()) || $notnull_bool(this.get$library().get$isCoreImpl()))) { 13310 if ($notnull_bool(t.get$isBool()) && ($notnull_bool(this.get$library().get$isC ore()) || $notnull_bool(this.get$library().get$isCoreImpl()))) {
13265 return $globals.world.nonNullBool; 13311 return $globals.world.nonNullBool;
13266 } 13312 }
13267 return (t && t.is$lang_Type()); 13313 return (t && t.is$lang_Type());
13268 } 13314 }
13269 Member.prototype.get$definition = function() { 13315 Member.prototype.get$definition = function() {
13270 return null; 13316 return null;
13271 } 13317 }
(...skipping 13 matching lines...) Expand all
13285 $globals.world.error('static members can not hide parent members', this.get$ span(), other.get$span()); 13331 $globals.world.error('static members can not hide parent members', this.get$ span(), other.get$span());
13286 return false; 13332 return false;
13287 } 13333 }
13288 else if ($notnull_bool(other.get$isStatic())) { 13334 else if ($notnull_bool(other.get$isStatic())) {
13289 $globals.world.error('can not override static member', this.get$span(), othe r.get$span()); 13335 $globals.world.error('can not override static member', this.get$span(), othe r.get$span());
13290 return false; 13336 return false;
13291 } 13337 }
13292 return true; 13338 return true;
13293 } 13339 }
13294 Member.prototype.get$generatedFactoryName = function() { 13340 Member.prototype.get$generatedFactoryName = function() {
13295 $assert(this.get$isFactory(), "this.isFactory", "member.dart", 195, 12); 13341 $assert(this.get$isFactory(), "this.isFactory", "member.dart", 201, 12);
13296 var prefix = ('' + this.declaringType.get$jsname() + '.' + this.get$constructo rName() + '\$'); 13342 var prefix = ('' + this.declaringType.get$jsname() + '.' + this.get$constructo rName() + '\$');
13297 if (this.name == '') { 13343 if (this.name == '') {
13298 return ('' + prefix + 'factory'); 13344 return ('' + prefix + 'factory');
13299 } 13345 }
13300 else { 13346 else {
13301 return ('' + prefix + this.name + '\$factory'); 13347 return ('' + prefix + this.name + '\$factory');
13302 } 13348 }
13303 } 13349 }
13304 Member.prototype.resolveType = function(node, isRequired) { 13350 Member.prototype.resolveType = function(node, isRequired) {
13305 var type = this.declaringType.resolveType(node, isRequired); 13351 var type = this.declaringType.resolveType(node, isRequired);
13306 if ($notnull_bool(this.get$isStatic()) && $notnull_bool(type.get$hasTypeParams ())) { 13352 if ($notnull_bool(this.get$isStatic()) && $notnull_bool(type.get$hasTypeParams ())) {
13307 $globals.world.error('using type parameter in static context', node.span); 13353 $globals.world.error('using type parameter in static context', node.span);
13308 } 13354 }
13309 return (type && type.is$lang_Type()); 13355 return (type && type.is$lang_Type());
13310 } 13356 }
13311 Member.prototype._get$3 = function($0, $1, $2) { 13357 Member.prototype._get$3 = function($0, $1, $2) {
13312 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value())); 13358 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()));
13313 }; 13359 };
13314 Member.prototype._set$4 = function($0, $1, $2, $3) { 13360 Member.prototype._set$4 = function($0, $1, $2, $3) {
13315 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value())); 13361 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()));
13316 }; 13362 };
13317 Member.prototype.canInvoke$2 = function($0, $1) { 13363 Member.prototype.canInvoke$2 = function($0, $1) {
13318 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 13364 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( )));
13319 }; 13365 };
13366 Member.prototype.computeValue$0 = function() {
13367 return this.computeValue();
13368 };
13320 Member.prototype.invoke$4 = function($0, $1, $2, $3) { 13369 Member.prototype.invoke$4 = function($0, $1, $2, $3) {
13321 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); 13370 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
13322 }; 13371 };
13323 Member.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 13372 Member.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) {
13324 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); 13373 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic));
13325 }; 13374 };
13326 Member.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 13375 Member.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
13327 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); 13376 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4));
13328 }; 13377 };
13329 Member.prototype.provideFieldSyntax$0 = function() { 13378 Member.prototype.provideFieldSyntax$0 = function() {
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
13718 } 13767 }
13719 ConcreteMember.prototype.get$isAbstract = function() { 13768 ConcreteMember.prototype.get$isAbstract = function() {
13720 return this.baseMember.get$isAbstract(); 13769 return this.baseMember.get$isAbstract();
13721 } 13770 }
13722 ConcreteMember.prototype.get$isConst = function() { 13771 ConcreteMember.prototype.get$isConst = function() {
13723 return this.baseMember.get$isConst(); 13772 return this.baseMember.get$isConst();
13724 } 13773 }
13725 ConcreteMember.prototype.get$isFactory = function() { 13774 ConcreteMember.prototype.get$isFactory = function() {
13726 return this.baseMember.get$isFactory(); 13775 return this.baseMember.get$isFactory();
13727 } 13776 }
13777 ConcreteMember.prototype.get$isFinal = function() {
13778 return this.baseMember.get$isFinal();
13779 }
13728 ConcreteMember.prototype.get$jsname = function() { 13780 ConcreteMember.prototype.get$jsname = function() {
13729 return this.baseMember.get$jsname(); 13781 return this.baseMember.get$jsname();
13730 } 13782 }
13731 ConcreteMember.prototype.set$jsname = function(name) { 13783 ConcreteMember.prototype.set$jsname = function(name) {
13732 return $globals.world.internalError('bad set of jsname on ConcreteMember'); 13784 return $globals.world.internalError('bad set of jsname on ConcreteMember');
13733 } 13785 }
13734 ConcreteMember.prototype.get$canGet = function() { 13786 ConcreteMember.prototype.get$canGet = function() {
13735 return this.baseMember.get$canGet(); 13787 return this.baseMember.get$canGet();
13736 } 13788 }
13737 ConcreteMember.prototype.get$canSet = function() { 13789 ConcreteMember.prototype.get$canSet = function() {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
13775 return this.baseMember.get$initDelegate(); 13827 return this.baseMember.get$initDelegate();
13776 } 13828 }
13777 ConcreteMember.prototype.set$initDelegate = function(ctor) { 13829 ConcreteMember.prototype.set$initDelegate = function(ctor) {
13778 this.baseMember.set$initDelegate(ctor); 13830 this.baseMember.set$initDelegate(ctor);
13779 } 13831 }
13780 ConcreteMember.prototype.resolveType = function(node, isRequired) { 13832 ConcreteMember.prototype.resolveType = function(node, isRequired) {
13781 var $0; 13833 var $0;
13782 var type = this.baseMember.resolveType(node, isRequired); 13834 var type = this.baseMember.resolveType(node, isRequired);
13783 return (($0 = type.resolveTypeParams$1(this.declaringType)) && $0.is$lang_Type ()); 13835 return (($0 = type.resolveTypeParams$1(this.declaringType)) && $0.is$lang_Type ());
13784 } 13836 }
13837 ConcreteMember.prototype.computeValue = function() {
13838 return this.baseMember.computeValue();
13839 }
13785 ConcreteMember.prototype.override = function(other) { 13840 ConcreteMember.prototype.override = function(other) {
13786 return this.baseMember.override(other); 13841 return this.baseMember.override(other);
13787 } 13842 }
13788 ConcreteMember.prototype._get = function(context, node, target, isDynamic) { 13843 ConcreteMember.prototype._get = function(context, node, target, isDynamic) {
13789 var ret = this.baseMember._get(context, node, target, isDynamic); 13844 var ret = this.baseMember._get(context, node, target, isDynamic);
13790 return new Value(this.get$inferredResult(), ret.code, node.span, true); 13845 return new Value(this.get$inferredResult(), ret.code, node.span, true);
13791 } 13846 }
13792 ConcreteMember.prototype._set = function(context, node, target, value, isDynamic ) { 13847 ConcreteMember.prototype._set = function(context, node, target, value, isDynamic ) {
13793 var ret = this.baseMember._set(context, node, target, value, isDynamic); 13848 var ret = this.baseMember._set(context, node, target, value, isDynamic);
13794 return new Value(this.returnType, ret.code, node.span, true); 13849 return new Value(this.returnType, ret.code, node.span, true);
(...skipping 11 matching lines...) Expand all
13806 } 13861 }
13807 ConcreteMember.prototype._get$3 = function($0, $1, $2) { 13862 ConcreteMember.prototype._get$3 = function($0, $1, $2) {
13808 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false); 13863 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
13809 }; 13864 };
13810 ConcreteMember.prototype._set$4 = function($0, $1, $2, $3) { 13865 ConcreteMember.prototype._set$4 = function($0, $1, $2, $3) {
13811 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false); 13866 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false);
13812 }; 13867 };
13813 ConcreteMember.prototype.canInvoke$2 = function($0, $1) { 13868 ConcreteMember.prototype.canInvoke$2 = function($0, $1) {
13814 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 13869 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( )));
13815 }; 13870 };
13871 ConcreteMember.prototype.computeValue$0 = function() {
13872 return this.computeValue();
13873 };
13816 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) { 13874 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) {
13817 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); 13875 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
13818 }; 13876 };
13819 ConcreteMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic ) { 13877 ConcreteMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic ) {
13820 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); 13878 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic));
13821 }; 13879 };
13822 ConcreteMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 13880 ConcreteMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
13823 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); 13881 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4));
13824 }; 13882 };
13825 ConcreteMember.prototype.provideFieldSyntax$0 = function() { 13883 ConcreteMember.prototype.provideFieldSyntax$0 = function() {
(...skipping 5562 matching lines...) Expand 10 before | Expand all | Expand 10 after
19388 } 19446 }
19389 lang_Type.prototype.get$parent = function() { 19447 lang_Type.prototype.get$parent = function() {
19390 return null; 19448 return null;
19391 } 19449 }
19392 lang_Type.prototype.getAllMembers = function() { 19450 lang_Type.prototype.getAllMembers = function() {
19393 return $map([]); 19451 return $map([]);
19394 } 19452 }
19395 lang_Type.prototype.hashCode = function() { 19453 lang_Type.prototype.hashCode = function() {
19396 return this.name.hashCode(); 19454 return this.name.hashCode();
19397 } 19455 }
19456 lang_Type.prototype._checkOverride = function(member) {
19457 var parentMember = this._getMemberInParents(member.name);
19458 if ($notnull_bool($ne(parentMember, null))) {
19459 if (!$notnull_bool(member.get$isPrivate()) || $eq(member.get$library(), pare ntMember.get$library())) {
19460 member.override((parentMember && parentMember.is$Member()));
19461 }
19462 }
19463 }
19464 lang_Type.prototype._createNotEqualMember = function() {
19465 var $0;
19466 var eq = (($0 = this.get$members().$index('\$eq')) && $0.is$MethodMember());
19467 if (eq == null) {
19468 $globals.world.internalError('INTERNAL: object does not define ==', this.get $definition().span);
19469 }
19470 var ne = new MethodMember('\$ne', this, eq.definition);
19471 ne.isGenerated = true;
19472 ne.returnType = eq.returnType;
19473 ne.parameters = eq.parameters;
19474 ne.isStatic = eq.isStatic;
19475 ne.isAbstract = eq.isAbstract;
19476 return ne;
19477 }
19478 lang_Type.prototype._getMemberInParents = function(memberName) {
19479 if ($notnull_bool(this.get$isClass())) {
19480 if (this.get$parent() != null) {
19481 return this.get$parent().getMember(memberName);
19482 }
19483 else if ($notnull_bool(this.get$isObject())) {
19484 if (memberName == '\$ne') {
19485 var ret = this._createNotEqualMember();
19486 this.get$members().$setindex(memberName, ret);
19487 return (ret && ret.is$Member());
19488 }
19489 return null;
19490 }
19491 }
19492 else {
19493 if (this.get$interfaces() != null && this.get$interfaces().length > 0) {
19494 var $list = this.get$interfaces();
19495 for (var $i = 0;$i < $list.length; $i++) {
19496 var i = $list.$index($i);
19497 var ret = i.getMember$1(memberName);
19498 if ($notnull_bool($ne(ret, null))) {
19499 return (ret && ret.is$Member());
19500 }
19501 }
19502 return null;
19503 }
19504 else {
19505 return $globals.world.objectType.getMember(memberName);
19506 }
19507 }
19508 }
19398 lang_Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) { 19509 lang_Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) {
19399 if (!$notnull_bool(this.isSubtypeOf(other))) { 19510 if (!$notnull_bool(this.isSubtypeOf(other))) {
19400 var msg = ('type ' + this.name + ' is not a subtype of ' + other.name); 19511 var msg = ('type ' + this.name + ' is not a subtype of ' + other.name);
19401 if ($notnull_bool(typeErrors)) { 19512 if ($notnull_bool(typeErrors)) {
19402 $globals.world.error($assert_String(msg), span); 19513 $globals.world.error($assert_String(msg), span);
19403 } 19514 }
19404 else { 19515 else {
19405 $globals.world.warning($assert_String(msg), span); 19516 $globals.world.warning($assert_String(msg), span);
19406 } 19517 }
19407 } 19518 }
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
19791 if ($notnull_bool($ne(newType, t))) needsNewType = true; 19902 if ($notnull_bool($ne(newType, t))) needsNewType = true;
19792 newTypeArgs.add$1(newType); 19903 newTypeArgs.add$1(newType);
19793 } 19904 }
19794 if (!$notnull_bool(needsNewType)) return this; 19905 if (!$notnull_bool(needsNewType)) return this;
19795 return this.genericType.getOrMakeConcreteType((newTypeArgs && newTypeArgs.is$L ist$Type())); 19906 return this.genericType.getOrMakeConcreteType((newTypeArgs && newTypeArgs.is$L ist$Type()));
19796 } 19907 }
19797 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) { 19908 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) {
19798 return this.genericType.getOrMakeConcreteType(typeArgs); 19909 return this.genericType.getOrMakeConcreteType(typeArgs);
19799 } 19910 }
19800 ConcreteType.prototype.get$parent = function() { 19911 ConcreteType.prototype.get$parent = function() {
19801 return this.genericType.get$parent(); 19912 if (this._parent == null && this.genericType.get$parent() != null) {
19913 this._parent = this.genericType.get$parent().resolveTypeParams(this);
19914 }
19915 return this._parent;
19802 } 19916 }
19803 ConcreteType.prototype.get$interfaces = function() { 19917 ConcreteType.prototype.get$interfaces = function() {
19804 if (this._interfaces == null && this.genericType.interfaces != null) { 19918 if (this._interfaces == null && this.genericType.interfaces != null) {
19805 this._interfaces = []; 19919 this._interfaces = [];
19806 var $list = this.genericType.interfaces; 19920 var $list = this.genericType.interfaces;
19807 for (var $i = 0;$i < $list.length; $i++) { 19921 for (var $i = 0;$i < $list.length; $i++) {
19808 var i = $list.$index($i); 19922 var i = $list.$index($i);
19809 this._interfaces.add(i.resolveTypeParams$1(this)); 19923 this._interfaces.add(i.resolveTypeParams$1(this));
19810 } 19924 }
19811 } 19925 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
19853 ret = new ConcreteMember($assert_String(genericMember.get$name()), this, gen ericMember); 19967 ret = new ConcreteMember($assert_String(genericMember.get$name()), this, gen ericMember);
19854 this.factories.addFactory(this.name, constructorName, (ret && ret.is$Member( ))); 19968 this.factories.addFactory(this.name, constructorName, (ret && ret.is$Member( )));
19855 } 19969 }
19856 else { 19970 else {
19857 ret = new ConcreteMember(this.name, this, genericMember); 19971 ret = new ConcreteMember(this.name, this, genericMember);
19858 this.constructors.$setindex(constructorName, ret); 19972 this.constructors.$setindex(constructorName, ret);
19859 } 19973 }
19860 return ret; 19974 return ret;
19861 } 19975 }
19862 ConcreteType.prototype.getMember = function(memberName) { 19976 ConcreteType.prototype.getMember = function(memberName) {
19863 var ret = this.members.$index(memberName); 19977 var $0;
19864 if ($notnull_bool($ne(ret, null))) return (ret && ret.is$Member()); 19978 var member = (($0 = this.members.$index(memberName)) && $0.is$Member());
19865 var genericMember = this.genericType.getMember(memberName); 19979 if (member != null) {
19866 if ($notnull_bool(genericMember == null)) return null; 19980 this._checkOverride(member);
19867 ret = new ConcreteMember($assert_String(genericMember.get$name()), this, gener icMember); 19981 return member;
19868 this.members.$setindex(memberName, ret); 19982 }
19869 return (ret && ret.is$Member()); 19983 var genericMember = this.genericType.members.$index(memberName);
19984 if ($notnull_bool($ne(genericMember, null))) {
19985 member = new ConcreteMember($assert_String(genericMember.get$name()), this, genericMember);
19986 this.members.$setindex(memberName, member);
19987 return member;
19988 }
19989 return this._getMemberInParents(memberName);
19870 } 19990 }
19871 ConcreteType.prototype.resolveMember = function(memberName) { 19991 ConcreteType.prototype.resolveMember = function(memberName) {
19872 var mem = this.getMember(memberName); 19992 var mem = this.getMember(memberName);
19873 if ($notnull_bool(mem == null)) return null; 19993 if ($notnull_bool(mem == null)) return null;
19874 var ret = new MemberSet((mem && mem.is$Member()), false); 19994 var ret = new MemberSet((mem && mem.is$Member()), false);
19875 if ($notnull_bool(mem.get$isStatic())) return (ret && ret.is$MemberSet()); 19995 if ($notnull_bool(mem.get$isStatic())) return (ret && ret.is$MemberSet());
19876 var $list = this.genericType.get$subtypes(); 19996 var $list = this.genericType.get$subtypes();
19877 for (var $i = this.genericType.get$subtypes().iterator(); $i.hasNext$0(); ) { 19997 for (var $i = this.genericType.get$subtypes().iterator(); $i.hasNext$0(); ) {
19878 var t = $i.next$0(); 19998 var t = $i.next$0();
19879 var m = t.get$members().$index(memberName); 19999 var m = t.get$members().$index(memberName);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
19947 DefinedType.prototype.set$constructors = function(value) { return this.construct ors = value; }; 20067 DefinedType.prototype.set$constructors = function(value) { return this.construct ors = value; };
19948 DefinedType.prototype.get$members = function() { return this.members; }; 20068 DefinedType.prototype.get$members = function() { return this.members; };
19949 DefinedType.prototype.set$members = function(value) { return this.members = valu e; }; 20069 DefinedType.prototype.set$members = function(value) { return this.members = valu e; };
19950 DefinedType.prototype.get$factories = function() { return this.factories; }; 20070 DefinedType.prototype.get$factories = function() { return this.factories; };
19951 DefinedType.prototype.set$factories = function(value) { return this.factories = value; }; 20071 DefinedType.prototype.set$factories = function(value) { return this.factories = value; };
19952 DefinedType.prototype.get$isUsed = function() { return this.isUsed; }; 20072 DefinedType.prototype.get$isUsed = function() { return this.isUsed; };
19953 DefinedType.prototype.set$isUsed = function(value) { return this.isUsed = value; }; 20073 DefinedType.prototype.set$isUsed = function(value) { return this.isUsed = value; };
19954 DefinedType.prototype.get$isNativeType = function() { return this.isNativeType; }; 20074 DefinedType.prototype.get$isNativeType = function() { return this.isNativeType; };
19955 DefinedType.prototype.set$isNativeType = function(value) { return this.isNativeT ype = value; }; 20075 DefinedType.prototype.set$isNativeType = function(value) { return this.isNativeT ype = value; };
19956 DefinedType.prototype.setDefinition = function(def) { 20076 DefinedType.prototype.setDefinition = function(def) {
19957 $assert(this.definition == null, "definition == null", "type.dart", 632, 12); 20077 $assert(this.definition == null, "definition == null", "type.dart", 703, 12);
19958 this.definition = def; 20078 this.definition = def;
19959 if ((this.definition instanceof TypeDefinition) && this.definition.get$nativeT ype() != null) { 20079 if ((this.definition instanceof TypeDefinition) && this.definition.get$nativeT ype() != null) {
19960 this.isNativeType = true; 20080 this.isNativeType = true;
19961 } 20081 }
19962 if (this.definition != null && this.definition.get$typeParameters() != null) { 20082 if (this.definition != null && this.definition.get$typeParameters() != null) {
19963 this._concreteTypes = $map([]); 20083 this._concreteTypes = $map([]);
19964 this.typeParameters = []; 20084 this.typeParameters = [];
19965 var $list = this.definition.get$typeParameters(); 20085 var $list = this.definition.get$typeParameters();
19966 for (var $i = 0;$i < $list.length; $i++) { 20086 for (var $i = 0;$i < $list.length; $i++) {
19967 var tp = $list.$index($i); 20087 var tp = $list.$index($i);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
20057 var resolvedInterface = this.resolveType((type && type.is$TypeReference()), true); 20177 var resolvedInterface = this.resolveType((type && type.is$TypeReference()), true);
20058 if ($notnull_bool(resolvedInterface.get$isClosed()) && !($notnull_bool(this. library.get$isCore()) || $notnull_bool(this.library.get$isCoreImpl()))) { 20178 if ($notnull_bool(resolvedInterface.get$isClosed()) && !($notnull_bool(this. library.get$isCore()) || $notnull_bool(this.library.get$isCoreImpl()))) {
20059 $globals.world.error(('can not implement "' + resolvedInterface.get$name() + '": ') + 'only native implementation allowed', (($0 = type.get$span()) && $0. is$SourceSpan())); 20179 $globals.world.error(('can not implement "' + resolvedInterface.get$name() + '": ') + 'only native implementation allowed', (($0 = type.get$span()) && $0. is$SourceSpan()));
20060 } 20180 }
20061 resolvedInterface.addDirectSubtype$1(this); 20181 resolvedInterface.addDirectSubtype$1(this);
20062 interfaces.add$1(resolvedInterface); 20182 interfaces.add$1(resolvedInterface);
20063 } 20183 }
20064 return (interfaces && interfaces.is$List$Type()); 20184 return (interfaces && interfaces.is$List$Type());
20065 } 20185 }
20066 DefinedType.prototype.addDirectSubtype = function(type) { 20186 DefinedType.prototype.addDirectSubtype = function(type) {
20067 $assert(this._subtypes == null, "_subtypes == null", "type.dart", 748, 12); 20187 $assert(this._subtypes == null, "_subtypes == null", "type.dart", 819, 12);
20068 this.directSubtypes.add(type); 20188 this.directSubtypes.add(type);
20069 } 20189 }
20070 DefinedType.prototype.get$subtypes = function() { 20190 DefinedType.prototype.get$subtypes = function() {
20071 var $0; 20191 var $0;
20072 if (this._subtypes == null) { 20192 if (this._subtypes == null) {
20073 this._subtypes = new HashSetImplementation(); 20193 this._subtypes = new HashSetImplementation();
20074 var $list = this.directSubtypes; 20194 var $list = this.directSubtypes;
20075 for (var $i = this.directSubtypes.iterator(); $i.hasNext$0(); ) { 20195 for (var $i = this.directSubtypes.iterator(); $i.hasNext$0(); ) {
20076 var st = $i.next$0(); 20196 var st = $i.next$0();
20077 this._subtypes.add(st); 20197 this._subtypes.add(st);
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
20308 this.addMethod(null, (c && c.is$FunctionDefinition())); 20428 this.addMethod(null, (c && c.is$FunctionDefinition()));
20309 this.constructors.$index('').resolve$1(this); 20429 this.constructors.$index('').resolve$1(this);
20310 return this.constructors.$index(''); 20430 return this.constructors.$index('');
20311 } 20431 }
20312 return null; 20432 return null;
20313 } 20433 }
20314 DefinedType.prototype.getMember = function(memberName) { 20434 DefinedType.prototype.getMember = function(memberName) {
20315 var $0; 20435 var $0;
20316 var member = (($0 = this.members.$index(memberName)) && $0.is$Member()); 20436 var member = (($0 = this.members.$index(memberName)) && $0.is$Member());
20317 if (member != null) { 20437 if (member != null) {
20318 var parentMember = this.getMemberInParents(memberName); 20438 this._checkOverride(member);
20319 if ($notnull_bool($ne(parentMember, null))) {
20320 if (!$notnull_bool(member.get$isPrivate()) || $eq(member.get$library(), pa rentMember.get$library())) {
20321 member.override((parentMember && parentMember.is$Member()));
20322 }
20323 }
20324 return member; 20439 return member;
20325 } 20440 }
20326 if ($notnull_bool(this.get$isTop())) { 20441 if ($notnull_bool(this.get$isTop())) {
20327 var libType = this.library.findTypeByName(memberName); 20442 var libType = this.library.findTypeByName(memberName);
20328 if ($notnull_bool($ne(libType, null))) { 20443 if ($notnull_bool($ne(libType, null))) {
20329 return (($0 = libType.get$typeMember()) && $0.is$Member()); 20444 return (($0 = libType.get$typeMember()) && $0.is$Member());
20330 } 20445 }
20331 } 20446 }
20332 return this.getMemberInParents(memberName); 20447 return this._getMemberInParents(memberName);
20333 }
20334 DefinedType.prototype.getMemberInParents = function(memberName) {
20335 if ($notnull_bool(this.isClass)) {
20336 if (this.get$parent() != null) {
20337 return this.get$parent().getMember(memberName);
20338 }
20339 else if ($notnull_bool(this.get$isObject())) {
20340 if (memberName == '\$ne') {
20341 var ret = this._createNotEqualMember();
20342 this.members.$setindex(memberName, ret);
20343 return (ret && ret.is$Member());
20344 }
20345 return null;
20346 }
20347 }
20348 else {
20349 if (this.interfaces != null && this.interfaces.length > 0) {
20350 var $list = this.interfaces;
20351 for (var $i = 0;$i < $list.length; $i++) {
20352 var i = $list.$index($i);
20353 var ret = i.getMember$1(memberName);
20354 if ($notnull_bool($ne(ret, null))) {
20355 return (ret && ret.is$Member());
20356 }
20357 }
20358 return null;
20359 }
20360 else {
20361 return $globals.world.objectType.getMember(memberName);
20362 }
20363 }
20364 } 20448 }
20365 DefinedType.prototype.resolveMember = function(memberName) { 20449 DefinedType.prototype.resolveMember = function(memberName) {
20366 var $0; 20450 var $0;
20367 var ret = (($0 = this._resolvedMembers.$index(memberName)) && $0.is$MemberSet( )); 20451 var ret = (($0 = this._resolvedMembers.$index(memberName)) && $0.is$MemberSet( ));
20368 if (ret != null) return ret; 20452 if (ret != null) return ret;
20369 var member = this.getMember(memberName); 20453 var member = this.getMember(memberName);
20370 if (member == null) { 20454 if (member == null) {
20371 return null; 20455 return null;
20372 } 20456 }
20373 ret = new MemberSet(member, false); 20457 ret = new MemberSet(member, false);
(...skipping 10 matching lines...) Expand all
20384 m = t.getMember$1(memberName); 20468 m = t.getMember$1(memberName);
20385 } 20469 }
20386 else { 20470 else {
20387 m = t.get$members().$index(memberName); 20471 m = t.get$members().$index(memberName);
20388 } 20472 }
20389 if ($notnull_bool($ne(m, null))) ret.add((m && m.is$Member())); 20473 if ($notnull_bool($ne(m, null))) ret.add((m && m.is$Member()));
20390 } 20474 }
20391 return ret; 20475 return ret;
20392 } 20476 }
20393 } 20477 }
20394 DefinedType.prototype._createNotEqualMember = function() {
20395 var $0;
20396 var eq = (($0 = this.members.$index('\$eq')) && $0.is$MethodMember());
20397 if (eq == null) {
20398 $globals.world.internalError('INTERNAL: object does not define ==', this.def inition.span);
20399 }
20400 var ne = new MethodMember('\$ne', this, eq.definition);
20401 ne.isGenerated = true;
20402 ne.returnType = eq.returnType;
20403 ne.parameters = eq.parameters;
20404 ne.isStatic = eq.isStatic;
20405 ne.isAbstract = eq.isAbstract;
20406 return ne;
20407 }
20408 DefinedType._getDottedName = function(type) { 20478 DefinedType._getDottedName = function(type) {
20409 if (type.names != null) { 20479 if (type.names != null) {
20410 var names = map(type.names, (function (n) { 20480 var names = map(type.names, (function (n) {
20411 return n.get$name(); 20481 return n.get$name();
20412 }) 20482 })
20413 ); 20483 );
20414 return type.name.name + '.' + Strings.join((names && names.is$List$String()) , '.'); 20484 return type.name.name + '.' + Strings.join((names && names.is$List$String()) , '.');
20415 } 20485 }
20416 else { 20486 else {
20417 return type.name.name; 20487 return type.name.name;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
20485 } 20555 }
20486 else { 20556 else {
20487 $globals.world.internalError('unknown type reference', node.span); 20557 $globals.world.internalError('unknown type reference', node.span);
20488 } 20558 }
20489 return node.type; 20559 return node.type;
20490 } 20560 }
20491 DefinedType.prototype.resolveTypeParams = function(inType) { 20561 DefinedType.prototype.resolveTypeParams = function(inType) {
20492 return this; 20562 return this;
20493 } 20563 }
20494 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { 20564 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) {
20495 $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1231, 12); 20565 $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1248, 12);
20496 var names = [this.name]; 20566 var names = [this.name];
20497 var typeMap = $map([]); 20567 var typeMap = $map([]);
20498 for (var i = 0; 20568 for (var i = 0;
20499 i < typeArgs.length; i++) { 20569 i < typeArgs.length; i++) {
20500 var paramName = this.typeParameters.$index(i).get$name(); 20570 var paramName = this.typeParameters.$index(i).get$name();
20501 typeMap.$setindex(paramName, typeArgs.$index(i)); 20571 typeMap.$setindex(paramName, typeArgs.$index(i));
20502 names.add$1(typeArgs.$index(i).get$name()); 20572 names.add$1(typeArgs.$index(i).get$name());
20503 } 20573 }
20504 var concreteName = Strings.join((names && names.is$List$String()), '\$'); 20574 var concreteName = Strings.join((names && names.is$List$String()), '\$');
20505 var ret = this._concreteTypes.$index(concreteName); 20575 var ret = this._concreteTypes.$index(concreteName);
20506 if ($notnull_bool(ret == null)) { 20576 if ($notnull_bool(ret == null)) {
20507 ret = new ConcreteType($assert_String(concreteName), this, typeMap, typeArgs ); 20577 ret = new ConcreteType($assert_String(concreteName), this, typeMap, typeArgs );
20508 this._concreteTypes.$setindex(concreteName, ret); 20578 this._concreteTypes.$setindex(concreteName, ret);
20509 } 20579 }
20510 return (ret && ret.is$lang_Type()); 20580 return (ret && ret.is$lang_Type());
20511 } 20581 }
20512 DefinedType.prototype.getCallStub = function(args) { 20582 DefinedType.prototype.getCallStub = function(args) {
20513 $assert(this.get$isFunction(), "isFunction", "type.dart", 1251, 12); 20583 $assert(this.get$isFunction(), "isFunction", "type.dart", 1268, 12);
20514 var name = _getCallStubName('call', args); 20584 var name = _getCallStubName('call', args);
20515 if (this.varStubs == null) this.varStubs = $map([]); 20585 if (this.varStubs == null) this.varStubs = $map([]);
20516 var stub = this.varStubs.$index(name); 20586 var stub = this.varStubs.$index(name);
20517 if ($notnull_bool(stub == null)) { 20587 if ($notnull_bool(stub == null)) {
20518 stub = new VarFunctionStub($assert_String(name), args); 20588 stub = new VarFunctionStub($assert_String(name), args);
20519 this.varStubs.$setindex(name, stub); 20589 this.varStubs.$setindex(name, stub);
20520 } 20590 }
20521 return (stub && stub.is$VarFunctionStub()); 20591 return (stub && stub.is$VarFunctionStub());
20522 } 20592 }
20523 DefinedType.prototype.addDirectSubtype$1 = function($0) { 20593 DefinedType.prototype.addDirectSubtype$1 = function($0) {
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
20756 $globals.world.error($assert_String(message), node.span); 20826 $globals.world.error($assert_String(message), node.span);
20757 } 20827 }
20758 else { 20828 else {
20759 $globals.world.warning($assert_String(message), node.span); 20829 $globals.world.warning($assert_String(message), node.span);
20760 } 20830 }
20761 } 20831 }
20762 } 20832 }
20763 if ($notnull_bool(member == null) && !$notnull_bool(this.isSuper) && !$notnull _bool(this.isType)) { 20833 if ($notnull_bool(member == null) && !$notnull_bool(this.isSuper) && !$notnull _bool(this.isType)) {
20764 member = context.findMembers(name); 20834 member = context.findMembers(name);
20765 if ($notnull_bool(member == null) && !$notnull_bool(isDynamic)) { 20835 if ($notnull_bool(member == null) && !$notnull_bool(isDynamic)) {
20766 $globals.world.warning(('' + name + ' is not defined anywhere in the world .'), node.span); 20836 var where = 'the world';
20837 if (name.startsWith('_')) {
20838 where = ('library "' + context.get$library().name + '"');
20839 }
20840 $globals.world.warning(('' + name + ' is not defined anywhere in ' + where + '.'), node.span);
20767 } 20841 }
20768 } 20842 }
20769 return member; 20843 return member;
20770 } 20844 }
20771 Value.prototype.checkFirstClass = function(span) { 20845 Value.prototype.checkFirstClass = function(span) {
20772 if ($notnull_bool(this.isType)) { 20846 if ($notnull_bool(this.isType)) {
20773 $globals.world.error('Types are not first class', span); 20847 $globals.world.error('Types are not first class', span);
20774 } 20848 }
20775 } 20849 }
20776 Value.prototype._varCall = function(context, args) { 20850 Value.prototype._varCall = function(context, args) {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
20935 for (var i = 0; 21009 for (var i = 0;
20936 i < args.get$length(); i++) { 21010 i < args.get$length(); i++) {
20937 argsCode.add$1(args.values.$index(i).get$code()); 21011 argsCode.add$1(args.values.$index(i).get$code());
20938 } 21012 }
20939 pos = Strings.join((argsCode && argsCode.is$List$String()), ", "); 21013 pos = Strings.join((argsCode && argsCode.is$List$String()), ", ");
20940 } 21014 }
20941 var noSuchArgs = [new Value($globals.world.stringType, ('"' + name + '"'), nod e.span, true), new Value($globals.world.listType, ('[' + pos + ']'), node.span, true)]; 21015 var noSuchArgs = [new Value($globals.world.stringType, ('"' + name + '"'), nod e.span, true), new Value($globals.world.listType, ('[' + pos + ']'), node.span, true)];
20942 return (($0 = this._resolveMember(context, 'noSuchMethod', node, false).invoke $4(context, node, this, new Arguments(null, noSuchArgs))) && $0.is$Value()); 21016 return (($0 = this._resolveMember(context, 'noSuchMethod', node, false).invoke $4(context, node, this, new Arguments(null, noSuchArgs))) && $0.is$Value());
20943 } 21017 }
20944 Value.prototype.invokeSpecial = function(name, args, returnType) { 21018 Value.prototype.invokeSpecial = function(name, args, returnType) {
20945 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 484, 12 ); 21019 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 488, 12 );
20946 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4 85, 12); 21020 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4 89, 12);
20947 var argsString = args.getCode(); 21021 var argsString = args.getCode();
20948 if (name == '\$index' || name == '\$setindex') { 21022 if (name == '\$index' || name == '\$setindex') {
20949 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString + ')'), this.span, true); 21023 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString + ')'), this.span, true);
20950 } 21024 }
20951 else { 21025 else {
20952 if (argsString.length > 0) argsString = (', ' + argsString); 21026 if (argsString.length > 0) argsString = (', ' + argsString);
20953 $globals.world.gen.corejs.useOperator(name); 21027 $globals.world.gen.corejs.useOperator(name);
20954 return new Value(returnType, ('' + name + '(' + this.code + argsString + ')' ), this.span, true); 21028 return new Value(returnType, ('' + name + '(' + this.code + argsString + ')' ), this.span, true);
20955 } 21029 }
20956 } 21030 }
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
21164 BareValue.prototype._ensureCode = function() { 21238 BareValue.prototype._ensureCode = function() {
21165 if (this.code != null) return; 21239 if (this.code != null) return;
21166 if ($notnull_bool(this.isType)) { 21240 if ($notnull_bool(this.isType)) {
21167 this.code = this.type.get$jsname(); 21241 this.code = this.type.get$jsname();
21168 } 21242 }
21169 else { 21243 else {
21170 this.code = this.home._makeThisCode(); 21244 this.code = this.home._makeThisCode();
21171 } 21245 }
21172 } 21246 }
21173 BareValue.prototype._tryResolveMember = function(context, name) { 21247 BareValue.prototype._tryResolveMember = function(context, name) {
21174 $assert($eq(context, this.home), "context == home", "value.dart", 705, 12); 21248 $assert($eq(context, this.home), "context == home", "value.dart", 709, 12);
21175 var member = this.type.resolveMember(name); 21249 var member = this.type.resolveMember(name);
21176 if ($notnull_bool($ne(member, null))) { 21250 if ($notnull_bool($ne(member, null))) {
21177 this._ensureCode(); 21251 this._ensureCode();
21178 return member; 21252 return member;
21179 } 21253 }
21180 member = this.home.get$library().lookup(name, this.span); 21254 member = this.home.get$library().lookup(name, this.span);
21181 if ($notnull_bool($ne(member, null))) { 21255 if ($notnull_bool($ne(member, null))) {
21182 return member; 21256 return member;
21183 } 21257 }
21184 this._ensureCode(); 21258 this._ensureCode();
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
21529 this.throwOnFatal = false 21603 this.throwOnFatal = false
21530 this.showInfo = false 21604 this.showInfo = false
21531 this.showWarnings = true 21605 this.showWarnings = true
21532 // Initializers done 21606 // Initializers done
21533 this.libDir = homedir + '/lib'; 21607 this.libDir = homedir + '/lib';
21534 var ignoreUnrecognizedFlags = false; 21608 var ignoreUnrecognizedFlags = false;
21535 var passedLibDir = false; 21609 var passedLibDir = false;
21536 this.childArgs = []; 21610 this.childArgs = [];
21537 loop: 21611 loop:
21538 for (var i = 2; 21612 for (var i = 2;
21539 i < args.length; i++) { 21613 i < $assert_num(args.length); i++) {
21540 var arg = args.$index(i); 21614 var arg = args.$index(i);
21541 switch (arg) { 21615 switch (arg) {
21542 case '--enable_leg': 21616 case '--enable_leg':
21543 21617
21544 this.enableLeg = true; 21618 this.enableLeg = true;
21545 continue loop; 21619 continue loop;
21546 21620
21547 case '--leg_only': 21621 case '--leg_only':
21548 21622
21549 this.enableLeg = true; 21623 this.enableLeg = true;
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
21975 if (!$notnull_bool($globals.options.compileOnly)) { 22049 if (!$notnull_bool($globals.options.compileOnly)) {
21976 process.argv = [argv.$index(0), argv.$index(1)]; 22050 process.argv = [argv.$index(0), argv.$index(1)];
21977 process.argv.addAll($globals.options.childArgs); 22051 process.argv.addAll($globals.options.childArgs);
21978 vm.runInNewContext($assert_String(code), createSandbox()); 22052 vm.runInNewContext($assert_String(code), createSandbox());
21979 } 22053 }
21980 } 22054 }
21981 else { 22055 else {
21982 process.exit(1); 22056 process.exit(1);
21983 } 22057 }
21984 } 22058 }
22059 // ********** Generic Type Inheritance **************
22060 /** Implements extends for generic types. */
22061 function $inheritsMembers(child, parent) {
22062 child = child.prototype;
22063 parent = parent.prototype;
22064 Object.getOwnPropertyNames(parent).forEach(function(name) {
22065 if (typeof(child[name]) == 'undefined') child[name] = parent[name];
22066 });
22067 }
22068 $inheritsMembers(_DoubleLinkedQueueEntrySentinel$E, DoubleLinkedQueueEntry$E);
22069 $inheritsMembers(_DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V, DoubleLinkedQ ueueEntry$KeyValuePair$K$V);
22070 $inheritsMembers(LinkTail$Dynamic, AbstractLink$Dynamic);
22071 $inheritsMembers(LinkEntry$Dynamic, AbstractLink$Dynamic);
22072 $inheritsMembers(LinkEntry$T, AbstractLink$T);
22073 $inheritsMembers(ArrayBasedScanner$SourceString, AbstractScanner$SourceString);
21985 // ********** Globals ************** 22074 // ********** Globals **************
21986 function $static_init(){ 22075 function $static_init(){
21987 $globals.HTracer__singleton = null; 22076 $globals.HTracer__singleton = null;
21988 } 22077 }
21989 const$0 = new NoMoreElementsException()/*const NoMoreElementsException()*/; 22078 const$0 = new NoMoreElementsException()/*const NoMoreElementsException()*/;
21990 const$1 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/; 22079 const$1 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/;
21991 const$10 = new StringWrapper('Dynamic')/*const SourceString('Dynamic')*/; 22080 const$10 = new StringWrapper('Dynamic')/*const SourceString('Dynamic')*/;
21992 const$100 = new Keyword("negate", true)/*const Keyword("negate", true)*/; 22081 const$100 = new Keyword("negate", true)/*const Keyword("negate", true)*/;
21993 const$102 = new Keyword("operator", true)/*const Keyword("operator", true)*/; 22082 const$102 = new Keyword("operator", true)/*const Keyword("operator", true)*/;
21994 const$104 = new Keyword("set", true)/*const Keyword("set", true)*/; 22083 const$104 = new Keyword("set", true)/*const Keyword("set", true)*/;
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
22280 NATIVE, 22369 NATIVE,
22281 NEGATE, 22370 NEGATE,
22282 OPERATOR, 22371 OPERATOR,
22283 SET, 22372 SET,
22284 SOURCE, 22373 SOURCE,
22285 STATIC, 22374 STATIC,
22286 TYPEDEF ]*/; 22375 TYPEDEF ]*/;
22287 var $globals = {}; 22376 var $globals = {};
22288 $static_init(); 22377 $static_init();
22289 main(); 22378 main();
OLDNEW
« no previous file with comments | « client/tests/client/client.status ('k') | frog/gen.dart » ('j') | frog/gen.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698