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

Side by Side Diff: frog/frogsh

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