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

Side by Side Diff: frog/frogsh

Issue 8509035: TBR (red build bot). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « no previous file | frog/gen.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 AssertError.prototype.toString = function() { 200 AssertError.prototype.toString = function() {
201 return ("Failed assertion: '" + this.failedAssertion + "' is not true ") + ("i n " + this.url + " at line " + this.line + ", column " + this.column + "."); 201 return ("Failed assertion: '" + this.failedAssertion + "' is not true ") + ("i n " + this.url + " at line " + this.line + ", column " + this.column + ".");
202 } 202 }
203 // ********** Code for Object ************** 203 // ********** Code for Object **************
204 Object.prototype.get$dynamic = function() { 204 Object.prototype.get$dynamic = function() {
205 return this; 205 return this;
206 } 206 }
207 Object.prototype.noSuchMethod = function(name, args) { 207 Object.prototype.noSuchMethod = function(name, args) {
208 $throw(new NoSuchMethodException(this, name, args)); 208 $throw(new NoSuchMethodException(this, name, args));
209 } 209 }
210 Object.prototype.forEach$1 = function($0) {
211 return this.noSuchMethod("forEach", [$0]);
212 }
213 ;
210 Object.prototype.get_$3 = function($0, $1, $2) { 214 Object.prototype.get_$3 = function($0, $1, $2) {
211 return this.noSuchMethod("get_", [$0, $1, $2]); 215 return this.noSuchMethod("get_", [$0, $1, $2]);
212 } 216 }
213 ; 217 ;
214 Object.prototype.invoke$4 = function($0, $1, $2, $3) { 218 Object.prototype.invoke$4 = function($0, $1, $2, $3) {
215 return this.noSuchMethod("invoke", [$0, $1, $2, $3]); 219 return this.noSuchMethod("invoke", [$0, $1, $2, $3]);
216 } 220 }
217 ; 221 ;
218 Object.prototype.printOn$1 = function($0) { 222 Object.prototype.printOn$1 = function($0) {
219 return this.noSuchMethod("printOn", [$0]); 223 return this.noSuchMethod("printOn", [$0]);
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 } 868 }
865 869
866 function _IsolateJsUtil() {} 870 function _IsolateJsUtil() {}
867 // ********** Code for ListFactory ************** 871 // ********** Code for ListFactory **************
868 ListFactory = Array; 872 ListFactory = Array;
869 ListFactory.prototype.is$List = function(){return this;}; 873 ListFactory.prototype.is$List = function(){return this;};
870 ListFactory.prototype.is$List$ArgumentNode = function(){return this;}; 874 ListFactory.prototype.is$List$ArgumentNode = function(){return this;};
871 ListFactory.prototype.is$List$EvaluatedValue = function(){return this;}; 875 ListFactory.prototype.is$List$EvaluatedValue = function(){return this;};
872 ListFactory.prototype.is$List$String = function(){return this;}; 876 ListFactory.prototype.is$List$String = function(){return this;};
873 ListFactory.prototype.is$List$T = function(){return this;}; 877 ListFactory.prototype.is$List$T = function(){return this;};
874 ListFactory.prototype.is$List$Type = function(){return this;};
875 ListFactory.prototype.is$List$Value = function(){return this;}; 878 ListFactory.prototype.is$List$Value = function(){return this;};
876 ListFactory.prototype.is$List$int = function(){return this;}; 879 ListFactory.prototype.is$List$int = function(){return this;};
877 ListFactory.prototype.is$Iterable = function(){return this;}; 880 ListFactory.prototype.is$Iterable = function(){return this;};
878 ListFactory.ListFactory$from$factory = function(other) { 881 ListFactory.ListFactory$from$factory = function(other) {
879 var $0; 882 var $0;
880 var list = []; 883 var list = [];
881 for (var $i = other.iterator(); $i.hasNext(); ) { 884 for (var $i = other.iterator(); $i.hasNext(); ) {
882 var e = $i.next(); 885 var e = $i.next();
883 list.add(e); 886 list.add(e);
884 } 887 }
(...skipping 23 matching lines...) Expand all
908 } 911 }
909 ListFactory.prototype.getRange = function(start, length) { 912 ListFactory.prototype.getRange = function(start, length) {
910 return this.slice(start, start + length); 913 return this.slice(start, start + length);
911 } 914 }
912 ListFactory.prototype.isEmpty = function() { 915 ListFactory.prototype.isEmpty = function() {
913 return this.length == 0; 916 return this.length == 0;
914 } 917 }
915 ListFactory.prototype.iterator = function() { 918 ListFactory.prototype.iterator = function() {
916 return new ListIterator(this); 919 return new ListIterator(this);
917 } 920 }
921 ListFactory.prototype.forEach$1 = ListFactory.prototype.forEach;
918 ListFactory$DoubleLinkedQueueEntry$KeyValuePair$K$V = ListFactory; 922 ListFactory$DoubleLinkedQueueEntry$KeyValuePair$K$V = ListFactory;
919 ListFactory$DoubleLinkedQueueEntry$KeyValuePair$Node$Element = ListFactory; 923 ListFactory$DoubleLinkedQueueEntry$KeyValuePair$Node$Element = ListFactory;
920 ListFactory$DoubleLinkedQueueEntry$KeyValuePair$String$Keyword = ListFactory; 924 ListFactory$DoubleLinkedQueueEntry$KeyValuePair$String$Keyword = ListFactory;
921 ListFactory$E = ListFactory; 925 ListFactory$E = ListFactory;
922 ListFactory$EvaluatedValue = ListFactory; 926 ListFactory$EvaluatedValue = ListFactory;
923 ListFactory$HBasicBlock = ListFactory; 927 ListFactory$HBasicBlock = ListFactory;
924 ListFactory$HInstruction = ListFactory; 928 ListFactory$HInstruction = ListFactory;
925 ListFactory$K = ListFactory; 929 ListFactory$K = ListFactory;
926 ListFactory$KeywordState = ListFactory; 930 ListFactory$KeywordState = ListFactory;
927 ListFactory$String = ListFactory; 931 ListFactory$String = ListFactory;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 } 1017 }
1014 // ********** Code for ImmutableMap ************** 1018 // ********** Code for ImmutableMap **************
1015 function ImmutableMap(keyValuePairs) { 1019 function ImmutableMap(keyValuePairs) {
1016 this._internal = $map([]); 1020 this._internal = $map([]);
1017 // Initializers done 1021 // Initializers done
1018 for (var i = 0; 1022 for (var i = 0;
1019 $notnull_bool(i < keyValuePairs.length); i += 2) { 1023 $notnull_bool(i < keyValuePairs.length); i += 2) {
1020 this._internal.$setindex(keyValuePairs.$index(i), keyValuePairs.$index(i + 1 )); 1024 this._internal.$setindex(keyValuePairs.$index(i), keyValuePairs.$index(i + 1 ));
1021 } 1025 }
1022 } 1026 }
1027 ImmutableMap.prototype.is$Map = function(){return this;};
1023 ImmutableMap.prototype.$index = function(key) { 1028 ImmutableMap.prototype.$index = function(key) {
1024 return this._internal.$index(key); 1029 return this._internal.$index(key);
1025 } 1030 }
1026 ImmutableMap.prototype.isEmpty = function() { 1031 ImmutableMap.prototype.isEmpty = function() {
1027 return this._internal.isEmpty(); 1032 return this._internal.isEmpty();
1028 } 1033 }
1029 ImmutableMap.prototype.get$length = function() { 1034 ImmutableMap.prototype.get$length = function() {
1030 return this._internal.get$length(); 1035 return this._internal.get$length();
1031 } 1036 }
1032 Object.defineProperty(ImmutableMap.prototype, "length", { 1037 Object.defineProperty(ImmutableMap.prototype, "length", {
1033 get: ImmutableMap.prototype.get$length, 1038 get: ImmutableMap.prototype.get$length,
1034 }); 1039 });
1035 ImmutableMap.prototype.forEach = function(f) { 1040 ImmutableMap.prototype.forEach = function(f) {
1036 this._internal.forEach(f); 1041 this._internal.forEach(f);
1037 } 1042 }
1038 ImmutableMap.prototype.getKeys = function() { 1043 ImmutableMap.prototype.getKeys = function() {
1039 return this._internal.getKeys(); 1044 return this._internal.getKeys();
1040 } 1045 }
1041 ImmutableMap.prototype.getValues = function() { 1046 ImmutableMap.prototype.getValues = function() {
1042 return this._internal.getValues(); 1047 return this._internal.getValues();
1043 } 1048 }
1044 ImmutableMap.prototype.containsKey = function(key) { 1049 ImmutableMap.prototype.containsKey = function(key) {
1045 return this._internal.containsKey(key); 1050 return this._internal.containsKey(key);
1046 } 1051 }
1047 ImmutableMap.prototype.$setindex = function(key, value) { 1052 ImmutableMap.prototype.$setindex = function(key, value) {
1048 $throw(const$221/*const IllegalAccessException()*/); 1053 $throw(const$221/*const IllegalAccessException()*/);
1049 } 1054 }
1055 ImmutableMap.prototype.forEach$1 = ImmutableMap.prototype.forEach;
1050 // ********** Code for MatchImplementation ************** 1056 // ********** Code for MatchImplementation **************
1051 function MatchImplementation(pattern, str, _start, _end, _groups) { 1057 function MatchImplementation(pattern, str, _start, _end, _groups) {
1052 this.pattern = pattern; 1058 this.pattern = pattern;
1053 this.str = str; 1059 this.str = str;
1054 this._start = _start; 1060 this._start = _start;
1055 this._end = _end; 1061 this._end = _end;
1056 this._groups = _groups; 1062 this._groups = _groups;
1057 // Initializers done 1063 // Initializers done
1058 } 1064 }
1059 MatchImplementation.prototype.$index = function(group) { 1065 MatchImplementation.prototype.$index = function(group) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 // Initializers done 1130 // Initializers done
1125 if ($notnull_bool(HashMapImplementation._deletedKey == null)) { 1131 if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
1126 HashMapImplementation._deletedKey = new Object(); 1132 HashMapImplementation._deletedKey = new Object();
1127 } 1133 }
1128 this._numberOfEntries = 0; 1134 this._numberOfEntries = 0;
1129 this._numberOfDeleted = 0; 1135 this._numberOfDeleted = 0;
1130 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/); 1136 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/);
1131 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1137 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1132 this._values = new ListFactory$V(8/*HashMapImplementation._INITIAL_CAPACITY*/) ; 1138 this._values = new ListFactory$V(8/*HashMapImplementation._INITIAL_CAPACITY*/) ;
1133 } 1139 }
1140 HashMapImplementation.prototype.is$Map = function(){return this;};
1134 HashMapImplementation.HashMapImplementation$from$factory = function(other) { 1141 HashMapImplementation.HashMapImplementation$from$factory = function(other) {
1135 var result = new HashMapImplementation(); 1142 var result = new HashMapImplementation();
1136 other.forEach((function (key, value) { 1143 other.forEach((function (key, value) {
1137 result.$setindex(key, value); 1144 result.$setindex(key, value);
1138 }) 1145 })
1139 ); 1146 );
1140 return result; 1147 return result;
1141 } 1148 }
1142 HashMapImplementation._computeLoadLimit = function(capacity) { 1149 HashMapImplementation._computeLoadLimit = function(capacity) {
1143 return $truncdiv((capacity * 3), 4); 1150 return $truncdiv((capacity * 3), 4);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 var i = 0; 1291 var i = 0;
1285 this.forEach(function _(key, value) { 1292 this.forEach(function _(key, value) {
1286 list.$setindex(i++, value); 1293 list.$setindex(i++, value);
1287 } 1294 }
1288 ); 1295 );
1289 return list; 1296 return list;
1290 } 1297 }
1291 HashMapImplementation.prototype.containsKey = function(key) { 1298 HashMapImplementation.prototype.containsKey = function(key) {
1292 return (this._probeForLookup(key) != -1); 1299 return (this._probeForLookup(key) != -1);
1293 } 1300 }
1301 HashMapImplementation.prototype.forEach$1 = HashMapImplementation.prototype.forE ach;
1294 // ********** Code for HashMapImplementation$E$E ************** 1302 // ********** Code for HashMapImplementation$E$E **************
1295 function HashMapImplementation$E$E() { 1303 function HashMapImplementation$E$E() {
1296 // Initializers done 1304 // Initializers done
1297 if ($notnull_bool(HashMapImplementation._deletedKey == null)) { 1305 if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
1298 HashMapImplementation._deletedKey = new Object(); 1306 HashMapImplementation._deletedKey = new Object();
1299 } 1307 }
1300 this._numberOfEntries = 0; 1308 this._numberOfEntries = 0;
1301 this._numberOfDeleted = 0; 1309 this._numberOfDeleted = 0;
1302 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/); 1310 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/);
1303 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1311 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1304 this._values = new ListFactory$E(8/*HashMapImplementation._INITIAL_CAPACITY*/) ; 1312 this._values = new ListFactory$E(8/*HashMapImplementation._INITIAL_CAPACITY*/) ;
1305 } 1313 }
1306 $inherits(HashMapImplementation$E$E, HashMapImplementation); 1314 $inherits(HashMapImplementation$E$E, HashMapImplementation);
1315 HashMapImplementation$E$E.prototype.is$Map = function(){return this;};
1307 HashMapImplementation$E$E._computeLoadLimit = function(capacity) { 1316 HashMapImplementation$E$E._computeLoadLimit = function(capacity) {
1308 return $truncdiv((capacity * 3), 4); 1317 return $truncdiv((capacity * 3), 4);
1309 } 1318 }
1310 HashMapImplementation$E$E._firstProbe = function(hashCode, length) { 1319 HashMapImplementation$E$E._firstProbe = function(hashCode, length) {
1311 return hashCode & (length - 1); 1320 return hashCode & (length - 1);
1312 } 1321 }
1313 HashMapImplementation$E$E._nextProbe = function(currentProbe, numberOfProbes, le ngth) { 1322 HashMapImplementation$E$E._nextProbe = function(currentProbe, numberOfProbes, le ngth) {
1314 return (currentProbe + numberOfProbes) & (length - 1); 1323 return (currentProbe + numberOfProbes) & (length - 1);
1315 } 1324 }
1316 HashMapImplementation$E$E.prototype._probeForAdding = function(key) { 1325 HashMapImplementation$E$E.prototype._probeForAdding = function(key) {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 if ($notnull_bool(HashMapImplementation._deletedKey == null)) { 1451 if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
1443 HashMapImplementation._deletedKey = new Object(); 1452 HashMapImplementation._deletedKey = new Object();
1444 } 1453 }
1445 this._numberOfEntries = 0; 1454 this._numberOfEntries = 0;
1446 this._numberOfDeleted = 0; 1455 this._numberOfDeleted = 0;
1447 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/); 1456 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/);
1448 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1457 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1449 this._values = new ListFactory$HInstruction(8/*HashMapImplementation._INITIAL_ CAPACITY*/); 1458 this._values = new ListFactory$HInstruction(8/*HashMapImplementation._INITIAL_ CAPACITY*/);
1450 } 1459 }
1451 $inherits(HashMapImplementation$Element$HInstruction, HashMapImplementation); 1460 $inherits(HashMapImplementation$Element$HInstruction, HashMapImplementation);
1461 HashMapImplementation$Element$HInstruction.prototype.is$Map = function(){return this;};
1452 HashMapImplementation$Element$HInstruction.HashMapImplementation$from$factory = function(other) { 1462 HashMapImplementation$Element$HInstruction.HashMapImplementation$from$factory = function(other) {
1453 var result = new HashMapImplementation(); 1463 var result = new HashMapImplementation();
1454 other.forEach((function (key, value) { 1464 other.forEach((function (key, value) {
1455 result.$setindex(key, value); 1465 result.$setindex(key, value);
1456 }) 1466 })
1457 ); 1467 );
1458 return result; 1468 return result;
1459 } 1469 }
1460 HashMapImplementation$Element$HInstruction._computeLoadLimit = function(capacity ) { 1470 HashMapImplementation$Element$HInstruction._computeLoadLimit = function(capacity ) {
1461 return $truncdiv((capacity * 3), 4); 1471 return $truncdiv((capacity * 3), 4);
1462 } 1472 }
1463 // ********** Code for HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePa ir$K$V ************** 1473 // ********** Code for HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePa ir$K$V **************
1464 function HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V() { 1474 function HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V() {
1465 // Initializers done 1475 // Initializers done
1466 if ($notnull_bool(HashMapImplementation._deletedKey == null)) { 1476 if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
1467 HashMapImplementation._deletedKey = new Object(); 1477 HashMapImplementation._deletedKey = new Object();
1468 } 1478 }
1469 this._numberOfEntries = 0; 1479 this._numberOfEntries = 0;
1470 this._numberOfDeleted = 0; 1480 this._numberOfDeleted = 0;
1471 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/); 1481 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/);
1472 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1482 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1473 this._values = new ListFactory$DoubleLinkedQueueEntry$KeyValuePair$K$V(8/*Hash MapImplementation._INITIAL_CAPACITY*/); 1483 this._values = new ListFactory$DoubleLinkedQueueEntry$KeyValuePair$K$V(8/*Hash MapImplementation._INITIAL_CAPACITY*/);
1474 } 1484 }
1475 $inherits(HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V, HashM apImplementation); 1485 $inherits(HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V, HashM apImplementation);
1486 HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype.is$Map = function(){return this;};
1476 HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V._computeLoadLimi t = function(capacity) { 1487 HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V._computeLoadLimi t = function(capacity) {
1477 return $truncdiv((capacity * 3), 4); 1488 return $truncdiv((capacity * 3), 4);
1478 } 1489 }
1479 // ********** Code for HashMapImplementation$Node$DoubleLinkedQueueEntry$KeyValu ePair$Node$Element ************** 1490 // ********** Code for HashMapImplementation$Node$DoubleLinkedQueueEntry$KeyValu ePair$Node$Element **************
1480 function HashMapImplementation$Node$DoubleLinkedQueueEntry$KeyValuePair$Node$Ele ment() { 1491 function HashMapImplementation$Node$DoubleLinkedQueueEntry$KeyValuePair$Node$Ele ment() {
1481 // Initializers done 1492 // Initializers done
1482 if ($notnull_bool(HashMapImplementation._deletedKey == null)) { 1493 if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
1483 HashMapImplementation._deletedKey = new Object(); 1494 HashMapImplementation._deletedKey = new Object();
1484 } 1495 }
1485 this._numberOfEntries = 0; 1496 this._numberOfEntries = 0;
1486 this._numberOfDeleted = 0; 1497 this._numberOfDeleted = 0;
1487 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/); 1498 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/);
1488 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1499 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1489 this._values = new ListFactory$DoubleLinkedQueueEntry$KeyValuePair$Node$Elemen t(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1500 this._values = new ListFactory$DoubleLinkedQueueEntry$KeyValuePair$Node$Elemen t(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1490 } 1501 }
1491 $inherits(HashMapImplementation$Node$DoubleLinkedQueueEntry$KeyValuePair$Node$El ement, HashMapImplementation); 1502 $inherits(HashMapImplementation$Node$DoubleLinkedQueueEntry$KeyValuePair$Node$El ement, HashMapImplementation);
1503 HashMapImplementation$Node$DoubleLinkedQueueEntry$KeyValuePair$Node$Element.prot otype.is$Map = function(){return this;};
1492 HashMapImplementation$Node$DoubleLinkedQueueEntry$KeyValuePair$Node$Element._com puteLoadLimit = function(capacity) { 1504 HashMapImplementation$Node$DoubleLinkedQueueEntry$KeyValuePair$Node$Element._com puteLoadLimit = function(capacity) {
1493 return $truncdiv((capacity * 3), 4); 1505 return $truncdiv((capacity * 3), 4);
1494 } 1506 }
1495 // ********** Code for HashMapImplementation$String$DoubleLinkedQueueEntry$KeyVa luePair$String$Keyword ************** 1507 // ********** Code for HashMapImplementation$String$DoubleLinkedQueueEntry$KeyVa luePair$String$Keyword **************
1496 function HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePair$String $Keyword() { 1508 function HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePair$String $Keyword() {
1497 // Initializers done 1509 // Initializers done
1498 if ($notnull_bool(HashMapImplementation._deletedKey == null)) { 1510 if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
1499 HashMapImplementation._deletedKey = new Object(); 1511 HashMapImplementation._deletedKey = new Object();
1500 } 1512 }
1501 this._numberOfEntries = 0; 1513 this._numberOfEntries = 0;
1502 this._numberOfDeleted = 0; 1514 this._numberOfDeleted = 0;
1503 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/); 1515 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/);
1504 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1516 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1505 this._values = new ListFactory$DoubleLinkedQueueEntry$KeyValuePair$String$Keyw ord(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1517 this._values = new ListFactory$DoubleLinkedQueueEntry$KeyValuePair$String$Keyw ord(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1506 } 1518 }
1507 $inherits(HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePair$Strin g$Keyword, HashMapImplementation); 1519 $inherits(HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePair$Strin g$Keyword, HashMapImplementation);
1520 HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePair$String$Keyword. prototype.is$Map = function(){return this;};
1508 HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePair$String$Keyword. _computeLoadLimit = function(capacity) { 1521 HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePair$String$Keyword. _computeLoadLimit = function(capacity) {
1509 return $truncdiv((capacity * 3), 4); 1522 return $truncdiv((capacity * 3), 4);
1510 } 1523 }
1511 // ********** Code for HashMapImplementation$String$EvaluatedValue ************* * 1524 // ********** Code for HashMapImplementation$String$EvaluatedValue ************* *
1512 function HashMapImplementation$String$EvaluatedValue() { 1525 function HashMapImplementation$String$EvaluatedValue() {
1513 // Initializers done 1526 // Initializers done
1514 if ($notnull_bool(HashMapImplementation._deletedKey == null)) { 1527 if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
1515 HashMapImplementation._deletedKey = new Object(); 1528 HashMapImplementation._deletedKey = new Object();
1516 } 1529 }
1517 this._numberOfEntries = 0; 1530 this._numberOfEntries = 0;
1518 this._numberOfDeleted = 0; 1531 this._numberOfDeleted = 0;
1519 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/); 1532 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/);
1520 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1533 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1521 this._values = new ListFactory$EvaluatedValue(8/*HashMapImplementation._INITIA L_CAPACITY*/); 1534 this._values = new ListFactory$EvaluatedValue(8/*HashMapImplementation._INITIA L_CAPACITY*/);
1522 } 1535 }
1523 $inherits(HashMapImplementation$String$EvaluatedValue, HashMapImplementation); 1536 $inherits(HashMapImplementation$String$EvaluatedValue, HashMapImplementation);
1537 HashMapImplementation$String$EvaluatedValue.prototype.is$Map = function(){return this;};
1524 HashMapImplementation$String$EvaluatedValue._computeLoadLimit = function(capacit y) { 1538 HashMapImplementation$String$EvaluatedValue._computeLoadLimit = function(capacit y) {
1525 return $truncdiv((capacity * 3), 4); 1539 return $truncdiv((capacity * 3), 4);
1526 } 1540 }
1527 // ********** Code for HashMapImplementation$String$String ************** 1541 // ********** Code for HashMapImplementation$String$String **************
1528 function HashMapImplementation$String$String() { 1542 function HashMapImplementation$String$String() {
1529 // Initializers done 1543 // Initializers done
1530 if ($notnull_bool(HashMapImplementation._deletedKey == null)) { 1544 if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
1531 HashMapImplementation._deletedKey = new Object(); 1545 HashMapImplementation._deletedKey = new Object();
1532 } 1546 }
1533 this._numberOfEntries = 0; 1547 this._numberOfEntries = 0;
1534 this._numberOfDeleted = 0; 1548 this._numberOfDeleted = 0;
1535 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/); 1549 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/);
1536 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1550 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1537 this._values = new ListFactory$String(8/*HashMapImplementation._INITIAL_CAPACI TY*/); 1551 this._values = new ListFactory$String(8/*HashMapImplementation._INITIAL_CAPACI TY*/);
1538 } 1552 }
1539 $inherits(HashMapImplementation$String$String, HashMapImplementation); 1553 $inherits(HashMapImplementation$String$String, HashMapImplementation);
1554 HashMapImplementation$String$String.prototype.is$Map = function(){return this;};
1540 HashMapImplementation$String$String._computeLoadLimit = function(capacity) { 1555 HashMapImplementation$String$String._computeLoadLimit = function(capacity) {
1541 return $truncdiv((capacity * 3), 4); 1556 return $truncdiv((capacity * 3), 4);
1542 } 1557 }
1543 // ********** Code for HashMapImplementation$Type$Type ************** 1558 // ********** Code for HashMapImplementation$Type$Type **************
1544 function HashMapImplementation$Type$Type() { 1559 function HashMapImplementation$Type$Type() {
1545 // Initializers done 1560 // Initializers done
1546 if ($notnull_bool(HashMapImplementation._deletedKey == null)) { 1561 if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
1547 HashMapImplementation._deletedKey = new Object(); 1562 HashMapImplementation._deletedKey = new Object();
1548 } 1563 }
1549 this._numberOfEntries = 0; 1564 this._numberOfEntries = 0;
1550 this._numberOfDeleted = 0; 1565 this._numberOfDeleted = 0;
1551 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/); 1566 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/);
1552 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1567 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1553 this._values = new ListFactory$Type(8/*HashMapImplementation._INITIAL_CAPACITY */); 1568 this._values = new ListFactory$Type(8/*HashMapImplementation._INITIAL_CAPACITY */);
1554 } 1569 }
1555 $inherits(HashMapImplementation$Type$Type, HashMapImplementation); 1570 $inherits(HashMapImplementation$Type$Type, HashMapImplementation);
1571 HashMapImplementation$Type$Type.prototype.is$Map = function(){return this;};
1556 HashMapImplementation$Type$Type._computeLoadLimit = function(capacity) { 1572 HashMapImplementation$Type$Type._computeLoadLimit = function(capacity) {
1557 return $truncdiv((capacity * 3), 4); 1573 return $truncdiv((capacity * 3), 4);
1558 } 1574 }
1559 // ********** Code for HashMapImplementation$int$int ************** 1575 // ********** Code for HashMapImplementation$int$int **************
1560 function HashMapImplementation$int$int() { 1576 function HashMapImplementation$int$int() {
1561 // Initializers done 1577 // Initializers done
1562 if ($notnull_bool(HashMapImplementation._deletedKey == null)) { 1578 if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
1563 HashMapImplementation._deletedKey = new Object(); 1579 HashMapImplementation._deletedKey = new Object();
1564 } 1580 }
1565 this._numberOfEntries = 0; 1581 this._numberOfEntries = 0;
1566 this._numberOfDeleted = 0; 1582 this._numberOfDeleted = 0;
1567 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/); 1583 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa tion._INITIAL_CAPACITY*/);
1568 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); 1584 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
1569 this._values = new ListFactory$int(8/*HashMapImplementation._INITIAL_CAPACITY* /); 1585 this._values = new ListFactory$int(8/*HashMapImplementation._INITIAL_CAPACITY* /);
1570 } 1586 }
1571 $inherits(HashMapImplementation$int$int, HashMapImplementation); 1587 $inherits(HashMapImplementation$int$int, HashMapImplementation);
1588 HashMapImplementation$int$int.prototype.is$Map = function(){return this;};
1572 HashMapImplementation$int$int._computeLoadLimit = function(capacity) { 1589 HashMapImplementation$int$int._computeLoadLimit = function(capacity) {
1573 return $truncdiv((capacity * 3), 4); 1590 return $truncdiv((capacity * 3), 4);
1574 } 1591 }
1575 // ********** Code for HashSetImplementation ************** 1592 // ********** Code for HashSetImplementation **************
1576 function HashSetImplementation() { 1593 function HashSetImplementation() {
1577 // Initializers done 1594 // Initializers done
1578 this._backingMap = new HashMapImplementation$E$E(); 1595 this._backingMap = new HashMapImplementation$E$E();
1579 } 1596 }
1580 HashSetImplementation.prototype.is$Iterable = function(){return this;}; 1597 HashSetImplementation.prototype.is$Iterable = function(){return this;};
1581 HashSetImplementation.HashSetImplementation$from$factory = function(other) { 1598 HashSetImplementation.HashSetImplementation$from$factory = function(other) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 } 1648 }
1632 HashSetImplementation.prototype.get$length = function() { 1649 HashSetImplementation.prototype.get$length = function() {
1633 return this._backingMap.get$length(); 1650 return this._backingMap.get$length();
1634 } 1651 }
1635 Object.defineProperty(HashSetImplementation.prototype, "length", { 1652 Object.defineProperty(HashSetImplementation.prototype, "length", {
1636 get: HashSetImplementation.prototype.get$length, 1653 get: HashSetImplementation.prototype.get$length,
1637 }); 1654 });
1638 HashSetImplementation.prototype.iterator = function() { 1655 HashSetImplementation.prototype.iterator = function() {
1639 return new HashSetIterator$E(this); 1656 return new HashSetIterator$E(this);
1640 } 1657 }
1658 HashSetImplementation.prototype.forEach$1 = HashSetImplementation.prototype.forE ach;
1641 // ********** Code for HashSetImplementation$E ************** 1659 // ********** Code for HashSetImplementation$E **************
1642 function HashSetImplementation$E() { 1660 function HashSetImplementation$E() {
1643 // Initializers done 1661 // Initializers done
1644 this._backingMap = new HashMapImplementation$E$E(); 1662 this._backingMap = new HashMapImplementation$E$E();
1645 } 1663 }
1646 $inherits(HashSetImplementation$E, HashSetImplementation); 1664 $inherits(HashSetImplementation$E, HashSetImplementation);
1647 HashSetImplementation$E.prototype.is$Iterable = function(){return this;}; 1665 HashSetImplementation$E.prototype.is$Iterable = function(){return this;};
1648 // ********** Code for HashSetImplementation$String ************** 1666 // ********** Code for HashSetImplementation$String **************
1649 function HashSetImplementation$String() { 1667 function HashSetImplementation$String() {
1650 // Initializers done 1668 // Initializers done
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1736 $inherits(KeyValuePair$Node$Element, KeyValuePair); 1754 $inherits(KeyValuePair$Node$Element, KeyValuePair);
1737 // ********** Code for KeyValuePair$String$Keyword ************** 1755 // ********** Code for KeyValuePair$String$Keyword **************
1738 function KeyValuePair$String$Keyword() {} 1756 function KeyValuePair$String$Keyword() {}
1739 $inherits(KeyValuePair$String$Keyword, KeyValuePair); 1757 $inherits(KeyValuePair$String$Keyword, KeyValuePair);
1740 // ********** Code for LinkedHashMapImplementation ************** 1758 // ********** Code for LinkedHashMapImplementation **************
1741 function LinkedHashMapImplementation() { 1759 function LinkedHashMapImplementation() {
1742 // Initializers done 1760 // Initializers done
1743 this._map = new HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$ V(); 1761 this._map = new HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$ V();
1744 this._list = new DoubleLinkedQueue$KeyValuePair$K$V(); 1762 this._list = new DoubleLinkedQueue$KeyValuePair$K$V();
1745 } 1763 }
1764 LinkedHashMapImplementation.prototype.is$Map = function(){return this;};
1746 LinkedHashMapImplementation.prototype.$setindex = function(key, value) { 1765 LinkedHashMapImplementation.prototype.$setindex = function(key, value) {
1747 if ($notnull_bool(this._map.containsKey(key))) { 1766 if ($notnull_bool(this._map.containsKey(key))) {
1748 this._map.$index(key).get$element().value = value; 1767 this._map.$index(key).get$element().value = value;
1749 } 1768 }
1750 else { 1769 else {
1751 this._list.addLast(new KeyValuePair$K$V(key, value)); 1770 this._list.addLast(new KeyValuePair$K$V(key, value));
1752 this._map.$setindex(key, this._list.lastEntry()); 1771 this._map.$setindex(key, this._list.lastEntry());
1753 } 1772 }
1754 } 1773 }
1755 LinkedHashMapImplementation.prototype.$index = function(key) { 1774 LinkedHashMapImplementation.prototype.$index = function(key) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1789 } 1808 }
1790 LinkedHashMapImplementation.prototype.get$length = function() { 1809 LinkedHashMapImplementation.prototype.get$length = function() {
1791 return this._map.get$length(); 1810 return this._map.get$length();
1792 } 1811 }
1793 Object.defineProperty(LinkedHashMapImplementation.prototype, "length", { 1812 Object.defineProperty(LinkedHashMapImplementation.prototype, "length", {
1794 get: LinkedHashMapImplementation.prototype.get$length, 1813 get: LinkedHashMapImplementation.prototype.get$length,
1795 }); 1814 });
1796 LinkedHashMapImplementation.prototype.isEmpty = function() { 1815 LinkedHashMapImplementation.prototype.isEmpty = function() {
1797 return this.get$length() == 0; 1816 return this.get$length() == 0;
1798 } 1817 }
1818 LinkedHashMapImplementation.prototype.forEach$1 = LinkedHashMapImplementation.pr ototype.forEach;
1799 // ********** Code for LinkedHashMapImplementation$Node$Element ************** 1819 // ********** Code for LinkedHashMapImplementation$Node$Element **************
1800 function LinkedHashMapImplementation$Node$Element() { 1820 function LinkedHashMapImplementation$Node$Element() {
1801 // Initializers done 1821 // Initializers done
1802 this._map = new HashMapImplementation$Node$DoubleLinkedQueueEntry$KeyValuePair $Node$Element(); 1822 this._map = new HashMapImplementation$Node$DoubleLinkedQueueEntry$KeyValuePair $Node$Element();
1803 this._list = new DoubleLinkedQueue$KeyValuePair$Node$Element(); 1823 this._list = new DoubleLinkedQueue$KeyValuePair$Node$Element();
1804 } 1824 }
1805 $inherits(LinkedHashMapImplementation$Node$Element, LinkedHashMapImplementation) ; 1825 $inherits(LinkedHashMapImplementation$Node$Element, LinkedHashMapImplementation) ;
1826 LinkedHashMapImplementation$Node$Element.prototype.is$Map = function(){return th is;};
1806 // ********** Code for LinkedHashMapImplementation$String$Keyword ************** 1827 // ********** Code for LinkedHashMapImplementation$String$Keyword **************
1807 function LinkedHashMapImplementation$String$Keyword() { 1828 function LinkedHashMapImplementation$String$Keyword() {
1808 // Initializers done 1829 // Initializers done
1809 this._map = new HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePa ir$String$Keyword(); 1830 this._map = new HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePa ir$String$Keyword();
1810 this._list = new DoubleLinkedQueue$KeyValuePair$String$Keyword(); 1831 this._list = new DoubleLinkedQueue$KeyValuePair$String$Keyword();
1811 } 1832 }
1812 $inherits(LinkedHashMapImplementation$String$Keyword, LinkedHashMapImplementatio n); 1833 $inherits(LinkedHashMapImplementation$String$Keyword, LinkedHashMapImplementatio n);
1834 LinkedHashMapImplementation$String$Keyword.prototype.is$Map = function(){return this;};
1813 // ********** Code for DoubleLinkedQueueEntry ************** 1835 // ********** Code for DoubleLinkedQueueEntry **************
1814 function DoubleLinkedQueueEntry(e) { 1836 function DoubleLinkedQueueEntry(e) {
1815 // Initializers done 1837 // Initializers done
1816 this._element = e; 1838 this._element = e;
1817 } 1839 }
1818 DoubleLinkedQueueEntry.prototype.is$DoubleLinkedQueueEntry$KeyValuePair$K$V = fu nction(){return this;}; 1840 DoubleLinkedQueueEntry.prototype.is$DoubleLinkedQueueEntry$KeyValuePair$K$V = fu nction(){return this;};
1819 DoubleLinkedQueueEntry.prototype._link = function(p, n) { 1841 DoubleLinkedQueueEntry.prototype._link = function(p, n) {
1820 this._next = n; 1842 this._next = n;
1821 this._previous = p; 1843 this._previous = p;
1822 p._next = this; 1844 p._next = this;
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
2039 var entry = this._sentinel._next; 2061 var entry = this._sentinel._next;
2040 while ($notnull_bool(entry !== this._sentinel)) { 2062 while ($notnull_bool(entry !== this._sentinel)) {
2041 if ($notnull_bool(f(entry._element))) other.addLast(entry._element); 2063 if ($notnull_bool(f(entry._element))) other.addLast(entry._element);
2042 entry = entry._next; 2064 entry = entry._next;
2043 } 2065 }
2044 return other; 2066 return other;
2045 } 2067 }
2046 DoubleLinkedQueue.prototype.iterator = function() { 2068 DoubleLinkedQueue.prototype.iterator = function() {
2047 return new _DoubleLinkedQueueIterator$E(this._sentinel); 2069 return new _DoubleLinkedQueueIterator$E(this._sentinel);
2048 } 2070 }
2071 DoubleLinkedQueue.prototype.forEach$1 = DoubleLinkedQueue.prototype.forEach;
2049 // ********** Code for DoubleLinkedQueue$E ************** 2072 // ********** Code for DoubleLinkedQueue$E **************
2050 function DoubleLinkedQueue$E() { 2073 function DoubleLinkedQueue$E() {
2051 // Initializers done 2074 // Initializers done
2052 this._sentinel = new _DoubleLinkedQueueEntrySentinel$E(); 2075 this._sentinel = new _DoubleLinkedQueueEntrySentinel$E();
2053 } 2076 }
2054 $inherits(DoubleLinkedQueue$E, DoubleLinkedQueue); 2077 $inherits(DoubleLinkedQueue$E, DoubleLinkedQueue);
2055 DoubleLinkedQueue$E.prototype.is$Iterable = function(){return this;}; 2078 DoubleLinkedQueue$E.prototype.is$Iterable = function(){return this;};
2056 // ********** Code for DoubleLinkedQueue$KeyValuePair$K$V ************** 2079 // ********** Code for DoubleLinkedQueue$KeyValuePair$K$V **************
2057 function DoubleLinkedQueue$KeyValuePair$K$V() { 2080 function DoubleLinkedQueue$KeyValuePair$K$V() {
2058 // Initializers done 2081 // Initializers done
(...skipping 4956 matching lines...) Expand 10 before | Expand all | Expand 10 after
7015 Literal.prototype.getEndToken = function() { 7038 Literal.prototype.getEndToken = function() {
7016 return this.token; 7039 return this.token;
7017 } 7040 }
7018 // ********** Code for Literal$SourceString ************** 7041 // ********** Code for Literal$SourceString **************
7019 function Literal$SourceString(token, handler) { 7042 function Literal$SourceString(token, handler) {
7020 this.token = token; 7043 this.token = token;
7021 this.handler = handler; 7044 this.handler = handler;
7022 // Initializers done 7045 // Initializers done
7023 } 7046 }
7024 $inherits(Literal$SourceString, Literal); 7047 $inherits(Literal$SourceString, Literal);
7048 Literal$SourceString.prototype.hashCode = function() {
7049 return this._hashCode;
7050 }
7025 // ********** Code for Literal$bool ************** 7051 // ********** Code for Literal$bool **************
7026 function Literal$bool(token, handler) { 7052 function Literal$bool(token, handler) {
7027 this.token = token; 7053 this.token = token;
7028 this.handler = handler; 7054 this.handler = handler;
7029 // Initializers done 7055 // Initializers done
7030 } 7056 }
7031 $inherits(Literal$bool, Literal); 7057 $inherits(Literal$bool, Literal);
7058 Literal$bool.prototype.hashCode = function() {
7059 return this._hashCode;
7060 }
7032 // ********** Code for Literal$double ************** 7061 // ********** Code for Literal$double **************
7033 function Literal$double(token, handler) { 7062 function Literal$double(token, handler) {
7034 this.token = token; 7063 this.token = token;
7035 this.handler = handler; 7064 this.handler = handler;
7036 // Initializers done 7065 // Initializers done
7037 } 7066 }
7038 $inherits(Literal$double, Literal); 7067 $inherits(Literal$double, Literal);
7068 Literal$double.prototype.hashCode = function() {
7069 return this._hashCode;
7070 }
7039 // ********** Code for Literal$int ************** 7071 // ********** Code for Literal$int **************
7040 function Literal$int(token, handler) { 7072 function Literal$int(token, handler) {
7041 this.token = token; 7073 this.token = token;
7042 this.handler = handler; 7074 this.handler = handler;
7043 // Initializers done 7075 // Initializers done
7044 } 7076 }
7045 $inherits(Literal$int, Literal); 7077 $inherits(Literal$int, Literal);
7078 Literal$int.prototype.hashCode = function() {
7079 return this._hashCode;
7080 }
7046 // ********** Code for LiteralInt ************** 7081 // ********** Code for LiteralInt **************
7047 function LiteralInt(token, handler) { 7082 function LiteralInt(token, handler) {
7048 Literal$int.call(this, token, handler); 7083 Literal$int.call(this, token, handler);
7049 // Initializers done 7084 // Initializers done
7050 } 7085 }
7051 $inherits(LiteralInt, Literal$int); 7086 $inherits(LiteralInt, Literal$int);
7052 LiteralInt.prototype.get$value = function() { 7087 LiteralInt.prototype.get$value = function() {
7053 try { 7088 try {
7054 return Math.parseInt($assert_String(this.token.get$value().toString())); 7089 return Math.parseInt($assert_String(this.token.get$value().toString()));
7055 } catch (ex) { 7090 } catch (ex) {
(...skipping 3113 matching lines...) Expand 10 before | Expand all | Expand 10 after
10169 } 10204 }
10170 WorldGenerator.prototype.writeType = function(type) { 10205 WorldGenerator.prototype.writeType = function(type) {
10171 var $0; 10206 var $0;
10172 if ($notnull_bool(type.name != null && (type instanceof ConcreteType) && $eq(t ype.get$library(), world.get$coreimpl()) && type.name.startsWith('ListFactory')) ) { 10207 if ($notnull_bool(type.name != null && (type instanceof ConcreteType) && $eq(t ype.get$library(), world.get$coreimpl()) && type.name.startsWith('ListFactory')) ) {
10173 this.writer.writeln(('' + type.get$jsname() + ' = ' + type.get$genericType() .get$jsname() + ';')); 10208 this.writer.writeln(('' + type.get$jsname() + ' = ' + type.get$genericType() .get$jsname() + ';'));
10174 return; 10209 return;
10175 } 10210 }
10176 var typeName = $notnull_bool(type.get$jsname() != null) ? type.get$jsname() : 'top level'; 10211 var typeName = $notnull_bool(type.get$jsname() != null) ? type.get$jsname() : 'top level';
10177 this.writer.comment(('// ********** Code for ' + typeName + ' **************') ); 10212 this.writer.comment(('// ********** Code for ' + typeName + ' **************') );
10178 if ($notnull_bool(type.get$isNativeType() && !$notnull_bool(type.get$isTop())) ) { 10213 if ($notnull_bool(type.get$isNativeType() && !$notnull_bool(type.get$isTop())) ) {
10179 var nativeName = type.get$definition().get$nativeType(); 10214 var nativeName = type.get$definition().nativeType;
10180 if ($notnull_bool($eq(nativeName, ''))) { 10215 if ($notnull_bool($eq(nativeName, ''))) {
10181 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); 10216 this.writer.writeln(('function ' + type.get$jsname() + '() {}'));
10182 } 10217 }
10183 else if ($notnull_bool(type.get$jsname() != nativeName)) { 10218 else if ($notnull_bool(type.get$jsname() != nativeName)) {
10184 this.writer.writeln(('' + type.get$jsname() + ' = ' + nativeName + ';')); 10219 this.writer.writeln(('' + type.get$jsname() + ' = ' + nativeName + ';'));
10185 } 10220 }
10186 } 10221 }
10187 if ($notnull_bool(type.get$isTop())) { 10222 if ($notnull_bool(type.get$isTop())) {
10188 } 10223 }
10189 else if ($notnull_bool(type.get$constructors().get$length() == 0)) { 10224 else if ($notnull_bool(type.constructors.get$length() == 0)) {
10190 if ($notnull_bool(!$notnull_bool(type.get$isNativeType()))) { 10225 if ($notnull_bool(!$notnull_bool(type.get$isNativeType()))) {
10191 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); 10226 this.writer.writeln(('function ' + type.get$jsname() + '() {}'));
10192 } 10227 }
10193 } 10228 }
10194 else { 10229 else {
10195 var standardConstructor = (($0 = type.get$constructors().$index('')) && $0.i s$Member()); 10230 var standardConstructor = (($0 = type.constructors.$index('')) && $0.is$Memb er());
10196 if ($notnull_bool(standardConstructor == null || standardConstructor.generat or == null)) { 10231 if ($notnull_bool(standardConstructor == null || standardConstructor.generat or == null)) {
10197 if ($notnull_bool(!$notnull_bool(type.get$isNativeType()))) { 10232 if ($notnull_bool(!$notnull_bool(type.get$isNativeType()))) {
10198 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); 10233 this.writer.writeln(('function ' + type.get$jsname() + '() {}'));
10199 } 10234 }
10200 } 10235 }
10201 else { 10236 else {
10202 standardConstructor.generator.writeDefinition(this.writer, null); 10237 standardConstructor.generator.writeDefinition(this.writer, null);
10203 } 10238 }
10204 var $list = type.get$constructors().getValues(); 10239 var $list = type.constructors.getValues();
10205 for (var $i = type.get$constructors().getValues().iterator(); $i.hasNext(); ) { 10240 for (var $i = type.constructors.getValues().iterator(); $i.hasNext(); ) {
10206 var c = $i.next(); 10241 var c = $i.next();
10207 if ($notnull_bool($ne(c.generator, null) && $ne(c, standardConstructor))) { 10242 if ($notnull_bool($ne(c.generator, null) && $ne(c, standardConstructor))) {
10208 c.generator.writeDefinition(this.writer, null); 10243 c.generator.writeDefinition(this.writer, null);
10209 } 10244 }
10210 } 10245 }
10211 } 10246 }
10212 if ($notnull_bool(!$notnull_bool(type.get$isTop()))) { 10247 if ($notnull_bool(!$notnull_bool(type.get$isTop()))) {
10213 if ($notnull_bool((type instanceof ConcreteType))) { 10248 if ($notnull_bool((type instanceof ConcreteType))) {
10214 this._ensureInheritsHelper(); 10249 this._ensureInheritsHelper();
10215 this.writer.writeln(('\$inherits(' + type.get$jsname() + ', ' + type.get$g enericType().get$jsname() + ');')); 10250 this.writer.writeln(('\$inherits(' + type.get$jsname() + ', ' + type.get$g enericType().get$jsname() + ');'));
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
10249 var $list = interface_.get$interfaces(); 10284 var $list = interface_.get$interfaces();
10250 for (var $i = 0;$i < $list.length; $i++) { 10285 for (var $i = 0;$i < $list.length; $i++) {
10251 var other = $list.$index($i); 10286 var other = $list.$index($i);
10252 if ($notnull_bool(!$notnull_bool(seen.contains(other)))) { 10287 if ($notnull_bool(!$notnull_bool(seen.contains(other)))) {
10253 worklist.addLast(other); 10288 worklist.addLast(other);
10254 seen.add(other); 10289 seen.add(other);
10255 } 10290 }
10256 } 10291 }
10257 } 10292 }
10258 } 10293 }
10259 type.get$factories().forEach(this.get$_writeMethod()); 10294 type.factories.forEach$1(this.get$_writeMethod());
10260 var $list = this._orderValues(type.get$members()); 10295 var $list = this._orderValues((($0 = type.members) && $0.is$Map()));
10261 for (var $i = 0;$i < $list.length; $i++) { 10296 for (var $i = 0;$i < $list.length; $i++) {
10262 var member = $list.$index($i); 10297 var member = $list.$index($i);
10263 if ($notnull_bool((member instanceof FieldMember))) { 10298 if ($notnull_bool((member instanceof FieldMember))) {
10264 this._writeField((member && member.is$FieldMember())); 10299 this._writeField((member && member.is$FieldMember()));
10265 } 10300 }
10266 if ($notnull_bool((member instanceof PropertyMember))) { 10301 if ($notnull_bool((member instanceof PropertyMember))) {
10267 this._writeProperty((member && member.is$PropertyMember())); 10302 this._writeProperty((member && member.is$PropertyMember()));
10268 } 10303 }
10269 if ($notnull_bool(member.get$isMethod())) { 10304 if ($notnull_bool(member.get$isMethod())) {
10270 this._writeMethod((member && member.is$Member())); 10305 this._writeMethod((member && member.is$Member()));
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
10346 var global = $i.next(); 10381 var global = $i.next();
10347 if ($notnull_bool(global.field != null)) { 10382 if ($notnull_bool(global.field != null)) {
10348 this._writeStaticField(global.field); 10383 this._writeStaticField(global.field);
10349 } 10384 }
10350 else { 10385 else {
10351 this.writer.writeln(('var ' + global.get$name() + ' = ' + global.exp.code + ';')); 10386 this.writer.writeln(('var ' + global.get$name() + ' = ' + global.exp.code + ';'));
10352 } 10387 }
10353 } 10388 }
10354 } 10389 }
10355 WorldGenerator.prototype._orderValues = function(map) { 10390 WorldGenerator.prototype._orderValues = function(map) {
10356 var $0; 10391 var values = map.getValues();
10357 var values = (($0 = map.getValues()) && $0.is$List());
10358 values.sort(this.get$_compareMembers()); 10392 values.sort(this.get$_compareMembers());
10359 return values; 10393 return values;
10360 } 10394 }
10361 WorldGenerator.prototype._compareMembers = function(x, y) { 10395 WorldGenerator.prototype._compareMembers = function(x, y) {
10362 if ($notnull_bool(x.get$span() != null && y.get$span() != null)) { 10396 if ($notnull_bool(x.get$span() != null && y.get$span() != null)) {
10363 var spans = x.get$span().compareTo(y.get$span()); 10397 var spans = x.get$span().compareTo(y.get$span());
10364 if ($notnull_bool(spans != 0)) return spans; 10398 if ($notnull_bool(spans != 0)) return spans;
10365 } 10399 }
10366 if ($notnull_bool(x.get$span() == null)) return 1; 10400 if ($notnull_bool(x.get$span() == null)) return 1;
10367 if ($notnull_bool(y.get$span() == null)) return -1; 10401 if ($notnull_bool(y.get$span() == null)) return -1;
10368 return x.get$name().compareTo(y.get$name()); 10402 return x.get$name().compareTo(y.get$name());
10369 } 10403 }
10370 WorldGenerator.prototype.get$_compareMembers = function() { 10404 WorldGenerator.prototype.get$_compareMembers = function() {
10371 return WorldGenerator.prototype._compareMembers.bind(this); 10405 return WorldGenerator.prototype._compareMembers.bind(this);
10372 } 10406 }
10373 WorldGenerator.prototype.useMapFactory = function() { 10407 WorldGenerator.prototype.useMapFactory = function() {
10374 var $0; 10408 var $0;
10375 this.corejs.useMap = true; 10409 this.corejs.useMap = true;
10376 var factType = world.get$coreimpl().types.$index('HashMapImplementation'); 10410 var factType = world.get$coreimpl().types.$index('HashMapImplementation');
10377 var m = factType.resolveMember('\$setindex'); 10411 var m = factType.resolveMember('\$setindex');
10378 this.genMethod((($0 = m.get$members().$index(0)) && $0.is$Member())); 10412 this.genMethod((($0 = m.members.$index(0)) && $0.is$Member()));
10379 var c = factType.getConstructor(''); 10413 var c = factType.getConstructor('');
10380 this.genMethod((c && c.is$Member())); 10414 this.genMethod((c && c.is$Member()));
10381 return factType; 10415 return factType;
10382 } 10416 }
10383 // ********** Code for BlockScope ************** 10417 // ********** Code for BlockScope **************
10384 function BlockScope(enclosingMethod, parent, reentrant) { 10418 function BlockScope(enclosingMethod, parent, reentrant) {
10385 this.enclosingMethod = enclosingMethod; 10419 this.enclosingMethod = enclosingMethod;
10386 this.parent = parent; 10420 this.parent = parent;
10387 this.reentrant = reentrant; 10421 this.reentrant = reentrant;
10388 this._vars = $map([]); 10422 this._vars = $map([]);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
10475 this.needsThis = false; 10509 this.needsThis = false;
10476 // Initializers done 10510 // Initializers done
10477 if ($notnull_bool(this.enclosingMethod != null)) { 10511 if ($notnull_bool(this.enclosingMethod != null)) {
10478 this._scope = new BlockScope(this, this.enclosingMethod._scope, false); 10512 this._scope = new BlockScope(this, this.enclosingMethod._scope, false);
10479 this.captures = new HashSetImplementation(); 10513 this.captures = new HashSetImplementation();
10480 } 10514 }
10481 else { 10515 else {
10482 this._scope = new BlockScope(this, null, false); 10516 this._scope = new BlockScope(this, null, false);
10483 } 10517 }
10484 if ($notnull_bool(this.enclosingMethod != null && this.method.name != '')) { 10518 if ($notnull_bool(this.enclosingMethod != null && this.method.name != '')) {
10485 var m = (($0 = this.method) && $0.is$MethodMember()); 10519 this._scope.create(this.method.name, this.method.get$functionType(), (($0 = this.method.get$definition()) && $0.is$lang_Node()), false);
10486 this._scope.create(m.name, m.get$functionType(), m.definition, false);
10487 } 10520 }
10488 this._usedTemps = new HashSetImplementation(); 10521 this._usedTemps = new HashSetImplementation();
10489 this._freeTemps = []; 10522 this._freeTemps = [];
10490 } 10523 }
10491 MethodGenerator.prototype.is$MethodGenerator = function(){return this;}; 10524 MethodGenerator.prototype.is$MethodGenerator = function(){return this;};
10492 MethodGenerator.prototype.findMembers = function(name) { 10525 MethodGenerator.prototype.findMembers = function(name) {
10493 return this.method.get$library()._findMembers(name); 10526 return this.method.get$library()._findMembers(name);
10494 } 10527 }
10495 MethodGenerator.prototype.get$isClosure = function() { 10528 MethodGenerator.prototype.get$isClosure = function() {
10496 return (this.enclosingMethod != null); 10529 return (this.enclosingMethod != null);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
10542 }) 10575 })
10543 ); 10576 );
10544 this.writer.write($assert_String(this.method.get$definition().body.body)); 10577 this.writer.write($assert_String(this.method.get$definition().body.body));
10545 } 10578 }
10546 } 10579 }
10547 else { 10580 else {
10548 this.writeBody(); 10581 this.writeBody();
10549 } 10582 }
10550 } 10583 }
10551 MethodGenerator.prototype.writeDefinition = function(defWriter, lambda) { 10584 MethodGenerator.prototype.writeDefinition = function(defWriter, lambda) {
10552 var $0;
10553 var paramCode = this._paramCode; 10585 var paramCode = this._paramCode;
10554 var names = null; 10586 var names = null;
10555 if ($notnull_bool(this.captures != null && this.captures.get$length() > 0)) { 10587 if ($notnull_bool(this.captures != null && this.captures.get$length() > 0)) {
10556 names = ListFactory.ListFactory$from$factory(this.captures); 10588 names = ListFactory.ListFactory$from$factory(this.captures);
10557 names.sort((function (x, y) { 10589 names.sort((function (x, y) {
10558 return x.compareTo(y); 10590 return x.compareTo(y);
10559 }) 10591 })
10560 ); 10592 );
10561 paramCode = ListFactory.ListFactory$from$factory((names && names.is$Iterable ())); 10593 paramCode = ListFactory.ListFactory$from$factory((names && names.is$Iterable ()));
10562 paramCode.addAll(this._paramCode); 10594 paramCode.addAll(this._paramCode);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
10596 else if ($notnull_bool(this.method.get$isStatic())) { 10628 else if ($notnull_bool(this.method.get$isStatic())) {
10597 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + th is.method.get$jsname() + ' = function' + _params + ' {')); 10629 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + th is.method.get$jsname() + ' = function' + _params + ' {'));
10598 } 10630 }
10599 else { 10631 else {
10600 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot ype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {')); 10632 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot ype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {'));
10601 } 10633 }
10602 if ($notnull_bool(this.needsThis)) { 10634 if ($notnull_bool(this.needsThis)) {
10603 defWriter.writeln('var \$this = this; // closure support'); 10635 defWriter.writeln('var \$this = this; // closure support');
10604 } 10636 }
10605 if ($notnull_bool(this._usedTemps.get$length() > 0 || this._freeTemps.length > 0)) { 10637 if ($notnull_bool(this._usedTemps.get$length() > 0 || this._freeTemps.length > 0)) {
10606 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da rt", 694, 14); 10638 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da rt", 693, 14);
10607 this._freeTemps.addAll(this._usedTemps); 10639 this._freeTemps.addAll(this._usedTemps);
10608 this._freeTemps.sort((function (x, y) { 10640 this._freeTemps.sort((function (x, y) {
10609 return x.compareTo(y); 10641 return x.compareTo(y);
10610 }) 10642 })
10611 ); 10643 );
10612 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';')); 10644 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';'));
10613 } 10645 }
10614 defWriter.writeln(this.writer.get$text()); 10646 defWriter.writeln(this.writer.get$text());
10615 if ($notnull_bool($ne(names, null))) { 10647 if ($notnull_bool($ne(names, null))) {
10616 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List $String()), ", ") + ')')); 10648 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List $String()), ", ") + ')'));
10617 } 10649 }
10618 else if ($notnull_bool(this.get$isClosure() && this.method.name == '')) { 10650 else if ($notnull_bool(this.get$isClosure() && this.method.name == '')) {
10619 defWriter.exitBlock('})'); 10651 defWriter.exitBlock('})');
10620 } 10652 }
10621 else { 10653 else {
10622 defWriter.exitBlock('}'); 10654 defWriter.exitBlock('}');
10623 } 10655 }
10624 if ($notnull_bool(this.method.get$isConstructor() && this.method.get$construct orName() != '')) { 10656 if ($notnull_bool(this.method.get$isConstructor() && this.method.get$construct orName() != '')) {
10625 defWriter.writeln(('' + this.method.declaringType.get$jsname() + '.' + this. method.get$constructorName() + '\$ctor.prototype = ') + ('' + this.method.declar ingType.get$jsname() + '.prototype;')); 10657 defWriter.writeln(('' + this.method.declaringType.get$jsname() + '.' + this. method.get$constructorName() + '\$ctor.prototype = ') + ('' + this.method.declar ingType.get$jsname() + '.prototype;'));
10626 } 10658 }
10627 this._provideOptionalParamInfo(defWriter); 10659 this._provideOptionalParamInfo(defWriter);
10628 if ($notnull_bool((this.method instanceof MethodMember))) { 10660 if ($notnull_bool((this.method instanceof MethodMember) && this.method._provid ePropertySyntax)) {
10629 var m = (($0 = this.method) && $0.is$MethodMember()); 10661 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot ype.get\$' + this.method.get$jsname() + ' = function() {'));
10630 if ($notnull_bool(m._providePropertySyntax)) { 10662 defWriter.writeln(('return ' + this.method.declaringType.get$jsname() + '.pr ototype.' + this.method.get$jsname() + '.bind(this);'));
10631 defWriter.enterBlock(('' + m.declaringType.get$jsname() + '.prototype') + ('.get\$' + m.get$jsname() + ' = function() {')); 10663 defWriter.exitBlock('}');
10632 defWriter.writeln(('return ' + m.declaringType.get$jsname() + '.prototype. ') + ('' + m.get$jsname() + '.bind(this);')); 10664 if ($notnull_bool(this.method._provideFieldSyntax)) {
10633 defWriter.exitBlock('}'); 10665 world.internalError('bound method accessed with field syntax');
10634 if ($notnull_bool(m._provideFieldSyntax)) {
10635 world.internalError('bound m accessed with field syntax');
10636 }
10637 } 10666 }
10638 } 10667 }
10639 } 10668 }
10640 MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) { 10669 MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) {
10641 var $0; 10670 if ($notnull_bool((this.method instanceof MethodMember) && this.method._provid eOptionalParamInfo)) {
10642 if ($notnull_bool((this.method instanceof MethodMember))) { 10671 var optNames = [];
10643 var meth = (($0 = this.method) && $0.is$MethodMember()); 10672 var optValues = [];
10644 if ($notnull_bool(meth._provideOptionalParamInfo)) { 10673 this.method.genParameterValues();
10645 var optNames = []; 10674 var $list = this.method.get$parameters();
10646 var optValues = []; 10675 for (var $i = 0;$i < $list.length; $i++) {
10647 meth.genParameterValues(); 10676 var param = $list.$index($i);
10648 var $list = meth.parameters; 10677 if ($notnull_bool(param.get$isOptional())) {
10649 for (var $i = 0;$i < $list.length; $i++) { 10678 optNames.add(param.get$name());
10650 var param = $list.$index($i); 10679 optValues.add(MethodGenerator._escapeString(param.get$value().code));
10651 if ($notnull_bool(param.get$isOptional())) { 10680 }
10652 optNames.add(param.get$name()); 10681 }
10653 optValues.add(MethodGenerator._escapeString(param.get$value().code)); 10682 if ($notnull_bool(optNames.length > 0)) {
10683 var start = '';
10684 if ($notnull_bool(this.method.get$isStatic())) {
10685 if ($notnull_bool(!$notnull_bool(this.method.declaringType.get$isTop())) ) {
10686 start = this.method.declaringType.get$jsname() + '.';
10654 } 10687 }
10655 } 10688 }
10656 if ($notnull_bool(optNames.length > 0)) { 10689 else {
10657 var start = ''; 10690 start = this.method.declaringType.get$jsname() + '.prototype.';
10658 if ($notnull_bool(meth.isStatic)) {
10659 if ($notnull_bool(!$notnull_bool(meth.declaringType.get$isTop()))) {
10660 start = meth.declaringType.get$jsname() + '.';
10661 }
10662 }
10663 else {
10664 start = meth.declaringType.get$jsname() + '.prototype.';
10665 }
10666 optNames.addAll(optValues);
10667 var optional = "['" + Strings.join((optNames && optNames.is$List$String( )), "', '") + "']";
10668 defWriter.writeln(('' + start + '' + meth.get$jsname() + '.\$optional = ' + optional + ''));
10669 } 10691 }
10692 optNames.addAll(optValues);
10693 var optional = "['" + Strings.join((optNames && optNames.is$List$String()) , "', '") + "']";
10694 defWriter.writeln(('' + start + '' + this.method.get$jsname() + '.\$option al = ' + optional + ''));
10670 } 10695 }
10671 } 10696 }
10672 } 10697 }
10673 MethodGenerator.prototype.writeBody = function() { 10698 MethodGenerator.prototype.writeBody = function() {
10674 var $0; 10699 var $0;
10675 var initializers = null; 10700 var initializers = null;
10676 var initializedFields = null; 10701 var initializedFields = null;
10677 if ($notnull_bool(this.method.get$isConstructor())) { 10702 if ($notnull_bool(this.method.get$isConstructor())) {
10678 initializers = []; 10703 initializers = [];
10679 initializedFields = new HashSetImplementation(); 10704 initializedFields = new HashSetImplementation();
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
10764 } 10789 }
10765 initializedFields = null; 10790 initializedFields = null;
10766 } 10791 }
10767 } 10792 }
10768 else { 10793 else {
10769 } 10794 }
10770 } 10795 }
10771 this.writer.comment('// Initializers done'); 10796 this.writer.comment('// Initializers done');
10772 } 10797 }
10773 if ($notnull_bool($ne(initializedFields, null))) { 10798 if ($notnull_bool($ne(initializedFields, null))) {
10774 var $list = this.method.declaringType.get$members().getKeys(); 10799 var $list = this.method.declaringType.members.getKeys();
10775 for (var $i = this.method.declaringType.get$members().getKeys().iterator(); $i.hasNext(); ) { 10800 for (var $i = this.method.declaringType.members.getKeys().iterator(); $i.has Next(); ) {
10776 var name = $i.next(); 10801 var name = $i.next();
10777 var member = this.method.declaringType.get$members().$index(name); 10802 var member = this.method.declaringType.members.$index(name);
10778 if ($notnull_bool((member instanceof FieldMember) && member.isFinal && !$n otnull_bool(member.get$isStatic()) && !$notnull_bool(initializedFields.contains( name)))) { 10803 if ($notnull_bool((member instanceof FieldMember) && member.isFinal && !$n otnull_bool(member.get$isStatic()) && !$notnull_bool(initializedFields.contains( name)))) {
10779 world.error(('Field "' + name + '" is final and was not initialized'), t his.method.get$definition().get$span()); 10804 world.error(('Field "' + name + '" is final and was not initialized'), t his.method.get$definition().get$span());
10780 } 10805 }
10781 } 10806 }
10782 } 10807 }
10783 this.visitStatementsInBlock((body && body.is$lang_Statement())); 10808 this.visitStatementsInBlock((body && body.is$lang_Statement()));
10784 } 10809 }
10785 MethodGenerator.prototype._writeInitializerCall = function(node) { 10810 MethodGenerator.prototype._writeInitializerCall = function(node) {
10786 var contructorName = ''; 10811 var contructorName = '';
10787 var targetExp = node.target; 10812 var targetExp = node.target;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
10830 world.error('bare argument can not follow named arguments', arg.get$span() ); 10855 world.error('bare argument can not follow named arguments', arg.get$span() );
10831 } 10856 }
10832 args.add(this.visitValue((($0 = arg.get$value()) && $0.is$lang_Expression()) )); 10857 args.add(this.visitValue((($0 = arg.get$value()) && $0.is$lang_Expression()) ));
10833 } 10858 }
10834 return new Arguments(arguments, args); 10859 return new Arguments(arguments, args);
10835 } 10860 }
10836 MethodGenerator._escapeString = function(text) { 10861 MethodGenerator._escapeString = function(text) {
10837 return text.replaceAll('\\', '\\\\').replaceAll('"', '\\"').replaceAll('\n', ' \\n').replaceAll('\r', '\\r'); 10862 return text.replaceAll('\\', '\\\\').replaceAll('"', '\\"').replaceAll('\n', ' \\n').replaceAll('\r', '\\r');
10838 } 10863 }
10839 MethodGenerator.prototype.visitStatementsInBlock = function(body) { 10864 MethodGenerator.prototype.visitStatementsInBlock = function(body) {
10865 var $0;
10840 if ($notnull_bool((body instanceof BlockStatement))) { 10866 if ($notnull_bool((body instanceof BlockStatement))) {
10841 var block = (body && body.is$BlockStatement()); 10867 var $list = body.body;
10842 var $list = block.body; 10868 for (var $i = body.body.iterator(); $i.hasNext(); ) {
10843 for (var $i = 0;$i < $list.length; $i++) { 10869 var stmt = $i.next();
10844 var stmt = $list.$index($i);
10845 stmt.visit(this); 10870 stmt.visit(this);
10846 } 10871 }
10847 } 10872 }
10848 else { 10873 else {
10849 if ($notnull_bool(body != null)) body.visit(this); 10874 if ($notnull_bool(body != null)) body.visit(this);
10850 } 10875 }
10851 return false; 10876 return false;
10852 } 10877 }
10853 MethodGenerator.prototype._pushBlock = function(reentrant) { 10878 MethodGenerator.prototype._pushBlock = function(reentrant) {
10854 this._scope = new BlockScope(this, this._scope, reentrant); 10879 this._scope = new BlockScope(this, this._scope, reentrant);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
10922 this.writer.write(('' + val.code + ' = ' + value.code + '')); 10947 this.writer.write(('' + val.code + ' = ' + value.code + ''));
10923 } 10948 }
10924 } 10949 }
10925 this.writer.writeln(';'); 10950 this.writer.writeln(';');
10926 return false; 10951 return false;
10927 } 10952 }
10928 MethodGenerator.prototype.visitFunctionDefinition = function(node) { 10953 MethodGenerator.prototype.visitFunctionDefinition = function(node) {
10929 var $0; 10954 var $0;
10930 var name = world.toJsIdentifier(node.name.name); 10955 var name = world.toJsIdentifier(node.name.name);
10931 var meth = this._makeLambdaMethod($assert_String(name), node); 10956 var meth = this._makeLambdaMethod($assert_String(name), node);
10932 var funcValue = this._scope.create($assert_String(name), (($0 = meth.get$funct ionType()) && $0.is$lang_Type()), (($0 = this.method.get$definition()) && $0.is$ lang_Node()), false); 10957 var funcValue = this._scope.create($assert_String(name), meth.get$functionType (), (($0 = this.method.get$definition()) && $0.is$lang_Node()), false);
10933 meth.generator.writeDefinition(this.writer, null); 10958 meth.generator.writeDefinition(this.writer, null);
10934 return false; 10959 return false;
10935 } 10960 }
10936 MethodGenerator.prototype.visitReturnStatement = function(node) { 10961 MethodGenerator.prototype.visitReturnStatement = function(node) {
10937 if ($notnull_bool(node.value == null)) { 10962 if ($notnull_bool(node.value == null)) {
10938 this.writer.writeln('return;'); 10963 this.writer.writeln('return;');
10939 } 10964 }
10940 else { 10965 else {
10941 if ($notnull_bool(this.method.get$isConstructor())) { 10966 if ($notnull_bool(this.method.get$isConstructor())) {
10942 world.error('return of value not allowed from constructor', node.span); 10967 world.error('return of value not allowed from constructor', node.span);
(...skipping 19 matching lines...) Expand all
10962 } 10987 }
10963 } 10988 }
10964 return true; 10989 return true;
10965 } 10990 }
10966 MethodGenerator.prototype.visitAssertStatement = function(node) { 10991 MethodGenerator.prototype.visitAssertStatement = function(node) {
10967 var $0; 10992 var $0;
10968 var test = this.visitValue(node.test); 10993 var test = this.visitValue(node.test);
10969 if ($notnull_bool(options.enableAsserts)) { 10994 if ($notnull_bool(options.enableAsserts)) {
10970 var err = world.corelib.types.$index('AssertError'); 10995 var err = world.corelib.types.$index('AssertError');
10971 world.gen.genMethod((($0 = err.getConstructor('')) && $0.is$Member())); 10996 world.gen.genMethod((($0 = err.getConstructor('')) && $0.is$Member()));
10972 world.gen.genMethod((($0 = err.get$members().$index('toString')) && $0.is$Me mber())); 10997 world.gen.genMethod((($0 = err.members.$index('toString')) && $0.is$Member() ));
10973 var span = node.test.span; 10998 var span = node.test.span;
10974 var line = span.file.getLine(span.start); 10999 var line = span.file.getLine(span.start);
10975 var column = span.file.getColumn($assert_num(line), span.start); 11000 var column = span.file.getColumn($assert_num(line), span.start);
10976 this.writer.writeln(('\$assert(' + test.code + ', "' + MethodGenerator._esca peString(span.get$text()) + '",') + (' "' + basename(span.file.filename) + '", ' + (line + 1) + ', ' + (column + 1) + ');')); 11001 this.writer.writeln(('\$assert(' + test.code + ', "' + MethodGenerator._esca peString(span.get$text()) + '",') + (' "' + basename(span.file.filename) + '", ' + (line + 1) + ', ' + (column + 1) + ');'));
10977 world.gen.corejs.useAssert = true; 11002 world.gen.corejs.useAssert = true;
10978 } 11003 }
10979 return false; 11004 return false;
10980 } 11005 }
10981 MethodGenerator.prototype.visitBreakStatement = function(node) { 11006 MethodGenerator.prototype.visitBreakStatement = function(node) {
10982 if ($notnull_bool(node.label == null)) { 11007 if ($notnull_bool(node.label == null)) {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
11089 } 11114 }
11090 MethodGenerator.prototype._genToDartException = function(ex, node) { 11115 MethodGenerator.prototype._genToDartException = function(ex, node) {
11091 var $0; 11116 var $0;
11092 var types = const$390/*const [ 11117 var types = const$390/*const [
11093 'NullPointerException', 'ObjectNotClosureException', 11118 'NullPointerException', 'ObjectNotClosureException',
11094 'NoSuchMethodException', 'StackOverflowException']*/; 11119 'NoSuchMethodException', 'StackOverflowException']*/;
11095 var target = new Value(null, 'this', false, true, false); 11120 var target = new Value(null, 'this', false, true, false);
11096 for (var $i = types.iterator(); $i.hasNext(); ) { 11121 for (var $i = types.iterator(); $i.hasNext(); ) {
11097 var name = $i.next(); 11122 var name = $i.next();
11098 world.corelib.types.$index(name).markUsed(); 11123 world.corelib.types.$index(name).markUsed();
11099 world.corelib.types.$index(name).get$members().$index('toString').invoke$4(t his, node, target, Arguments.get$EMPTY()); 11124 world.corelib.types.$index(name).members.$index('toString').invoke$4(this, n ode, target, Arguments.get$EMPTY());
11100 } 11125 }
11101 this.writer.writeln(('' + ex + ' = \$toDartException(' + ex + ');')); 11126 this.writer.writeln(('' + ex + ' = \$toDartException(' + ex + ');'));
11102 world.gen.corejs.useToDartException = true; 11127 world.gen.corejs.useToDartException = true;
11103 } 11128 }
11104 MethodGenerator.prototype.visitTryStatement = function(node) { 11129 MethodGenerator.prototype.visitTryStatement = function(node) {
11105 var $0; 11130 var $0;
11106 this.writer.enterBlock('try {'); 11131 this.writer.enterBlock('try {');
11107 this._pushBlock(false); 11132 this._pushBlock(false);
11108 this.visitStatementsInBlock(node.body); 11133 this.visitStatementsInBlock(node.body);
11109 this._popBlock(); 11134 this._popBlock();
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
11302 var name = ''; 11327 var name = '';
11303 if ($notnull_bool(node.func.name != null)) { 11328 if ($notnull_bool(node.func.name != null)) {
11304 name = world.toJsIdentifier(node.func.name.name); 11329 name = world.toJsIdentifier(node.func.name.name);
11305 } 11330 }
11306 var meth = this._makeLambdaMethod($assert_String(name), node.func); 11331 var meth = this._makeLambdaMethod($assert_String(name), node.func);
11307 var w = new CodeWriter(); 11332 var w = new CodeWriter();
11308 meth.generator.writeDefinition((w && w.is$CodeWriter()), node); 11333 meth.generator.writeDefinition((w && w.is$CodeWriter()), node);
11309 return new Value(meth.get$functionType(), w.get$text(), false, true, false); 11334 return new Value(meth.get$functionType(), w.get$text(), false, true, false);
11310 } 11335 }
11311 MethodGenerator.prototype.visitCallExpression = function(node) { 11336 MethodGenerator.prototype.visitCallExpression = function(node) {
11312 var $0;
11313 var target; 11337 var target;
11314 var position = node.target; 11338 var position = node.target;
11315 var name = '\$call'; 11339 var name = '\$call';
11316 if ($notnull_bool((node.target instanceof DotExpression))) { 11340 if ($notnull_bool((node.target instanceof DotExpression))) {
11317 var dot = (($0 = node.target) && $0.is$DotExpression()); 11341 target = node.target.self.visit(this);
11318 target = dot.self.visit(this); 11342 name = node.target.get$name().get$name();
11319 name = dot.name.name; 11343 position = node.target.get$name();
11320 position = dot.name;
11321 } 11344 }
11322 else if ($notnull_bool((node.target instanceof VarExpression))) { 11345 else if ($notnull_bool((node.target instanceof VarExpression))) {
11323 var varExpr = (($0 = node.target) && $0.is$VarExpression()); 11346 name = node.target.get$name().get$name();
11324 name = varExpr.name.name;
11325 var meth = this.method.declaringType.resolveMember(name); 11347 var meth = this.method.declaringType.resolveMember(name);
11326 if ($notnull_bool($ne(meth, null))) { 11348 if ($notnull_bool($ne(meth, null))) {
11327 target = this._makeThisOrType(); 11349 target = this._makeThisOrType();
11328 return meth.invoke$4(this, varExpr, target, this._makeArgs(node.arguments) ); 11350 return meth.invoke$4(this, node.target, target, this._makeArgs(node.argume nts));
11329 } 11351 }
11330 meth = this.method.declaringType.get$library().lookup($assert_String(name), varExpr.span); 11352 meth = this.method.declaringType.get$library().lookup($assert_String(name), node.target.span);
11331 if ($notnull_bool($ne(meth, null))) { 11353 if ($notnull_bool($ne(meth, null))) {
11332 return meth.invoke$4(this, varExpr, null, this._makeArgs(node.arguments)); 11354 return meth.invoke$4(this, node.target, null, this._makeArgs(node.argument s));
11333 } 11355 }
11334 name = '\$call'; 11356 name = '\$call';
11335 target = varExpr.visit(this); 11357 target = node.target.visit(this);
11336 } 11358 }
11337 else { 11359 else {
11338 target = node.target.visit(this); 11360 target = node.target.visit(this);
11339 } 11361 }
11340 return target.invoke$4(this, name, position, this._makeArgs(node.arguments)); 11362 return target.invoke$4(this, name, position, this._makeArgs(node.arguments));
11341 } 11363 }
11342 MethodGenerator.prototype.visitIndexExpression = function(node) { 11364 MethodGenerator.prototype.visitIndexExpression = function(node) {
11343 var target = this.visitValue(node.target); 11365 var target = this.visitValue(node.target);
11344 var index = this.visitValue(node.index); 11366 var index = this.visitValue(node.index);
11345 return target.invoke$4(this, '\$index', node, new Arguments(null, [index])); 11367 return target.invoke$4(this, '\$index', node, new Arguments(null, [index]));
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
11735 } 11757 }
11736 MethodGenerator.prototype.visitSuperExpression = function(node) { 11758 MethodGenerator.prototype.visitSuperExpression = function(node) {
11737 return this._makeSuperValue(node); 11759 return this._makeSuperValue(node);
11738 } 11760 }
11739 MethodGenerator.prototype.visitNullExpression = function(node) { 11761 MethodGenerator.prototype.visitNullExpression = function(node) {
11740 return EvaluatedValue.EvaluatedValue$factory(null, null, 'null', null); 11762 return EvaluatedValue.EvaluatedValue$factory(null, null, 'null', null);
11741 } 11763 }
11742 MethodGenerator.prototype.visitLiteralExpression = function(node) { 11764 MethodGenerator.prototype.visitLiteralExpression = function(node) {
11743 var $0; 11765 var $0;
11744 var type = node.type.type; 11766 var type = node.type.type;
11745 $assert($ne(type, null), "type != null", "gen.dart", 2072, 12); 11767 $assert($ne(type, null), "type != null", "gen.dart", 2063, 12);
11746 if ($notnull_bool(!!(($0 = node.value) && $0.is$List))) { 11768 if ($notnull_bool(!!(($0 = node.value) && $0.is$List))) {
11747 var items = []; 11769 var items = [];
11748 var $list = node.value; 11770 var $list = node.value;
11749 for (var $i = node.value.iterator(); $i.hasNext(); ) { 11771 for (var $i = node.value.iterator(); $i.hasNext(); ) {
11750 var item = $i.next(); 11772 var item = $i.next();
11751 var val = this.visitValue((item && item.is$lang_Expression())); 11773 var val = this.visitValue((item && item.is$lang_Expression()));
11752 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY()); 11774 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY());
11753 var code = val.code; 11775 var code = val.code;
11754 if ($notnull_bool((item instanceof BinaryExpression) || (item instanceof C onditionalExpression))) { 11776 if ($notnull_bool((item instanceof BinaryExpression) || (item instanceof C onditionalExpression))) {
11755 code = ('(' + code + ')'); 11777 code = ('(' + code + ')');
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
11959 var lib = $i.next(); 11981 var lib = $i.next();
11960 if ($notnull_bool(lib._privateMembers.containsKey(member.name))) { 11982 if ($notnull_bool(lib._privateMembers.containsKey(member.name))) {
11961 member.set$jsname(('_' + this.get$jsname() + '' + member.name + '')); 11983 member.set$jsname(('_' + this.get$jsname() + '' + member.name + ''));
11962 break; 11984 break;
11963 } 11985 }
11964 } 11986 }
11965 mset = new MemberSet(member); 11987 mset = new MemberSet(member);
11966 this._privateMembers.$setindex(member.name, mset); 11988 this._privateMembers.$setindex(member.name, mset);
11967 } 11989 }
11968 else { 11990 else {
11969 mset.get$members().add(member); 11991 mset.members.add(member);
11970 } 11992 }
11971 } 11993 }
11972 else { 11994 else {
11973 world._addMember(member); 11995 world._addMember(member);
11974 } 11996 }
11975 } 11997 }
11976 Library.prototype.getOrAddFunctionType = function(name, func, inType) { 11998 Library.prototype.getOrAddFunctionType = function(name, func, inType) {
11977 var def = new FunctionTypeDefinition(func, null, func.span); 11999 var def = new FunctionTypeDefinition(func, null, func.span);
11978 var type = new DefinedType(name, this, def, false); 12000 var type = new DefinedType(name, this, def, false);
11979 type.addMethod('\$call', func); 12001 type.addMethod('\$call', func);
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
12266 return parseStringLiteral($assert_String(expr.get$value())); 12288 return parseStringLiteral($assert_String(expr.get$value()));
12267 } 12289 }
12268 _LibraryVisitor.prototype.visitTypeDefinition = function(node) { 12290 _LibraryVisitor.prototype.visitTypeDefinition = function(node) {
12269 var oldType = this.currentType; 12291 var oldType = this.currentType;
12270 this.currentType = this.library.addType(node.name.name, node, node.isClass); 12292 this.currentType = this.library.addType(node.name.name, node, node.isClass);
12271 var $list = node.body; 12293 var $list = node.body;
12272 for (var $i = 0;$i < $list.length; $i++) { 12294 for (var $i = 0;$i < $list.length; $i++) {
12273 var member = $list.$index($i); 12295 var member = $list.$index($i);
12274 member.visit(this); 12296 member.visit(this);
12275 } 12297 }
12276 this.currentType = (oldType && oldType.is$DefinedType()); 12298 this.currentType = (oldType && oldType.is$lang_Type());
12277 } 12299 }
12278 _LibraryVisitor.prototype.visitVariableDefinition = function(node) { 12300 _LibraryVisitor.prototype.visitVariableDefinition = function(node) {
12279 this.currentType.addField(node); 12301 this.currentType.addField(node);
12280 } 12302 }
12281 _LibraryVisitor.prototype.visitFunctionDefinition = function(node) { 12303 _LibraryVisitor.prototype.visitFunctionDefinition = function(node) {
12282 this.currentType.addMethod(node.name.name, node); 12304 this.currentType.addMethod(node.name.name, node);
12283 } 12305 }
12284 _LibraryVisitor.prototype.visitFunctionTypeDefinition = function(node) { 12306 _LibraryVisitor.prototype.visitFunctionTypeDefinition = function(node) {
12285 var type = this.library.addType(node.func.name.name, node, false); 12307 var type = this.library.addType(node.func.name.name, node, false);
12286 type.addMethod('\$call', node.func); 12308 type.addMethod('\$call', node.func);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
12372 } 12394 }
12373 Member.prototype.get$isMethod = function() { 12395 Member.prototype.get$isMethod = function() {
12374 return false; 12396 return false;
12375 } 12397 }
12376 Member.prototype.get$isProperty = function() { 12398 Member.prototype.get$isProperty = function() {
12377 return false; 12399 return false;
12378 } 12400 }
12379 Member.prototype.get$isAbstract = function() { 12401 Member.prototype.get$isAbstract = function() {
12380 return false; 12402 return false;
12381 } 12403 }
12382 Member.prototype.get$isConst = function() {
12383 return false;
12384 }
12385 Member.prototype.get$isFactory = function() {
12386 return false;
12387 }
12388 Member.prototype.get$prefersPropertySyntax = function() { 12404 Member.prototype.get$prefersPropertySyntax = function() {
12389 return true; 12405 return true;
12390 } 12406 }
12391 Member.prototype.get$requiresFieldSyntax = function() { 12407 Member.prototype.get$requiresFieldSyntax = function() {
12392 return false; 12408 return false;
12393 } 12409 }
12394 Member.prototype.get$isNative = function() { 12410 Member.prototype.get$isNative = function() {
12395 return false; 12411 return false;
12396 } 12412 }
12397 Member.prototype.get$constructorName = function() { 12413 Member.prototype.get$constructorName = function() {
12398 return world.internalError('can not be a constructor', this.get$span()); 12414 return world.internalError('can not be a constructor', this.get$span());
12399 } 12415 }
12400 Member.prototype.provideFieldSyntax = function() { 12416 Member.prototype.provideFieldSyntax = function() {
12401 return world.internalError('can not be field', this.get$span()); 12417 return world.internalError('can not be field', this.get$span());
12402 } 12418 }
12403 Member.prototype.providePropertySyntax = function() { 12419 Member.prototype.providePropertySyntax = function() {
12404 return world.internalError('can not be property', this.get$span()); 12420 return world.internalError('can not be property', this.get$span());
12405 } 12421 }
12406 Member.prototype.get$initDelegate = function() {
12407 return world.internalError('cannot have initializers', this.get$span());
12408 }
12409 Member.prototype.set$initDelegate = function(ctor) {
12410 return world.internalError('cannot have initializers', this.get$span());
12411 }
12412 Member.prototype.get$definition = function() { 12422 Member.prototype.get$definition = function() {
12413 return null; 12423 return null;
12414 } 12424 }
12415 Member.prototype.get$parameters = function() { 12425 Member.prototype.get$parameters = function() {
12416 return []; 12426 return [];
12417 } 12427 }
12418 Member.prototype.canInvoke = function(context, args) { 12428 Member.prototype.canInvoke = function(context, args) {
12419 return this.get$canGet() && new Value(this.get$returnType(), null, false, true , false).canInvoke(context, '\$call', args); 12429 return this.get$canGet() && new Value(this.get$returnType(), null, false, true , false).canInvoke(context, '\$call', args);
12420 } 12430 }
12421 Member.prototype.invoke = function(context, node, target, args, isDynamic) { 12431 Member.prototype.invoke = function(context, node, target, args, isDynamic) {
12422 var newTarget = this.get_(context, node, target, isDynamic); 12432 var newTarget = this.get_(context, node, target, isDynamic);
12423 return newTarget.invoke(context, '\$call', node, args, isDynamic); 12433 return newTarget.invoke(context, '\$call', node, args, isDynamic);
12424 } 12434 }
12425 Member.prototype.override = function(other) { 12435 Member.prototype.override = function(other) {
12426 if ($notnull_bool(this.get$isStatic())) { 12436 if ($notnull_bool(this.get$isStatic())) {
12427 world.error('static members can not hide parent members', this.get$span(), o ther.get$span()); 12437 world.error('static members can not hide parent members', this.get$span(), o ther.get$span());
12428 return false; 12438 return false;
12429 } 12439 }
12430 else if ($notnull_bool(other.get$isStatic())) { 12440 else if ($notnull_bool(other.get$isStatic())) {
12431 world.error('can not override static member', this.get$span(), other.get$spa n()); 12441 world.error('can not override static member', this.get$span(), other.get$spa n());
12432 return false; 12442 return false;
12433 } 12443 }
12434 return true; 12444 return true;
12435 } 12445 }
12436 Member.prototype.get$generatedFactoryName = function() { 12446 Member.prototype.get$generatedFactoryName = function() {
12437 $assert(this.get$isFactory(), "this.isFactory", "member.dart", 174, 12); 12447 $assert(this.get$isFactory(), "this.isFactory", "member.dart", 164, 12);
12438 var prefix = ('' + this.declaringType.get$jsname() + '.' + this.get$constructo rName() + '\$'); 12448 var prefix = ('' + this.declaringType.get$jsname() + '.' + this.get$constructo rName() + '\$');
12439 if ($notnull_bool(this.name == '')) { 12449 if ($notnull_bool(this.name == '')) {
12440 return ('' + prefix + 'factory'); 12450 return ('' + prefix + 'factory');
12441 } 12451 }
12442 else { 12452 else {
12443 return ('' + prefix + '' + this.name + '\$factory'); 12453 return ('' + prefix + '' + this.name + '\$factory');
12444 } 12454 }
12445 } 12455 }
12446 Member.prototype.resolveType = function(node, isRequired) {
12447 var type = this.declaringType.resolveType(node, isRequired);
12448 if ($notnull_bool(this.get$isStatic() && type.get$hasTypeParams())) {
12449 world.error('using type parameter in static context', node.span);
12450 }
12451 return type;
12452 }
12453 Member.prototype.get_$3 = function($0, $1, $2) { 12456 Member.prototype.get_$3 = function($0, $1, $2) {
12454 return this.get_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value())); 12457 return this.get_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()));
12455 } 12458 }
12456 ; 12459 ;
12457 Member.prototype.invoke$4 = function($0, $1, $2, $3) { 12460 Member.prototype.invoke$4 = function($0, $1, $2, $3) {
12458 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); 12461 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
12459 } 12462 }
12460 ; 12463 ;
12461 Member.prototype.set_$4 = function($0, $1, $2, $3) { 12464 Member.prototype.set_$4 = function($0, $1, $2, $3) {
12462 return this.set_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value())); 12465 return this.set_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()));
12463 } 12466 }
12464 ; 12467 ;
12465 // ********** Code for TypeMember ************** 12468 // ********** Code for TypeMember **************
12466 function TypeMember(type) { 12469 function TypeMember(type) {
12467 this.type = type; 12470 this.type = type;
12468 Member.call(this, type.name, type.library.topType); 12471 Member.call(this, type.name, type.library.topType);
12469 // Initializers done 12472 // Initializers done
12470 } 12473 }
12471 $inherits(TypeMember, Member); 12474 $inherits(TypeMember, Member);
12472 TypeMember.prototype.get$span = function() { 12475 TypeMember.prototype.get$span = function() {
12473 return this.type.definition.span; 12476 return this.type.definition.span;
12474 } 12477 }
12475 TypeMember.prototype.get$isStatic = function() { 12478 TypeMember.prototype.get$isStatic = function() {
12476 return true; 12479 return true;
12477 } 12480 }
12478 TypeMember.prototype.get$returnType = function() { 12481 TypeMember.prototype.get$returnType = function() {
12479 return world.varType; 12482 return world.get$isVar();
12480 } 12483 }
12481 TypeMember.prototype.canInvoke = function(context, args) { 12484 TypeMember.prototype.canInvoke = function(context, args) {
12482 return false; 12485 return false;
12483 } 12486 }
12484 TypeMember.prototype.get$canGet = function() { 12487 TypeMember.prototype.get$canGet = function() {
12485 return true; 12488 return true;
12486 } 12489 }
12487 TypeMember.prototype.get$canSet = function() { 12490 TypeMember.prototype.get$canSet = function() {
12488 return false; 12491 return false;
12489 } 12492 }
12490 TypeMember.prototype.resolve = function(inType) { 12493 TypeMember.prototype.resolve = function(inType) {
12491 12494
12492 } 12495 }
12493 TypeMember.prototype.get_ = function(context, node, target, isDynamic) { 12496 TypeMember.prototype.get_ = function(context, node, target, isDynamic) {
12494 $assert(target == null || target.type.get$isTop(), "target == null || target.t ype.isTop", "member.dart", 222, 12); 12497 $assert(target == null || target.type.get$isTop(), "target == null || target.t ype.isTop", "member.dart", 202, 12);
12495 return new Value(this.type, this.type.get$jsname(), false, false, true); 12498 return new Value(this.type, this.type.get$jsname(), false, false, true);
12496 } 12499 }
12497 TypeMember.prototype.set_ = function(context, node, target, value, isDynamic) { 12500 TypeMember.prototype.set_ = function(context, node, target, value, isDynamic) {
12498 world.error('can not set type', this.type.definition.span); 12501 world.error('can not set type', this.type.definition.span);
12499 } 12502 }
12500 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) { 12503 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) {
12501 world.error('can not invoke type', this.type.definition.span); 12504 world.error('can not invoke type', this.type.definition.span);
12502 } 12505 }
12503 TypeMember.prototype.get_$3 = function($0, $1, $2) { 12506 TypeMember.prototype.get_$3 = function($0, $1, $2) {
12504 return this.get_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false); 12507 return this.get_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
12638 return cv; 12641 return cv;
12639 } 12642 }
12640 if ($notnull_bool(this.declaringType.get$isTop())) { 12643 if ($notnull_bool(this.declaringType.get$isTop())) {
12641 return new Value(this.type, ('' + this.get$jsname() + ''), false, true, fa lse); 12644 return new Value(this.type, ('' + this.get$jsname() + ''), false, true, fa lse);
12642 } 12645 }
12643 else { 12646 else {
12644 return new Value(this.type, ('' + this.declaringType.get$jsname() + '.' + this.get$jsname() + ''), false, true, false); 12647 return new Value(this.type, ('' + this.declaringType.get$jsname() + '.' + this.get$jsname() + ''), false, true, false);
12645 } 12648 }
12646 } 12649 }
12647 else if ($notnull_bool(target.get$isConst() && this.isFinal)) { 12650 else if ($notnull_bool(target.get$isConst() && this.isFinal)) {
12648 var constTarget = $notnull_bool((target instanceof GlobalValue)) ? target.ge t$dynamic().exp : target; 12651 var constTarget = $notnull_bool((target instanceof GlobalValue)) ? target.ex p : target;
12649 if ($notnull_bool((constTarget instanceof ConstObjectValue))) { 12652 if ($notnull_bool((constTarget instanceof ConstObjectValue))) {
12650 return constTarget.fields.$index(this.name); 12653 return constTarget.fields.$index(this.name);
12651 } 12654 }
12652 else if ($notnull_bool($eq(constTarget.type, world.stringType) && this.name == 'length')) { 12655 else if ($notnull_bool($eq(constTarget.type, world.stringType) && this.name == 'length')) {
12653 return new Value(this.type, ('' + constTarget.get$actualValue().length + ' '), false, true, false); 12656 return new Value(this.type, ('' + constTarget.get$actualValue().length + ' '), false, true, false);
12654 } 12657 }
12655 } 12658 }
12656 return new Value(this.type, ('' + target.code + '.' + this.get$jsname() + ''), false, true, false); 12659 return new Value(this.type, ('' + target.code + '.' + this.get$jsname() + ''), false, true, false);
12657 } 12660 }
12658 FieldMember.prototype.set_ = function(context, node, target, value, isDynamic) { 12661 FieldMember.prototype.set_ = function(context, node, target, value, isDynamic) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
12730 PropertyMember.prototype.set_ = function(context, node, target, value, isDynamic ) { 12733 PropertyMember.prototype.set_ = function(context, node, target, value, isDynamic ) {
12731 if ($notnull_bool(this.setter == null)) { 12734 if ($notnull_bool(this.setter == null)) {
12732 if ($notnull_bool(this._overriddenField != null)) { 12735 if ($notnull_bool(this._overriddenField != null)) {
12733 return this._overriddenField.set_(context, node, target, value, isDynamic) ; 12736 return this._overriddenField.set_(context, node, target, value, isDynamic) ;
12734 } 12737 }
12735 return target.invokeNoSuchMethod(context, ('set:' + this.name + ''), node, n ew Arguments(null, [value])); 12738 return target.invokeNoSuchMethod(context, ('set:' + this.name + ''), node, n ew Arguments(null, [value]));
12736 } 12739 }
12737 return this.setter.invoke(context, node, target, new Arguments(null, [value]), isDynamic); 12740 return this.setter.invoke(context, node, target, new Arguments(null, [value]), isDynamic);
12738 } 12741 }
12739 PropertyMember.prototype.addFromParent = function(parentMember) { 12742 PropertyMember.prototype.addFromParent = function(parentMember) {
12740 var $0;
12741 var parent;
12742 if ($notnull_bool((parentMember instanceof ConcreteMember))) { 12743 if ($notnull_bool((parentMember instanceof ConcreteMember))) {
12743 var c = (parentMember && parentMember.is$ConcreteMember()); 12744 parentMember = parentMember.baseMember;
12744 parent = (($0 = c.baseMember) && $0.is$PropertyMember());
12745 } 12745 }
12746 else { 12746 if ($notnull_bool(this.getter == null)) this.getter = parentMember.getter;
12747 parent = (parentMember && parentMember.is$PropertyMember()); 12747 if ($notnull_bool(this.setter == null)) this.setter = parentMember.setter;
12748 }
12749 if ($notnull_bool(this.getter == null)) this.getter = parent.getter;
12750 if ($notnull_bool(this.setter == null)) this.setter = parent.setter;
12751 } 12748 }
12752 PropertyMember.prototype.resolve = function(inType) { 12749 PropertyMember.prototype.resolve = function(inType) {
12753 if ($notnull_bool(this.getter != null)) this.getter.resolve(inType); 12750 if ($notnull_bool(this.getter != null)) this.getter.resolve(inType);
12754 if ($notnull_bool(this.setter != null)) this.setter.resolve(inType); 12751 if ($notnull_bool(this.setter != null)) this.setter.resolve(inType);
12755 this.get$library()._addMember(this); 12752 this.get$library()._addMember(this);
12756 } 12753 }
12757 PropertyMember.prototype.get_$3 = function($0, $1, $2) { 12754 PropertyMember.prototype.get_$3 = function($0, $1, $2) {
12758 return this.get_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false); 12755 return this.get_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
12759 } 12756 }
12760 ; 12757 ;
(...skipping 14 matching lines...) Expand all
12775 var newType = p.type.resolveTypeParams(declaringType); 12772 var newType = p.type.resolveTypeParams(declaringType);
12776 if ($notnull_bool($ne(newType, p.type))) { 12773 if ($notnull_bool($ne(newType, p.type))) {
12777 this.parameters.add(p.copyWithNewType((newType && newType.is$lang_Type())) ); 12774 this.parameters.add(p.copyWithNewType((newType && newType.is$lang_Type())) );
12778 } 12775 }
12779 else { 12776 else {
12780 this.parameters.add(p); 12777 this.parameters.add(p);
12781 } 12778 }
12782 } 12779 }
12783 } 12780 }
12784 $inherits(ConcreteMember, Member); 12781 $inherits(ConcreteMember, Member);
12785 ConcreteMember.prototype.is$ConcreteMember = function(){return this;};
12786 ConcreteMember.prototype.get$returnType = function() { return this.returnType; } ; 12782 ConcreteMember.prototype.get$returnType = function() { return this.returnType; } ;
12787 ConcreteMember.prototype.set$returnType = function(value) { return this.returnTy pe = value; }; 12783 ConcreteMember.prototype.set$returnType = function(value) { return this.returnTy pe = value; };
12788 ConcreteMember.prototype.get$parameters = function() { return this.parameters; } ; 12784 ConcreteMember.prototype.get$parameters = function() { return this.parameters; } ;
12789 ConcreteMember.prototype.set$parameters = function(value) { return this.paramete rs = value; }; 12785 ConcreteMember.prototype.set$parameters = function(value) { return this.paramete rs = value; };
12790 ConcreteMember.prototype.get$span = function() { 12786 ConcreteMember.prototype.get$span = function() {
12791 return this.baseMember.get$span(); 12787 return this.baseMember.get$span();
12792 } 12788 }
12793 ConcreteMember.prototype.get$isStatic = function() { 12789 ConcreteMember.prototype.get$isStatic = function() {
12794 return this.baseMember.get$isStatic(); 12790 return this.baseMember.get$isStatic();
12795 } 12791 }
12796 ConcreteMember.prototype.get$isAbstract = function() { 12792 ConcreteMember.prototype.get$isAbstract = function() {
12797 return this.baseMember.get$isAbstract(); 12793 return this.baseMember.get$isAbstract();
12798 } 12794 }
12799 ConcreteMember.prototype.get$isConst = function() { 12795 ConcreteMember.prototype.get$isConst = function() {
12800 return this.baseMember.get$isConst(); 12796 return this.baseMember.get$isConst();
12801 } 12797 }
12802 ConcreteMember.prototype.get$isFactory = function() {
12803 return this.baseMember.get$isFactory();
12804 }
12805 ConcreteMember.prototype.get$jsname = function() { 12798 ConcreteMember.prototype.get$jsname = function() {
12806 return this.baseMember.get$jsname(); 12799 return this.baseMember.get$jsname();
12807 } 12800 }
12808 ConcreteMember.prototype.set$jsname = function(name) { 12801 ConcreteMember.prototype.set$jsname = function(name) {
12809 return world.internalError('bad set of jsname on ConcreteMember'); 12802 return world.internalError('bad set of jsname on ConcreteMember');
12810 } 12803 }
12804 ConcreteMember.prototype.get$isFactory = function() {
12805 return this.baseMember.get$isFactory();
12806 }
12811 ConcreteMember.prototype.get$canGet = function() { 12807 ConcreteMember.prototype.get$canGet = function() {
12812 return this.baseMember.get$canGet(); 12808 return this.baseMember.get$canGet();
12813 } 12809 }
12814 ConcreteMember.prototype.get$canSet = function() { 12810 ConcreteMember.prototype.get$canSet = function() {
12815 return this.baseMember.get$canSet(); 12811 return this.baseMember.get$canSet();
12816 } 12812 }
12817 ConcreteMember.prototype.canInvoke = function(context, args) { 12813 ConcreteMember.prototype.canInvoke = function(context, args) {
12818 return this.baseMember.canInvoke(context, args); 12814 return this.baseMember.canInvoke(context, args);
12819 } 12815 }
12820 ConcreteMember.prototype.get$isField = function() { 12816 ConcreteMember.prototype.get$isField = function() {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
12933 MethodMember.prototype.get$canGet = function() { 12929 MethodMember.prototype.get$canGet = function() {
12934 return false; 12930 return false;
12935 } 12931 }
12936 MethodMember.prototype.get$canSet = function() { 12932 MethodMember.prototype.get$canSet = function() {
12937 return false; 12933 return false;
12938 } 12934 }
12939 MethodMember.prototype.get$span = function() { 12935 MethodMember.prototype.get$span = function() {
12940 return $notnull_bool(this.definition == null) ? null : this.definition.span; 12936 return $notnull_bool(this.definition == null) ? null : this.definition.span;
12941 } 12937 }
12942 MethodMember.prototype.get$constructorName = function() { 12938 MethodMember.prototype.get$constructorName = function() {
12943 var $0; 12939 if ($notnull_bool(this.definition.returnType == null)) return '';
12944 var returnType = (($0 = this.definition.returnType) && $0.is$NameTypeReference ()); 12940 if ($notnull_bool(this.definition.returnType.names != null)) {
12945 if ($notnull_bool(returnType == null)) return ''; 12941 return this.definition.returnType.names.$index(0).get$name();
12946 if ($notnull_bool(returnType.names != null)) {
12947 return returnType.names.$index(0).get$name();
12948 } 12942 }
12949 else if ($notnull_bool(returnType.name != null)) { 12943 else if ($notnull_bool($ne(this.definition.returnType.get$name(), null))) {
12950 return returnType.name.name; 12944 return this.definition.returnType.get$name().get$name();
12951 } 12945 }
12952 world.internalError('no valid constructor name', this.definition.span); 12946 world.internalError('no valid constructor name', this.definition.span);
12953 } 12947 }
12954 MethodMember.prototype.get$functionType = function() { 12948 MethodMember.prototype.get$functionType = function() {
12955 if ($notnull_bool(this._functionType == null)) { 12949 if ($notnull_bool(this._functionType == null)) {
12956 this._functionType = this.get$library().getOrAddFunctionType(this.name, this .definition, this.declaringType); 12950 this._functionType = this.get$library().getOrAddFunctionType(this.name, this .definition, this.declaringType);
12957 if ($notnull_bool(this.parameters == null)) { 12951 if ($notnull_bool(this.parameters == null)) {
12958 this.resolve(this.declaringType); 12952 this.resolve(this.declaringType);
12959 } 12953 }
12960 } 12954 }
(...skipping 29 matching lines...) Expand all
12990 MethodMember.prototype.indexOfParameter = function(name) { 12984 MethodMember.prototype.indexOfParameter = function(name) {
12991 for (var i = 0; 12985 for (var i = 0;
12992 $notnull_bool(i < this.parameters.length); i++) { 12986 $notnull_bool(i < this.parameters.length); i++) {
12993 var p = this.parameters.$index(i); 12987 var p = this.parameters.$index(i);
12994 if ($notnull_bool(p.get$isOptional() && $eq(p.get$name(), name))) { 12988 if ($notnull_bool(p.get$isOptional() && $eq(p.get$name(), name))) {
12995 return i; 12989 return i;
12996 } 12990 }
12997 } 12991 }
12998 return -1; 12992 return -1;
12999 } 12993 }
12994 MethodMember.prototype.resolveType = function(node, isRequired) {
12995 var type = this.declaringType.resolveType(node, isRequired);
12996 if ($notnull_bool(this.isStatic && type.get$hasTypeParams())) {
12997 world.error('using type parameter in static context', node.span);
12998 }
12999 return type;
13000 }
13000 MethodMember.prototype.get$prefersPropertySyntax = function() { 13001 MethodMember.prototype.get$prefersPropertySyntax = function() {
13001 return true; 13002 return true;
13002 } 13003 }
13003 MethodMember.prototype.get$requiresFieldSyntax = function() { 13004 MethodMember.prototype.get$requiresFieldSyntax = function() {
13004 return false; 13005 return false;
13005 } 13006 }
13006 MethodMember.prototype.provideFieldSyntax = function() { 13007 MethodMember.prototype.provideFieldSyntax = function() {
13007 return this._provideFieldSyntax = true; 13008 return this._provideFieldSyntax = true;
13008 } 13009 }
13009 MethodMember.prototype.providePropertySyntax = function() { 13010 MethodMember.prototype.providePropertySyntax = function() {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
13168 } 13169 }
13169 if ($notnull_bool(this.isStatic)) { 13170 if ($notnull_bool(this.isStatic)) {
13170 if ($notnull_bool(this.declaringType.get$isTop())) { 13171 if ($notnull_bool(this.declaringType.get$isTop())) {
13171 return new Value(this.returnType, ('' + this.get$jsname() + '(' + argsStri ng + ')'), false, true, false); 13172 return new Value(this.returnType, ('' + this.get$jsname() + '(' + argsStri ng + ')'), false, true, false);
13172 } 13173 }
13173 return new Value(this.returnType, ('' + this.declaringType.get$jsname() + '. ' + this.get$jsname() + '(' + argsString + ')'), false, true, false); 13174 return new Value(this.returnType, ('' + this.declaringType.get$jsname() + '. ' + this.get$jsname() + '(' + argsString + ')'), false, true, false);
13174 } 13175 }
13175 var code = ('' + target.code + '.' + this.get$jsname() + '(' + argsString + ') '); 13176 var code = ('' + target.code + '.' + this.get$jsname() + '(' + argsString + ') ');
13176 if ($notnull_bool(target.get$isConst())) { 13177 if ($notnull_bool(target.get$isConst())) {
13177 if ($notnull_bool((target instanceof GlobalValue))) { 13178 if ($notnull_bool((target instanceof GlobalValue))) {
13178 target = target.get$dynamic().exp; 13179 target = target.exp;
13179 } 13180 }
13180 if ($notnull_bool(this.name == 'get\$length')) { 13181 if ($notnull_bool(this.name == 'get\$length')) {
13181 if ($notnull_bool((target instanceof ConstListValue) || (target instanceof ConstMapValue))) { 13182 if ($notnull_bool((target instanceof ConstListValue) || (target instanceof ConstMapValue))) {
13182 code = ('' + target.get$dynamic().values.length + ''); 13183 code = ('' + target.values.length + '');
13183 } 13184 }
13184 } 13185 }
13185 else if ($notnull_bool(this.name == 'isEmpty')) { 13186 else if ($notnull_bool(this.name == 'isEmpty')) {
13186 if ($notnull_bool((target instanceof ConstListValue) || (target instanceof ConstMapValue))) { 13187 if ($notnull_bool((target instanceof ConstListValue) || (target instanceof ConstMapValue))) {
13187 code = ('' + target.get$dynamic().values.isEmpty() + ''); 13188 code = ('' + target.values.isEmpty() + '');
13188 } 13189 }
13189 } 13190 }
13190 } 13191 }
13191 if ($notnull_bool(this.name == 'get\$typeName' && $eq(this.declaringType.get$l ibrary(), world.get$dom()))) { 13192 if ($notnull_bool(this.name == 'get\$typeName' && $eq(this.declaringType.get$l ibrary(), world.get$dom()))) {
13192 world.gen.corejs.useTypeNameOf = true; 13193 world.gen.corejs.useTypeNameOf = true;
13193 } 13194 }
13194 return new Value(this.returnType, code, false, true, false); 13195 return new Value(this.returnType, code, false, true, false);
13195 } 13196 }
13196 MethodMember.prototype._invokeConstructor = function(context, node, target, args , argsString) { 13197 MethodMember.prototype._invokeConstructor = function(context, node, target, args , argsString) {
13197 this.declaringType.markUsed(); 13198 this.declaringType.markUsed();
13198 if ($notnull_bool(target != null)) { 13199 if ($notnull_bool(target != null)) {
13199 var code = $notnull_bool((this.get$constructorName() != '')) ? ('' + this.de claringType.get$jsname() + '.' + this.get$constructorName() + '\$ctor.call(' + a rgsString + ')') : ('' + this.declaringType.get$jsname() + '.call(' + argsString + ')'); 13200 var code = $notnull_bool((this.get$constructorName() != '')) ? ('' + this.de claringType.get$jsname() + '.' + this.get$constructorName() + '\$ctor.call(' + a rgsString + ')') : ('' + this.declaringType.get$jsname() + '.call(' + argsString + ')');
13200 return new Value(this.declaringType, code, false, true, false); 13201 return new Value(this.declaringType, code, false, true, false);
13201 } 13202 }
13202 else { 13203 else {
13203 var code = $notnull_bool((this.get$constructorName() != '')) ? ('new ' + thi s.declaringType.get$jsname() + '.' + this.get$constructorName() + '\$ctor(' + ar gsString + ')') : ('new ' + this.declaringType.get$jsname() + '(' + argsString + ')'); 13204 var code = $notnull_bool((this.get$constructorName() != '')) ? ('new ' + thi s.declaringType.get$jsname() + '.' + this.get$constructorName() + '\$ctor(' + ar gsString + ')') : ('new ' + this.declaringType.get$jsname() + '(' + argsString + ')');
13204 if ($notnull_bool(this.isConst && (node instanceof lang_NewExpression) && no de.get$dynamic().get$isConst())) { 13205 if ($notnull_bool(this.isConst && node.get$isConst())) {
13205 return this._invokeConstConstructor(node, $assert_String(code), target, ar gs); 13206 return this._invokeConstConstructor(node, $assert_String(code), target, ar gs);
13206 } 13207 }
13207 else { 13208 else {
13208 return new Value(this.declaringType, code, false, true, false); 13209 return new Value(this.declaringType, code, false, true, false);
13209 } 13210 }
13210 } 13211 }
13211 } 13212 }
13212 MethodMember.prototype._invokeConstConstructor = function(node, code, target, ar gs) { 13213 MethodMember.prototype._invokeConstConstructor = function(node, code, target, ar gs) {
13213 var $0; 13214 var $0;
13214 var fields = new HashMapImplementation$String$EvaluatedValue(); 13215 var fields = new HashMapImplementation$String$EvaluatedValue();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
13260 value = value.exp; 13261 value = value.exp;
13261 } 13262 }
13262 var $list0 = value.fields.getKeys(); 13263 var $list0 = value.fields.getKeys();
13263 for (var $i0 = value.fields.getKeys().iterator(); $i0.hasNext(); ) { 13264 for (var $i0 = value.fields.getKeys().iterator(); $i0.hasNext(); ) {
13264 var fname = $i0.next(); 13265 var fname = $i0.next();
13265 fields.$setindex(fname, value.fields.$index(fname)); 13266 fields.$setindex(fname, value.fields.$index(fname));
13266 } 13267 }
13267 } 13268 }
13268 } 13269 }
13269 else { 13270 else {
13270 var assign = (init && init.is$BinaryExpression()); 13271 var fname = init.x.get$name().get$name();
13271 var x = (($0 = assign.x) && $0.is$VarExpression()); 13272 var val = this.generator.visitValue(init.y);
13272 var fname = x.name.name;
13273 var val = this.generator.visitValue(assign.y);
13274 fields.$setindex(fname, val); 13273 fields.$setindex(fname, val);
13275 } 13274 }
13276 } 13275 }
13277 this.generator._popBlock(); 13276 this.generator._popBlock();
13278 } 13277 }
13279 var $list = this.declaringType.get$members().getValues(); 13278 var $list = this.declaringType.members.getValues();
13280 for (var $i = this.declaringType.get$members().getValues().iterator(); $i.hasN ext(); ) { 13279 for (var $i = this.declaringType.members.getValues().iterator(); $i.hasNext(); ) {
13281 var f = $i.next(); 13280 var f = $i.next();
13282 if ($notnull_bool((f instanceof FieldMember) && !$notnull_bool(f.get$isStati c()) && $ne(f.get$value(), null) && !$notnull_bool(fields.containsKey(f.get$name ())))) { 13281 if ($notnull_bool((f instanceof FieldMember) && !$notnull_bool(f.get$isStati c()) && $ne(f.get$value(), null) && !$notnull_bool(fields.containsKey(f.get$name ())))) {
13283 fields.$setindex(f.get$name(), f.computeValue()); 13282 fields.$setindex(f.get$name(), f.computeValue());
13284 } 13283 }
13285 } 13284 }
13286 return world.gen.globalForConst(ConstObjectValue.ConstObjectValue$factory(this .declaringType, fields, code, node.span), args.values); 13285 return world.gen.globalForConst(ConstObjectValue.ConstObjectValue$factory(this .declaringType, fields, code, node.span), args.values);
13287 } 13286 }
13288 MethodMember.prototype._invokeBuiltin = function(context, node, target, args, ar gsCode) { 13287 MethodMember.prototype._invokeBuiltin = function(context, node, target, args, ar gsCode) {
13289 var allConst = target.get$isConst() && args.values.every((function (arg) { 13288 var allConst = target.get$isConst() && args.values.every((function (arg) {
13290 return arg.get$isConst(); 13289 return arg.get$isConst();
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
13578 ; 13577 ;
13579 // ********** Code for MemberSet ************** 13578 // ********** Code for MemberSet **************
13580 function MemberSet(member) { 13579 function MemberSet(member) {
13581 this.name = member.name; 13580 this.name = member.name;
13582 this.members = [member]; 13581 this.members = [member];
13583 this.jsname = member.get$jsname(); 13582 this.jsname = member.get$jsname();
13584 // Initializers done 13583 // Initializers done
13585 } 13584 }
13586 MemberSet.prototype.is$MemberSet = function(){return this;}; 13585 MemberSet.prototype.is$MemberSet = function(){return this;};
13587 MemberSet.prototype.get$name = function() { return this.name; }; 13586 MemberSet.prototype.get$name = function() { return this.name; };
13588 MemberSet.prototype.get$members = function() { return this.members; };
13589 MemberSet.prototype.get$jsname = function() { return this.jsname; }; 13587 MemberSet.prototype.get$jsname = function() { return this.jsname; };
13590 MemberSet.prototype.toString = function() { 13588 MemberSet.prototype.toString = function() {
13591 return ('' + this.name + ':' + this.members.length + ''); 13589 return ('' + this.name + ':' + this.members.length + '');
13592 } 13590 }
13593 MemberSet.prototype.get$containsMethods = function() { 13591 MemberSet.prototype.get$containsMethods = function() {
13594 return this.members.some((function (m) { 13592 return this.members.some((function (m) {
13595 return (m instanceof MethodMember); 13593 return (m instanceof MethodMember);
13596 }) 13594 })
13597 ); 13595 );
13598 } 13596 }
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
13809 } 13807 }
13810 FactoryMap.prototype.forEach = function(f) { 13808 FactoryMap.prototype.forEach = function(f) {
13811 this.factories.forEach((function (_, constructors) { 13809 this.factories.forEach((function (_, constructors) {
13812 constructors.forEach((function (_, member) { 13810 constructors.forEach((function (_, member) {
13813 f(member); 13811 f(member);
13814 }) 13812 })
13815 ); 13813 );
13816 }) 13814 })
13817 ); 13815 );
13818 } 13816 }
13817 FactoryMap.prototype.forEach$1 = FactoryMap.prototype.forEach;
13819 // ********** Code for lang_Token ************** 13818 // ********** Code for lang_Token **************
13820 function lang_Token(kind, source, start, end) { 13819 function lang_Token(kind, source, start, end) {
13821 this.kind = kind; 13820 this.kind = kind;
13822 this.source = source; 13821 this.source = source;
13823 this.start = start; 13822 this.start = start;
13824 this.end = end; 13823 this.end = end;
13825 // Initializers done 13824 // Initializers done
13826 } 13825 }
13827 lang_Token.prototype.get$source = function() { return this.source; }; 13826 lang_Token.prototype.get$source = function() { return this.source; };
13828 lang_Token.prototype.get$text = function() { 13827 lang_Token.prototype.get$text = function() {
(...skipping 3357 matching lines...) Expand 10 before | Expand all | Expand 10 after
17186 // ********** Code for Definition ************** 17185 // ********** Code for Definition **************
17187 function Definition(span) { 17186 function Definition(span) {
17188 lang_Statement.call(this, span); 17187 lang_Statement.call(this, span);
17189 // Initializers done 17188 // Initializers done
17190 } 17189 }
17191 $inherits(Definition, lang_Statement); 17190 $inherits(Definition, lang_Statement);
17192 Definition.prototype.is$Definition = function(){return this;}; 17191 Definition.prototype.is$Definition = function(){return this;};
17193 Definition.prototype.get$typeParameters = function() { 17192 Definition.prototype.get$typeParameters = function() {
17194 return null; 17193 return null;
17195 } 17194 }
17196 Definition.prototype.get$nativeType = function() {
17197 return null;
17198 }
17199 // ********** Code for lang_Statement ************** 17195 // ********** Code for lang_Statement **************
17200 function lang_Statement(span) { 17196 function lang_Statement(span) {
17201 lang_Node.call(this, span); 17197 lang_Node.call(this, span);
17202 // Initializers done 17198 // Initializers done
17203 } 17199 }
17204 $inherits(lang_Statement, lang_Node); 17200 $inherits(lang_Statement, lang_Node);
17205 lang_Statement.prototype.is$lang_Statement = function(){return this;}; 17201 lang_Statement.prototype.is$lang_Statement = function(){return this;};
17206 // ********** Code for lang_Expression ************** 17202 // ********** Code for lang_Expression **************
17207 function lang_Expression(span) { 17203 function lang_Expression(span) {
17208 lang_Node.call(this, span); 17204 lang_Node.call(this, span);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
17243 this.typeParameters = typeParameters; 17239 this.typeParameters = typeParameters;
17244 this.extendsTypes = extendsTypes; 17240 this.extendsTypes = extendsTypes;
17245 this.implementsTypes = implementsTypes; 17241 this.implementsTypes = implementsTypes;
17246 this.nativeType = nativeType; 17242 this.nativeType = nativeType;
17247 this.factoryType = factoryType; 17243 this.factoryType = factoryType;
17248 this.body = body; 17244 this.body = body;
17249 Definition.call(this, span); 17245 Definition.call(this, span);
17250 // Initializers done 17246 // Initializers done
17251 } 17247 }
17252 $inherits(TypeDefinition, Definition); 17248 $inherits(TypeDefinition, Definition);
17253 TypeDefinition.prototype.is$TypeDefinition = function(){return this;};
17254 TypeDefinition.prototype.get$isClass = function() { return this.isClass; }; 17249 TypeDefinition.prototype.get$isClass = function() { return this.isClass; };
17255 TypeDefinition.prototype.set$isClass = function(value) { return this.isClass = v alue; }; 17250 TypeDefinition.prototype.set$isClass = function(value) { return this.isClass = v alue; };
17256 TypeDefinition.prototype.get$name = function() { return this.name; }; 17251 TypeDefinition.prototype.get$name = function() { return this.name; };
17257 TypeDefinition.prototype.set$name = function(value) { return this.name = value; }; 17252 TypeDefinition.prototype.set$name = function(value) { return this.name = value; };
17258 TypeDefinition.prototype.get$typeParameters = function() { return this.typeParam eters; }; 17253 TypeDefinition.prototype.get$typeParameters = function() { return this.typeParam eters; };
17259 TypeDefinition.prototype.set$typeParameters = function(value) { return this.type Parameters = value; }; 17254 TypeDefinition.prototype.set$typeParameters = function(value) { return this.type Parameters = value; };
17260 TypeDefinition.prototype.get$nativeType = function() { return this.nativeType; } ;
17261 TypeDefinition.prototype.set$nativeType = function(value) { return this.nativeTy pe = value; };
17262 TypeDefinition.prototype.visit = function(visitor) { 17255 TypeDefinition.prototype.visit = function(visitor) {
17263 return visitor.visitTypeDefinition(this); 17256 return visitor.visitTypeDefinition(this);
17264 } 17257 }
17265 // ********** Code for FunctionTypeDefinition ************** 17258 // ********** Code for FunctionTypeDefinition **************
17266 function FunctionTypeDefinition(func, typeParameters, span) { 17259 function FunctionTypeDefinition(func, typeParameters, span) {
17267 this.func = func; 17260 this.func = func;
17268 this.typeParameters = typeParameters; 17261 this.typeParameters = typeParameters;
17269 Definition.call(this, span); 17262 Definition.call(this, span);
17270 // Initializers done 17263 // Initializers done
17271 } 17264 }
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
17444 SwitchStatement.prototype.visit = function(visitor) { 17437 SwitchStatement.prototype.visit = function(visitor) {
17445 return visitor.visitSwitchStatement(this); 17438 return visitor.visitSwitchStatement(this);
17446 } 17439 }
17447 // ********** Code for BlockStatement ************** 17440 // ********** Code for BlockStatement **************
17448 function BlockStatement(body, span) { 17441 function BlockStatement(body, span) {
17449 this.body = body; 17442 this.body = body;
17450 lang_Statement.call(this, span); 17443 lang_Statement.call(this, span);
17451 // Initializers done 17444 // Initializers done
17452 } 17445 }
17453 $inherits(BlockStatement, lang_Statement); 17446 $inherits(BlockStatement, lang_Statement);
17454 BlockStatement.prototype.is$BlockStatement = function(){return this;};
17455 BlockStatement.prototype.visit = function(visitor) { 17447 BlockStatement.prototype.visit = function(visitor) {
17456 return visitor.visitBlockStatement(this); 17448 return visitor.visitBlockStatement(this);
17457 } 17449 }
17458 // ********** Code for LabeledStatement ************** 17450 // ********** Code for LabeledStatement **************
17459 function LabeledStatement(name, body, span) { 17451 function LabeledStatement(name, body, span) {
17460 this.name = name; 17452 this.name = name;
17461 this.body = body; 17453 this.body = body;
17462 lang_Statement.call(this, span); 17454 lang_Statement.call(this, span);
17463 // Initializers done 17455 // Initializers done
17464 } 17456 }
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
17758 return visitor.visitGenericTypeReference(this); 17750 return visitor.visitGenericTypeReference(this);
17759 } 17751 }
17760 // ********** Code for FunctionTypeReference ************** 17752 // ********** Code for FunctionTypeReference **************
17761 function FunctionTypeReference(isFinal, func, span) { 17753 function FunctionTypeReference(isFinal, func, span) {
17762 this.isFinal = isFinal; 17754 this.isFinal = isFinal;
17763 this.func = func; 17755 this.func = func;
17764 TypeReference.call(this, span); 17756 TypeReference.call(this, span);
17765 // Initializers done 17757 // Initializers done
17766 } 17758 }
17767 $inherits(FunctionTypeReference, TypeReference); 17759 $inherits(FunctionTypeReference, TypeReference);
17768 FunctionTypeReference.prototype.is$FunctionTypeReference = function(){return thi s;};
17769 FunctionTypeReference.prototype.visit = function(visitor) { 17760 FunctionTypeReference.prototype.visit = function(visitor) {
17770 return visitor.visitFunctionTypeReference(this); 17761 return visitor.visitFunctionTypeReference(this);
17771 } 17762 }
17772 // ********** Code for ArgumentNode ************** 17763 // ********** Code for ArgumentNode **************
17773 function ArgumentNode(label, value, span) { 17764 function ArgumentNode(label, value, span) {
17774 this.label = label; 17765 this.label = label;
17775 this.value = value; 17766 this.value = value;
17776 lang_Node.call(this, span); 17767 lang_Node.call(this, span);
17777 // Initializers done 17768 // Initializers done
17778 } 17769 }
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
17940 } 17931 }
17941 lang_Type.prototype.get$typeofName = function() { 17932 lang_Type.prototype.get$typeofName = function() {
17942 return null; 17933 return null;
17943 } 17934 }
17944 lang_Type.prototype.get$jsname = function() { 17935 lang_Type.prototype.get$jsname = function() {
17945 return $notnull_bool(this._jsname == null) ? this.name : this._jsname; 17936 return $notnull_bool(this._jsname == null) ? this.name : this._jsname;
17946 } 17937 }
17947 lang_Type.prototype.set$jsname = function(name) { 17938 lang_Type.prototype.set$jsname = function(name) {
17948 return this._jsname = name; 17939 return this._jsname = name;
17949 } 17940 }
17950 lang_Type.prototype.get$members = function() {
17951 return null;
17952 }
17953 lang_Type.prototype.get$definition = function() {
17954 return null;
17955 }
17956 lang_Type.prototype.get$factories = function() {
17957 return null;
17958 }
17959 lang_Type.prototype.get$typeArgsInOrder = function() { 17941 lang_Type.prototype.get$typeArgsInOrder = function() {
17960 return null; 17942 return null;
17961 } 17943 }
17962 lang_Type.prototype.get$genericType = function() { 17944 lang_Type.prototype.get$genericType = function() {
17963 return this; 17945 return this;
17964 } 17946 }
17965 lang_Type.prototype.get$interfaces = function() { 17947 lang_Type.prototype.get$interfaces = function() {
17966 return null; 17948 return null;
17967 } 17949 }
17968 lang_Type.prototype.get$parent = function() { 17950 lang_Type.prototype.get$parent = function() {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
18082 ParameterType.prototype.is$ParameterType = function(){return this;}; 18064 ParameterType.prototype.is$ParameterType = function(){return this;};
18083 ParameterType.prototype.get$isClass = function() { 18065 ParameterType.prototype.get$isClass = function() {
18084 return false; 18066 return false;
18085 } 18067 }
18086 ParameterType.prototype.get$library = function() { 18068 ParameterType.prototype.get$library = function() {
18087 return null; 18069 return null;
18088 } 18070 }
18089 ParameterType.prototype.get$span = function() { 18071 ParameterType.prototype.get$span = function() {
18090 return this.typeParameter.span; 18072 return this.typeParameter.span;
18091 } 18073 }
18092 ParameterType.prototype.get$constructors = function() {
18093 return world.internalError('no constructors on type parameters yet');
18094 }
18095 ParameterType.prototype.getCallMethod = function() { 18074 ParameterType.prototype.getCallMethod = function() {
18096 return this.extendsType.getCallMethod(); 18075 return this.extendsType.getCallMethod();
18097 } 18076 }
18098 ParameterType.prototype.genMethod = function(method) { 18077 ParameterType.prototype.genMethod = function(method) {
18099 this.extendsType.genMethod(method); 18078 this.extendsType.genMethod(method);
18100 } 18079 }
18101 ParameterType.prototype.isSubtypeOf = function(child) { 18080 ParameterType.prototype.isSubtypeOf = function(child) {
18102 return true; 18081 return true;
18103 } 18082 }
18104 ParameterType.prototype.resolveMember = function(memberName) { 18083 ParameterType.prototype.resolveMember = function(memberName) {
18105 return this.extendsType.resolveMember(memberName); 18084 return this.extendsType.resolveMember(memberName);
18106 } 18085 }
18107 ParameterType.prototype.getConstructor = function(constructorName) { 18086 ParameterType.prototype.getConstructor = function(constructorName) {
18108 world.internalError('no constructors on type parameters yet'); 18087 world.internalError('no constructors on type parameters yet');
18109 } 18088 }
18110 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) {
18111 world.internalError('no concrete types of type parameters yet', this.get$span( ));
18112 }
18113 ParameterType.prototype.resolveTypeParams = function(inType) { 18089 ParameterType.prototype.resolveTypeParams = function(inType) {
18114 return inType.typeArguments.$index(this.name); 18090 return inType.typeArguments.$index(this.name);
18115 } 18091 }
18116 ParameterType.prototype.addDirectSubtype = function(type) {
18117 world.internalError('no subtypes of type parameters yet', this.get$span());
18118 }
18119 ParameterType.prototype.resolve = function(inType) { 18092 ParameterType.prototype.resolve = function(inType) {
18120 if ($notnull_bool(this.typeParameter.extendsType != null)) { 18093 if ($notnull_bool(this.typeParameter.extendsType != null)) {
18121 this.extendsType = inType.resolveType(this.typeParameter.extendsType, true); 18094 this.extendsType = inType.resolveType(this.typeParameter.extendsType, true);
18122 } 18095 }
18123 else { 18096 else {
18124 this.extendsType = world.objectType; 18097 this.extendsType = world.objectType;
18125 } 18098 }
18126 } 18099 }
18127 // ********** Code for ConcreteType ************** 18100 // ********** Code for ConcreteType **************
18128 function ConcreteType(name, genericType, typeArguments, typeArgsInOrder) { 18101 function ConcreteType(name, genericType, typeArguments, typeArgsInOrder) {
18129 this.genericType = genericType; 18102 this.genericType = genericType;
18130 this.typeArguments = typeArguments; 18103 this.typeArguments = typeArguments;
18131 this.typeArgsInOrder = typeArgsInOrder; 18104 this.typeArgsInOrder = typeArgsInOrder;
18132 this.constructors = $map([]); 18105 this.constructors = $map([]);
18133 this.members = $map([]); 18106 this.members = $map([]);
18134 this.factories = new FactoryMap(); 18107 this.factories = new FactoryMap();
18135 lang_Type.call(this, name); 18108 lang_Type.call(this, name);
18136 // Initializers done 18109 // Initializers done
18137 } 18110 }
18138 $inherits(ConcreteType, lang_Type); 18111 $inherits(ConcreteType, lang_Type);
18139 ConcreteType.prototype.get$genericType = function() { return this.genericType; } ; 18112 ConcreteType.prototype.get$genericType = function() { return this.genericType; } ;
18140 ConcreteType.prototype.get$typeArgsInOrder = function() { return this.typeArgsIn Order; }; 18113 ConcreteType.prototype.get$typeArgsInOrder = function() { return this.typeArgsIn Order; };
18141 ConcreteType.prototype.set$typeArgsInOrder = function(value) { return this.typeA rgsInOrder = value; }; 18114 ConcreteType.prototype.set$typeArgsInOrder = function(value) { return this.typeA rgsInOrder = value; };
18142 ConcreteType.prototype.get$isList = function() { 18115 ConcreteType.prototype.get$isList = function() {
18143 return this.genericType.get$isList(); 18116 return this.genericType.get$isList();
18144 } 18117 }
18145 ConcreteType.prototype.get$isClass = function() { 18118 ConcreteType.prototype.get$isClass = function() {
18146 return this.genericType.isClass; 18119 return this.genericType.get$isClass();
18147 } 18120 }
18148 ConcreteType.prototype.get$library = function() { 18121 ConcreteType.prototype.get$library = function() {
18149 return this.genericType.library; 18122 return this.genericType.get$library();
18150 } 18123 }
18151 ConcreteType.prototype.get$span = function() { 18124 ConcreteType.prototype.get$span = function() {
18152 return this.genericType.get$span(); 18125 return this.genericType.get$span();
18153 } 18126 }
18154 ConcreteType.prototype.get$hasTypeParams = function() { 18127 ConcreteType.prototype.get$hasTypeParams = function() {
18155 return this.typeArguments.getValues().some((function (e) { 18128 return this.typeArguments.getValues().some((function (e) {
18156 return (e instanceof ParameterType); 18129 return (e instanceof ParameterType);
18157 }) 18130 })
18158 ); 18131 );
18159 } 18132 }
18160 ConcreteType.prototype.get$members = function() { return this.members; };
18161 ConcreteType.prototype.set$members = function(value) { return this.members = val ue; };
18162 ConcreteType.prototype.get$constructors = function() { return this.constructors; };
18163 ConcreteType.prototype.set$constructors = function(value) { return this.construc tors = value; };
18164 ConcreteType.prototype.get$factories = function() { return this.factories; };
18165 ConcreteType.prototype.set$factories = function(value) { return this.factories = value; };
18166 ConcreteType.prototype.resolveTypeParams = function(inType) { 18133 ConcreteType.prototype.resolveTypeParams = function(inType) {
18167 var newTypeArgs = []; 18134 var newTypeArgs = [];
18168 var needsNewType = false; 18135 var needsNewType = false;
18169 var $list = this.typeArgsInOrder; 18136 var $list = this.typeArgsInOrder;
18170 for (var $i = 0;$i < $list.length; $i++) { 18137 for (var $i = 0;$i < $list.length; $i++) {
18171 var t = $list.$index($i); 18138 var t = $list.$index($i);
18172 var newType = t.resolveTypeParams(inType); 18139 var newType = t.resolveTypeParams(inType);
18173 if ($notnull_bool($ne(newType, t))) needsNewType = true; 18140 if ($notnull_bool($ne(newType, t))) needsNewType = true;
18174 newTypeArgs.add(newType); 18141 newTypeArgs.add(newType);
18175 } 18142 }
18176 if ($notnull_bool(!$notnull_bool(needsNewType))) return this; 18143 if ($notnull_bool(!$notnull_bool(needsNewType))) return this;
18177 return this.genericType.getOrMakeConcreteType((newTypeArgs && newTypeArgs.is$L ist$Type())); 18144 return this.genericType.getOrMakeConcreteType(newTypeArgs);
18178 } 18145 }
18179 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) { 18146 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) {
18180 return this.genericType.getOrMakeConcreteType(typeArgs); 18147 return this.genericType.getOrMakeConcreteType(typeArgs);
18181 } 18148 }
18182 ConcreteType.prototype.get$parent = function() { 18149 ConcreteType.prototype.get$parent = function() {
18183 return this.genericType.parent; 18150 return this.genericType.get$parent();
18184 } 18151 }
18185 ConcreteType.prototype.get$interfaces = function() { 18152 ConcreteType.prototype.get$interfaces = function() {
18186 if ($notnull_bool(this._interfaces == null && this.genericType.interfaces != n ull)) { 18153 if ($notnull_bool(this._interfaces == null && this.genericType.get$interfaces( ) != null)) {
18187 this._interfaces = []; 18154 this._interfaces = [];
18188 var $list = this.genericType.interfaces; 18155 var $list = this.genericType.get$interfaces();
18189 for (var $i = 0;$i < $list.length; $i++) { 18156 for (var $i = 0;$i < $list.length; $i++) {
18190 var i = $list.$index($i); 18157 var i = $list.$index($i);
18191 this._interfaces.add(i.resolveTypeParams(this)); 18158 this._interfaces.add(i.resolveTypeParams(this));
18192 } 18159 }
18193 } 18160 }
18194 return this._interfaces; 18161 return this._interfaces;
18195 } 18162 }
18196 ConcreteType.prototype.getCallMethod = function() { 18163 ConcreteType.prototype.getCallMethod = function() {
18197 return this.genericType.getCallMethod(); 18164 return this.genericType.getCallMethod();
18198 } 18165 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
18251 } 18218 }
18252 ConcreteType.prototype.resolveMember = function(memberName) { 18219 ConcreteType.prototype.resolveMember = function(memberName) {
18253 var $0; 18220 var $0;
18254 var mem = this.getMember(memberName); 18221 var mem = this.getMember(memberName);
18255 if ($notnull_bool(mem == null)) return null; 18222 if ($notnull_bool(mem == null)) return null;
18256 var ret = new MemberSet((mem && mem.is$Member())); 18223 var ret = new MemberSet((mem && mem.is$Member()));
18257 if ($notnull_bool(mem.get$isStatic())) return ret; 18224 if ($notnull_bool(mem.get$isStatic())) return ret;
18258 var $list = this.genericType.get$subtypes(); 18225 var $list = this.genericType.get$subtypes();
18259 for (var $i = this.genericType.get$subtypes().iterator(); $i.hasNext(); ) { 18226 for (var $i = this.genericType.get$subtypes().iterator(); $i.hasNext(); ) {
18260 var t = $i.next(); 18227 var t = $i.next();
18261 var m = t.get$members().$index(memberName); 18228 var m = t.members.$index(memberName);
18262 if ($notnull_bool($ne(m, null))) ret.add(m); 18229 if ($notnull_bool($ne(m, null))) ret.add(m);
18263 } 18230 }
18264 return ret; 18231 return ret;
18265 } 18232 }
18266 ConcreteType.prototype.resolveType = function(node, isRequired) { 18233 ConcreteType.prototype.resolveType = function(node, isRequired) {
18267 var ret = this.genericType.resolveType(node, isRequired); 18234 var ret = this.genericType.resolveType(node, isRequired);
18268 return ret; 18235 return ret;
18269 } 18236 }
18270 ConcreteType.prototype.addDirectSubtype = function(type) { 18237 ConcreteType.prototype.addDirectSubtype = function(type) {
18271 this.genericType.addDirectSubtype(type); 18238 this.genericType.addDirectSubtype(type);
(...skipping 18 matching lines...) Expand all
18290 DefinedType.prototype.get$definition = function() { return this.definition; }; 18257 DefinedType.prototype.get$definition = function() { return this.definition; };
18291 DefinedType.prototype.set$definition = function(value) { return this.definition = value; }; 18258 DefinedType.prototype.set$definition = function(value) { return this.definition = value; };
18292 DefinedType.prototype.get$library = function() { return this.library; }; 18259 DefinedType.prototype.get$library = function() { return this.library; };
18293 DefinedType.prototype.get$isClass = function() { return this.isClass; }; 18260 DefinedType.prototype.get$isClass = function() { return this.isClass; };
18294 DefinedType.prototype.get$parent = function() { return this.parent; }; 18261 DefinedType.prototype.get$parent = function() { return this.parent; };
18295 DefinedType.prototype.set$parent = function(value) { return this.parent = value; }; 18262 DefinedType.prototype.set$parent = function(value) { return this.parent = value; };
18296 DefinedType.prototype.get$interfaces = function() { return this.interfaces; }; 18263 DefinedType.prototype.get$interfaces = function() { return this.interfaces; };
18297 DefinedType.prototype.set$interfaces = function(value) { return this.interfaces = value; }; 18264 DefinedType.prototype.set$interfaces = function(value) { return this.interfaces = value; };
18298 DefinedType.prototype.get$typeParameters = function() { return this.typeParamete rs; }; 18265 DefinedType.prototype.get$typeParameters = function() { return this.typeParamete rs; };
18299 DefinedType.prototype.set$typeParameters = function(value) { return this.typePar ameters = value; }; 18266 DefinedType.prototype.set$typeParameters = function(value) { return this.typePar ameters = value; };
18300 DefinedType.prototype.get$constructors = function() { return this.constructors; };
18301 DefinedType.prototype.set$constructors = function(value) { return this.construct ors = value; };
18302 DefinedType.prototype.get$members = function() { return this.members; };
18303 DefinedType.prototype.set$members = function(value) { return this.members = valu e; };
18304 DefinedType.prototype.get$factories = function() { return this.factories; };
18305 DefinedType.prototype.set$factories = function(value) { return this.factories = value; };
18306 DefinedType.prototype.get$isUsed = function() { return this.isUsed; }; 18267 DefinedType.prototype.get$isUsed = function() { return this.isUsed; };
18307 DefinedType.prototype.set$isUsed = function(value) { return this.isUsed = value; }; 18268 DefinedType.prototype.set$isUsed = function(value) { return this.isUsed = value; };
18308 DefinedType.prototype.get$isNativeType = function() { return this.isNativeType; }; 18269 DefinedType.prototype.get$isNativeType = function() { return this.isNativeType; };
18309 DefinedType.prototype.set$isNativeType = function(value) { return this.isNativeT ype = value; }; 18270 DefinedType.prototype.set$isNativeType = function(value) { return this.isNativeT ype = value; };
18310 DefinedType.prototype.setDefinition = function(def) { 18271 DefinedType.prototype.setDefinition = function(def) {
18311 $assert(this.definition == null, "definition == null", "type.dart", 558, 12); 18272 $assert(this.definition == null, "definition == null", "type.dart", 541, 12);
18312 this.definition = def; 18273 this.definition = def;
18313 if ($notnull_bool((this.definition instanceof TypeDefinition) && this.definiti on.get$nativeType() != null)) { 18274 if ($notnull_bool((this.definition instanceof TypeDefinition) && this.definiti on.nativeType != null)) {
18314 this.isNativeType = true; 18275 this.isNativeType = true;
18315 } 18276 }
18316 if ($notnull_bool(this.definition != null && this.definition.get$typeParameter s() != null)) { 18277 if ($notnull_bool(this.definition != null && this.definition.get$typeParameter s() != null)) {
18317 this._concreteTypes = $map([]); 18278 this._concreteTypes = $map([]);
18318 this.typeParameters = []; 18279 this.typeParameters = [];
18319 var $list = this.definition.get$typeParameters(); 18280 var $list = this.definition.get$typeParameters();
18320 for (var $i = 0;$i < $list.length; $i++) { 18281 for (var $i = 0;$i < $list.length; $i++) {
18321 var tp = $list.$index($i); 18282 var tp = $list.$index($i);
18322 var paramName = tp.get$name().get$name(); 18283 var paramName = tp.get$name().get$name();
18323 this.typeParameters.add(new ParameterType($assert_String(paramName), tp)); 18284 this.typeParameters.add(new ParameterType($assert_String(paramName), tp));
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
18408 var resolvedInterface = this.resolveType((type && type.is$TypeReference()), true); 18369 var resolvedInterface = this.resolveType((type && type.is$TypeReference()), true);
18409 if ($notnull_bool(resolvedInterface.get$isClosed() && !$notnull_bool((this.l ibrary.get$isCore() || this.library.get$isCoreImpl())))) { 18370 if ($notnull_bool(resolvedInterface.get$isClosed() && !$notnull_bool((this.l ibrary.get$isCore() || this.library.get$isCoreImpl())))) {
18410 world.error(('can not implement "' + resolvedInterface.get$name() + '": ') + 'only native implementation allowed', type.get$span()); 18371 world.error(('can not implement "' + resolvedInterface.get$name() + '": ') + 'only native implementation allowed', type.get$span());
18411 } 18372 }
18412 resolvedInterface.addDirectSubtype(this); 18373 resolvedInterface.addDirectSubtype(this);
18413 interfaces.add(resolvedInterface); 18374 interfaces.add(resolvedInterface);
18414 } 18375 }
18415 return interfaces; 18376 return interfaces;
18416 } 18377 }
18417 DefinedType.prototype.addDirectSubtype = function(type) { 18378 DefinedType.prototype.addDirectSubtype = function(type) {
18418 $assert(this._subtypes == null, "_subtypes == null", "type.dart", 674, 12); 18379 $assert(this._subtypes == null, "_subtypes == null", "type.dart", 657, 12);
18419 this.directSubtypes.add(type); 18380 this.directSubtypes.add(type);
18420 } 18381 }
18421 DefinedType.prototype.get$subtypes = function() { 18382 DefinedType.prototype.get$subtypes = function() {
18422 var $0; 18383 var $0;
18423 if ($notnull_bool(this._subtypes == null)) { 18384 if ($notnull_bool(this._subtypes == null)) {
18424 this._subtypes = new HashSetImplementation$Type(); 18385 this._subtypes = new HashSetImplementation$Type();
18425 var $list = this.directSubtypes; 18386 var $list = this.directSubtypes;
18426 for (var $i = this.directSubtypes.iterator(); $i.hasNext(); ) { 18387 for (var $i = this.directSubtypes.iterator(); $i.hasNext(); ) {
18427 var st = $i.next(); 18388 var st = $i.next();
18428 this._subtypes.add(st); 18389 this._subtypes.add(st);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
18470 for (var i = 0; 18431 for (var i = 0;
18471 $notnull_bool(i < this.interfaces.length); i++) { 18432 $notnull_bool(i < this.interfaces.length); i++) {
18472 if ($notnull_bool(_helper(this.interfaces.$index(i)))) return i; 18433 if ($notnull_bool(_helper(this.interfaces.$index(i)))) return i;
18473 } 18434 }
18474 return -1; 18435 return -1;
18475 } 18436 }
18476 DefinedType.prototype.resolve = function() { 18437 DefinedType.prototype.resolve = function() {
18477 var $this = this; // closure support 18438 var $this = this; // closure support
18478 var $0; 18439 var $0;
18479 if ($notnull_bool((this.definition instanceof TypeDefinition))) { 18440 if ($notnull_bool((this.definition instanceof TypeDefinition))) {
18480 var typeDef = (($0 = this.definition) && $0.is$TypeDefinition());
18481 if ($notnull_bool(this.isClass)) { 18441 if ($notnull_bool(this.isClass)) {
18482 if ($notnull_bool(typeDef.extendsTypes != null && typeDef.extendsTypes.len gth > 0)) { 18442 if ($notnull_bool(this.definition.extendsTypes != null && this.definition. extendsTypes.length > 0)) {
18483 if ($notnull_bool(typeDef.extendsTypes.length > 1)) { 18443 if ($notnull_bool(this.definition.extendsTypes.length > 1)) {
18484 world.error('more than one base class', typeDef.extendsTypes.$index(1) .get$span()); 18444 world.error('more than one base class', this.definition.extendsTypes.$ index(1).get$span());
18485 } 18445 }
18486 var extendsTypeRef = typeDef.extendsTypes.$index(0); 18446 var extendsTypeRef = this.definition.extendsTypes.$index(0);
18487 if ($notnull_bool((extendsTypeRef instanceof GenericTypeReference))) { 18447 if ($notnull_bool((extendsTypeRef instanceof GenericTypeReference))) {
18488 var g = (extendsTypeRef && extendsTypeRef.is$GenericTypeReference()); 18448 var g = (extendsTypeRef && extendsTypeRef.is$GenericTypeReference());
18489 this.parent = this.resolveType(g.baseType, true); 18449 this.parent = this.resolveType(g.baseType, true);
18490 } 18450 }
18491 this.parent = this.resolveType((extendsTypeRef && extendsTypeRef.is$Type Reference()), true); 18451 this.parent = this.resolveType((extendsTypeRef && extendsTypeRef.is$Type Reference()), true);
18492 if ($notnull_bool(!$notnull_bool(this.parent.get$isClass()))) { 18452 if ($notnull_bool(!$notnull_bool(this.parent.get$isClass()))) {
18493 world.error('class may not extend an interface - use implements', type Def.extendsTypes.$index(0).get$span()); 18453 world.error('class may not extend an interface - use implements', this .definition.extendsTypes.$index(0).get$span());
18494 } 18454 }
18495 this.parent.addDirectSubtype(this); 18455 this.parent.addDirectSubtype(this);
18496 if ($notnull_bool(this._cycleInClassExtends())) { 18456 if ($notnull_bool(this._cycleInClassExtends())) {
18497 world.error(('class "' + this.name + '" has a cycle in its inheritance chain'), extendsTypeRef.get$span()); 18457 world.error(('class "' + this.name + '" has a cycle in its inheritance chain'), extendsTypeRef.get$span());
18498 } 18458 }
18499 } 18459 }
18500 else { 18460 else {
18501 if ($notnull_bool(!$notnull_bool(this.get$isObject()))) { 18461 if ($notnull_bool(!$notnull_bool(this.get$isObject()))) {
18502 this.parent = world.objectType; 18462 this.parent = world.objectType;
18503 } 18463 }
18504 } 18464 }
18505 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes); 18465 this.interfaces = this._resolveInterfaces(this.definition.implementsTypes) ;
18506 if ($notnull_bool(typeDef.factoryType != null)) { 18466 if ($notnull_bool(this.definition.factoryType != null)) {
18507 world.error('factory not allowed on classes', typeDef.factoryType.span); 18467 world.error('factory not allowed on classes', this.definition.factoryTyp e.span);
18508 } 18468 }
18509 } 18469 }
18510 else { 18470 else {
18511 if ($notnull_bool(typeDef.implementsTypes != null && typeDef.implementsTyp es.length > 0)) { 18471 if ($notnull_bool(this.definition.implementsTypes != null && this.definiti on.implementsTypes.length > 0)) {
18512 world.error('implements not allowed on interfaces (use extends)', typeDe f.implementsTypes.$index(0).get$span()); 18472 world.error('implements not allowed on interfaces (use extends)', this.d efinition.implementsTypes.$index(0).get$span());
18513 } 18473 }
18514 this.interfaces = this._resolveInterfaces(typeDef.extendsTypes); 18474 this.interfaces = this._resolveInterfaces(this.definition.extendsTypes);
18515 var res = this._cycleInInterfaceExtends(); 18475 var res = this._cycleInInterfaceExtends();
18516 if ($notnull_bool(res >= 0)) { 18476 if ($notnull_bool(res >= 0)) {
18517 world.error(('interface "' + this.name + '" has a cycle in its inheritan ce chain'), typeDef.extendsTypes.$index(res).get$span()); 18477 world.error(('interface "' + this.name + '" has a cycle in its inheritan ce chain'), this.definition.extendsTypes.$index(res).get$span());
18518 } 18478 }
18519 if ($notnull_bool(typeDef.factoryType != null)) { 18479 if ($notnull_bool(this.definition.factoryType != null)) {
18520 this.factory_ = this.resolveType(typeDef.factoryType, true); 18480 this.factory_ = this.resolveType(this.definition.factoryType, true);
18521 if ($notnull_bool(this.factory_ == null)) { 18481 if ($notnull_bool(this.factory_ == null)) {
18522 world.warning('unresolved factory', typeDef.factoryType.span); 18482 world.info(('unresolved factory: ' + this.definition.factoryType.get$n ame().get$name() + ''), this.definition.factoryType.get$name().get$span());
18523 } 18483 }
18524 } 18484 }
18525 } 18485 }
18526 } 18486 }
18527 else if ($notnull_bool((this.definition instanceof FunctionTypeDefinition))) { 18487 else if ($notnull_bool((this.definition instanceof FunctionTypeDefinition))) {
18528 this.interfaces = [world.functionType]; 18488 this.interfaces = [world.functionType];
18529 } 18489 }
18530 if ($notnull_bool(this.typeParameters != null)) { 18490 if ($notnull_bool(this.typeParameters != null)) {
18531 var $list = this.typeParameters; 18491 var $list = this.typeParameters;
18532 for (var $i = 0;$i < $list.length; $i++) { 18492 for (var $i = 0;$i < $list.length; $i++) {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
18634 if ($notnull_bool(this.factory_ != null)) { 18594 if ($notnull_bool(this.factory_ != null)) {
18635 return this.factory_.getFactory(this, constructorName); 18595 return this.factory_.getFactory(this, constructorName);
18636 } 18596 }
18637 return ret; 18597 return ret;
18638 } 18598 }
18639 ret = this.factories.getFactory(this.name, constructorName); 18599 ret = this.factories.getFactory(this.name, constructorName);
18640 if ($notnull_bool($ne(ret, null))) return ret; 18600 if ($notnull_bool($ne(ret, null))) return ret;
18641 return this._tryCreateDefaultConstructor(constructorName); 18601 return this._tryCreateDefaultConstructor(constructorName);
18642 } 18602 }
18643 DefinedType.prototype._tryCreateDefaultConstructor = function(name) { 18603 DefinedType.prototype._tryCreateDefaultConstructor = function(name) {
18644 var $0;
18645 if ($notnull_bool(name == '' && this.definition != null && this.isClass && thi s.constructors.get$length() == 0)) { 18604 if ($notnull_bool(name == '' && this.definition != null && this.isClass && thi s.constructors.get$length() == 0)) {
18646 var span = this.definition.span; 18605 var span = this.definition.span;
18647 var inits = null, body = null; 18606 var inits = null, body = null;
18648 if ($notnull_bool(this.isNativeType)) { 18607 if ($notnull_bool(this.isNativeType)) {
18649 body = new NativeStatement(null, (span && span.is$SourceSpan())); 18608 body = new NativeStatement(null, (span && span.is$SourceSpan()));
18650 inits = null; 18609 inits = null;
18651 } 18610 }
18652 else { 18611 else {
18653 body = null; 18612 body = null;
18654 inits = [new CallExpression(new SuperExpression((span && span.is$SourceSpa n())), [], (span && span.is$SourceSpan()))]; 18613 inits = [new CallExpression(new SuperExpression((span && span.is$SourceSpa n())), [], (span && span.is$SourceSpan()))];
18655 } 18614 }
18656 var typeDef = (($0 = this.definition) && $0.is$TypeDefinition()); 18615 var c = new FunctionDefinition(null, null, this.definition.get$name(), [], i nits, body, (span && span.is$SourceSpan()));
18657 var c = new FunctionDefinition(null, null, typeDef.name, [], inits, body, (s pan && span.is$SourceSpan()));
18658 this.addMethod(null, (c && c.is$FunctionDefinition())); 18616 this.addMethod(null, (c && c.is$FunctionDefinition()));
18659 this.constructors.$index('').resolve(this); 18617 this.constructors.$index('').resolve(this);
18660 return this.constructors.$index(''); 18618 return this.constructors.$index('');
18661 } 18619 }
18662 return null; 18620 return null;
18663 } 18621 }
18664 DefinedType.prototype.getMember = function(memberName) { 18622 DefinedType.prototype.getMember = function(memberName) {
18665 var $0; 18623 var $0;
18666 var member = (($0 = this.members.$index(memberName)) && $0.is$Member()); 18624 var member = (($0 = this.members.$index(memberName)) && $0.is$Member());
18667 if ($notnull_bool(member != null)) { 18625 if ($notnull_bool(member != null)) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
18727 } 18685 }
18728 else { 18686 else {
18729 var $list = this.get$subtypes(); 18687 var $list = this.get$subtypes();
18730 for (var $i = this.get$subtypes().iterator(); $i.hasNext(); ) { 18688 for (var $i = this.get$subtypes().iterator(); $i.hasNext(); ) {
18731 var t = $i.next(); 18689 var t = $i.next();
18732 var m; 18690 var m;
18733 if ($notnull_bool(!$notnull_bool(this.isClass) && t.get$isClass())) { 18691 if ($notnull_bool(!$notnull_bool(this.isClass) && t.get$isClass())) {
18734 m = t.getMember(memberName); 18692 m = t.getMember(memberName);
18735 } 18693 }
18736 else { 18694 else {
18737 m = t.get$members().$index(memberName); 18695 m = t.members.$index(memberName);
18738 } 18696 }
18739 if ($notnull_bool($ne(m, null))) ret.add((m && m.is$Member())); 18697 if ($notnull_bool($ne(m, null))) ret.add((m && m.is$Member()));
18740 } 18698 }
18741 return ret; 18699 return ret;
18742 } 18700 }
18743 } 18701 }
18744 DefinedType.prototype._createNotEqualMember = function() { 18702 DefinedType.prototype._createNotEqualMember = function() {
18745 var $0; 18703 var $0;
18746 var eq = (($0 = this.members.$index('\$eq')) && $0.is$MethodMember()); 18704 var eq = (($0 = this.members.$index('\$eq')) && $0.is$MethodMember());
18747 if ($notnull_bool(eq == null)) { 18705 if ($notnull_bool(eq == null)) {
(...skipping 17 matching lines...) Expand all
18765 } 18723 }
18766 else { 18724 else {
18767 return type.name.name; 18725 return type.name.name;
18768 } 18726 }
18769 } 18727 }
18770 DefinedType.prototype.resolveType = function(node, typeErrors) { 18728 DefinedType.prototype.resolveType = function(node, typeErrors) {
18771 var $0; 18729 var $0;
18772 if ($notnull_bool(node == null)) return world.varType; 18730 if ($notnull_bool(node == null)) return world.varType;
18773 if ($notnull_bool(node.type != null)) return node.type; 18731 if ($notnull_bool(node.type != null)) return node.type;
18774 if ($notnull_bool((node instanceof NameTypeReference))) { 18732 if ($notnull_bool((node instanceof NameTypeReference))) {
18775 var typeRef = (node && node.is$NameTypeReference());
18776 var name; 18733 var name;
18777 if ($notnull_bool(typeRef.names != null)) { 18734 if ($notnull_bool(node.names != null)) {
18778 name = $assert_String(typeRef.names.last().get$name()); 18735 name = $assert_String(node.names.last().get$name());
18779 } 18736 }
18780 else { 18737 else {
18781 name = typeRef.name.name; 18738 name = $assert_String(node.get$name().get$name());
18782 } 18739 }
18783 if ($notnull_bool(this.typeParameters != null)) { 18740 if ($notnull_bool(this.typeParameters != null)) {
18784 var $list = this.typeParameters; 18741 var $list = this.typeParameters;
18785 for (var $i = 0;$i < $list.length; $i++) { 18742 for (var $i = 0;$i < $list.length; $i++) {
18786 var tp = $list.$index($i); 18743 var tp = $list.$index($i);
18787 if ($notnull_bool($eq(tp.get$name(), name))) { 18744 if ($notnull_bool($eq(tp.get$name(), name))) {
18788 typeRef.type = (tp && tp.is$lang_Type()); 18745 node.type = (tp && tp.is$lang_Type());
18789 } 18746 }
18790 } 18747 }
18791 } 18748 }
18792 if ($notnull_bool(typeRef.type == null)) { 18749 if ($notnull_bool(node.type == null)) {
18793 typeRef.type = this.library.findType(typeRef); 18750 node.type = this.library.findType((node && node.is$NameTypeReference()));
18794 } 18751 }
18795 if ($notnull_bool(typeRef.type == null)) { 18752 if ($notnull_bool(node.type == null)) {
18796 var message = ('can not find type ' + DefinedType._getDottedName(typeRef) + ''); 18753 var message = ('can not find type ' + DefinedType._getDottedName((node && node.is$NameTypeReference())) + '');
18797 if ($notnull_bool(typeErrors)) { 18754 if ($notnull_bool(typeErrors)) {
18798 world.error($assert_String(message), typeRef.span); 18755 world.error($assert_String(message), node.span);
18799 typeRef.type = world.objectType; 18756 node.type = world.objectType;
18800 } 18757 }
18801 else { 18758 else {
18802 world.warning($assert_String(message), typeRef.span); 18759 world.warning($assert_String(message), node.span);
18803 typeRef.type = world.varType; 18760 node.type = world.varType;
18804 } 18761 }
18805 } 18762 }
18806 } 18763 }
18807 else if ($notnull_bool((node instanceof GenericTypeReference))) { 18764 else if ($notnull_bool((node instanceof GenericTypeReference))) {
18808 var typeRef = (node && node.is$GenericTypeReference()); 18765 var baseType = this.resolveType(node.baseType, typeErrors);
18809 var baseType = this.resolveType(typeRef.baseType, typeErrors);
18810 if ($notnull_bool(!$notnull_bool(baseType.get$isGeneric()))) { 18766 if ($notnull_bool(!$notnull_bool(baseType.get$isGeneric()))) {
18811 world.error(('' + baseType.get$name() + ' is not generic'), typeRef.span); 18767 world.error(('' + baseType.get$name() + ' is not generic'), node.span);
18812 return null; 18768 return null;
18813 } 18769 }
18814 if ($notnull_bool(typeRef.typeArguments.length != baseType.get$typeParameter s().length)) { 18770 if ($notnull_bool(node.typeArguments.length != baseType.get$typeParameters() .length)) {
18815 world.error('wrong number of type arguments', typeRef.span); 18771 world.error('wrong number of type arguments', node.span);
18816 return null; 18772 return null;
18817 } 18773 }
18818 var typeArgs = []; 18774 var typeArgs = [];
18819 for (var i = 0; 18775 for (var i = 0;
18820 $notnull_bool(i < typeRef.typeArguments.length); i++) { 18776 $notnull_bool(i < node.typeArguments.length); i++) {
18821 var extendsType = baseType.get$typeParameters().$index(i).extendsType; 18777 var extendsType = baseType.get$typeParameters().$index(i).extendsType;
18822 var typeArg = this.resolveType((($0 = typeRef.typeArguments.$index(i)) && $0.is$TypeReference()), typeErrors); 18778 var typeArg = this.resolveType((($0 = node.typeArguments.$index(i)) && $0. is$TypeReference()), typeErrors);
18823 typeArgs.add(typeArg); 18779 typeArgs.add(typeArg);
18824 if ($notnull_bool($ne(extendsType, null) && !(typeArg instanceof Parameter Type))) { 18780 if ($notnull_bool($ne(extendsType, null) && !(typeArg instanceof Parameter Type))) {
18825 typeArg.ensureSubtypeOf((extendsType && extendsType.is$lang_Type()), typ eRef.typeArguments.$index(i).get$span(), typeErrors); 18781 typeArg.ensureSubtypeOf((extendsType && extendsType.is$lang_Type()), nod e.typeArguments.$index(i).get$span(), typeErrors);
18826 } 18782 }
18827 } 18783 }
18828 typeRef.type = baseType.getOrMakeConcreteType(typeArgs); 18784 node.type = baseType.getOrMakeConcreteType(typeArgs);
18829 } 18785 }
18830 else if ($notnull_bool((node instanceof FunctionTypeReference))) { 18786 else if ($notnull_bool((node instanceof FunctionTypeReference))) {
18831 var typeRef = (node && node.is$FunctionTypeReference());
18832 var name = ''; 18787 var name = '';
18833 if ($notnull_bool(typeRef.func.name != null)) name = typeRef.func.name.name; 18788 if ($notnull_bool(node.func.name != null)) name = node.func.name.name;
18834 typeRef.type = this.library.getOrAddFunctionType($assert_String(name), typeR ef.func, this); 18789 node.type = this.library.getOrAddFunctionType($assert_String(name), node.fun c, this);
18835 } 18790 }
18836 else { 18791 else {
18837 world.internalError('unknown type reference', node.span); 18792 world.internalError('unknown type reference', node.span);
18838 } 18793 }
18839 return node.type; 18794 return node.type;
18840 } 18795 }
18841 DefinedType.prototype.resolveTypeParams = function(inType) { 18796 DefinedType.prototype.resolveTypeParams = function(inType) {
18842 return this; 18797 return this;
18843 } 18798 }
18844 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { 18799 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) {
18845 $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1156, 12); 18800 $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1135, 12);
18846 var names = [this.name]; 18801 var names = [this.name];
18847 var typeMap = $map([]); 18802 var typeMap = $map([]);
18848 for (var i = 0; 18803 for (var i = 0;
18849 $notnull_bool(i < typeArgs.length); i++) { 18804 $notnull_bool(i < typeArgs.length); i++) {
18850 var paramName = this.typeParameters.$index(i).get$name(); 18805 var paramName = this.typeParameters.$index(i).get$name();
18851 typeMap.$setindex(paramName, typeArgs.$index(i)); 18806 typeMap.$setindex(paramName, typeArgs.$index(i));
18852 names.add(typeArgs.$index(i).get$name()); 18807 names.add(typeArgs.$index(i).get$name());
18853 } 18808 }
18854 var concreteName = Strings.join((names && names.is$List$String()), '\$'); 18809 var concreteName = Strings.join((names && names.is$List$String()), '\$');
18855 var ret = this._concreteTypes.$index(concreteName); 18810 var ret = this._concreteTypes.$index(concreteName);
18856 if ($notnull_bool(ret == null)) { 18811 if ($notnull_bool(ret == null)) {
18857 ret = new ConcreteType($assert_String(concreteName), this, typeMap, typeArgs ); 18812 ret = new ConcreteType($assert_String(concreteName), this, typeMap, typeArgs );
18858 this._concreteTypes.$setindex(concreteName, ret); 18813 this._concreteTypes.$setindex(concreteName, ret);
18859 } 18814 }
18860 return ret; 18815 return ret;
18861 } 18816 }
18862 DefinedType.prototype.getCallStub = function(args) { 18817 DefinedType.prototype.getCallStub = function(args) {
18863 $assert(this.get$isFunction(), "isFunction", "type.dart", 1176, 12); 18818 $assert(this.get$isFunction(), "isFunction", "type.dart", 1155, 12);
18864 var name = _getCallStubName('call', args); 18819 var name = _getCallStubName('call', args);
18865 if ($notnull_bool(this.varStubs == null)) this.varStubs = $map([]); 18820 if ($notnull_bool(this.varStubs == null)) this.varStubs = $map([]);
18866 var stub = this.varStubs.$index(name); 18821 var stub = this.varStubs.$index(name);
18867 if ($notnull_bool(stub == null)) { 18822 if ($notnull_bool(stub == null)) {
18868 stub = new VarFunctionStub($assert_String(name), args); 18823 stub = new VarFunctionStub($assert_String(name), args);
18869 this.varStubs.$setindex(name, stub); 18824 this.varStubs.$setindex(name, stub);
18870 } 18825 }
18871 return stub; 18826 return stub;
18872 } 18827 }
18873 // ********** Code for FixedCollection ************** 18828 // ********** Code for FixedCollection **************
(...skipping 12 matching lines...) Expand all
18886 } 18841 }
18887 FixedCollection.prototype.filter = function(f) { 18842 FixedCollection.prototype.filter = function(f) {
18888 return Collections.filter(this, new ListFactory$E(), f); 18843 return Collections.filter(this, new ListFactory$E(), f);
18889 } 18844 }
18890 FixedCollection.prototype.some = function(f) { 18845 FixedCollection.prototype.some = function(f) {
18891 return Collections.some(this, f); 18846 return Collections.some(this, f);
18892 } 18847 }
18893 FixedCollection.prototype.isEmpty = function() { 18848 FixedCollection.prototype.isEmpty = function() {
18894 return this.length == 0; 18849 return this.length == 0;
18895 } 18850 }
18851 FixedCollection.prototype.forEach$1 = FixedCollection.prototype.forEach;
18896 // ********** Code for FixedCollection$Type ************** 18852 // ********** Code for FixedCollection$Type **************
18897 function FixedCollection$Type(value, length) { 18853 function FixedCollection$Type(value, length) {
18898 this.value = value; 18854 this.value = value;
18899 this.length = length; 18855 this.length = length;
18900 // Initializers done 18856 // Initializers done
18901 } 18857 }
18902 $inherits(FixedCollection$Type, FixedCollection); 18858 $inherits(FixedCollection$Type, FixedCollection);
18903 FixedCollection$Type.prototype.is$Iterable = function(){return this;}; 18859 FixedCollection$Type.prototype.is$Iterable = function(){return this;};
18904 // ********** Code for FixedIterator ************** 18860 // ********** Code for FixedIterator **************
18905 function FixedIterator(value, length) { 18861 function FixedIterator(value, length) {
(...skipping 26 matching lines...) Expand all
18932 this.needsTemp = needsTemp; 18888 this.needsTemp = needsTemp;
18933 this.isType = isType; 18889 this.isType = isType;
18934 // Initializers done 18890 // Initializers done
18935 if ($notnull_bool(this.type == null)) this.type = world.varType; 18891 if ($notnull_bool(this.type == null)) this.type = world.varType;
18936 } 18892 }
18937 Value.prototype.is$Value = function(){return this;}; 18893 Value.prototype.is$Value = function(){return this;};
18938 Value.prototype.get$isConst = function() { 18894 Value.prototype.get$isConst = function() {
18939 return false; 18895 return false;
18940 } 18896 }
18941 Value.prototype.get_ = function(context, name, node) { 18897 Value.prototype.get_ = function(context, name, node) {
18942 var member = this._resolveMember(context, name, node, false); 18898 var member = this._resolveMember(context, name, node);
18943 if ($notnull_bool($ne(member, null))) { 18899 if ($notnull_bool($ne(member, null))) {
18944 member = member.get_$3(context, node, this); 18900 member = member.get_$3(context, node, this);
18945 } 18901 }
18946 if ($notnull_bool($ne(member, null))) { 18902 if ($notnull_bool($ne(member, null))) {
18947 return member; 18903 return member;
18948 } 18904 }
18949 else { 18905 else {
18950 return this.invokeNoSuchMethod(context, ('get:' + name + ''), node); 18906 return this.invokeNoSuchMethod(context, ('get:' + name + ''), node);
18951 } 18907 }
18952 } 18908 }
18953 Value.prototype.set_ = function(context, name, node, value, isDynamic) { 18909 Value.prototype.set_ = function(context, name, node, value, isDynamic) {
18954 var member = this._resolveMember(context, name, node, isDynamic); 18910 var member = this._resolveMember(context, name, node);
18955 if ($notnull_bool($ne(member, null))) { 18911 if ($notnull_bool($ne(member, null))) {
18956 member = member.set_(context, node, this, value, isDynamic); 18912 member = member.set_(context, node, this, value, isDynamic);
18957 } 18913 }
18958 if ($notnull_bool($ne(member, null))) { 18914 if ($notnull_bool($ne(member, null))) {
18959 return member; 18915 return member;
18960 } 18916 }
18961 else { 18917 else {
18962 return this.invokeNoSuchMethod(context, ('set:' + name + ''), node, new Argu ments(null, [value])); 18918 return this.invokeNoSuchMethod(context, ('set:' + name + ''), node, new Argu ments(null, [value]));
18963 } 18919 }
18964 } 18920 }
18965 Value.prototype.invoke = function(context, name, node, args, isDynamic) { 18921 Value.prototype.invoke = function(context, name, node, args, isDynamic) {
18966 if ($notnull_bool(this.type.get$isVar() && name == '\$ne')) { 18922 if ($notnull_bool(this.type.get$isVar() && name == '\$ne')) {
18967 if ($notnull_bool(args.values.length != 1)) { 18923 if ($notnull_bool(args.values.length != 1)) {
18968 world.warning('wrong number of arguments for !=', node.span); 18924 world.warning('wrong number of arguments for !=', node.span);
18969 } 18925 }
18970 world.gen.corejs.useOperator('\$ne'); 18926 world.gen.corejs.useOperator('\$ne');
18971 return new Value(null, ('\$ne(' + this.code + ', ' + args.values.$index(0).c ode + ')'), false, true, false); 18927 return new Value(null, ('\$ne(' + this.code + ', ' + args.values.$index(0).c ode + ')'), false, true, false);
18972 } 18928 }
18973 if ($notnull_bool(name == '\$call')) { 18929 if ($notnull_bool(name == '\$call')) {
18974 if ($notnull_bool(this.isType)) { 18930 if ($notnull_bool(this.isType)) {
18975 world.error('must use "new" or "const" to construct a new instance', node. span); 18931 world.error('must use "new" or "const" to construct a new instance', node. span);
18976 } 18932 }
18977 if ($notnull_bool(this.type.needsVarCall(args))) { 18933 if ($notnull_bool(this.type.needsVarCall(args))) {
18978 return this._varCall(context, args); 18934 return this._varCall(context, args);
18979 } 18935 }
18980 } 18936 }
18981 var member = this._resolveMember(context, name, node, isDynamic); 18937 var member = this._resolveMember(context, name, node);
18982 if ($notnull_bool(member == null)) { 18938 if ($notnull_bool(member == null)) {
18983 return this.invokeNoSuchMethod(context, name, node, args); 18939 return this.invokeNoSuchMethod(context, name, node, args);
18984 } 18940 }
18985 else { 18941 else {
18986 return member.invoke(context, node, this, args, isDynamic); 18942 return member.invoke(context, node, this, args, isDynamic);
18987 } 18943 }
18988 } 18944 }
18989 Value.prototype.canInvoke = function(context, name, args) { 18945 Value.prototype.canInvoke = function(context, name, args) {
18990 if ($notnull_bool(this.type.get$isVar() && name == '\$ne')) { 18946 if ($notnull_bool(this.type.get$isVar() && name == '\$ne')) {
18991 return true; 18947 return true;
18992 } 18948 }
18993 if ($notnull_bool(this.type.get$isVarOrFunction() && name == '\$call')) { 18949 if ($notnull_bool(this.type.get$isVarOrFunction() && name == '\$call')) {
18994 return true; 18950 return true;
18995 } 18951 }
18996 var member = this._resolveMember(context, name, null, true); 18952 var member = this._tryResolveMember(context, name);
18997 return $ne(member, null) && member.canInvoke(context, args); 18953 return $ne(member, null) && member.canInvoke(context, args);
18998 } 18954 }
18999 Value.prototype._hasOverriddenNoSuchMethod = function() { 18955 Value.prototype._tryResolveMember = function(context, name) {
19000 if ($notnull_bool(this.isSuper)) { 18956 var member = null;
19001 var m = this.type.getMember('noSuchMethod'); 18957 if ($notnull_bool(!$notnull_bool(this.type.get$isVar()))) {
19002 return $ne(m, null) && !$notnull_bool(m.declaringType.get$isObject());
19003 }
19004 else {
19005 return this.type.resolveMember('noSuchMethod').members.length > 1;
19006 }
19007 }
19008 Value.prototype._resolveMember = function(context, name, node, isDynamic) {
19009 var member;
19010 if ($notnull_bool(!$notnull_bool(this.type.get$isVar()) && !(this.type instanc eof ParameterType))) {
19011 if ($notnull_bool(this.isSuper)) { 18958 if ($notnull_bool(this.isSuper)) {
19012 member = this.type.getMember(name); 18959 return this.type.getMember(name);
19013 } 18960 }
19014 else { 18961 else {
19015 member = this.type.resolveMember(name); 18962 member = this.type.resolveMember(name);
19016 } 18963 }
19017 if ($notnull_bool($ne(member, null) && this.isType && !$notnull_bool(member. get$isStatic()))) {
19018 if ($notnull_bool(!$notnull_bool(isDynamic))) {
19019 world.error('can not refer to instance member as static', node.span);
19020 }
19021 return null;
19022 }
19023 if ($notnull_bool(member == null && !$notnull_bool(isDynamic) && !$notnull_b ool(this._hasOverriddenNoSuchMethod()))) {
19024 var typeName = $notnull_bool(this.type.name == null) ? this.type.get$libra ry().name : this.type.name;
19025 var message = ('can not resolve "' + name + '" on "' + typeName + '"');
19026 if ($notnull_bool(this.isType)) {
19027 world.error($assert_String(message), node.span);
19028 }
19029 else {
19030 world.warning($assert_String(message), node.span);
19031 }
19032 }
19033 } 18964 }
19034 if ($notnull_bool(member == null && !$notnull_bool(this.isSuper) && !$notnull_ bool(this.isType))) { 18965 if ($notnull_bool(member == null)) {
19035 member = context.findMembers(name); 18966 member = context.findMembers(name);
19036 if ($notnull_bool(member == null && !$notnull_bool(isDynamic))) {
19037 world.warning(('' + name + ' is not defined anywhere in the world.'), node .span);
19038 }
19039 } 18967 }
19040 return member; 18968 return member;
19041 } 18969 }
18970 Value.prototype._resolveMember = function(context, name, node) {
18971 var member = this._tryResolveMember(context, name);
18972 if ($notnull_bool($ne(member, null))) {
18973 if ($notnull_bool(this.isType && !$notnull_bool(member.get$isStatic()))) {
18974 world.error('can not refer to instance member as static', node.span);
18975 }
18976 return member;
18977 }
18978 else {
18979 if ($notnull_bool(this._tryResolveMember(context, 'noSuchMethod').members.le ngth > 1)) {
18980 return null;
18981 }
18982 var typeName = $notnull_bool(this.type.name == null) ? this.type.get$library ().name : this.type.name;
18983 var message = ('can not resolve "' + name + '" on "' + typeName + '"');
18984 if ($notnull_bool(this.isType)) {
18985 world.error($assert_String(message), node.span);
18986 }
18987 else {
18988 world.warning($assert_String(message), node.span);
18989 }
18990 if ($notnull_bool(context.findMembers(name) == null)) {
18991 world.warning(('' + name + ' is not defined anywhere in the world.'), node .span);
18992 }
18993 return null;
18994 }
18995 }
19042 Value.prototype.checkFirstClass = function(span) { 18996 Value.prototype.checkFirstClass = function(span) {
19043 if ($notnull_bool(this.isType)) { 18997 if ($notnull_bool(this.isType)) {
19044 world.error('Types are not first class', span); 18998 world.error('Types are not first class', span);
19045 } 18999 }
19046 } 19000 }
19047 Value.prototype._varCall = function(context, args) { 19001 Value.prototype._varCall = function(context, args) {
19048 var stub = world.functionType.getCallStub(args); 19002 var stub = world.functionType.getCallStub(args);
19049 return new Value(null, ('' + this.code + '.' + stub.get$name() + '(' + args.ge tCode() + ')'), false, true, false); 19003 return new Value(null, ('' + this.code + '.' + stub.get$name() + '(' + args.ge tCode() + ')'), false, true, false);
19050 } 19004 }
19051 Value.prototype.needsConversion = function(toType) { 19005 Value.prototype.needsConversion = function(toType) {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
19195 var pos = ''; 19149 var pos = '';
19196 if ($notnull_bool(args != null)) { 19150 if ($notnull_bool(args != null)) {
19197 var argsCode = []; 19151 var argsCode = [];
19198 for (var i = 0; 19152 for (var i = 0;
19199 $notnull_bool(i < args.get$length()); i++) { 19153 $notnull_bool(i < args.get$length()); i++) {
19200 argsCode.add(args.values.$index(i).code); 19154 argsCode.add(args.values.$index(i).code);
19201 } 19155 }
19202 pos = Strings.join((argsCode && argsCode.is$List$String()), ", "); 19156 pos = Strings.join((argsCode && argsCode.is$List$String()), ", ");
19203 } 19157 }
19204 var noSuchArgs = [new Value(world.stringType, ('"' + name + '"'), false, true, false), new Value(world.listType, ('[' + pos + ']'), false, true, false)]; 19158 var noSuchArgs = [new Value(world.stringType, ('"' + name + '"'), false, true, false), new Value(world.listType, ('[' + pos + ']'), false, true, false)];
19205 return this._resolveMember(context, 'noSuchMethod', node, false).invoke$4(cont ext, node, this, new Arguments(null, noSuchArgs)); 19159 return this._tryResolveMember(context, 'noSuchMethod').invoke$4(context, node, this, new Arguments(null, noSuchArgs));
19206 } 19160 }
19207 Value.prototype.invokeSpecial = function(name, args, returnType) { 19161 Value.prototype.invokeSpecial = function(name, args, returnType) {
19208 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 443, 12 ); 19162 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 432, 12 );
19209 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4 44, 12); 19163 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4 33, 12);
19210 var argsString = args.getCode(); 19164 var argsString = args.getCode();
19211 if ($notnull_bool(name == '\$index' || name == '\$setindex')) { 19165 if ($notnull_bool(name == '\$index' || name == '\$setindex')) {
19212 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString + ')'), false, true, false); 19166 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString + ')'), false, true, false);
19213 } 19167 }
19214 else { 19168 else {
19215 if ($notnull_bool(argsString.length > 0)) argsString = (', ' + argsString + ''); 19169 if ($notnull_bool(argsString.length > 0)) argsString = (', ' + argsString + '');
19216 world.gen.corejs.useOperator(name); 19170 world.gen.corejs.useOperator(name);
19217 return new Value(returnType, ('' + name + '(' + this.code + '' + argsString + ')'), false, true, false); 19171 return new Value(returnType, ('' + name + '(' + this.code + '' + argsString + ')'), false, true, false);
19218 } 19172 }
19219 } 19173 }
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
19404 World.prototype.get$dom = function() { 19358 World.prototype.get$dom = function() {
19405 return this.libraries.$index('dart:dom'); 19359 return this.libraries.$index('dart:dom');
19406 } 19360 }
19407 World.prototype.get$functionType = function() { return this.functionType; }; 19361 World.prototype.get$functionType = function() { return this.functionType; };
19408 World.prototype.set$functionType = function(value) { return this.functionType = value; }; 19362 World.prototype.set$functionType = function(value) { return this.functionType = value; };
19409 World.prototype.init = function() { 19363 World.prototype.init = function() {
19410 var $0; 19364 var $0;
19411 this.corelib = new Library(this.readFile('dart:core')); 19365 this.corelib = new Library(this.readFile('dart:core'));
19412 this.libraries.$setindex('dart:core', this.corelib); 19366 this.libraries.$setindex('dart:core', this.corelib);
19413 this._todo.add(this.corelib); 19367 this._todo.add(this.corelib);
19414 this.voidType = (($0 = this._addToCoreLib('void', false)) && $0.is$DefinedType ()); 19368 this.voidType = (($0 = this._addToCoreLib('void', false)) && $0.is$lang_Type() );
19415 this.dynamicType = (($0 = this._addToCoreLib('Dynamic', false)) && $0.is$Defin edType()); 19369 this.dynamicType = (($0 = this._addToCoreLib('Dynamic', false)) && $0.is$lang_ Type());
19416 this.varType = this.dynamicType; 19370 this.varType = this.dynamicType;
19417 this.objectType = (($0 = this._addToCoreLib('Object', true)) && $0.is$DefinedT ype()); 19371 this.objectType = (($0 = this._addToCoreLib('Object', true)) && $0.is$lang_Typ e());
19418 this.numType = (($0 = this._addToCoreLib('num', false)) && $0.is$DefinedType() ); 19372 this.numType = (($0 = this._addToCoreLib('num', false)) && $0.is$lang_Type());
19419 this.intType = (($0 = this._addToCoreLib('int', false)) && $0.is$DefinedType() ); 19373 this.intType = (($0 = this._addToCoreLib('int', false)) && $0.is$lang_Type());
19420 this.doubleType = (($0 = this._addToCoreLib('double', false)) && $0.is$Defined Type()); 19374 this.doubleType = (($0 = this._addToCoreLib('double', false)) && $0.is$lang_Ty pe());
19421 this.boolType = (($0 = this._addToCoreLib('bool', false)) && $0.is$DefinedType ()); 19375 this.boolType = (($0 = this._addToCoreLib('bool', false)) && $0.is$lang_Type() );
19422 this.stringType = (($0 = this._addToCoreLib('String', false)) && $0.is$Defined Type()); 19376 this.stringType = (($0 = this._addToCoreLib('String', false)) && $0.is$lang_Ty pe());
19423 this.listType = (($0 = this._addToCoreLib('List', false)) && $0.is$DefinedType ()); 19377 this.listType = (($0 = this._addToCoreLib('List', false)) && $0.is$lang_Type() );
19424 this.mapType = (($0 = this._addToCoreLib('Map', false)) && $0.is$DefinedType() ); 19378 this.mapType = (($0 = this._addToCoreLib('Map', false)) && $0.is$lang_Type());
19425 this.functionType = (($0 = this._addToCoreLib('Function', false)) && $0.is$Def inedType()); 19379 this.functionType = (($0 = this._addToCoreLib('Function', false)) && $0.is$lan g_Type());
19426 } 19380 }
19427 World.prototype._addMember = function(member) { 19381 World.prototype._addMember = function(member) {
19428 $assert(!$notnull_bool(member.get$isPrivate()), "!member.isPrivate", "world.da rt", 141, 12); 19382 $assert(!$notnull_bool(member.get$isPrivate()), "!member.isPrivate", "world.da rt", 141, 12);
19429 if ($notnull_bool(member.get$isStatic())) { 19383 if ($notnull_bool(member.get$isStatic())) {
19430 if ($notnull_bool(member.declaringType.get$isTop())) { 19384 if ($notnull_bool(member.declaringType.get$isTop())) {
19431 this._addTopName(member); 19385 this._addTopName(member);
19432 } 19386 }
19433 return; 19387 return;
19434 } 19388 }
19435 var mset = this._members.$index(member.name); 19389 var mset = this._members.$index(member.name);
19436 if ($notnull_bool(mset == null)) { 19390 if ($notnull_bool(mset == null)) {
19437 mset = new MemberSet(member); 19391 mset = new MemberSet(member);
19438 this._members.$setindex(mset.get$name(), mset); 19392 this._members.$setindex(mset.get$name(), mset);
19439 } 19393 }
19440 else { 19394 else {
19441 mset.get$members().add(member); 19395 mset.members.add(member);
19442 } 19396 }
19443 } 19397 }
19444 World.prototype._addTopName = function(named) { 19398 World.prototype._addTopName = function(named) {
19445 var existing = this._topNames.$index(named.get$name()); 19399 var existing = this._topNames.$index(named.get$name());
19446 if ($notnull_bool($ne(existing, null))) { 19400 if ($notnull_bool($ne(existing, null))) {
19447 this.info(('mangling matching top level name "' + named.get$name() + '" in ' ) + ('both "' + named.get$library().name + '" and "' + existing.get$library().na me + '"')); 19401 this.info(('mangling matching top level name "' + named.get$name() + '" in ' ) + ('both "' + named.get$library().name + '" and "' + existing.get$library().na me + '"'));
19448 if ($notnull_bool(named.get$isNative())) { 19402 if ($notnull_bool(named.get$isNative())) {
19449 if ($notnull_bool(existing.get$isNative())) { 19403 if ($notnull_bool(existing.get$isNative())) {
19450 world.internalError(('conflicting native names "' + named.get$name() + ' " ') + ('(already defined in ' + existing.get$span().get$locationText() + ')'), named.get$span()); 19404 world.internalError(('conflicting native names "' + named.get$name() + ' " ') + ('(already defined in ' + existing.get$span().get$locationText() + ')'), named.get$span());
19451 } 19405 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
19536 }) 19490 })
19537 ); 19491 );
19538 this.withTiming('resolve top level', (function () { 19492 this.withTiming('resolve top level', (function () {
19539 $this.resolveAll(); 19493 $this.resolveAll();
19540 }) 19494 })
19541 ); 19495 );
19542 this.withTiming('generate code', (function () { 19496 this.withTiming('generate code', (function () {
19543 var $0; 19497 var $0;
19544 var mainMembers = lib.topType.resolveMember('main'); 19498 var mainMembers = lib.topType.resolveMember('main');
19545 var main = null; 19499 var main = null;
19546 if ($notnull_bool(mainMembers == null || mainMembers.get$members().length == 0)) { 19500 if ($notnull_bool(mainMembers == null || mainMembers.members.length == 0)) {
19547 $this.fatal('no main method specified'); 19501 $this.fatal('no main method specified');
19548 } 19502 }
19549 else if ($notnull_bool(mainMembers.get$members().length > 1)) { 19503 else if ($notnull_bool(mainMembers.members.length > 1)) {
19550 var $list = mainMembers.get$members(); 19504 var $list = mainMembers.members;
19551 for (var $i = mainMembers.get$members().iterator(); $i.hasNext(); ) { 19505 for (var $i = mainMembers.members.iterator(); $i.hasNext(); ) {
19552 var m = $i.next(); 19506 var m = $i.next();
19553 main = m; 19507 main = m;
19554 $this.error('more than one main member (using last?)', main.get$span()); 19508 $this.error('more than one main member (using last?)', main.get$span());
19555 } 19509 }
19556 } 19510 }
19557 else { 19511 else {
19558 main = mainMembers.get$members().$index(0); 19512 main = mainMembers.members.$index(0);
19559 } 19513 }
19560 var codeWriter = new CodeWriter(); 19514 var codeWriter = new CodeWriter();
19561 $this.gen = new WorldGenerator(main, codeWriter); 19515 $this.gen = new WorldGenerator(main, codeWriter);
19562 $this.gen.run(); 19516 $this.gen.run();
19563 $this.jsBytesWritten = codeWriter.get$text().length; 19517 $this.jsBytesWritten = codeWriter.get$text().length;
19564 }) 19518 })
19565 ); 19519 );
19566 } 19520 }
19567 World.prototype.getGeneratedCode = function() { 19521 World.prototype.getGeneratedCode = function() {
19568 if ($notnull_bool(this.legCode != null)) { 19522 if ($notnull_bool(this.legCode != null)) {
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
19930 } 19884 }
19931 // ********** Code for VarMethodSet ************** 19885 // ********** Code for VarMethodSet **************
19932 function VarMethodSet(name, members, callArgs, returnType) { 19886 function VarMethodSet(name, members, callArgs, returnType) {
19933 this.members = members; 19887 this.members = members;
19934 this.returnType = returnType; 19888 this.returnType = returnType;
19935 this.args = callArgs.toCallStubArgs(); 19889 this.args = callArgs.toCallStubArgs();
19936 VarMember.call(this, name); 19890 VarMember.call(this, name);
19937 // Initializers done 19891 // Initializers done
19938 } 19892 }
19939 $inherits(VarMethodSet, VarMember); 19893 $inherits(VarMethodSet, VarMember);
19940 VarMethodSet.prototype.get$members = function() { return this.members; };
19941 VarMethodSet.prototype.get$returnType = function() { return this.returnType; }; 19894 VarMethodSet.prototype.get$returnType = function() { return this.returnType; };
19942 VarMethodSet.prototype.get$baseName = function() { 19895 VarMethodSet.prototype.get$baseName = function() {
19943 return this.members.$index(0).get$name(); 19896 return this.members.$index(0).get$name();
19944 } 19897 }
19945 VarMethodSet.prototype.invoke = function(context, node, target, args) { 19898 VarMethodSet.prototype.invoke = function(context, node, target, args) {
19946 this._invokeMembers(context, node); 19899 this._invokeMembers(context, node);
19947 return VarMember.prototype.invoke.call(this, context, node, target, args); 19900 return VarMember.prototype.invoke.call(this, context, node, target, args);
19948 } 19901 }
19949 VarMethodSet.prototype._invokeMembers = function(context, node) { 19902 VarMethodSet.prototype._invokeMembers = function(context, node) {
19950 if ($notnull_bool(this._fallbackStubs != null)) return; 19903 if ($notnull_bool(this._fallbackStubs != null)) return;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
20020 if ($notnull_bool(current == null && i.hasNext())) { 19973 if ($notnull_bool(current == null && i.hasNext())) {
20021 current = i.next(); 19974 current = i.next();
20022 } 19975 }
20023 while ($notnull_bool(i.hasNext())) { 19976 while ($notnull_bool(i.hasNext())) {
20024 current = callback.call$2(current, i.next()); 19977 current = callback.call$2(current, i.next());
20025 } 19978 }
20026 return current; 19979 return current;
20027 } 19980 }
20028 function orderValuesByKeys(map) { 19981 function orderValuesByKeys(map) {
20029 var $0; 19982 var $0;
20030 var keys = (($0 = map.getKeys()) && $0.is$List()); 19983 var keys = map.getKeys();
20031 keys.sort((function (x, y) { 19984 keys.sort((function (x, y) {
20032 return x.compareTo(y); 19985 return x.compareTo(y);
20033 }) 19986 })
20034 ); 19987 );
20035 var values = []; 19988 var values = [];
20036 for (var $i = 0;$i < keys.length; $i++) { 19989 for (var $i = keys.iterator(); $i.hasNext(); ) {
20037 var k = keys.$index($i); 19990 var k = $i.next();
20038 values.add(map.$index(k)); 19991 values.add(map.$index(k));
20039 } 19992 }
20040 return values; 19993 return values;
20041 } 19994 }
20042 function isMultilineString(text) { 19995 function isMultilineString(text) {
20043 return text.startsWith('"""') || text.startsWith("'''"); 19996 return text.startsWith('"""') || text.startsWith("'''");
20044 } 19997 }
20045 function isRawMultilineString(text) { 19998 function isRawMultilineString(text) {
20046 return text.startsWith('@"""') || text.startsWith("@'''"); 19999 return text.startsWith('@"""') || text.startsWith("@'''");
20047 } 20000 }
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
20257 INTERFACE, 20210 INTERFACE,
20258 LIBRARY, 20211 LIBRARY,
20259 NATIVE, 20212 NATIVE,
20260 NEGATE, 20213 NEGATE,
20261 OPERATOR, 20214 OPERATOR,
20262 SET, 20215 SET,
20263 SOURCE, 20216 SOURCE,
20264 STATIC, 20217 STATIC,
20265 TYPEDEF ]*/; 20218 TYPEDEF ]*/;
20266 RunEntry(function () {main();}, []); 20219 RunEntry(function () {main();}, []);
OLDNEW
« no previous file with comments | « no previous file | frog/gen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698