| OLD | NEW |
| 1 #!/usr/bin/env node | 1 #!/usr/bin/env node |
| 2 // ********** Library dart:core ************** | 2 // ********** Library dart:core ************** |
| 3 // ********** Natives dart:core ************** | 3 // ********** Natives dart:core ************** |
| 4 /** | 4 /** |
| 5 * Generates a dynamic call stub for a function. | 5 * Generates a dynamic call stub for a function. |
| 6 * Our goal is to create a stub method like this on-the-fly: | 6 * Our goal is to create a stub method like this on-the-fly: |
| 7 * function($0, $1, capture) { this($0, $1, true, capture); } | 7 * function($0, $1, capture) { this($0, $1, true, capture); } |
| 8 * | 8 * |
| 9 * This stub then replaces the dynamic one on Function, with one that is | 9 * This stub then replaces the dynamic one on Function, with one that is |
| 10 * specialized for that particular function, taking into account its default | 10 * specialized for that particular function, taking into account its default |
| (...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 } | 871 } |
| 872 } | 872 } |
| 873 // ********** Library dart:coreimpl ************** | 873 // ********** Library dart:coreimpl ************** |
| 874 // ********** Code for ListFactory ************** | 874 // ********** Code for ListFactory ************** |
| 875 ListFactory = Array; | 875 ListFactory = Array; |
| 876 ListFactory.prototype.is$ListFactory = function(){return this;}; | 876 ListFactory.prototype.is$ListFactory = function(){return this;}; |
| 877 ListFactory.prototype.is$List = function(){return this;}; | 877 ListFactory.prototype.is$List = function(){return this;}; |
| 878 ListFactory.prototype.is$List$ArgumentNode = function(){return this;}; | 878 ListFactory.prototype.is$List$ArgumentNode = function(){return this;}; |
| 879 ListFactory.prototype.is$List$Definition = function(){return this;}; | 879 ListFactory.prototype.is$List$Definition = function(){return this;}; |
| 880 ListFactory.prototype.is$List$EvaluatedValue = function(){return this;}; | 880 ListFactory.prototype.is$List$EvaluatedValue = function(){return this;}; |
| 881 ListFactory.prototype.is$List$GlobalValue = function(){return this;}; |
| 881 ListFactory.prototype.is$List$HInstruction = function(){return this;}; | 882 ListFactory.prototype.is$List$HInstruction = function(){return this;}; |
| 882 ListFactory.prototype.is$List$Member = function(){return this;}; | 883 ListFactory.prototype.is$List$Member = function(){return this;}; |
| 883 ListFactory.prototype.is$List$String = function(){return this;}; | 884 ListFactory.prototype.is$List$String = function(){return this;}; |
| 884 ListFactory.prototype.is$List$Type = function(){return this;}; | 885 ListFactory.prototype.is$List$Type = function(){return this;}; |
| 885 ListFactory.prototype.is$List$Value = function(){return this;}; | 886 ListFactory.prototype.is$List$Value = function(){return this;}; |
| 886 ListFactory.prototype.is$List$int = function(){return this;}; | 887 ListFactory.prototype.is$List$int = function(){return this;}; |
| 887 ListFactory.prototype.is$Collection$E = function(){return this;}; | 888 ListFactory.prototype.is$Collection$E = function(){return this;}; |
| 888 ListFactory.prototype.is$Collection$Object = function(){return this;}; | 889 ListFactory.prototype.is$Collection$Object = function(){return this;}; |
| 889 ListFactory.prototype.is$Collection$Type = function(){return this;}; | 890 ListFactory.prototype.is$Collection$Type = function(){return this;}; |
| 890 ListFactory.prototype.is$Iterable = function(){return this;}; | 891 ListFactory.prototype.is$Iterable = function(){return this;}; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 for (var i = 0; | 1003 for (var i = 0; |
| 1003 i < other.length; i++) { | 1004 i < other.length; i++) { |
| 1004 list._setindex(i, other.$index(i)); | 1005 list._setindex(i, other.$index(i)); |
| 1005 } | 1006 } |
| 1006 return list; | 1007 return list; |
| 1007 } | 1008 } |
| 1008 ImmutableList.prototype.get$length = function() { | 1009 ImmutableList.prototype.get$length = function() { |
| 1009 return this._length; | 1010 return this._length; |
| 1010 } | 1011 } |
| 1011 ImmutableList.prototype.set$length = function(length) { | 1012 ImmutableList.prototype.set$length = function(length) { |
| 1012 $throw(const$12/*const IllegalAccessException()*/); | 1013 $throw(const$14/*const IllegalAccessException()*/); |
| 1013 } | 1014 } |
| 1014 Object.defineProperty(ImmutableList.prototype, "length", { | 1015 Object.defineProperty(ImmutableList.prototype, "length", { |
| 1015 get: ImmutableList.prototype.get$length, | 1016 get: ImmutableList.prototype.get$length, |
| 1016 set: ImmutableList.prototype.set$length | 1017 set: ImmutableList.prototype.set$length |
| 1017 }); | 1018 }); |
| 1018 ImmutableList.prototype._setindex = function(index, value) { | 1019 ImmutableList.prototype._setindex = function(index, value) { |
| 1019 return this[index] = value; | 1020 return this[index] = value; |
| 1020 } | 1021 } |
| 1021 ImmutableList.prototype.$setindex = function(index, value) { | 1022 ImmutableList.prototype.$setindex = function(index, value) { |
| 1022 $throw(const$12/*const IllegalAccessException()*/); | 1023 $throw(const$14/*const IllegalAccessException()*/); |
| 1023 } | 1024 } |
| 1024 ImmutableList.prototype.removeRange = function(start, length) { | 1025 ImmutableList.prototype.removeRange = function(start, length) { |
| 1025 $throw(const$12/*const IllegalAccessException()*/); | 1026 $throw(const$14/*const IllegalAccessException()*/); |
| 1026 } | 1027 } |
| 1027 ImmutableList.prototype.insertRange = function(start, length, initialValue) { | 1028 ImmutableList.prototype.insertRange = function(start, length, initialValue) { |
| 1028 $throw(const$12/*const IllegalAccessException()*/); | 1029 $throw(const$14/*const IllegalAccessException()*/); |
| 1029 } | 1030 } |
| 1030 ImmutableList.prototype.sort = function(compare) { | 1031 ImmutableList.prototype.sort = function(compare) { |
| 1031 $throw(const$12/*const IllegalAccessException()*/); | 1032 $throw(const$14/*const IllegalAccessException()*/); |
| 1032 } | 1033 } |
| 1033 ImmutableList.prototype.add = function(element) { | 1034 ImmutableList.prototype.add = function(element) { |
| 1034 $throw(const$12/*const IllegalAccessException()*/); | 1035 $throw(const$14/*const IllegalAccessException()*/); |
| 1035 } | 1036 } |
| 1036 ImmutableList.prototype.addLast = function(element) { | 1037 ImmutableList.prototype.addLast = function(element) { |
| 1037 $throw(const$12/*const IllegalAccessException()*/); | 1038 $throw(const$14/*const IllegalAccessException()*/); |
| 1038 } | 1039 } |
| 1039 ImmutableList.prototype.addAll = function(elements) { | 1040 ImmutableList.prototype.addAll = function(elements) { |
| 1040 $throw(const$12/*const IllegalAccessException()*/); | 1041 $throw(const$14/*const IllegalAccessException()*/); |
| 1041 } | 1042 } |
| 1042 ImmutableList.prototype.clear = function() { | 1043 ImmutableList.prototype.clear = function() { |
| 1043 $throw(const$12/*const IllegalAccessException()*/); | 1044 $throw(const$14/*const IllegalAccessException()*/); |
| 1044 } | 1045 } |
| 1045 ImmutableList.prototype.removeLast = function() { | 1046 ImmutableList.prototype.removeLast = function() { |
| 1046 $throw(const$12/*const IllegalAccessException()*/); | 1047 $throw(const$14/*const IllegalAccessException()*/); |
| 1047 } | 1048 } |
| 1048 ImmutableList.prototype.add$1 = ImmutableList.prototype.add; | 1049 ImmutableList.prototype.add$1 = ImmutableList.prototype.add; |
| 1049 ImmutableList.prototype.addAll$1 = function($0) { | 1050 ImmutableList.prototype.addAll$1 = function($0) { |
| 1050 return this.addAll(($0 && $0.is$Collection$E())); | 1051 return this.addAll(($0 && $0.is$Collection$E())); |
| 1051 }; | 1052 }; |
| 1052 ImmutableList.prototype.removeLast$0 = function() { | 1053 ImmutableList.prototype.removeLast$0 = function() { |
| 1053 return this.removeLast(); | 1054 return this.removeLast(); |
| 1054 }; | 1055 }; |
| 1055 ImmutableList.prototype.sort$1 = ImmutableList.prototype.sort; | 1056 ImmutableList.prototype.sort$1 = ImmutableList.prototype.sort; |
| 1056 // ********** Code for ImmutableMap ************** | 1057 // ********** Code for ImmutableMap ************** |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1082 ImmutableMap.prototype.getKeys = function() { | 1083 ImmutableMap.prototype.getKeys = function() { |
| 1083 return this._internal.getKeys(); | 1084 return this._internal.getKeys(); |
| 1084 } | 1085 } |
| 1085 ImmutableMap.prototype.getValues = function() { | 1086 ImmutableMap.prototype.getValues = function() { |
| 1086 return this._internal.getValues(); | 1087 return this._internal.getValues(); |
| 1087 } | 1088 } |
| 1088 ImmutableMap.prototype.containsKey = function(key) { | 1089 ImmutableMap.prototype.containsKey = function(key) { |
| 1089 return this._internal.containsKey(key); | 1090 return this._internal.containsKey(key); |
| 1090 } | 1091 } |
| 1091 ImmutableMap.prototype.$setindex = function(key, value) { | 1092 ImmutableMap.prototype.$setindex = function(key, value) { |
| 1092 $throw(const$12/*const IllegalAccessException()*/); | 1093 $throw(const$14/*const IllegalAccessException()*/); |
| 1093 } | 1094 } |
| 1094 ImmutableMap.prototype.forEach$1 = ImmutableMap.prototype.forEach; | 1095 ImmutableMap.prototype.forEach$1 = ImmutableMap.prototype.forEach; |
| 1095 ImmutableMap.prototype.getKeys$0 = function() { | 1096 ImmutableMap.prototype.getKeys$0 = function() { |
| 1096 return this.getKeys(); | 1097 return this.getKeys(); |
| 1097 }; | 1098 }; |
| 1098 ImmutableMap.prototype.isEmpty$0 = function() { | 1099 ImmutableMap.prototype.isEmpty$0 = function() { |
| 1099 return this.isEmpty(); | 1100 return this.isEmpty(); |
| 1100 }; | 1101 }; |
| 1101 // ********** Code for NumImplementation ************** | 1102 // ********** Code for NumImplementation ************** |
| 1102 NumImplementation = Number; | 1103 NumImplementation = Number; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 } | 1166 } |
| 1166 ExceptionImplementation.prototype.toString = function() { | 1167 ExceptionImplementation.prototype.toString = function() { |
| 1167 return (this._msg == null) ? "Exception" : ("Exception: " + this._msg); | 1168 return (this._msg == null) ? "Exception" : ("Exception: " + this._msg); |
| 1168 } | 1169 } |
| 1169 ExceptionImplementation.prototype.toString$0 = function() { | 1170 ExceptionImplementation.prototype.toString$0 = function() { |
| 1170 return this.toString(); | 1171 return this.toString(); |
| 1171 }; | 1172 }; |
| 1172 // ********** Code for HashMapImplementation ************** | 1173 // ********** Code for HashMapImplementation ************** |
| 1173 function HashMapImplementation() { | 1174 function HashMapImplementation() { |
| 1174 // Initializers done | 1175 // Initializers done |
| 1175 if (HashMapImplementation._deletedKey == null) { | |
| 1176 HashMapImplementation._deletedKey = new Object(); | |
| 1177 } | |
| 1178 this._numberOfEntries = 0; | 1176 this._numberOfEntries = 0; |
| 1179 this._numberOfDeleted = 0; | 1177 this._numberOfDeleted = 0; |
| 1180 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); | 1178 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); |
| 1181 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); | 1179 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); |
| 1182 this._values = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); | 1180 this._values = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); |
| 1183 } | 1181 } |
| 1184 HashMapImplementation.prototype.is$HashMapImplementation = function(){return thi
s;}; | 1182 HashMapImplementation.prototype.is$HashMapImplementation = function(){return thi
s;}; |
| 1185 HashMapImplementation.prototype.is$Map$Node$Element = function(){return this;}; | 1183 HashMapImplementation.prototype.is$Map$Node$Element = function(){return this;}; |
| 1186 HashMapImplementation.prototype.is$Map$String$Member = function(){return this;}; | 1184 HashMapImplementation.prototype.is$Map$String$Member = function(){return this;}; |
| 1187 HashMapImplementation.HashMapImplementation$from$factory = function(other) { | 1185 HashMapImplementation.HashMapImplementation$from$factory = function(other) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1208 var insertionIndex = -1; | 1206 var insertionIndex = -1; |
| 1209 while (true) { | 1207 while (true) { |
| 1210 var existingKey = this._keys.$index(hash); | 1208 var existingKey = this._keys.$index(hash); |
| 1211 if (existingKey == null) { | 1209 if (existingKey == null) { |
| 1212 if (insertionIndex < 0) return hash; | 1210 if (insertionIndex < 0) return hash; |
| 1213 return insertionIndex; | 1211 return insertionIndex; |
| 1214 } | 1212 } |
| 1215 else if ($notnull_bool($eq(existingKey, key))) { | 1213 else if ($notnull_bool($eq(existingKey, key))) { |
| 1216 return hash; | 1214 return hash; |
| 1217 } | 1215 } |
| 1218 else if ((insertionIndex < 0) && (HashMapImplementation._deletedKey === exis
tingKey)) { | 1216 else if ((insertionIndex < 0) && (const$1/*HashMapImplementation._DELETED_KE
Y*/ === existingKey)) { |
| 1219 insertionIndex = hash; | 1217 insertionIndex = hash; |
| 1220 } | 1218 } |
| 1221 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); | 1219 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); |
| 1222 } | 1220 } |
| 1223 } | 1221 } |
| 1224 HashMapImplementation.prototype._probeForLookup = function(key) { | 1222 HashMapImplementation.prototype._probeForLookup = function(key) { |
| 1225 var hash = HashMapImplementation._firstProbe($assert_num(key.hashCode$0()), th
is._keys.length); | 1223 var hash = HashMapImplementation._firstProbe($assert_num(key.hashCode$0()), th
is._keys.length); |
| 1226 var numberOfProbes = 1; | 1224 var numberOfProbes = 1; |
| 1227 var initialHash = hash; | 1225 var initialHash = hash; |
| 1228 while (true) { | 1226 while (true) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1242 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; | 1240 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; |
| 1243 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; | 1241 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; |
| 1244 if (this._numberOfDeleted > numberOfFree) { | 1242 if (this._numberOfDeleted > numberOfFree) { |
| 1245 this._grow(this._keys.length); | 1243 this._grow(this._keys.length); |
| 1246 } | 1244 } |
| 1247 } | 1245 } |
| 1248 HashMapImplementation._isPowerOfTwo = function(x) { | 1246 HashMapImplementation._isPowerOfTwo = function(x) { |
| 1249 return ((x & (x - 1)) == 0); | 1247 return ((x & (x - 1)) == 0); |
| 1250 } | 1248 } |
| 1251 HashMapImplementation.prototype._grow = function(newCapacity) { | 1249 HashMapImplementation.prototype._grow = function(newCapacity) { |
| 1252 $assert(HashMapImplementation._isPowerOfTwo(newCapacity), "_isPowerOfTwo(newCa
pacity)", "hash_map_set.dart", 153, 12); | 1250 $assert(HashMapImplementation._isPowerOfTwo(newCapacity), "_isPowerOfTwo(newCa
pacity)", "hash_map_set.dart", 149, 12); |
| 1253 var capacity = this._keys.length; | 1251 var capacity = this._keys.length; |
| 1254 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 1252 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 1255 var oldKeys = this._keys; | 1253 var oldKeys = this._keys; |
| 1256 var oldValues = this._values; | 1254 var oldValues = this._values; |
| 1257 this._keys = new ListFactory(newCapacity); | 1255 this._keys = new ListFactory(newCapacity); |
| 1258 this._values = new ListFactory(newCapacity); | 1256 this._values = new ListFactory(newCapacity); |
| 1259 for (var i = 0; | 1257 for (var i = 0; |
| 1260 i < capacity; i++) { | 1258 i < capacity; i++) { |
| 1261 var key = oldKeys.$index(i); | 1259 var key = oldKeys.$index(i); |
| 1262 if (key == null || key === HashMapImplementation._deletedKey) { | 1260 if (key == null || key === const$1/*HashMapImplementation._DELETED_KEY*/) { |
| 1263 continue; | 1261 continue; |
| 1264 } | 1262 } |
| 1265 var value = oldValues.$index(i); | 1263 var value = oldValues.$index(i); |
| 1266 var newIndex = this._probeForAdding(key); | 1264 var newIndex = this._probeForAdding(key); |
| 1267 this._keys.$setindex(newIndex, key); | 1265 this._keys.$setindex(newIndex, key); |
| 1268 this._values.$setindex(newIndex, value); | 1266 this._values.$setindex(newIndex, value); |
| 1269 } | 1267 } |
| 1270 this._numberOfDeleted = 0; | 1268 this._numberOfDeleted = 0; |
| 1271 } | 1269 } |
| 1272 HashMapImplementation.prototype.clear = function() { | 1270 HashMapImplementation.prototype.clear = function() { |
| 1273 this._numberOfEntries = 0; | 1271 this._numberOfEntries = 0; |
| 1274 this._numberOfDeleted = 0; | 1272 this._numberOfDeleted = 0; |
| 1275 var length = this._keys.length; | 1273 var length = this._keys.length; |
| 1276 for (var i = 0; | 1274 for (var i = 0; |
| 1277 i < length; i++) { | 1275 i < length; i++) { |
| 1278 this._keys.$setindex(i); | 1276 this._keys.$setindex(i); |
| 1279 this._values.$setindex(i); | 1277 this._values.$setindex(i); |
| 1280 } | 1278 } |
| 1281 } | 1279 } |
| 1282 HashMapImplementation.prototype.$setindex = function(key, value) { | 1280 HashMapImplementation.prototype.$setindex = function(key, value) { |
| 1283 this._ensureCapacity(); | 1281 this._ensureCapacity(); |
| 1284 var index = this._probeForAdding(key); | 1282 var index = this._probeForAdding(key); |
| 1285 if ((this._keys.$index(index) == null) || (this._keys.$index(index) === HashMa
pImplementation._deletedKey)) { | 1283 if ((this._keys.$index(index) == null) || (this._keys.$index(index) === const$
1/*HashMapImplementation._DELETED_KEY*/)) { |
| 1286 this._numberOfEntries++; | 1284 this._numberOfEntries++; |
| 1287 } | 1285 } |
| 1288 this._keys.$setindex(index, key); | 1286 this._keys.$setindex(index, key); |
| 1289 this._values.$setindex(index, value); | 1287 this._values.$setindex(index, value); |
| 1290 } | 1288 } |
| 1291 HashMapImplementation.prototype.$index = function(key) { | 1289 HashMapImplementation.prototype.$index = function(key) { |
| 1292 var index = this._probeForLookup(key); | 1290 var index = this._probeForLookup(key); |
| 1293 if (index < 0) return null; | 1291 if (index < 0) return null; |
| 1294 return this._values.$index(index); | 1292 return this._values.$index(index); |
| 1295 } | 1293 } |
| 1296 HashMapImplementation.prototype.remove = function(key) { | 1294 HashMapImplementation.prototype.remove = function(key) { |
| 1297 var index = this._probeForLookup(key); | 1295 var index = this._probeForLookup(key); |
| 1298 if (index >= 0) { | 1296 if (index >= 0) { |
| 1299 this._numberOfEntries--; | 1297 this._numberOfEntries--; |
| 1300 var value = this._values.$index(index); | 1298 var value = this._values.$index(index); |
| 1301 this._values.$setindex(index); | 1299 this._values.$setindex(index); |
| 1302 this._keys.$setindex(index, HashMapImplementation._deletedKey); | 1300 this._keys.$setindex(index, const$1/*HashMapImplementation._DELETED_KEY*/); |
| 1303 this._numberOfDeleted++; | 1301 this._numberOfDeleted++; |
| 1304 return value; | 1302 return value; |
| 1305 } | 1303 } |
| 1306 return null; | 1304 return null; |
| 1307 } | 1305 } |
| 1308 HashMapImplementation.prototype.isEmpty = function() { | 1306 HashMapImplementation.prototype.isEmpty = function() { |
| 1309 return this._numberOfEntries == 0; | 1307 return this._numberOfEntries == 0; |
| 1310 } | 1308 } |
| 1311 HashMapImplementation.prototype.get$length = function() { | 1309 HashMapImplementation.prototype.get$length = function() { |
| 1312 return this._numberOfEntries; | 1310 return this._numberOfEntries; |
| 1313 } | 1311 } |
| 1314 Object.defineProperty(HashMapImplementation.prototype, "length", { | 1312 Object.defineProperty(HashMapImplementation.prototype, "length", { |
| 1315 get: HashMapImplementation.prototype.get$length | 1313 get: HashMapImplementation.prototype.get$length |
| 1316 }); | 1314 }); |
| 1317 HashMapImplementation.prototype.forEach = function(f) { | 1315 HashMapImplementation.prototype.forEach = function(f) { |
| 1318 var length = this._keys.length; | 1316 var length = this._keys.length; |
| 1319 for (var i = 0; | 1317 for (var i = 0; |
| 1320 i < length; i++) { | 1318 i < length; i++) { |
| 1321 if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== HashMapImple
mentation._deletedKey)) { | 1319 if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== const$1/*Has
hMapImplementation._DELETED_KEY*/)) { |
| 1322 f(this._keys.$index(i), this._values.$index(i)); | 1320 f(this._keys.$index(i), this._values.$index(i)); |
| 1323 } | 1321 } |
| 1324 } | 1322 } |
| 1325 } | 1323 } |
| 1326 HashMapImplementation.prototype.getKeys = function() { | 1324 HashMapImplementation.prototype.getKeys = function() { |
| 1327 var list = new ListFactory(this.get$length()); | 1325 var list = new ListFactory(this.get$length()); |
| 1328 var i = 0; | 1326 var i = 0; |
| 1329 this.forEach(function _(key, value) { | 1327 this.forEach(function _(key, value) { |
| 1330 list.$setindex(i++, key); | 1328 list.$setindex(i++, key); |
| 1331 } | 1329 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1347 HashMapImplementation.prototype.forEach$1 = HashMapImplementation.prototype.forE
ach; | 1345 HashMapImplementation.prototype.forEach$1 = HashMapImplementation.prototype.forE
ach; |
| 1348 HashMapImplementation.prototype.getKeys$0 = function() { | 1346 HashMapImplementation.prototype.getKeys$0 = function() { |
| 1349 return this.getKeys(); | 1347 return this.getKeys(); |
| 1350 }; | 1348 }; |
| 1351 HashMapImplementation.prototype.isEmpty$0 = function() { | 1349 HashMapImplementation.prototype.isEmpty$0 = function() { |
| 1352 return this.isEmpty(); | 1350 return this.isEmpty(); |
| 1353 }; | 1351 }; |
| 1354 // ********** Code for HashMapImplementation$E$E ************** | 1352 // ********** Code for HashMapImplementation$E$E ************** |
| 1355 function HashMapImplementation$E$E() { | 1353 function HashMapImplementation$E$E() { |
| 1356 // Initializers done | 1354 // Initializers done |
| 1357 if (HashMapImplementation._deletedKey == null) { | |
| 1358 HashMapImplementation._deletedKey = new Object(); | |
| 1359 } | |
| 1360 this._numberOfEntries = 0; | 1355 this._numberOfEntries = 0; |
| 1361 this._numberOfDeleted = 0; | 1356 this._numberOfDeleted = 0; |
| 1362 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); | 1357 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); |
| 1363 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); | 1358 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); |
| 1364 this._values = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); | 1359 this._values = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); |
| 1365 } | 1360 } |
| 1366 $inherits(HashMapImplementation$E$E, HashMapImplementation); | 1361 $inherits(HashMapImplementation$E$E, HashMapImplementation); |
| 1367 HashMapImplementation$E$E.prototype.is$Map$Node$Element = function(){return this
;}; | 1362 HashMapImplementation$E$E.prototype.is$Map$Node$Element = function(){return this
;}; |
| 1368 HashMapImplementation$E$E.prototype.is$Map$String$Member = function(){return thi
s;}; | 1363 HashMapImplementation$E$E.prototype.is$Map$String$Member = function(){return thi
s;}; |
| 1369 HashMapImplementation$E$E._computeLoadLimit = function(capacity) { | 1364 HashMapImplementation$E$E._computeLoadLimit = function(capacity) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1382 var insertionIndex = -1; | 1377 var insertionIndex = -1; |
| 1383 while (true) { | 1378 while (true) { |
| 1384 var existingKey = this._keys.$index(hash); | 1379 var existingKey = this._keys.$index(hash); |
| 1385 if (existingKey == null) { | 1380 if (existingKey == null) { |
| 1386 if (insertionIndex < 0) return hash; | 1381 if (insertionIndex < 0) return hash; |
| 1387 return insertionIndex; | 1382 return insertionIndex; |
| 1388 } | 1383 } |
| 1389 else if ($notnull_bool($eq(existingKey, key))) { | 1384 else if ($notnull_bool($eq(existingKey, key))) { |
| 1390 return hash; | 1385 return hash; |
| 1391 } | 1386 } |
| 1392 else if ((insertionIndex < 0) && (HashMapImplementation._deletedKey === exis
tingKey)) { | 1387 else if ((insertionIndex < 0) && (const$1/*HashMapImplementation._DELETED_KE
Y*/ === existingKey)) { |
| 1393 insertionIndex = hash; | 1388 insertionIndex = hash; |
| 1394 } | 1389 } |
| 1395 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); | 1390 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); |
| 1396 } | 1391 } |
| 1397 } | 1392 } |
| 1398 HashMapImplementation$E$E.prototype._probeForLookup = function(key) { | 1393 HashMapImplementation$E$E.prototype._probeForLookup = function(key) { |
| 1399 var hash = HashMapImplementation._firstProbe($assert_num(key.hashCode$0()), th
is._keys.length); | 1394 var hash = HashMapImplementation._firstProbe($assert_num(key.hashCode$0()), th
is._keys.length); |
| 1400 var numberOfProbes = 1; | 1395 var numberOfProbes = 1; |
| 1401 var initialHash = hash; | 1396 var initialHash = hash; |
| 1402 while (true) { | 1397 while (true) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1416 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; | 1411 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; |
| 1417 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; | 1412 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; |
| 1418 if (this._numberOfDeleted > numberOfFree) { | 1413 if (this._numberOfDeleted > numberOfFree) { |
| 1419 this._grow(this._keys.length); | 1414 this._grow(this._keys.length); |
| 1420 } | 1415 } |
| 1421 } | 1416 } |
| 1422 HashMapImplementation$E$E._isPowerOfTwo = function(x) { | 1417 HashMapImplementation$E$E._isPowerOfTwo = function(x) { |
| 1423 return ((x & (x - 1)) == 0); | 1418 return ((x & (x - 1)) == 0); |
| 1424 } | 1419 } |
| 1425 HashMapImplementation$E$E.prototype._grow = function(newCapacity) { | 1420 HashMapImplementation$E$E.prototype._grow = function(newCapacity) { |
| 1426 $assert(HashMapImplementation._isPowerOfTwo(newCapacity), "_isPowerOfTwo(newCa
pacity)", "hash_map_set.dart", 153, 12); | 1421 $assert(HashMapImplementation._isPowerOfTwo(newCapacity), "_isPowerOfTwo(newCa
pacity)", "hash_map_set.dart", 149, 12); |
| 1427 var capacity = this._keys.length; | 1422 var capacity = this._keys.length; |
| 1428 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 1423 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 1429 var oldKeys = this._keys; | 1424 var oldKeys = this._keys; |
| 1430 var oldValues = this._values; | 1425 var oldValues = this._values; |
| 1431 this._keys = new ListFactory(newCapacity); | 1426 this._keys = new ListFactory(newCapacity); |
| 1432 this._values = new ListFactory(newCapacity); | 1427 this._values = new ListFactory(newCapacity); |
| 1433 for (var i = 0; | 1428 for (var i = 0; |
| 1434 i < capacity; i++) { | 1429 i < capacity; i++) { |
| 1435 var key = oldKeys.$index(i); | 1430 var key = oldKeys.$index(i); |
| 1436 if (key == null || key === HashMapImplementation._deletedKey) { | 1431 if (key == null || key === const$1/*HashMapImplementation._DELETED_KEY*/) { |
| 1437 continue; | 1432 continue; |
| 1438 } | 1433 } |
| 1439 var value = oldValues.$index(i); | 1434 var value = oldValues.$index(i); |
| 1440 var newIndex = this._probeForAdding(key); | 1435 var newIndex = this._probeForAdding(key); |
| 1441 this._keys.$setindex(newIndex, key); | 1436 this._keys.$setindex(newIndex, key); |
| 1442 this._values.$setindex(newIndex, value); | 1437 this._values.$setindex(newIndex, value); |
| 1443 } | 1438 } |
| 1444 this._numberOfDeleted = 0; | 1439 this._numberOfDeleted = 0; |
| 1445 } | 1440 } |
| 1446 HashMapImplementation$E$E.prototype.clear = function() { | 1441 HashMapImplementation$E$E.prototype.clear = function() { |
| 1447 this._numberOfEntries = 0; | 1442 this._numberOfEntries = 0; |
| 1448 this._numberOfDeleted = 0; | 1443 this._numberOfDeleted = 0; |
| 1449 var length = this._keys.length; | 1444 var length = this._keys.length; |
| 1450 for (var i = 0; | 1445 for (var i = 0; |
| 1451 i < length; i++) { | 1446 i < length; i++) { |
| 1452 this._keys.$setindex(i); | 1447 this._keys.$setindex(i); |
| 1453 this._values.$setindex(i); | 1448 this._values.$setindex(i); |
| 1454 } | 1449 } |
| 1455 } | 1450 } |
| 1456 HashMapImplementation$E$E.prototype.$setindex = function(key, value) { | 1451 HashMapImplementation$E$E.prototype.$setindex = function(key, value) { |
| 1457 this._ensureCapacity(); | 1452 this._ensureCapacity(); |
| 1458 var index = this._probeForAdding(key); | 1453 var index = this._probeForAdding(key); |
| 1459 if ((this._keys.$index(index) == null) || (this._keys.$index(index) === HashMa
pImplementation._deletedKey)) { | 1454 if ((this._keys.$index(index) == null) || (this._keys.$index(index) === const$
1/*HashMapImplementation._DELETED_KEY*/)) { |
| 1460 this._numberOfEntries++; | 1455 this._numberOfEntries++; |
| 1461 } | 1456 } |
| 1462 this._keys.$setindex(index, key); | 1457 this._keys.$setindex(index, key); |
| 1463 this._values.$setindex(index, value); | 1458 this._values.$setindex(index, value); |
| 1464 } | 1459 } |
| 1465 HashMapImplementation$E$E.prototype.remove = function(key) { | 1460 HashMapImplementation$E$E.prototype.remove = function(key) { |
| 1466 var index = this._probeForLookup(key); | 1461 var index = this._probeForLookup(key); |
| 1467 if (index >= 0) { | 1462 if (index >= 0) { |
| 1468 this._numberOfEntries--; | 1463 this._numberOfEntries--; |
| 1469 var value = this._values.$index(index); | 1464 var value = this._values.$index(index); |
| 1470 this._values.$setindex(index); | 1465 this._values.$setindex(index); |
| 1471 this._keys.$setindex(index, HashMapImplementation._deletedKey); | 1466 this._keys.$setindex(index, const$1/*HashMapImplementation._DELETED_KEY*/); |
| 1472 this._numberOfDeleted++; | 1467 this._numberOfDeleted++; |
| 1473 return value; | 1468 return value; |
| 1474 } | 1469 } |
| 1475 return null; | 1470 return null; |
| 1476 } | 1471 } |
| 1477 HashMapImplementation$E$E.prototype.isEmpty = function() { | 1472 HashMapImplementation$E$E.prototype.isEmpty = function() { |
| 1478 return this._numberOfEntries == 0; | 1473 return this._numberOfEntries == 0; |
| 1479 } | 1474 } |
| 1480 HashMapImplementation$E$E.prototype.forEach = function(f) { | 1475 HashMapImplementation$E$E.prototype.forEach = function(f) { |
| 1481 var length = this._keys.length; | 1476 var length = this._keys.length; |
| 1482 for (var i = 0; | 1477 for (var i = 0; |
| 1483 i < length; i++) { | 1478 i < length; i++) { |
| 1484 if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== HashMapImple
mentation._deletedKey)) { | 1479 if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== const$1/*Has
hMapImplementation._DELETED_KEY*/)) { |
| 1485 f(this._keys.$index(i), this._values.$index(i)); | 1480 f(this._keys.$index(i), this._values.$index(i)); |
| 1486 } | 1481 } |
| 1487 } | 1482 } |
| 1488 } | 1483 } |
| 1489 HashMapImplementation$E$E.prototype.getKeys = function() { | 1484 HashMapImplementation$E$E.prototype.getKeys = function() { |
| 1490 var list = new ListFactory(this.get$length()); | 1485 var list = new ListFactory(this.get$length()); |
| 1491 var i = 0; | 1486 var i = 0; |
| 1492 this.forEach(function _(key, value) { | 1487 this.forEach(function _(key, value) { |
| 1493 list.$setindex(i++, key); | 1488 list.$setindex(i++, key); |
| 1494 } | 1489 } |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1637 // ********** Code for HashSetIterator ************** | 1632 // ********** Code for HashSetIterator ************** |
| 1638 function HashSetIterator(set_) { | 1633 function HashSetIterator(set_) { |
| 1639 this._nextValidIndex = -1; | 1634 this._nextValidIndex = -1; |
| 1640 this._entries = set_._backingMap._keys; | 1635 this._entries = set_._backingMap._keys; |
| 1641 // Initializers done | 1636 // Initializers done |
| 1642 this._advance(); | 1637 this._advance(); |
| 1643 } | 1638 } |
| 1644 HashSetIterator.prototype.is$Iterator$T = function(){return this;}; | 1639 HashSetIterator.prototype.is$Iterator$T = function(){return this;}; |
| 1645 HashSetIterator.prototype.hasNext = function() { | 1640 HashSetIterator.prototype.hasNext = function() { |
| 1646 if (this._nextValidIndex >= this._entries.length) return false; | 1641 if (this._nextValidIndex >= this._entries.length) return false; |
| 1647 if (this._entries.$index(this._nextValidIndex) === HashMapImplementation._dele
tedKey) { | 1642 if (this._entries.$index(this._nextValidIndex) === const$1/*HashMapImplementat
ion._DELETED_KEY*/) { |
| 1648 this._advance(); | 1643 this._advance(); |
| 1649 } | 1644 } |
| 1650 return this._nextValidIndex < this._entries.length; | 1645 return this._nextValidIndex < this._entries.length; |
| 1651 } | 1646 } |
| 1652 HashSetIterator.prototype.next = function() { | 1647 HashSetIterator.prototype.next = function() { |
| 1653 if (!this.hasNext()) { | 1648 if (!this.hasNext()) { |
| 1654 $throw(const$0/*const NoMoreElementsException()*/); | 1649 $throw(const$0/*const NoMoreElementsException()*/); |
| 1655 } | 1650 } |
| 1656 var res = this._entries.$index(this._nextValidIndex); | 1651 var res = this._entries.$index(this._nextValidIndex); |
| 1657 this._advance(); | 1652 this._advance(); |
| 1658 return res; | 1653 return res; |
| 1659 } | 1654 } |
| 1660 HashSetIterator.prototype._advance = function() { | 1655 HashSetIterator.prototype._advance = function() { |
| 1661 var length = this._entries.length; | 1656 var length = this._entries.length; |
| 1662 var entry; | 1657 var entry; |
| 1663 var deletedKey = HashMapImplementation._deletedKey; | 1658 var deletedKey = const$1/*HashMapImplementation._DELETED_KEY*/; |
| 1664 do { | 1659 do { |
| 1665 if (++this._nextValidIndex >= length) break; | 1660 if (++this._nextValidIndex >= length) break; |
| 1666 entry = this._entries.$index(this._nextValidIndex); | 1661 entry = this._entries.$index(this._nextValidIndex); |
| 1667 } | 1662 } |
| 1668 while ((entry == null) || (entry === deletedKey)) | 1663 while ((entry == null) || (entry === deletedKey)) |
| 1669 } | 1664 } |
| 1670 HashSetIterator.prototype.hasNext$0 = function() { | 1665 HashSetIterator.prototype.hasNext$0 = function() { |
| 1671 return this.hasNext(); | 1666 return this.hasNext(); |
| 1672 }; | 1667 }; |
| 1673 HashSetIterator.prototype.next$0 = function() { | 1668 HashSetIterator.prototype.next$0 = function() { |
| 1674 return this.next(); | 1669 return this.next(); |
| 1675 }; | 1670 }; |
| 1676 // ********** Code for HashSetIterator$E ************** | 1671 // ********** Code for HashSetIterator$E ************** |
| 1677 function HashSetIterator$E(set_) { | 1672 function HashSetIterator$E(set_) { |
| 1678 this._nextValidIndex = -1; | 1673 this._nextValidIndex = -1; |
| 1679 this._entries = set_._backingMap._keys; | 1674 this._entries = set_._backingMap._keys; |
| 1680 // Initializers done | 1675 // Initializers done |
| 1681 this._advance(); | 1676 this._advance(); |
| 1682 } | 1677 } |
| 1683 $inherits(HashSetIterator$E, HashSetIterator); | 1678 $inherits(HashSetIterator$E, HashSetIterator); |
| 1684 HashSetIterator$E.prototype.is$Iterator$T = function(){return this;}; | 1679 HashSetIterator$E.prototype.is$Iterator$T = function(){return this;}; |
| 1685 HashSetIterator$E.prototype._advance = function() { | 1680 HashSetIterator$E.prototype._advance = function() { |
| 1686 var length = this._entries.length; | 1681 var length = this._entries.length; |
| 1687 var entry; | 1682 var entry; |
| 1688 var deletedKey = HashMapImplementation._deletedKey; | 1683 var deletedKey = const$1/*HashMapImplementation._DELETED_KEY*/; |
| 1689 do { | 1684 do { |
| 1690 if (++this._nextValidIndex >= length) break; | 1685 if (++this._nextValidIndex >= length) break; |
| 1691 entry = this._entries.$index(this._nextValidIndex); | 1686 entry = this._entries.$index(this._nextValidIndex); |
| 1692 } | 1687 } |
| 1693 while ((entry == null) || (entry === deletedKey)) | 1688 while ((entry == null) || (entry === deletedKey)) |
| 1694 } | 1689 } |
| 1690 // ********** Code for _DeletedKeySentinel ************** |
| 1691 function _DeletedKeySentinel() { |
| 1692 // Initializers done |
| 1693 } |
| 1695 // ********** Code for KeyValuePair ************** | 1694 // ********** Code for KeyValuePair ************** |
| 1696 function KeyValuePair(key, value) { | 1695 function KeyValuePair(key, value) { |
| 1697 this.key = key; | 1696 this.key = key; |
| 1698 this.value = value; | 1697 this.value = value; |
| 1699 // Initializers done | 1698 // Initializers done |
| 1700 } | 1699 } |
| 1701 KeyValuePair.prototype.get$value = function() { return this.value; }; | 1700 KeyValuePair.prototype.get$value = function() { return this.value; }; |
| 1702 KeyValuePair.prototype.set$value = function(value) { return this.value = value;
}; | 1701 KeyValuePair.prototype.set$value = function(value) { return this.value = value;
}; |
| 1703 // ********** Code for KeyValuePair$K$V ************** | 1702 // ********** Code for KeyValuePair$K$V ************** |
| 1704 function KeyValuePair$K$V(key, value) { | 1703 function KeyValuePair$K$V(key, value) { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1850 $inherits(DoubleLinkedQueueEntry$KeyValuePair$K$V, DoubleLinkedQueueEntry); | 1849 $inherits(DoubleLinkedQueueEntry$KeyValuePair$K$V, DoubleLinkedQueueEntry); |
| 1851 DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype.is$DoubleLinkedQueueEntry$KeyV
aluePair$K$V = function(){return this;}; | 1850 DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype.is$DoubleLinkedQueueEntry$KeyV
aluePair$K$V = function(){return this;}; |
| 1852 // ********** Code for _DoubleLinkedQueueEntrySentinel ************** | 1851 // ********** Code for _DoubleLinkedQueueEntrySentinel ************** |
| 1853 function _DoubleLinkedQueueEntrySentinel() { | 1852 function _DoubleLinkedQueueEntrySentinel() { |
| 1854 // Initializers done | 1853 // Initializers done |
| 1855 DoubleLinkedQueueEntry$E.call(this, null); | 1854 DoubleLinkedQueueEntry$E.call(this, null); |
| 1856 this._link(this, this); | 1855 this._link(this, this); |
| 1857 } | 1856 } |
| 1858 $inherits(_DoubleLinkedQueueEntrySentinel, DoubleLinkedQueueEntry$E); | 1857 $inherits(_DoubleLinkedQueueEntrySentinel, DoubleLinkedQueueEntry$E); |
| 1859 _DoubleLinkedQueueEntrySentinel.prototype.remove = function() { | 1858 _DoubleLinkedQueueEntrySentinel.prototype.remove = function() { |
| 1860 $throw(const$3/*const EmptyQueueException()*/); | 1859 $throw(const$5/*const EmptyQueueException()*/); |
| 1861 } | 1860 } |
| 1862 _DoubleLinkedQueueEntrySentinel.prototype._asNonSentinelEntry = function() { | 1861 _DoubleLinkedQueueEntrySentinel.prototype._asNonSentinelEntry = function() { |
| 1863 return null; | 1862 return null; |
| 1864 } | 1863 } |
| 1865 _DoubleLinkedQueueEntrySentinel.prototype.get$element = function() { | 1864 _DoubleLinkedQueueEntrySentinel.prototype.get$element = function() { |
| 1866 $throw(const$3/*const EmptyQueueException()*/); | 1865 $throw(const$5/*const EmptyQueueException()*/); |
| 1867 } | 1866 } |
| 1868 // ********** Code for _DoubleLinkedQueueEntrySentinel$E ************** | 1867 // ********** Code for _DoubleLinkedQueueEntrySentinel$E ************** |
| 1869 function _DoubleLinkedQueueEntrySentinel$E() { | 1868 function _DoubleLinkedQueueEntrySentinel$E() { |
| 1870 // Initializers done | 1869 // Initializers done |
| 1871 DoubleLinkedQueueEntry$E.call(this, null); | 1870 DoubleLinkedQueueEntry$E.call(this, null); |
| 1872 this._link(this, this); | 1871 this._link(this, this); |
| 1873 } | 1872 } |
| 1874 $inherits(_DoubleLinkedQueueEntrySentinel$E, _DoubleLinkedQueueEntrySentinel); | 1873 $inherits(_DoubleLinkedQueueEntrySentinel$E, _DoubleLinkedQueueEntrySentinel); |
| 1875 // ********** Code for _DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V ********
****** | 1874 // ********** Code for _DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V ********
****** |
| 1876 function _DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V() { | 1875 function _DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V() { |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2447 NodeFileSystem.prototype.fileExists = function(filename) { | 2446 NodeFileSystem.prototype.fileExists = function(filename) { |
| 2448 return path.existsSync(filename); | 2447 return path.existsSync(filename); |
| 2449 } | 2448 } |
| 2450 // ********** Code for top level ************** | 2449 // ********** Code for top level ************** |
| 2451 // ********** Library io ************** | 2450 // ********** Library io ************** |
| 2452 // ********** Code for top level ************** | 2451 // ********** Code for top level ************** |
| 2453 function join(strings) { | 2452 function join(strings) { |
| 2454 return Strings.join(strings, '/'); | 2453 return Strings.join(strings, '/'); |
| 2455 } | 2454 } |
| 2456 function readSync(fileName) { | 2455 function readSync(fileName) { |
| 2457 return new SourceFile(fileName, world.files.readAll(fileName)); | 2456 return new SourceFile(fileName, $globals.world.files.readAll(fileName)); |
| 2458 } | 2457 } |
| 2459 // ********** Library util_implementation ************** | 2458 // ********** Library util_implementation ************** |
| 2460 // ********** Code for LinkFactory ************** | 2459 // ********** Code for LinkFactory ************** |
| 2461 function LinkFactory() {} | 2460 function LinkFactory() {} |
| 2462 LinkFactory.Link$factory = function(head, tail) { | 2461 LinkFactory.Link$factory = function(head, tail) { |
| 2463 var $0; | 2462 var $0; |
| 2464 return new LinkEntry$Dynamic(head, (($0 = (tail == null) ? new LinkTail$Dynami
c() : tail) && $0.is$Link$T())); | 2463 return new LinkEntry$Dynamic(head, (($0 = (tail == null) ? new LinkTail$Dynami
c() : tail) && $0.is$Link$T())); |
| 2465 } | 2464 } |
| 2466 // ********** Code for AbstractLink ************** | 2465 // ********** Code for AbstractLink ************** |
| 2467 function AbstractLink() { | 2466 function AbstractLink() { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2546 LinkTail.prototype.is$Link$Token = function(){return this;}; | 2545 LinkTail.prototype.is$Link$Token = function(){return this;}; |
| 2547 LinkTail.prototype.is$Link$Type = function(){return this;}; | 2546 LinkTail.prototype.is$Link$Type = function(){return this;}; |
| 2548 LinkTail.prototype.is$Iterable = function(){return this;}; | 2547 LinkTail.prototype.is$Iterable = function(){return this;}; |
| 2549 LinkTail.prototype.get$head = function() { | 2548 LinkTail.prototype.get$head = function() { |
| 2550 return null; | 2549 return null; |
| 2551 } | 2550 } |
| 2552 LinkTail.prototype.get$tail = function() { | 2551 LinkTail.prototype.get$tail = function() { |
| 2553 return null; | 2552 return null; |
| 2554 } | 2553 } |
| 2555 LinkTail.prototype.toList = function() { | 2554 LinkTail.prototype.toList = function() { |
| 2556 return const$13/*const []*/; | 2555 return const$15/*const []*/; |
| 2557 } | 2556 } |
| 2558 LinkTail.prototype.isEmpty = function() { | 2557 LinkTail.prototype.isEmpty = function() { |
| 2559 return true; | 2558 return true; |
| 2560 } | 2559 } |
| 2561 LinkTail.prototype.isEmpty$0 = function() { | 2560 LinkTail.prototype.isEmpty$0 = function() { |
| 2562 return this.isEmpty(); | 2561 return this.isEmpty(); |
| 2563 }; | 2562 }; |
| 2564 // ********** Code for LinkTail$Dynamic ************** | 2563 // ********** Code for LinkTail$Dynamic ************** |
| 2565 function LinkTail$Dynamic() { | 2564 function LinkTail$Dynamic() { |
| 2566 // Initializers done | 2565 // Initializers done |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2669 $inherits(LinkEntry$T, LinkEntry); | 2668 $inherits(LinkEntry$T, LinkEntry); |
| 2670 // ********** Code for LinkBuilderImplementation ************** | 2669 // ********** Code for LinkBuilderImplementation ************** |
| 2671 function LinkBuilderImplementation() { | 2670 function LinkBuilderImplementation() { |
| 2672 this.head = null | 2671 this.head = null |
| 2673 this.lastLink = null | 2672 this.lastLink = null |
| 2674 // Initializers done | 2673 // Initializers done |
| 2675 } | 2674 } |
| 2676 LinkBuilderImplementation.prototype.get$head = function() { return this.head; }; | 2675 LinkBuilderImplementation.prototype.get$head = function() { return this.head; }; |
| 2677 LinkBuilderImplementation.prototype.set$head = function(value) { return this.hea
d = value; }; | 2676 LinkBuilderImplementation.prototype.set$head = function(value) { return this.hea
d = value; }; |
| 2678 LinkBuilderImplementation.prototype.toLink = function() { | 2677 LinkBuilderImplementation.prototype.toLink = function() { |
| 2679 if (this.head == null) return const$14/*const EmptyLink<Token>()*/; | 2678 if (this.head == null) return const$16/*const EmptyLink<Token>()*/; |
| 2680 this.lastLink.realTail = const$14/*const EmptyLink<Token>()*/; | 2679 this.lastLink.realTail = const$16/*const EmptyLink<Token>()*/; |
| 2681 var link = this.head; | 2680 var link = this.head; |
| 2682 this.lastLink = null; | 2681 this.lastLink = null; |
| 2683 this.head = null; | 2682 this.head = null; |
| 2684 return link; | 2683 return link; |
| 2685 } | 2684 } |
| 2686 LinkBuilderImplementation.prototype.addLast = function(t) { | 2685 LinkBuilderImplementation.prototype.addLast = function(t) { |
| 2687 var entry = new LinkEntry$T(t, null); | 2686 var entry = new LinkEntry$T(t, null); |
| 2688 if (this.head == null) { | 2687 if (this.head == null) { |
| 2689 this.head = entry; | 2688 this.head = entry; |
| 2690 } | 2689 } |
| 2691 else { | 2690 else { |
| 2692 this.lastLink.realTail = entry; | 2691 this.lastLink.realTail = entry; |
| 2693 } | 2692 } |
| 2694 this.lastLink = entry; | 2693 this.lastLink = entry; |
| 2695 } | 2694 } |
| 2696 // ********** Code for LinkBuilderImplementation$T ************** | 2695 // ********** Code for LinkBuilderImplementation$T ************** |
| 2697 function LinkBuilderImplementation$T() {} | 2696 function LinkBuilderImplementation$T() {} |
| 2698 $inherits(LinkBuilderImplementation$T, LinkBuilderImplementation); | 2697 $inherits(LinkBuilderImplementation$T, LinkBuilderImplementation); |
| 2699 // ********** Code for LinkBuilderImplementation$Type ************** | 2698 // ********** Code for LinkBuilderImplementation$Type ************** |
| 2700 function LinkBuilderImplementation$Type() {} | 2699 function LinkBuilderImplementation$Type() {} |
| 2701 $inherits(LinkBuilderImplementation$Type, LinkBuilderImplementation); | 2700 $inherits(LinkBuilderImplementation$Type, LinkBuilderImplementation); |
| 2702 // ********** Code for top level ************** | 2701 // ********** Code for top level ************** |
| 2703 // ********** Library util ************** | 2702 // ********** Library util ************** |
| 2704 // ********** Code for top level ************** | 2703 // ********** Code for top level ************** |
| 2705 // ********** Library scanner_implementation ************** | 2704 // ********** Library scanner_implementation ************** |
| 2706 // ********** Code for ArrayBasedScanner ************** | 2705 // ********** Code for ArrayBasedScanner ************** |
| 2707 function ArrayBasedScanner() { | 2706 function ArrayBasedScanner() { |
| 2708 this.groupingStack = const$14/*const EmptyLink<Token>()*/ | 2707 this.groupingStack = const$16/*const EmptyLink<Token>()*/ |
| 2709 this.extraCharOffset = 0; | 2708 this.extraCharOffset = 0; |
| 2710 this.tokenStart = -1; | 2709 this.tokenStart = -1; |
| 2711 this.byteOffset = -1; | 2710 this.byteOffset = -1; |
| 2712 this.tokens = new Token(0/*null.EOF_TOKEN*/, -1); | 2711 this.tokens = new Token(0/*null.EOF_TOKEN*/, -1); |
| 2713 // Initializers done | 2712 // Initializers done |
| 2714 AbstractScanner$S.call(this); | 2713 AbstractScanner$S.call(this); |
| 2715 this.tail = this.tokens; | 2714 this.tail = this.tokens; |
| 2716 } | 2715 } |
| 2717 $inherits(ArrayBasedScanner, AbstractScanner$S); | 2716 $inherits(ArrayBasedScanner, AbstractScanner$S); |
| 2718 ArrayBasedScanner.prototype.get$charOffset = function() { | 2717 ArrayBasedScanner.prototype.get$charOffset = function() { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2816 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Tok
en()); | 2815 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Tok
en()); |
| 2817 } | 2816 } |
| 2818 if ($notnull_bool(this.groupingStack.isEmpty())) return; | 2817 if ($notnull_bool(this.groupingStack.isEmpty())) return; |
| 2819 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { | 2818 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { |
| 2820 this.groupingStack.get$head().set$endGroup(oldTail.next); | 2819 this.groupingStack.get$head().set$endGroup(oldTail.next); |
| 2821 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Tok
en()); | 2820 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Tok
en()); |
| 2822 } | 2821 } |
| 2823 } | 2822 } |
| 2824 // ********** Code for ArrayBasedScanner$SourceString ************** | 2823 // ********** Code for ArrayBasedScanner$SourceString ************** |
| 2825 function ArrayBasedScanner$SourceString() { | 2824 function ArrayBasedScanner$SourceString() { |
| 2826 this.groupingStack = const$14/*const EmptyLink<Token>()*/ | 2825 this.groupingStack = const$16/*const EmptyLink<Token>()*/ |
| 2827 this.extraCharOffset = 0; | 2826 this.extraCharOffset = 0; |
| 2828 this.tokenStart = -1; | 2827 this.tokenStart = -1; |
| 2829 this.byteOffset = -1; | 2828 this.byteOffset = -1; |
| 2830 this.tokens = new Token(0/*null.EOF_TOKEN*/, -1); | 2829 this.tokens = new Token(0/*null.EOF_TOKEN*/, -1); |
| 2831 // Initializers done | 2830 // Initializers done |
| 2832 AbstractScanner$S.call(this); | 2831 AbstractScanner$S.call(this); |
| 2833 this.tail = this.tokens; | 2832 this.tail = this.tokens; |
| 2834 } | 2833 } |
| 2835 $inherits(ArrayBasedScanner$SourceString, ArrayBasedScanner); | 2834 $inherits(ArrayBasedScanner$SourceString, ArrayBasedScanner); |
| 2836 // ********** Code for top level ************** | 2835 // ********** Code for top level ************** |
| (...skipping 2648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5485 } | 5484 } |
| 5486 ParserError.prototype.toString = function() { | 5485 ParserError.prototype.toString = function() { |
| 5487 return this.reason; | 5486 return this.reason; |
| 5488 } | 5487 } |
| 5489 ParserError.prototype.toString$0 = function() { | 5488 ParserError.prototype.toString$0 = function() { |
| 5490 return this.toString(); | 5489 return this.toString(); |
| 5491 }; | 5490 }; |
| 5492 // ********** Code for ElementListener ************** | 5491 // ********** Code for ElementListener ************** |
| 5493 function ElementListener(canceler) { | 5492 function ElementListener(canceler) { |
| 5494 this.previousIdentifier = null | 5493 this.previousIdentifier = null |
| 5495 this.nodes = const$14/*const EmptyLink<Token>()*/ | 5494 this.nodes = const$16/*const EmptyLink<Token>()*/ |
| 5496 this.topLevelElements = const$14/*const EmptyLink<Token>()*/ | 5495 this.topLevelElements = const$16/*const EmptyLink<Token>()*/ |
| 5497 this.canceler = canceler; | 5496 this.canceler = canceler; |
| 5498 // Initializers done | 5497 // Initializers done |
| 5499 Listener.call(this); | 5498 Listener.call(this); |
| 5500 } | 5499 } |
| 5501 $inherits(ElementListener, Listener); | 5500 $inherits(ElementListener, Listener); |
| 5502 ElementListener.prototype.beginLibraryTag = function(token) { | 5501 ElementListener.prototype.beginLibraryTag = function(token) { |
| 5503 this.canceler.cancel("Cannot handle library tags"); | 5502 this.canceler.cancel("Cannot handle library tags"); |
| 5504 } | 5503 } |
| 5505 ElementListener.prototype.endClass = function(interfacesCount, beginToken, exten
dsKeyword, implementsKeyword, endToken) { | 5504 ElementListener.prototype.endClass = function(interfacesCount, beginToken, exten
dsKeyword, implementsKeyword, endToken) { |
| 5506 var $0; | 5505 var $0; |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5773 this.pushNode(new Throw(null, throwToken, endToken)); | 5772 this.pushNode(new Throw(null, throwToken, endToken)); |
| 5774 } | 5773 } |
| 5775 NodeListener.prototype.handleUnaryPostfixExpression = function(token) { | 5774 NodeListener.prototype.handleUnaryPostfixExpression = function(token) { |
| 5776 this.pushNode(new Send.postfix$ctor(this.popNode(), new Operator(token))); | 5775 this.pushNode(new Send.postfix$ctor(this.popNode(), new Operator(token))); |
| 5777 } | 5776 } |
| 5778 NodeListener.prototype.handleUnaryPrefixExpression = function(token) { | 5777 NodeListener.prototype.handleUnaryPrefixExpression = function(token) { |
| 5779 this.pushNode(new Send.prefix$ctor(this.popNode(), new Operator(token))); | 5778 this.pushNode(new Send.prefix$ctor(this.popNode(), new Operator(token))); |
| 5780 } | 5779 } |
| 5781 NodeListener.prototype.makeNodeList = function(count, beginToken, endToken, deli
miter) { | 5780 NodeListener.prototype.makeNodeList = function(count, beginToken, endToken, deli
miter) { |
| 5782 var $0; | 5781 var $0; |
| 5783 var nodes = const$14/*const EmptyLink<Token>()*/; | 5782 var nodes = const$16/*const EmptyLink<Token>()*/; |
| 5784 for (; count > 0; --count) { | 5783 for (; count > 0; --count) { |
| 5785 nodes = (($0 = nodes.prepend(this.popNode())) && $0.is$Link$Node()); | 5784 nodes = (($0 = nodes.prepend(this.popNode())) && $0.is$Link$Node()); |
| 5786 } | 5785 } |
| 5787 var sourceDelimiter = (($0 = (delimiter == null) ? null : new StringWrapper(de
limiter)) && $0.is$SourceString()); | 5786 var sourceDelimiter = (($0 = (delimiter == null) ? null : new StringWrapper(de
limiter)) && $0.is$SourceString()); |
| 5788 return new NodeList(beginToken, nodes, endToken, sourceDelimiter); | 5787 return new NodeList(beginToken, nodes, endToken, sourceDelimiter); |
| 5789 } | 5788 } |
| 5790 NodeListener.prototype.log = function(message) { | 5789 NodeListener.prototype.log = function(message) { |
| 5791 this.logger.log(message); | 5790 this.logger.log(message); |
| 5792 } | 5791 } |
| 5793 NodeListener.prototype.endArguments$3 = function($0, $1, $2) { | 5792 NodeListener.prototype.endArguments$3 = function($0, $1, $2) { |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5978 // ********** Code for Token ************** | 5977 // ********** Code for Token ************** |
| 5979 function Token(kind, charOffset) { | 5978 function Token(kind, charOffset) { |
| 5980 this.kind = kind; | 5979 this.kind = kind; |
| 5981 this.charOffset = charOffset; | 5980 this.charOffset = charOffset; |
| 5982 // Initializers done | 5981 // Initializers done |
| 5983 } | 5982 } |
| 5984 Token.prototype.is$Token = function(){return this;}; | 5983 Token.prototype.is$Token = function(){return this;}; |
| 5985 Token.prototype.get$kind = function() { return this.kind; }; | 5984 Token.prototype.get$kind = function() { return this.kind; }; |
| 5986 Token.prototype.get$charOffset = function() { return this.charOffset; }; | 5985 Token.prototype.get$charOffset = function() { return this.charOffset; }; |
| 5987 Token.prototype.get$value = function() { | 5986 Token.prototype.get$value = function() { |
| 5988 return const$112/*const SourceString('EOF')*/; | 5987 return const$114/*const SourceString('EOF')*/; |
| 5989 } | 5988 } |
| 5990 Token.prototype.get$stringValue = function() { | 5989 Token.prototype.get$stringValue = function() { |
| 5991 return 'EOF'; | 5990 return 'EOF'; |
| 5992 } | 5991 } |
| 5993 Token.prototype.toString = function() { | 5992 Token.prototype.toString = function() { |
| 5994 return Strings.String$fromCharCodes$factory([this.kind]); | 5993 return Strings.String$fromCharCodes$factory([this.kind]); |
| 5995 } | 5994 } |
| 5996 Token.prototype.next$0 = function() { | 5995 Token.prototype.next$0 = function() { |
| 5997 return this.next(); | 5996 return this.next(); |
| 5998 }; | 5997 }; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6080 // ********** Code for Keyword ************** | 6079 // ********** Code for Keyword ************** |
| 6081 function Keyword(syntax, isPseudo) { | 6080 function Keyword(syntax, isPseudo) { |
| 6082 this.syntax = syntax; | 6081 this.syntax = syntax; |
| 6083 this.isPseudo = isPseudo; | 6082 this.isPseudo = isPseudo; |
| 6084 // Initializers done | 6083 // Initializers done |
| 6085 } | 6084 } |
| 6086 Keyword.prototype.is$SourceString = function(){return this;}; | 6085 Keyword.prototype.is$SourceString = function(){return this;}; |
| 6087 Keyword.prototype.get$syntax = function() { return this.syntax; }; | 6086 Keyword.prototype.get$syntax = function() { return this.syntax; }; |
| 6088 Keyword.prototype.get$isPseudo = function() { return this.isPseudo; }; | 6087 Keyword.prototype.get$isPseudo = function() { return this.isPseudo; }; |
| 6089 Keyword.get$keywords = function() { | 6088 Keyword.get$keywords = function() { |
| 6090 if (Keyword._keywords == null) { | 6089 if ($globals.Keyword__keywords == null) { |
| 6091 Keyword._keywords = Keyword.computeKeywordMap(); | 6090 $globals.Keyword__keywords = Keyword.computeKeywordMap(); |
| 6092 } | 6091 } |
| 6093 return Keyword._keywords; | 6092 return $globals.Keyword__keywords; |
| 6094 } | 6093 } |
| 6095 Keyword.computeKeywordMap = function() { | 6094 Keyword.computeKeywordMap = function() { |
| 6096 var result = new LinkedHashMapImplementation(); | 6095 var result = new LinkedHashMapImplementation(); |
| 6097 for (var $i0 = const$110/*Keyword.values*/.iterator(); $i0.hasNext(); ) { | 6096 for (var $i0 = const$112/*Keyword.values*/.iterator(); $i0.hasNext(); ) { |
| 6098 var keyword = $i0.next(); | 6097 var keyword = $i0.next(); |
| 6099 result.$setindex(keyword.syntax, keyword); | 6098 result.$setindex(keyword.syntax, keyword); |
| 6100 } | 6099 } |
| 6101 return result; | 6100 return result; |
| 6102 } | 6101 } |
| 6103 Keyword.prototype.hashCode = function() { | 6102 Keyword.prototype.hashCode = function() { |
| 6104 return this.syntax.hashCode(); | 6103 return this.syntax.hashCode(); |
| 6105 } | 6104 } |
| 6106 Keyword.prototype.$eq = function(other) { | 6105 Keyword.prototype.$eq = function(other) { |
| 6107 return !!(other && other.is$SourceString) && this.toString() == other.toString
$0(); | 6106 return !!(other && other.is$SourceString) && this.toString() == other.toString
$0(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 6123 }; | 6122 }; |
| 6124 Keyword.prototype.toString$0 = function() { | 6123 Keyword.prototype.toString$0 = function() { |
| 6125 return this.toString(); | 6124 return this.toString(); |
| 6126 }; | 6125 }; |
| 6127 // ********** Code for KeywordState ************** | 6126 // ********** Code for KeywordState ************** |
| 6128 function KeywordState() { | 6127 function KeywordState() { |
| 6129 // Initializers done | 6128 // Initializers done |
| 6130 } | 6129 } |
| 6131 KeywordState.prototype.is$KeywordState = function(){return this;}; | 6130 KeywordState.prototype.is$KeywordState = function(){return this;}; |
| 6132 KeywordState.get$KEYWORD_STATE = function() { | 6131 KeywordState.get$KEYWORD_STATE = function() { |
| 6133 if (KeywordState._KEYWORD_STATE == null) { | 6132 if ($globals.KeywordState__KEYWORD_STATE == null) { |
| 6134 var strings = new ListFactory(const$110/*Keyword.values*/.get$length()); | 6133 var strings = new ListFactory(const$112/*Keyword.values*/.get$length()); |
| 6135 for (var i = 0; | 6134 for (var i = 0; |
| 6136 i < const$110/*Keyword.values*/.get$length(); i++) { | 6135 i < const$112/*Keyword.values*/.get$length(); i++) { |
| 6137 strings.$setindex(i, const$110/*Keyword.values*/[i].get$syntax()); | 6136 strings.$setindex(i, const$112/*Keyword.values*/[i].get$syntax()); |
| 6138 } | 6137 } |
| 6139 strings.sort((function (a, b) { | 6138 strings.sort((function (a, b) { |
| 6140 return a.compareTo$1(b); | 6139 return a.compareTo$1(b); |
| 6141 }) | 6140 }) |
| 6142 ); | 6141 ); |
| 6143 KeywordState._KEYWORD_STATE = KeywordState.computeKeywordStateTable(0, strin
gs, 0, strings.length); | 6142 $globals.KeywordState__KEYWORD_STATE = KeywordState.computeKeywordStateTable
(0, strings, 0, strings.length); |
| 6144 } | 6143 } |
| 6145 return KeywordState._KEYWORD_STATE; | 6144 return $globals.KeywordState__KEYWORD_STATE; |
| 6146 } | 6145 } |
| 6147 KeywordState.computeKeywordStateTable = function(start, strings, offset, length)
{ | 6146 KeywordState.computeKeywordStateTable = function(start, strings, offset, length)
{ |
| 6148 var result = new ListFactory(26); | 6147 var result = new ListFactory(26); |
| 6149 $assert(length != 0, "length != 0", "keyword.dart", 161, 12); | 6148 $assert(length != 0, "length != 0", "keyword.dart", 161, 12); |
| 6150 var chunk = 0; | 6149 var chunk = 0; |
| 6151 var chunkStart = -1; | 6150 var chunkStart = -1; |
| 6152 for (var i = offset; | 6151 for (var i = offset; |
| 6153 i < offset + length; i++) { | 6152 i < offset + length; i++) { |
| 6154 if (strings.$index(i).length > start) { | 6153 if (strings.$index(i).length > start) { |
| 6155 var c = $assert_num(strings.$index(i).charCodeAt$1(start)); | 6154 var c = $assert_num(strings.$index(i).charCodeAt$1(start)); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6330 function Send(receiver, selector, argumentsNode) { | 6329 function Send(receiver, selector, argumentsNode) { |
| 6331 this.receiver = receiver; | 6330 this.receiver = receiver; |
| 6332 this.selector = selector; | 6331 this.selector = selector; |
| 6333 this.argumentsNode = argumentsNode; | 6332 this.argumentsNode = argumentsNode; |
| 6334 // Initializers done | 6333 // Initializers done |
| 6335 Expression.call(this); | 6334 Expression.call(this); |
| 6336 } | 6335 } |
| 6337 Send.postfix$ctor = function(receiver, selector) { | 6336 Send.postfix$ctor = function(receiver, selector) { |
| 6338 this.receiver = receiver; | 6337 this.receiver = receiver; |
| 6339 this.selector = selector; | 6338 this.selector = selector; |
| 6340 this.argumentsNode = const$211/*const Postfix()*/; | 6339 this.argumentsNode = const$213/*const Postfix()*/; |
| 6341 // Initializers done | 6340 // Initializers done |
| 6342 Expression.call(this); | 6341 Expression.call(this); |
| 6343 } | 6342 } |
| 6344 Send.postfix$ctor.prototype = Send.prototype; | 6343 Send.postfix$ctor.prototype = Send.prototype; |
| 6345 Send.prefix$ctor = function(receiver, selector) { | 6344 Send.prefix$ctor = function(receiver, selector) { |
| 6346 this.receiver = receiver; | 6345 this.receiver = receiver; |
| 6347 this.selector = selector; | 6346 this.selector = selector; |
| 6348 this.argumentsNode = const$210/*const Prefix()*/; | 6347 this.argumentsNode = const$212/*const Prefix()*/; |
| 6349 // Initializers done | 6348 // Initializers done |
| 6350 Expression.call(this); | 6349 Expression.call(this); |
| 6351 } | 6350 } |
| 6352 Send.prefix$ctor.prototype = Send.prototype; | 6351 Send.prefix$ctor.prototype = Send.prototype; |
| 6353 $inherits(Send, Expression); | 6352 $inherits(Send, Expression); |
| 6354 Send.prototype.is$Send = function(){return this;}; | 6353 Send.prototype.is$Send = function(){return this;}; |
| 6355 Send.prototype.get$arguments = function() { | 6354 Send.prototype.get$arguments = function() { |
| 6356 return this.argumentsNode.nodes; | 6355 return this.argumentsNode.nodes; |
| 6357 } | 6356 } |
| 6358 Send.prototype.accept = function(visitor) { | 6357 Send.prototype.accept = function(visitor) { |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6690 return this.accept(($0 && $0.is$Visitor())); | 6689 return this.accept(($0 && $0.is$Visitor())); |
| 6691 }; | 6690 }; |
| 6692 // ********** Code for LiteralBool ************** | 6691 // ********** Code for LiteralBool ************** |
| 6693 function LiteralBool(token, handler) { | 6692 function LiteralBool(token, handler) { |
| 6694 // Initializers done | 6693 // Initializers done |
| 6695 Literal$bool.call(this, token, handler); | 6694 Literal$bool.call(this, token, handler); |
| 6696 } | 6695 } |
| 6697 $inherits(LiteralBool, Literal$bool); | 6696 $inherits(LiteralBool, Literal$bool); |
| 6698 LiteralBool.prototype.get$value = function() { | 6697 LiteralBool.prototype.get$value = function() { |
| 6699 switch (this.token.get$value()) { | 6698 switch (this.token.get$value()) { |
| 6700 case const$66/*Keyword.TRUE*/: | 6699 case const$68/*Keyword.TRUE*/: |
| 6701 | 6700 |
| 6702 return true; | 6701 return true; |
| 6703 | 6702 |
| 6704 case const$38/*Keyword.FALSE*/: | 6703 case const$40/*Keyword.FALSE*/: |
| 6705 | 6704 |
| 6706 return false; | 6705 return false; |
| 6707 | 6706 |
| 6708 default: | 6707 default: |
| 6709 | 6708 |
| 6710 (this.handler)(this.token, ("not a bool " + this.token.get$value())); | 6709 (this.handler)(this.token, ("not a bool " + this.token.get$value())); |
| 6711 | 6710 |
| 6712 } | 6711 } |
| 6713 } | 6712 } |
| 6714 LiteralBool.prototype.accept = function(visitor) { | 6713 LiteralBool.prototype.accept = function(visitor) { |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7057 Unparser.prototype.visitVariableDefinitions = function(node) { | 7056 Unparser.prototype.visitVariableDefinitions = function(node) { |
| 7058 var $0; | 7057 var $0; |
| 7059 if (node.type != null) { | 7058 if (node.type != null) { |
| 7060 this.visit(node.type); | 7059 this.visit(node.type); |
| 7061 } | 7060 } |
| 7062 else { | 7061 else { |
| 7063 this.sb.add('var'); | 7062 this.sb.add('var'); |
| 7064 } | 7063 } |
| 7065 this.sb.add(' '); | 7064 this.sb.add(' '); |
| 7066 this.visit(node.definitions); | 7065 this.visit(node.definitions); |
| 7067 if ($notnull_bool($eq(node.endToken.get$value(), const$208/*const SourceString
(';')*/))) { | 7066 if ($notnull_bool($eq(node.endToken.get$value(), const$210/*const SourceString
(';')*/))) { |
| 7068 this.add((($0 = node.endToken.get$value()) && $0.is$SourceString())); | 7067 this.add((($0 = node.endToken.get$value()) && $0.is$SourceString())); |
| 7069 } | 7068 } |
| 7070 } | 7069 } |
| 7071 Unparser.prototype.add$1 = function($0) { | 7070 Unparser.prototype.add$1 = function($0) { |
| 7072 return this.add(($0 && $0.is$SourceString())); | 7071 return this.add(($0 && $0.is$SourceString())); |
| 7073 }; | 7072 }; |
| 7074 Unparser.prototype.visit$1 = function($0) { | 7073 Unparser.prototype.visit$1 = function($0) { |
| 7075 return this.visit(($0 && $0.is$Node())); | 7074 return this.visit(($0 && $0.is$Node())); |
| 7076 }; | 7075 }; |
| 7077 // ********** Code for top level ************** | 7076 // ********** Code for top level ************** |
| (...skipping 25 matching lines...) Expand all Loading... |
| 7103 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); | 7102 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); |
| 7104 }; | 7103 }; |
| 7105 Element.prototype.hashCode$0 = function() { | 7104 Element.prototype.hashCode$0 = function() { |
| 7106 return this.hashCode(); | 7105 return this.hashCode(); |
| 7107 }; | 7106 }; |
| 7108 // ********** Code for VariableElement ************** | 7107 // ********** Code for VariableElement ************** |
| 7109 function VariableElement(node, typeAnnotation, name, enclosingElement) { | 7108 function VariableElement(node, typeAnnotation, name, enclosingElement) { |
| 7110 this.node = node; | 7109 this.node = node; |
| 7111 this.typeAnnotation = typeAnnotation; | 7110 this.typeAnnotation = typeAnnotation; |
| 7112 // Initializers done | 7111 // Initializers done |
| 7113 Element.call(this, name, const$230, enclosingElement); | 7112 Element.call(this, name, const$232, enclosingElement); |
| 7114 } | 7113 } |
| 7115 $inherits(VariableElement, Element); | 7114 $inherits(VariableElement, Element); |
| 7116 VariableElement.prototype.get$type = function() { return this.type; }; | 7115 VariableElement.prototype.get$type = function() { return this.type; }; |
| 7117 VariableElement.prototype.set$type = function(value) { return this.type = value;
}; | 7116 VariableElement.prototype.set$type = function(value) { return this.type = value;
}; |
| 7118 VariableElement.prototype.parseNode = function(canceler, logger) { | 7117 VariableElement.prototype.parseNode = function(canceler, logger) { |
| 7119 return this.node; | 7118 return this.node; |
| 7120 } | 7119 } |
| 7121 VariableElement.prototype.computeType = function(compiler, types) { | 7120 VariableElement.prototype.computeType = function(compiler, types) { |
| 7122 return getType(this.typeAnnotation, types); | 7121 return getType(this.typeAnnotation, types); |
| 7123 } | 7122 } |
| 7124 VariableElement.prototype.computeType$2 = function($0, $1) { | 7123 VariableElement.prototype.computeType$2 = function($0, $1) { |
| 7125 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); | 7124 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); |
| 7126 }; | 7125 }; |
| 7127 // ********** Code for ForeignElement ************** | 7126 // ********** Code for ForeignElement ************** |
| 7128 function ForeignElement(name) { | 7127 function ForeignElement(name) { |
| 7129 // Initializers done | 7128 // Initializers done |
| 7130 Element.call(this, name, const$204, null); | 7129 Element.call(this, name, const$206, null); |
| 7131 } | 7130 } |
| 7132 $inherits(ForeignElement, Element); | 7131 $inherits(ForeignElement, Element); |
| 7133 ForeignElement.prototype.computeType = function(compiler, types) { | 7132 ForeignElement.prototype.computeType = function(compiler, types) { |
| 7134 return types.dynamicType; | 7133 return types.dynamicType; |
| 7135 } | 7134 } |
| 7136 ForeignElement.prototype.computeType$2 = function($0, $1) { | 7135 ForeignElement.prototype.computeType$2 = function($0, $1) { |
| 7137 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); | 7136 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); |
| 7138 }; | 7137 }; |
| 7139 // ********** Code for FunctionElement ************** | 7138 // ********** Code for FunctionElement ************** |
| 7140 function FunctionElement(name) { | 7139 function FunctionElement(name) { |
| 7141 // Initializers done | 7140 // Initializers done |
| 7142 Element.call(this, name, const$201, null); | 7141 Element.call(this, name, const$203, null); |
| 7143 } | 7142 } |
| 7144 $inherits(FunctionElement, Element); | 7143 $inherits(FunctionElement, Element); |
| 7145 FunctionElement.prototype.get$type = function() { return this.type; }; | 7144 FunctionElement.prototype.get$type = function() { return this.type; }; |
| 7146 FunctionElement.prototype.set$type = function(value) { return this.type = value;
}; | 7145 FunctionElement.prototype.set$type = function(value) { return this.type = value;
}; |
| 7147 FunctionElement.prototype.computeType = function(compiler, types) { | 7146 FunctionElement.prototype.computeType = function(compiler, types) { |
| 7148 var $0; | 7147 var $0; |
| 7149 if (this.type != null) return (($0 = this.type) && $0.is$FunctionType()); | 7148 if (this.type != null) return (($0 = this.type) && $0.is$FunctionType()); |
| 7150 var node = (($0 = this.parseNode(compiler, compiler)) && $0.is$FunctionExpress
ion()); | 7149 var node = (($0 = this.parseNode(compiler, compiler)) && $0.is$FunctionExpress
ion()); |
| 7151 var returnType = getType(node.returnType, types); | 7150 var returnType = getType(node.returnType, types); |
| 7152 if (returnType == null) compiler.cancel(('unknown type ' + returnType)); | 7151 if (returnType == null) compiler.cancel(('unknown type ' + returnType)); |
| 7153 var parameterTypes = new LinkBuilderImplementation(); | 7152 var parameterTypes = new LinkBuilderImplementation(); |
| 7154 for (var link = node.parameters.nodes; | 7153 for (var link = node.parameters.nodes; |
| 7155 !$notnull_bool(link.isEmpty$0()); link = link.get$tail()) { | 7154 !$notnull_bool(link.isEmpty$0()); link = link.get$tail()) { |
| 7156 var parameter = (($0 = link.get$head()) && $0.is$VariableDefinitions()); | 7155 var parameter = (($0 = link.get$head()) && $0.is$VariableDefinitions()); |
| 7157 parameterTypes.addLast(getType(parameter.type, types)); | 7156 parameterTypes.addLast(getType(parameter.type, types)); |
| 7158 } | 7157 } |
| 7159 this.type = new FunctionType(returnType, (($0 = parameterTypes.toLink()) && $0
.is$Link$Type())); | 7158 this.type = new FunctionType(returnType, (($0 = parameterTypes.toLink()) && $0
.is$Link$Type())); |
| 7160 return (($0 = this.type) && $0.is$FunctionType()); | 7159 return (($0 = this.type) && $0.is$FunctionType()); |
| 7161 } | 7160 } |
| 7162 FunctionElement.prototype.computeType$2 = FunctionElement.prototype.computeType; | 7161 FunctionElement.prototype.computeType$2 = FunctionElement.prototype.computeType; |
| 7163 // ********** Code for ClassElement ************** | 7162 // ********** Code for ClassElement ************** |
| 7164 function ClassElement(name) { | 7163 function ClassElement(name) { |
| 7165 this.interfaces = const$14/*const EmptyLink<Token>()*/ | 7164 this.interfaces = const$16/*const EmptyLink<Token>()*/ |
| 7166 this.isResolved = false | 7165 this.isResolved = false |
| 7167 // Initializers done | 7166 // Initializers done |
| 7168 Element.call(this, name, const$199, null); | 7167 Element.call(this, name, const$201, null); |
| 7169 } | 7168 } |
| 7170 $inherits(ClassElement, Element); | 7169 $inherits(ClassElement, Element); |
| 7171 ClassElement.prototype.is$ClassElement = function(){return this;}; | 7170 ClassElement.prototype.is$ClassElement = function(){return this;}; |
| 7172 ClassElement.prototype.get$type = function() { return this.type; }; | 7171 ClassElement.prototype.get$type = function() { return this.type; }; |
| 7173 ClassElement.prototype.set$type = function(value) { return this.type = value; }; | 7172 ClassElement.prototype.set$type = function(value) { return this.type = value; }; |
| 7174 ClassElement.prototype.get$interfaces = function() { return this.interfaces; }; | 7173 ClassElement.prototype.get$interfaces = function() { return this.interfaces; }; |
| 7175 ClassElement.prototype.set$interfaces = function(value) { return this.interfaces
= value; }; | 7174 ClassElement.prototype.set$interfaces = function(value) { return this.interfaces
= value; }; |
| 7176 ClassElement.prototype.computeType = function(compiler, types) { | 7175 ClassElement.prototype.computeType = function(compiler, types) { |
| 7177 if (this.type == null) { | 7176 if (this.type == null) { |
| 7178 this.type = new SimpleType(this.name, this); | 7177 this.type = new SimpleType(this.name, this); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 7205 $inherits(SsaBuilderTask, CompilerTask); | 7204 $inherits(SsaBuilderTask, CompilerTask); |
| 7206 SsaBuilderTask.prototype.get$name = function() { | 7205 SsaBuilderTask.prototype.get$name = function() { |
| 7207 return 'SSA builder'; | 7206 return 'SSA builder'; |
| 7208 } | 7207 } |
| 7209 SsaBuilderTask.prototype.build = function(tree, elements) { | 7208 SsaBuilderTask.prototype.build = function(tree, elements) { |
| 7210 var $this = this; // closure support | 7209 var $this = this; // closure support |
| 7211 var $0; | 7210 var $0; |
| 7212 return (($0 = this.measure((function () { | 7211 return (($0 = this.measure((function () { |
| 7213 var $0; | 7212 var $0; |
| 7214 var function_ = (tree && tree.is$FunctionExpression()); | 7213 var function_ = (tree && tree.is$FunctionExpression()); |
| 7215 HInstruction.idCounter = 0; | 7214 $globals.HInstruction_idCounter = 0; |
| 7216 var graph = $this.compileMethod(function_.parameters, function_.body, elemen
ts); | 7215 var graph = $this.compileMethod(function_.parameters, function_.body, elemen
ts); |
| 7217 $assert(graph.isValid(), "graph.isValid()", "builder.dart", 15, 14); | 7216 $assert(graph.isValid(), "graph.isValid()", "builder.dart", 15, 14); |
| 7218 if (false/*null.GENERATE_SSA_TRACE*/) { | 7217 if (false/*null.GENERATE_SSA_TRACE*/) { |
| 7219 var name = (($0 = function_.name) && $0.is$Identifier()); | 7218 var name = (($0 = function_.name) && $0.is$Identifier()); |
| 7220 HTracer.HTracer$singleton$factory().traceCompilation(name.get$source().toS
tring()); | 7219 HTracer.HTracer$singleton$factory().traceCompilation(name.get$source().toS
tring()); |
| 7221 HTracer.HTracer$singleton$factory().traceGraph('builder', graph); | 7220 HTracer.HTracer$singleton$factory().traceGraph('builder', graph); |
| 7222 } | 7221 } |
| 7223 return graph; | 7222 return graph; |
| 7224 }) | 7223 }) |
| 7225 )) && $0.is$HGraph()); | 7224 )) && $0.is$HGraph()); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7475 this.stack.add(result); | 7474 this.stack.add(result); |
| 7476 } | 7475 } |
| 7477 SsaBuilder.prototype.visitLogicalOr = function(node) { | 7476 SsaBuilder.prototype.visitLogicalOr = function(node) { |
| 7478 this.compiler.unimplemented("SsaBuilder.visitLogicalOr"); | 7477 this.compiler.unimplemented("SsaBuilder.visitLogicalOr"); |
| 7479 } | 7478 } |
| 7480 SsaBuilder.prototype.visitSend = function(node) { | 7479 SsaBuilder.prototype.visitSend = function(node) { |
| 7481 var $0; | 7480 var $0; |
| 7482 var element = (($0 = this.elements.$index(node)) && $0.is$Element()); | 7481 var element = (($0 = this.elements.$index(node)) && $0.is$Element()); |
| 7483 if ((node.selector instanceof Operator)) { | 7482 if ((node.selector instanceof Operator)) { |
| 7484 var op = (($0 = node.selector) && $0.is$Operator()); | 7483 var op = (($0 = node.selector) && $0.is$Operator()); |
| 7485 if ($notnull_bool($eq(const$255/*const SourceString("&&")*/, op.get$source()
))) { | 7484 if ($notnull_bool($eq(const$257/*const SourceString("&&")*/, op.get$source()
))) { |
| 7486 this.visitLogicalAnd(node); | 7485 this.visitLogicalAnd(node); |
| 7487 return; | 7486 return; |
| 7488 } | 7487 } |
| 7489 else if ($notnull_bool($eq(const$256/*const SourceString("||")*/, op.get$sou
rce()))) { | 7488 else if ($notnull_bool($eq(const$258/*const SourceString("||")*/, op.get$sou
rce()))) { |
| 7490 this.visitLogicalOr(node); | 7489 this.visitLogicalOr(node); |
| 7491 return; | 7490 return; |
| 7492 } | 7491 } |
| 7493 this.visit(node.receiver); | 7492 this.visit(node.receiver); |
| 7494 this.visit(node.argumentsNode); | 7493 this.visit(node.argumentsNode); |
| 7495 var right = this.pop(); | 7494 var right = this.pop(); |
| 7496 var left = this.pop(); | 7495 var left = this.pop(); |
| 7497 if ($notnull_bool($eq(const$257/*const SourceString("+")*/, op.get$source())
)) { | 7496 if ($notnull_bool($eq(const$259/*const SourceString("+")*/, op.get$source())
)) { |
| 7498 this.push(new HAdd(element, [left, right])); | 7497 this.push(new HAdd(element, [left, right])); |
| 7499 } | 7498 } |
| 7500 else if ($notnull_bool($eq(const$258/*const SourceString("-")*/, op.get$sour
ce()))) { | 7499 else if ($notnull_bool($eq(const$260/*const SourceString("-")*/, op.get$sour
ce()))) { |
| 7501 this.push(new HSubtract(element, [left, right])); | 7500 this.push(new HSubtract(element, [left, right])); |
| 7502 } | 7501 } |
| 7503 else if ($notnull_bool($eq(const$259/*const SourceString("*")*/, op.get$sour
ce()))) { | 7502 else if ($notnull_bool($eq(const$261/*const SourceString("*")*/, op.get$sour
ce()))) { |
| 7504 this.push(new HMultiply(element, [left, right])); | 7503 this.push(new HMultiply(element, [left, right])); |
| 7505 } | 7504 } |
| 7506 else if ($notnull_bool($eq(const$260/*const SourceString("/")*/, op.get$sour
ce()))) { | 7505 else if ($notnull_bool($eq(const$262/*const SourceString("/")*/, op.get$sour
ce()))) { |
| 7507 this.push(new HDivide(element, [left, right])); | 7506 this.push(new HDivide(element, [left, right])); |
| 7508 } | 7507 } |
| 7509 else if ($notnull_bool($eq(const$261/*const SourceString("~/")*/, op.get$sou
rce()))) { | 7508 else if ($notnull_bool($eq(const$263/*const SourceString("~/")*/, op.get$sou
rce()))) { |
| 7510 this.push(new HTruncatingDivide(element, [left, right])); | 7509 this.push(new HTruncatingDivide(element, [left, right])); |
| 7511 } | 7510 } |
| 7512 else if ($notnull_bool($eq(const$262/*const SourceString("==")*/, op.get$sou
rce()))) { | 7511 else if ($notnull_bool($eq(const$264/*const SourceString("==")*/, op.get$sou
rce()))) { |
| 7513 this.push(new HEquals(element, [left, right])); | 7512 this.push(new HEquals(element, [left, right])); |
| 7514 } | 7513 } |
| 7515 } | 7514 } |
| 7516 else if ($notnull_bool(node.get$isPropertyAccess())) { | 7515 else if ($notnull_bool(node.get$isPropertyAccess())) { |
| 7517 if (node.receiver != null) { | 7516 if (node.receiver != null) { |
| 7518 this.compiler.unimplemented("SsaBuilder.visitSend with receiver"); | 7517 this.compiler.unimplemented("SsaBuilder.visitSend with receiver"); |
| 7519 } | 7518 } |
| 7520 this.stack.add(this.definitions.$index(element)); | 7519 this.stack.add(this.definitions.$index(element)); |
| 7521 } | 7520 } |
| 7522 else { | 7521 else { |
| 7523 var link = node.get$arguments(); | 7522 var link = node.get$arguments(); |
| 7524 if (element.kind === const$204/*ElementKind.FOREIGN*/) { | 7523 if (element.kind === const$206/*ElementKind.FOREIGN*/) { |
| 7525 link = (($0 = link.get$tail()) && $0.is$Link$Node()); | 7524 link = (($0 = link.get$tail()) && $0.is$Link$Node()); |
| 7526 } | 7525 } |
| 7527 var arguments = []; | 7526 var arguments = []; |
| 7528 for (; !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.
is$Link$Node())) { | 7527 for (; !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.
is$Link$Node())) { |
| 7529 this.visit((($0 = link.get$head()) && $0.is$Node())); | 7528 this.visit((($0 = link.get$head()) && $0.is$Node())); |
| 7530 arguments.add$1(this.pop()); | 7529 arguments.add$1(this.pop()); |
| 7531 } | 7530 } |
| 7532 if (element.kind === const$204/*ElementKind.FOREIGN*/) { | 7531 if (element.kind === const$206/*ElementKind.FOREIGN*/) { |
| 7533 var literal = (($0 = node.get$arguments().get$head()) && $0.is$LiteralStri
ng()); | 7532 var literal = (($0 = node.get$arguments().get$head()) && $0.is$LiteralStri
ng()); |
| 7534 this.compiler.ensure((literal instanceof LiteralString)); | 7533 this.compiler.ensure((literal instanceof LiteralString)); |
| 7535 this.push(new HInvokeForeign(element, arguments, this.unquote(literal))); | 7534 this.push(new HInvokeForeign(element, arguments, this.unquote(literal))); |
| 7536 } | 7535 } |
| 7537 else { | 7536 else { |
| 7538 var selector = (($0 = node.selector) && $0.is$Identifier()); | 7537 var selector = (($0 = node.selector) && $0.is$Identifier()); |
| 7539 this.push(new HInvoke(element, arguments)); | 7538 this.push(new HInvoke(element, arguments)); |
| 7540 } | 7539 } |
| 7541 } | 7540 } |
| 7542 } | 7541 } |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7908 var $0; | 7907 var $0; |
| 7909 this.buffer.add(('' + this.local((($0 = node.inputs.$index(0)) && $0.is$HLocal
())))); | 7908 this.buffer.add(('' + this.local((($0 = node.inputs.$index(0)) && $0.is$HLocal
())))); |
| 7910 } | 7909 } |
| 7911 SsaCodeGenerator.prototype.visitLocal = function(node) { | 7910 SsaCodeGenerator.prototype.visitLocal = function(node) { |
| 7912 this.buffer.add(('var ' + this.local(node))); | 7911 this.buffer.add(('var ' + this.local(node))); |
| 7913 } | 7912 } |
| 7914 SsaCodeGenerator.prototype.visit$1 = SsaCodeGenerator.prototype.visit; | 7913 SsaCodeGenerator.prototype.visit$1 = SsaCodeGenerator.prototype.visit; |
| 7915 // ********** Code for JsNames ************** | 7914 // ********** Code for JsNames ************** |
| 7916 function JsNames() {} | 7915 function JsNames() {} |
| 7917 JsNames.get$reserved = function() { | 7916 JsNames.get$reserved = function() { |
| 7918 if (JsNames._reserved == null) { | 7917 if ($globals.JsNames__reserved == null) { |
| 7919 JsNames._reserved = new HashSetImplementation(); | 7918 $globals.JsNames__reserved = new HashSetImplementation(); |
| 7920 JsNames._reserved.addAll(const$265/*JsNames.reservedPropertySymbols*/); | 7919 $globals.JsNames__reserved.addAll(const$267/*JsNames.reservedPropertySymbols
*/); |
| 7921 JsNames._reserved.addAll(const$267/*JsNames.reservedGlobalSymbols*/); | 7920 $globals.JsNames__reserved.addAll(const$269/*JsNames.reservedGlobalSymbols*/
); |
| 7922 JsNames._reserved.addAll(const$269/*JsNames.javaScriptKeywords*/); | 7921 $globals.JsNames__reserved.addAll(const$271/*JsNames.javaScriptKeywords*/); |
| 7923 } | 7922 } |
| 7924 return JsNames._reserved; | 7923 return $globals.JsNames__reserved; |
| 7925 } | 7924 } |
| 7926 JsNames.getValid = function(name) { | 7925 JsNames.getValid = function(name) { |
| 7927 if (JsNames.get$reserved().contains(name)) { | 7926 if (JsNames.get$reserved().contains(name)) { |
| 7928 name = ('\$' + name); | 7927 name = ('\$' + name); |
| 7929 $assert(!JsNames.get$reserved().contains(name), "!reserved.contains(name)",
"js_names.dart", 171, 14); | 7928 $assert(!JsNames.get$reserved().contains(name), "!reserved.contains(name)",
"js_names.dart", 171, 14); |
| 7930 } | 7929 } |
| 7931 else if (name.contains("$")) { | 7930 else if (name.contains("$")) { |
| 7932 name = name.replaceAll("$", "_$"); | 7931 name = name.replaceAll("$", "_$"); |
| 7933 } | 7932 } |
| 7934 return name; | 7933 return name; |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8207 // Initializers done | 8206 // Initializers done |
| 8208 HBasicBlock.withId$ctor.call(this, null); | 8207 HBasicBlock.withId$ctor.call(this, null); |
| 8209 } | 8208 } |
| 8210 HBasicBlock.withId$ctor = function(id) { | 8209 HBasicBlock.withId$ctor = function(id) { |
| 8211 this.status = 0/*HBasicBlock.STATUS_NEW*/ | 8210 this.status = 0/*HBasicBlock.STATUS_NEW*/ |
| 8212 this.isLoopHeader = false | 8211 this.isLoopHeader = false |
| 8213 this.dominator = null | 8212 this.dominator = null |
| 8214 this.id = id; | 8213 this.id = id; |
| 8215 this.phis = new HInstructionList(); | 8214 this.phis = new HInstructionList(); |
| 8216 this.predecessors = []; | 8215 this.predecessors = []; |
| 8217 this.successors = const$13/*const []*/; | 8216 this.successors = const$15/*const []*/; |
| 8218 this.dominatedBlocks = []; | 8217 this.dominatedBlocks = []; |
| 8219 // Initializers done | 8218 // Initializers done |
| 8220 HInstructionList.call(this); | 8219 HInstructionList.call(this); |
| 8221 } | 8220 } |
| 8222 HBasicBlock.withId$ctor.prototype = HBasicBlock.prototype; | 8221 HBasicBlock.withId$ctor.prototype = HBasicBlock.prototype; |
| 8223 $inherits(HBasicBlock, HInstructionList); | 8222 $inherits(HBasicBlock, HInstructionList); |
| 8224 HBasicBlock.prototype.is$HBasicBlock = function(){return this;}; | 8223 HBasicBlock.prototype.is$HBasicBlock = function(){return this;}; |
| 8225 HBasicBlock.prototype.get$id = function() { return this.id; }; | 8224 HBasicBlock.prototype.get$id = function() { return this.id; }; |
| 8226 HBasicBlock.prototype.set$id = function(value) { return this.id = value; }; | 8225 HBasicBlock.prototype.set$id = function(value) { return this.id = value; }; |
| 8227 HBasicBlock.prototype.isNew = function() { | 8226 HBasicBlock.prototype.isNew = function() { |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8380 }; | 8379 }; |
| 8381 // ********** Code for HInstruction ************** | 8380 // ********** Code for HInstruction ************** |
| 8382 function HInstruction(inputs) { | 8381 function HInstruction(inputs) { |
| 8383 this._usedBy = null | 8382 this._usedBy = null |
| 8384 this.previous = null | 8383 this.previous = null |
| 8385 this.next = null | 8384 this.next = null |
| 8386 this.flags = 0 | 8385 this.flags = 0 |
| 8387 this.inputs = inputs; | 8386 this.inputs = inputs; |
| 8388 // Initializers done | 8387 // Initializers done |
| 8389 this.prepareGvn(); | 8388 this.prepareGvn(); |
| 8390 this.id = HInstruction.idCounter++; | 8389 this.id = $globals.HInstruction_idCounter++; |
| 8391 } | 8390 } |
| 8392 HInstruction.prototype.is$HInstruction = function(){return this;}; | 8391 HInstruction.prototype.is$HInstruction = function(){return this;}; |
| 8393 HInstruction.prototype.get$id = function() { return this.id; }; | 8392 HInstruction.prototype.get$id = function() { return this.id; }; |
| 8394 HInstruction.prototype.set$id = function(value) { return this.id = value; }; | 8393 HInstruction.prototype.set$id = function(value) { return this.id = value; }; |
| 8395 HInstruction.prototype.get$inputs = function() { return this.inputs; }; | 8394 HInstruction.prototype.get$inputs = function() { return this.inputs; }; |
| 8396 HInstruction.prototype.get$previous = function() { return this.previous; }; | 8395 HInstruction.prototype.get$previous = function() { return this.previous; }; |
| 8397 HInstruction.prototype.set$previous = function(value) { return this.previous = v
alue; }; | 8396 HInstruction.prototype.set$previous = function(value) { return this.previous = v
alue; }; |
| 8398 HInstruction.prototype.getFlag = function(position) { | 8397 HInstruction.prototype.getFlag = function(position) { |
| 8399 return (this.flags & (1 << position)) != 0; | 8398 return (this.flags & (1 << position)) != 0; |
| 8400 } | 8399 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 8425 HInstruction.prototype.setGenerateAtUseSite = function() { | 8424 HInstruction.prototype.setGenerateAtUseSite = function() { |
| 8426 this.setFlag(2/*HInstruction.FLAG_GENERATE_AT_USE_SITE*/); | 8425 this.setFlag(2/*HInstruction.FLAG_GENERATE_AT_USE_SITE*/); |
| 8427 } | 8426 } |
| 8428 HInstruction.prototype.useGvn = function() { | 8427 HInstruction.prototype.useGvn = function() { |
| 8429 return this.getFlag(3/*HInstruction.FLAG_USE_GVN*/); | 8428 return this.getFlag(3/*HInstruction.FLAG_USE_GVN*/); |
| 8430 } | 8429 } |
| 8431 HInstruction.prototype.setUseGvn = function() { | 8430 HInstruction.prototype.setUseGvn = function() { |
| 8432 this.setFlag(3/*HInstruction.FLAG_USE_GVN*/); | 8431 this.setFlag(3/*HInstruction.FLAG_USE_GVN*/); |
| 8433 } | 8432 } |
| 8434 HInstruction.prototype.get$usedBy = function() { | 8433 HInstruction.prototype.get$usedBy = function() { |
| 8435 if (this._usedBy == null) return const$13/*const []*/; | 8434 if (this._usedBy == null) return const$15/*const []*/; |
| 8436 return this._usedBy; | 8435 return this._usedBy; |
| 8437 } | 8436 } |
| 8438 HInstruction.prototype.isInBasicBlock = function() { | 8437 HInstruction.prototype.isInBasicBlock = function() { |
| 8439 return this._usedBy != null; | 8438 return this._usedBy != null; |
| 8440 } | 8439 } |
| 8441 HInstruction.prototype.equals = function(other) { | 8440 HInstruction.prototype.equals = function(other) { |
| 8442 $assert($notnull_bool(this.useGvn()) && $notnull_bool(other.useGvn()), "useGvn
() && other.useGvn()", "nodes.dart", 518, 12); | 8441 $assert($notnull_bool(this.useGvn()) && $notnull_bool(other.useGvn()), "useGvn
() && other.useGvn()", "nodes.dart", 518, 12); |
| 8443 if (!$notnull_bool(this.typeEquals(other))) return false; | 8442 if (!$notnull_bool(this.typeEquals(other))) return false; |
| 8444 if (this.flags != other.flags) return false; | 8443 if (this.flags != other.flags) return false; |
| 8445 var inputsLength = this.inputs.length; | 8444 var inputsLength = this.inputs.length; |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8729 } | 8728 } |
| 8730 HEquals.prototype.dataEquals = function(other) { | 8729 HEquals.prototype.dataEquals = function(other) { |
| 8731 return true; | 8730 return true; |
| 8732 } | 8731 } |
| 8733 HEquals.prototype.accept$1 = function($0) { | 8732 HEquals.prototype.accept$1 = function($0) { |
| 8734 return this.accept(($0 && $0.is$HVisitor())); | 8733 return this.accept(($0 && $0.is$HVisitor())); |
| 8735 }; | 8734 }; |
| 8736 // ********** Code for HExit ************** | 8735 // ********** Code for HExit ************** |
| 8737 function HExit() { | 8736 function HExit() { |
| 8738 // Initializers done | 8737 // Initializers done |
| 8739 HControlFlow.call(this, const$13/*const []*/); | 8738 HControlFlow.call(this, const$15/*const []*/); |
| 8740 } | 8739 } |
| 8741 $inherits(HExit, HControlFlow); | 8740 $inherits(HExit, HControlFlow); |
| 8742 HExit.prototype.toString = function() { | 8741 HExit.prototype.toString = function() { |
| 8743 return 'exit'; | 8742 return 'exit'; |
| 8744 } | 8743 } |
| 8745 HExit.prototype.accept = function(visitor) { | 8744 HExit.prototype.accept = function(visitor) { |
| 8746 return visitor.visitExit(this); | 8745 return visitor.visitExit(this); |
| 8747 } | 8746 } |
| 8748 HExit.prototype.accept$1 = function($0) { | 8747 HExit.prototype.accept$1 = function($0) { |
| 8749 return this.accept(($0 && $0.is$HVisitor())); | 8748 return this.accept(($0 && $0.is$HVisitor())); |
| 8750 }; | 8749 }; |
| 8751 HExit.prototype.toString$0 = function() { | 8750 HExit.prototype.toString$0 = function() { |
| 8752 return this.toString(); | 8751 return this.toString(); |
| 8753 }; | 8752 }; |
| 8754 // ********** Code for HGoto ************** | 8753 // ********** Code for HGoto ************** |
| 8755 function HGoto() { | 8754 function HGoto() { |
| 8756 // Initializers done | 8755 // Initializers done |
| 8757 HControlFlow.call(this, const$13/*const []*/); | 8756 HControlFlow.call(this, const$15/*const []*/); |
| 8758 } | 8757 } |
| 8759 $inherits(HGoto, HControlFlow); | 8758 $inherits(HGoto, HControlFlow); |
| 8760 HGoto.prototype.toString = function() { | 8759 HGoto.prototype.toString = function() { |
| 8761 return 'goto'; | 8760 return 'goto'; |
| 8762 } | 8761 } |
| 8763 HGoto.prototype.accept = function(visitor) { | 8762 HGoto.prototype.accept = function(visitor) { |
| 8764 return visitor.visitGoto(this); | 8763 return visitor.visitGoto(this); |
| 8765 } | 8764 } |
| 8766 HGoto.prototype.accept$1 = function($0) { | 8765 HGoto.prototype.accept$1 = function($0) { |
| 8767 return this.accept(($0 && $0.is$HVisitor())); | 8766 return this.accept(($0 && $0.is$HVisitor())); |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9254 function HTracer() {} | 9253 function HTracer() {} |
| 9255 HTracer._internal$ctor = function() { | 9254 HTracer._internal$ctor = function() { |
| 9256 this.indent = 0 | 9255 this.indent = 0 |
| 9257 this.output = new StringBufferImpl(""); | 9256 this.output = new StringBufferImpl(""); |
| 9258 // Initializers done | 9257 // Initializers done |
| 9259 HGraphVisitor.call(this); | 9258 HGraphVisitor.call(this); |
| 9260 } | 9259 } |
| 9261 HTracer._internal$ctor.prototype = HTracer.prototype; | 9260 HTracer._internal$ctor.prototype = HTracer.prototype; |
| 9262 $inherits(HTracer, HGraphVisitor); | 9261 $inherits(HTracer, HGraphVisitor); |
| 9263 HTracer.HTracer$singleton$factory = function() { | 9262 HTracer.HTracer$singleton$factory = function() { |
| 9264 if (HTracer._singleton == null) HTracer._singleton = new HTracer._internal$cto
r(); | 9263 if ($globals.HTracer__singleton == null) $globals.HTracer__singleton = new HTr
acer._internal$ctor(); |
| 9265 return HTracer._singleton; | 9264 return $globals.HTracer__singleton; |
| 9266 } | 9265 } |
| 9267 HTracer.prototype.traceCompilation = function(methodName) { | 9266 HTracer.prototype.traceCompilation = function(methodName) { |
| 9268 var $this = this; // closure support | 9267 var $this = this; // closure support |
| 9269 this.tag("compilation", (function () { | 9268 this.tag("compilation", (function () { |
| 9270 $this.printProperty("name", methodName); | 9269 $this.printProperty("name", methodName); |
| 9271 $this.printProperty("method", methodName); | 9270 $this.printProperty("method", methodName); |
| 9272 $this.printProperty("date", new DateImplementation.now$ctor().value); | 9271 $this.printProperty("date", new DateImplementation.now$ctor().value); |
| 9273 }) | 9272 }) |
| 9274 ); | 9273 ); |
| 9275 } | 9274 } |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9715 // ********** Code for top level ************** | 9714 // ********** Code for top level ************** |
| 9716 // ********** Library leg ************** | 9715 // ********** Library leg ************** |
| 9717 // ********** Code for WorldCompiler ************** | 9716 // ********** Code for WorldCompiler ************** |
| 9718 function WorldCompiler(world, script) { | 9717 function WorldCompiler(world, script) { |
| 9719 this.world = world; | 9718 this.world = world; |
| 9720 // Initializers done | 9719 // Initializers done |
| 9721 Compiler.call(this, script); | 9720 Compiler.call(this, script); |
| 9722 } | 9721 } |
| 9723 $inherits(WorldCompiler, Compiler); | 9722 $inherits(WorldCompiler, Compiler); |
| 9724 WorldCompiler.prototype.log = function(message) { | 9723 WorldCompiler.prototype.log = function(message) { |
| 9725 if ($notnull_bool(options.showInfo)) { | 9724 if ($notnull_bool($globals.options.showInfo)) { |
| 9726 this.world.info(('[leg] ' + message)); | 9725 this.world.info(('[leg] ' + message)); |
| 9727 } | 9726 } |
| 9728 } | 9727 } |
| 9729 WorldCompiler.prototype.run = function() { | 9728 WorldCompiler.prototype.run = function() { |
| 9730 var success = Compiler.prototype.run.call(this); | 9729 var success = Compiler.prototype.run.call(this); |
| 9731 if ($notnull_bool(success)) { | 9730 if ($notnull_bool(success)) { |
| 9732 var code = this.getGeneratedCode(); | 9731 var code = this.getGeneratedCode(); |
| 9733 this.world.legCode = $assert_String(code); | 9732 this.world.legCode = $assert_String(code); |
| 9734 this.world.jsBytesWritten = $assert_num(code.length); | 9733 this.world.jsBytesWritten = $assert_num(code.length); |
| 9735 var $list = this.tasks; | 9734 var $list = this.tasks; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9797 if (false/*null.GENERATE_SSA_TRACE*/) { | 9796 if (false/*null.GENERATE_SSA_TRACE*/) { |
| 9798 print("------------------"); | 9797 print("------------------"); |
| 9799 print(HTracer.HTracer$singleton$factory()); | 9798 print(HTracer.HTracer$singleton$factory()); |
| 9800 print("------------------"); | 9799 print("------------------"); |
| 9801 } | 9800 } |
| 9802 this.log('compilation succeeded'); | 9801 this.log('compilation succeeded'); |
| 9803 return true; | 9802 return true; |
| 9804 } | 9803 } |
| 9805 Compiler.prototype.scanCoreLibrary = function() { | 9804 Compiler.prototype.scanCoreLibrary = function() { |
| 9806 var $0; | 9805 var $0; |
| 9807 var fileName = join([options.libDir, '..', 'leg', 'lib', 'core.dart']); | 9806 var fileName = join([$globals.options.libDir, '..', 'leg', 'lib', 'core.dart']
); |
| 9808 var file = (($0 = readSync(fileName)) && $0.is$SourceFile()); | 9807 var file = (($0 = readSync(fileName)) && $0.is$SourceFile()); |
| 9809 this.scanner.scan(new leg_Script(file)); | 9808 this.scanner.scan(new leg_Script(file)); |
| 9810 var element = new ForeignElement(const$203/*const SourceString('JS')*/); | 9809 var element = new ForeignElement(const$205/*const SourceString('JS')*/); |
| 9811 this.universe.define(element); | 9810 this.universe.define(element); |
| 9812 } | 9811 } |
| 9813 Compiler.prototype.runCompiler = function() { | 9812 Compiler.prototype.runCompiler = function() { |
| 9814 var $0; | 9813 var $0; |
| 9815 this.scanCoreLibrary(); | 9814 this.scanCoreLibrary(); |
| 9816 this.scanner.scan(this.script); | 9815 this.scanner.scan(this.script); |
| 9817 var element = this.universe.find(const$206/*Compiler.MAIN*/); | 9816 var element = this.universe.find(const$208/*Compiler.MAIN*/); |
| 9818 if (element == null) this.cancel(('Could not find ' + const$206/*Compiler.MAIN
*/)); | 9817 if (element == null) this.cancel(('Could not find ' + const$208/*Compiler.MAIN
*/)); |
| 9819 this.compileMethod(element); | 9818 this.compileMethod(element); |
| 9820 while (!this.worklist.isEmpty()) { | 9819 while (!this.worklist.isEmpty()) { |
| 9821 this.compileMethod((($0 = this.worklist.removeLast()) && $0.is$Element())); | 9820 this.compileMethod((($0 = this.worklist.removeLast()) && $0.is$Element())); |
| 9822 } | 9821 } |
| 9823 } | 9822 } |
| 9824 Compiler.prototype.compileMethod = function(element) { | 9823 Compiler.prototype.compileMethod = function(element) { |
| 9825 var tree = this.parser.parse(element); | 9824 var tree = this.parser.parse(element); |
| 9826 var elements = this.resolver.resolve(tree); | 9825 var elements = this.resolver.resolve(tree); |
| 9827 this.checker.check(tree, elements); | 9826 this.checker.check(tree, elements); |
| 9828 var graph = this.builder.build(tree, elements); | 9827 var graph = this.builder.build(tree, elements); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9977 var element = this.context.lookup(node.get$source()); | 9976 var element = this.context.lookup(node.get$source()); |
| 9978 if (element == null) this.fail(node, ErrorMessages.cannotResolve(node)); | 9977 if (element == null) this.fail(node, ErrorMessages.cannotResolve(node)); |
| 9979 return this.useElement(node, element); | 9978 return this.useElement(node, element); |
| 9980 } | 9979 } |
| 9981 ResolverVisitor.prototype.visitIf = function(node) { | 9980 ResolverVisitor.prototype.visitIf = function(node) { |
| 9982 this.visit(node.condition); | 9981 this.visit(node.condition); |
| 9983 this.visit(node.thenPart); | 9982 this.visit(node.thenPart); |
| 9984 this.visit(node.elsePart); | 9983 this.visit(node.elsePart); |
| 9985 } | 9984 } |
| 9986 ResolverVisitor.prototype.potentiallyMapOperatorToMethodName = function(name) { | 9985 ResolverVisitor.prototype.potentiallyMapOperatorToMethodName = function(name) { |
| 9987 if ($notnull_bool($eq(name, const$213/*const SourceString('+')*/))) return con
st$214/*const SourceString('add')*/; | 9986 if ($notnull_bool($eq(name, const$215/*const SourceString('+')*/))) return con
st$216/*const SourceString('add')*/; |
| 9988 if ($notnull_bool($eq(name, const$215/*const SourceString('-')*/))) return con
st$216/*const SourceString('sub')*/; | 9987 if ($notnull_bool($eq(name, const$217/*const SourceString('-')*/))) return con
st$218/*const SourceString('sub')*/; |
| 9989 if ($notnull_bool($eq(name, const$217/*const SourceString('*')*/))) return con
st$218/*const SourceString('mul')*/; | 9988 if ($notnull_bool($eq(name, const$219/*const SourceString('*')*/))) return con
st$220/*const SourceString('mul')*/; |
| 9990 if ($notnull_bool($eq(name, const$219/*const SourceString('/')*/))) return con
st$220/*const SourceString('div')*/; | 9989 if ($notnull_bool($eq(name, const$221/*const SourceString('/')*/))) return con
st$222/*const SourceString('div')*/; |
| 9991 if ($notnull_bool($eq(name, const$221/*const SourceString('~/')*/))) return co
nst$222/*const SourceString('tdiv')*/; | 9990 if ($notnull_bool($eq(name, const$223/*const SourceString('~/')*/))) return co
nst$224/*const SourceString('tdiv')*/; |
| 9992 if ($notnull_bool($eq(name, const$223/*const SourceString('==')*/))) return co
nst$224/*const SourceString('eq')*/; | 9991 if ($notnull_bool($eq(name, const$225/*const SourceString('==')*/))) return co
nst$226/*const SourceString('eq')*/; |
| 9993 if ($notnull_bool($eq(name, const$225/*const SourceString('<')*/))) return con
st$226/*const SourceString('lt')*/; | 9992 if ($notnull_bool($eq(name, const$227/*const SourceString('<')*/))) return con
st$228/*const SourceString('lt')*/; |
| 9994 return name; | 9993 return name; |
| 9995 } | 9994 } |
| 9996 ResolverVisitor.prototype.visitSend = function(node) { | 9995 ResolverVisitor.prototype.visitSend = function(node) { |
| 9997 var $0; | 9996 var $0; |
| 9998 this.visit(node.receiver); | 9997 this.visit(node.receiver); |
| 9999 var identifier = (($0 = node.selector) && $0.is$Identifier()); | 9998 var identifier = (($0 = node.selector) && $0.is$Identifier()); |
| 10000 var name = this.potentiallyMapOperatorToMethodName(identifier.get$source()); | 9999 var name = this.potentiallyMapOperatorToMethodName(identifier.get$source()); |
| 10001 var target = this.context.lookup(name); | 10000 var target = this.context.lookup(name); |
| 10002 if (target == null && !(($notnull_bool($eq(name, const$227/*const SourceString
('&&')*/)) || $notnull_bool(($eq(name, const$228/*const SourceString('||')*/))))
)) { | 10001 if (target == null && !(($notnull_bool($eq(name, const$229/*const SourceString
('&&')*/)) || $notnull_bool(($eq(name, const$230/*const SourceString('||')*/))))
)) { |
| 10003 this.fail(node, ErrorMessages.cannotResolve(name)); | 10002 this.fail(node, ErrorMessages.cannotResolve(name)); |
| 10004 } | 10003 } |
| 10005 this.visit(node.argumentsNode); | 10004 this.visit(node.argumentsNode); |
| 10006 return this.useElement(node, target); | 10005 return this.useElement(node, target); |
| 10007 } | 10006 } |
| 10008 ResolverVisitor.prototype.visitSendSet = function(node) { | 10007 ResolverVisitor.prototype.visitSendSet = function(node) { |
| 10009 var $0; | 10008 var $0; |
| 10010 var receiver = (($0 = this.visit(node.receiver)) && $0.is$Element()); | 10009 var receiver = (($0 = this.visit(node.receiver)) && $0.is$Element()); |
| 10011 var selector = (($0 = node.selector) && $0.is$Identifier()); | 10010 var selector = (($0 = node.selector) && $0.is$Identifier()); |
| 10012 if (receiver != null) { | 10011 if (receiver != null) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 10040 this.fail(node, "Unimplemented in the resolver"); | 10039 this.fail(node, "Unimplemented in the resolver"); |
| 10041 } | 10040 } |
| 10042 ResolverVisitor.prototype.visitReturn = function(node) { | 10041 ResolverVisitor.prototype.visitReturn = function(node) { |
| 10043 this.visit(node.expression); | 10042 this.visit(node.expression); |
| 10044 } | 10043 } |
| 10045 ResolverVisitor.prototype.visitThrow = function(node) { | 10044 ResolverVisitor.prototype.visitThrow = function(node) { |
| 10046 this.visit(node.expression); | 10045 this.visit(node.expression); |
| 10047 } | 10046 } |
| 10048 ResolverVisitor.prototype.visitTypeAnnotation = function(node) { | 10047 ResolverVisitor.prototype.visitTypeAnnotation = function(node) { |
| 10049 var name = node.typeName; | 10048 var name = node.typeName; |
| 10050 if ($notnull_bool($eq(name.get$source(), const$229/*const SourceString('var')*
/))) return null; | 10049 if ($notnull_bool($eq(name.get$source(), const$231/*const SourceString('var')*
/))) return null; |
| 10051 if ($notnull_bool($eq(name.get$source(), const$4/*const SourceString('void')*/
))) return null; | 10050 if ($notnull_bool($eq(name.get$source(), const$6/*const SourceString('void')*/
))) return null; |
| 10052 var element = this.context.lookup(name.get$source()); | 10051 var element = this.context.lookup(name.get$source()); |
| 10053 if (element == null) { | 10052 if (element == null) { |
| 10054 this.warning(node, ErrorMessages.cannotResolveType(name)); | 10053 this.warning(node, ErrorMessages.cannotResolveType(name)); |
| 10055 } | 10054 } |
| 10056 else if (element.kind !== const$199/*ElementKind.CLASS*/) { | 10055 else if (element.kind !== const$201/*ElementKind.CLASS*/) { |
| 10057 this.warning(node, ErrorMessages.notAType(name)); | 10056 this.warning(node, ErrorMessages.notAType(name)); |
| 10058 } | 10057 } |
| 10059 else { | 10058 else { |
| 10060 var cls = (element && element.is$ClassElement()); | 10059 var cls = (element && element.is$ClassElement()); |
| 10061 this.compiler.resolver.toResolve.add(element); | 10060 this.compiler.resolver.toResolve.add(element); |
| 10062 } | 10061 } |
| 10063 return this.useElement(node, element); | 10062 return this.useElement(node, element); |
| 10064 } | 10063 } |
| 10065 ResolverVisitor.prototype.visitVariableDefinitions = function(node) { | 10064 ResolverVisitor.prototype.visitVariableDefinitions = function(node) { |
| 10066 this.visit(node.type); | 10065 this.visit(node.type); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10100 } | 10099 } |
| 10101 return element.computeType(this.compiler, null); | 10100 return element.computeType(this.compiler, null); |
| 10102 } | 10101 } |
| 10103 ClassResolverVisitor.prototype.visitTypeAnnotation = function(node) { | 10102 ClassResolverVisitor.prototype.visitTypeAnnotation = function(node) { |
| 10104 var $0; | 10103 var $0; |
| 10105 var name = node.typeName; | 10104 var name = node.typeName; |
| 10106 var element = this.context.lookup(name.get$source()); | 10105 var element = this.context.lookup(name.get$source()); |
| 10107 if (element == null) { | 10106 if (element == null) { |
| 10108 this.compiler.cancel(ErrorMessages.cannotResolveType(name)); | 10107 this.compiler.cancel(ErrorMessages.cannotResolveType(name)); |
| 10109 } | 10108 } |
| 10110 else if (element.kind !== const$199/*ElementKind.CLASS*/) { | 10109 else if (element.kind !== const$201/*ElementKind.CLASS*/) { |
| 10111 this.compiler.cancel(ErrorMessages.notAType(name)); | 10110 this.compiler.cancel(ErrorMessages.notAType(name)); |
| 10112 } | 10111 } |
| 10113 else { | 10112 else { |
| 10114 this.compiler.resolver.toResolve.add(element); | 10113 this.compiler.resolver.toResolve.add(element); |
| 10115 return (($0 = element.computeType(this.compiler, null)) && $0.is$Type()); | 10114 return (($0 = element.computeType(this.compiler, null)) && $0.is$Type()); |
| 10116 } | 10115 } |
| 10117 return null; | 10116 return null; |
| 10118 } | 10117 } |
| 10119 ClassResolverVisitor.prototype.visit = function(node) { | 10118 ClassResolverVisitor.prototype.visit = function(node) { |
| 10120 var $0; | 10119 var $0; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10162 VariableDefinitionsVisitor.prototype.visit$1 = function($0) { | 10161 VariableDefinitionsVisitor.prototype.visit$1 = function($0) { |
| 10163 return this.visit(($0 && $0.is$Node())); | 10162 return this.visit(($0 && $0.is$Node())); |
| 10164 }; | 10163 }; |
| 10165 // ********** Code for Scope ************** | 10164 // ********** Code for Scope ************** |
| 10166 function Scope(parent) { | 10165 function Scope(parent) { |
| 10167 // Initializers done | 10166 // Initializers done |
| 10168 Scope.enclosing$ctor.call(this, parent, parent.enclosingElement); | 10167 Scope.enclosing$ctor.call(this, parent, parent.enclosingElement); |
| 10169 } | 10168 } |
| 10170 Scope.top$ctor = function() { | 10169 Scope.top$ctor = function() { |
| 10171 this.parent = null; | 10170 this.parent = null; |
| 10172 this.elements = const$212/*const {}*/; | 10171 this.elements = const$214/*const {}*/; |
| 10173 this.enclosingElement = null; | 10172 this.enclosingElement = null; |
| 10174 // Initializers done | 10173 // Initializers done |
| 10175 } | 10174 } |
| 10176 Scope.top$ctor.prototype = Scope.prototype; | 10175 Scope.top$ctor.prototype = Scope.prototype; |
| 10177 Scope.enclosing$ctor = function(parent, enclosingElement) { | 10176 Scope.enclosing$ctor = function(parent, enclosingElement) { |
| 10178 this.parent = parent; | 10177 this.parent = parent; |
| 10179 this.enclosingElement = enclosingElement; | 10178 this.enclosingElement = enclosingElement; |
| 10180 this.elements = $map([]); | 10179 this.elements = $map([]); |
| 10181 // Initializers done | 10180 // Initializers done |
| 10182 } | 10181 } |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10316 sb.add('('); | 10315 sb.add('('); |
| 10317 this.parameterTypes.printOn(sb, ', '); | 10316 this.parameterTypes.printOn(sb, ', '); |
| 10318 sb.add((') -> ' + this.returnType)); | 10317 sb.add((') -> ' + this.returnType)); |
| 10319 return sb.toString(); | 10318 return sb.toString(); |
| 10320 } | 10319 } |
| 10321 FunctionType.prototype.toString$0 = function() { | 10320 FunctionType.prototype.toString$0 = function() { |
| 10322 return this.toString(); | 10321 return this.toString(); |
| 10323 }; | 10322 }; |
| 10324 // ********** Code for Types ************** | 10323 // ********** Code for Types ************** |
| 10325 function Types() { | 10324 function Types() { |
| 10326 this.voidType = new SimpleType.named$ctor(const$4/*Types.VOID*/); | 10325 this.voidType = new SimpleType.named$ctor(const$6/*Types.VOID*/); |
| 10327 this.intType = new SimpleType.named$ctor(const$6/*Types.INT*/); | 10326 this.intType = new SimpleType.named$ctor(const$8/*Types.INT*/); |
| 10328 this.dynamicType = new SimpleType.named$ctor(const$8/*Types.DYNAMIC*/); | 10327 this.dynamicType = new SimpleType.named$ctor(const$10/*Types.DYNAMIC*/); |
| 10329 this.stringType = new SimpleType.named$ctor(const$10/*Types.STRING*/); | 10328 this.stringType = new SimpleType.named$ctor(const$12/*Types.STRING*/); |
| 10330 // Initializers done | 10329 // Initializers done |
| 10331 } | 10330 } |
| 10332 Types.prototype.is$Types = function(){return this;}; | 10331 Types.prototype.is$Types = function(){return this;}; |
| 10333 Types.prototype.get$dynamicType = function() { return this.dynamicType; }; | 10332 Types.prototype.get$dynamicType = function() { return this.dynamicType; }; |
| 10334 Types.prototype.lookup = function(s) { | 10333 Types.prototype.lookup = function(s) { |
| 10335 if ($notnull_bool($eq(const$4/*Types.VOID*/, s))) { | 10334 if ($notnull_bool($eq(const$6/*Types.VOID*/, s))) { |
| 10336 return this.voidType; | 10335 return this.voidType; |
| 10337 } | 10336 } |
| 10338 else if ($notnull_bool($eq(const$6/*Types.INT*/, s))) { | 10337 else if ($notnull_bool($eq(const$8/*Types.INT*/, s))) { |
| 10339 return this.intType; | 10338 return this.intType; |
| 10340 } | 10339 } |
| 10341 else if ($notnull_bool($eq(const$8/*Types.DYNAMIC*/, s)) || s.get$stringValue(
) === 'var') { | 10340 else if ($notnull_bool($eq(const$10/*Types.DYNAMIC*/, s)) || s.get$stringValue
() === 'var') { |
| 10342 return this.dynamicType; | 10341 return this.dynamicType; |
| 10343 } | 10342 } |
| 10344 else if ($notnull_bool($eq(const$10/*Types.STRING*/, s))) { | 10343 else if ($notnull_bool($eq(const$12/*Types.STRING*/, s))) { |
| 10345 return this.stringType; | 10344 return this.stringType; |
| 10346 } | 10345 } |
| 10347 return null; | 10346 return null; |
| 10348 } | 10347 } |
| 10349 Types.prototype.isSubtype = function(r, s) { | 10348 Types.prototype.isSubtype = function(r, s) { |
| 10350 return r === s || r === this.dynamicType || s === this.dynamicType; | 10349 return r === s || r === this.dynamicType || s === this.dynamicType; |
| 10351 } | 10350 } |
| 10352 Types.prototype.isAssignable = function(r, s) { | 10351 Types.prototype.isAssignable = function(r, s) { |
| 10353 return $notnull_bool(this.isSubtype(r, s)) || $notnull_bool(this.isSubtype(s,
r)); | 10352 return $notnull_bool(this.isSubtype(r, s)) || $notnull_bool(this.isSubtype(s,
r)); |
| 10354 } | 10353 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 10377 message = ('' + message + ': ' + reason); | 10376 message = ('' + message + ': ' + reason); |
| 10378 } | 10377 } |
| 10379 $throw(new CancelTypeCheckException(node, message)); | 10378 $throw(new CancelTypeCheckException(node, message)); |
| 10380 } | 10379 } |
| 10381 TypeCheckerVisitor.prototype.reportTypeWarning = function(node, kind, arguments)
{ | 10380 TypeCheckerVisitor.prototype.reportTypeWarning = function(node, kind, arguments)
{ |
| 10382 this.compiler.reportWarning(node, new TypeWarning(kind, arguments).getMessage(
)); | 10381 this.compiler.reportWarning(node, new TypeWarning(kind, arguments).getMessage(
)); |
| 10383 } | 10382 } |
| 10384 TypeCheckerVisitor.prototype.nonVoidType = function(node) { | 10383 TypeCheckerVisitor.prototype.nonVoidType = function(node) { |
| 10385 var type = this.type(node); | 10384 var type = this.type(node); |
| 10386 if ($eq(type, this.types.voidType)) { | 10385 if ($eq(type, this.types.voidType)) { |
| 10387 this.reportTypeWarning(node, const$245/*WarningKind.VOID_EXPRESSION*/, const
$13/*const []*/); | 10386 this.reportTypeWarning(node, const$247/*WarningKind.VOID_EXPRESSION*/, const
$15/*const []*/); |
| 10388 } | 10387 } |
| 10389 return type; | 10388 return type; |
| 10390 } | 10389 } |
| 10391 TypeCheckerVisitor.prototype.typeWithDefault = function(node, defaultValue) { | 10390 TypeCheckerVisitor.prototype.typeWithDefault = function(node, defaultValue) { |
| 10392 return node != null ? this.type(node) : defaultValue; | 10391 return node != null ? this.type(node) : defaultValue; |
| 10393 } | 10392 } |
| 10394 TypeCheckerVisitor.prototype.type = function(node) { | 10393 TypeCheckerVisitor.prototype.type = function(node) { |
| 10395 var $0; | 10394 var $0; |
| 10396 if (node == null) this.fail(null, 'unexpected node: null'); | 10395 if (node == null) this.fail(null, 'unexpected node: null'); |
| 10397 var result = (($0 = node.accept(this)) && $0.is$Type()); | 10396 var result = (($0 = node.accept(this)) && $0.is$Type()); |
| 10398 return result; | 10397 return result; |
| 10399 } | 10398 } |
| 10400 TypeCheckerVisitor.prototype.get$type = function() { | 10399 TypeCheckerVisitor.prototype.get$type = function() { |
| 10401 return TypeCheckerVisitor.prototype.type.bind(this); | 10400 return TypeCheckerVisitor.prototype.type.bind(this); |
| 10402 } | 10401 } |
| 10403 TypeCheckerVisitor.prototype.checkAssignable = function(node, s, t) { | 10402 TypeCheckerVisitor.prototype.checkAssignable = function(node, s, t) { |
| 10404 if (!$notnull_bool(this.types.isAssignable(s, t))) { | 10403 if (!$notnull_bool(this.types.isAssignable(s, t))) { |
| 10405 this.reportTypeWarning(node, const$238/*WarningKind.NOT_ASSIGNABLE*/, [s, t]
); | 10404 this.reportTypeWarning(node, const$240/*WarningKind.NOT_ASSIGNABLE*/, [s, t]
); |
| 10406 } | 10405 } |
| 10407 } | 10406 } |
| 10408 TypeCheckerVisitor.prototype.visitBlock = function(node) { | 10407 TypeCheckerVisitor.prototype.visitBlock = function(node) { |
| 10409 this.type(node.statements); | 10408 this.type(node.statements); |
| 10410 return this.types.voidType; | 10409 return this.types.voidType; |
| 10411 } | 10410 } |
| 10412 TypeCheckerVisitor.prototype.visitClassNode = function(node) { | 10411 TypeCheckerVisitor.prototype.visitClassNode = function(node) { |
| 10413 this.fail(node); | 10412 this.fail(node); |
| 10414 } | 10413 } |
| 10415 TypeCheckerVisitor.prototype.visitExpressionStatement = function(node) { | 10414 TypeCheckerVisitor.prototype.visitExpressionStatement = function(node) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 10436 this.type(node.thenPart); | 10435 this.type(node.thenPart); |
| 10437 if ($notnull_bool(node.get$hasElsePart())) this.type(node.elsePart); | 10436 if ($notnull_bool(node.get$hasElsePart())) this.type(node.elsePart); |
| 10438 return this.types.voidType; | 10437 return this.types.voidType; |
| 10439 } | 10438 } |
| 10440 TypeCheckerVisitor.prototype.visitSend = function(node) { | 10439 TypeCheckerVisitor.prototype.visitSend = function(node) { |
| 10441 var $0; | 10440 var $0; |
| 10442 var target = this.elements.$index(node); | 10441 var target = this.elements.$index(node); |
| 10443 var selector = (($0 = node.selector) && $0.is$Identifier()); | 10442 var selector = (($0 = node.selector) && $0.is$Identifier()); |
| 10444 if (target != null) { | 10443 if (target != null) { |
| 10445 var name = selector.get$source(); | 10444 var name = selector.get$source(); |
| 10446 if ($notnull_bool($eq(name, const$213/*const SourceString('+')*/)) || $notnu
ll_bool($eq(name, const$242/*const SourceString('=')*/)) || $notnull_bool($eq(na
me, const$215/*const SourceString('-')*/)) || $notnull_bool($eq(name, const$217/
*const SourceString('*')*/)) || $notnull_bool($eq(name, const$219/*const SourceS
tring('/')*/)) || $notnull_bool($eq(name, const$225/*const SourceString('<')*/))
|| $notnull_bool($eq(name, const$221/*const SourceString('~/')*/))) { | 10445 if ($notnull_bool($eq(name, const$215/*const SourceString('+')*/)) || $notnu
ll_bool($eq(name, const$244/*const SourceString('=')*/)) || $notnull_bool($eq(na
me, const$217/*const SourceString('-')*/)) || $notnull_bool($eq(name, const$219/
*const SourceString('*')*/)) || $notnull_bool($eq(name, const$221/*const SourceS
tring('/')*/)) || $notnull_bool($eq(name, const$227/*const SourceString('<')*/))
|| $notnull_bool($eq(name, const$223/*const SourceString('~/')*/))) { |
| 10447 return this.types.dynamicType; | 10446 return this.types.dynamicType; |
| 10448 } | 10447 } |
| 10449 var targetType = target.computeType$2(this.compiler, this.types); | 10448 var targetType = target.computeType$2(this.compiler, this.types); |
| 10450 if ($notnull_bool(node.get$isPropertyAccess())) { | 10449 if ($notnull_bool(node.get$isPropertyAccess())) { |
| 10451 return (targetType && targetType.is$Type()); | 10450 return (targetType && targetType.is$Type()); |
| 10452 } | 10451 } |
| 10453 else if ($notnull_bool(node.get$isFunctionObjectInvocation())) { | 10452 else if ($notnull_bool(node.get$isFunctionObjectInvocation())) { |
| 10454 this.fail(node); | 10453 this.fail(node); |
| 10455 } | 10454 } |
| 10456 else { | 10455 else { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10513 } | 10512 } |
| 10514 TypeCheckerVisitor.prototype.visitOperator = function(node) { | 10513 TypeCheckerVisitor.prototype.visitOperator = function(node) { |
| 10515 return this.types.dynamicType; | 10514 return this.types.dynamicType; |
| 10516 } | 10515 } |
| 10517 TypeCheckerVisitor.prototype.visitReturn = function(node) { | 10516 TypeCheckerVisitor.prototype.visitReturn = function(node) { |
| 10518 var expression = node.expression; | 10517 var expression = node.expression; |
| 10519 var isVoidFunction = (this.expectedReturnType === this.types.voidType); | 10518 var isVoidFunction = (this.expectedReturnType === this.types.voidType); |
| 10520 if (expression != null) { | 10519 if (expression != null) { |
| 10521 var expressionType = this.type(expression); | 10520 var expressionType = this.type(expression); |
| 10522 if (isVoidFunction && !$notnull_bool(this.types.isAssignable(expressionType,
this.types.voidType))) { | 10521 if (isVoidFunction && !$notnull_bool(this.types.isAssignable(expressionType,
this.types.voidType))) { |
| 10523 this.reportTypeWarning(expression, const$236/*WarningKind.RETURN_VALUE_IN_
VOID*/, const$13/*const []*/); | 10522 this.reportTypeWarning(expression, const$238/*WarningKind.RETURN_VALUE_IN_
VOID*/, const$15/*const []*/); |
| 10524 } | 10523 } |
| 10525 else { | 10524 else { |
| 10526 this.checkAssignable(expression, expressionType, this.expectedReturnType); | 10525 this.checkAssignable(expression, expressionType, this.expectedReturnType); |
| 10527 } | 10526 } |
| 10528 } | 10527 } |
| 10529 else if (!$notnull_bool(this.types.isAssignable(this.expectedReturnType, this.
types.voidType))) { | 10528 else if (!$notnull_bool(this.types.isAssignable(this.expectedReturnType, this.
types.voidType))) { |
| 10530 this.reportTypeWarning(node, const$240/*WarningKind.RETURN_NOTHING*/, [this.
expectedReturnType]); | 10529 this.reportTypeWarning(node, const$242/*WarningKind.RETURN_NOTHING*/, [this.
expectedReturnType]); |
| 10531 } | 10530 } |
| 10532 return null; | 10531 return null; |
| 10533 } | 10532 } |
| 10534 TypeCheckerVisitor.prototype.visitThrow = function(node) { | 10533 TypeCheckerVisitor.prototype.visitThrow = function(node) { |
| 10535 if (node.expression != null) this.type(node.expression); | 10534 if (node.expression != null) this.type(node.expression); |
| 10536 return this.types.voidType; | 10535 return this.types.voidType; |
| 10537 } | 10536 } |
| 10538 TypeCheckerVisitor.prototype.visitTypeAnnotation = function(node) { | 10537 TypeCheckerVisitor.prototype.visitTypeAnnotation = function(node) { |
| 10539 if (node.typeName == null) return this.types.dynamicType; | 10538 if (node.typeName == null) return this.types.dynamicType; |
| 10540 var name = node.typeName.get$source(); | 10539 var name = node.typeName.get$source(); |
| 10541 var type = this.types.lookup(name); | 10540 var type = this.types.lookup(name); |
| 10542 if (type == null) this.fail(node, ('unsupported type ' + name)); | 10541 if (type == null) this.fail(node, ('unsupported type ' + name)); |
| 10543 return type; | 10542 return type; |
| 10544 } | 10543 } |
| 10545 TypeCheckerVisitor.prototype.visitVariableDefinitions = function(node) { | 10544 TypeCheckerVisitor.prototype.visitVariableDefinitions = function(node) { |
| 10546 var $0; | 10545 var $0; |
| 10547 var type = this.typeWithDefault(node.type, this.types.dynamicType); | 10546 var type = this.typeWithDefault(node.type, this.types.dynamicType); |
| 10548 if ($eq(type, this.types.voidType)) { | 10547 if ($eq(type, this.types.voidType)) { |
| 10549 this.reportTypeWarning(node.type, const$243/*WarningKind.VOID_VARIABLE*/, co
nst$13/*const []*/); | 10548 this.reportTypeWarning(node.type, const$245/*WarningKind.VOID_VARIABLE*/, co
nst$15/*const []*/); |
| 10550 type = this.types.dynamicType; | 10549 type = this.types.dynamicType; |
| 10551 } | 10550 } |
| 10552 for (var link = node.definitions.nodes; | 10551 for (var link = node.definitions.nodes; |
| 10553 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$
Node())) { | 10552 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$
Node())) { |
| 10554 var initialization = (($0 = link.get$head()) && $0.is$Node()); | 10553 var initialization = (($0 = link.get$head()) && $0.is$Node()); |
| 10555 this.compiler.ensure((initialization instanceof Identifier) || (initializati
on instanceof Send)); | 10554 this.compiler.ensure((initialization instanceof Identifier) || (initializati
on instanceof Send)); |
| 10556 if ((initialization instanceof Send)) { | 10555 if ((initialization instanceof Send)) { |
| 10557 var initializer = this.nonVoidType((($0 = link.get$head()) && $0.is$Node()
)); | 10556 var initializer = this.nonVoidType((($0 = link.get$head()) && $0.is$Node()
)); |
| 10558 this.checkAssignable(node, type, initializer); | 10557 this.checkAssignable(node, type, initializer); |
| 10559 } | 10558 } |
| 10560 } | 10559 } |
| 10561 return null; | 10560 return null; |
| 10562 } | 10561 } |
| 10563 // ********** Code for Universe ************** | 10562 // ********** Code for Universe ************** |
| 10564 function Universe() { | 10563 function Universe() { |
| 10565 this.elements = $map([]); | 10564 this.elements = $map([]); |
| 10566 this.generatedCode = $map([]); | 10565 this.generatedCode = $map([]); |
| 10567 this.scope = new Element(const$2, null, null); | 10566 this.scope = new Element(const$4, null, null); |
| 10568 // Initializers done | 10567 // Initializers done |
| 10569 } | 10568 } |
| 10570 Universe.prototype.find = function(name) { | 10569 Universe.prototype.find = function(name) { |
| 10571 var $0; | 10570 var $0; |
| 10572 return (($0 = this.elements.$index(name)) && $0.is$Element()); | 10571 return (($0 = this.elements.$index(name)) && $0.is$Element()); |
| 10573 } | 10572 } |
| 10574 Universe.prototype.define = function(element) { | 10573 Universe.prototype.define = function(element) { |
| 10575 $assert(this.elements.$index(element.name) == null, "elements[element.name] ==
null", "universe.dart", 20, 12); | 10574 $assert(this.elements.$index(element.name) == null, "elements[element.name] ==
null", "universe.dart", 20, 12); |
| 10576 this.elements.$setindex(element.name, element); | 10575 this.elements.$setindex(element.name, element); |
| 10577 } | 10576 } |
| 10578 Universe.prototype.addGeneratedCode = function(element, code) { | 10577 Universe.prototype.addGeneratedCode = function(element, code) { |
| 10579 this.generatedCode.$setindex(element, code); | 10578 this.generatedCode.$setindex(element, code); |
| 10580 } | 10579 } |
| 10581 // ********** Code for top level ************** | 10580 // ********** Code for top level ************** |
| 10582 function unreachable() { | 10581 function unreachable() { |
| 10583 $throw(const$271/*const Exception("Internal Error (Leg): UNREACHABLE")*/); | 10582 $throw(const$273/*const Exception("Internal Error (Leg): UNREACHABLE")*/); |
| 10584 } | 10583 } |
| 10585 function compile(world) { | 10584 function compile(world) { |
| 10586 var file = world.readFile(options.dartScript); | 10585 var file = world.readFile($globals.options.dartScript); |
| 10587 var script = new leg_Script(file); | 10586 var script = new leg_Script(file); |
| 10588 var compiler = new WorldCompiler(world, script); | 10587 var compiler = new WorldCompiler(world, script); |
| 10589 return compiler.run(); | 10588 return compiler.run(); |
| 10590 } | 10589 } |
| 10591 // ********** Library lang ************** | 10590 // ********** Library lang ************** |
| 10592 // ********** Code for CodeWriter ************** | 10591 // ********** Code for CodeWriter ************** |
| 10593 function CodeWriter() { | 10592 function CodeWriter() { |
| 10594 this._indentation = 0 | 10593 this._indentation = 0 |
| 10595 this._pendingIndent = false | 10594 this._pendingIndent = false |
| 10596 this.writeComments = true | 10595 this.writeComments = true |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10753 w.writeln("Object.prototype.$typeNameOf = function() {\n if ((typeof(window
) != 'undefined' && window.constructor.name == 'DOMWindow')\n || typeof(pro
cess) != 'undefined') { // fast-path for Chrome and Node\n return this.constr
uctor.name;\n }\n var str = Object.prototype.toString.call(this);\n return st
r.substring(8, str.length - 1);\n}"); | 10752 w.writeln("Object.prototype.$typeNameOf = function() {\n if ((typeof(window
) != 'undefined' && window.constructor.name == 'DOMWindow')\n || typeof(pro
cess) != 'undefined') { // fast-path for Chrome and Node\n return this.constr
uctor.name;\n }\n var str = Object.prototype.toString.call(this);\n return st
r.substring(8, str.length - 1);\n}"); |
| 10754 } | 10753 } |
| 10755 if ($notnull_bool(this.useIndex)) { | 10754 if ($notnull_bool(this.useIndex)) { |
| 10756 w.writeln("Object.prototype.$index = function(i) { return this[i]; }\nArray.
prototype.$index = function(i) { return this[i]; }\nString.prototype.$index = fu
nction(i) { return this[i]; }"); | 10755 w.writeln("Object.prototype.$index = function(i) { return this[i]; }\nArray.
prototype.$index = function(i) { return this[i]; }\nString.prototype.$index = fu
nction(i) { return this[i]; }"); |
| 10757 } | 10756 } |
| 10758 if ($notnull_bool(this.useSetIndex)) { | 10757 if ($notnull_bool(this.useSetIndex)) { |
| 10759 w.writeln("Object.prototype.$setindex = function(i, value) { return this[i]
= value; }\nArray.prototype.$setindex = function(i, value) { return this[i] = va
lue; }"); | 10758 w.writeln("Object.prototype.$setindex = function(i, value) { return this[i]
= value; }\nArray.prototype.$setindex = function(i, value) { return this[i] = va
lue; }"); |
| 10760 } | 10759 } |
| 10761 if ($notnull_bool(this.useIsolates)) { | 10760 if ($notnull_bool(this.useIsolates)) { |
| 10762 if ($notnull_bool(this.useWrap0)) { | 10761 if ($notnull_bool(this.useWrap0)) { |
| 10763 w.writeln("// Wrap a 0-arg dom-callback to bind it with the current isolat
e:\nfunction $wrap_call$0(fn) { return fn && fn.wrap$call$0(); }\nFunction.proto
type.wrap$call$0 = function() {\n var isolate = $globalState.currentIsolate;\n
var self = this;\n this.wrap$0 = function() {\n isolate.eval(self);\n $g
lobalState.topEventLoop.run();\n };\n this.wrap$call$0 = function() { return t
his.wrap$0; };\n return this.wrap$0;\n}"); | 10762 w.writeln("// Wrap a 0-arg dom-callback to bind it with the current isolat
e:\nfunction $wrap_call$0(fn) { return fn && fn.wrap$call$0(); }\nFunction.proto
type.wrap$call$0 = function() {\n var isolateContext = $globalState.currentCont
ext;\n var self = this;\n this.wrap$0 = function() {\n isolateContext.eval(
self);\n $globalState.topEventLoop.run();\n };\n this.wrap$call$0 = functio
n() { return this.wrap$0; };\n return this.wrap$0;\n}"); |
| 10764 } | 10763 } |
| 10765 if ($notnull_bool(this.useWrap1)) { | 10764 if ($notnull_bool(this.useWrap1)) { |
| 10766 w.writeln("// Wrap a 1-arg dom-callback to bind it with the current isolat
e:\nfunction $wrap_call$1(fn) { return fn && fn.wrap$call$1(); }\nFunction.proto
type.wrap$call$1 = function() {\n var isolate = $globalState.currentIsolate;\n
var self = this;\n this.wrap$1 = function(arg) {\n isolate.eval(function()
{ self(arg); });\n $globalState.topEventLoop.run();\n };\n this.wrap$call$1
= function() { return this.wrap$1; };\n return this.wrap$1;\n}"); | 10765 w.writeln("// Wrap a 1-arg dom-callback to bind it with the current isolat
e:\nfunction $wrap_call$1(fn) { return fn && fn.wrap$call$1(); }\nFunction.proto
type.wrap$call$1 = function() {\n var isolateContext = $globalState.currentCont
ext;\n var self = this;\n this.wrap$1 = function(arg) {\n isolateContext.ev
al(function() { self(arg); });\n $globalState.topEventLoop.run();\n };\n th
is.wrap$call$1 = function() { return this.wrap$1; };\n return this.wrap$1;\n}")
; |
| 10767 } | 10766 } |
| 10768 w.writeln("var $globalThis = this;\nvar $globalState = null;"); | 10767 w.writeln("var $globalThis = this;\nvar $globals = null;\nvar $globalState =
null;"); |
| 10769 } | 10768 } |
| 10770 else { | 10769 else { |
| 10771 if ($notnull_bool(this.useWrap0)) { | 10770 if ($notnull_bool(this.useWrap0)) { |
| 10772 w.writeln("function $wrap_call$0(fn) { return fn; }"); | 10771 w.writeln("function $wrap_call$0(fn) { return fn; }"); |
| 10773 } | 10772 } |
| 10774 if ($notnull_bool(this.useWrap1)) { | 10773 if ($notnull_bool(this.useWrap1)) { |
| 10775 w.writeln("function $wrap_call$1(fn) { return fn; }"); | 10774 w.writeln("function $wrap_call$1(fn) { return fn; }"); |
| 10776 } | 10775 } |
| 10777 } | 10776 } |
| 10778 var $list = orderValuesByKeys(this._usedOperators); | 10777 var $list = orderValuesByKeys(this._usedOperators); |
| 10779 for (var $i = 0;$i < $list.length; $i++) { | 10778 for (var $i = 0;$i < $list.length; $i++) { |
| 10780 var opImpl = $list.$index($i); | 10779 var opImpl = $list.$index($i); |
| 10781 w.writeln($assert_String(opImpl)); | 10780 w.writeln($assert_String(opImpl)); |
| 10782 } | 10781 } |
| 10783 } | 10782 } |
| 10784 CoreJs.prototype.generate$1 = function($0) { | 10783 CoreJs.prototype.generate$1 = function($0) { |
| 10785 return this.generate(($0 && $0.is$CodeWriter())); | 10784 return this.generate(($0 && $0.is$CodeWriter())); |
| 10786 }; | 10785 }; |
| 10787 // ********** Code for WorldGenerator ************** | 10786 // ********** Code for WorldGenerator ************** |
| 10788 function WorldGenerator(main, writer) { | 10787 function WorldGenerator(main, writer) { |
| 10788 this.hasStatics = false |
| 10789 this._inheritsGenerated = false | 10789 this._inheritsGenerated = false |
| 10790 this.main = main; | 10790 this.main = main; |
| 10791 this.writer = writer; | 10791 this.writer = writer; |
| 10792 this.globals = $map([]); | 10792 this.globals = $map([]); |
| 10793 this.corejs = new CoreJs(); | 10793 this.corejs = new CoreJs(); |
| 10794 // Initializers done | 10794 // Initializers done |
| 10795 } | 10795 } |
| 10796 WorldGenerator.prototype.run = function() { | 10796 WorldGenerator.prototype.run = function() { |
| 10797 var $0; | 10797 var $0; |
| 10798 var metaGen = new MethodGenerator(this.main, null); | 10798 var metaGen = new MethodGenerator(this.main, null); |
| 10799 var mainCall = this.main.invoke((metaGen && metaGen.is$MethodGenerator()), nul
l, null, Arguments.get$EMPTY(), false); | 10799 var mainCall = this.main.invoke((metaGen && metaGen.is$MethodGenerator()), nul
l, null, Arguments.get$EMPTY(), false); |
| 10800 this.main.declaringType.markUsed(); | 10800 this.main.declaringType.markUsed(); |
| 10801 world.corelib.types.$index('BadNumberFormatException').markUsed$0(); | 10801 $globals.world.corelib.types.$index('BadNumberFormatException').markUsed$0(); |
| 10802 world.get$coreimpl().types.$index('NumImplementation').markUsed$0(); | 10802 $globals.world.get$coreimpl().types.$index('NumImplementation').markUsed$0(); |
| 10803 world.get$coreimpl().types.$index('StringImplementation').markUsed$0(); | 10803 $globals.world.get$coreimpl().types.$index('StringImplementation').markUsed$0(
); |
| 10804 this.genMethod((($0 = world.get$coreimpl().types.$index('StringImplementation'
).getMember$1('contains')) && $0.is$Member())); | 10804 this.genMethod((($0 = $globals.world.get$coreimpl().types.$index('StringImplem
entation').getMember$1('contains')) && $0.is$Member())); |
| 10805 if ($notnull_bool(world.corelib.types.$index('Isolate').get$isUsed()) || $notn
ull_bool(world.get$coreimpl().types.$index('ReceivePortImpl').get$isUsed())) { | 10805 if ($notnull_bool($globals.world.corelib.types.$index('Isolate').get$isUsed())
|| $notnull_bool($globals.world.get$coreimpl().types.$index('ReceivePortImpl').
get$isUsed())) { |
| 10806 this.corejs.useIsolates = true; | 10806 this.corejs.useIsolates = true; |
| 10807 var isolateMain = (($0 = world.get$coreimpl().topType.resolveMember('startAs
Isolate').members.$index(0)) && $0.is$MethodMember()); | 10807 var isolateMain = (($0 = $globals.world.get$coreimpl().topType.resolveMember
('startRootIsolate').members.$index(0)) && $0.is$MethodMember()); |
| 10808 mainCall = isolateMain.invoke((metaGen && metaGen.is$MethodGenerator()), nul
l, null, new Arguments(null, [this.main._get((metaGen && metaGen.is$MethodGenera
tor()), this.main.definition, null, false)]), false); | 10808 mainCall = isolateMain.invoke((metaGen && metaGen.is$MethodGenerator()), nul
l, null, new Arguments(null, [this.main._get((metaGen && metaGen.is$MethodGenera
tor()), this.main.definition, null, false)]), false); |
| 10809 } | 10809 } |
| 10810 this.writeTypes(world.get$coreimpl()); | 10810 this.writeTypes($globals.world.get$coreimpl()); |
| 10811 this.writeTypes(world.corelib); | 10811 this.writeTypes($globals.world.corelib); |
| 10812 this.writeTypes(this.main.declaringType.get$library()); | 10812 this.writeTypes(this.main.declaringType.get$library()); |
| 10813 this._writeGlobals(); | 10813 this.writeGlobals(); |
| 10814 this.writer.writeln(('' + mainCall.get$code() + ';')); | 10814 this.writer.writeln(('' + mainCall.get$code() + ';')); |
| 10815 } | 10815 } |
| 10816 WorldGenerator.prototype.globalForStaticField = function(field, fieldValue, depe
ndencies) { | 10816 WorldGenerator.prototype.globalForStaticField = function(field, fieldValue, depe
ndencies) { |
| 10817 var $0; | 10817 var $0; |
| 10818 this.hasStatics = true; |
| 10818 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname
()); | 10819 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname
()); |
| 10819 if (!this.globals.containsKey(fullname)) { | 10820 if (!this.globals.containsKey(fullname)) { |
| 10820 this.globals.$setindex(fullname, GlobalValue.GlobalValue$fromStatic$factory(
field, fieldValue, dependencies)); | 10821 this.globals.$setindex(fullname, GlobalValue.GlobalValue$fromStatic$factory(
field, fieldValue, dependencies)); |
| 10821 } | 10822 } |
| 10822 return (($0 = this.globals.$index(fullname)) && $0.is$GlobalValue()); | 10823 return (($0 = this.globals.$index(fullname)) && $0.is$GlobalValue()); |
| 10823 } | 10824 } |
| 10824 WorldGenerator.prototype.globalForConst = function(exp, dependencies) { | 10825 WorldGenerator.prototype.globalForConst = function(exp, dependencies) { |
| 10825 var $0; | 10826 var $0; |
| 10826 var code = exp.canonicalCode; | 10827 var code = exp.canonicalCode; |
| 10827 if (!this.globals.containsKey(code)) { | 10828 if (!this.globals.containsKey(code)) { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10885 WorldGenerator.prototype._maybeIsTest = function(onType, checkType) { | 10886 WorldGenerator.prototype._maybeIsTest = function(onType, checkType) { |
| 10886 if (!$notnull_bool(checkType.isTested)) return; | 10887 if (!$notnull_bool(checkType.isTested)) return; |
| 10887 var value = 'false'; | 10888 var value = 'false'; |
| 10888 if ($notnull_bool(onType.isSubtypeOf(checkType))) { | 10889 if ($notnull_bool(onType.isSubtypeOf(checkType))) { |
| 10889 value = 'function(){return this;}'; | 10890 value = 'function(){return this;}'; |
| 10890 } | 10891 } |
| 10891 this.writer.writeln(('' + onType.get$jsname() + '.prototype.is\$' + checkType.
get$jsname() + ' = ') + ('' + value + ';')); | 10892 this.writer.writeln(('' + onType.get$jsname() + '.prototype.is\$' + checkType.
get$jsname() + ' = ') + ('' + value + ';')); |
| 10892 } | 10893 } |
| 10893 WorldGenerator.prototype.writeType = function(type) { | 10894 WorldGenerator.prototype.writeType = function(type) { |
| 10894 var $0; | 10895 var $0; |
| 10895 if (type.name != null && (type instanceof ConcreteType) && $eq(type.get$librar
y(), world.get$coreimpl()) && type.name.startsWith('ListFactory')) { | 10896 if (type.name != null && (type instanceof ConcreteType) && $eq(type.get$librar
y(), $globals.world.get$coreimpl()) && type.name.startsWith('ListFactory')) { |
| 10896 this.writer.writeln(('' + type.get$jsname() + ' = ' + type.get$genericType()
.get$jsname() + ';')); | 10897 this.writer.writeln(('' + type.get$jsname() + ' = ' + type.get$genericType()
.get$jsname() + ';')); |
| 10897 return; | 10898 return; |
| 10898 } | 10899 } |
| 10899 var typeName = type.get$jsname() != null ? type.get$jsname() : 'top level'; | 10900 var typeName = type.get$jsname() != null ? type.get$jsname() : 'top level'; |
| 10900 this.writer.comment(('// ********** Code for ' + typeName + ' **************')
); | 10901 this.writer.comment(('// ********** Code for ' + typeName + ' **************')
); |
| 10901 if ($notnull_bool(type.get$isNativeType()) && !$notnull_bool(type.get$isTop())
) { | 10902 if ($notnull_bool(type.get$isNativeType()) && !$notnull_bool(type.get$isTop())
) { |
| 10902 var nativeName = type.get$definition().get$nativeType(); | 10903 var nativeName = type.get$definition().get$nativeType(); |
| 10903 if ($notnull_bool($eq(nativeName, ''))) { | 10904 if ($notnull_bool($eq(nativeName, ''))) { |
| 10904 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); | 10905 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); |
| 10905 } | 10906 } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11008 stub.generate$1(this.writer); | 11009 stub.generate$1(this.writer); |
| 11009 } | 11010 } |
| 11010 } | 11011 } |
| 11011 } | 11012 } |
| 11012 WorldGenerator.prototype._writeStaticField = function(field) { | 11013 WorldGenerator.prototype._writeStaticField = function(field) { |
| 11013 if ($notnull_bool(field.isFinal)) return; | 11014 if ($notnull_bool(field.isFinal)) return; |
| 11014 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname
()); | 11015 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname
()); |
| 11015 if (this.globals.containsKey(fullname)) { | 11016 if (this.globals.containsKey(fullname)) { |
| 11016 var value = this.globals.$index(fullname); | 11017 var value = this.globals.$index(fullname); |
| 11017 if ($notnull_bool(field.declaringType.get$isTop()) && !$notnull_bool(field.i
sNative)) { | 11018 if ($notnull_bool(field.declaringType.get$isTop()) && !$notnull_bool(field.i
sNative)) { |
| 11018 this.writer.writeln(('var ' + field.get$jsname() + ' = ' + value.get$exp()
.get$code() + ';')); | 11019 this.writer.writeln(('\$globals.' + field.get$jsname() + ' = ' + value.get
$exp().get$code() + ';')); |
| 11019 } | 11020 } |
| 11020 else { | 11021 else { |
| 11021 this.writer.writeln(('' + field.declaringType.get$jsname() + '.' + field.g
et$jsname() + ' = ' + value.get$exp().get$code() + ';')); | 11022 this.writer.writeln(('\$globals.' + field.declaringType.get$jsname() + '_'
+ field.get$jsname()) + (' = ' + value.get$exp().get$code() + ';')); |
| 11022 } | 11023 } |
| 11023 } | 11024 } |
| 11024 } | 11025 } |
| 11025 WorldGenerator.prototype._writeField = function(field) { | 11026 WorldGenerator.prototype._writeField = function(field) { |
| 11026 if ($notnull_bool(field.declaringType.get$isTop()) && !$notnull_bool(field.isN
ative) && field.value == null) { | 11027 if ($notnull_bool(field.declaringType.get$isTop()) && !$notnull_bool(field.isN
ative) && field.value == null) { |
| 11027 this.writer.writeln(('var ' + field.get$jsname() + ';')); | 11028 this.writer.writeln(('var ' + field.get$jsname() + ';')); |
| 11028 } | 11029 } |
| 11029 if ($notnull_bool(field._providePropertySyntax)) { | 11030 if ($notnull_bool(field._providePropertySyntax)) { |
| 11030 this.writer.writeln(('' + field.declaringType.get$jsname() + '.prototype.get
\$' + field.get$jsname() + ' = ') + ('function() { return this.' + field.get$jsn
ame() + '; };')); | 11031 this.writer.writeln(('' + field.declaringType.get$jsname() + '.prototype.get
\$' + field.get$jsname() + ' = ') + ('function() { return this.' + field.get$jsn
ame() + '; };')); |
| 11031 if (!$notnull_bool(field.isFinal)) { | 11032 if (!$notnull_bool(field.isFinal)) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 11049 } | 11050 } |
| 11050 } | 11051 } |
| 11051 WorldGenerator.prototype._writeMethod = function(method) { | 11052 WorldGenerator.prototype._writeMethod = function(method) { |
| 11052 if (method.generator != null) { | 11053 if (method.generator != null) { |
| 11053 method.generator.writeDefinition(this.writer, null); | 11054 method.generator.writeDefinition(this.writer, null); |
| 11054 } | 11055 } |
| 11055 } | 11056 } |
| 11056 WorldGenerator.prototype.get$_writeMethod = function() { | 11057 WorldGenerator.prototype.get$_writeMethod = function() { |
| 11057 return WorldGenerator.prototype._writeMethod.bind(this); | 11058 return WorldGenerator.prototype._writeMethod.bind(this); |
| 11058 } | 11059 } |
| 11059 WorldGenerator.prototype._writeGlobals = function() { | 11060 WorldGenerator.prototype.writeGlobals = function() { |
| 11060 var $0; | 11061 var $0; |
| 11061 if (this.globals.get$length() > 0) { | 11062 if (this.globals.get$length() > 0) { |
| 11062 this.writer.comment('// ********** Globals **************'); | 11063 this.writer.comment('// ********** Globals **************'); |
| 11064 var list = this.globals.getValues(); |
| 11065 list.sort$1((function (a, b) { |
| 11066 return a.compareTo$1(b); |
| 11067 }) |
| 11068 ); |
| 11069 this.writer.enterBlock('function \$static_init(){'); |
| 11070 for (var $i = list.iterator$0(); $i.hasNext$0(); ) { |
| 11071 var global = $i.next$0(); |
| 11072 if ($notnull_bool($ne(global.get$field(), null))) { |
| 11073 this._writeStaticField((($0 = global.get$field()) && $0.is$FieldMember()
)); |
| 11074 } |
| 11075 } |
| 11076 this.writer.exitBlock('}'); |
| 11077 for (var $i = list.iterator$0(); $i.hasNext$0(); ) { |
| 11078 var global0 = $i.next$0(); |
| 11079 if ($notnull_bool(global0.get$field() == null)) { |
| 11080 this.writer.writeln(('' + global0.get$name() + ' = ' + global0.get$exp()
.get$code() + ';')); |
| 11081 } |
| 11082 } |
| 11063 } | 11083 } |
| 11064 var list = this.globals.getValues(); | 11084 if (!$notnull_bool(this.corejs.useIsolates)) { |
| 11065 list.sort$1((function (a, b) { | 11085 if ($notnull_bool(this.hasStatics)) { |
| 11066 return a.compareTo$1(b); | 11086 this.writer.writeln('var \$globals = {};'); |
| 11067 }) | |
| 11068 ); | |
| 11069 for (var $i = list.iterator$0(); $i.hasNext$0(); ) { | |
| 11070 var global = $i.next$0(); | |
| 11071 if ($notnull_bool($ne(global.get$field(), null))) { | |
| 11072 this._writeStaticField((($0 = global.get$field()) && $0.is$FieldMember()))
; | |
| 11073 } | 11087 } |
| 11074 else { | 11088 if (this.globals.get$length() > 0) { |
| 11075 this.writer.writeln(('var ' + global.get$name() + ' = ' + global.get$exp()
.get$code() + ';')); | 11089 this.writer.writeln('\$static_init();'); |
| 11076 } | 11090 } |
| 11077 } | 11091 } |
| 11078 } | 11092 } |
| 11079 WorldGenerator.prototype._orderValues = function(map) { | 11093 WorldGenerator.prototype._orderValues = function(map) { |
| 11080 var $0; | 11094 var $0; |
| 11081 var values = (($0 = map.getValues()) && $0.is$List()); | 11095 var values = (($0 = map.getValues()) && $0.is$List()); |
| 11082 values.sort(this.get$_compareMembers()); | 11096 values.sort(this.get$_compareMembers()); |
| 11083 return values; | 11097 return values; |
| 11084 } | 11098 } |
| 11085 WorldGenerator.prototype._compareMembers = function(x, y) { | 11099 WorldGenerator.prototype._compareMembers = function(x, y) { |
| 11086 if ($notnull_bool($ne(x.get$span(), null)) && $notnull_bool($ne(y.get$span(),
null))) { | 11100 if ($notnull_bool($ne(x.get$span(), null)) && $notnull_bool($ne(y.get$span(),
null))) { |
| 11087 var spans = $assert_num(x.get$span().compareTo$1(y.get$span())); | 11101 var spans = $assert_num(x.get$span().compareTo$1(y.get$span())); |
| 11088 if (spans != 0) return spans; | 11102 if (spans != 0) return spans; |
| 11089 } | 11103 } |
| 11090 if ($notnull_bool(x.get$span() == null)) return 1; | 11104 if ($notnull_bool(x.get$span() == null)) return 1; |
| 11091 if ($notnull_bool(y.get$span() == null)) return -1; | 11105 if ($notnull_bool(y.get$span() == null)) return -1; |
| 11092 return $assert_num(x.get$name().compareTo$1(y.get$name())); | 11106 return $assert_num(x.get$name().compareTo$1(y.get$name())); |
| 11093 } | 11107 } |
| 11094 WorldGenerator.prototype.get$_compareMembers = function() { | 11108 WorldGenerator.prototype.get$_compareMembers = function() { |
| 11095 return WorldGenerator.prototype._compareMembers.bind(this); | 11109 return WorldGenerator.prototype._compareMembers.bind(this); |
| 11096 } | 11110 } |
| 11097 WorldGenerator.prototype.useMapFactory = function() { | 11111 WorldGenerator.prototype.useMapFactory = function() { |
| 11098 var $0; | 11112 var $0; |
| 11099 this.corejs.useMap = true; | 11113 this.corejs.useMap = true; |
| 11100 var factType = world.get$coreimpl().types.$index('HashMapImplementation'); | 11114 var factType = $globals.world.get$coreimpl().types.$index('HashMapImplementati
on'); |
| 11101 var m = factType.resolveMember$1('\$setindex'); | 11115 var m = factType.resolveMember$1('\$setindex'); |
| 11102 this.genMethod((($0 = m.get$members().$index(0)) && $0.is$Member())); | 11116 this.genMethod((($0 = m.get$members().$index(0)) && $0.is$Member())); |
| 11103 var c = factType.getConstructor$1(''); | 11117 var c = factType.getConstructor$1(''); |
| 11104 this.genMethod((c && c.is$Member())); | 11118 this.genMethod((c && c.is$Member())); |
| 11105 return (factType && factType.is$lang_Type()); | 11119 return (factType && factType.is$lang_Type()); |
| 11106 } | 11120 } |
| 11107 // ********** Code for BlockScope ************** | 11121 // ********** Code for BlockScope ************** |
| 11108 function BlockScope(enclosingMethod, parent, reentrant) { | 11122 function BlockScope(enclosingMethod, parent, reentrant) { |
| 11109 this.enclosingMethod = enclosingMethod; | 11123 this.enclosingMethod = enclosingMethod; |
| 11110 this.parent = parent; | 11124 this.parent = parent; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11157 for (var s = this.parent; | 11171 for (var s = this.parent; |
| 11158 $notnull_bool($ne(s, null)); s = s.get$parent()) { | 11172 $notnull_bool($ne(s, null)); s = s.get$parent()) { |
| 11159 if (s._vars.containsKey(name)) return true; | 11173 if (s._vars.containsKey(name)) return true; |
| 11160 if ($notnull_bool(s.get$isMethodScope()) && s._closedOver.contains(name)) re
turn true; | 11174 if ($notnull_bool(s.get$isMethodScope()) && s._closedOver.contains(name)) re
turn true; |
| 11161 } | 11175 } |
| 11162 var type = this.enclosingMethod.method.declaringType; | 11176 var type = this.enclosingMethod.method.declaringType; |
| 11163 if (type.get$library().lookup(name, null) != null) return true; | 11177 if (type.get$library().lookup(name, null) != null) return true; |
| 11164 return false; | 11178 return false; |
| 11165 } | 11179 } |
| 11166 BlockScope.prototype.create = function(name, type, span, isFinal, isParameter) { | 11180 BlockScope.prototype.create = function(name, type, span, isFinal, isParameter) { |
| 11167 var jsName = world.toJsIdentifier(name); | 11181 var jsName = $globals.world.toJsIdentifier(name); |
| 11168 if (this._vars.containsKey(name)) { | 11182 if (this._vars.containsKey(name)) { |
| 11169 world.error(('duplicate name "' + name + '"'), span); | 11183 $globals.world.error(('duplicate name "' + name + '"'), span); |
| 11170 } | 11184 } |
| 11171 if (!$notnull_bool(isParameter)) { | 11185 if (!$notnull_bool(isParameter)) { |
| 11172 var index = 0; | 11186 var index = 0; |
| 11173 while ($notnull_bool(this._isDefinedInParent($assert_String(jsName)))) { | 11187 while ($notnull_bool(this._isDefinedInParent($assert_String(jsName)))) { |
| 11174 jsName = ('' + name + (index++)); | 11188 jsName = ('' + name + (index++)); |
| 11175 } | 11189 } |
| 11176 } | 11190 } |
| 11177 var ret = new Value(type, jsName, span, false); | 11191 var ret = new Value(type, jsName, span, false); |
| 11178 ret.set$isFinal(isFinal); | 11192 ret.set$isFinal(isFinal); |
| 11179 this._vars.$setindex(name, ret); | 11193 this._vars.$setindex(name, ret); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11257 } | 11271 } |
| 11258 else { | 11272 else { |
| 11259 return new Value(v.type, ('(' + tmp.code + ' = ' + v.code + ')'), v.span, tr
ue); | 11273 return new Value(v.type, ('(' + tmp.code + ' = ' + v.code + ')'), v.span, tr
ue); |
| 11260 } | 11274 } |
| 11261 } | 11275 } |
| 11262 MethodGenerator.prototype.freeTemp = function(value) { | 11276 MethodGenerator.prototype.freeTemp = function(value) { |
| 11263 if (this._usedTemps.remove(value.code)) { | 11277 if (this._usedTemps.remove(value.code)) { |
| 11264 this._freeTemps.add(value.code); | 11278 this._freeTemps.add(value.code); |
| 11265 } | 11279 } |
| 11266 else { | 11280 else { |
| 11267 world.internalError(('tried to free unused value or non-temp "' + value.code
+ '"')); | 11281 $globals.world.internalError(('tried to free unused value or non-temp "' + v
alue.code + '"')); |
| 11268 } | 11282 } |
| 11269 } | 11283 } |
| 11270 MethodGenerator.prototype.run = function() { | 11284 MethodGenerator.prototype.run = function() { |
| 11271 if ($notnull_bool(this.method.isGenerated)) return; | 11285 if ($notnull_bool(this.method.isGenerated)) return; |
| 11272 this.method.isGenerated = true; | 11286 this.method.isGenerated = true; |
| 11273 this.method.generator = this; | 11287 this.method.generator = this; |
| 11274 if ((this.method.get$definition().get$body() instanceof NativeStatement)) { | 11288 if ((this.method.get$definition().get$body() instanceof NativeStatement)) { |
| 11275 if ($notnull_bool(this.method.get$definition().get$body().get$body() == null
)) { | 11289 if ($notnull_bool(this.method.get$definition().get$body().get$body() == null
)) { |
| 11276 this.method.generator = null; | 11290 this.method.generator = null; |
| 11277 } | 11291 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11335 else if ($notnull_bool(this.method.get$isStatic())) { | 11349 else if ($notnull_bool(this.method.get$isStatic())) { |
| 11336 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + th
is.method.get$jsname() + ' = function' + _params + ' {')); | 11350 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + th
is.method.get$jsname() + ' = function' + _params + ' {')); |
| 11337 } | 11351 } |
| 11338 else { | 11352 else { |
| 11339 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot
ype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {')); | 11353 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot
ype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {')); |
| 11340 } | 11354 } |
| 11341 if ($notnull_bool(this.needsThis)) { | 11355 if ($notnull_bool(this.needsThis)) { |
| 11342 defWriter.writeln('var \$this = this; // closure support'); | 11356 defWriter.writeln('var \$this = this; // closure support'); |
| 11343 } | 11357 } |
| 11344 if (this._usedTemps.get$length() > 0 || this._freeTemps.length > 0) { | 11358 if (this._usedTemps.get$length() > 0 || this._freeTemps.length > 0) { |
| 11345 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da
rt", 706, 14); | 11359 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da
rt", 736, 14); |
| 11346 this._freeTemps.addAll(this._usedTemps); | 11360 this._freeTemps.addAll(this._usedTemps); |
| 11347 this._freeTemps.sort((function (x, y) { | 11361 this._freeTemps.sort((function (x, y) { |
| 11348 return x.compareTo$1(y); | 11362 return x.compareTo$1(y); |
| 11349 }) | 11363 }) |
| 11350 ); | 11364 ); |
| 11351 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';')); | 11365 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';')); |
| 11352 } | 11366 } |
| 11353 defWriter.writeln(this.writer.get$text()); | 11367 defWriter.writeln(this.writer.get$text()); |
| 11354 if ($notnull_bool($ne(names, null))) { | 11368 if ($notnull_bool($ne(names, null))) { |
| 11355 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List
$String()), ", ") + ')')); | 11369 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List
$String()), ", ") + ')')); |
| 11356 } | 11370 } |
| 11357 else if ($notnull_bool(this.get$isClosure()) && this.method.name == '') { | 11371 else if ($notnull_bool(this.get$isClosure()) && this.method.name == '') { |
| 11358 defWriter.exitBlock('})'); | 11372 defWriter.exitBlock('})'); |
| 11359 } | 11373 } |
| 11360 else { | 11374 else { |
| 11361 defWriter.exitBlock('}'); | 11375 defWriter.exitBlock('}'); |
| 11362 } | 11376 } |
| 11363 if ($notnull_bool(this.method.get$isConstructor()) && this.method.get$construc
torName() != '') { | 11377 if ($notnull_bool(this.method.get$isConstructor()) && this.method.get$construc
torName() != '') { |
| 11364 defWriter.writeln(('' + this.method.declaringType.get$jsname() + '.' + this.
method.get$constructorName() + '\$ctor.prototype = ') + ('' + this.method.declar
ingType.get$jsname() + '.prototype;')); | 11378 defWriter.writeln(('' + this.method.declaringType.get$jsname() + '.' + this.
method.get$constructorName() + '\$ctor.prototype = ') + ('' + this.method.declar
ingType.get$jsname() + '.prototype;')); |
| 11365 } | 11379 } |
| 11366 this._provideOptionalParamInfo(defWriter); | 11380 this._provideOptionalParamInfo(defWriter); |
| 11367 if ((this.method instanceof MethodMember)) { | 11381 if ((this.method instanceof MethodMember)) { |
| 11368 var m = (($0 = this.method) && $0.is$MethodMember()); | 11382 var m = (($0 = this.method) && $0.is$MethodMember()); |
| 11369 if ($notnull_bool(m._providePropertySyntax)) { | 11383 if ($notnull_bool(m._providePropertySyntax)) { |
| 11370 defWriter.enterBlock(('' + m.declaringType.get$jsname() + '.prototype') +
('.get\$' + m.get$jsname() + ' = function() {')); | 11384 defWriter.enterBlock(('' + m.declaringType.get$jsname() + '.prototype') +
('.get\$' + m.get$jsname() + ' = function() {')); |
| 11371 defWriter.writeln(('return ' + m.declaringType.get$jsname() + '.prototype.
') + ('' + m.get$jsname() + '.bind(this);')); | 11385 defWriter.writeln(('return ' + m.declaringType.get$jsname() + '.prototype.
') + ('' + m.get$jsname() + '.bind(this);')); |
| 11372 defWriter.exitBlock('}'); | 11386 defWriter.exitBlock('}'); |
| 11373 if ($notnull_bool(m._provideFieldSyntax)) { | 11387 if ($notnull_bool(m._provideFieldSyntax)) { |
| 11374 world.internalError('bound m accessed with field syntax'); | 11388 $globals.world.internalError('bound m accessed with field syntax'); |
| 11375 } | 11389 } |
| 11376 } | 11390 } |
| 11377 } | 11391 } |
| 11378 } | 11392 } |
| 11379 MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) { | 11393 MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) { |
| 11380 var $0; | 11394 var $0; |
| 11381 if ((this.method instanceof MethodMember)) { | 11395 if ((this.method instanceof MethodMember)) { |
| 11382 var meth = (($0 = this.method) && $0.is$MethodMember()); | 11396 var meth = (($0 = this.method) && $0.is$MethodMember()); |
| 11383 if ($notnull_bool(meth._provideOptionalParamInfo)) { | 11397 if ($notnull_bool(meth._provideOptionalParamInfo)) { |
| 11384 var optNames = []; | 11398 var optNames = []; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 11409 } | 11423 } |
| 11410 } | 11424 } |
| 11411 } | 11425 } |
| 11412 MethodGenerator.prototype.writeBody = function() { | 11426 MethodGenerator.prototype.writeBody = function() { |
| 11413 var $0; | 11427 var $0; |
| 11414 var initializers = null; | 11428 var initializers = null; |
| 11415 var initializedFields = null; | 11429 var initializedFields = null; |
| 11416 if ($notnull_bool(this.method.get$isConstructor())) { | 11430 if ($notnull_bool(this.method.get$isConstructor())) { |
| 11417 initializers = []; | 11431 initializers = []; |
| 11418 initializedFields = new HashSetImplementation(); | 11432 initializedFields = new HashSetImplementation(); |
| 11419 var $list = world.gen._orderValues(this.method.declaringType.getAllMembers()
); | 11433 var $list = $globals.world.gen._orderValues(this.method.declaringType.getAll
Members()); |
| 11420 for (var $i = 0;$i < $list.length; $i++) { | 11434 for (var $i = 0;$i < $list.length; $i++) { |
| 11421 var f = $list.$index($i); | 11435 var f = $list.$index($i); |
| 11422 if ((f instanceof FieldMember) && !$notnull_bool(f.get$isStatic())) { | 11436 if ((f instanceof FieldMember) && !$notnull_bool(f.get$isStatic())) { |
| 11423 var cv = f.computeValue$0(); | 11437 var cv = f.computeValue$0(); |
| 11424 if ($notnull_bool($ne(cv, null))) { | 11438 if ($notnull_bool($ne(cv, null))) { |
| 11425 initializers.add$1(('this.' + f.get$jsname() + ' = ' + cv.get$code()))
; | 11439 initializers.add$1(('this.' + f.get$jsname() + ' = ' + cv.get$code()))
; |
| 11426 initializedFields.add$1(f.get$name()); | 11440 initializedFields.add$1(f.get$name()); |
| 11427 } | 11441 } |
| 11428 } | 11442 } |
| 11429 } | 11443 } |
| 11430 } | 11444 } |
| 11431 this._paramCode = []; | 11445 this._paramCode = []; |
| 11432 var $list = this.method.get$parameters(); | 11446 var $list = this.method.get$parameters(); |
| 11433 for (var $i = 0;$i < $list.length; $i++) { | 11447 for (var $i = 0;$i < $list.length; $i++) { |
| 11434 var p = $list.$index($i); | 11448 var p = $list.$index($i); |
| 11435 if ($notnull_bool($ne(initializers, null)) && $notnull_bool(p.get$isInitiali
zer())) { | 11449 if ($notnull_bool($ne(initializers, null)) && $notnull_bool(p.get$isInitiali
zer())) { |
| 11436 var field = this.method.declaringType.getMember($assert_String(p.get$name(
))); | 11450 var field = this.method.declaringType.getMember($assert_String(p.get$name(
))); |
| 11437 if ($notnull_bool(field == null)) { | 11451 if ($notnull_bool(field == null)) { |
| 11438 world.error('bad this parameter - no matching field', (($0 = p.get$defin
ition().get$span()) && $0.is$SourceSpan())); | 11452 $globals.world.error('bad this parameter - no matching field', (($0 = p.
get$definition().get$span()) && $0.is$SourceSpan())); |
| 11439 } | 11453 } |
| 11440 if (!$notnull_bool(field.get$isField())) { | 11454 if (!$notnull_bool(field.get$isField())) { |
| 11441 world.error(('"this.' + p.get$name() + '" does not refer to a field'), (
($0 = p.get$definition().get$span()) && $0.is$SourceSpan())); | 11455 $globals.world.error(('"this.' + p.get$name() + '" does not refer to a f
ield'), (($0 = p.get$definition().get$span()) && $0.is$SourceSpan())); |
| 11442 } | 11456 } |
| 11443 var paramValue = new Value(field.get$returnType(), p.get$name(), p.get$def
inition().get$span(), false); | 11457 var paramValue = new Value(field.get$returnType(), p.get$name(), p.get$def
inition().get$span(), false); |
| 11444 this._paramCode.add(paramValue.get$code()); | 11458 this._paramCode.add(paramValue.get$code()); |
| 11445 initializers.add$1(('this.' + field.get$jsname() + ' = ' + paramValue.get$
code() + ';')); | 11459 initializers.add$1(('this.' + field.get$jsname() + ' = ' + paramValue.get$
code() + ';')); |
| 11446 initializedFields.add$1(p.get$name()); | 11460 initializedFields.add$1(p.get$name()); |
| 11447 } | 11461 } |
| 11448 else { | 11462 else { |
| 11449 var paramValue = this._scope.declareParameter((p && p.is$Parameter())); | 11463 var paramValue = this._scope.declareParameter((p && p.is$Parameter())); |
| 11450 this._paramCode.add(paramValue.get$code()); | 11464 this._paramCode.add(paramValue.get$code()); |
| 11451 } | 11465 } |
| 11452 } | 11466 } |
| 11453 var body = this.method.get$definition().get$body(); | 11467 var body = this.method.get$definition().get$body(); |
| 11454 if ($notnull_bool(body == null) && !$notnull_bool(this.method.get$isConstructo
r())) { | 11468 if ($notnull_bool(body == null) && !$notnull_bool(this.method.get$isConstructo
r())) { |
| 11455 world.error(('unexpected empty body for ' + this.method.name), (($0 = this.m
ethod.get$definition().get$span()) && $0.is$SourceSpan())); | 11469 $globals.world.error(('unexpected empty body for ' + this.method.name), (($0
= this.method.get$definition().get$span()) && $0.is$SourceSpan())); |
| 11456 } | 11470 } |
| 11457 var initializerCall = null; | 11471 var initializerCall = null; |
| 11458 var declaredInitializers = this.method.get$definition().get$initializers(); | 11472 var declaredInitializers = this.method.get$definition().get$initializers(); |
| 11459 if ($notnull_bool($ne(initializers, null))) { | 11473 if ($notnull_bool($ne(initializers, null))) { |
| 11460 for (var $i = initializers.iterator$0(); $i.hasNext$0(); ) { | 11474 for (var $i = initializers.iterator$0(); $i.hasNext$0(); ) { |
| 11461 var i = $i.next$0(); | 11475 var i = $i.next$0(); |
| 11462 this.writer.writeln($assert_String(i)); | 11476 this.writer.writeln($assert_String(i)); |
| 11463 } | 11477 } |
| 11464 if ($notnull_bool($ne(declaredInitializers, null))) { | 11478 if ($notnull_bool($ne(declaredInitializers, null))) { |
| 11465 for (var $i = declaredInitializers.iterator$0(); $i.hasNext$0(); ) { | 11479 for (var $i = declaredInitializers.iterator$0(); $i.hasNext$0(); ) { |
| 11466 var init = $i.next$0(); | 11480 var init = $i.next$0(); |
| 11467 if ((init instanceof CallExpression)) { | 11481 if ((init instanceof CallExpression)) { |
| 11468 if ($notnull_bool($ne(initializerCall, null))) { | 11482 if ($notnull_bool($ne(initializerCall, null))) { |
| 11469 world.error('only one initializer redirecting call is allowed', (($0
= init.get$span()) && $0.is$SourceSpan())); | 11483 $globals.world.error('only one initializer redirecting call is allow
ed', (($0 = init.get$span()) && $0.is$SourceSpan())); |
| 11470 } | 11484 } |
| 11471 initializerCall = init; | 11485 initializerCall = init; |
| 11472 } | 11486 } |
| 11473 else if ((init instanceof BinaryExpression) && TokenKind.kindFromAssign(
$assert_num(init.get$op().get$kind())) == 0) { | 11487 else if ((init instanceof BinaryExpression) && TokenKind.kindFromAssign(
$assert_num(init.get$op().get$kind())) == 0) { |
| 11474 var left = init.get$x(); | 11488 var left = init.get$x(); |
| 11475 if (!((left instanceof DotExpression) && (left.get$self() instanceof T
hisExpression) || (left instanceof VarExpression))) { | 11489 if (!((left instanceof DotExpression) && (left.get$self() instanceof T
hisExpression) || (left instanceof VarExpression))) { |
| 11476 world.error('invalid left side of initializer', (($0 = left.get$span
()) && $0.is$SourceSpan())); | 11490 $globals.world.error('invalid left side of initializer', (($0 = left
.get$span()) && $0.is$SourceSpan())); |
| 11477 continue; | 11491 continue; |
| 11478 } | 11492 } |
| 11479 var f = this.method.declaringType.getMember($assert_String(left.get$na
me().get$name())); | 11493 var f = this.method.declaringType.getMember($assert_String(left.get$na
me().get$name())); |
| 11480 if ($notnull_bool(f == null)) { | 11494 if ($notnull_bool(f == null)) { |
| 11481 world.error('bad initializer - no matching field', (($0 = left.get$s
pan()) && $0.is$SourceSpan())); | 11495 $globals.world.error('bad initializer - no matching field', (($0 = l
eft.get$span()) && $0.is$SourceSpan())); |
| 11482 continue; | 11496 continue; |
| 11483 } | 11497 } |
| 11484 else if (!$notnull_bool(f.get$isField())) { | 11498 else if (!$notnull_bool(f.get$isField())) { |
| 11485 world.error(('"' + left.get$name().get$name() + '" does not refer to
a field'), (($0 = left.get$span()) && $0.is$SourceSpan())); | 11499 $globals.world.error(('"' + left.get$name().get$name() + '" does not
refer to a field'), (($0 = left.get$span()) && $0.is$SourceSpan())); |
| 11486 continue; | 11500 continue; |
| 11487 } | 11501 } |
| 11488 initializedFields.add$1(f.get$name()); | 11502 initializedFields.add$1(f.get$name()); |
| 11489 this.writer.writeln(('this.' + f.get$jsname() + ' = ' + this.visitValu
e((($0 = init.get$y()) && $0.is$lang_Expression())).get$code() + ';')); | 11503 this.writer.writeln(('this.' + f.get$jsname() + ' = ' + this.visitValu
e((($0 = init.get$y()) && $0.is$lang_Expression())).get$code() + ';')); |
| 11490 } | 11504 } |
| 11491 else { | 11505 else { |
| 11492 world.error('invalid initializer', (($0 = init.get$span()) && $0.is$So
urceSpan())); | 11506 $globals.world.error('invalid initializer', (($0 = init.get$span()) &&
$0.is$SourceSpan())); |
| 11493 } | 11507 } |
| 11494 } | 11508 } |
| 11495 } | 11509 } |
| 11496 this.writer.comment('// Initializers done'); | 11510 this.writer.comment('// Initializers done'); |
| 11497 } | 11511 } |
| 11498 if ($notnull_bool(this.method.get$isConstructor()) && $notnull_bool(initialize
rCall == null)) { | 11512 if ($notnull_bool(this.method.get$isConstructor()) && $notnull_bool(initialize
rCall == null)) { |
| 11499 var parentType = this.method.declaringType.get$parent(); | 11513 var parentType = this.method.declaringType.get$parent(); |
| 11500 if ($notnull_bool($ne(parentType, null)) && !$notnull_bool(parentType.get$is
Object())) { | 11514 if ($notnull_bool($ne(parentType, null)) && !$notnull_bool(parentType.get$is
Object())) { |
| 11501 initializerCall = new CallExpression(new SuperExpression(this.method.get$s
pan()), [], this.method.get$span()); | 11515 initializerCall = new CallExpression(new SuperExpression(this.method.get$s
pan()), [], this.method.get$span()); |
| 11502 } | 11516 } |
| 11503 } | 11517 } |
| 11504 if ($notnull_bool($ne(initializerCall, null))) { | 11518 if ($notnull_bool($ne(initializerCall, null))) { |
| 11505 var target = this._writeInitializerCall((initializerCall && initializerCall.
is$CallExpression())); | 11519 var target = this._writeInitializerCall((initializerCall && initializerCall.
is$CallExpression())); |
| 11506 if (!$notnull_bool(target.get$isSuper())) { | 11520 if (!$notnull_bool(target.get$isSuper())) { |
| 11507 if (initializers.length > 0) { | 11521 if (initializers.length > 0) { |
| 11508 var $list = this.method.get$parameters(); | 11522 var $list = this.method.get$parameters(); |
| 11509 for (var $i = 0;$i < $list.length; $i++) { | 11523 for (var $i = 0;$i < $list.length; $i++) { |
| 11510 var p = $list.$index($i); | 11524 var p = $list.$index($i); |
| 11511 if ($notnull_bool(p.get$isInitializer())) { | 11525 if ($notnull_bool(p.get$isInitializer())) { |
| 11512 world.error('no initialization allowed on redirecting constructors',
(($0 = p.get$definition().get$span()) && $0.is$SourceSpan())); | 11526 $globals.world.error('no initialization allowed on redirecting const
ructors', (($0 = p.get$definition().get$span()) && $0.is$SourceSpan())); |
| 11513 break; | 11527 break; |
| 11514 } | 11528 } |
| 11515 } | 11529 } |
| 11516 } | 11530 } |
| 11517 if ($notnull_bool($ne(declaredInitializers, null)) && declaredInitializers
.length > 1) { | 11531 if ($notnull_bool($ne(declaredInitializers, null)) && declaredInitializers
.length > 1) { |
| 11518 var init = $notnull_bool($eq(declaredInitializers.$index(0), initializer
Call)) ? declaredInitializers.$index(1) : declaredInitializers.$index(0); | 11532 var init = $notnull_bool($eq(declaredInitializers.$index(0), initializer
Call)) ? declaredInitializers.$index(1) : declaredInitializers.$index(0); |
| 11519 world.error('no initialization allowed on redirecting constructors', (($
0 = init.get$span()) && $0.is$SourceSpan())); | 11533 $globals.world.error('no initialization allowed on redirecting construct
ors', (($0 = init.get$span()) && $0.is$SourceSpan())); |
| 11520 } | 11534 } |
| 11521 initializedFields = null; | 11535 initializedFields = null; |
| 11522 } | 11536 } |
| 11523 } | 11537 } |
| 11524 if ($notnull_bool($ne(initializedFields, null))) { | 11538 if ($notnull_bool($ne(initializedFields, null))) { |
| 11525 var $list = this.method.declaringType.get$members().getKeys(); | 11539 var $list = this.method.declaringType.get$members().getKeys(); |
| 11526 for (var $i = this.method.declaringType.get$members().getKeys().iterator$0()
; $i.hasNext$0(); ) { | 11540 for (var $i = this.method.declaringType.get$members().getKeys().iterator$0()
; $i.hasNext$0(); ) { |
| 11527 var name = $i.next$0(); | 11541 var name = $i.next$0(); |
| 11528 var member = this.method.declaringType.get$members().$index(name); | 11542 var member = this.method.declaringType.get$members().$index(name); |
| 11529 if ((member instanceof FieldMember) && $notnull_bool(member.get$isFinal())
&& !$notnull_bool(member.get$isStatic()) && !$notnull_bool(initializedFields.co
ntains$1(name))) { | 11543 if ((member instanceof FieldMember) && $notnull_bool(member.get$isFinal())
&& !$notnull_bool(member.get$isStatic()) && !$notnull_bool(initializedFields.co
ntains$1(name))) { |
| 11530 world.error(('Field "' + name + '" is final and was not initialized'), (
($0 = this.method.get$definition().get$span()) && $0.is$SourceSpan())); | 11544 $globals.world.error(('Field "' + name + '" is final and was not initial
ized'), (($0 = this.method.get$definition().get$span()) && $0.is$SourceSpan())); |
| 11531 } | 11545 } |
| 11532 } | 11546 } |
| 11533 } | 11547 } |
| 11534 this.visitStatementsInBlock((body && body.is$lang_Statement())); | 11548 this.visitStatementsInBlock((body && body.is$lang_Statement())); |
| 11535 } | 11549 } |
| 11536 MethodGenerator.prototype._writeInitializerCall = function(node) { | 11550 MethodGenerator.prototype._writeInitializerCall = function(node) { |
| 11537 var contructorName = ''; | 11551 var contructorName = ''; |
| 11538 var targetExp = node.target; | 11552 var targetExp = node.target; |
| 11539 if ((targetExp instanceof DotExpression)) { | 11553 if ((targetExp instanceof DotExpression)) { |
| 11540 var dot = (targetExp && targetExp.is$DotExpression()); | 11554 var dot = (targetExp && targetExp.is$DotExpression()); |
| 11541 targetExp = dot.self; | 11555 targetExp = dot.self; |
| 11542 contructorName = dot.name.name; | 11556 contructorName = dot.name.name; |
| 11543 } | 11557 } |
| 11544 var target = null; | 11558 var target = null; |
| 11545 if ((targetExp instanceof SuperExpression)) { | 11559 if ((targetExp instanceof SuperExpression)) { |
| 11546 target = this._makeSuperValue((targetExp && targetExp.is$lang_Node())); | 11560 target = this._makeSuperValue((targetExp && targetExp.is$lang_Node())); |
| 11547 } | 11561 } |
| 11548 else if ((targetExp instanceof ThisExpression)) { | 11562 else if ((targetExp instanceof ThisExpression)) { |
| 11549 target = this._makeThisValue((targetExp && targetExp.is$lang_Node())); | 11563 target = this._makeThisValue((targetExp && targetExp.is$lang_Node())); |
| 11550 } | 11564 } |
| 11551 else { | 11565 else { |
| 11552 world.error('bad call in initializers', node.span); | 11566 $globals.world.error('bad call in initializers', node.span); |
| 11553 } | 11567 } |
| 11554 var m = target.get$type().getConstructor$1(contructorName); | 11568 var m = target.get$type().getConstructor$1(contructorName); |
| 11555 this.method.set$initDelegate(m); | 11569 this.method.set$initDelegate(m); |
| 11556 var other = m; | 11570 var other = m; |
| 11557 while ($notnull_bool($ne(other, null))) { | 11571 while ($notnull_bool($ne(other, null))) { |
| 11558 if ($notnull_bool($eq(other, this.method))) { | 11572 if ($notnull_bool($eq(other, this.method))) { |
| 11559 world.error('initialization cycle', node.span); | 11573 $globals.world.error('initialization cycle', node.span); |
| 11560 break; | 11574 break; |
| 11561 } | 11575 } |
| 11562 other = other.get$initDelegate(); | 11576 other = other.get$initDelegate(); |
| 11563 } | 11577 } |
| 11564 world.gen.genMethod((m && m.is$Member())); | 11578 $globals.world.gen.genMethod((m && m.is$Member())); |
| 11565 var value = m.invoke$4(this, node, target, this._makeArgs(node.arguments)); | 11579 var value = m.invoke$4(this, node, target, this._makeArgs(node.arguments)); |
| 11566 if ($notnull_bool($ne(target.get$type(), world.objectType))) { | 11580 if ($notnull_bool($ne(target.get$type(), $globals.world.objectType))) { |
| 11567 this.writer.writeln(('' + value.get$code() + ';')); | 11581 this.writer.writeln(('' + value.get$code() + ';')); |
| 11568 } | 11582 } |
| 11569 return (target && target.is$Value()); | 11583 return (target && target.is$Value()); |
| 11570 } | 11584 } |
| 11571 MethodGenerator.prototype._makeArgs = function(arguments) { | 11585 MethodGenerator.prototype._makeArgs = function(arguments) { |
| 11572 var $0; | 11586 var $0; |
| 11573 var args = []; | 11587 var args = []; |
| 11574 var seenLabel = false; | 11588 var seenLabel = false; |
| 11575 for (var $i = 0;$i < arguments.length; $i++) { | 11589 for (var $i = 0;$i < arguments.length; $i++) { |
| 11576 var arg = arguments.$index($i); | 11590 var arg = arguments.$index($i); |
| 11577 if ($notnull_bool($ne(arg.get$label(), null))) { | 11591 if ($notnull_bool($ne(arg.get$label(), null))) { |
| 11578 seenLabel = true; | 11592 seenLabel = true; |
| 11579 } | 11593 } |
| 11580 else if ($notnull_bool(seenLabel)) { | 11594 else if ($notnull_bool(seenLabel)) { |
| 11581 world.error('bare argument can not follow named arguments', (($0 = arg.get
$span()) && $0.is$SourceSpan())); | 11595 $globals.world.error('bare argument can not follow named arguments', (($0
= arg.get$span()) && $0.is$SourceSpan())); |
| 11582 } | 11596 } |
| 11583 args.add$1(this.visitValue((($0 = arg.get$value()) && $0.is$lang_Expression(
)))); | 11597 args.add$1(this.visitValue((($0 = arg.get$value()) && $0.is$lang_Expression(
)))); |
| 11584 } | 11598 } |
| 11585 return new Arguments(arguments, args); | 11599 return new Arguments(arguments, args); |
| 11586 } | 11600 } |
| 11587 MethodGenerator._escapeString = function(text) { | 11601 MethodGenerator._escapeString = function(text) { |
| 11588 return text.replaceAll('\\', '\\\\').replaceAll('"', '\\"').replaceAll('\n', '
\\n').replaceAll('\r', '\\r'); | 11602 return text.replaceAll('\\', '\\\\').replaceAll('"', '\\"').replaceAll('\n', '
\\n').replaceAll('\r', '\\r'); |
| 11589 } | 11603 } |
| 11590 MethodGenerator.prototype.visitStatementsInBlock = function(body) { | 11604 MethodGenerator.prototype.visitStatementsInBlock = function(body) { |
| 11591 if ((body instanceof BlockStatement)) { | 11605 if ((body instanceof BlockStatement)) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 11604 MethodGenerator.prototype._pushBlock = function(reentrant) { | 11618 MethodGenerator.prototype._pushBlock = function(reentrant) { |
| 11605 this._scope = new BlockScope(this, this._scope, reentrant); | 11619 this._scope = new BlockScope(this, this._scope, reentrant); |
| 11606 } | 11620 } |
| 11607 MethodGenerator.prototype._popBlock = function() { | 11621 MethodGenerator.prototype._popBlock = function() { |
| 11608 this._scope = this._scope.parent; | 11622 this._scope = this._scope.parent; |
| 11609 } | 11623 } |
| 11610 MethodGenerator.prototype._makeLambdaMethod = function(name, func) { | 11624 MethodGenerator.prototype._makeLambdaMethod = function(name, func) { |
| 11611 var meth = new MethodMember(name, this.method.declaringType, func); | 11625 var meth = new MethodMember(name, this.method.declaringType, func); |
| 11612 meth.set$isLambda(true); | 11626 meth.set$isLambda(true); |
| 11613 meth.resolve$1(this.method.declaringType); | 11627 meth.resolve$1(this.method.declaringType); |
| 11614 world.gen.genMethod((meth && meth.is$Member()), this); | 11628 $globals.world.gen.genMethod((meth && meth.is$Member()), this); |
| 11615 return (meth && meth.is$MethodMember()); | 11629 return (meth && meth.is$MethodMember()); |
| 11616 } | 11630 } |
| 11617 MethodGenerator.prototype.visitBool = function(node) { | 11631 MethodGenerator.prototype.visitBool = function(node) { |
| 11618 return this.visitValue(node).convertTo$3(this, world.nonNullBool, node); | 11632 return this.visitValue(node).convertTo$3(this, $globals.world.nonNullBool, nod
e); |
| 11619 } | 11633 } |
| 11620 MethodGenerator.prototype.visitValue = function(node) { | 11634 MethodGenerator.prototype.visitValue = function(node) { |
| 11621 if (node == null) return null; | 11635 if (node == null) return null; |
| 11622 var value = node.visit(this); | 11636 var value = node.visit(this); |
| 11623 value.checkFirstClass$1(node.span); | 11637 value.checkFirstClass$1(node.span); |
| 11624 return value; | 11638 return value; |
| 11625 } | 11639 } |
| 11626 MethodGenerator.prototype.visitTypedValue = function(node, expectedType) { | 11640 MethodGenerator.prototype.visitTypedValue = function(node, expectedType) { |
| 11627 return this.visitValue(node).convertTo$3(this, expectedType, node); | 11641 return this.visitValue(node).convertTo$3(this, expectedType, node); |
| 11628 } | 11642 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 11651 for (var i = 0; | 11665 for (var i = 0; |
| 11652 i < node.names.length; i++) { | 11666 i < node.names.length; i++) { |
| 11653 var thisType = type; | 11667 var thisType = type; |
| 11654 if (i > 0) { | 11668 if (i > 0) { |
| 11655 this.writer.write(', '); | 11669 this.writer.write(', '); |
| 11656 } | 11670 } |
| 11657 var name = node.names.$index(i).get$name(); | 11671 var name = node.names.$index(i).get$name(); |
| 11658 var value = this.visitValue((($0 = node.values.$index(i)) && $0.is$lang_Expr
ession())); | 11672 var value = this.visitValue((($0 = node.values.$index(i)) && $0.is$lang_Expr
ession())); |
| 11659 if ($notnull_bool(isFinal)) { | 11673 if ($notnull_bool(isFinal)) { |
| 11660 if ($notnull_bool(value == null)) { | 11674 if ($notnull_bool(value == null)) { |
| 11661 world.error('no value specified for final variable', node.span); | 11675 $globals.world.error('no value specified for final variable', node.span)
; |
| 11662 } | 11676 } |
| 11663 else { | 11677 else { |
| 11664 if ($notnull_bool(thisType.get$isVar())) thisType = value.get$type(); | 11678 if ($notnull_bool(thisType.get$isVar())) thisType = value.get$type(); |
| 11665 } | 11679 } |
| 11666 } | 11680 } |
| 11667 var val = this._scope.create($assert_String(name), (thisType && thisType.is$
lang_Type()), (($0 = node.names.$index(i).get$span()) && $0.is$SourceSpan()), $a
ssert_bool(isFinal), false); | 11681 var val = this._scope.create($assert_String(name), (thisType && thisType.is$
lang_Type()), (($0 = node.names.$index(i).get$span()) && $0.is$SourceSpan()), $a
ssert_bool(isFinal), false); |
| 11668 if ($notnull_bool(value == null)) { | 11682 if ($notnull_bool(value == null)) { |
| 11669 if ($notnull_bool(this._scope.reentrant)) { | 11683 if ($notnull_bool(this._scope.reentrant)) { |
| 11670 this.writer.write(('' + val.get$code() + ' = null')); | 11684 this.writer.write(('' + val.get$code() + ' = null')); |
| 11671 } | 11685 } |
| 11672 else { | 11686 else { |
| 11673 this.writer.write(('' + val.get$code())); | 11687 this.writer.write(('' + val.get$code())); |
| 11674 } | 11688 } |
| 11675 } | 11689 } |
| 11676 else { | 11690 else { |
| 11677 value = value.convertTo$3(this, type, node.values.$index(i)); | 11691 value = value.convertTo$3(this, type, node.values.$index(i)); |
| 11678 this.writer.write(('' + val.get$code() + ' = ' + value.get$code())); | 11692 this.writer.write(('' + val.get$code() + ' = ' + value.get$code())); |
| 11679 } | 11693 } |
| 11680 } | 11694 } |
| 11681 this.writer.writeln(';'); | 11695 this.writer.writeln(';'); |
| 11682 return false; | 11696 return false; |
| 11683 } | 11697 } |
| 11684 MethodGenerator.prototype.visitFunctionDefinition = function(node) { | 11698 MethodGenerator.prototype.visitFunctionDefinition = function(node) { |
| 11685 var $0; | 11699 var $0; |
| 11686 var name = world.toJsIdentifier(node.name.name); | 11700 var name = $globals.world.toJsIdentifier(node.name.name); |
| 11687 var meth = this._makeLambdaMethod($assert_String(name), node); | 11701 var meth = this._makeLambdaMethod($assert_String(name), node); |
| 11688 var funcValue = this._scope.create($assert_String(name), (($0 = meth.get$funct
ionType()) && $0.is$lang_Type()), (($0 = this.method.get$definition().get$span()
) && $0.is$SourceSpan()), true, false); | 11702 var funcValue = this._scope.create($assert_String(name), (($0 = meth.get$funct
ionType()) && $0.is$lang_Type()), (($0 = this.method.get$definition().get$span()
) && $0.is$SourceSpan()), true, false); |
| 11689 meth.get$generator().writeDefinition$2(this.writer); | 11703 meth.get$generator().writeDefinition$2(this.writer); |
| 11690 return false; | 11704 return false; |
| 11691 } | 11705 } |
| 11692 MethodGenerator.prototype.visitReturnStatement = function(node) { | 11706 MethodGenerator.prototype.visitReturnStatement = function(node) { |
| 11693 if (node.value == null) { | 11707 if (node.value == null) { |
| 11694 this.writer.writeln('return;'); | 11708 this.writer.writeln('return;'); |
| 11695 } | 11709 } |
| 11696 else { | 11710 else { |
| 11697 if ($notnull_bool(this.method.get$isConstructor())) { | 11711 if ($notnull_bool(this.method.get$isConstructor())) { |
| 11698 world.error('return of value not allowed from constructor', node.span); | 11712 $globals.world.error('return of value not allowed from constructor', node.
span); |
| 11699 } | 11713 } |
| 11700 var value = this.visitTypedValue(node.value, this.method.get$returnType()); | 11714 var value = this.visitTypedValue(node.value, this.method.get$returnType()); |
| 11701 this.writer.writeln(('return ' + value.get$code() + ';')); | 11715 this.writer.writeln(('return ' + value.get$code() + ';')); |
| 11702 } | 11716 } |
| 11703 return true; | 11717 return true; |
| 11704 } | 11718 } |
| 11705 MethodGenerator.prototype.visitThrowStatement = function(node) { | 11719 MethodGenerator.prototype.visitThrowStatement = function(node) { |
| 11706 if (node.value != null) { | 11720 if (node.value != null) { |
| 11707 var value = this.visitValue(node.value); | 11721 var value = this.visitValue(node.value); |
| 11708 value.invoke$4(this, 'toString', node, Arguments.get$EMPTY()); | 11722 value.invoke$4(this, 'toString', node, Arguments.get$EMPTY()); |
| 11709 this.writer.writeln(('\$throw(' + value.get$code() + ');')); | 11723 this.writer.writeln(('\$throw(' + value.get$code() + ');')); |
| 11710 world.gen.corejs.useThrow = true; | 11724 $globals.world.gen.corejs.useThrow = true; |
| 11711 } | 11725 } |
| 11712 else { | 11726 else { |
| 11713 var rethrow = this._scope.getRethrow(); | 11727 var rethrow = this._scope.getRethrow(); |
| 11714 if ($notnull_bool(rethrow == null)) { | 11728 if ($notnull_bool(rethrow == null)) { |
| 11715 world.error('rethrow outside of catch', node.span); | 11729 $globals.world.error('rethrow outside of catch', node.span); |
| 11716 } | 11730 } |
| 11717 else { | 11731 else { |
| 11718 this.writer.writeln(('throw ' + rethrow.get$code() + ';')); | 11732 this.writer.writeln(('throw ' + rethrow.get$code() + ';')); |
| 11719 } | 11733 } |
| 11720 } | 11734 } |
| 11721 return true; | 11735 return true; |
| 11722 } | 11736 } |
| 11723 MethodGenerator.prototype.visitAssertStatement = function(node) { | 11737 MethodGenerator.prototype.visitAssertStatement = function(node) { |
| 11724 var $0; | 11738 var $0; |
| 11725 var test = this.visitValue(node.test); | 11739 var test = this.visitValue(node.test); |
| 11726 if ($notnull_bool(options.enableAsserts)) { | 11740 if ($notnull_bool($globals.options.enableAsserts)) { |
| 11727 var err = world.corelib.types.$index('AssertError'); | 11741 var err = $globals.world.corelib.types.$index('AssertError'); |
| 11728 world.gen.genMethod((($0 = err.getConstructor$1('')) && $0.is$Member())); | 11742 $globals.world.gen.genMethod((($0 = err.getConstructor$1('')) && $0.is$Membe
r())); |
| 11729 world.gen.genMethod((($0 = err.get$members().$index('toString')) && $0.is$Me
mber())); | 11743 $globals.world.gen.genMethod((($0 = err.get$members().$index('toString')) &&
$0.is$Member())); |
| 11730 var span = node.test.span; | 11744 var span = node.test.span; |
| 11731 var line = span.get$file().getLine$1(span.get$start()); | 11745 var line = span.get$file().getLine$1(span.get$start()); |
| 11732 var column = span.get$file().getColumn$2(line, span.get$start()); | 11746 var column = span.get$file().getColumn$2(line, span.get$start()); |
| 11733 this.writer.writeln(('\$assert(' + test.get$code() + ', "' + MethodGenerator
._escapeString($assert_String(span.get$text())) + '",') + (' "' + basename($asse
rt_String(span.get$file().get$filename())) + '", ' + (line + 1) + ', ' + (column
+ 1) + ');')); | 11747 this.writer.writeln(('\$assert(' + test.get$code() + ', "' + MethodGenerator
._escapeString($assert_String(span.get$text())) + '",') + (' "' + basename($asse
rt_String(span.get$file().get$filename())) + '", ' + (line + 1) + ', ' + (column
+ 1) + ');')); |
| 11734 world.gen.corejs.useAssert = true; | 11748 $globals.world.gen.corejs.useAssert = true; |
| 11735 } | 11749 } |
| 11736 return false; | 11750 return false; |
| 11737 } | 11751 } |
| 11738 MethodGenerator.prototype.visitBreakStatement = function(node) { | 11752 MethodGenerator.prototype.visitBreakStatement = function(node) { |
| 11739 if (node.label == null) { | 11753 if (node.label == null) { |
| 11740 this.writer.writeln('break;'); | 11754 this.writer.writeln('break;'); |
| 11741 } | 11755 } |
| 11742 else { | 11756 else { |
| 11743 this.writer.writeln(('break ' + node.label.name + ';')); | 11757 this.writer.writeln(('break ' + node.label.name + ';')); |
| 11744 } | 11758 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11823 var list = node.list.visit(this); | 11837 var list = node.list.visit(this); |
| 11824 this._pushBlock(true); | 11838 this._pushBlock(true); |
| 11825 var isFinal = this._isFinal(node.item.type); | 11839 var isFinal = this._isFinal(node.item.type); |
| 11826 var item = this._scope.create($assert_String(itemName), (itemType && itemType.
is$lang_Type()), node.item.name.span, isFinal, false); | 11840 var item = this._scope.create($assert_String(itemName), (itemType && itemType.
is$lang_Type()), node.item.name.span, isFinal, false); |
| 11827 var listVar = (list && list.is$Value()); | 11841 var listVar = (list && list.is$Value()); |
| 11828 if ($notnull_bool(list.get$needsTemp())) { | 11842 if ($notnull_bool(list.get$needsTemp())) { |
| 11829 listVar = this._scope.create('\$list', (($0 = list.get$type()) && $0.is$lang
_Type()), null, false, false); | 11843 listVar = this._scope.create('\$list', (($0 = list.get$type()) && $0.is$lang
_Type()), null, false, false); |
| 11830 this.writer.writeln(('var ' + listVar.code + ' = ' + list.get$code() + ';'))
; | 11844 this.writer.writeln(('var ' + listVar.code + ' = ' + list.get$code() + ';'))
; |
| 11831 } | 11845 } |
| 11832 if ($notnull_bool(list.get$type().get$isList())) { | 11846 if ($notnull_bool(list.get$type().get$isList())) { |
| 11833 var tmpi = this._scope.create('\$i', world.numType, null, false, false); | 11847 var tmpi = this._scope.create('\$i', $globals.world.numType, null, false, fa
lse); |
| 11834 this.writer.enterBlock(('for (var ' + tmpi.get$code() + ' = 0;') + ('' + tmp
i.get$code() + ' < ' + listVar.code + '.length; ' + tmpi.get$code() + '++) {')); | 11848 this.writer.enterBlock(('for (var ' + tmpi.get$code() + ' = 0;') + ('' + tmp
i.get$code() + ' < ' + listVar.code + '.length; ' + tmpi.get$code() + '++) {')); |
| 11835 var value = listVar.invoke(this, '\$index', node.list, new Arguments(null, [
tmpi]), false); | 11849 var value = listVar.invoke(this, '\$index', node.list, new Arguments(null, [
tmpi]), false); |
| 11836 this.writer.writeln(('var ' + item.get$code() + ' = ' + value.get$code() + '
;')); | 11850 this.writer.writeln(('var ' + item.get$code() + ' = ' + value.get$code() + '
;')); |
| 11837 } | 11851 } |
| 11838 else { | 11852 else { |
| 11839 this._pushBlock(false); | 11853 this._pushBlock(false); |
| 11840 var iterator = list.invoke$4(this, 'iterator', node.list, Arguments.get$EMPT
Y()); | 11854 var iterator = list.invoke$4(this, 'iterator', node.list, Arguments.get$EMPT
Y()); |
| 11841 var tmpi = this._scope.create('\$i', (($0 = iterator.get$type()) && $0.is$la
ng_Type()), null, false, false); | 11855 var tmpi = this._scope.create('\$i', (($0 = iterator.get$type()) && $0.is$la
ng_Type()), null, false, false); |
| 11842 var hasNext = tmpi.invoke$4(this, 'hasNext', node.list, Arguments.get$EMPTY(
)); | 11856 var hasNext = tmpi.invoke$4(this, 'hasNext', node.list, Arguments.get$EMPTY(
)); |
| 11843 var next = tmpi.invoke$4(this, 'next', node.list, Arguments.get$EMPTY()); | 11857 var next = tmpi.invoke$4(this, 'next', node.list, Arguments.get$EMPTY()); |
| 11844 this.writer.enterBlock(('for (var ' + tmpi.get$code() + ' = ' + iterator.get
$code() + '; ' + hasNext.get$code() + '; ) {')); | 11858 this.writer.enterBlock(('for (var ' + tmpi.get$code() + ' = ' + iterator.get
$code() + '; ' + hasNext.get$code() + '; ) {')); |
| 11845 this.writer.writeln(('var ' + item.get$code() + ' = ' + next.get$code() + ';
')); | 11859 this.writer.writeln(('var ' + item.get$code() + ' = ' + next.get$code() + ';
')); |
| 11846 } | 11860 } |
| 11847 this.visitStatementsInBlock(node.body); | 11861 this.visitStatementsInBlock(node.body); |
| 11848 this.writer.exitBlock('}'); | 11862 this.writer.exitBlock('}'); |
| 11849 this._popBlock(); | 11863 this._popBlock(); |
| 11850 return false; | 11864 return false; |
| 11851 } | 11865 } |
| 11852 MethodGenerator.prototype._genToDartException = function(ex, node) { | 11866 MethodGenerator.prototype._genToDartException = function(ex, node) { |
| 11853 var types = const$384/*const [ | 11867 var types = const$386/*const [ |
| 11854 'NullPointerException', 'ObjectNotClosureException', | 11868 'NullPointerException', 'ObjectNotClosureException', |
| 11855 'NoSuchMethodException', 'StackOverflowException']*/; | 11869 'NoSuchMethodException', 'StackOverflowException']*/; |
| 11856 var target = new Value(world.varType, 'this', node.span, true); | 11870 var target = new Value($globals.world.varType, 'this', node.span, true); |
| 11857 for (var $i = types.iterator$0(); $i.hasNext$0(); ) { | 11871 for (var $i = types.iterator$0(); $i.hasNext$0(); ) { |
| 11858 var name = $i.next$0(); | 11872 var name = $i.next$0(); |
| 11859 world.corelib.types.$index(name).markUsed$0(); | 11873 $globals.world.corelib.types.$index(name).markUsed$0(); |
| 11860 world.corelib.types.$index(name).get$members().$index('toString').invoke$4(t
his, node, target, Arguments.get$EMPTY()); | 11874 $globals.world.corelib.types.$index(name).get$members().$index('toString').i
nvoke$4(this, node, target, Arguments.get$EMPTY()); |
| 11861 } | 11875 } |
| 11862 this.writer.writeln(('' + ex + ' = \$toDartException(' + ex + ');')); | 11876 this.writer.writeln(('' + ex + ' = \$toDartException(' + ex + ');')); |
| 11863 world.gen.corejs.useToDartException = true; | 11877 $globals.world.gen.corejs.useToDartException = true; |
| 11864 } | 11878 } |
| 11865 MethodGenerator.prototype.visitTryStatement = function(node) { | 11879 MethodGenerator.prototype.visitTryStatement = function(node) { |
| 11866 var $0; | 11880 var $0; |
| 11867 this.writer.enterBlock('try {'); | 11881 this.writer.enterBlock('try {'); |
| 11868 this._pushBlock(false); | 11882 this._pushBlock(false); |
| 11869 this.visitStatementsInBlock(node.body); | 11883 this.visitStatementsInBlock(node.body); |
| 11870 this._popBlock(); | 11884 this._popBlock(); |
| 11871 if (node.catches.length == 1) { | 11885 if (node.catches.length == 1) { |
| 11872 var catch_ = node.catches.$index(0); | 11886 var catch_ = node.catches.$index(0); |
| 11873 this._pushBlock(false); | 11887 this._pushBlock(false); |
| 11874 var ex = this._scope.declare((($0 = catch_.get$exception()) && $0.is$Declare
dIdentifier())); | 11888 var ex = this._scope.declare((($0 = catch_.get$exception()) && $0.is$Declare
dIdentifier())); |
| 11875 this._scope.rethrow = (ex && ex.is$Value()); | 11889 this._scope.rethrow = (ex && ex.is$Value()); |
| 11876 this.writer.nextBlock(('} catch (' + ex.get$code() + ') {')); | 11890 this.writer.nextBlock(('} catch (' + ex.get$code() + ') {')); |
| 11877 if ($notnull_bool($ne(catch_.get$trace(), null))) { | 11891 if ($notnull_bool($ne(catch_.get$trace(), null))) { |
| 11878 var trace = this._scope.declare((($0 = catch_.get$trace()) && $0.is$Declar
edIdentifier())); | 11892 var trace = this._scope.declare((($0 = catch_.get$trace()) && $0.is$Declar
edIdentifier())); |
| 11879 this.writer.writeln(('var ' + trace.get$code() + ' = \$stackTraceOf(' + ex
.get$code() + ');')); | 11893 this.writer.writeln(('var ' + trace.get$code() + ' = \$stackTraceOf(' + ex
.get$code() + ');')); |
| 11880 world.gen.corejs.useStackTraceOf = true; | 11894 $globals.world.gen.corejs.useStackTraceOf = true; |
| 11881 } | 11895 } |
| 11882 this._genToDartException($assert_String(ex.get$code()), node); | 11896 this._genToDartException($assert_String(ex.get$code()), node); |
| 11883 if (!$notnull_bool(ex.get$type().get$isVarOrObject())) { | 11897 if (!$notnull_bool(ex.get$type().get$isVarOrObject())) { |
| 11884 var test = ex.instanceOf$3$isTrue$forceCheck(this, ex.get$type(), catch_.g
et$exception().get$span(), false, true); | 11898 var test = ex.instanceOf$3$isTrue$forceCheck(this, ex.get$type(), catch_.g
et$exception().get$span(), false, true); |
| 11885 this.writer.writeln(('if (' + test.get$code() + ') throw ' + ex.get$code()
+ ';')); | 11899 this.writer.writeln(('if (' + test.get$code() + ') throw ' + ex.get$code()
+ ';')); |
| 11886 } | 11900 } |
| 11887 this.visitStatementsInBlock((($0 = node.catches.$index(0).get$body()) && $0.
is$lang_Statement())); | 11901 this.visitStatementsInBlock((($0 = node.catches.$index(0).get$body()) && $0.
is$lang_Statement())); |
| 11888 this._popBlock(); | 11902 this._popBlock(); |
| 11889 } | 11903 } |
| 11890 else if (node.catches.length > 0) { | 11904 else if (node.catches.length > 0) { |
| 11891 this._pushBlock(false); | 11905 this._pushBlock(false); |
| 11892 var ex = this._scope.create('\$ex', world.varType, null, false, false); | 11906 var ex = this._scope.create('\$ex', $globals.world.varType, null, false, fal
se); |
| 11893 this._scope.rethrow = (ex && ex.is$Value()); | 11907 this._scope.rethrow = (ex && ex.is$Value()); |
| 11894 this.writer.nextBlock(('} catch (' + ex.get$code() + ') {')); | 11908 this.writer.nextBlock(('} catch (' + ex.get$code() + ') {')); |
| 11895 var trace = null; | 11909 var trace = null; |
| 11896 if (node.catches.some((function (c) { | 11910 if (node.catches.some((function (c) { |
| 11897 return $ne(c.get$trace(), null); | 11911 return $ne(c.get$trace(), null); |
| 11898 }) | 11912 }) |
| 11899 )) { | 11913 )) { |
| 11900 trace = this._scope.create('\$trace', world.varType, null, false, false); | 11914 trace = this._scope.create('\$trace', $globals.world.varType, null, false,
false); |
| 11901 this.writer.writeln(('var ' + trace.get$code() + ' = \$stackTraceOf(' + ex
.get$code() + ');')); | 11915 this.writer.writeln(('var ' + trace.get$code() + ' = \$stackTraceOf(' + ex
.get$code() + ');')); |
| 11902 world.gen.corejs.useStackTraceOf = true; | 11916 $globals.world.gen.corejs.useStackTraceOf = true; |
| 11903 } | 11917 } |
| 11904 this._genToDartException($assert_String(ex.get$code()), node); | 11918 this._genToDartException($assert_String(ex.get$code()), node); |
| 11905 var needsRethrow = true; | 11919 var needsRethrow = true; |
| 11906 for (var i = 0; | 11920 for (var i = 0; |
| 11907 i < node.catches.length; i++) { | 11921 i < node.catches.length; i++) { |
| 11908 var catch_ = node.catches.$index(i); | 11922 var catch_ = node.catches.$index(i); |
| 11909 this._pushBlock(false); | 11923 this._pushBlock(false); |
| 11910 var tmp = this._scope.declare((($0 = catch_.get$exception()) && $0.is$Decl
aredIdentifier())); | 11924 var tmp = this._scope.declare((($0 = catch_.get$exception()) && $0.is$Decl
aredIdentifier())); |
| 11911 if (!$notnull_bool(tmp.get$type().get$isVarOrObject())) { | 11925 if (!$notnull_bool(tmp.get$type().get$isVarOrObject())) { |
| 11912 var test = ex.instanceOf$3$isTrue$forceCheck(this, tmp.get$type(), catch
_.get$exception().get$span(), true, true); | 11926 var test = ex.instanceOf$3$isTrue$forceCheck(this, tmp.get$type(), catch
_.get$exception().get$span(), true, true); |
| 11913 if (i == 0) { | 11927 if (i == 0) { |
| 11914 this.writer.enterBlock(('if (' + test.get$code() + ') {')); | 11928 this.writer.enterBlock(('if (' + test.get$code() + ') {')); |
| 11915 } | 11929 } |
| 11916 else { | 11930 else { |
| 11917 this.writer.nextBlock(('} else if (' + test.get$code() + ') {')); | 11931 this.writer.nextBlock(('} else if (' + test.get$code() + ') {')); |
| 11918 } | 11932 } |
| 11919 } | 11933 } |
| 11920 else if (i > 0) { | 11934 else if (i > 0) { |
| 11921 this.writer.nextBlock('} else {'); | 11935 this.writer.nextBlock('} else {'); |
| 11922 } | 11936 } |
| 11923 this.writer.writeln(('var ' + tmp.get$code() + ' = ' + ex.get$code() + ';'
)); | 11937 this.writer.writeln(('var ' + tmp.get$code() + ' = ' + ex.get$code() + ';'
)); |
| 11924 if ($notnull_bool($ne(catch_.get$trace(), null))) { | 11938 if ($notnull_bool($ne(catch_.get$trace(), null))) { |
| 11925 var tmptrace = this._scope.declare((($0 = catch_.get$trace()) && $0.is$D
eclaredIdentifier())); | 11939 var tmptrace = this._scope.declare((($0 = catch_.get$trace()) && $0.is$D
eclaredIdentifier())); |
| 11926 this.writer.writeln(('var ' + tmptrace.get$code() + ' = ' + trace.get$co
de() + ';')); | 11940 this.writer.writeln(('var ' + tmptrace.get$code() + ' = ' + trace.get$co
de() + ';')); |
| 11927 } | 11941 } |
| 11928 this.visitStatementsInBlock((($0 = catch_.get$body()) && $0.is$lang_Statem
ent())); | 11942 this.visitStatementsInBlock((($0 = catch_.get$body()) && $0.is$lang_Statem
ent())); |
| 11929 this._popBlock(); | 11943 this._popBlock(); |
| 11930 if ($notnull_bool(tmp.get$type().get$isVarOrObject())) { | 11944 if ($notnull_bool(tmp.get$type().get$isVarOrObject())) { |
| 11931 if (i + 1 < node.catches.length) { | 11945 if (i + 1 < node.catches.length) { |
| 11932 world.warning('Unreachable catch clause', (($0 = node.catches.$index(i
+ 1)) && $0.is$SourceSpan())); | 11946 $globals.world.warning('Unreachable catch clause', (($0 = node.catches
.$index(i + 1)) && $0.is$SourceSpan())); |
| 11933 } | 11947 } |
| 11934 if (i > 0) { | 11948 if (i > 0) { |
| 11935 this.writer.exitBlock('}'); | 11949 this.writer.exitBlock('}'); |
| 11936 } | 11950 } |
| 11937 needsRethrow = false; | 11951 needsRethrow = false; |
| 11938 break; | 11952 break; |
| 11939 } | 11953 } |
| 11940 } | 11954 } |
| 11941 if ($notnull_bool(needsRethrow)) { | 11955 if ($notnull_bool(needsRethrow)) { |
| 11942 this.writer.nextBlock('} else {'); | 11956 this.writer.nextBlock('} else {'); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 11955 return false; | 11969 return false; |
| 11956 } | 11970 } |
| 11957 MethodGenerator.prototype.visitSwitchStatement = function(node) { | 11971 MethodGenerator.prototype.visitSwitchStatement = function(node) { |
| 11958 var $0; | 11972 var $0; |
| 11959 var test = this.visitValue(node.test); | 11973 var test = this.visitValue(node.test); |
| 11960 this.writer.enterBlock(('switch (' + test.get$code() + ') {')); | 11974 this.writer.enterBlock(('switch (' + test.get$code() + ') {')); |
| 11961 var $list = node.cases; | 11975 var $list = node.cases; |
| 11962 for (var $i = 0;$i < $list.length; $i++) { | 11976 for (var $i = 0;$i < $list.length; $i++) { |
| 11963 var case_ = $list.$index($i); | 11977 var case_ = $list.$index($i); |
| 11964 if ($notnull_bool($ne(case_.get$label(), null))) { | 11978 if ($notnull_bool($ne(case_.get$label(), null))) { |
| 11965 world.error('unimplemented: labeled case statement', (($0 = case_.get$span
()) && $0.is$SourceSpan())); | 11979 $globals.world.error('unimplemented: labeled case statement', (($0 = case_
.get$span()) && $0.is$SourceSpan())); |
| 11966 } | 11980 } |
| 11967 this._pushBlock(false); | 11981 this._pushBlock(false); |
| 11968 for (var i = 0; | 11982 for (var i = 0; |
| 11969 i < $assert_num(case_.get$cases().length); i++) { | 11983 i < $assert_num(case_.get$cases().length); i++) { |
| 11970 var expr = case_.get$cases().$index(i); | 11984 var expr = case_.get$cases().$index(i); |
| 11971 if ($notnull_bool(expr == null)) { | 11985 if ($notnull_bool(expr == null)) { |
| 11972 if (i < case_.get$cases().length - 1) { | 11986 if (i < case_.get$cases().length - 1) { |
| 11973 world.error('default clause must be the last case', (($0 = case_.get$s
pan()) && $0.is$SourceSpan())); | 11987 $globals.world.error('default clause must be the last case', (($0 = ca
se_.get$span()) && $0.is$SourceSpan())); |
| 11974 } | 11988 } |
| 11975 this.writer.writeln('default:'); | 11989 this.writer.writeln('default:'); |
| 11976 } | 11990 } |
| 11977 else { | 11991 else { |
| 11978 var value = this.visitValue((expr && expr.is$lang_Expression())); | 11992 var value = this.visitValue((expr && expr.is$lang_Expression())); |
| 11979 this.writer.writeln(('case ' + value.get$code() + ':')); | 11993 this.writer.writeln(('case ' + value.get$code() + ':')); |
| 11980 } | 11994 } |
| 11981 } | 11995 } |
| 11982 this.writer.enterBlock(''); | 11996 this.writer.enterBlock(''); |
| 11983 var caseExits = this._visitAllStatements(case_.get$statements(), false); | 11997 var caseExits = this._visitAllStatements(case_.get$statements(), false); |
| 11984 if ($notnull_bool($ne(case_, node.cases.$index(node.cases.length - 1))) && !
$notnull_bool(caseExits)) { | 11998 if ($notnull_bool($ne(case_, node.cases.$index(node.cases.length - 1))) && !
$notnull_bool(caseExits)) { |
| 11985 var span = case_.get$statements().$index(case_.get$statements().length - 1
).get$span(); | 11999 var span = case_.get$statements().$index(case_.get$statements().length - 1
).get$span(); |
| 11986 this.writer.writeln('\$throw(new FallThroughError());'); | 12000 this.writer.writeln('\$throw(new FallThroughError());'); |
| 11987 world.gen.corejs.useThrow = true; | 12001 $globals.world.gen.corejs.useThrow = true; |
| 11988 } | 12002 } |
| 11989 this.writer.exitBlock(''); | 12003 this.writer.exitBlock(''); |
| 11990 this._popBlock(); | 12004 this._popBlock(); |
| 11991 } | 12005 } |
| 11992 this.writer.exitBlock('}'); | 12006 this.writer.exitBlock('}'); |
| 11993 return false; | 12007 return false; |
| 11994 } | 12008 } |
| 11995 MethodGenerator.prototype._visitAllStatements = function(statementList, exits) { | 12009 MethodGenerator.prototype._visitAllStatements = function(statementList, exits) { |
| 11996 var $0; | 12010 var $0; |
| 11997 for (var i = 0; | 12011 for (var i = 0; |
| 11998 i < $assert_num(statementList.length); i++) { | 12012 i < $assert_num(statementList.length); i++) { |
| 11999 var stmt = statementList.$index(i); | 12013 var stmt = statementList.$index(i); |
| 12000 exits = stmt.visit$1(this); | 12014 exits = stmt.visit$1(this); |
| 12001 if ($notnull_bool($ne(stmt, statementList.$index(statementList.length - 1)))
&& $notnull_bool(exits)) { | 12015 if ($notnull_bool($ne(stmt, statementList.$index(statementList.length - 1)))
&& $notnull_bool(exits)) { |
| 12002 world.warning('unreachable code', (($0 = statementList.$index(i + 1).get$s
pan()) && $0.is$SourceSpan())); | 12016 $globals.world.warning('unreachable code', (($0 = statementList.$index(i +
1).get$span()) && $0.is$SourceSpan())); |
| 12003 } | 12017 } |
| 12004 } | 12018 } |
| 12005 return $assert_bool(exits); | 12019 return $assert_bool(exits); |
| 12006 } | 12020 } |
| 12007 MethodGenerator.prototype.visitBlockStatement = function(node) { | 12021 MethodGenerator.prototype.visitBlockStatement = function(node) { |
| 12008 this._pushBlock(false); | 12022 this._pushBlock(false); |
| 12009 this.writer.enterBlock('{'); | 12023 this.writer.enterBlock('{'); |
| 12010 var exits = this._visitAllStatements(node.body, false); | 12024 var exits = this._visitAllStatements(node.body, false); |
| 12011 this.writer.exitBlock('}'); | 12025 this.writer.exitBlock('}'); |
| 12012 this._popBlock(); | 12026 this._popBlock(); |
| 12013 return $assert_bool(exits); | 12027 return $assert_bool(exits); |
| 12014 } | 12028 } |
| 12015 MethodGenerator.prototype.visitLabeledStatement = function(node) { | 12029 MethodGenerator.prototype.visitLabeledStatement = function(node) { |
| 12016 this.writer.writeln(('' + node.name.name + ':')); | 12030 this.writer.writeln(('' + node.name.name + ':')); |
| 12017 node.body.visit(this); | 12031 node.body.visit(this); |
| 12018 return false; | 12032 return false; |
| 12019 } | 12033 } |
| 12020 MethodGenerator.prototype.visitExpressionStatement = function(node) { | 12034 MethodGenerator.prototype.visitExpressionStatement = function(node) { |
| 12021 if ((node.body instanceof VarExpression) || (node.body instanceof ThisExpressi
on)) { | 12035 if ((node.body instanceof VarExpression) || (node.body instanceof ThisExpressi
on)) { |
| 12022 world.warning('variable used as statement', node.span); | 12036 $globals.world.warning('variable used as statement', node.span); |
| 12023 } | 12037 } |
| 12024 var value = this.visitVoid(node.body); | 12038 var value = this.visitVoid(node.body); |
| 12025 this.writer.writeln(('' + value.get$code() + ';')); | 12039 this.writer.writeln(('' + value.get$code() + ';')); |
| 12026 return false; | 12040 return false; |
| 12027 } | 12041 } |
| 12028 MethodGenerator.prototype.visitEmptyStatement = function(node) { | 12042 MethodGenerator.prototype.visitEmptyStatement = function(node) { |
| 12029 this.writer.writeln(';'); | 12043 this.writer.writeln(';'); |
| 12030 return false; | 12044 return false; |
| 12031 } | 12045 } |
| 12032 MethodGenerator.prototype._checkNonStatic = function(node) { | 12046 MethodGenerator.prototype._checkNonStatic = function(node) { |
| 12033 if ($notnull_bool(this.get$isStatic())) { | 12047 if ($notnull_bool(this.get$isStatic())) { |
| 12034 world.warning('not allowed in static method', node.span); | 12048 $globals.world.warning('not allowed in static method', node.span); |
| 12035 } | 12049 } |
| 12036 } | 12050 } |
| 12037 MethodGenerator.prototype._makeSuperValue = function(node) { | 12051 MethodGenerator.prototype._makeSuperValue = function(node) { |
| 12038 var parentType = this.method.declaringType.get$parent(); | 12052 var parentType = this.method.declaringType.get$parent(); |
| 12039 this._checkNonStatic(node); | 12053 this._checkNonStatic(node); |
| 12040 if ($notnull_bool(parentType == null)) { | 12054 if ($notnull_bool(parentType == null)) { |
| 12041 world.error('no super class', node.span); | 12055 $globals.world.error('no super class', node.span); |
| 12042 } | 12056 } |
| 12043 var ret = new Value(parentType, 'this', node.span, false); | 12057 var ret = new Value(parentType, 'this', node.span, false); |
| 12044 ret.set$isSuper(true); | 12058 ret.set$isSuper(true); |
| 12045 return ret; | 12059 return ret; |
| 12046 } | 12060 } |
| 12047 MethodGenerator.prototype._getOutermostMethod = function() { | 12061 MethodGenerator.prototype._getOutermostMethod = function() { |
| 12048 var result = this; | 12062 var result = this; |
| 12049 while ($notnull_bool($ne(result.get$enclosingMethod(), null))) { | 12063 while ($notnull_bool($ne(result.get$enclosingMethod(), null))) { |
| 12050 result = result.get$enclosingMethod(); | 12064 result = result.get$enclosingMethod(); |
| 12051 } | 12065 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 12068 return new Value(outermostMethod.method.get$declaringType(), '\$this', node
!= null ? node.span : null, false); | 12082 return new Value(outermostMethod.method.get$declaringType(), '\$this', node
!= null ? node.span : null, false); |
| 12069 } | 12083 } |
| 12070 else { | 12084 else { |
| 12071 this._checkNonStatic(node); | 12085 this._checkNonStatic(node); |
| 12072 return new Value(this.method.declaringType, 'this', node != null ? node.span
: null, false); | 12086 return new Value(this.method.declaringType, 'this', node != null ? node.span
: null, false); |
| 12073 } | 12087 } |
| 12074 } | 12088 } |
| 12075 MethodGenerator.prototype.visitLambdaExpression = function(node) { | 12089 MethodGenerator.prototype.visitLambdaExpression = function(node) { |
| 12076 var name = ''; | 12090 var name = ''; |
| 12077 if (node.func.name != null) { | 12091 if (node.func.name != null) { |
| 12078 name = world.toJsIdentifier(node.func.name.name); | 12092 name = $globals.world.toJsIdentifier(node.func.name.name); |
| 12079 } | 12093 } |
| 12080 var meth = this._makeLambdaMethod($assert_String(name), node.func); | 12094 var meth = this._makeLambdaMethod($assert_String(name), node.func); |
| 12081 var w = new CodeWriter(); | 12095 var w = new CodeWriter(); |
| 12082 meth.get$generator().writeDefinition$2(w, node); | 12096 meth.get$generator().writeDefinition$2(w, node); |
| 12083 return new Value(meth.get$functionType(), w.get$text(), node.span, true); | 12097 return new Value(meth.get$functionType(), w.get$text(), node.span, true); |
| 12084 } | 12098 } |
| 12085 MethodGenerator.prototype.visitCallExpression = function(node) { | 12099 MethodGenerator.prototype.visitCallExpression = function(node) { |
| 12086 var $0; | 12100 var $0; |
| 12087 var target; | 12101 var target; |
| 12088 var position = node.target; | 12102 var position = node.target; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 12109 return target.invoke$4(this, name, position, this._makeArgs(node.arguments)); | 12123 return target.invoke$4(this, name, position, this._makeArgs(node.arguments)); |
| 12110 } | 12124 } |
| 12111 MethodGenerator.prototype.visitIndexExpression = function(node) { | 12125 MethodGenerator.prototype.visitIndexExpression = function(node) { |
| 12112 var target = this.visitValue(node.target); | 12126 var target = this.visitValue(node.target); |
| 12113 var index = this.visitValue(node.index); | 12127 var index = this.visitValue(node.index); |
| 12114 return target.invoke$4(this, '\$index', node, new Arguments(null, [index])); | 12128 return target.invoke$4(this, '\$index', node, new Arguments(null, [index])); |
| 12115 } | 12129 } |
| 12116 MethodGenerator.prototype.visitBinaryExpression = function(node) { | 12130 MethodGenerator.prototype.visitBinaryExpression = function(node) { |
| 12117 var kind = node.op.kind; | 12131 var kind = node.op.kind; |
| 12118 if (kind == 35/*TokenKind.AND*/ || kind == 34/*TokenKind.OR*/) { | 12132 if (kind == 35/*TokenKind.AND*/ || kind == 34/*TokenKind.OR*/) { |
| 12119 var x = this.visitTypedValue(node.x, world.nonNullBool); | 12133 var x = this.visitTypedValue(node.x, $globals.world.nonNullBool); |
| 12120 var y = this.visitTypedValue(node.y, world.nonNullBool); | 12134 var y = this.visitTypedValue(node.y, $globals.world.nonNullBool); |
| 12121 var code = ('' + x.get$code() + ' ' + node.op + ' ' + y.get$code()); | 12135 var code = ('' + x.get$code() + ' ' + node.op + ' ' + y.get$code()); |
| 12122 if ($notnull_bool(x.get$isConst()) && $notnull_bool(y.get$isConst())) { | 12136 if ($notnull_bool(x.get$isConst()) && $notnull_bool(y.get$isConst())) { |
| 12123 var value = (kind == 35/*TokenKind.AND*/) ? $notnull_bool(x.get$actualValu
e()) && $notnull_bool(y.get$actualValue()) : $notnull_bool(x.get$actualValue())
|| $notnull_bool(y.get$actualValue()); | 12137 var value = (kind == 35/*TokenKind.AND*/) ? $notnull_bool(x.get$actualValu
e()) && $notnull_bool(y.get$actualValue()) : $notnull_bool(x.get$actualValue())
|| $notnull_bool(y.get$actualValue()); |
| 12124 return EvaluatedValue.EvaluatedValue$factory(world.nonNullBool, value, (''
+ value), node.span); | 12138 return EvaluatedValue.EvaluatedValue$factory($globals.world.nonNullBool, v
alue, ('' + value), node.span); |
| 12125 } | 12139 } |
| 12126 return new Value(world.nonNullBool, code, node.span, true); | 12140 return new Value($globals.world.nonNullBool, code, node.span, true); |
| 12127 } | 12141 } |
| 12128 else if (kind == 50/*TokenKind.EQ_STRICT*/ || kind == 51/*TokenKind.NE_STRICT*
/) { | 12142 else if (kind == 50/*TokenKind.EQ_STRICT*/ || kind == 51/*TokenKind.NE_STRICT*
/) { |
| 12129 var x = this.visitValue(node.x); | 12143 var x = this.visitValue(node.x); |
| 12130 var y = this.visitValue(node.y); | 12144 var y = this.visitValue(node.y); |
| 12131 if ($notnull_bool(x.get$isConst()) && $notnull_bool(y.get$isConst())) { | 12145 if ($notnull_bool(x.get$isConst()) && $notnull_bool(y.get$isConst())) { |
| 12132 var value = kind == 50/*TokenKind.EQ_STRICT*/ ? $eq(x.get$actualValue(), y
.get$actualValue()) : $ne(x.get$actualValue(), y.get$actualValue()); | 12146 var value = kind == 50/*TokenKind.EQ_STRICT*/ ? $eq(x.get$actualValue(), y
.get$actualValue()) : $ne(x.get$actualValue(), y.get$actualValue()); |
| 12133 return EvaluatedValue.EvaluatedValue$factory(world.nonNullBool, value, (""
+ value), node.span); | 12147 return EvaluatedValue.EvaluatedValue$factory($globals.world.nonNullBool, v
alue, ("" + value), node.span); |
| 12134 } | 12148 } |
| 12135 if ($notnull_bool($eq(x.get$code(), 'null')) || $notnull_bool($eq(y.get$code
(), 'null'))) { | 12149 if ($notnull_bool($eq(x.get$code(), 'null')) || $notnull_bool($eq(y.get$code
(), 'null'))) { |
| 12136 var op = node.op.toString().substring(0, 2); | 12150 var op = node.op.toString().substring(0, 2); |
| 12137 return new Value(world.nonNullBool, ('' + x.get$code() + ' ' + op + ' ' +
y.get$code()), node.span, true); | 12151 return new Value($globals.world.nonNullBool, ('' + x.get$code() + ' ' + op
+ ' ' + y.get$code()), node.span, true); |
| 12138 } | 12152 } |
| 12139 else { | 12153 else { |
| 12140 return new Value(world.nonNullBool, ('' + x.get$code() + ' ' + node.op + '
' + y.get$code()), node.span, true); | 12154 return new Value($globals.world.nonNullBool, ('' + x.get$code() + ' ' + no
de.op + ' ' + y.get$code()), node.span, true); |
| 12141 } | 12155 } |
| 12142 } | 12156 } |
| 12143 var assignKind = TokenKind.kindFromAssign(node.op.kind); | 12157 var assignKind = TokenKind.kindFromAssign(node.op.kind); |
| 12144 if (assignKind == -1) { | 12158 if (assignKind == -1) { |
| 12145 var x = this.visitValue(node.x); | 12159 var x = this.visitValue(node.x); |
| 12146 var y = this.visitValue(node.y); | 12160 var y = this.visitValue(node.y); |
| 12147 var name = TokenKind.binaryMethodName(node.op.kind); | 12161 var name = TokenKind.binaryMethodName(node.op.kind); |
| 12148 if (node.op.kind == 49/*TokenKind.NE*/) { | 12162 if (node.op.kind == 49/*TokenKind.NE*/) { |
| 12149 name = '\$ne'; | 12163 name = '\$ne'; |
| 12150 } | 12164 } |
| 12151 if ($notnull_bool(name == null)) { | 12165 if ($notnull_bool(name == null)) { |
| 12152 world.internalError(('unimplemented binary op ' + node.op), node.span); | 12166 $globals.world.internalError(('unimplemented binary op ' + node.op), node.
span); |
| 12153 return; | 12167 return; |
| 12154 } | 12168 } |
| 12155 return x.invoke$4(this, name, node, new Arguments(null, [y])); | 12169 return x.invoke$4(this, name, node, new Arguments(null, [y])); |
| 12156 } | 12170 } |
| 12157 else { | 12171 else { |
| 12158 return this._visitAssign(assignKind, node.x, node.y, node, to$call$1(null)); | 12172 return this._visitAssign(assignKind, node.x, node.y, node, to$call$1(null)); |
| 12159 } | 12173 } |
| 12160 } | 12174 } |
| 12161 MethodGenerator.prototype._visitAssign = function(kind, xn, yn, position, captur
eOriginal) { | 12175 MethodGenerator.prototype._visitAssign = function(kind, xn, yn, position, captur
eOriginal) { |
| 12162 if (captureOriginal == null) { | 12176 if (captureOriginal == null) { |
| 12163 captureOriginal = (function (x) { | 12177 captureOriginal = (function (x) { |
| 12164 return x; | 12178 return x; |
| 12165 }) | 12179 }) |
| 12166 ; | 12180 ; |
| 12167 } | 12181 } |
| 12168 if ((xn instanceof VarExpression)) { | 12182 if ((xn instanceof VarExpression)) { |
| 12169 return this._visitVarAssign(kind, (xn && xn.is$VarExpression()), yn, positio
n, captureOriginal); | 12183 return this._visitVarAssign(kind, (xn && xn.is$VarExpression()), yn, positio
n, captureOriginal); |
| 12170 } | 12184 } |
| 12171 else if ((xn instanceof IndexExpression)) { | 12185 else if ((xn instanceof IndexExpression)) { |
| 12172 return this._visitIndexAssign(kind, (xn && xn.is$IndexExpression()), yn, pos
ition, captureOriginal); | 12186 return this._visitIndexAssign(kind, (xn && xn.is$IndexExpression()), yn, pos
ition, captureOriginal); |
| 12173 } | 12187 } |
| 12174 else if ((xn instanceof DotExpression)) { | 12188 else if ((xn instanceof DotExpression)) { |
| 12175 return this._visitDotAssign(kind, (xn && xn.is$DotExpression()), yn, positio
n, captureOriginal); | 12189 return this._visitDotAssign(kind, (xn && xn.is$DotExpression()), yn, positio
n, captureOriginal); |
| 12176 } | 12190 } |
| 12177 else { | 12191 else { |
| 12178 world.error('illegal lhs', position.span); | 12192 $globals.world.error('illegal lhs', position.span); |
| 12179 } | 12193 } |
| 12180 } | 12194 } |
| 12181 MethodGenerator.prototype._visitVarAssign = function(kind, xn, yn, position, cap
tureOriginal) { | 12195 MethodGenerator.prototype._visitVarAssign = function(kind, xn, yn, position, cap
tureOriginal) { |
| 12182 var name = xn.name.name; | 12196 var name = xn.name.name; |
| 12183 var x = this._scope.lookup(name); | 12197 var x = this._scope.lookup(name); |
| 12184 var y = this.visitValue(yn); | 12198 var y = this.visitValue(yn); |
| 12185 if ($notnull_bool(x == null)) { | 12199 if ($notnull_bool(x == null)) { |
| 12186 var members = this.method.declaringType.resolveMember(name); | 12200 var members = this.method.declaringType.resolveMember(name); |
| 12187 if ($notnull_bool($ne(members, null))) { | 12201 if ($notnull_bool($ne(members, null))) { |
| 12188 x = this._makeThisOrType(position.span); | 12202 x = this._makeThisOrType(position.span); |
| 12189 if (kind == 0) { | 12203 if (kind == 0) { |
| 12190 return x.set_$4(this, name, position, y); | 12204 return x.set_$4(this, name, position, y); |
| 12191 } | 12205 } |
| 12192 else if (!$notnull_bool(members.get$treatAsField()) || $notnull_bool(membe
rs.get$containsMethods())) { | 12206 else if (!$notnull_bool(members.get$treatAsField()) || $notnull_bool(membe
rs.get$containsMethods())) { |
| 12193 var right = x.get_$3(this, name, position); | 12207 var right = x.get_$3(this, name, position); |
| 12194 right = captureOriginal((right && right.is$Value())); | 12208 right = captureOriginal((right && right.is$Value())); |
| 12195 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new
Arguments(null, [y])); | 12209 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new
Arguments(null, [y])); |
| 12196 return x.set_$4(this, name, position, y); | 12210 return x.set_$4(this, name, position, y); |
| 12197 } | 12211 } |
| 12198 else { | 12212 else { |
| 12199 x = x.get_$3(this, name, position); | 12213 x = x.get_$3(this, name, position); |
| 12200 } | 12214 } |
| 12201 } | 12215 } |
| 12202 else { | 12216 else { |
| 12203 var member = this.get$library().lookup(name, xn.name.span); | 12217 var member = this.get$library().lookup(name, xn.name.span); |
| 12204 if (member == null) { | 12218 if (member == null) { |
| 12205 world.warning(('can not resolve ' + name), xn.span); | 12219 $globals.world.warning(('can not resolve ' + name), xn.span); |
| 12206 return this._makeMissingValue(name); | 12220 return this._makeMissingValue(name); |
| 12207 } | 12221 } |
| 12208 members = new MemberSet(member, false); | 12222 members = new MemberSet(member, false); |
| 12209 if (!$notnull_bool(members.get$treatAsField()) || $notnull_bool(members.ge
t$containsMethods())) { | 12223 if (!$notnull_bool(members.get$treatAsField()) || $notnull_bool(members.ge
t$containsMethods())) { |
| 12210 if (kind != 0) { | 12224 if (kind != 0) { |
| 12211 var right = members._get$3(this, position, x); | 12225 var right = members._get$3(this, position, x); |
| 12212 right = captureOriginal((right && right.is$Value())); | 12226 right = captureOriginal((right && right.is$Value())); |
| 12213 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, n
ew Arguments(null, [y])); | 12227 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, n
ew Arguments(null, [y])); |
| 12214 } | 12228 } |
| 12215 return members._set$4(this, position, x, y); | 12229 return members._set$4(this, position, x, y); |
| 12216 } | 12230 } |
| 12217 else { | 12231 else { |
| 12218 x = members._get$3(this, position, x); | 12232 x = members._get$3(this, position, x); |
| 12219 } | 12233 } |
| 12220 } | 12234 } |
| 12221 } | 12235 } |
| 12222 if ($notnull_bool(x.get$isFinal())) { | 12236 if ($notnull_bool(x.get$isFinal())) { |
| 12223 world.error(('final variable "' + x.get$code() + '" is not assignable'), pos
ition.span); | 12237 $globals.world.error(('final variable "' + x.get$code() + '" is not assignab
le'), position.span); |
| 12224 } | 12238 } |
| 12225 y = y.convertTo$3(this, x.get$type(), yn); | 12239 y = y.convertTo$3(this, x.get$type(), yn); |
| 12226 if (kind == 0) { | 12240 if (kind == 0) { |
| 12227 x = captureOriginal((x && x.is$Value())); | 12241 x = captureOriginal((x && x.is$Value())); |
| 12228 return new Value(y.get$type(), ('' + x.get$code() + ' = ' + y.get$code()), p
osition.span, true); | 12242 return new Value(y.get$type(), ('' + x.get$code() + ' = ' + y.get$code()), p
osition.span, true); |
| 12229 } | 12243 } |
| 12230 else if ($notnull_bool(x.get$type().get$isNum()) && $notnull_bool(y.get$type()
.get$isNum()) && (kind != 46/*TokenKind.TRUNCDIV*/)) { | 12244 else if ($notnull_bool(x.get$type().get$isNum()) && $notnull_bool(y.get$type()
.get$isNum()) && (kind != 46/*TokenKind.TRUNCDIV*/)) { |
| 12231 x = captureOriginal((x && x.is$Value())); | 12245 x = captureOriginal((x && x.is$Value())); |
| 12232 var op = TokenKind.kindToString(kind); | 12246 var op = TokenKind.kindToString(kind); |
| 12233 return new Value(y.get$type(), ('' + x.get$code() + ' ' + op + '= ' + y.get$
code()), position.span, true); | 12247 return new Value(y.get$type(), ('' + x.get$code() + ' ' + op + '= ' + y.get$
code()), position.span, true); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12277 var value = this.visitValue(node.self); | 12291 var value = this.visitValue(node.self); |
| 12278 switch (node.op.kind) { | 12292 switch (node.op.kind) { |
| 12279 case 16/*TokenKind.INCR*/: | 12293 case 16/*TokenKind.INCR*/: |
| 12280 case 17/*TokenKind.DECR*/: | 12294 case 17/*TokenKind.DECR*/: |
| 12281 | 12295 |
| 12282 if ($notnull_bool(value.get$type().get$isNum())) { | 12296 if ($notnull_bool(value.get$type().get$isNum())) { |
| 12283 return new Value(value.get$type(), ('' + node.op + value.get$code()), no
de.span, true); | 12297 return new Value(value.get$type(), ('' + node.op + value.get$code()), no
de.span, true); |
| 12284 } | 12298 } |
| 12285 else { | 12299 else { |
| 12286 var kind = (16/*TokenKind.INCR*/ == node.op.kind ? 42/*TokenKind.ADD*/ :
43/*TokenKind.SUB*/); | 12300 var kind = (16/*TokenKind.INCR*/ == node.op.kind ? 42/*TokenKind.ADD*/ :
43/*TokenKind.SUB*/); |
| 12287 var operand = new LiteralExpression(1, new TypeReference(node.span, worl
d.numType), '1', node.span); | 12301 var operand = new LiteralExpression(1, new TypeReference(node.span, $glo
bals.world.numType), '1', node.span); |
| 12288 return this._visitAssign($assert_num(kind), node.self, (operand && opera
nd.is$lang_Expression()), node, to$call$1(null)); | 12302 return this._visitAssign($assert_num(kind), node.self, (operand && opera
nd.is$lang_Expression()), node, to$call$1(null)); |
| 12289 } | 12303 } |
| 12290 | 12304 |
| 12291 case 19/*TokenKind.NOT*/: | 12305 case 19/*TokenKind.NOT*/: |
| 12292 | 12306 |
| 12293 if ($notnull_bool(value.get$type().get$isBool()) && $notnull_bool(value.ge
t$isConst())) { | 12307 if ($notnull_bool(value.get$type().get$isBool()) && $notnull_bool(value.ge
t$isConst())) { |
| 12294 var newVal = !$notnull_bool(value.get$actualValue()); | 12308 var newVal = !$notnull_bool(value.get$actualValue()); |
| 12295 return EvaluatedValue.EvaluatedValue$factory((($0 = value.get$type()) &&
$0.is$lang_Type()), newVal, ('' + newVal), node.span); | 12309 return EvaluatedValue.EvaluatedValue$factory((($0 = value.get$type()) &&
$0.is$lang_Type()), newVal, ('' + newVal), node.span); |
| 12296 } | 12310 } |
| 12297 else { | 12311 else { |
| 12298 var newVal = value.convertTo$3(this, world.nonNullBool, node); | 12312 var newVal = value.convertTo$3(this, $globals.world.nonNullBool, node); |
| 12299 return new Value(newVal.get$type(), ('!' + newVal.get$code()), node.span
, true); | 12313 return new Value(newVal.get$type(), ('!' + newVal.get$code()), node.span
, true); |
| 12300 } | 12314 } |
| 12301 | 12315 |
| 12302 case 42/*TokenKind.ADD*/: | 12316 case 42/*TokenKind.ADD*/: |
| 12303 | 12317 |
| 12304 return value.convertTo$3(this, world.numType, node); | 12318 return value.convertTo$3(this, $globals.world.numType, node); |
| 12305 | 12319 |
| 12306 case 43/*TokenKind.SUB*/: | 12320 case 43/*TokenKind.SUB*/: |
| 12307 case 18/*TokenKind.BIT_NOT*/: | 12321 case 18/*TokenKind.BIT_NOT*/: |
| 12308 | 12322 |
| 12309 if (node.op.kind == 18/*TokenKind.BIT_NOT*/) { | 12323 if (node.op.kind == 18/*TokenKind.BIT_NOT*/) { |
| 12310 return value.invoke$4(this, '\$bit_not', node, Arguments.get$EMPTY()); | 12324 return value.invoke$4(this, '\$bit_not', node, Arguments.get$EMPTY()); |
| 12311 } | 12325 } |
| 12312 else if (node.op.kind == 43/*TokenKind.SUB*/) { | 12326 else if (node.op.kind == 43/*TokenKind.SUB*/) { |
| 12313 return value.invoke$4(this, '\$negate', node, Arguments.get$EMPTY()); | 12327 return value.invoke$4(this, '\$negate', node, Arguments.get$EMPTY()); |
| 12314 } | 12328 } |
| 12315 else { | 12329 else { |
| 12316 world.internalError(('unimplemented: unary ' + node.op), node.span); | 12330 $globals.world.internalError(('unimplemented: unary ' + node.op), node.s
pan); |
| 12317 } | 12331 } |
| 12318 $throw(new FallThroughError()); | 12332 $throw(new FallThroughError()); |
| 12319 | 12333 |
| 12320 default: | 12334 default: |
| 12321 | 12335 |
| 12322 world.internalError(('unimplemented: ' + node.op), node.span); | 12336 $globals.world.internalError(('unimplemented: ' + node.op), node.span); |
| 12323 | 12337 |
| 12324 } | 12338 } |
| 12325 } | 12339 } |
| 12326 MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) { | 12340 MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) { |
| 12327 var $this = this; // closure support | 12341 var $this = this; // closure support |
| 12328 var value = this.visitValue(node.body); | 12342 var value = this.visitValue(node.body); |
| 12329 if ($notnull_bool(value.get$type().get$isNum())) { | 12343 if ($notnull_bool(value.get$type().get$isNum())) { |
| 12330 return new Value(value.get$type(), ('' + value.get$code() + node.op), node.s
pan, true); | 12344 return new Value(value.get$type(), ('' + value.get$code() + node.op), node.s
pan, true); |
| 12331 } | 12345 } |
| 12332 var kind = (16/*TokenKind.INCR*/ == node.op.kind) ? 42/*TokenKind.ADD*/ : 43/*
TokenKind.SUB*/; | 12346 var kind = (16/*TokenKind.INCR*/ == node.op.kind) ? 42/*TokenKind.ADD*/ : 43/*
TokenKind.SUB*/; |
| 12333 var operand = new LiteralExpression(1, new TypeReference(node.span, world.numT
ype), '1', node.span); | 12347 var operand = new LiteralExpression(1, new TypeReference(node.span, $globals.w
orld.numType), '1', node.span); |
| 12334 var tmpleft = null, left = null; | 12348 var tmpleft = null, left = null; |
| 12335 var ret = this._visitAssign($assert_num(kind), node.body, (operand && operand.
is$lang_Expression()), node, (function (l) { | 12349 var ret = this._visitAssign($assert_num(kind), node.body, (operand && operand.
is$lang_Expression()), node, (function (l) { |
| 12336 if ($notnull_bool(isVoid)) { | 12350 if ($notnull_bool(isVoid)) { |
| 12337 return l; | 12351 return l; |
| 12338 } | 12352 } |
| 12339 else { | 12353 else { |
| 12340 left = l; | 12354 left = l; |
| 12341 tmpleft = $this.forceTemp((l && l.is$Value())); | 12355 tmpleft = $this.forceTemp((l && l.is$Value())); |
| 12342 return $this.assignTemp((tmpleft && tmpleft.is$Value()), (left && left.is$
Value())); | 12356 return $this.assignTemp((tmpleft && tmpleft.is$Value()), (left && left.is$
Value())); |
| 12343 } | 12357 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 12368 if ($notnull_bool(type.get$isTop())) { | 12382 if ($notnull_bool(type.get$isTop())) { |
| 12369 type = type.get$library().findTypeByName$1(constructorName); | 12383 type = type.get$library().findTypeByName$1(constructorName); |
| 12370 constructorName = ''; | 12384 constructorName = ''; |
| 12371 } | 12385 } |
| 12372 var m = type.getConstructor$1(constructorName); | 12386 var m = type.getConstructor$1(constructorName); |
| 12373 if ($notnull_bool(m == null)) { | 12387 if ($notnull_bool(m == null)) { |
| 12374 var name = type.get$jsname(); | 12388 var name = type.get$jsname(); |
| 12375 if ($notnull_bool(type.get$isVar())) { | 12389 if ($notnull_bool(type.get$isVar())) { |
| 12376 name = typeRef.get$name().get$name(); | 12390 name = typeRef.get$name().get$name(); |
| 12377 } | 12391 } |
| 12378 world.error(('no matching constructor for ' + name), node.span); | 12392 $globals.world.error(('no matching constructor for ' + name), node.span); |
| 12379 return this._makeMissingValue($assert_String(name)); | 12393 return this._makeMissingValue($assert_String(name)); |
| 12380 } | 12394 } |
| 12381 if ($notnull_bool(node.isConst)) { | 12395 if ($notnull_bool(node.isConst)) { |
| 12382 if (!$notnull_bool(m.get$isConst())) { | 12396 if (!$notnull_bool(m.get$isConst())) { |
| 12383 world.error('can\'t use const on a non-const constructor', node.span); | 12397 $globals.world.error('can\'t use const on a non-const constructor', node.s
pan); |
| 12384 } | 12398 } |
| 12385 var $list = node.arguments; | 12399 var $list = node.arguments; |
| 12386 for (var $i = 0;$i < $list.length; $i++) { | 12400 for (var $i = 0;$i < $list.length; $i++) { |
| 12387 var arg = $list.$index($i); | 12401 var arg = $list.$index($i); |
| 12388 if (!$notnull_bool(this.visitValue((($0 = arg.get$value()) && $0.is$lang_E
xpression())).get$isConst())) { | 12402 if (!$notnull_bool(this.visitValue((($0 = arg.get$value()) && $0.is$lang_E
xpression())).get$isConst())) { |
| 12389 world.error('const constructor expects const arguments', (($0 = arg.get$
span()) && $0.is$SourceSpan())); | 12403 $globals.world.error('const constructor expects const arguments', (($0 =
arg.get$span()) && $0.is$SourceSpan())); |
| 12390 } | 12404 } |
| 12391 } | 12405 } |
| 12392 } | 12406 } |
| 12393 return m.invoke$4(this, node, null, this._makeArgs(node.arguments)); | 12407 return m.invoke$4(this, node, null, this._makeArgs(node.arguments)); |
| 12394 } | 12408 } |
| 12395 MethodGenerator.prototype.visitListExpression = function(node) { | 12409 MethodGenerator.prototype.visitListExpression = function(node) { |
| 12396 var $0; | 12410 var $0; |
| 12397 var argsCode = []; | 12411 var argsCode = []; |
| 12398 var argValues = []; | 12412 var argValues = []; |
| 12399 var $list = node.values; | 12413 var $list = node.values; |
| 12400 for (var $i = 0;$i < $list.length; $i++) { | 12414 for (var $i = 0;$i < $list.length; $i++) { |
| 12401 var item = $list.$index($i); | 12415 var item = $list.$index($i); |
| 12402 var arg = this.visitValue((item && item.is$lang_Expression())); | 12416 var arg = this.visitValue((item && item.is$lang_Expression())); |
| 12403 argValues.add$1(arg); | 12417 argValues.add$1(arg); |
| 12404 if ($notnull_bool(node.isConst)) { | 12418 if ($notnull_bool(node.isConst)) { |
| 12405 if (!$notnull_bool(arg.get$isConst())) { | 12419 if (!$notnull_bool(arg.get$isConst())) { |
| 12406 world.error('const list can only contain const values', (($0 = item.get$
span()) && $0.is$SourceSpan())); | 12420 $globals.world.error('const list can only contain const values', (($0 =
item.get$span()) && $0.is$SourceSpan())); |
| 12407 argsCode.add$1(arg.get$code()); | 12421 argsCode.add$1(arg.get$code()); |
| 12408 } | 12422 } |
| 12409 else { | 12423 else { |
| 12410 argsCode.add$1(arg.get$canonicalCode()); | 12424 argsCode.add$1(arg.get$canonicalCode()); |
| 12411 } | 12425 } |
| 12412 } | 12426 } |
| 12413 else { | 12427 else { |
| 12414 argsCode.add$1(arg.get$code()); | 12428 argsCode.add$1(arg.get$code()); |
| 12415 } | 12429 } |
| 12416 } | 12430 } |
| 12417 world.get$coreimpl().types.$index('ListFactory').markUsed$0(); | 12431 $globals.world.get$coreimpl().types.$index('ListFactory').markUsed$0(); |
| 12418 var code = ('[' + Strings.join((argsCode && argsCode.is$List$String()), ", ")
+ ']'); | 12432 var code = ('[' + Strings.join((argsCode && argsCode.is$List$String()), ", ")
+ ']'); |
| 12419 var value = new Value(world.listType, code, node.span, true); | 12433 var value = new Value($globals.world.listType, code, node.span, true); |
| 12420 if ($notnull_bool(node.isConst)) { | 12434 if ($notnull_bool(node.isConst)) { |
| 12421 var immutableList = world.get$coreimpl().types.$index('ImmutableList'); | 12435 var immutableList = $globals.world.get$coreimpl().types.$index('ImmutableLis
t'); |
| 12422 var immutableListCtor = immutableList.getConstructor$1('from'); | 12436 var immutableListCtor = immutableList.getConstructor$1('from'); |
| 12423 var result = immutableListCtor.invoke$4(this, node, null, new Arguments(null
, [value])); | 12437 var result = immutableListCtor.invoke$4(this, node, null, new Arguments(null
, [value])); |
| 12424 value = world.gen.globalForConst(ConstListValue.ConstListValue$factory((immu
tableList && immutableList.is$lang_Type()), (argValues && argValues.is$List$Eval
uatedValue()), ('const ' + code), $assert_String(result.get$code()), node.span),
(argValues && argValues.is$List$Value())); | 12438 value = $globals.world.gen.globalForConst(ConstListValue.ConstListValue$fact
ory((immutableList && immutableList.is$lang_Type()), (argValues && argValues.is$
List$EvaluatedValue()), ('const ' + code), $assert_String(result.get$code()), no
de.span), (argValues && argValues.is$List$Value())); |
| 12425 } | 12439 } |
| 12426 return value; | 12440 return value; |
| 12427 } | 12441 } |
| 12428 MethodGenerator.prototype.visitMapExpression = function(node) { | 12442 MethodGenerator.prototype.visitMapExpression = function(node) { |
| 12429 var $0; | 12443 var $0; |
| 12430 var mapImplType = world.gen.useMapFactory(); | 12444 var mapImplType = $globals.world.gen.useMapFactory(); |
| 12431 var argValues = []; | 12445 var argValues = []; |
| 12432 var argsCode = []; | 12446 var argsCode = []; |
| 12433 for (var i = 0; | 12447 for (var i = 0; |
| 12434 i < node.items.length; i += 2) { | 12448 i < node.items.length; i += 2) { |
| 12435 var key = this.visitTypedValue((($0 = node.items.$index(i)) && $0.is$lang_Ex
pression()), world.stringType); | 12449 var key = this.visitTypedValue((($0 = node.items.$index(i)) && $0.is$lang_Ex
pression()), $globals.world.stringType); |
| 12436 var valueItem = node.items.$index(i + 1); | 12450 var valueItem = node.items.$index(i + 1); |
| 12437 var value = this.visitValue((valueItem && valueItem.is$lang_Expression())); | 12451 var value = this.visitValue((valueItem && valueItem.is$lang_Expression())); |
| 12438 argValues.add$1(key); | 12452 argValues.add$1(key); |
| 12439 argValues.add$1(value); | 12453 argValues.add$1(value); |
| 12440 if ($notnull_bool(node.isConst)) { | 12454 if ($notnull_bool(node.isConst)) { |
| 12441 if (!$notnull_bool(key.get$isConst()) || !$notnull_bool(value.get$isConst(
))) { | 12455 if (!$notnull_bool(key.get$isConst()) || !$notnull_bool(value.get$isConst(
))) { |
| 12442 world.error('const map can only contain const values', (($0 = valueItem.
get$span()) && $0.is$SourceSpan())); | 12456 $globals.world.error('const map can only contain const values', (($0 = v
alueItem.get$span()) && $0.is$SourceSpan())); |
| 12443 argsCode.add$1(key.get$code()); | 12457 argsCode.add$1(key.get$code()); |
| 12444 argsCode.add$1(value.get$code()); | 12458 argsCode.add$1(value.get$code()); |
| 12445 } | 12459 } |
| 12446 else { | 12460 else { |
| 12447 argsCode.add$1(key.get$canonicalCode()); | 12461 argsCode.add$1(key.get$canonicalCode()); |
| 12448 argsCode.add$1(value.get$canonicalCode()); | 12462 argsCode.add$1(value.get$canonicalCode()); |
| 12449 } | 12463 } |
| 12450 } | 12464 } |
| 12451 else { | 12465 else { |
| 12452 argsCode.add$1(key.get$code()); | 12466 argsCode.add$1(key.get$code()); |
| 12453 argsCode.add$1(value.get$code()); | 12467 argsCode.add$1(value.get$code()); |
| 12454 } | 12468 } |
| 12455 } | 12469 } |
| 12456 var argList = ('[' + Strings.join((argsCode && argsCode.is$List$String()), ",
") + ']'); | 12470 var argList = ('[' + Strings.join((argsCode && argsCode.is$List$String()), ",
") + ']'); |
| 12457 var code = ('\$map(' + argList + ')'); | 12471 var code = ('\$map(' + argList + ')'); |
| 12458 if ($notnull_bool(node.isConst)) { | 12472 if ($notnull_bool(node.isConst)) { |
| 12459 var immutableMap = world.get$coreimpl().types.$index('ImmutableMap'); | 12473 var immutableMap = $globals.world.get$coreimpl().types.$index('ImmutableMap'
); |
| 12460 var immutableMapCtor = immutableMap.getConstructor$1(''); | 12474 var immutableMapCtor = immutableMap.getConstructor$1(''); |
| 12461 var argsValue = new Value(world.listType, argList, node.span, true); | 12475 var argsValue = new Value($globals.world.listType, argList, node.span, true)
; |
| 12462 var result = immutableMapCtor.invoke$4(this, node, null, new Arguments(null,
[argsValue])); | 12476 var result = immutableMapCtor.invoke$4(this, node, null, new Arguments(null,
[argsValue])); |
| 12463 var value = ConstMapValue.ConstMapValue$factory((immutableMap && immutableMa
p.is$lang_Type()), (argValues && argValues.is$List$EvaluatedValue()), code, $ass
ert_String(result.get$code()), node.span); | 12477 var value = ConstMapValue.ConstMapValue$factory((immutableMap && immutableMa
p.is$lang_Type()), (argValues && argValues.is$List$EvaluatedValue()), code, $ass
ert_String(result.get$code()), node.span); |
| 12464 return world.gen.globalForConst(value, (argValues && argValues.is$List$Value
())); | 12478 return $globals.world.gen.globalForConst(value, (argValues && argValues.is$L
ist$Value())); |
| 12465 } | 12479 } |
| 12466 return new Value(mapImplType, code, node.span, true); | 12480 return new Value(mapImplType, code, node.span, true); |
| 12467 } | 12481 } |
| 12468 MethodGenerator.prototype.visitConditionalExpression = function(node) { | 12482 MethodGenerator.prototype.visitConditionalExpression = function(node) { |
| 12469 var $0; | 12483 var $0; |
| 12470 var test = this.visitBool(node.test); | 12484 var test = this.visitBool(node.test); |
| 12471 var trueBranch = this.visitValue(node.trueBranch); | 12485 var trueBranch = this.visitValue(node.trueBranch); |
| 12472 var falseBranch = this.visitValue(node.falseBranch); | 12486 var falseBranch = this.visitValue(node.falseBranch); |
| 12473 var code = ('' + test.get$code() + ' ? ' + trueBranch.get$code() + ' : ' + fal
seBranch.get$code()); | 12487 var code = ('' + test.get$code() + ' ? ' + trueBranch.get$code() + ' : ' + fal
seBranch.get$code()); |
| 12474 return new Value(lang_Type.union((($0 = trueBranch.get$type()) && $0.is$lang_T
ype()), (($0 = falseBranch.get$type()) && $0.is$lang_Type())), code, node.span,
true); | 12488 return new Value(lang_Type.union((($0 = trueBranch.get$type()) && $0.is$lang_T
ype()), (($0 = falseBranch.get$type()) && $0.is$lang_Type())), code, node.span,
true); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 12490 var target = node.self.visit(this); | 12504 var target = node.self.visit(this); |
| 12491 return target.get_$3(this, node.name.name, node.name); | 12505 return target.get_$3(this, node.name.name, node.name); |
| 12492 } | 12506 } |
| 12493 MethodGenerator.prototype.visitVarExpression = function(node) { | 12507 MethodGenerator.prototype.visitVarExpression = function(node) { |
| 12494 var name = node.name.name; | 12508 var name = node.name.name; |
| 12495 var ret = this._scope.lookup(name); | 12509 var ret = this._scope.lookup(name); |
| 12496 if ($notnull_bool($ne(ret, null))) return ret; | 12510 if ($notnull_bool($ne(ret, null))) return ret; |
| 12497 return this._makeThisOrType(node.span).get_$3(this, name, node); | 12511 return this._makeThisOrType(node.span).get_$3(this, name, node); |
| 12498 } | 12512 } |
| 12499 MethodGenerator.prototype._makeMissingValue = function(name) { | 12513 MethodGenerator.prototype._makeMissingValue = function(name) { |
| 12500 return new Value(world.varType, ('' + name + '()/*NotFound*/'), null, true); | 12514 return new Value($globals.world.varType, ('' + name + '()/*NotFound*/'), null,
true); |
| 12501 } | 12515 } |
| 12502 MethodGenerator.prototype._makeThisOrType = function(span) { | 12516 MethodGenerator.prototype._makeThisOrType = function(span) { |
| 12503 var $0; | 12517 var $0; |
| 12504 return new BareValue(this, (($0 = this._getOutermostMethod()) && $0.is$MethodG
enerator()), span); | 12518 return new BareValue(this, (($0 = this._getOutermostMethod()) && $0.is$MethodG
enerator()), span); |
| 12505 } | 12519 } |
| 12506 MethodGenerator.prototype.visitThisExpression = function(node) { | 12520 MethodGenerator.prototype.visitThisExpression = function(node) { |
| 12507 return this._makeThisValue(node); | 12521 return this._makeThisValue(node); |
| 12508 } | 12522 } |
| 12509 MethodGenerator.prototype.visitSuperExpression = function(node) { | 12523 MethodGenerator.prototype.visitSuperExpression = function(node) { |
| 12510 return this._makeSuperValue(node); | 12524 return this._makeSuperValue(node); |
| 12511 } | 12525 } |
| 12512 MethodGenerator.prototype.visitNullExpression = function(node) { | 12526 MethodGenerator.prototype.visitNullExpression = function(node) { |
| 12513 return EvaluatedValue.EvaluatedValue$factory(world.varType, null, 'null', null
); | 12527 return EvaluatedValue.EvaluatedValue$factory($globals.world.varType, null, 'nu
ll', null); |
| 12514 } | 12528 } |
| 12515 MethodGenerator.prototype._isUnaryIncrement = function(item) { | 12529 MethodGenerator.prototype._isUnaryIncrement = function(item) { |
| 12516 if ((item instanceof UnaryExpression)) { | 12530 if ((item instanceof UnaryExpression)) { |
| 12517 var u = (item && item.is$UnaryExpression()); | 12531 var u = (item && item.is$UnaryExpression()); |
| 12518 return u.op.kind == 16/*TokenKind.INCR*/ || u.op.kind == 17/*TokenKind.DECR*
/; | 12532 return u.op.kind == 16/*TokenKind.INCR*/ || u.op.kind == 17/*TokenKind.DECR*
/; |
| 12519 } | 12533 } |
| 12520 else { | 12534 else { |
| 12521 return false; | 12535 return false; |
| 12522 } | 12536 } |
| 12523 } | 12537 } |
| 12524 MethodGenerator.prototype.visitLiteralExpression = function(node) { | 12538 MethodGenerator.prototype.visitLiteralExpression = function(node) { |
| 12525 var $0; | 12539 var $0; |
| 12526 var type = node.type.type; | 12540 var type = node.type.type; |
| 12527 $assert($ne(type, null), "type != null", "gen.dart", 2128, 12); | 12541 $assert($ne(type, null), "type != null", "gen.dart", 2158, 12); |
| 12528 if (!!(($0 = node.value) && $0.is$List)) { | 12542 if (!!(($0 = node.value) && $0.is$List)) { |
| 12529 var items = []; | 12543 var items = []; |
| 12530 var $list = node.value; | 12544 var $list = node.value; |
| 12531 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) { | 12545 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) { |
| 12532 var item = $i.next$0(); | 12546 var item = $i.next$0(); |
| 12533 var val = this.visitValue((item && item.is$lang_Expression())); | 12547 var val = this.visitValue((item && item.is$lang_Expression())); |
| 12534 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY()); | 12548 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY()); |
| 12535 var code = val.get$code(); | 12549 var code = val.get$code(); |
| 12536 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr
ession) || (item instanceof PostfixExpression) || $notnull_bool(this._isUnaryInc
rement((item && item.is$lang_Expression())))) { | 12550 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr
ession) || (item instanceof PostfixExpression) || $notnull_bool(this._isUnaryInc
rement((item && item.is$lang_Expression())))) { |
| 12537 code = ('(' + code + ')'); | 12551 code = ('(' + code + ')'); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12571 function Arguments(nodes, values) { | 12585 function Arguments(nodes, values) { |
| 12572 this.nodes = nodes; | 12586 this.nodes = nodes; |
| 12573 this.values = values; | 12587 this.values = values; |
| 12574 // Initializers done | 12588 // Initializers done |
| 12575 } | 12589 } |
| 12576 Arguments.prototype.is$Arguments = function(){return this;}; | 12590 Arguments.prototype.is$Arguments = function(){return this;}; |
| 12577 Arguments.Arguments$bare$factory = function(arity) { | 12591 Arguments.Arguments$bare$factory = function(arity) { |
| 12578 var values = []; | 12592 var values = []; |
| 12579 for (var i = 0; | 12593 for (var i = 0; |
| 12580 i < arity; i++) { | 12594 i < arity; i++) { |
| 12581 values.add$1(new Value(world.varType, ('\$' + i), null, false)); | 12595 values.add$1(new Value($globals.world.varType, ('\$' + i), null, false)); |
| 12582 } | 12596 } |
| 12583 return new Arguments(null, values); | 12597 return new Arguments(null, values); |
| 12584 } | 12598 } |
| 12585 Arguments.get$EMPTY = function() { | 12599 Arguments.get$EMPTY = function() { |
| 12586 if (Arguments._empty == null) { | 12600 if ($globals.Arguments__empty == null) { |
| 12587 Arguments._empty = new Arguments(null, []); | 12601 $globals.Arguments__empty = new Arguments(null, []); |
| 12588 } | 12602 } |
| 12589 return Arguments._empty; | 12603 return $globals.Arguments__empty; |
| 12590 } | 12604 } |
| 12591 Arguments.prototype.get$values = function() { return this.values; }; | 12605 Arguments.prototype.get$values = function() { return this.values; }; |
| 12592 Arguments.prototype.set$values = function(value) { return this.values = value; }
; | 12606 Arguments.prototype.set$values = function(value) { return this.values = value; }
; |
| 12593 Arguments.prototype.get$nameCount = function() { | 12607 Arguments.prototype.get$nameCount = function() { |
| 12594 return this.get$length() - this.get$bareCount(); | 12608 return this.get$length() - this.get$bareCount(); |
| 12595 } | 12609 } |
| 12596 Arguments.prototype.get$hasNames = function() { | 12610 Arguments.prototype.get$hasNames = function() { |
| 12597 return this.get$bareCount() < this.get$length(); | 12611 return this.get$bareCount() < this.get$length(); |
| 12598 } | 12612 } |
| 12599 Arguments.prototype.get$length = function() { | 12613 Arguments.prototype.get$length = function() { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12653 for (var i = this.get$bareCount(); | 12667 for (var i = this.get$bareCount(); |
| 12654 i < this.get$length(); i++) { | 12668 i < this.get$length(); i++) { |
| 12655 names.add$1(this.getName(i)); | 12669 names.add$1(this.getName(i)); |
| 12656 } | 12670 } |
| 12657 return (names && names.is$List$String()); | 12671 return (names && names.is$List$String()); |
| 12658 } | 12672 } |
| 12659 Arguments.prototype.toCallStubArgs = function() { | 12673 Arguments.prototype.toCallStubArgs = function() { |
| 12660 var result = []; | 12674 var result = []; |
| 12661 for (var i = 0; | 12675 for (var i = 0; |
| 12662 i < this.get$bareCount(); i++) { | 12676 i < this.get$bareCount(); i++) { |
| 12663 result.add$1(new Value(world.varType, ('\$' + i), null, false)); | 12677 result.add$1(new Value($globals.world.varType, ('\$' + i), null, false)); |
| 12664 } | 12678 } |
| 12665 for (var i = this.get$bareCount(); | 12679 for (var i = this.get$bareCount(); |
| 12666 i < this.get$length(); i++) { | 12680 i < this.get$length(); i++) { |
| 12667 var name = this.getName(i); | 12681 var name = this.getName(i); |
| 12668 if ($notnull_bool(name == null)) name = ('\$' + i); | 12682 if ($notnull_bool(name == null)) name = ('\$' + i); |
| 12669 result.add$1(new Value(world.varType, name, null, false)); | 12683 result.add$1(new Value($globals.world.varType, name, null, false)); |
| 12670 } | 12684 } |
| 12671 return new Arguments(this.nodes, result); | 12685 return new Arguments(this.nodes, result); |
| 12672 } | 12686 } |
| 12673 // ********** Code for LibraryImport ************** | 12687 // ********** Code for LibraryImport ************** |
| 12674 function LibraryImport(library, prefix) { | 12688 function LibraryImport(library, prefix) { |
| 12675 this.library = library; | 12689 this.library = library; |
| 12676 this.prefix = prefix; | 12690 this.prefix = prefix; |
| 12677 // Initializers done | 12691 // Initializers done |
| 12678 } | 12692 } |
| 12679 LibraryImport.prototype.get$prefix = function() { return this.prefix; }; | 12693 LibraryImport.prototype.get$prefix = function() { return this.prefix; }; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 12695 } | 12709 } |
| 12696 Library.prototype.is$Library = function(){return this;}; | 12710 Library.prototype.is$Library = function(){return this;}; |
| 12697 Library.prototype.get$baseSource = function() { return this.baseSource; }; | 12711 Library.prototype.get$baseSource = function() { return this.baseSource; }; |
| 12698 Library.prototype.get$types = function() { return this.types; }; | 12712 Library.prototype.get$types = function() { return this.types; }; |
| 12699 Library.prototype.set$types = function(value) { return this.types = value; }; | 12713 Library.prototype.set$types = function(value) { return this.types = value; }; |
| 12700 Library.prototype.get$name = function() { return this.name; }; | 12714 Library.prototype.get$name = function() { return this.name; }; |
| 12701 Library.prototype.set$name = function(value) { return this.name = value; }; | 12715 Library.prototype.set$name = function(value) { return this.name = value; }; |
| 12702 Library.prototype.get$topType = function() { return this.topType; }; | 12716 Library.prototype.get$topType = function() { return this.topType; }; |
| 12703 Library.prototype.set$topType = function(value) { return this.topType = value; }
; | 12717 Library.prototype.set$topType = function(value) { return this.topType = value; }
; |
| 12704 Library.prototype.get$isCore = function() { | 12718 Library.prototype.get$isCore = function() { |
| 12705 return $eq(this, world.corelib); | 12719 return $eq(this, $globals.world.corelib); |
| 12706 } | 12720 } |
| 12707 Library.prototype.get$isCoreImpl = function() { | 12721 Library.prototype.get$isCoreImpl = function() { |
| 12708 return $eq(this, world.get$coreimpl()); | 12722 return $eq(this, $globals.world.get$coreimpl()); |
| 12709 } | 12723 } |
| 12710 Library.prototype.get$jsname = function() { | 12724 Library.prototype.get$jsname = function() { |
| 12711 if (this._jsname == null) { | 12725 if (this._jsname == null) { |
| 12712 this._jsname = this.name.replaceAll('.', '_').replaceAll(':', '_').replaceAl
l(' ', '_'); | 12726 this._jsname = this.name.replaceAll('.', '_').replaceAll(':', '_').replaceAl
l(' ', '_'); |
| 12713 } | 12727 } |
| 12714 return this._jsname; | 12728 return this._jsname; |
| 12715 } | 12729 } |
| 12716 Library.prototype.get$span = function() { | 12730 Library.prototype.get$span = function() { |
| 12717 return new SourceSpan(this.baseSource, 0, 0); | 12731 return new SourceSpan(this.baseSource, 0, 0); |
| 12718 } | 12732 } |
| 12719 Library.prototype.makeFullPath = function(filename) { | 12733 Library.prototype.makeFullPath = function(filename) { |
| 12720 if (filename.startsWith('dart:')) return filename; | 12734 if (filename.startsWith('dart:')) return filename; |
| 12721 if (filename.startsWith('/')) return filename; | 12735 if (filename.startsWith('/')) return filename; |
| 12722 if (filename.startsWith('file:///')) return filename; | 12736 if (filename.startsWith('file:///')) return filename; |
| 12723 if (filename.startsWith('http://')) return filename; | 12737 if (filename.startsWith('http://')) return filename; |
| 12724 return joinPaths(this.sourceDir, filename); | 12738 return joinPaths(this.sourceDir, filename); |
| 12725 } | 12739 } |
| 12726 Library.prototype.addImport = function(fullname, prefix) { | 12740 Library.prototype.addImport = function(fullname, prefix) { |
| 12727 var newLib = world.getOrAddLibrary(fullname); | 12741 var newLib = $globals.world.getOrAddLibrary(fullname); |
| 12728 this.imports.add(new LibraryImport(newLib, prefix)); | 12742 this.imports.add(new LibraryImport(newLib, prefix)); |
| 12729 return newLib; | 12743 return newLib; |
| 12730 } | 12744 } |
| 12731 Library.prototype.addNative = function(fullname) { | 12745 Library.prototype.addNative = function(fullname) { |
| 12732 this.natives.add(world.reader.readFile(fullname)); | 12746 this.natives.add($globals.world.reader.readFile(fullname)); |
| 12733 } | 12747 } |
| 12734 Library.prototype._findMembers = function(name) { | 12748 Library.prototype._findMembers = function(name) { |
| 12735 var $0; | 12749 var $0; |
| 12736 if (name.startsWith('_')) { | 12750 if (name.startsWith('_')) { |
| 12737 return (($0 = this._privateMembers.$index(name)) && $0.is$MemberSet()); | 12751 return (($0 = this._privateMembers.$index(name)) && $0.is$MemberSet()); |
| 12738 } | 12752 } |
| 12739 else { | 12753 else { |
| 12740 return (($0 = world._members.$index(name)) && $0.is$MemberSet()); | 12754 return (($0 = $globals.world._members.$index(name)) && $0.is$MemberSet()); |
| 12741 } | 12755 } |
| 12742 } | 12756 } |
| 12743 Library.prototype._addMember = function(member) { | 12757 Library.prototype._addMember = function(member) { |
| 12744 if ($notnull_bool(member.get$isPrivate())) { | 12758 if ($notnull_bool(member.get$isPrivate())) { |
| 12745 if ($notnull_bool(member.get$isStatic())) { | 12759 if ($notnull_bool(member.get$isStatic())) { |
| 12746 if ($notnull_bool(member.declaringType.get$isTop())) { | 12760 if ($notnull_bool(member.declaringType.get$isTop())) { |
| 12747 world._addTopName(member); | 12761 $globals.world._addTopName(member); |
| 12748 } | 12762 } |
| 12749 return; | 12763 return; |
| 12750 } | 12764 } |
| 12751 var mset = this._privateMembers.$index(member.name); | 12765 var mset = this._privateMembers.$index(member.name); |
| 12752 if ($notnull_bool(mset == null)) { | 12766 if ($notnull_bool(mset == null)) { |
| 12753 var $list = world.libraries.getValues(); | 12767 var $list = $globals.world.libraries.getValues(); |
| 12754 for (var $i = world.libraries.getValues().iterator$0(); $i.hasNext$0(); )
{ | 12768 for (var $i = $globals.world.libraries.getValues().iterator$0(); $i.hasNex
t$0(); ) { |
| 12755 var lib = $i.next$0(); | 12769 var lib = $i.next$0(); |
| 12756 if (lib._privateMembers.containsKey(member.name)) { | 12770 if (lib._privateMembers.containsKey(member.name)) { |
| 12757 member.set$jsname(('_' + this.get$jsname() + member.name)); | 12771 member.set$jsname(('_' + this.get$jsname() + member.name)); |
| 12758 break; | 12772 break; |
| 12759 } | 12773 } |
| 12760 } | 12774 } |
| 12761 mset = new MemberSet(member, false); | 12775 mset = new MemberSet(member, false); |
| 12762 this._privateMembers.$setindex(member.name, mset); | 12776 this._privateMembers.$setindex(member.name, mset); |
| 12763 } | 12777 } |
| 12764 else { | 12778 else { |
| 12765 mset.get$members().add$1(member); | 12779 mset.get$members().add$1(member); |
| 12766 } | 12780 } |
| 12767 } | 12781 } |
| 12768 else { | 12782 else { |
| 12769 world._addMember(member); | 12783 $globals.world._addMember(member); |
| 12770 } | 12784 } |
| 12771 } | 12785 } |
| 12772 Library.prototype.getOrAddFunctionType = function(name, func, inType) { | 12786 Library.prototype.getOrAddFunctionType = function(name, func, inType) { |
| 12773 var def = new FunctionTypeDefinition(func, null, func.span); | 12787 var def = new FunctionTypeDefinition(func, null, func.span); |
| 12774 var type = new DefinedType(name, this, def, false); | 12788 var type = new DefinedType(name, this, def, false); |
| 12775 type.addMethod('\$call', func); | 12789 type.addMethod('\$call', func); |
| 12776 type.members.$index('\$call').resolve$1(inType); | 12790 type.members.$index('\$call').resolve$1(inType); |
| 12777 type.interfaces = [world.functionType]; | 12791 type.interfaces = [$globals.world.functionType]; |
| 12778 return type; | 12792 return type; |
| 12779 } | 12793 } |
| 12780 Library.prototype.addType = function(name, definition, isClass) { | 12794 Library.prototype.addType = function(name, definition, isClass) { |
| 12781 var $0; | 12795 var $0; |
| 12782 if (this.types.containsKey(name)) { | 12796 if (this.types.containsKey(name)) { |
| 12783 var existingType = this.types.$index(name); | 12797 var existingType = this.types.$index(name); |
| 12784 if ($notnull_bool(this.get$isCore()) && $notnull_bool(existingType.get$defin
ition() == null)) { | 12798 if ($notnull_bool(this.get$isCore()) && $notnull_bool(existingType.get$defin
ition() == null)) { |
| 12785 existingType.setDefinition$1(definition); | 12799 existingType.setDefinition$1(definition); |
| 12786 } | 12800 } |
| 12787 else { | 12801 else { |
| 12788 world.warning(('duplicate definition of ' + name), definition.span); | 12802 $globals.world.warning(('duplicate definition of ' + name), definition.spa
n); |
| 12789 } | 12803 } |
| 12790 } | 12804 } |
| 12791 else { | 12805 else { |
| 12792 this.types.$setindex(name, new DefinedType(name, this, (definition && defini
tion.is$Definition()), isClass)); | 12806 this.types.$setindex(name, new DefinedType(name, this, (definition && defini
tion.is$Definition()), isClass)); |
| 12793 } | 12807 } |
| 12794 return (($0 = this.types.$index(name)) && $0.is$DefinedType()); | 12808 return (($0 = this.types.$index(name)) && $0.is$DefinedType()); |
| 12795 } | 12809 } |
| 12796 Library.prototype.findType = function(type) { | 12810 Library.prototype.findType = function(type) { |
| 12797 var result = this.findTypeByName(type.name.name); | 12811 var result = this.findTypeByName(type.name.name); |
| 12798 if (result == null) return null; | 12812 if (result == null) return null; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 12815 var imported = $list.$index($i); | 12829 var imported = $list.$index($i); |
| 12816 var newRet = null; | 12830 var newRet = null; |
| 12817 if ($notnull_bool(imported.get$prefix() == null)) { | 12831 if ($notnull_bool(imported.get$prefix() == null)) { |
| 12818 newRet = imported.get$library().get$types().$index(name); | 12832 newRet = imported.get$library().get$types().$index(name); |
| 12819 } | 12833 } |
| 12820 else if ($notnull_bool($eq(imported.get$prefix(), name))) { | 12834 else if ($notnull_bool($eq(imported.get$prefix(), name))) { |
| 12821 newRet = imported.get$library().get$topType(); | 12835 newRet = imported.get$library().get$topType(); |
| 12822 } | 12836 } |
| 12823 if ($notnull_bool($ne(newRet, null))) { | 12837 if ($notnull_bool($ne(newRet, null))) { |
| 12824 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { | 12838 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { |
| 12825 world.error(('conflicting types for "' + name + '"'), (($0 = ret.get$spa
n()) && $0.is$SourceSpan()), (($0 = newRet.get$span()) && $0.is$SourceSpan())); | 12839 $globals.world.error(('conflicting types for "' + name + '"'), (($0 = re
t.get$span()) && $0.is$SourceSpan()), (($0 = newRet.get$span()) && $0.is$SourceS
pan())); |
| 12826 } | 12840 } |
| 12827 else { | 12841 else { |
| 12828 ret = newRet; | 12842 ret = newRet; |
| 12829 } | 12843 } |
| 12830 } | 12844 } |
| 12831 } | 12845 } |
| 12832 return (ret && ret.is$lang_Type()); | 12846 return (ret && ret.is$lang_Type()); |
| 12833 } | 12847 } |
| 12834 Library.prototype.lookup = function(name, span) { | 12848 Library.prototype.lookup = function(name, span) { |
| 12835 var $0; | 12849 var $0; |
| 12836 var retType = this.findTypeByName(name); | 12850 var retType = this.findTypeByName(name); |
| 12837 var ret = null; | 12851 var ret = null; |
| 12838 if ($notnull_bool($ne(retType, null))) { | 12852 if ($notnull_bool($ne(retType, null))) { |
| 12839 ret = retType.get$typeMember(); | 12853 ret = retType.get$typeMember(); |
| 12840 } | 12854 } |
| 12841 var newRet = this.topType.getMember(name); | 12855 var newRet = this.topType.getMember(name); |
| 12842 if ($notnull_bool($ne(newRet, null))) { | 12856 if ($notnull_bool($ne(newRet, null))) { |
| 12843 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { | 12857 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { |
| 12844 world.error(('conflicting members for "' + name + '"'), span, (($0 = ret.g
et$span()) && $0.is$SourceSpan()), (($0 = newRet.get$span()) && $0.is$SourceSpan
())); | 12858 $globals.world.error(('conflicting members for "' + name + '"'), span, (($
0 = ret.get$span()) && $0.is$SourceSpan()), (($0 = newRet.get$span()) && $0.is$S
ourceSpan())); |
| 12845 } | 12859 } |
| 12846 else { | 12860 else { |
| 12847 ret = newRet; | 12861 ret = newRet; |
| 12848 } | 12862 } |
| 12849 } | 12863 } |
| 12850 var $list = this.imports; | 12864 var $list = this.imports; |
| 12851 for (var $i = 0;$i < $list.length; $i++) { | 12865 for (var $i = 0;$i < $list.length; $i++) { |
| 12852 var imported = $list.$index($i); | 12866 var imported = $list.$index($i); |
| 12853 if ($notnull_bool(imported.get$prefix() == null)) { | 12867 if ($notnull_bool(imported.get$prefix() == null)) { |
| 12854 newRet = imported.get$library().get$topType().getMember$1(name); | 12868 newRet = imported.get$library().get$topType().getMember$1(name); |
| 12855 if ($notnull_bool($ne(newRet, null))) { | 12869 if ($notnull_bool($ne(newRet, null))) { |
| 12856 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { | 12870 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { |
| 12857 world.error(('conflicting members for "' + name + '"'), span, (($0 = r
et.get$span()) && $0.is$SourceSpan()), (($0 = newRet.get$span()) && $0.is$Source
Span())); | 12871 $globals.world.error(('conflicting members for "' + name + '"'), span,
(($0 = ret.get$span()) && $0.is$SourceSpan()), (($0 = newRet.get$span()) && $0.
is$SourceSpan())); |
| 12858 } | 12872 } |
| 12859 else { | 12873 else { |
| 12860 ret = newRet; | 12874 ret = newRet; |
| 12861 } | 12875 } |
| 12862 } | 12876 } |
| 12863 } | 12877 } |
| 12864 } | 12878 } |
| 12865 return (ret && ret.is$Member()); | 12879 return (ret && ret.is$Member()); |
| 12866 } | 12880 } |
| 12867 Library.prototype.resolve = function() { | 12881 Library.prototype.resolve = function() { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12912 this.currentType = this.library.topType; | 12926 this.currentType = this.library.topType; |
| 12913 this.sources = []; | 12927 this.sources = []; |
| 12914 } | 12928 } |
| 12915 _LibraryVisitor.prototype.is$TreeVisitor = function(){return this;}; | 12929 _LibraryVisitor.prototype.is$TreeVisitor = function(){return this;}; |
| 12916 _LibraryVisitor.prototype.get$library = function() { return this.library; }; | 12930 _LibraryVisitor.prototype.get$library = function() { return this.library; }; |
| 12917 _LibraryVisitor.prototype.get$isTop = function() { return this.isTop; }; | 12931 _LibraryVisitor.prototype.get$isTop = function() { return this.isTop; }; |
| 12918 _LibraryVisitor.prototype.set$isTop = function(value) { return this.isTop = valu
e; }; | 12932 _LibraryVisitor.prototype.set$isTop = function(value) { return this.isTop = valu
e; }; |
| 12919 _LibraryVisitor.prototype.addSourceFromName = function(name, span) { | 12933 _LibraryVisitor.prototype.addSourceFromName = function(name, span) { |
| 12920 var filename = this.library.makeFullPath(name); | 12934 var filename = this.library.makeFullPath(name); |
| 12921 if ($notnull_bool($eq(filename, this.library.baseSource.filename))) { | 12935 if ($notnull_bool($eq(filename, this.library.baseSource.filename))) { |
| 12922 world.error('library can not source itself', span); | 12936 $globals.world.error('library can not source itself', span); |
| 12923 return; | 12937 return; |
| 12924 } | 12938 } |
| 12925 else if (this.sources.some((function (s) { | 12939 else if (this.sources.some((function (s) { |
| 12926 return $eq(s.get$filename(), filename); | 12940 return $eq(s.get$filename(), filename); |
| 12927 }) | 12941 }) |
| 12928 )) { | 12942 )) { |
| 12929 world.error(('file "' + filename + '" has already been sourced'), span); | 12943 $globals.world.error(('file "' + filename + '" has already been sourced'), s
pan); |
| 12930 return; | 12944 return; |
| 12931 } | 12945 } |
| 12932 var source = world.readFile(this.library.makeFullPath(name)); | 12946 var source = $globals.world.readFile(this.library.makeFullPath(name)); |
| 12933 this.sources.add(source); | 12947 this.sources.add(source); |
| 12934 } | 12948 } |
| 12935 _LibraryVisitor.prototype.addSource = function(source) { | 12949 _LibraryVisitor.prototype.addSource = function(source) { |
| 12936 var $this = this; // closure support | 12950 var $this = this; // closure support |
| 12937 if (this.library.sources.some((function (s) { | 12951 if (this.library.sources.some((function (s) { |
| 12938 return $eq(s.get$filename(), source.filename); | 12952 return $eq(s.get$filename(), source.filename); |
| 12939 }) | 12953 }) |
| 12940 )) { | 12954 )) { |
| 12941 world.error(('duplicate source file "' + source.filename + '"')); | 12955 $globals.world.error(('duplicate source file "' + source.filename + '"')); |
| 12942 return; | 12956 return; |
| 12943 } | 12957 } |
| 12944 this.library.sources.add(source); | 12958 this.library.sources.add(source); |
| 12945 var parser = new lang_Parser(source, options.dietParse, false, false, 0); | 12959 var parser = new lang_Parser(source, $globals.options.dietParse, false, false,
0); |
| 12946 var unit = parser.compilationUnit(); | 12960 var unit = parser.compilationUnit(); |
| 12947 unit.forEach((function (def) { | 12961 unit.forEach((function (def) { |
| 12948 return def.visit$1($this); | 12962 return def.visit$1($this); |
| 12949 }) | 12963 }) |
| 12950 ); | 12964 ); |
| 12951 $assert(this.sources.length == 0 || $notnull_bool(this.isTop), "sources.length
== 0 || isTop", "library.dart", 293, 12); | 12965 $assert(this.sources.length == 0 || $notnull_bool(this.isTop), "sources.length
== 0 || isTop", "library.dart", 293, 12); |
| 12952 this.isTop = false; | 12966 this.isTop = false; |
| 12953 var newSources = this.sources; | 12967 var newSources = this.sources; |
| 12954 this.sources = []; | 12968 this.sources = []; |
| 12955 for (var $i = newSources.iterator$0(); $i.hasNext$0(); ) { | 12969 for (var $i = newSources.iterator$0(); $i.hasNext$0(); ) { |
| 12956 var source0 = $i.next$0(); | 12970 var source0 = $i.next$0(); |
| 12957 this.addSource((source0 && source0.is$SourceFile())); | 12971 this.addSource((source0 && source0.is$SourceFile())); |
| 12958 } | 12972 } |
| 12959 } | 12973 } |
| 12960 _LibraryVisitor.prototype.visitDirectiveDefinition = function(node) { | 12974 _LibraryVisitor.prototype.visitDirectiveDefinition = function(node) { |
| 12961 if (!$notnull_bool(this.isTop)) { | 12975 if (!$notnull_bool(this.isTop)) { |
| 12962 world.error('directives not allowed in sourced file', node.span); | 12976 $globals.world.error('directives not allowed in sourced file', node.span); |
| 12963 return; | 12977 return; |
| 12964 } | 12978 } |
| 12965 var name; | 12979 var name; |
| 12966 switch (node.name.name) { | 12980 switch (node.name.name) { |
| 12967 case "library": | 12981 case "library": |
| 12968 | 12982 |
| 12969 name = this.getSingleStringArg(node); | 12983 name = this.getSingleStringArg(node); |
| 12970 if (this.library.name == null) { | 12984 if (this.library.name == null) { |
| 12971 this.library.name = $assert_String(name); | 12985 this.library.name = $assert_String(name); |
| 12972 if ($notnull_bool($eq(name, 'node')) || $notnull_bool($eq(name, 'dom')))
{ | 12986 if ($notnull_bool($eq(name, 'node')) || $notnull_bool($eq(name, 'dom')))
{ |
| 12973 this.library.topType.isNativeType = true; | 12987 this.library.topType.isNativeType = true; |
| 12974 } | 12988 } |
| 12975 if ($notnull_bool(this.seenImport) || $notnull_bool(this.seenSource) ||
$notnull_bool(this.seenResource)) { | 12989 if ($notnull_bool(this.seenImport) || $notnull_bool(this.seenSource) ||
$notnull_bool(this.seenResource)) { |
| 12976 world.error('#library must be first directive in file', node.span); | 12990 $globals.world.error('#library must be first directive in file', node.
span); |
| 12977 } | 12991 } |
| 12978 } | 12992 } |
| 12979 else { | 12993 else { |
| 12980 world.error('already specified library name', node.span); | 12994 $globals.world.error('already specified library name', node.span); |
| 12981 } | 12995 } |
| 12982 break; | 12996 break; |
| 12983 | 12997 |
| 12984 case "import": | 12998 case "import": |
| 12985 | 12999 |
| 12986 this.seenImport = true; | 13000 this.seenImport = true; |
| 12987 name = this.getFirstStringArg(node); | 13001 name = this.getFirstStringArg(node); |
| 12988 var prefix = this.tryGetNamedStringArg(node, 'prefix'); | 13002 var prefix = this.tryGetNamedStringArg(node, 'prefix'); |
| 12989 if (node.arguments.length > 2 || node.arguments.length == 2 && $notnull_bo
ol(prefix == null)) { | 13003 if (node.arguments.length > 2 || node.arguments.length == 2 && $notnull_bo
ol(prefix == null)) { |
| 12990 world.error('expected at most one "name" argument and one optional "pref
ix"' + (' but found ' + node.arguments.length), node.span); | 13004 $globals.world.error('expected at most one "name" argument and one optio
nal "prefix"' + (' but found ' + node.arguments.length), node.span); |
| 12991 } | 13005 } |
| 12992 else if ($notnull_bool($ne(prefix, null)) && prefix.indexOf$2('.', 0) >= 0
) { | 13006 else if ($notnull_bool($ne(prefix, null)) && prefix.indexOf$2('.', 0) >= 0
) { |
| 12993 world.error('library prefix canot contain "."', node.span); | 13007 $globals.world.error('library prefix canot contain "."', node.span); |
| 12994 } | 13008 } |
| 12995 else if ($notnull_bool(this.seenSource) || $notnull_bool(this.seenResource
)) { | 13009 else if ($notnull_bool(this.seenSource) || $notnull_bool(this.seenResource
)) { |
| 12996 world.error('#imports must come before any #source or #resource', node.s
pan); | 13010 $globals.world.error('#imports must come before any #source or #resource
', node.span); |
| 12997 } | 13011 } |
| 12998 if ($notnull_bool($eq(prefix, ''))) prefix = null; | 13012 if ($notnull_bool($eq(prefix, ''))) prefix = null; |
| 12999 var filename = this.library.makeFullPath($assert_String(name)); | 13013 var filename = this.library.makeFullPath($assert_String(name)); |
| 13000 if (this.library.imports.some((function (li) { | 13014 if (this.library.imports.some((function (li) { |
| 13001 return $eq(li.get$library().get$baseSource(), filename); | 13015 return $eq(li.get$library().get$baseSource(), filename); |
| 13002 }) | 13016 }) |
| 13003 )) { | 13017 )) { |
| 13004 world.error(('duplicate import of "' + name + '"'), node.span); | 13018 $globals.world.error(('duplicate import of "' + name + '"'), node.span); |
| 13005 return; | 13019 return; |
| 13006 } | 13020 } |
| 13007 var newLib = this.library.addImport($assert_String(filename), $assert_Stri
ng(prefix)); | 13021 var newLib = this.library.addImport($assert_String(filename), $assert_Stri
ng(prefix)); |
| 13008 break; | 13022 break; |
| 13009 | 13023 |
| 13010 case "source": | 13024 case "source": |
| 13011 | 13025 |
| 13012 this.seenSource = true; | 13026 this.seenSource = true; |
| 13013 name = this.getSingleStringArg(node); | 13027 name = this.getSingleStringArg(node); |
| 13014 this.addSourceFromName($assert_String(name), node.span); | 13028 this.addSourceFromName($assert_String(name), node.span); |
| 13015 if ($notnull_bool(this.seenResource)) { | 13029 if ($notnull_bool(this.seenResource)) { |
| 13016 world.error('#sources must come before any #resource', node.span); | 13030 $globals.world.error('#sources must come before any #resource', node.spa
n); |
| 13017 } | 13031 } |
| 13018 break; | 13032 break; |
| 13019 | 13033 |
| 13020 case "native": | 13034 case "native": |
| 13021 | 13035 |
| 13022 name = this.getSingleStringArg(node); | 13036 name = this.getSingleStringArg(node); |
| 13023 this.library.addNative(this.library.makeFullPath($assert_String(name))); | 13037 this.library.addNative(this.library.makeFullPath($assert_String(name))); |
| 13024 break; | 13038 break; |
| 13025 | 13039 |
| 13026 case "resource": | 13040 case "resource": |
| 13027 | 13041 |
| 13028 this.seenResource = true; | 13042 this.seenResource = true; |
| 13029 this.getFirstStringArg(node); | 13043 this.getFirstStringArg(node); |
| 13030 break; | 13044 break; |
| 13031 | 13045 |
| 13032 default: | 13046 default: |
| 13033 | 13047 |
| 13034 world.error(('unknown directive: ' + node.name.name), node.span); | 13048 $globals.world.error(('unknown directive: ' + node.name.name), node.span); |
| 13035 | 13049 |
| 13036 } | 13050 } |
| 13037 } | 13051 } |
| 13038 _LibraryVisitor.prototype.getSingleStringArg = function(node) { | 13052 _LibraryVisitor.prototype.getSingleStringArg = function(node) { |
| 13039 if (node.arguments.length != 1) { | 13053 if (node.arguments.length != 1) { |
| 13040 world.error(('expected exactly one argument but found ' + node.arguments.len
gth), node.span); | 13054 $globals.world.error(('expected exactly one argument but found ' + node.argu
ments.length), node.span); |
| 13041 } | 13055 } |
| 13042 return this.getFirstStringArg(node); | 13056 return this.getFirstStringArg(node); |
| 13043 } | 13057 } |
| 13044 _LibraryVisitor.prototype.getFirstStringArg = function(node) { | 13058 _LibraryVisitor.prototype.getFirstStringArg = function(node) { |
| 13045 if (node.arguments.length < 1) { | 13059 if (node.arguments.length < 1) { |
| 13046 world.error(('expected at least one argument but found ' + node.arguments.le
ngth), node.span); | 13060 $globals.world.error(('expected at least one argument but found ' + node.arg
uments.length), node.span); |
| 13047 } | 13061 } |
| 13048 var arg = node.arguments.$index(0); | 13062 var arg = node.arguments.$index(0); |
| 13049 if ($notnull_bool($ne(arg.get$label(), null))) { | 13063 if ($notnull_bool($ne(arg.get$label(), null))) { |
| 13050 world.error('label not allowed for directive', node.span); | 13064 $globals.world.error('label not allowed for directive', node.span); |
| 13051 } | 13065 } |
| 13052 return this._parseStringArgument((arg && arg.is$ArgumentNode())); | 13066 return this._parseStringArgument((arg && arg.is$ArgumentNode())); |
| 13053 } | 13067 } |
| 13054 _LibraryVisitor.prototype.tryGetNamedStringArg = function(node, argName) { | 13068 _LibraryVisitor.prototype.tryGetNamedStringArg = function(node, argName) { |
| 13055 var args = node.arguments.filter((function (a) { | 13069 var args = node.arguments.filter((function (a) { |
| 13056 return $notnull_bool($ne(a.get$label(), null)) && $notnull_bool($eq(a.get$la
bel().get$name(), argName)); | 13070 return $notnull_bool($ne(a.get$label(), null)) && $notnull_bool($eq(a.get$la
bel().get$name(), argName)); |
| 13057 }) | 13071 }) |
| 13058 ); | 13072 ); |
| 13059 if ($notnull_bool($eq(args.length, 0))) { | 13073 if ($notnull_bool($eq(args.length, 0))) { |
| 13060 return null; | 13074 return null; |
| 13061 } | 13075 } |
| 13062 if (args.length > 1) { | 13076 if (args.length > 1) { |
| 13063 world.error(('expected at most one "' + argName + '" argument but found ') +
node.arguments.length, node.span); | 13077 $globals.world.error(('expected at most one "' + argName + '" argument but f
ound ') + node.arguments.length, node.span); |
| 13064 } | 13078 } |
| 13065 for (var $i = args.iterator$0(); $i.hasNext$0(); ) { | 13079 for (var $i = args.iterator$0(); $i.hasNext$0(); ) { |
| 13066 var arg = $i.next$0(); | 13080 var arg = $i.next$0(); |
| 13067 return this._parseStringArgument((arg && arg.is$ArgumentNode())); | 13081 return this._parseStringArgument((arg && arg.is$ArgumentNode())); |
| 13068 } | 13082 } |
| 13069 } | 13083 } |
| 13070 _LibraryVisitor.prototype._parseStringArgument = function(arg) { | 13084 _LibraryVisitor.prototype._parseStringArgument = function(arg) { |
| 13071 var $0; | 13085 var $0; |
| 13072 var expr = arg.value; | 13086 var expr = arg.value; |
| 13073 if (!(expr instanceof LiteralExpression) || !$notnull_bool(expr.get$type().get
$type().get$isString())) { | 13087 if (!(expr instanceof LiteralExpression) || !$notnull_bool(expr.get$type().get
$type().get$isString())) { |
| 13074 world.error('expected string', (($0 = expr.get$span()) && $0.is$SourceSpan()
)); | 13088 $globals.world.error('expected string', (($0 = expr.get$span()) && $0.is$Sou
rceSpan())); |
| 13075 } | 13089 } |
| 13076 return parseStringLiteral($assert_String(expr.get$value())); | 13090 return parseStringLiteral($assert_String(expr.get$value())); |
| 13077 } | 13091 } |
| 13078 _LibraryVisitor.prototype.visitTypeDefinition = function(node) { | 13092 _LibraryVisitor.prototype.visitTypeDefinition = function(node) { |
| 13079 var oldType = this.currentType; | 13093 var oldType = this.currentType; |
| 13080 this.currentType = this.library.addType(node.name.name, node, node.isClass); | 13094 this.currentType = this.library.addType(node.name.name, node, node.isClass); |
| 13081 var $list = node.body; | 13095 var $list = node.body; |
| 13082 for (var $i = 0;$i < $list.length; $i++) { | 13096 for (var $i = 0;$i < $list.length; $i++) { |
| 13083 var member = $list.$index($i); | 13097 var member = $list.$index($i); |
| 13084 member.visit$1(this); | 13098 member.visit$1(this); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13116 Parameter.prototype.get$value = function() { return this.value; }; | 13130 Parameter.prototype.get$value = function() { return this.value; }; |
| 13117 Parameter.prototype.set$value = function(value) { return this.value = value; }; | 13131 Parameter.prototype.set$value = function(value) { return this.value = value; }; |
| 13118 Parameter.prototype.resolve = function(method, inType) { | 13132 Parameter.prototype.resolve = function(method, inType) { |
| 13119 this.name = this.definition.name.name; | 13133 this.name = this.definition.name.name; |
| 13120 if (this.name.startsWith('this.')) { | 13134 if (this.name.startsWith('this.')) { |
| 13121 this.name = this.name.substring(5); | 13135 this.name = this.name.substring(5); |
| 13122 this.isInitializer = true; | 13136 this.isInitializer = true; |
| 13123 } | 13137 } |
| 13124 this.type = inType.resolveType(this.definition.type, false); | 13138 this.type = inType.resolveType(this.definition.type, false); |
| 13125 if ($notnull_bool(method.get$isStatic()) && $notnull_bool(this.type.get$hasTyp
eParams())) { | 13139 if ($notnull_bool(method.get$isStatic()) && $notnull_bool(this.type.get$hasTyp
eParams())) { |
| 13126 world.error('using type parameter in static context', this.definition.span); | 13140 $globals.world.error('using type parameter in static context', this.definiti
on.span); |
| 13127 } | 13141 } |
| 13128 if (this.definition.value != null) { | 13142 if (this.definition.value != null) { |
| 13129 if ((this.definition.value instanceof NullExpression) && this.definition.val
ue.span.start == this.definition.span.start) { | 13143 if ((this.definition.value instanceof NullExpression) && this.definition.val
ue.span.start == this.definition.span.start) { |
| 13130 return; | 13144 return; |
| 13131 } | 13145 } |
| 13132 if ($notnull_bool(method.get$isAbstract())) { | 13146 if ($notnull_bool(method.get$isAbstract())) { |
| 13133 world.error('default value not allowed on abstract methods', this.definiti
on.span); | 13147 $globals.world.error('default value not allowed on abstract methods', this
.definition.span); |
| 13134 } | 13148 } |
| 13135 else if (method.name == '\$call' && $notnull_bool(method.get$definition().ge
t$body() == null)) { | 13149 else if (method.name == '\$call' && $notnull_bool(method.get$definition().ge
t$body() == null)) { |
| 13136 world.error('default value not allowed on function type', this.definition.
span); | 13150 $globals.world.error('default value not allowed on function type', this.de
finition.span); |
| 13137 } | 13151 } |
| 13138 } | 13152 } |
| 13139 else if ($notnull_bool(this.isInitializer) && !$notnull_bool(method.get$isCons
tructor())) { | 13153 else if ($notnull_bool(this.isInitializer) && !$notnull_bool(method.get$isCons
tructor())) { |
| 13140 world.error('initializer parameters only allowed on constructors', this.defi
nition.span); | 13154 $globals.world.error('initializer parameters only allowed on constructors',
this.definition.span); |
| 13141 } | 13155 } |
| 13142 } | 13156 } |
| 13143 Parameter.prototype.genValue = function(method, context) { | 13157 Parameter.prototype.genValue = function(method, context) { |
| 13144 var $0; | 13158 var $0; |
| 13145 if (this.definition.value == null || this.value != null) return; | 13159 if (this.definition.value == null || this.value != null) return; |
| 13146 if (context == null) { | 13160 if (context == null) { |
| 13147 context = new MethodGenerator(method, null); | 13161 context = new MethodGenerator(method, null); |
| 13148 } | 13162 } |
| 13149 this.value = (($0 = this.definition.value.visit(context)) && $0.is$Value()); | 13163 this.value = (($0 = this.definition.value.visit(context)) && $0.is$Value()); |
| 13150 this.value = this.value.convertTo(context, this.type, this.definition.value, f
alse); | 13164 this.value = this.value.convertTo(context, this.type, this.definition.value, f
alse); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13224 Member.prototype.get$prefersPropertySyntax = function() { | 13238 Member.prototype.get$prefersPropertySyntax = function() { |
| 13225 return true; | 13239 return true; |
| 13226 } | 13240 } |
| 13227 Member.prototype.get$requiresFieldSyntax = function() { | 13241 Member.prototype.get$requiresFieldSyntax = function() { |
| 13228 return false; | 13242 return false; |
| 13229 } | 13243 } |
| 13230 Member.prototype.get$isNative = function() { | 13244 Member.prototype.get$isNative = function() { |
| 13231 return false; | 13245 return false; |
| 13232 } | 13246 } |
| 13233 Member.prototype.get$constructorName = function() { | 13247 Member.prototype.get$constructorName = function() { |
| 13234 world.internalError('can not be a constructor', this.get$span()); | 13248 $globals.world.internalError('can not be a constructor', this.get$span()); |
| 13235 } | 13249 } |
| 13236 Member.prototype.provideFieldSyntax = function() { | 13250 Member.prototype.provideFieldSyntax = function() { |
| 13237 | 13251 |
| 13238 } | 13252 } |
| 13239 Member.prototype.providePropertySyntax = function() { | 13253 Member.prototype.providePropertySyntax = function() { |
| 13240 | 13254 |
| 13241 } | 13255 } |
| 13242 Member.prototype.get$initDelegate = function() { | 13256 Member.prototype.get$initDelegate = function() { |
| 13243 world.internalError('cannot have initializers', this.get$span()); | 13257 $globals.world.internalError('cannot have initializers', this.get$span()); |
| 13244 } | 13258 } |
| 13245 Member.prototype.set$initDelegate = function(ctor) { | 13259 Member.prototype.set$initDelegate = function(ctor) { |
| 13246 world.internalError('cannot have initializers', this.get$span()); | 13260 $globals.world.internalError('cannot have initializers', this.get$span()); |
| 13247 } | 13261 } |
| 13248 Member.prototype.get$inferredResult = function() { | 13262 Member.prototype.get$inferredResult = function() { |
| 13249 var t = this.get$returnType(); | 13263 var t = this.get$returnType(); |
| 13250 if ($notnull_bool(t.get$isBool()) && ($notnull_bool(this.get$library().get$isC
ore()) || $notnull_bool(this.get$library().get$isCoreImpl()))) { | 13264 if ($notnull_bool(t.get$isBool()) && ($notnull_bool(this.get$library().get$isC
ore()) || $notnull_bool(this.get$library().get$isCoreImpl()))) { |
| 13251 return world.nonNullBool; | 13265 return $globals.world.nonNullBool; |
| 13252 } | 13266 } |
| 13253 return (t && t.is$lang_Type()); | 13267 return (t && t.is$lang_Type()); |
| 13254 } | 13268 } |
| 13255 Member.prototype.get$definition = function() { | 13269 Member.prototype.get$definition = function() { |
| 13256 return null; | 13270 return null; |
| 13257 } | 13271 } |
| 13258 Member.prototype.get$parameters = function() { | 13272 Member.prototype.get$parameters = function() { |
| 13259 return []; | 13273 return []; |
| 13260 } | 13274 } |
| 13261 Member.prototype.canInvoke = function(context, args) { | 13275 Member.prototype.canInvoke = function(context, args) { |
| 13262 return $notnull_bool(this.get$canGet()) && $notnull_bool(new Value(this.get$re
turnType(), null, null, true).canInvoke(context, '\$call', args)); | 13276 return $notnull_bool(this.get$canGet()) && $notnull_bool(new Value(this.get$re
turnType(), null, null, true).canInvoke(context, '\$call', args)); |
| 13263 } | 13277 } |
| 13264 Member.prototype.invoke = function(context, node, target, args, isDynamic) { | 13278 Member.prototype.invoke = function(context, node, target, args, isDynamic) { |
| 13265 var $0; | 13279 var $0; |
| 13266 var newTarget = this._get(context, node, target, isDynamic); | 13280 var newTarget = this._get(context, node, target, isDynamic); |
| 13267 return (($0 = newTarget.invoke$5(context, '\$call', node, args, isDynamic)) &&
$0.is$Value()); | 13281 return (($0 = newTarget.invoke$5(context, '\$call', node, args, isDynamic)) &&
$0.is$Value()); |
| 13268 } | 13282 } |
| 13269 Member.prototype.override = function(other) { | 13283 Member.prototype.override = function(other) { |
| 13270 if ($notnull_bool(this.get$isStatic())) { | 13284 if ($notnull_bool(this.get$isStatic())) { |
| 13271 world.error('static members can not hide parent members', this.get$span(), o
ther.get$span()); | 13285 $globals.world.error('static members can not hide parent members', this.get$
span(), other.get$span()); |
| 13272 return false; | 13286 return false; |
| 13273 } | 13287 } |
| 13274 else if ($notnull_bool(other.get$isStatic())) { | 13288 else if ($notnull_bool(other.get$isStatic())) { |
| 13275 world.error('can not override static member', this.get$span(), other.get$spa
n()); | 13289 $globals.world.error('can not override static member', this.get$span(), othe
r.get$span()); |
| 13276 return false; | 13290 return false; |
| 13277 } | 13291 } |
| 13278 return true; | 13292 return true; |
| 13279 } | 13293 } |
| 13280 Member.prototype.get$generatedFactoryName = function() { | 13294 Member.prototype.get$generatedFactoryName = function() { |
| 13281 $assert(this.get$isFactory(), "this.isFactory", "member.dart", 195, 12); | 13295 $assert(this.get$isFactory(), "this.isFactory", "member.dart", 195, 12); |
| 13282 var prefix = ('' + this.declaringType.get$jsname() + '.' + this.get$constructo
rName() + '\$'); | 13296 var prefix = ('' + this.declaringType.get$jsname() + '.' + this.get$constructo
rName() + '\$'); |
| 13283 if (this.name == '') { | 13297 if (this.name == '') { |
| 13284 return ('' + prefix + 'factory'); | 13298 return ('' + prefix + 'factory'); |
| 13285 } | 13299 } |
| 13286 else { | 13300 else { |
| 13287 return ('' + prefix + this.name + '\$factory'); | 13301 return ('' + prefix + this.name + '\$factory'); |
| 13288 } | 13302 } |
| 13289 } | 13303 } |
| 13290 Member.prototype.resolveType = function(node, isRequired) { | 13304 Member.prototype.resolveType = function(node, isRequired) { |
| 13291 var type = this.declaringType.resolveType(node, isRequired); | 13305 var type = this.declaringType.resolveType(node, isRequired); |
| 13292 if ($notnull_bool(this.get$isStatic()) && $notnull_bool(type.get$hasTypeParams
())) { | 13306 if ($notnull_bool(this.get$isStatic()) && $notnull_bool(type.get$hasTypeParams
())) { |
| 13293 world.error('using type parameter in static context', node.span); | 13307 $globals.world.error('using type parameter in static context', node.span); |
| 13294 } | 13308 } |
| 13295 return (type && type.is$lang_Type()); | 13309 return (type && type.is$lang_Type()); |
| 13296 } | 13310 } |
| 13297 Member.prototype._get$3 = function($0, $1, $2) { | 13311 Member.prototype._get$3 = function($0, $1, $2) { |
| 13298 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value())); | 13312 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value())); |
| 13299 }; | 13313 }; |
| 13300 Member.prototype._set$4 = function($0, $1, $2, $3) { | 13314 Member.prototype._set$4 = function($0, $1, $2, $3) { |
| 13301 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value())); | 13315 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value())); |
| 13302 }; | 13316 }; |
| 13303 Member.prototype.canInvoke$2 = function($0, $1) { | 13317 Member.prototype.canInvoke$2 = function($0, $1) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 13330 $inherits(TypeMember, Member); | 13344 $inherits(TypeMember, Member); |
| 13331 TypeMember.prototype.is$TypeMember = function(){return this;}; | 13345 TypeMember.prototype.is$TypeMember = function(){return this;}; |
| 13332 TypeMember.prototype.get$type = function() { return this.type; }; | 13346 TypeMember.prototype.get$type = function() { return this.type; }; |
| 13333 TypeMember.prototype.get$span = function() { | 13347 TypeMember.prototype.get$span = function() { |
| 13334 return this.type.definition.span; | 13348 return this.type.definition.span; |
| 13335 } | 13349 } |
| 13336 TypeMember.prototype.get$isStatic = function() { | 13350 TypeMember.prototype.get$isStatic = function() { |
| 13337 return true; | 13351 return true; |
| 13338 } | 13352 } |
| 13339 TypeMember.prototype.get$returnType = function() { | 13353 TypeMember.prototype.get$returnType = function() { |
| 13340 return world.varType; | 13354 return $globals.world.varType; |
| 13341 } | 13355 } |
| 13342 TypeMember.prototype.canInvoke = function(context, args) { | 13356 TypeMember.prototype.canInvoke = function(context, args) { |
| 13343 return false; | 13357 return false; |
| 13344 } | 13358 } |
| 13345 TypeMember.prototype.get$canGet = function() { | 13359 TypeMember.prototype.get$canGet = function() { |
| 13346 return true; | 13360 return true; |
| 13347 } | 13361 } |
| 13348 TypeMember.prototype.get$canSet = function() { | 13362 TypeMember.prototype.get$canSet = function() { |
| 13349 return false; | 13363 return false; |
| 13350 } | 13364 } |
| 13351 TypeMember.prototype.resolve = function(inType) { | 13365 TypeMember.prototype.resolve = function(inType) { |
| 13352 | 13366 |
| 13353 } | 13367 } |
| 13354 TypeMember.prototype._get = function(context, node, target, isDynamic) { | 13368 TypeMember.prototype._get = function(context, node, target, isDynamic) { |
| 13355 var ret = new Value(this.type, this.type.get$jsname(), node.span, false); | 13369 var ret = new Value(this.type, this.type.get$jsname(), node.span, false); |
| 13356 ret.set$isType(true); | 13370 ret.set$isType(true); |
| 13357 return (ret && ret.is$Value()); | 13371 return (ret && ret.is$Value()); |
| 13358 } | 13372 } |
| 13359 TypeMember.prototype._set = function(context, node, target, value, isDynamic) { | 13373 TypeMember.prototype._set = function(context, node, target, value, isDynamic) { |
| 13360 world.error('can not set type', node.span); | 13374 $globals.world.error('can not set type', node.span); |
| 13361 } | 13375 } |
| 13362 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) { | 13376 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) { |
| 13363 world.error('can not invoke type', node.span); | 13377 $globals.world.error('can not invoke type', node.span); |
| 13364 } | 13378 } |
| 13365 TypeMember.prototype._get$3 = function($0, $1, $2) { | 13379 TypeMember.prototype._get$3 = function($0, $1, $2) { |
| 13366 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), false); | 13380 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), false); |
| 13367 }; | 13381 }; |
| 13368 TypeMember.prototype._set$4 = function($0, $1, $2, $3) { | 13382 TypeMember.prototype._set$4 = function($0, $1, $2, $3) { |
| 13369 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value()), false); | 13383 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value()), false); |
| 13370 }; | 13384 }; |
| 13371 TypeMember.prototype.canInvoke$2 = function($0, $1) { | 13385 TypeMember.prototype.canInvoke$2 = function($0, $1) { |
| 13372 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments(
))); | 13386 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments(
))); |
| 13373 }; | 13387 }; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 13404 FieldMember.prototype.get$isFinal = function() { return this.isFinal; }; | 13418 FieldMember.prototype.get$isFinal = function() { return this.isFinal; }; |
| 13405 FieldMember.prototype.set$isFinal = function(value) { return this.isFinal = valu
e; }; | 13419 FieldMember.prototype.set$isFinal = function(value) { return this.isFinal = valu
e; }; |
| 13406 FieldMember.prototype.get$isNative = function() { return this.isNative; }; | 13420 FieldMember.prototype.get$isNative = function() { return this.isNative; }; |
| 13407 FieldMember.prototype.set$isNative = function(value) { return this.isNative = va
lue; }; | 13421 FieldMember.prototype.set$isNative = function(value) { return this.isNative = va
lue; }; |
| 13408 FieldMember.prototype.override = function(other) { | 13422 FieldMember.prototype.override = function(other) { |
| 13409 if (!$notnull_bool(Member.prototype.override.call(this, other))) return false; | 13423 if (!$notnull_bool(Member.prototype.override.call(this, other))) return false; |
| 13410 if ($notnull_bool(other.get$isProperty())) { | 13424 if ($notnull_bool(other.get$isProperty())) { |
| 13411 return true; | 13425 return true; |
| 13412 } | 13426 } |
| 13413 else { | 13427 else { |
| 13414 world.error('field can not override anything but property', this.get$span(),
other.get$span()); | 13428 $globals.world.error('field can not override anything but property', this.ge
t$span(), other.get$span()); |
| 13415 return false; | 13429 return false; |
| 13416 } | 13430 } |
| 13417 } | 13431 } |
| 13418 FieldMember.prototype.get$prefersPropertySyntax = function() { | 13432 FieldMember.prototype.get$prefersPropertySyntax = function() { |
| 13419 return false; | 13433 return false; |
| 13420 } | 13434 } |
| 13421 FieldMember.prototype.get$requiresFieldSyntax = function() { | 13435 FieldMember.prototype.get$requiresFieldSyntax = function() { |
| 13422 return this.isNative; | 13436 return this.isNative; |
| 13423 } | 13437 } |
| 13424 FieldMember.prototype.provideFieldSyntax = function() { | 13438 FieldMember.prototype.provideFieldSyntax = function() { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 13446 FieldMember.prototype.resolve = function(inType) { | 13460 FieldMember.prototype.resolve = function(inType) { |
| 13447 var $0; | 13461 var $0; |
| 13448 this.isStatic = this.declaringType.get$isTop(); | 13462 this.isStatic = this.declaringType.get$isTop(); |
| 13449 this.isFinal = false; | 13463 this.isFinal = false; |
| 13450 if (this.definition.modifiers != null) { | 13464 if (this.definition.modifiers != null) { |
| 13451 var $list = this.definition.modifiers; | 13465 var $list = this.definition.modifiers; |
| 13452 for (var $i = 0;$i < $list.length; $i++) { | 13466 for (var $i = 0;$i < $list.length; $i++) { |
| 13453 var mod = $list.$index($i); | 13467 var mod = $list.$index($i); |
| 13454 if ($notnull_bool($eq(mod.get$kind(), 86/*TokenKind.STATIC*/))) { | 13468 if ($notnull_bool($eq(mod.get$kind(), 86/*TokenKind.STATIC*/))) { |
| 13455 if ($notnull_bool(this.isStatic)) { | 13469 if ($notnull_bool(this.isStatic)) { |
| 13456 world.error('duplicate static modifier', (($0 = mod.get$span()) && $0.
is$SourceSpan())); | 13470 $globals.world.error('duplicate static modifier', (($0 = mod.get$span(
)) && $0.is$SourceSpan())); |
| 13457 } | 13471 } |
| 13458 this.isStatic = true; | 13472 this.isStatic = true; |
| 13459 } | 13473 } |
| 13460 else if ($notnull_bool($eq(mod.get$kind(), 97/*TokenKind.FINAL*/))) { | 13474 else if ($notnull_bool($eq(mod.get$kind(), 97/*TokenKind.FINAL*/))) { |
| 13461 if ($notnull_bool(this.isFinal)) { | 13475 if ($notnull_bool(this.isFinal)) { |
| 13462 world.error('duplicate final modifier', (($0 = mod.get$span()) && $0.i
s$SourceSpan())); | 13476 $globals.world.error('duplicate final modifier', (($0 = mod.get$span()
) && $0.is$SourceSpan())); |
| 13463 } | 13477 } |
| 13464 this.isFinal = true; | 13478 this.isFinal = true; |
| 13465 } | 13479 } |
| 13466 else { | 13480 else { |
| 13467 world.error(('' + mod + ' modifier not allowed on field'), (($0 = mod.ge
t$span()) && $0.is$SourceSpan())); | 13481 $globals.world.error(('' + mod + ' modifier not allowed on field'), (($0
= mod.get$span()) && $0.is$SourceSpan())); |
| 13468 } | 13482 } |
| 13469 } | 13483 } |
| 13470 } | 13484 } |
| 13471 this.type = inType.resolveType(this.definition.type, false); | 13485 this.type = inType.resolveType(this.definition.type, false); |
| 13472 if ($notnull_bool(this.isStatic) && $notnull_bool(this.type.get$hasTypeParams(
))) { | 13486 if ($notnull_bool(this.isStatic) && $notnull_bool(this.type.get$hasTypeParams(
))) { |
| 13473 world.error('using type parameter in static context', this.definition.type.s
pan); | 13487 $globals.world.error('using type parameter in static context', this.definiti
on.type.span); |
| 13474 } | 13488 } |
| 13475 if ($notnull_bool(this.isStatic) && $notnull_bool(this.isFinal) && this.value
== null) { | 13489 if ($notnull_bool(this.isStatic) && $notnull_bool(this.isFinal) && this.value
== null) { |
| 13476 world.error('static final field is missing initializer', this.get$span()); | 13490 $globals.world.error('static final field is missing initializer', this.get$s
pan()); |
| 13477 } | 13491 } |
| 13478 this.get$library()._addMember(this); | 13492 this.get$library()._addMember(this); |
| 13479 } | 13493 } |
| 13480 FieldMember.prototype.computeValue = function() { | 13494 FieldMember.prototype.computeValue = function() { |
| 13481 var $0; | 13495 var $0; |
| 13482 if (this.value == null) return null; | 13496 if (this.value == null) return null; |
| 13483 if (this._computedValue == null) { | 13497 if (this._computedValue == null) { |
| 13484 if ($notnull_bool(this._computing)) { | 13498 if ($notnull_bool(this._computing)) { |
| 13485 world.error('circular reference', this.value.span); | 13499 $globals.world.error('circular reference', this.value.span); |
| 13486 return null; | 13500 return null; |
| 13487 } | 13501 } |
| 13488 this._computing = true; | 13502 this._computing = true; |
| 13489 var finalMethod = new MethodMember('final_context', this.declaringType, null
); | 13503 var finalMethod = new MethodMember('final_context', this.declaringType, null
); |
| 13490 finalMethod.set$isStatic(true); | 13504 finalMethod.set$isStatic(true); |
| 13491 var finalGen = new MethodGenerator(finalMethod, null); | 13505 var finalGen = new MethodGenerator(finalMethod, null); |
| 13492 this._computedValue = (($0 = this.value.visit((finalGen && finalGen.is$TreeV
isitor()))) && $0.is$Value()); | 13506 this._computedValue = (($0 = this.value.visit((finalGen && finalGen.is$TreeV
isitor()))) && $0.is$Value()); |
| 13493 if (!$notnull_bool(this._computedValue.get$isConst())) { | 13507 if (!$notnull_bool(this._computedValue.get$isConst())) { |
| 13494 if ($notnull_bool(this.isStatic)) { | 13508 if ($notnull_bool(this.isStatic)) { |
| 13495 world.error('non constant static field must be initialized in functions'
, this.value.span); | 13509 $globals.world.error('non constant static field must be initialized in f
unctions', this.value.span); |
| 13496 } | 13510 } |
| 13497 else { | 13511 else { |
| 13498 world.error('non constant field must be initialized in constructor', thi
s.value.span); | 13512 $globals.world.error('non constant field must be initialized in construc
tor', this.value.span); |
| 13499 } | 13513 } |
| 13500 } | 13514 } |
| 13501 if ($notnull_bool(this.isStatic)) { | 13515 if ($notnull_bool(this.isStatic)) { |
| 13502 this._computedValue = world.gen.globalForStaticField(this, this._computedV
alue, [this._computedValue]); | 13516 this._computedValue = $globals.world.gen.globalForStaticField(this, this._
computedValue, [this._computedValue]); |
| 13503 } | 13517 } |
| 13504 this._computing = false; | 13518 this._computing = false; |
| 13505 } | 13519 } |
| 13506 return this._computedValue; | 13520 return this._computedValue; |
| 13507 } | 13521 } |
| 13508 FieldMember.prototype._get = function(context, node, target, isDynamic) { | 13522 FieldMember.prototype._get = function(context, node, target, isDynamic) { |
| 13509 var $0; | 13523 var $0; |
| 13510 if (!$notnull_bool(isDynamic)) { | 13524 if (!$notnull_bool(isDynamic)) { |
| 13511 this.declaringType.markUsed(); | 13525 this.declaringType.markUsed(); |
| 13512 } | 13526 } |
| 13513 if ($notnull_bool(this.isStatic)) { | 13527 if ($notnull_bool(this.isStatic)) { |
| 13514 var cv = this.computeValue(); | 13528 var cv = this.computeValue(); |
| 13515 if ($notnull_bool(this.isFinal)) { | 13529 if ($notnull_bool(this.isFinal)) { |
| 13516 return (cv && cv.is$Value()); | 13530 return (cv && cv.is$Value()); |
| 13517 } | 13531 } |
| 13532 $globals.world.gen.hasStatics = true; |
| 13518 if ($notnull_bool(this.declaringType.get$isTop())) { | 13533 if ($notnull_bool(this.declaringType.get$isTop())) { |
| 13519 return new Value(this.type, ('' + this.get$jsname()), node.span, true); | 13534 if ($eq(this.declaringType.get$library(), $globals.world.get$dom())) { |
| 13535 return new Value(this.type, ('' + this.get$jsname()), node.span, true); |
| 13536 } |
| 13537 else { |
| 13538 return new Value(this.type, ('\$globals.' + this.get$jsname()), node.spa
n, true); |
| 13539 } |
| 13540 } |
| 13541 else if ($notnull_bool(this.declaringType.get$isNative())) { |
| 13542 return new Value(this.type, ('' + this.declaringType.get$jsname() + '.' +
this.get$jsname()), node.span, true); |
| 13520 } | 13543 } |
| 13521 else { | 13544 else { |
| 13522 return new Value(this.type, ('' + this.declaringType.get$jsname() + '.' +
this.get$jsname()), node.span, true); | 13545 return new Value(this.type, ('\$globals.' + this.declaringType.get$jsname(
) + '_' + this.get$jsname()), node.span, true); |
| 13523 } | 13546 } |
| 13524 } | 13547 } |
| 13525 else if ($notnull_bool(target.get$isConst()) && $notnull_bool(this.isFinal)) { | 13548 else if ($notnull_bool(target.get$isConst()) && $notnull_bool(this.isFinal)) { |
| 13526 var constTarget = (target instanceof GlobalValue) ? target.get$dynamic().get
$exp() : target; | 13549 var constTarget = (target instanceof GlobalValue) ? target.get$dynamic().get
$exp() : target; |
| 13527 if ((constTarget instanceof ConstObjectValue)) { | 13550 if ((constTarget instanceof ConstObjectValue)) { |
| 13528 return (($0 = constTarget.get$fields().$index(this.name)) && $0.is$Value()
); | 13551 return (($0 = constTarget.get$fields().$index(this.name)) && $0.is$Value()
); |
| 13529 } | 13552 } |
| 13530 else if ($notnull_bool($eq(constTarget.get$type(), world.stringType)) && thi
s.name == 'length') { | 13553 else if ($notnull_bool($eq(constTarget.get$type(), $globals.world.stringType
)) && this.name == 'length') { |
| 13531 return new Value(this.type, ('' + constTarget.get$actualValue().length), n
ode.span, true); | 13554 return new Value(this.type, ('' + constTarget.get$actualValue().length), n
ode.span, true); |
| 13532 } | 13555 } |
| 13533 } | 13556 } |
| 13534 return new Value(this.type, ('' + target.code + '.' + this.get$jsname()), node
.span, true); | 13557 return new Value(this.type, ('' + target.code + '.' + this.get$jsname()), node
.span, true); |
| 13535 } | 13558 } |
| 13536 FieldMember.prototype._set = function(context, node, target, value, isDynamic) { | 13559 FieldMember.prototype._set = function(context, node, target, value, isDynamic) { |
| 13537 var lhs = this._get(context, node, target, isDynamic); | 13560 var lhs = this._get(context, node, target, isDynamic); |
| 13538 value = value.convertTo(context, this.type, node, isDynamic); | 13561 value = value.convertTo(context, this.type, node, isDynamic); |
| 13539 return new Value(this.type, ('' + lhs.get$code() + ' = ' + value.code), node.s
pan, true); | 13562 return new Value(this.type, ('' + lhs.get$code() + ' = ' + value.code), node.s
pan, true); |
| 13540 } | 13563 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13600 return this.getter == null ? this.setter.returnType : this.getter.returnType; | 13623 return this.getter == null ? this.setter.returnType : this.getter.returnType; |
| 13601 } | 13624 } |
| 13602 PropertyMember.prototype.override = function(other) { | 13625 PropertyMember.prototype.override = function(other) { |
| 13603 if (!$notnull_bool(Member.prototype.override.call(this, other))) return false; | 13626 if (!$notnull_bool(Member.prototype.override.call(this, other))) return false; |
| 13604 if ($notnull_bool(other.get$isProperty()) || $notnull_bool(other.get$isField()
)) { | 13627 if ($notnull_bool(other.get$isProperty()) || $notnull_bool(other.get$isField()
)) { |
| 13605 if ($notnull_bool(other.get$isProperty())) this.addFromParent(other); | 13628 if ($notnull_bool(other.get$isProperty())) this.addFromParent(other); |
| 13606 else this._overriddenField = other; | 13629 else this._overriddenField = other; |
| 13607 return true; | 13630 return true; |
| 13608 } | 13631 } |
| 13609 else { | 13632 else { |
| 13610 world.error('property can only override field or property', this.get$span(),
other.get$span()); | 13633 $globals.world.error('property can only override field or property', this.ge
t$span(), other.get$span()); |
| 13611 return false; | 13634 return false; |
| 13612 } | 13635 } |
| 13613 } | 13636 } |
| 13614 PropertyMember.prototype._get = function(context, node, target, isDynamic) { | 13637 PropertyMember.prototype._get = function(context, node, target, isDynamic) { |
| 13615 if (this.getter == null) { | 13638 if (this.getter == null) { |
| 13616 if (this._overriddenField != null) { | 13639 if (this._overriddenField != null) { |
| 13617 return this._overriddenField._get(context, node, target, isDynamic); | 13640 return this._overriddenField._get(context, node, target, isDynamic); |
| 13618 } | 13641 } |
| 13619 return target.invokeNoSuchMethod(context, ('get:' + this.name), node); | 13642 return target.invokeNoSuchMethod(context, ('get:' + this.name), node); |
| 13620 } | 13643 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13699 ConcreteMember.prototype.get$isConst = function() { | 13722 ConcreteMember.prototype.get$isConst = function() { |
| 13700 return this.baseMember.get$isConst(); | 13723 return this.baseMember.get$isConst(); |
| 13701 } | 13724 } |
| 13702 ConcreteMember.prototype.get$isFactory = function() { | 13725 ConcreteMember.prototype.get$isFactory = function() { |
| 13703 return this.baseMember.get$isFactory(); | 13726 return this.baseMember.get$isFactory(); |
| 13704 } | 13727 } |
| 13705 ConcreteMember.prototype.get$jsname = function() { | 13728 ConcreteMember.prototype.get$jsname = function() { |
| 13706 return this.baseMember.get$jsname(); | 13729 return this.baseMember.get$jsname(); |
| 13707 } | 13730 } |
| 13708 ConcreteMember.prototype.set$jsname = function(name) { | 13731 ConcreteMember.prototype.set$jsname = function(name) { |
| 13709 return world.internalError('bad set of jsname on ConcreteMember'); | 13732 return $globals.world.internalError('bad set of jsname on ConcreteMember'); |
| 13710 } | 13733 } |
| 13711 ConcreteMember.prototype.get$canGet = function() { | 13734 ConcreteMember.prototype.get$canGet = function() { |
| 13712 return this.baseMember.get$canGet(); | 13735 return this.baseMember.get$canGet(); |
| 13713 } | 13736 } |
| 13714 ConcreteMember.prototype.get$canSet = function() { | 13737 ConcreteMember.prototype.get$canSet = function() { |
| 13715 return this.baseMember.get$canSet(); | 13738 return this.baseMember.get$canSet(); |
| 13716 } | 13739 } |
| 13717 ConcreteMember.prototype.canInvoke = function(context, args) { | 13740 ConcreteMember.prototype.canInvoke = function(context, args) { |
| 13718 return this.baseMember.canInvoke(context, args); | 13741 return this.baseMember.canInvoke(context, args); |
| 13719 } | 13742 } |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13861 MethodMember.prototype.get$constructorName = function() { | 13884 MethodMember.prototype.get$constructorName = function() { |
| 13862 var $0; | 13885 var $0; |
| 13863 var returnType = (($0 = this.definition.returnType) && $0.is$NameTypeReference
()); | 13886 var returnType = (($0 = this.definition.returnType) && $0.is$NameTypeReference
()); |
| 13864 if (returnType == null) return ''; | 13887 if (returnType == null) return ''; |
| 13865 if (returnType.names != null) { | 13888 if (returnType.names != null) { |
| 13866 return $assert_String(returnType.names.$index(0).get$name()); | 13889 return $assert_String(returnType.names.$index(0).get$name()); |
| 13867 } | 13890 } |
| 13868 else if (returnType.name != null) { | 13891 else if (returnType.name != null) { |
| 13869 return returnType.name.name; | 13892 return returnType.name.name; |
| 13870 } | 13893 } |
| 13871 world.internalError('no valid constructor name', this.definition.span); | 13894 $globals.world.internalError('no valid constructor name', this.definition.span
); |
| 13872 } | 13895 } |
| 13873 MethodMember.prototype.get$functionType = function() { | 13896 MethodMember.prototype.get$functionType = function() { |
| 13874 if (this._functionType == null) { | 13897 if (this._functionType == null) { |
| 13875 this._functionType = this.get$library().getOrAddFunctionType(this.name, this
.definition, this.declaringType); | 13898 this._functionType = this.get$library().getOrAddFunctionType(this.name, this
.definition, this.declaringType); |
| 13876 if (this.parameters == null) { | 13899 if (this.parameters == null) { |
| 13877 this.resolve(this.declaringType); | 13900 this.resolve(this.declaringType); |
| 13878 } | 13901 } |
| 13879 } | 13902 } |
| 13880 return this._functionType; | 13903 return this._functionType; |
| 13881 } | 13904 } |
| 13882 MethodMember.prototype.override = function(other) { | 13905 MethodMember.prototype.override = function(other) { |
| 13883 if (!$notnull_bool(Member.prototype.override.call(this, other))) return false; | 13906 if (!$notnull_bool(Member.prototype.override.call(this, other))) return false; |
| 13884 if ($notnull_bool(other.get$isMethod())) { | 13907 if ($notnull_bool(other.get$isMethod())) { |
| 13885 return true; | 13908 return true; |
| 13886 } | 13909 } |
| 13887 else { | 13910 else { |
| 13888 world.error('method can only override methods', this.get$span(), other.get$s
pan()); | 13911 $globals.world.error('method can only override methods', this.get$span(), ot
her.get$span()); |
| 13889 return false; | 13912 return false; |
| 13890 } | 13913 } |
| 13891 } | 13914 } |
| 13892 MethodMember.prototype.canInvoke = function(context, args) { | 13915 MethodMember.prototype.canInvoke = function(context, args) { |
| 13893 var bareCount = args.get$bareCount(); | 13916 var bareCount = args.get$bareCount(); |
| 13894 if (bareCount > this.parameters.length) return false; | 13917 if (bareCount > this.parameters.length) return false; |
| 13895 if (bareCount == this.parameters.length) { | 13918 if (bareCount == this.parameters.length) { |
| 13896 if (bareCount != args.get$length()) return false; | 13919 if (bareCount != args.get$length()) return false; |
| 13897 } | 13920 } |
| 13898 else { | 13921 else { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 13922 MethodMember.prototype.get$requiresFieldSyntax = function() { | 13945 MethodMember.prototype.get$requiresFieldSyntax = function() { |
| 13923 return false; | 13946 return false; |
| 13924 } | 13947 } |
| 13925 MethodMember.prototype.provideFieldSyntax = function() { | 13948 MethodMember.prototype.provideFieldSyntax = function() { |
| 13926 this._provideFieldSyntax = true; | 13949 this._provideFieldSyntax = true; |
| 13927 } | 13950 } |
| 13928 MethodMember.prototype.providePropertySyntax = function() { | 13951 MethodMember.prototype.providePropertySyntax = function() { |
| 13929 this._providePropertySyntax = true; | 13952 this._providePropertySyntax = true; |
| 13930 } | 13953 } |
| 13931 MethodMember.prototype._set = function(context, Node, target, value, isDynamic)
{ | 13954 MethodMember.prototype._set = function(context, Node, target, value, isDynamic)
{ |
| 13932 world.error('can not set method', this.definition.span); | 13955 $globals.world.error('can not set method', this.definition.span); |
| 13933 } | 13956 } |
| 13934 MethodMember.prototype._get = function(context, node, target, isDynamic) { | 13957 MethodMember.prototype._get = function(context, node, target, isDynamic) { |
| 13935 this.declaringType.genMethod(this); | 13958 this.declaringType.genMethod(this); |
| 13936 this._provideOptionalParamInfo = true; | 13959 this._provideOptionalParamInfo = true; |
| 13937 if ($notnull_bool(this.isStatic)) { | 13960 if ($notnull_bool(this.isStatic)) { |
| 13961 this.declaringType.markUsed(); |
| 13938 var type = $notnull_bool(this.declaringType.get$isTop()) ? '' : ('' + this.d
eclaringType.get$jsname() + '.'); | 13962 var type = $notnull_bool(this.declaringType.get$isTop()) ? '' : ('' + this.d
eclaringType.get$jsname() + '.'); |
| 13939 return new Value(this.get$functionType(), ('' + type + this.get$jsname()), n
ode.span, true); | 13963 return new Value(this.get$functionType(), ('' + type + this.get$jsname()), n
ode.span, true); |
| 13940 } | 13964 } |
| 13941 this._providePropertySyntax = true; | 13965 this._providePropertySyntax = true; |
| 13942 return new Value(this.get$functionType(), ('' + target.code + '.get\$' + this.
get$jsname() + '()'), node.span, true); | 13966 return new Value(this.get$functionType(), ('' + target.code + '.get\$' + this.
get$jsname() + '()'), node.span, true); |
| 13943 } | 13967 } |
| 13944 MethodMember.prototype.namesInOrder = function(args) { | 13968 MethodMember.prototype.namesInOrder = function(args) { |
| 13945 if (!$notnull_bool(args.get$hasNames())) return true; | 13969 if (!$notnull_bool(args.get$hasNames())) return true; |
| 13946 var lastParameter = null; | 13970 var lastParameter = null; |
| 13947 for (var i = args.get$bareCount(); | 13971 for (var i = args.get$bareCount(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 13975 } | 13999 } |
| 13976 } | 14000 } |
| 13977 } | 14001 } |
| 13978 return true; | 14002 return true; |
| 13979 } | 14003 } |
| 13980 MethodMember._argCountMsg = function(actual, expected, atLeast) { | 14004 MethodMember._argCountMsg = function(actual, expected, atLeast) { |
| 13981 return 'wrong number of arguments, expected ' + ('' + ($notnull_bool(atLeast)
? "at least " : "") + expected + ' but found ' + actual); | 14005 return 'wrong number of arguments, expected ' + ('' + ($notnull_bool(atLeast)
? "at least " : "") + expected + ' but found ' + actual); |
| 13982 } | 14006 } |
| 13983 MethodMember.prototype._argError = function(context, node, target, args, msg) { | 14007 MethodMember.prototype._argError = function(context, node, target, args, msg) { |
| 13984 if ($notnull_bool(this.isStatic) || $notnull_bool(this.get$isConstructor())) { | 14008 if ($notnull_bool(this.isStatic) || $notnull_bool(this.get$isConstructor())) { |
| 13985 world.error(msg, node.span); | 14009 $globals.world.error(msg, node.span); |
| 13986 } | 14010 } |
| 13987 else { | 14011 else { |
| 13988 world.warning(msg, node.span); | 14012 $globals.world.warning(msg, node.span); |
| 13989 } | 14013 } |
| 13990 return target.invokeNoSuchMethod(context, this.name, node, args); | 14014 return target.invokeNoSuchMethod(context, this.name, node, args); |
| 13991 } | 14015 } |
| 13992 MethodMember.prototype.genParameterValues = function() { | 14016 MethodMember.prototype.genParameterValues = function() { |
| 13993 var $list = this.parameters; | 14017 var $list = this.parameters; |
| 13994 for (var $i = 0;$i < $list.length; $i++) { | 14018 for (var $i = 0;$i < $list.length; $i++) { |
| 13995 var p = $list.$index($i); | 14019 var p = $list.$index($i); |
| 13996 p.genValue$2(this, this.generator); | 14020 p.genValue$2(this, this.generator); |
| 13997 } | 14021 } |
| 13998 } | 14022 } |
| 13999 MethodMember.prototype.invoke = function(context, node, target, args, isDynamic)
{ | 14023 MethodMember.prototype.invoke = function(context, node, target, args, isDynamic)
{ |
| 14000 var $0; | 14024 var $0; |
| 14001 if (this.parameters == null) { | 14025 if (this.parameters == null) { |
| 14002 world.info(('surprised to need to resolve: ' + this.declaringType.name + '.'
+ this.name)); | 14026 $globals.world.info(('surprised to need to resolve: ' + this.declaringType.n
ame + '.' + this.name)); |
| 14003 this.resolve(this.declaringType); | 14027 this.resolve(this.declaringType); |
| 14004 } | 14028 } |
| 14005 this.declaringType.genMethod(this); | 14029 this.declaringType.genMethod(this); |
| 14006 if ($notnull_bool(this.isStatic) || $notnull_bool(this.isFactory)) { | 14030 if ($notnull_bool(this.isStatic) || $notnull_bool(this.isFactory)) { |
| 14007 this.declaringType.markUsed(); | 14031 this.declaringType.markUsed(); |
| 14008 } | 14032 } |
| 14009 if ($notnull_bool(this.get$isNative()) && this.returnType != null) this.return
Type.markUsed(); | 14033 if ($notnull_bool(this.get$isNative()) && this.returnType != null) this.return
Type.markUsed(); |
| 14010 if (!$notnull_bool(this.namesInOrder(args))) { | 14034 if (!$notnull_bool(this.namesInOrder(args))) { |
| 14011 return context.findMembers(this.name).invokeOnVar(context, node, target, arg
s); | 14035 return context.findMembers(this.name).invokeOnVar(context, node, target, arg
s); |
| 14012 } | 14036 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14061 } | 14085 } |
| 14062 seen.add$1(name); | 14086 seen.add$1(name); |
| 14063 var p = this.indexOfParameter($assert_String(name)); | 14087 var p = this.indexOfParameter($assert_String(name)); |
| 14064 if (p < 0) { | 14088 if (p < 0) { |
| 14065 return this._argError(context, node, target, args, ('method does not h
ave optional parameter "' + name + '"')); | 14089 return this._argError(context, node, target, args, ('method does not h
ave optional parameter "' + name + '"')); |
| 14066 } | 14090 } |
| 14067 else if (p < bareCount) { | 14091 else if (p < bareCount) { |
| 14068 return this._argError(context, node, target, args, ('argument "' + nam
e + '" passed as positional and named')); | 14092 return this._argError(context, node, target, args, ('argument "' + nam
e + '" passed as positional and named')); |
| 14069 } | 14093 } |
| 14070 } | 14094 } |
| 14071 world.internalError(('wrong named arguments calling ' + this.name), node.s
pan); | 14095 $globals.world.internalError(('wrong named arguments calling ' + this.name
), node.span); |
| 14072 } | 14096 } |
| 14073 Arguments.removeTrailingNulls((argsCode && argsCode.is$List$Value())); | 14097 Arguments.removeTrailingNulls((argsCode && argsCode.is$List$Value())); |
| 14074 } | 14098 } |
| 14075 var argsString = Strings.join((argsCode && argsCode.is$List$String()), ', '); | 14099 var argsString = Strings.join((argsCode && argsCode.is$List$String()), ', '); |
| 14076 if ($notnull_bool(this.get$isConstructor())) { | 14100 if ($notnull_bool(this.get$isConstructor())) { |
| 14077 return this._invokeConstructor(context, node, target, args, argsString); | 14101 return this._invokeConstructor(context, node, target, args, argsString); |
| 14078 } | 14102 } |
| 14079 if (target != null && $notnull_bool(target.isSuper)) { | 14103 if (target != null && $notnull_bool(target.isSuper)) { |
| 14080 return new Value(this.get$inferredResult(), ('' + this.declaringType.get$jsn
ame() + '.prototype.' + this.get$jsname() + '.call(' + argsString + ')'), node.s
pan, true); | 14104 return new Value(this.get$inferredResult(), ('' + this.declaringType.get$jsn
ame() + '.prototype.' + this.get$jsname() + '.call(' + argsString + ')'), node.s
pan, true); |
| 14081 } | 14105 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 14100 if ((target instanceof ConstListValue) || (target instanceof ConstMapValue
)) { | 14124 if ((target instanceof ConstListValue) || (target instanceof ConstMapValue
)) { |
| 14101 code = ('' + target.get$dynamic().get$values().length); | 14125 code = ('' + target.get$dynamic().get$values().length); |
| 14102 } | 14126 } |
| 14103 } | 14127 } |
| 14104 else if (this.name == 'isEmpty') { | 14128 else if (this.name == 'isEmpty') { |
| 14105 if ((target instanceof ConstListValue) || (target instanceof ConstMapValue
)) { | 14129 if ((target instanceof ConstListValue) || (target instanceof ConstMapValue
)) { |
| 14106 code = ('' + target.get$dynamic().get$values().isEmpty$0()); | 14130 code = ('' + target.get$dynamic().get$values().isEmpty$0()); |
| 14107 } | 14131 } |
| 14108 } | 14132 } |
| 14109 } | 14133 } |
| 14110 if (this.name == 'get\$typeName' && $eq(this.declaringType.get$library(), worl
d.get$dom())) { | 14134 if (this.name == 'get\$typeName' && $eq(this.declaringType.get$library(), $glo
bals.world.get$dom())) { |
| 14111 world.gen.corejs.useTypeNameOf = true; | 14135 $globals.world.gen.corejs.useTypeNameOf = true; |
| 14112 } | 14136 } |
| 14113 return new Value(this.get$inferredResult(), code, node.span, true); | 14137 return new Value(this.get$inferredResult(), code, node.span, true); |
| 14114 } | 14138 } |
| 14115 MethodMember.prototype._invokeConstructor = function(context, node, target, args
, argsString) { | 14139 MethodMember.prototype._invokeConstructor = function(context, node, target, args
, argsString) { |
| 14116 this.declaringType.markUsed(); | 14140 this.declaringType.markUsed(); |
| 14117 if (target != null) { | 14141 if (target != null) { |
| 14118 var code = (this.get$constructorName() != '') ? ('' + this.declaringType.get
$jsname() + '.' + this.get$constructorName() + '\$ctor.call(' + argsString + ')'
) : ('' + this.declaringType.get$jsname() + '.call(' + argsString + ')'); | 14142 var code = (this.get$constructorName() != '') ? ('' + this.declaringType.get
$jsname() + '.' + this.get$constructorName() + '\$ctor.call(' + argsString + ')'
) : ('' + this.declaringType.get$jsname() + '.call(' + argsString + ')'); |
| 14119 return new Value(this.declaringType, code, node.span, true); | 14143 return new Value(this.declaringType, code, node.span, true); |
| 14120 } | 14144 } |
| 14121 else { | 14145 else { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14195 } | 14219 } |
| 14196 this.generator._popBlock(); | 14220 this.generator._popBlock(); |
| 14197 } | 14221 } |
| 14198 var $list = this.declaringType.get$members().getValues(); | 14222 var $list = this.declaringType.get$members().getValues(); |
| 14199 for (var $i = this.declaringType.get$members().getValues().iterator$0(); $i.ha
sNext$0(); ) { | 14223 for (var $i = this.declaringType.get$members().getValues().iterator$0(); $i.ha
sNext$0(); ) { |
| 14200 var f = $i.next$0(); | 14224 var f = $i.next$0(); |
| 14201 if ((f instanceof FieldMember) && !$notnull_bool(f.get$isStatic()) && $notnu
ll_bool($ne(f.get$value(), null)) && !fields.containsKey(f.get$name())) { | 14225 if ((f instanceof FieldMember) && !$notnull_bool(f.get$isStatic()) && $notnu
ll_bool($ne(f.get$value(), null)) && !fields.containsKey(f.get$name())) { |
| 14202 fields.$setindex(f.get$name(), f.computeValue$0()); | 14226 fields.$setindex(f.get$name(), f.computeValue$0()); |
| 14203 } | 14227 } |
| 14204 } | 14228 } |
| 14205 return world.gen.globalForConst(ConstObjectValue.ConstObjectValue$factory(this
.declaringType, fields, code, node.span), args.values); | 14229 return $globals.world.gen.globalForConst(ConstObjectValue.ConstObjectValue$fac
tory(this.declaringType, fields, code, node.span), args.values); |
| 14206 } | 14230 } |
| 14207 MethodMember.prototype._invokeBuiltin = function(context, node, target, args, ar
gsCode, isDynamic) { | 14231 MethodMember.prototype._invokeBuiltin = function(context, node, target, args, ar
gsCode, isDynamic) { |
| 14208 var allConst = $notnull_bool(target.get$isConst()) && args.values.every((funct
ion (arg) { | 14232 var allConst = $notnull_bool(target.get$isConst()) && args.values.every((funct
ion (arg) { |
| 14209 return arg.get$isConst(); | 14233 return arg.get$isConst(); |
| 14210 }) | 14234 }) |
| 14211 ); | 14235 ); |
| 14212 if ($notnull_bool(this.declaringType.get$isNum())) { | 14236 if ($notnull_bool(this.declaringType.get$isNum())) { |
| 14213 if (!$notnull_bool(allConst)) { | 14237 if (!$notnull_bool(allConst)) { |
| 14214 var code; | 14238 var code; |
| 14215 if (this.name == '\$negate') { | 14239 if (this.name == '\$negate') { |
| 14216 code = ('-' + target.code); | 14240 code = ('-' + target.code); |
| 14217 } | 14241 } |
| 14218 else if (this.name == '\$bit_not') { | 14242 else if (this.name == '\$bit_not') { |
| 14219 code = ('~' + target.code); | 14243 code = ('~' + target.code); |
| 14220 } | 14244 } |
| 14221 else if (this.name == '\$truncdiv' || this.name == '\$mod') { | 14245 else if (this.name == '\$truncdiv' || this.name == '\$mod') { |
| 14222 world.gen.corejs.useOperator(this.name); | 14246 $globals.world.gen.corejs.useOperator(this.name); |
| 14223 code = ('' + this.name + '(' + target.code + ', ' + argsCode.$index(0) +
')'); | 14247 code = ('' + this.name + '(' + target.code + ', ' + argsCode.$index(0) +
')'); |
| 14224 } | 14248 } |
| 14225 else { | 14249 else { |
| 14226 var op = TokenKind.rawOperatorFromMethod(this.name); | 14250 var op = TokenKind.rawOperatorFromMethod(this.name); |
| 14227 code = ('' + target.code + ' ' + op + ' ' + argsCode.$index(0)); | 14251 code = ('' + target.code + ' ' + op + ' ' + argsCode.$index(0)); |
| 14228 } | 14252 } |
| 14229 return new Value(this.get$inferredResult(), code, node.span, true); | 14253 return new Value(this.get$inferredResult(), code, node.span, true); |
| 14230 } | 14254 } |
| 14231 else { | 14255 else { |
| 14232 var value; | 14256 var value; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14349 else if (this.name == '\$add') { | 14373 else if (this.name == '\$add') { |
| 14350 if ($notnull_bool(allConst)) { | 14374 if ($notnull_bool(allConst)) { |
| 14351 var val0 = target.get$dynamic().get$actualValue(); | 14375 var val0 = target.get$dynamic().get$actualValue(); |
| 14352 val0 = val0.substring$2(1, val0.length - 1); | 14376 val0 = val0.substring$2(1, val0.length - 1); |
| 14353 var val1 = args.values.$index(0).get$dynamic().get$actualValue(); | 14377 var val1 = args.values.$index(0).get$dynamic().get$actualValue(); |
| 14354 if ($notnull_bool(args.values.$index(0).get$type().get$isString())) { | 14378 if ($notnull_bool(args.values.$index(0).get$type().get$isString())) { |
| 14355 val1 = val1.substring$2(1, val1.length - 1); | 14379 val1 = val1.substring$2(1, val1.length - 1); |
| 14356 } | 14380 } |
| 14357 var value = ('' + val0 + val1); | 14381 var value = ('' + val0 + val1); |
| 14358 value = '"' + value.replaceAll$2('"', '\\"') + '"'; | 14382 value = '"' + value.replaceAll$2('"', '\\"') + '"'; |
| 14359 return EvaluatedValue.EvaluatedValue$factory(world.stringType, value, $a
ssert_String(value), node.span); | 14383 return EvaluatedValue.EvaluatedValue$factory($globals.world.stringType,
value, $assert_String(value), node.span); |
| 14360 } | 14384 } |
| 14361 args.values.$index(0).invoke$4(context, 'toString', node, Arguments.get$EM
PTY()); | 14385 args.values.$index(0).invoke$4(context, 'toString', node, Arguments.get$EM
PTY()); |
| 14362 return new Value(this.declaringType, ('' + target.code + ' + ' + argsCode.
$index(0)), node.span, true); | 14386 return new Value(this.declaringType, ('' + target.code + ' + ' + argsCode.
$index(0)), node.span, true); |
| 14363 } | 14387 } |
| 14364 } | 14388 } |
| 14365 else if ($notnull_bool(this.declaringType.get$isNativeType())) { | 14389 else if ($notnull_bool(this.declaringType.get$isNativeType())) { |
| 14366 if (this.name == '\$index') { | 14390 if (this.name == '\$index') { |
| 14367 return new Value(this.returnType, ('' + target.code + '[' + argsCode.$inde
x(0) + ']'), node.span, true); | 14391 return new Value(this.returnType, ('' + target.code + '[' + argsCode.$inde
x(0) + ']'), node.span, true); |
| 14368 } | 14392 } |
| 14369 else if (this.name == '\$setindex') { | 14393 else if (this.name == '\$setindex') { |
| 14370 return new Value(this.returnType, ('' + target.code + '[' + argsCode.$inde
x(0) + '] = ' + argsCode.$index(1)), node.span, true); | 14394 return new Value(this.returnType, ('' + target.code + '[' + argsCode.$inde
x(0) + '] = ' + argsCode.$index(1)), node.span, true); |
| 14371 } | 14395 } |
| 14372 } | 14396 } |
| 14373 if (this.name == '\$eq' || this.name == '\$ne') { | 14397 if (this.name == '\$eq' || this.name == '\$ne') { |
| 14374 var op = this.name == '\$eq' ? '==' : '!='; | 14398 var op = this.name == '\$eq' ? '==' : '!='; |
| 14375 if (this.name == '\$ne') { | 14399 if (this.name == '\$ne') { |
| 14376 target.invoke(context, '\$eq', node, args, isDynamic); | 14400 target.invoke(context, '\$eq', node, args, isDynamic); |
| 14377 } | 14401 } |
| 14378 if ($notnull_bool(allConst)) { | 14402 if ($notnull_bool(allConst)) { |
| 14379 var val0 = target.get$dynamic().get$actualValue(); | 14403 var val0 = target.get$dynamic().get$actualValue(); |
| 14380 var val1 = args.values.$index(0).get$dynamic().get$actualValue(); | 14404 var val1 = args.values.$index(0).get$dynamic().get$actualValue(); |
| 14381 var newVal = this.name == '\$eq' ? $eq(val0, val1) : $ne(val0, val1); | 14405 var newVal = this.name == '\$eq' ? $eq(val0, val1) : $ne(val0, val1); |
| 14382 return EvaluatedValue.EvaluatedValue$factory(world.nonNullBool, newVal, ("
" + newVal), node.span); | 14406 return EvaluatedValue.EvaluatedValue$factory($globals.world.nonNullBool, n
ewVal, ("" + newVal), node.span); |
| 14383 } | 14407 } |
| 14384 if ($notnull_bool($eq(argsCode.$index(0), 'null'))) { | 14408 if ($notnull_bool($eq(argsCode.$index(0), 'null'))) { |
| 14385 return new Value(this.get$inferredResult(), ('' + target.code + ' ' + op +
' null'), node.span, true); | 14409 return new Value(this.get$inferredResult(), ('' + target.code + ' ' + op +
' null'), node.span, true); |
| 14386 } | 14410 } |
| 14387 else if ($notnull_bool(target.type.get$isNum()) || $notnull_bool(target.type
.get$isString())) { | 14411 else if ($notnull_bool(target.type.get$isNum()) || $notnull_bool(target.type
.get$isString())) { |
| 14388 return new Value(this.get$inferredResult(), ('' + target.code + ' ' + op +
' ' + argsCode.$index(0)), node.span, true); | 14412 return new Value(this.get$inferredResult(), ('' + target.code + ' ' + op +
' ' + argsCode.$index(0)), node.span, true); |
| 14389 } | 14413 } |
| 14390 world.gen.corejs.useOperator(this.name); | 14414 $globals.world.gen.corejs.useOperator(this.name); |
| 14391 return new Value(this.get$inferredResult(), ('' + this.name + '(' + target.c
ode + ', ' + argsCode.$index(0) + ')'), node.span, true); | 14415 return new Value(this.get$inferredResult(), ('' + this.name + '(' + target.c
ode + ', ' + argsCode.$index(0) + ')'), node.span, true); |
| 14392 } | 14416 } |
| 14393 if ($notnull_bool(this.get$isCallMethod())) { | 14417 if ($notnull_bool(this.get$isCallMethod())) { |
| 14394 this.declaringType.markUsed(); | 14418 this.declaringType.markUsed(); |
| 14395 return new Value(this.get$inferredResult(), ('' + target.code + '(' + String
s.join((argsCode && argsCode.is$List$String()), ", ") + ')'), node.span, true); | 14419 return new Value(this.get$inferredResult(), ('' + target.code + '(' + String
s.join((argsCode && argsCode.is$List$String()), ", ") + ')'), node.span, true); |
| 14396 } | 14420 } |
| 14397 if (this.name == '\$index') { | 14421 if (this.name == '\$index') { |
| 14398 world.gen.corejs.useIndex = true; | 14422 $globals.world.gen.corejs.useIndex = true; |
| 14399 } | 14423 } |
| 14400 else if (this.name == '\$setindex') { | 14424 else if (this.name == '\$setindex') { |
| 14401 world.gen.corejs.useSetIndex = true; | 14425 $globals.world.gen.corejs.useSetIndex = true; |
| 14402 } | 14426 } |
| 14403 var argsString = Strings.join((argsCode && argsCode.is$List$String()), ', '); | 14427 var argsString = Strings.join((argsCode && argsCode.is$List$String()), ', '); |
| 14404 return new Value(this.get$inferredResult(), ('' + target.code + '.' + this.get
$jsname() + '(' + argsString + ')'), node.span, true); | 14428 return new Value(this.get$inferredResult(), ('' + target.code + '.' + this.get
$jsname() + '(' + argsString + ')'), node.span, true); |
| 14405 } | 14429 } |
| 14406 MethodMember.prototype.resolve = function(inType) { | 14430 MethodMember.prototype.resolve = function(inType) { |
| 14407 var $0; | 14431 var $0; |
| 14408 this.isStatic = inType.get$isTop(); | 14432 this.isStatic = inType.get$isTop(); |
| 14409 this.isConst = false; | 14433 this.isConst = false; |
| 14410 this.isFactory = false; | 14434 this.isFactory = false; |
| 14411 this.isAbstract = !$notnull_bool(this.declaringType.get$isClass()); | 14435 this.isAbstract = !$notnull_bool(this.declaringType.get$isClass()); |
| 14412 if (this.definition.modifiers != null) { | 14436 if (this.definition.modifiers != null) { |
| 14413 var $list = this.definition.modifiers; | 14437 var $list = this.definition.modifiers; |
| 14414 for (var $i = 0;$i < $list.length; $i++) { | 14438 for (var $i = 0;$i < $list.length; $i++) { |
| 14415 var mod = $list.$index($i); | 14439 var mod = $list.$index($i); |
| 14416 if ($notnull_bool($eq(mod.get$kind(), 86/*TokenKind.STATIC*/))) { | 14440 if ($notnull_bool($eq(mod.get$kind(), 86/*TokenKind.STATIC*/))) { |
| 14417 if ($notnull_bool(this.isStatic)) { | 14441 if ($notnull_bool(this.isStatic)) { |
| 14418 world.error('duplicate static modifier', (($0 = mod.get$span()) && $0.
is$SourceSpan())); | 14442 $globals.world.error('duplicate static modifier', (($0 = mod.get$span(
)) && $0.is$SourceSpan())); |
| 14419 } | 14443 } |
| 14420 this.isStatic = true; | 14444 this.isStatic = true; |
| 14421 } | 14445 } |
| 14422 else if ($notnull_bool(this.get$isConstructor()) && $notnull_bool($eq(mod.
get$kind(), 91/*TokenKind.CONST*/))) { | 14446 else if ($notnull_bool(this.get$isConstructor()) && $notnull_bool($eq(mod.
get$kind(), 91/*TokenKind.CONST*/))) { |
| 14423 if ($notnull_bool(this.isConst)) { | 14447 if ($notnull_bool(this.isConst)) { |
| 14424 world.error('duplicate const modifier', (($0 = mod.get$span()) && $0.i
s$SourceSpan())); | 14448 $globals.world.error('duplicate const modifier', (($0 = mod.get$span()
) && $0.is$SourceSpan())); |
| 14425 } | 14449 } |
| 14426 this.isConst = true; | 14450 this.isConst = true; |
| 14427 } | 14451 } |
| 14428 else if ($notnull_bool($eq(mod.get$kind(), 75/*TokenKind.FACTORY*/))) { | 14452 else if ($notnull_bool($eq(mod.get$kind(), 75/*TokenKind.FACTORY*/))) { |
| 14429 if ($notnull_bool(this.isFactory)) { | 14453 if ($notnull_bool(this.isFactory)) { |
| 14430 world.error('duplicate factory modifier', (($0 = mod.get$span()) && $0
.is$SourceSpan())); | 14454 $globals.world.error('duplicate factory modifier', (($0 = mod.get$span
()) && $0.is$SourceSpan())); |
| 14431 } | 14455 } |
| 14432 this.isFactory = true; | 14456 this.isFactory = true; |
| 14433 } | 14457 } |
| 14434 else if ($notnull_bool($eq(mod.get$kind(), 71/*TokenKind.ABSTRACT*/))) { | 14458 else if ($notnull_bool($eq(mod.get$kind(), 71/*TokenKind.ABSTRACT*/))) { |
| 14435 if ($notnull_bool(this.isAbstract)) { | 14459 if ($notnull_bool(this.isAbstract)) { |
| 14436 if ($notnull_bool(this.declaringType.get$isClass())) { | 14460 if ($notnull_bool(this.declaringType.get$isClass())) { |
| 14437 world.error('duplicate abstract modifier', (($0 = mod.get$span()) &&
$0.is$SourceSpan())); | 14461 $globals.world.error('duplicate abstract modifier', (($0 = mod.get$s
pan()) && $0.is$SourceSpan())); |
| 14438 } | 14462 } |
| 14439 else { | 14463 else { |
| 14440 world.error('abstract modifier not allowed on interface members', ((
$0 = mod.get$span()) && $0.is$SourceSpan())); | 14464 $globals.world.error('abstract modifier not allowed on interface mem
bers', (($0 = mod.get$span()) && $0.is$SourceSpan())); |
| 14441 } | 14465 } |
| 14442 } | 14466 } |
| 14443 this.isAbstract = true; | 14467 this.isAbstract = true; |
| 14444 } | 14468 } |
| 14445 else { | 14469 else { |
| 14446 world.error(('' + mod + ' modifier not allowed on method'), (($0 = mod.g
et$span()) && $0.is$SourceSpan())); | 14470 $globals.world.error(('' + mod + ' modifier not allowed on method'), (($
0 = mod.get$span()) && $0.is$SourceSpan())); |
| 14447 } | 14471 } |
| 14448 } | 14472 } |
| 14449 } | 14473 } |
| 14450 if ($notnull_bool(this.isFactory)) { | 14474 if ($notnull_bool(this.isFactory)) { |
| 14451 this.isStatic = true; | 14475 this.isStatic = true; |
| 14452 } | 14476 } |
| 14453 if ($notnull_bool(this.get$isOperator()) && $notnull_bool(this.isStatic) && !$
notnull_bool(this.get$isCallMethod())) { | 14477 if ($notnull_bool(this.get$isOperator()) && $notnull_bool(this.isStatic) && !$
notnull_bool(this.get$isCallMethod())) { |
| 14454 world.error(('operator method may not be static "' + this.name + '"'), this.
get$span()); | 14478 $globals.world.error(('operator method may not be static "' + this.name + '"
'), this.get$span()); |
| 14455 } | 14479 } |
| 14456 if ($notnull_bool(this.isAbstract)) { | 14480 if ($notnull_bool(this.isAbstract)) { |
| 14457 if (this.definition.body != null && !(this.declaringType.get$definition() in
stanceof FunctionTypeDefinition)) { | 14481 if (this.definition.body != null && !(this.declaringType.get$definition() in
stanceof FunctionTypeDefinition)) { |
| 14458 world.error('abstract method can not have a body', this.get$span()); | 14482 $globals.world.error('abstract method can not have a body', this.get$span(
)); |
| 14459 } | 14483 } |
| 14460 if ($notnull_bool(this.isStatic) && !(this.declaringType.get$definition() in
stanceof FunctionTypeDefinition)) { | 14484 if ($notnull_bool(this.isStatic) && !(this.declaringType.get$definition() in
stanceof FunctionTypeDefinition)) { |
| 14461 world.error('static method can not be abstract', this.get$span()); | 14485 $globals.world.error('static method can not be abstract', this.get$span())
; |
| 14462 } | 14486 } |
| 14463 } | 14487 } |
| 14464 else { | 14488 else { |
| 14465 if (this.definition.body == null && !$notnull_bool(this.get$isConstructor())
) { | 14489 if (this.definition.body == null && !$notnull_bool(this.get$isConstructor())
) { |
| 14466 world.error('method needs a body', this.get$span()); | 14490 $globals.world.error('method needs a body', this.get$span()); |
| 14467 } | 14491 } |
| 14468 } | 14492 } |
| 14469 if ($notnull_bool(this.get$isConstructor())) { | 14493 if ($notnull_bool(this.get$isConstructor())) { |
| 14470 this.returnType = this.declaringType; | 14494 this.returnType = this.declaringType; |
| 14471 } | 14495 } |
| 14472 else { | 14496 else { |
| 14473 this.returnType = inType.resolveType(this.definition.returnType, false); | 14497 this.returnType = inType.resolveType(this.definition.returnType, false); |
| 14474 if ($notnull_bool(this.isStatic) && $notnull_bool(this.returnType.get$hasTyp
eParams())) { | 14498 if ($notnull_bool(this.isStatic) && $notnull_bool(this.returnType.get$hasTyp
eParams())) { |
| 14475 world.error('using type parameter in static context', this.definition.retu
rnType.span); | 14499 $globals.world.error('using type parameter in static context', this.defini
tion.returnType.span); |
| 14476 } | 14500 } |
| 14477 } | 14501 } |
| 14478 this.parameters = []; | 14502 this.parameters = []; |
| 14479 var $list = this.definition.formals; | 14503 var $list = this.definition.formals; |
| 14480 for (var $i = 0;$i < $list.length; $i++) { | 14504 for (var $i = 0;$i < $list.length; $i++) { |
| 14481 var formal = $list.$index($i); | 14505 var formal = $list.$index($i); |
| 14482 var param = new Parameter(formal); | 14506 var param = new Parameter(formal); |
| 14483 param.resolve$2(this, inType); | 14507 param.resolve$2(this, inType); |
| 14484 this.parameters.add(param); | 14508 this.parameters.add(param); |
| 14485 } | 14509 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14575 return $assert_bool(this.members.$index(0).get$isOperator()); | 14599 return $assert_bool(this.members.$index(0).get$isOperator()); |
| 14576 } | 14600 } |
| 14577 MemberSet.prototype.canInvoke = function(context, args) { | 14601 MemberSet.prototype.canInvoke = function(context, args) { |
| 14578 return this.members.some((function (m) { | 14602 return this.members.some((function (m) { |
| 14579 return m.canInvoke$2(context, args); | 14603 return m.canInvoke$2(context, args); |
| 14580 }) | 14604 }) |
| 14581 ); | 14605 ); |
| 14582 } | 14606 } |
| 14583 MemberSet.prototype._makeError = function(node, target, action) { | 14607 MemberSet.prototype._makeError = function(node, target, action) { |
| 14584 if (!$notnull_bool(target.type.get$isVar())) { | 14608 if (!$notnull_bool(target.type.get$isVar())) { |
| 14585 world.warning(('could not find applicable ' + action + ' for "' + this.name
+ '"'), node.span); | 14609 $globals.world.warning(('could not find applicable ' + action + ' for "' + t
his.name + '"'), node.span); |
| 14586 } | 14610 } |
| 14587 return new Value(world.varType, ('' + target.code + '.' + this.jsname + '() /*
no applicable ' + action + '*/'), node.span, true); | 14611 return new Value($globals.world.varType, ('' + target.code + '.' + this.jsname
+ '() /*no applicable ' + action + '*/'), node.span, true); |
| 14588 } | 14612 } |
| 14589 MemberSet.prototype.get$treatAsField = function() { | 14613 MemberSet.prototype.get$treatAsField = function() { |
| 14590 if (this._treatAsField == null) { | 14614 if (this._treatAsField == null) { |
| 14591 this._treatAsField = !$notnull_bool(this.isVar); | 14615 this._treatAsField = !$notnull_bool(this.isVar); |
| 14592 var $list = this.members; | 14616 var $list = this.members; |
| 14593 for (var $i = 0;$i < $list.length; $i++) { | 14617 for (var $i = 0;$i < $list.length; $i++) { |
| 14594 var member = $list.$index($i); | 14618 var member = $list.$index($i); |
| 14595 if ($notnull_bool(member.get$requiresFieldSyntax())) { | 14619 if ($notnull_bool(member.get$requiresFieldSyntax())) { |
| 14596 this._treatAsField = true; | 14620 this._treatAsField = true; |
| 14597 break; | 14621 break; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14734 return (($0 = member.invoke$4(context, node, target, args)) && $0.is$Value()); | 14758 return (($0 = member.invoke$4(context, node, target, args)) && $0.is$Value()); |
| 14735 } | 14759 } |
| 14736 MemberSet.prototype._tryUnion = function(x, y, node) { | 14760 MemberSet.prototype._tryUnion = function(x, y, node) { |
| 14737 if (x == null) return y; | 14761 if (x == null) return y; |
| 14738 var type = lang_Type.union(x.type, y.type); | 14762 var type = lang_Type.union(x.type, y.type); |
| 14739 if (x.code == y.code) { | 14763 if (x.code == y.code) { |
| 14740 if ($notnull_bool($eq(type, x.type))) { | 14764 if ($notnull_bool($eq(type, x.type))) { |
| 14741 return x; | 14765 return x; |
| 14742 } | 14766 } |
| 14743 else if ($notnull_bool(x.get$isConst()) || $notnull_bool(y.get$isConst())) { | 14767 else if ($notnull_bool(x.get$isConst()) || $notnull_bool(y.get$isConst())) { |
| 14744 world.internalError("unexpected: union of const values "); | 14768 $globals.world.internalError("unexpected: union of const values "); |
| 14745 } | 14769 } |
| 14746 else { | 14770 else { |
| 14747 var ret = new Value(type, x.code, node.span, true); | 14771 var ret = new Value(type, x.code, node.span, true); |
| 14748 ret.set$isSuper($notnull_bool(x.isSuper) && $notnull_bool(y.isSuper)); | 14772 ret.set$isSuper($notnull_bool(x.isSuper) && $notnull_bool(y.isSuper)); |
| 14749 ret.set$needsTemp($notnull_bool(x.needsTemp) || $notnull_bool(y.needsTemp)
); | 14773 ret.set$needsTemp($notnull_bool(x.needsTemp) || $notnull_bool(y.needsTemp)
); |
| 14750 ret.set$isType($notnull_bool(x.isType) && $notnull_bool(y.isType)); | 14774 ret.set$isType($notnull_bool(x.isType) && $notnull_bool(y.isType)); |
| 14751 return (ret && ret.is$Value()); | 14775 return (ret && ret.is$Value()); |
| 14752 } | 14776 } |
| 14753 } | 14777 } |
| 14754 else { | 14778 else { |
| 14755 return new Value(type, null, node.span, true); | 14779 return new Value(type, null, node.span, true); |
| 14756 } | 14780 } |
| 14757 } | 14781 } |
| 14758 MemberSet.prototype.getVarMember = function(context, node, args) { | 14782 MemberSet.prototype.getVarMember = function(context, node, args) { |
| 14759 if (world.objectType.varStubs == null) { | 14783 if ($globals.world.objectType.varStubs == null) { |
| 14760 world.objectType.varStubs = $map([]); | 14784 $globals.world.objectType.varStubs = $map([]); |
| 14761 } | 14785 } |
| 14762 var stubName = _getCallStubName(this.name, args); | 14786 var stubName = _getCallStubName(this.name, args); |
| 14763 var stub = world.objectType.varStubs.$index(stubName); | 14787 var stub = $globals.world.objectType.varStubs.$index(stubName); |
| 14764 if ($notnull_bool(stub == null)) { | 14788 if ($notnull_bool(stub == null)) { |
| 14765 var mset = context.findMembers(this.name).members; | 14789 var mset = context.findMembers(this.name).members; |
| 14766 var targets = mset.filter((function (m) { | 14790 var targets = mset.filter((function (m) { |
| 14767 return m.canInvoke$2(context, args); | 14791 return m.canInvoke$2(context, args); |
| 14768 }) | 14792 }) |
| 14769 ); | 14793 ); |
| 14770 stub = new VarMethodSet($assert_String(stubName), targets, args, this._foldT
ypes((targets && targets.is$List$Member()))); | 14794 stub = new VarMethodSet($assert_String(stubName), targets, args, this._foldT
ypes((targets && targets.is$List$Member()))); |
| 14771 world.objectType.varStubs.$setindex(stubName, stub); | 14795 $globals.world.objectType.varStubs.$setindex(stubName, stub); |
| 14772 } | 14796 } |
| 14773 return (stub && stub.is$VarMember()); | 14797 return (stub && stub.is$VarMember()); |
| 14774 } | 14798 } |
| 14775 MemberSet.prototype._foldTypes = function(targets) { | 14799 MemberSet.prototype._foldTypes = function(targets) { |
| 14776 var $0; | 14800 var $0; |
| 14777 return (($0 = reduce(map(targets, (function (t) { | 14801 return (($0 = reduce(map(targets, (function (t) { |
| 14778 return t.get$returnType(); | 14802 return t.get$returnType(); |
| 14779 }) | 14803 }) |
| 14780 ), lang_Type.union, world.varType)) && $0.is$lang_Type()); | 14804 ), lang_Type.union, $globals.world.varType)) && $0.is$lang_Type()); |
| 14781 } | 14805 } |
| 14782 MemberSet.prototype._get$3 = function($0, $1, $2) { | 14806 MemberSet.prototype._get$3 = function($0, $1, $2) { |
| 14783 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), false); | 14807 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), false); |
| 14784 }; | 14808 }; |
| 14785 MemberSet.prototype._set$4 = function($0, $1, $2, $3) { | 14809 MemberSet.prototype._set$4 = function($0, $1, $2, $3) { |
| 14786 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value()), false); | 14810 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value()), false); |
| 14787 }; | 14811 }; |
| 14788 MemberSet.prototype.add$1 = function($0) { | 14812 MemberSet.prototype.add$1 = function($0) { |
| 14789 return this.add(($0 && $0.is$Member())); | 14813 return this.add(($0 && $0.is$Member())); |
| 14790 }; | 14814 }; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14897 this._lineStarts = (starts && starts.is$List$int()); | 14921 this._lineStarts = (starts && starts.is$List$int()); |
| 14898 } | 14922 } |
| 14899 return this._lineStarts; | 14923 return this._lineStarts; |
| 14900 } | 14924 } |
| 14901 SourceFile.prototype.getLine = function(position) { | 14925 SourceFile.prototype.getLine = function(position) { |
| 14902 var starts = this.get$lineStarts(); | 14926 var starts = this.get$lineStarts(); |
| 14903 for (var i = 0; | 14927 for (var i = 0; |
| 14904 i < $assert_num(starts.length); i++) { | 14928 i < $assert_num(starts.length); i++) { |
| 14905 if (starts.$index(i) > position) return i - 1; | 14929 if (starts.$index(i) > position) return i - 1; |
| 14906 } | 14930 } |
| 14907 world.internalError('bad position'); | 14931 $globals.world.internalError('bad position'); |
| 14908 } | 14932 } |
| 14909 SourceFile.prototype.getColumn = function(line, position) { | 14933 SourceFile.prototype.getColumn = function(line, position) { |
| 14910 return position - $assert_num(this.get$lineStarts().$index(line)); | 14934 return position - $assert_num(this.get$lineStarts().$index(line)); |
| 14911 } | 14935 } |
| 14912 SourceFile.prototype.getLocationMessage = function(message, start, end, includeT
ext) { | 14936 SourceFile.prototype.getLocationMessage = function(message, start, end, includeT
ext) { |
| 14913 var line = this.getLine(start); | 14937 var line = this.getLine(start); |
| 14914 var column = this.getColumn($assert_num(line), start); | 14938 var column = this.getColumn($assert_num(line), start); |
| 14915 var buf = new StringBufferImpl(('' + this.filename + ':' + (line + 1) + ':' +
(column + 1) + ': ' + message)); | 14939 var buf = new StringBufferImpl(('' + this.filename + ':' + (line + 1) + ':' +
(column + 1) + ': ' + message)); |
| 14916 if ($notnull_bool(includeText)) { | 14940 if ($notnull_bool(includeText)) { |
| 14917 buf.add$1('\n'); | 14941 buf.add$1('\n'); |
| (...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16774 var $0; | 16798 var $0; |
| 16775 if ($notnull_bool(this.throwOnIncomplete)) this.isPrematureEndOfFile(); | 16799 if ($notnull_bool(this.throwOnIncomplete)) this.isPrematureEndOfFile(); |
| 16776 var tok = this._lang_next(); | 16800 var tok = this._lang_next(); |
| 16777 var message = ('expected ' + expected + ', but found ' + tok); | 16801 var message = ('expected ' + expected + ', but found ' + tok); |
| 16778 this._lang_error($assert_String(message), (($0 = tok.get$span()) && $0.is$Sour
ceSpan())); | 16802 this._lang_error($assert_String(message), (($0 = tok.get$span()) && $0.is$Sour
ceSpan())); |
| 16779 } | 16803 } |
| 16780 lang_Parser.prototype._lang_error = function(message, location) { | 16804 lang_Parser.prototype._lang_error = function(message, location) { |
| 16781 if (location == null) { | 16805 if (location == null) { |
| 16782 location = this._peekToken.get$span(); | 16806 location = this._peekToken.get$span(); |
| 16783 } | 16807 } |
| 16784 world.fatal(message, location); | 16808 $globals.world.fatal(message, location); |
| 16785 } | 16809 } |
| 16786 lang_Parser.prototype._skipBlock = function() { | 16810 lang_Parser.prototype._skipBlock = function() { |
| 16787 var $0; | 16811 var $0; |
| 16788 var depth = 1; | 16812 var depth = 1; |
| 16789 this._eat(6/*TokenKind.LBRACE*/); | 16813 this._eat(6/*TokenKind.LBRACE*/); |
| 16790 while (true) { | 16814 while (true) { |
| 16791 var tok = this._lang_next(); | 16815 var tok = this._lang_next(); |
| 16792 if ($notnull_bool($eq(tok.get$kind(), 6/*TokenKind.LBRACE*/))) { | 16816 if ($notnull_bool($eq(tok.get$kind(), 6/*TokenKind.LBRACE*/))) { |
| 16793 depth += 1; | 16817 depth += 1; |
| 16794 } | 16818 } |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17560 else { | 17584 else { |
| 17561 return expr; | 17585 return expr; |
| 17562 } | 17586 } |
| 17563 | 17587 |
| 17564 } | 17588 } |
| 17565 } | 17589 } |
| 17566 lang_Parser.prototype._isBin = function(expr, kind) { | 17590 lang_Parser.prototype._isBin = function(expr, kind) { |
| 17567 return (expr instanceof BinaryExpression) && $notnull_bool($eq(expr.get$op().g
et$kind(), kind)); | 17591 return (expr instanceof BinaryExpression) && $notnull_bool($eq(expr.get$op().g
et$kind(), kind)); |
| 17568 } | 17592 } |
| 17569 lang_Parser.prototype._boolTypeRef = function(span) { | 17593 lang_Parser.prototype._boolTypeRef = function(span) { |
| 17570 return new TypeReference(span, world.nonNullBool); | 17594 return new TypeReference(span, $globals.world.nonNullBool); |
| 17571 } | 17595 } |
| 17572 lang_Parser.prototype._intTypeRef = function(span) { | 17596 lang_Parser.prototype._intTypeRef = function(span) { |
| 17573 return new TypeReference(span, world.intType); | 17597 return new TypeReference(span, $globals.world.intType); |
| 17574 } | 17598 } |
| 17575 lang_Parser.prototype._doubleTypeRef = function(span) { | 17599 lang_Parser.prototype._doubleTypeRef = function(span) { |
| 17576 return new TypeReference(span, world.doubleType); | 17600 return new TypeReference(span, $globals.world.doubleType); |
| 17577 } | 17601 } |
| 17578 lang_Parser.prototype._stringTypeRef = function(span) { | 17602 lang_Parser.prototype._stringTypeRef = function(span) { |
| 17579 return new TypeReference(span, world.stringType); | 17603 return new TypeReference(span, $globals.world.stringType); |
| 17580 } | 17604 } |
| 17581 lang_Parser.prototype.primary = function() { | 17605 lang_Parser.prototype.primary = function() { |
| 17582 var start = this._peekToken.start; | 17606 var start = this._peekToken.start; |
| 17583 switch (this._peek()) { | 17607 switch (this._peek()) { |
| 17584 case 108/*TokenKind.THIS*/: | 17608 case 108/*TokenKind.THIS*/: |
| 17585 | 17609 |
| 17586 this._eat(108/*TokenKind.THIS*/); | 17610 this._eat(108/*TokenKind.THIS*/); |
| 17587 return new ThisExpression(this._makeSpan(start)); | 17611 return new ThisExpression(this._makeSpan(start)); |
| 17588 | 17612 |
| 17589 case 106/*TokenKind.SUPER*/: | 17613 case 106/*TokenKind.SUPER*/: |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18040 } | 18064 } |
| 18041 lang_Parser.prototype.type = function(depth) { | 18065 lang_Parser.prototype.type = function(depth) { |
| 18042 var start = this._peekToken.start; | 18066 var start = this._peekToken.start; |
| 18043 var name; | 18067 var name; |
| 18044 var names = null; | 18068 var names = null; |
| 18045 var typeArgs = null; | 18069 var typeArgs = null; |
| 18046 var isFinal = false; | 18070 var isFinal = false; |
| 18047 switch (this._peek()) { | 18071 switch (this._peek()) { |
| 18048 case 113/*TokenKind.VOID*/: | 18072 case 113/*TokenKind.VOID*/: |
| 18049 | 18073 |
| 18050 return new TypeReference(this._lang_next().get$span(), world.voidType); | 18074 return new TypeReference(this._lang_next().get$span(), $globals.world.void
Type); |
| 18051 | 18075 |
| 18052 case 112/*TokenKind.VAR*/: | 18076 case 112/*TokenKind.VAR*/: |
| 18053 | 18077 |
| 18054 return new TypeReference(this._lang_next().get$span(), world.varType); | 18078 return new TypeReference(this._lang_next().get$span(), $globals.world.varT
ype); |
| 18055 | 18079 |
| 18056 case 97/*TokenKind.FINAL*/: | 18080 case 97/*TokenKind.FINAL*/: |
| 18057 | 18081 |
| 18058 this._eat(97/*TokenKind.FINAL*/); | 18082 this._eat(97/*TokenKind.FINAL*/); |
| 18059 isFinal = true; | 18083 isFinal = true; |
| 18060 name = this.identifier(); | 18084 name = this.identifier(); |
| 18061 break; | 18085 break; |
| 18062 | 18086 |
| 18063 default: | 18087 default: |
| 18064 | 18088 |
| (...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19368 lang_Type.prototype.getAllMembers = function() { | 19392 lang_Type.prototype.getAllMembers = function() { |
| 19369 return $map([]); | 19393 return $map([]); |
| 19370 } | 19394 } |
| 19371 lang_Type.prototype.hashCode = function() { | 19395 lang_Type.prototype.hashCode = function() { |
| 19372 return this.name.hashCode(); | 19396 return this.name.hashCode(); |
| 19373 } | 19397 } |
| 19374 lang_Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) { | 19398 lang_Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) { |
| 19375 if (!$notnull_bool(this.isSubtypeOf(other))) { | 19399 if (!$notnull_bool(this.isSubtypeOf(other))) { |
| 19376 var msg = ('type ' + this.name + ' is not a subtype of ' + other.name); | 19400 var msg = ('type ' + this.name + ' is not a subtype of ' + other.name); |
| 19377 if ($notnull_bool(typeErrors)) { | 19401 if ($notnull_bool(typeErrors)) { |
| 19378 world.error($assert_String(msg), span); | 19402 $globals.world.error($assert_String(msg), span); |
| 19379 } | 19403 } |
| 19380 else { | 19404 else { |
| 19381 world.warning($assert_String(msg), span); | 19405 $globals.world.warning($assert_String(msg), span); |
| 19382 } | 19406 } |
| 19383 } | 19407 } |
| 19384 } | 19408 } |
| 19385 lang_Type.prototype.needsVarCall = function(args) { | 19409 lang_Type.prototype.needsVarCall = function(args) { |
| 19386 if ($notnull_bool(this.get$isVarOrFunction())) { | 19410 if ($notnull_bool(this.get$isVarOrFunction())) { |
| 19387 return true; | 19411 return true; |
| 19388 } | 19412 } |
| 19389 var call = this.getCallMethod(); | 19413 var call = this.getCallMethod(); |
| 19390 if ($notnull_bool($ne(call, null))) { | 19414 if ($notnull_bool($ne(call, null))) { |
| 19391 if (args.get$length() != call.get$parameters().length || !$notnull_bool(call
.namesInOrder$1(args))) { | 19415 if (args.get$length() != call.get$parameters().length || !$notnull_bool(call
.namesInOrder$1(args))) { |
| 19392 return true; | 19416 return true; |
| 19393 } | 19417 } |
| 19394 } | 19418 } |
| 19395 return false; | 19419 return false; |
| 19396 } | 19420 } |
| 19397 lang_Type.union = function(x, y) { | 19421 lang_Type.union = function(x, y) { |
| 19398 if ($eq(x, y)) return x; | 19422 if ($eq(x, y)) return x; |
| 19399 if ($notnull_bool(x.get$isNum()) && $notnull_bool(y.get$isNum())) return world
.numType; | 19423 if ($notnull_bool(x.get$isNum()) && $notnull_bool(y.get$isNum())) return $glob
als.world.numType; |
| 19400 if ($notnull_bool(x.get$isString()) && $notnull_bool(y.get$isString())) return
world.stringType; | 19424 if ($notnull_bool(x.get$isString()) && $notnull_bool(y.get$isString())) return
$globals.world.stringType; |
| 19401 return world.varType; | 19425 return $globals.world.varType; |
| 19402 } | 19426 } |
| 19403 lang_Type.prototype.isAssignable = function(other) { | 19427 lang_Type.prototype.isAssignable = function(other) { |
| 19404 return $notnull_bool(this.isSubtypeOf(other)) || $notnull_bool(other.isSubtype
Of(this)); | 19428 return $notnull_bool(this.isSubtypeOf(other)) || $notnull_bool(other.isSubtype
Of(this)); |
| 19405 } | 19429 } |
| 19406 lang_Type.prototype._isDirectSupertypeOf = function(other) { | 19430 lang_Type.prototype._isDirectSupertypeOf = function(other) { |
| 19407 var $this = this; // closure support | 19431 var $this = this; // closure support |
| 19408 if ($notnull_bool(other.get$isClass())) { | 19432 if ($notnull_bool(other.get$isClass())) { |
| 19409 return $eq(other.get$parent(), this) || $notnull_bool(this.get$isObject()) &
& other.get$parent() == null; | 19433 return $eq(other.get$parent(), this) || $notnull_bool(this.get$isObject()) &
& other.get$parent() == null; |
| 19410 } | 19434 } |
| 19411 else { | 19435 else { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19517 ParameterType.prototype.get$isClass = function() { | 19541 ParameterType.prototype.get$isClass = function() { |
| 19518 return false; | 19542 return false; |
| 19519 } | 19543 } |
| 19520 ParameterType.prototype.get$library = function() { | 19544 ParameterType.prototype.get$library = function() { |
| 19521 return null; | 19545 return null; |
| 19522 } | 19546 } |
| 19523 ParameterType.prototype.get$span = function() { | 19547 ParameterType.prototype.get$span = function() { |
| 19524 return this.typeParameter.span; | 19548 return this.typeParameter.span; |
| 19525 } | 19549 } |
| 19526 ParameterType.prototype.get$constructors = function() { | 19550 ParameterType.prototype.get$constructors = function() { |
| 19527 world.internalError('no constructors on type parameters yet'); | 19551 $globals.world.internalError('no constructors on type parameters yet'); |
| 19528 } | 19552 } |
| 19529 ParameterType.prototype.getCallMethod = function() { | 19553 ParameterType.prototype.getCallMethod = function() { |
| 19530 return this.extendsType.getCallMethod(); | 19554 return this.extendsType.getCallMethod(); |
| 19531 } | 19555 } |
| 19532 ParameterType.prototype.genMethod = function(method) { | 19556 ParameterType.prototype.genMethod = function(method) { |
| 19533 this.extendsType.genMethod(method); | 19557 this.extendsType.genMethod(method); |
| 19534 } | 19558 } |
| 19535 ParameterType.prototype.isSubtypeOf = function(other) { | 19559 ParameterType.prototype.isSubtypeOf = function(other) { |
| 19536 return true; | 19560 return true; |
| 19537 } | 19561 } |
| 19538 ParameterType.prototype.resolveMember = function(memberName) { | 19562 ParameterType.prototype.resolveMember = function(memberName) { |
| 19539 return this.extendsType.resolveMember(memberName); | 19563 return this.extendsType.resolveMember(memberName); |
| 19540 } | 19564 } |
| 19541 ParameterType.prototype.getConstructor = function(constructorName) { | 19565 ParameterType.prototype.getConstructor = function(constructorName) { |
| 19542 world.internalError('no constructors on type parameters yet'); | 19566 $globals.world.internalError('no constructors on type parameters yet'); |
| 19543 } | 19567 } |
| 19544 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) { | 19568 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| 19545 world.internalError('no concrete types of type parameters yet', this.get$span(
)); | 19569 $globals.world.internalError('no concrete types of type parameters yet', this.
get$span()); |
| 19546 } | 19570 } |
| 19547 ParameterType.prototype.resolveTypeParams = function(inType) { | 19571 ParameterType.prototype.resolveTypeParams = function(inType) { |
| 19548 var $0; | 19572 var $0; |
| 19549 return (($0 = inType.typeArguments.$index(this.name)) && $0.is$lang_Type()); | 19573 return (($0 = inType.typeArguments.$index(this.name)) && $0.is$lang_Type()); |
| 19550 } | 19574 } |
| 19551 ParameterType.prototype.addDirectSubtype = function(type) { | 19575 ParameterType.prototype.addDirectSubtype = function(type) { |
| 19552 world.internalError('no subtypes of type parameters yet', this.get$span()); | 19576 $globals.world.internalError('no subtypes of type parameters yet', this.get$sp
an()); |
| 19553 } | 19577 } |
| 19554 ParameterType.prototype.resolve = function(inType) { | 19578 ParameterType.prototype.resolve = function(inType) { |
| 19555 if (this.typeParameter.extendsType != null) { | 19579 if (this.typeParameter.extendsType != null) { |
| 19556 this.extendsType = inType.resolveType(this.typeParameter.extendsType, true); | 19580 this.extendsType = inType.resolveType(this.typeParameter.extendsType, true); |
| 19557 } | 19581 } |
| 19558 else { | 19582 else { |
| 19559 this.extendsType = world.objectType; | 19583 this.extendsType = $globals.world.objectType; |
| 19560 } | 19584 } |
| 19561 } | 19585 } |
| 19562 ParameterType.prototype.addDirectSubtype$1 = function($0) { | 19586 ParameterType.prototype.addDirectSubtype$1 = function($0) { |
| 19563 return this.addDirectSubtype(($0 && $0.is$lang_Type())); | 19587 return this.addDirectSubtype(($0 && $0.is$lang_Type())); |
| 19564 }; | 19588 }; |
| 19565 ParameterType.prototype.getConstructor$1 = function($0) { | 19589 ParameterType.prototype.getConstructor$1 = function($0) { |
| 19566 return this.getConstructor($assert_String($0)); | 19590 return this.getConstructor($assert_String($0)); |
| 19567 }; | 19591 }; |
| 19568 ParameterType.prototype.getOrMakeConcreteType$1 = function($0) { | 19592 ParameterType.prototype.getOrMakeConcreteType$1 = function($0) { |
| 19569 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); | 19593 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19942 for (var $i = 0;$i < $list.length; $i++) { | 19966 for (var $i = 0;$i < $list.length; $i++) { |
| 19943 var tp = $list.$index($i); | 19967 var tp = $list.$index($i); |
| 19944 var paramName = tp.get$name().get$name(); | 19968 var paramName = tp.get$name().get$name(); |
| 19945 this.typeParameters.add(new ParameterType($assert_String(paramName), tp)); | 19969 this.typeParameters.add(new ParameterType($assert_String(paramName), tp)); |
| 19946 } | 19970 } |
| 19947 } | 19971 } |
| 19948 } | 19972 } |
| 19949 DefinedType.prototype.get$typeArgsInOrder = function() { | 19973 DefinedType.prototype.get$typeArgsInOrder = function() { |
| 19950 if (this.typeParameters == null) return null; | 19974 if (this.typeParameters == null) return null; |
| 19951 if (this._typeArgsInOrder == null) { | 19975 if (this._typeArgsInOrder == null) { |
| 19952 this._typeArgsInOrder = new FixedCollection$Type(world.varType, this.typePar
ameters.length); | 19976 this._typeArgsInOrder = new FixedCollection$Type($globals.world.varType, thi
s.typeParameters.length); |
| 19953 } | 19977 } |
| 19954 return this._typeArgsInOrder; | 19978 return this._typeArgsInOrder; |
| 19955 } | 19979 } |
| 19956 DefinedType.prototype.get$isVar = function() { | 19980 DefinedType.prototype.get$isVar = function() { |
| 19957 return $eq(this, world.varType); | 19981 return $eq(this, $globals.world.varType); |
| 19958 } | 19982 } |
| 19959 DefinedType.prototype.get$isVoid = function() { | 19983 DefinedType.prototype.get$isVoid = function() { |
| 19960 return $eq(this, world.voidType); | 19984 return $eq(this, $globals.world.voidType); |
| 19961 } | 19985 } |
| 19962 DefinedType.prototype.get$isTop = function() { | 19986 DefinedType.prototype.get$isTop = function() { |
| 19963 return this.name == null; | 19987 return this.name == null; |
| 19964 } | 19988 } |
| 19965 DefinedType.prototype.get$isObject = function() { | 19989 DefinedType.prototype.get$isObject = function() { |
| 19966 return $notnull_bool(this.library.get$isCore()) && this.name == 'Object'; | 19990 return $notnull_bool(this.library.get$isCore()) && this.name == 'Object'; |
| 19967 } | 19991 } |
| 19968 DefinedType.prototype.get$isString = function() { | 19992 DefinedType.prototype.get$isString = function() { |
| 19969 return $notnull_bool(this.library.get$isCore()) && this.name == 'String' || $n
otnull_bool(this.library.get$isCoreImpl()) && this.name == 'StringImplementation
'; | 19993 return $notnull_bool(this.library.get$isCore()) && this.name == 'String' || $n
otnull_bool(this.library.get$isCoreImpl()) && this.name == 'StringImplementation
'; |
| 19970 } | 19994 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20002 DefinedType.prototype.getAllMembers = function() { | 20026 DefinedType.prototype.getAllMembers = function() { |
| 20003 return HashMapImplementation.HashMapImplementation$from$factory(this.members); | 20027 return HashMapImplementation.HashMapImplementation$from$factory(this.members); |
| 20004 } | 20028 } |
| 20005 DefinedType.prototype.markUsed = function() { | 20029 DefinedType.prototype.markUsed = function() { |
| 20006 if ($notnull_bool(this.isUsed)) return; | 20030 if ($notnull_bool(this.isUsed)) return; |
| 20007 this.isUsed = true; | 20031 this.isUsed = true; |
| 20008 if (this._lazyGenMethods != null) { | 20032 if (this._lazyGenMethods != null) { |
| 20009 var $list = orderValuesByKeys(this._lazyGenMethods); | 20033 var $list = orderValuesByKeys(this._lazyGenMethods); |
| 20010 for (var $i = 0;$i < $list.length; $i++) { | 20034 for (var $i = 0;$i < $list.length; $i++) { |
| 20011 var method = $list.$index($i); | 20035 var method = $list.$index($i); |
| 20012 world.gen.genMethod((method && method.is$Member())); | 20036 $globals.world.gen.genMethod((method && method.is$Member())); |
| 20013 } | 20037 } |
| 20014 this._lazyGenMethods = null; | 20038 this._lazyGenMethods = null; |
| 20015 } | 20039 } |
| 20016 if (this.get$parent() != null) this.get$parent().markUsed(); | 20040 if (this.get$parent() != null) this.get$parent().markUsed(); |
| 20017 } | 20041 } |
| 20018 DefinedType.prototype.genMethod = function(method) { | 20042 DefinedType.prototype.genMethod = function(method) { |
| 20019 if ($notnull_bool(this.isUsed)) { | 20043 if ($notnull_bool(this.isUsed)) { |
| 20020 world.gen.genMethod(method); | 20044 $globals.world.gen.genMethod(method); |
| 20021 } | 20045 } |
| 20022 else if ($notnull_bool(this.isClass)) { | 20046 else if ($notnull_bool(this.isClass)) { |
| 20023 if (this._lazyGenMethods == null) this._lazyGenMethods = $map([]); | 20047 if (this._lazyGenMethods == null) this._lazyGenMethods = $map([]); |
| 20024 this._lazyGenMethods.$setindex(method.name, method); | 20048 this._lazyGenMethods.$setindex(method.name, method); |
| 20025 } | 20049 } |
| 20026 } | 20050 } |
| 20027 DefinedType.prototype._resolveInterfaces = function(types) { | 20051 DefinedType.prototype._resolveInterfaces = function(types) { |
| 20028 var $0; | 20052 var $0; |
| 20029 if (types == null) return []; | 20053 if (types == null) return []; |
| 20030 var interfaces = []; | 20054 var interfaces = []; |
| 20031 for (var $i = 0;$i < types.length; $i++) { | 20055 for (var $i = 0;$i < types.length; $i++) { |
| 20032 var type = types.$index($i); | 20056 var type = types.$index($i); |
| 20033 var resolvedInterface = this.resolveType((type && type.is$TypeReference()),
true); | 20057 var resolvedInterface = this.resolveType((type && type.is$TypeReference()),
true); |
| 20034 if ($notnull_bool(resolvedInterface.get$isClosed()) && !($notnull_bool(this.
library.get$isCore()) || $notnull_bool(this.library.get$isCoreImpl()))) { | 20058 if ($notnull_bool(resolvedInterface.get$isClosed()) && !($notnull_bool(this.
library.get$isCore()) || $notnull_bool(this.library.get$isCoreImpl()))) { |
| 20035 world.error(('can not implement "' + resolvedInterface.get$name() + '": ')
+ 'only native implementation allowed', (($0 = type.get$span()) && $0.is$Source
Span())); | 20059 $globals.world.error(('can not implement "' + resolvedInterface.get$name()
+ '": ') + 'only native implementation allowed', (($0 = type.get$span()) && $0.
is$SourceSpan())); |
| 20036 } | 20060 } |
| 20037 resolvedInterface.addDirectSubtype$1(this); | 20061 resolvedInterface.addDirectSubtype$1(this); |
| 20038 interfaces.add$1(resolvedInterface); | 20062 interfaces.add$1(resolvedInterface); |
| 20039 } | 20063 } |
| 20040 return (interfaces && interfaces.is$List$Type()); | 20064 return (interfaces && interfaces.is$List$Type()); |
| 20041 } | 20065 } |
| 20042 DefinedType.prototype.addDirectSubtype = function(type) { | 20066 DefinedType.prototype.addDirectSubtype = function(type) { |
| 20043 $assert(this._subtypes == null, "_subtypes == null", "type.dart", 748, 12); | 20067 $assert(this._subtypes == null, "_subtypes == null", "type.dart", 748, 12); |
| 20044 this.directSubtypes.add(type); | 20068 this.directSubtypes.add(type); |
| 20045 } | 20069 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20099 return -1; | 20123 return -1; |
| 20100 } | 20124 } |
| 20101 DefinedType.prototype.resolve = function() { | 20125 DefinedType.prototype.resolve = function() { |
| 20102 var $this = this; // closure support | 20126 var $this = this; // closure support |
| 20103 var $0; | 20127 var $0; |
| 20104 if ((this.definition instanceof TypeDefinition)) { | 20128 if ((this.definition instanceof TypeDefinition)) { |
| 20105 var typeDef = (($0 = this.definition) && $0.is$TypeDefinition()); | 20129 var typeDef = (($0 = this.definition) && $0.is$TypeDefinition()); |
| 20106 if ($notnull_bool(this.isClass)) { | 20130 if ($notnull_bool(this.isClass)) { |
| 20107 if (typeDef.extendsTypes != null && typeDef.extendsTypes.length > 0) { | 20131 if (typeDef.extendsTypes != null && typeDef.extendsTypes.length > 0) { |
| 20108 if (typeDef.extendsTypes.length > 1) { | 20132 if (typeDef.extendsTypes.length > 1) { |
| 20109 world.error('more than one base class', (($0 = typeDef.extendsTypes.$i
ndex(1).get$span()) && $0.is$SourceSpan())); | 20133 $globals.world.error('more than one base class', (($0 = typeDef.extend
sTypes.$index(1).get$span()) && $0.is$SourceSpan())); |
| 20110 } | 20134 } |
| 20111 var extendsTypeRef = typeDef.extendsTypes.$index(0); | 20135 var extendsTypeRef = typeDef.extendsTypes.$index(0); |
| 20112 if ((extendsTypeRef instanceof GenericTypeReference)) { | 20136 if ((extendsTypeRef instanceof GenericTypeReference)) { |
| 20113 var g = (extendsTypeRef && extendsTypeRef.is$GenericTypeReference()); | 20137 var g = (extendsTypeRef && extendsTypeRef.is$GenericTypeReference()); |
| 20114 this.set$parent(this.resolveType(g.baseType, true)); | 20138 this.set$parent(this.resolveType(g.baseType, true)); |
| 20115 } | 20139 } |
| 20116 this.set$parent(this.resolveType((extendsTypeRef && extendsTypeRef.is$Ty
peReference()), true)); | 20140 this.set$parent(this.resolveType((extendsTypeRef && extendsTypeRef.is$Ty
peReference()), true)); |
| 20117 if (!$notnull_bool(this.get$parent().get$isClass())) { | 20141 if (!$notnull_bool(this.get$parent().get$isClass())) { |
| 20118 world.error('class may not extend an interface - use implements', (($0
= typeDef.extendsTypes.$index(0).get$span()) && $0.is$SourceSpan())); | 20142 $globals.world.error('class may not extend an interface - use implemen
ts', (($0 = typeDef.extendsTypes.$index(0).get$span()) && $0.is$SourceSpan())); |
| 20119 } | 20143 } |
| 20120 this.get$parent().addDirectSubtype(this); | 20144 this.get$parent().addDirectSubtype(this); |
| 20121 if ($notnull_bool(this._cycleInClassExtends())) { | 20145 if ($notnull_bool(this._cycleInClassExtends())) { |
| 20122 world.error(('class "' + this.name + '" has a cycle in its inheritance
chain'), (($0 = extendsTypeRef.get$span()) && $0.is$SourceSpan())); | 20146 $globals.world.error(('class "' + this.name + '" has a cycle in its in
heritance chain'), (($0 = extendsTypeRef.get$span()) && $0.is$SourceSpan())); |
| 20123 } | 20147 } |
| 20124 } | 20148 } |
| 20125 else { | 20149 else { |
| 20126 if (!$notnull_bool(this.get$isObject())) { | 20150 if (!$notnull_bool(this.get$isObject())) { |
| 20127 this.set$parent(world.objectType); | 20151 this.set$parent($globals.world.objectType); |
| 20128 this.get$parent().addDirectSubtype(this); | 20152 this.get$parent().addDirectSubtype(this); |
| 20129 } | 20153 } |
| 20130 } | 20154 } |
| 20131 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes); | 20155 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes); |
| 20132 if (typeDef.factoryType != null) { | 20156 if (typeDef.factoryType != null) { |
| 20133 world.error('factory not allowed on classes', typeDef.factoryType.span); | 20157 $globals.world.error('factory not allowed on classes', typeDef.factoryTy
pe.span); |
| 20134 } | 20158 } |
| 20135 } | 20159 } |
| 20136 else { | 20160 else { |
| 20137 if (typeDef.implementsTypes != null && typeDef.implementsTypes.length > 0)
{ | 20161 if (typeDef.implementsTypes != null && typeDef.implementsTypes.length > 0)
{ |
| 20138 world.error('implements not allowed on interfaces (use extends)', (($0 =
typeDef.implementsTypes.$index(0).get$span()) && $0.is$SourceSpan())); | 20162 $globals.world.error('implements not allowed on interfaces (use extends)
', (($0 = typeDef.implementsTypes.$index(0).get$span()) && $0.is$SourceSpan())); |
| 20139 } | 20163 } |
| 20140 this.interfaces = this._resolveInterfaces(typeDef.extendsTypes); | 20164 this.interfaces = this._resolveInterfaces(typeDef.extendsTypes); |
| 20141 var res = this._cycleInInterfaceExtends(); | 20165 var res = this._cycleInInterfaceExtends(); |
| 20142 if (res >= 0) { | 20166 if (res >= 0) { |
| 20143 world.error(('interface "' + this.name + '" has a cycle in its inheritan
ce chain'), (($0 = typeDef.extendsTypes.$index(res).get$span()) && $0.is$SourceS
pan())); | 20167 $globals.world.error(('interface "' + this.name + '" has a cycle in its
inheritance chain'), (($0 = typeDef.extendsTypes.$index(res).get$span()) && $0.i
s$SourceSpan())); |
| 20144 } | 20168 } |
| 20145 if (typeDef.factoryType != null) { | 20169 if (typeDef.factoryType != null) { |
| 20146 this.factory_ = this.resolveType(typeDef.factoryType, true); | 20170 this.factory_ = this.resolveType(typeDef.factoryType, true); |
| 20147 if (this.factory_ == null) { | 20171 if (this.factory_ == null) { |
| 20148 world.warning('unresolved factory', typeDef.factoryType.span); | 20172 $globals.world.warning('unresolved factory', typeDef.factoryType.span)
; |
| 20149 } | 20173 } |
| 20150 } | 20174 } |
| 20151 } | 20175 } |
| 20152 } | 20176 } |
| 20153 else if ((this.definition instanceof FunctionTypeDefinition)) { | 20177 else if ((this.definition instanceof FunctionTypeDefinition)) { |
| 20154 this.interfaces = [world.functionType]; | 20178 this.interfaces = [$globals.world.functionType]; |
| 20155 } | 20179 } |
| 20156 if (this.typeParameters != null) { | 20180 if (this.typeParameters != null) { |
| 20157 var $list = this.typeParameters; | 20181 var $list = this.typeParameters; |
| 20158 for (var $i = 0;$i < $list.length; $i++) { | 20182 for (var $i = 0;$i < $list.length; $i++) { |
| 20159 var tp = $list.$index($i); | 20183 var tp = $list.$index($i); |
| 20160 tp.resolve$1(this); | 20184 tp.resolve$1(this); |
| 20161 } | 20185 } |
| 20162 } | 20186 } |
| 20163 world._addType(this); | 20187 $globals.world._addType(this); |
| 20164 var $list = this.constructors.getValues(); | 20188 var $list = this.constructors.getValues(); |
| 20165 for (var $i = this.constructors.getValues().iterator$0(); $i.hasNext$0(); ) { | 20189 for (var $i = this.constructors.getValues().iterator$0(); $i.hasNext$0(); ) { |
| 20166 var c = $i.next$0(); | 20190 var c = $i.next$0(); |
| 20167 c.resolve$1(this); | 20191 c.resolve$1(this); |
| 20168 } | 20192 } |
| 20169 var $list0 = this.members.getValues(); | 20193 var $list0 = this.members.getValues(); |
| 20170 for (var $i = this.members.getValues().iterator$0(); $i.hasNext$0(); ) { | 20194 for (var $i = this.members.getValues().iterator$0(); $i.hasNext$0(); ) { |
| 20171 var m = $i.next$0(); | 20195 var m = $i.next$0(); |
| 20172 m.resolve$1(this); | 20196 m.resolve$1(this); |
| 20173 } | 20197 } |
| 20174 this.factories.forEach((function (f) { | 20198 this.factories.forEach((function (f) { |
| 20175 return f.resolve$1($this); | 20199 return f.resolve$1($this); |
| 20176 }) | 20200 }) |
| 20177 ); | 20201 ); |
| 20178 } | 20202 } |
| 20179 DefinedType.prototype.addMethod = function(methodName, definition) { | 20203 DefinedType.prototype.addMethod = function(methodName, definition) { |
| 20180 if (methodName == null) methodName = definition.name.name; | 20204 if (methodName == null) methodName = definition.name.name; |
| 20181 var method = new MethodMember(methodName, this, definition); | 20205 var method = new MethodMember(methodName, this, definition); |
| 20182 if ($notnull_bool(method.get$isConstructor())) { | 20206 if ($notnull_bool(method.get$isConstructor())) { |
| 20183 if (this.constructors.containsKey(method.get$constructorName())) { | 20207 if (this.constructors.containsKey(method.get$constructorName())) { |
| 20184 world.error(('duplicate constructor definition of ' + method.get$name()),
definition.span); | 20208 $globals.world.error(('duplicate constructor definition of ' + method.get$
name()), definition.span); |
| 20185 return; | 20209 return; |
| 20186 } | 20210 } |
| 20187 this.constructors.$setindex(method.get$constructorName(), method); | 20211 this.constructors.$setindex(method.get$constructorName(), method); |
| 20188 return; | 20212 return; |
| 20189 } | 20213 } |
| 20190 if (definition.modifiers != null && definition.modifiers.length == 1 && $notnu
ll_bool($eq(definition.modifiers.$index(0).get$kind(), 75/*TokenKind.FACTORY*/))
) { | 20214 if (definition.modifiers != null && definition.modifiers.length == 1 && $notnu
ll_bool($eq(definition.modifiers.$index(0).get$kind(), 75/*TokenKind.FACTORY*/))
) { |
| 20191 if (this.factories.getFactory($assert_String(method.get$constructorName()),
$assert_String(method.get$name())) != null) { | 20215 if (this.factories.getFactory($assert_String(method.get$constructorName()),
$assert_String(method.get$name())) != null) { |
| 20192 world.error(('duplicate factory definition of "' + method.get$name() + '"'
), definition.span); | 20216 $globals.world.error(('duplicate factory definition of "' + method.get$nam
e() + '"'), definition.span); |
| 20193 return; | 20217 return; |
| 20194 } | 20218 } |
| 20195 this.factories.addFactory($assert_String(method.get$constructorName()), $ass
ert_String(method.get$name()), (method && method.is$Member())); | 20219 this.factories.addFactory($assert_String(method.get$constructorName()), $ass
ert_String(method.get$name()), (method && method.is$Member())); |
| 20196 return; | 20220 return; |
| 20197 } | 20221 } |
| 20198 if (methodName.startsWith('get\$') || methodName.startsWith('set\$')) { | 20222 if (methodName.startsWith('get\$') || methodName.startsWith('set\$')) { |
| 20199 var propName = methodName.substring(4); | 20223 var propName = methodName.substring(4); |
| 20200 var prop = this.members.$index(propName); | 20224 var prop = this.members.$index(propName); |
| 20201 if ($notnull_bool(prop == null)) { | 20225 if ($notnull_bool(prop == null)) { |
| 20202 prop = new PropertyMember($assert_String(propName), this); | 20226 prop = new PropertyMember($assert_String(propName), this); |
| 20203 this.members.$setindex(propName, prop); | 20227 this.members.$setindex(propName, prop); |
| 20204 } | 20228 } |
| 20205 if (!(prop instanceof PropertyMember)) { | 20229 if (!(prop instanceof PropertyMember)) { |
| 20206 world.error(('property conflicts with field "' + propName + '"'), definiti
on.span); | 20230 $globals.world.error(('property conflicts with field "' + propName + '"'),
definition.span); |
| 20207 return; | 20231 return; |
| 20208 } | 20232 } |
| 20209 if (methodName[0] == 'g') { | 20233 if (methodName[0] == 'g') { |
| 20210 if ($notnull_bool($ne(prop.get$getter(), null))) { | 20234 if ($notnull_bool($ne(prop.get$getter(), null))) { |
| 20211 world.error(('duplicate getter definition for "' + propName + '"'), defi
nition.span); | 20235 $globals.world.error(('duplicate getter definition for "' + propName + '
"'), definition.span); |
| 20212 } | 20236 } |
| 20213 prop.set$getter(method); | 20237 prop.set$getter(method); |
| 20214 } | 20238 } |
| 20215 else { | 20239 else { |
| 20216 if ($notnull_bool($ne(prop.get$setter(), null))) { | 20240 if ($notnull_bool($ne(prop.get$setter(), null))) { |
| 20217 world.error(('duplicate setter definition for "' + propName + '"'), defi
nition.span); | 20241 $globals.world.error(('duplicate setter definition for "' + propName + '
"'), definition.span); |
| 20218 } | 20242 } |
| 20219 prop.set$setter(method); | 20243 prop.set$setter(method); |
| 20220 } | 20244 } |
| 20221 return; | 20245 return; |
| 20222 } | 20246 } |
| 20223 if (this.members.containsKey(methodName)) { | 20247 if (this.members.containsKey(methodName)) { |
| 20224 world.error(('duplicate method definition of "' + method.get$name() + '"'),
definition.span); | 20248 $globals.world.error(('duplicate method definition of "' + method.get$name()
+ '"'), definition.span); |
| 20225 return; | 20249 return; |
| 20226 } | 20250 } |
| 20227 this.members.$setindex(methodName, method); | 20251 this.members.$setindex(methodName, method); |
| 20228 } | 20252 } |
| 20229 DefinedType.prototype.addField = function(definition) { | 20253 DefinedType.prototype.addField = function(definition) { |
| 20230 for (var i = 0; | 20254 for (var i = 0; |
| 20231 i < definition.names.length; i++) { | 20255 i < definition.names.length; i++) { |
| 20232 var name = definition.names.$index(i).get$name(); | 20256 var name = definition.names.$index(i).get$name(); |
| 20233 if (this.members.containsKey(name)) { | 20257 if (this.members.containsKey(name)) { |
| 20234 world.error(('duplicate field definition of "' + name + '"'), definition.s
pan); | 20258 $globals.world.error(('duplicate field definition of "' + name + '"'), def
inition.span); |
| 20235 return; | 20259 return; |
| 20236 } | 20260 } |
| 20237 var value = null; | 20261 var value = null; |
| 20238 if (definition.values != null) { | 20262 if (definition.values != null) { |
| 20239 value = definition.values.$index(i); | 20263 value = definition.values.$index(i); |
| 20240 } | 20264 } |
| 20241 var field = new FieldMember($assert_String(name), this, definition, value); | 20265 var field = new FieldMember($assert_String(name), this, definition, value); |
| 20242 this.members.$setindex(name, field); | 20266 this.members.$setindex(name, field); |
| 20243 if ($notnull_bool(this.isNativeType)) { | 20267 if ($notnull_bool(this.isNativeType)) { |
| 20244 field.set$isNative(true); | 20268 field.set$isNative(true); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20327 for (var $i = 0;$i < $list.length; $i++) { | 20351 for (var $i = 0;$i < $list.length; $i++) { |
| 20328 var i = $list.$index($i); | 20352 var i = $list.$index($i); |
| 20329 var ret = i.getMember$1(memberName); | 20353 var ret = i.getMember$1(memberName); |
| 20330 if ($notnull_bool($ne(ret, null))) { | 20354 if ($notnull_bool($ne(ret, null))) { |
| 20331 return (ret && ret.is$Member()); | 20355 return (ret && ret.is$Member()); |
| 20332 } | 20356 } |
| 20333 } | 20357 } |
| 20334 return null; | 20358 return null; |
| 20335 } | 20359 } |
| 20336 else { | 20360 else { |
| 20337 return world.objectType.getMember(memberName); | 20361 return $globals.world.objectType.getMember(memberName); |
| 20338 } | 20362 } |
| 20339 } | 20363 } |
| 20340 } | 20364 } |
| 20341 DefinedType.prototype.resolveMember = function(memberName) { | 20365 DefinedType.prototype.resolveMember = function(memberName) { |
| 20342 var $0; | 20366 var $0; |
| 20343 var ret = (($0 = this._resolvedMembers.$index(memberName)) && $0.is$MemberSet(
)); | 20367 var ret = (($0 = this._resolvedMembers.$index(memberName)) && $0.is$MemberSet(
)); |
| 20344 if (ret != null) return ret; | 20368 if (ret != null) return ret; |
| 20345 var member = this.getMember(memberName); | 20369 var member = this.getMember(memberName); |
| 20346 if (member == null) { | 20370 if (member == null) { |
| 20347 return null; | 20371 return null; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 20364 } | 20388 } |
| 20365 if ($notnull_bool($ne(m, null))) ret.add((m && m.is$Member())); | 20389 if ($notnull_bool($ne(m, null))) ret.add((m && m.is$Member())); |
| 20366 } | 20390 } |
| 20367 return ret; | 20391 return ret; |
| 20368 } | 20392 } |
| 20369 } | 20393 } |
| 20370 DefinedType.prototype._createNotEqualMember = function() { | 20394 DefinedType.prototype._createNotEqualMember = function() { |
| 20371 var $0; | 20395 var $0; |
| 20372 var eq = (($0 = this.members.$index('\$eq')) && $0.is$MethodMember()); | 20396 var eq = (($0 = this.members.$index('\$eq')) && $0.is$MethodMember()); |
| 20373 if (eq == null) { | 20397 if (eq == null) { |
| 20374 world.internalError('INTERNAL: object does not define ==', this.definition.s
pan); | 20398 $globals.world.internalError('INTERNAL: object does not define ==', this.def
inition.span); |
| 20375 } | 20399 } |
| 20376 var ne = new MethodMember('\$ne', this, eq.definition); | 20400 var ne = new MethodMember('\$ne', this, eq.definition); |
| 20377 ne.isGenerated = true; | 20401 ne.isGenerated = true; |
| 20378 ne.returnType = eq.returnType; | 20402 ne.returnType = eq.returnType; |
| 20379 ne.parameters = eq.parameters; | 20403 ne.parameters = eq.parameters; |
| 20380 ne.isStatic = eq.isStatic; | 20404 ne.isStatic = eq.isStatic; |
| 20381 ne.isAbstract = eq.isAbstract; | 20405 ne.isAbstract = eq.isAbstract; |
| 20382 return ne; | 20406 return ne; |
| 20383 } | 20407 } |
| 20384 DefinedType._getDottedName = function(type) { | 20408 DefinedType._getDottedName = function(type) { |
| 20385 if (type.names != null) { | 20409 if (type.names != null) { |
| 20386 var names = map(type.names, (function (n) { | 20410 var names = map(type.names, (function (n) { |
| 20387 return n.get$name(); | 20411 return n.get$name(); |
| 20388 }) | 20412 }) |
| 20389 ); | 20413 ); |
| 20390 return type.name.name + '.' + Strings.join((names && names.is$List$String())
, '.'); | 20414 return type.name.name + '.' + Strings.join((names && names.is$List$String())
, '.'); |
| 20391 } | 20415 } |
| 20392 else { | 20416 else { |
| 20393 return type.name.name; | 20417 return type.name.name; |
| 20394 } | 20418 } |
| 20395 } | 20419 } |
| 20396 DefinedType.prototype.resolveType = function(node, typeErrors) { | 20420 DefinedType.prototype.resolveType = function(node, typeErrors) { |
| 20397 var $0; | 20421 var $0; |
| 20398 if (node == null) return world.varType; | 20422 if (node == null) return $globals.world.varType; |
| 20399 if (node.type != null) return node.type; | 20423 if (node.type != null) return node.type; |
| 20400 if ((node instanceof NameTypeReference)) { | 20424 if ((node instanceof NameTypeReference)) { |
| 20401 var typeRef = (node && node.is$NameTypeReference()); | 20425 var typeRef = (node && node.is$NameTypeReference()); |
| 20402 var name; | 20426 var name; |
| 20403 if (typeRef.names != null) { | 20427 if (typeRef.names != null) { |
| 20404 name = $assert_String(typeRef.names.last().get$name()); | 20428 name = $assert_String(typeRef.names.last().get$name()); |
| 20405 } | 20429 } |
| 20406 else { | 20430 else { |
| 20407 name = typeRef.name.name; | 20431 name = typeRef.name.name; |
| 20408 } | 20432 } |
| 20409 if (this.typeParameters != null) { | 20433 if (this.typeParameters != null) { |
| 20410 var $list = this.typeParameters; | 20434 var $list = this.typeParameters; |
| 20411 for (var $i = 0;$i < $list.length; $i++) { | 20435 for (var $i = 0;$i < $list.length; $i++) { |
| 20412 var tp = $list.$index($i); | 20436 var tp = $list.$index($i); |
| 20413 if ($notnull_bool($eq(tp.get$name(), name))) { | 20437 if ($notnull_bool($eq(tp.get$name(), name))) { |
| 20414 typeRef.type = (tp && tp.is$lang_Type()); | 20438 typeRef.type = (tp && tp.is$lang_Type()); |
| 20415 } | 20439 } |
| 20416 } | 20440 } |
| 20417 } | 20441 } |
| 20418 if (typeRef.type == null) { | 20442 if (typeRef.type == null) { |
| 20419 typeRef.type = this.library.findType(typeRef); | 20443 typeRef.type = this.library.findType(typeRef); |
| 20420 } | 20444 } |
| 20421 if (typeRef.type == null) { | 20445 if (typeRef.type == null) { |
| 20422 var message = ('cannot find type ' + DefinedType._getDottedName(typeRef)); | 20446 var message = ('cannot find type ' + DefinedType._getDottedName(typeRef)); |
| 20423 if ($notnull_bool(typeErrors)) { | 20447 if ($notnull_bool(typeErrors)) { |
| 20424 world.error($assert_String(message), typeRef.span); | 20448 $globals.world.error($assert_String(message), typeRef.span); |
| 20425 typeRef.type = world.objectType; | 20449 typeRef.type = $globals.world.objectType; |
| 20426 } | 20450 } |
| 20427 else { | 20451 else { |
| 20428 world.warning($assert_String(message), typeRef.span); | 20452 $globals.world.warning($assert_String(message), typeRef.span); |
| 20429 typeRef.type = world.varType; | 20453 typeRef.type = $globals.world.varType; |
| 20430 } | 20454 } |
| 20431 } | 20455 } |
| 20432 } | 20456 } |
| 20433 else if ((node instanceof GenericTypeReference)) { | 20457 else if ((node instanceof GenericTypeReference)) { |
| 20434 var typeRef = (node && node.is$GenericTypeReference()); | 20458 var typeRef = (node && node.is$GenericTypeReference()); |
| 20435 var baseType = this.resolveType(typeRef.baseType, typeErrors); | 20459 var baseType = this.resolveType(typeRef.baseType, typeErrors); |
| 20436 if (!$notnull_bool(baseType.get$isGeneric())) { | 20460 if (!$notnull_bool(baseType.get$isGeneric())) { |
| 20437 world.error(('' + baseType.get$name() + ' is not generic'), typeRef.span); | 20461 $globals.world.error(('' + baseType.get$name() + ' is not generic'), typeR
ef.span); |
| 20438 return null; | 20462 return null; |
| 20439 } | 20463 } |
| 20440 if (typeRef.typeArguments.length != baseType.get$typeParameters().length) { | 20464 if (typeRef.typeArguments.length != baseType.get$typeParameters().length) { |
| 20441 world.error('wrong number of type arguments', typeRef.span); | 20465 $globals.world.error('wrong number of type arguments', typeRef.span); |
| 20442 return null; | 20466 return null; |
| 20443 } | 20467 } |
| 20444 var typeArgs = []; | 20468 var typeArgs = []; |
| 20445 for (var i = 0; | 20469 for (var i = 0; |
| 20446 i < typeRef.typeArguments.length; i++) { | 20470 i < typeRef.typeArguments.length; i++) { |
| 20447 var extendsType = baseType.get$typeParameters().$index(i).get$extendsType(
); | 20471 var extendsType = baseType.get$typeParameters().$index(i).get$extendsType(
); |
| 20448 var typeArg = this.resolveType((($0 = typeRef.typeArguments.$index(i)) &&
$0.is$TypeReference()), typeErrors); | 20472 var typeArg = this.resolveType((($0 = typeRef.typeArguments.$index(i)) &&
$0.is$TypeReference()), typeErrors); |
| 20449 typeArgs.add$1(typeArg); | 20473 typeArgs.add$1(typeArg); |
| 20450 if ($notnull_bool($ne(extendsType, null)) && !(typeArg instanceof Paramete
rType)) { | 20474 if ($notnull_bool($ne(extendsType, null)) && !(typeArg instanceof Paramete
rType)) { |
| 20451 typeArg.ensureSubtypeOf$3(extendsType, typeRef.typeArguments.$index(i).g
et$span(), typeErrors); | 20475 typeArg.ensureSubtypeOf$3(extendsType, typeRef.typeArguments.$index(i).g
et$span(), typeErrors); |
| 20452 } | 20476 } |
| 20453 } | 20477 } |
| 20454 typeRef.type = (($0 = baseType.getOrMakeConcreteType$1(typeArgs)) && $0.is$l
ang_Type()); | 20478 typeRef.type = (($0 = baseType.getOrMakeConcreteType$1(typeArgs)) && $0.is$l
ang_Type()); |
| 20455 } | 20479 } |
| 20456 else if ((node instanceof FunctionTypeReference)) { | 20480 else if ((node instanceof FunctionTypeReference)) { |
| 20457 var typeRef = (node && node.is$FunctionTypeReference()); | 20481 var typeRef = (node && node.is$FunctionTypeReference()); |
| 20458 var name = ''; | 20482 var name = ''; |
| 20459 if (typeRef.func.name != null) name = typeRef.func.name.name; | 20483 if (typeRef.func.name != null) name = typeRef.func.name.name; |
| 20460 typeRef.type = this.library.getOrAddFunctionType($assert_String(name), typeR
ef.func, this); | 20484 typeRef.type = this.library.getOrAddFunctionType($assert_String(name), typeR
ef.func, this); |
| 20461 } | 20485 } |
| 20462 else { | 20486 else { |
| 20463 world.internalError('unknown type reference', node.span); | 20487 $globals.world.internalError('unknown type reference', node.span); |
| 20464 } | 20488 } |
| 20465 return node.type; | 20489 return node.type; |
| 20466 } | 20490 } |
| 20467 DefinedType.prototype.resolveTypeParams = function(inType) { | 20491 DefinedType.prototype.resolveTypeParams = function(inType) { |
| 20468 return this; | 20492 return this; |
| 20469 } | 20493 } |
| 20470 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { | 20494 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| 20471 $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1231, 12); | 20495 $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1231, 12); |
| 20472 var names = [this.name]; | 20496 var names = [this.name]; |
| 20473 var typeMap = $map([]); | 20497 var typeMap = $map([]); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20609 // ********** Code for Value ************** | 20633 // ********** Code for Value ************** |
| 20610 function Value(type, code, span, needsTemp) { | 20634 function Value(type, code, span, needsTemp) { |
| 20611 this.isSuper = false | 20635 this.isSuper = false |
| 20612 this.isType = false | 20636 this.isType = false |
| 20613 this.isFinal = false | 20637 this.isFinal = false |
| 20614 this.type = type; | 20638 this.type = type; |
| 20615 this.code = code; | 20639 this.code = code; |
| 20616 this.span = span; | 20640 this.span = span; |
| 20617 this.needsTemp = needsTemp; | 20641 this.needsTemp = needsTemp; |
| 20618 // Initializers done | 20642 // Initializers done |
| 20619 if (this.type == null) world.internalError('type passed as null', this.span); | 20643 if (this.type == null) $globals.world.internalError('type passed as null', thi
s.span); |
| 20620 } | 20644 } |
| 20621 Value.prototype.is$Value = function(){return this;}; | 20645 Value.prototype.is$Value = function(){return this;}; |
| 20622 Value.prototype.get$type = function() { return this.type; }; | 20646 Value.prototype.get$type = function() { return this.type; }; |
| 20623 Value.prototype.set$type = function(value) { return this.type = value; }; | 20647 Value.prototype.set$type = function(value) { return this.type = value; }; |
| 20624 Value.prototype.get$code = function() { return this.code; }; | 20648 Value.prototype.get$code = function() { return this.code; }; |
| 20625 Value.prototype.set$code = function(value) { return this.code = value; }; | 20649 Value.prototype.set$code = function(value) { return this.code = value; }; |
| 20626 Value.prototype.get$span = function() { return this.span; }; | 20650 Value.prototype.get$span = function() { return this.span; }; |
| 20627 Value.prototype.set$span = function(value) { return this.span = value; }; | 20651 Value.prototype.set$span = function(value) { return this.span = value; }; |
| 20628 Value.prototype.get$isSuper = function() { return this.isSuper; }; | 20652 Value.prototype.get$isSuper = function() { return this.isSuper; }; |
| 20629 Value.prototype.set$isSuper = function(value) { return this.isSuper = value; }; | 20653 Value.prototype.set$isSuper = function(value) { return this.isSuper = value; }; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 20658 return member._set(context, node, this, value, isDynamic); | 20682 return member._set(context, node, this, value, isDynamic); |
| 20659 } | 20683 } |
| 20660 else { | 20684 else { |
| 20661 return this.invokeNoSuchMethod(context, ('set:' + name), node, new Arguments
(null, [value])); | 20685 return this.invokeNoSuchMethod(context, ('set:' + name), node, new Arguments
(null, [value])); |
| 20662 } | 20686 } |
| 20663 } | 20687 } |
| 20664 Value.prototype.invoke = function(context, name, node, args, isDynamic) { | 20688 Value.prototype.invoke = function(context, name, node, args, isDynamic) { |
| 20665 var $0; | 20689 var $0; |
| 20666 if ($notnull_bool(this.get$_typeIsVarOrParameterType()) && name == '\$ne') { | 20690 if ($notnull_bool(this.get$_typeIsVarOrParameterType()) && name == '\$ne') { |
| 20667 if (args.values.length != 1) { | 20691 if (args.values.length != 1) { |
| 20668 world.warning('wrong number of arguments for !=', node.span); | 20692 $globals.world.warning('wrong number of arguments for !=', node.span); |
| 20669 } | 20693 } |
| 20670 var eq = this.invoke(context, '\$eq', node, args, isDynamic); | 20694 var eq = this.invoke(context, '\$eq', node, args, isDynamic); |
| 20671 world.gen.corejs.useOperator('\$ne'); | 20695 $globals.world.gen.corejs.useOperator('\$ne'); |
| 20672 return new Value(eq.get$type(), ('\$ne(' + this.code + ', ' + args.values.$i
ndex(0).get$code() + ')'), node.span, true); | 20696 return new Value(eq.get$type(), ('\$ne(' + this.code + ', ' + args.values.$i
ndex(0).get$code() + ')'), node.span, true); |
| 20673 } | 20697 } |
| 20674 if (name == '\$call') { | 20698 if (name == '\$call') { |
| 20675 if ($notnull_bool(this.isType)) { | 20699 if ($notnull_bool(this.isType)) { |
| 20676 world.error('must use "new" or "const" to construct a new instance', node.
span); | 20700 $globals.world.error('must use "new" or "const" to construct a new instanc
e', node.span); |
| 20677 } | 20701 } |
| 20678 if ($notnull_bool(this.type.needsVarCall(args))) { | 20702 if ($notnull_bool(this.type.needsVarCall(args))) { |
| 20679 return this._varCall(context, args); | 20703 return this._varCall(context, args); |
| 20680 } | 20704 } |
| 20681 } | 20705 } |
| 20682 var member = this._resolveMember(context, name, node, isDynamic); | 20706 var member = this._resolveMember(context, name, node, isDynamic); |
| 20683 if ($notnull_bool(member == null)) { | 20707 if ($notnull_bool(member == null)) { |
| 20684 return this.invokeNoSuchMethod(context, name, node, args); | 20708 return this.invokeNoSuchMethod(context, name, node, args); |
| 20685 } | 20709 } |
| 20686 else { | 20710 else { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 20714 else { | 20738 else { |
| 20715 return this.type.resolveMember(name); | 20739 return this.type.resolveMember(name); |
| 20716 } | 20740 } |
| 20717 } | 20741 } |
| 20718 Value.prototype._resolveMember = function(context, name, node, isDynamic) { | 20742 Value.prototype._resolveMember = function(context, name, node, isDynamic) { |
| 20719 var member; | 20743 var member; |
| 20720 if (!$notnull_bool(this.get$_typeIsVarOrParameterType())) { | 20744 if (!$notnull_bool(this.get$_typeIsVarOrParameterType())) { |
| 20721 member = this._tryResolveMember(context, name); | 20745 member = this._tryResolveMember(context, name); |
| 20722 if ($notnull_bool($ne(member, null)) && $notnull_bool(this.isType) && !$notn
ull_bool(member.get$isStatic())) { | 20746 if ($notnull_bool($ne(member, null)) && $notnull_bool(this.isType) && !$notn
ull_bool(member.get$isStatic())) { |
| 20723 if (!$notnull_bool(isDynamic)) { | 20747 if (!$notnull_bool(isDynamic)) { |
| 20724 world.error('can not refer to instance member as static', node.span); | 20748 $globals.world.error('can not refer to instance member as static', node.
span); |
| 20725 } | 20749 } |
| 20726 return null; | 20750 return null; |
| 20727 } | 20751 } |
| 20728 if ($notnull_bool(member == null) && !$notnull_bool(isDynamic) && !$notnull_
bool(this._hasOverriddenNoSuchMethod())) { | 20752 if ($notnull_bool(member == null) && !$notnull_bool(isDynamic) && !$notnull_
bool(this._hasOverriddenNoSuchMethod())) { |
| 20729 var typeName = this.type.name == null ? this.type.get$library().name : thi
s.type.name; | 20753 var typeName = this.type.name == null ? this.type.get$library().name : thi
s.type.name; |
| 20730 var message = ('can not resolve "' + name + '" on "' + typeName + '"'); | 20754 var message = ('can not resolve "' + name + '" on "' + typeName + '"'); |
| 20731 if ($notnull_bool(this.isType)) { | 20755 if ($notnull_bool(this.isType)) { |
| 20732 world.error($assert_String(message), node.span); | 20756 $globals.world.error($assert_String(message), node.span); |
| 20733 } | 20757 } |
| 20734 else { | 20758 else { |
| 20735 world.warning($assert_String(message), node.span); | 20759 $globals.world.warning($assert_String(message), node.span); |
| 20736 } | 20760 } |
| 20737 } | 20761 } |
| 20738 } | 20762 } |
| 20739 if ($notnull_bool(member == null) && !$notnull_bool(this.isSuper) && !$notnull
_bool(this.isType)) { | 20763 if ($notnull_bool(member == null) && !$notnull_bool(this.isSuper) && !$notnull
_bool(this.isType)) { |
| 20740 member = context.findMembers(name); | 20764 member = context.findMembers(name); |
| 20741 if ($notnull_bool(member == null) && !$notnull_bool(isDynamic)) { | 20765 if ($notnull_bool(member == null) && !$notnull_bool(isDynamic)) { |
| 20742 world.warning(('' + name + ' is not defined anywhere in the world.'), node
.span); | 20766 $globals.world.warning(('' + name + ' is not defined anywhere in the world
.'), node.span); |
| 20743 } | 20767 } |
| 20744 } | 20768 } |
| 20745 return member; | 20769 return member; |
| 20746 } | 20770 } |
| 20747 Value.prototype.checkFirstClass = function(span) { | 20771 Value.prototype.checkFirstClass = function(span) { |
| 20748 if ($notnull_bool(this.isType)) { | 20772 if ($notnull_bool(this.isType)) { |
| 20749 world.error('Types are not first class', span); | 20773 $globals.world.error('Types are not first class', span); |
| 20750 } | 20774 } |
| 20751 } | 20775 } |
| 20752 Value.prototype._varCall = function(context, args) { | 20776 Value.prototype._varCall = function(context, args) { |
| 20753 var stub = world.functionType.getCallStub(args); | 20777 var stub = $globals.world.functionType.getCallStub(args); |
| 20754 return new Value(world.varType, ('' + this.code + '.' + stub.get$name() + '('
+ args.getCode() + ')'), this.span, true); | 20778 return new Value($globals.world.varType, ('' + this.code + '.' + stub.get$name
() + '(' + args.getCode() + ')'), this.span, true); |
| 20755 } | 20779 } |
| 20756 Value.prototype.needsConversion = function(toType) { | 20780 Value.prototype.needsConversion = function(toType) { |
| 20757 var callMethod = toType.getCallMethod(); | 20781 var callMethod = toType.getCallMethod(); |
| 20758 if ($notnull_bool($ne(callMethod, null))) { | 20782 if ($notnull_bool($ne(callMethod, null))) { |
| 20759 var arity = $assert_num(callMethod.get$parameters().length); | 20783 var arity = $assert_num(callMethod.get$parameters().length); |
| 20760 var myCall = this.type.getCallMethod(); | 20784 var myCall = this.type.getCallMethod(); |
| 20761 if ($notnull_bool(myCall == null) || $notnull_bool($ne(myCall.get$parameters
().length, arity))) { | 20785 if ($notnull_bool(myCall == null) || $notnull_bool($ne(myCall.get$parameters
().length, arity))) { |
| 20762 return true; | 20786 return true; |
| 20763 } | 20787 } |
| 20764 } | 20788 } |
| 20765 if ($notnull_bool(options.enableTypeChecks)) { | 20789 if ($notnull_bool($globals.options.enableTypeChecks)) { |
| 20766 var fromType = this.type; | 20790 var fromType = this.type; |
| 20767 if ($notnull_bool(this.type.get$isVar()) && (this.code != 'null' || !$notnul
l_bool(toType.get$isNullable()))) { | 20791 if ($notnull_bool(this.type.get$isVar()) && (this.code != 'null' || !$notnul
l_bool(toType.get$isNullable()))) { |
| 20768 fromType = world.objectType; | 20792 fromType = $globals.world.objectType; |
| 20769 } | 20793 } |
| 20770 var bothNum = $notnull_bool(this.type.get$isNum()) && $notnull_bool(toType.g
et$isNum()); | 20794 var bothNum = $notnull_bool(this.type.get$isNum()) && $notnull_bool(toType.g
et$isNum()); |
| 20771 return $notnull_bool(fromType.isSubtypeOf(toType)) || $notnull_bool(bothNum)
; | 20795 return $notnull_bool(fromType.isSubtypeOf(toType)) || $notnull_bool(bothNum)
; |
| 20772 } | 20796 } |
| 20773 return false; | 20797 return false; |
| 20774 } | 20798 } |
| 20775 Value.prototype.convertTo = function(context, toType, node, isDynamic) { | 20799 Value.prototype.convertTo = function(context, toType, node, isDynamic) { |
| 20776 var $0; | 20800 var $0; |
| 20777 var checked = !$notnull_bool(isDynamic); | 20801 var checked = !$notnull_bool(isDynamic); |
| 20778 var callMethod = toType.getCallMethod(); | 20802 var callMethod = toType.getCallMethod(); |
| 20779 if ($notnull_bool($ne(callMethod, null))) { | 20803 if ($notnull_bool($ne(callMethod, null))) { |
| 20780 if ($notnull_bool(checked) && !$notnull_bool(toType.isAssignable(this.type))
) { | 20804 if ($notnull_bool(checked) && !$notnull_bool(toType.isAssignable(this.type))
) { |
| 20781 this.convertWarning(toType, node); | 20805 this.convertWarning(toType, node); |
| 20782 } | 20806 } |
| 20783 var arity = $assert_num(callMethod.get$parameters().length); | 20807 var arity = $assert_num(callMethod.get$parameters().length); |
| 20784 var myCall = this.type.getCallMethod(); | 20808 var myCall = this.type.getCallMethod(); |
| 20785 if ($notnull_bool(myCall == null) || $notnull_bool($ne(myCall.get$parameters
().length, arity))) { | 20809 if ($notnull_bool(myCall == null) || $notnull_bool($ne(myCall.get$parameters
().length, arity))) { |
| 20786 var stub = world.functionType.getCallStub(Arguments.Arguments$bare$factory
(arity)); | 20810 var stub = $globals.world.functionType.getCallStub(Arguments.Arguments$bar
e$factory(arity)); |
| 20787 var val = new Value(toType, ('to\$' + stub.name + '(' + this.code + ')'),
node.span, true); | 20811 var val = new Value(toType, ('to\$' + stub.name + '(' + this.code + ')'),
node.span, true); |
| 20788 return (($0 = $notnull_bool(this._isDomCallback(toType)) && !$notnull_bool
(this._isDomCallback(this.type)) ? val._wrapDomCallback(toType, arity) : val) &&
$0.is$Value()); | 20812 return (($0 = $notnull_bool(this._isDomCallback(toType)) && !$notnull_bool
(this._isDomCallback(this.type)) ? val._wrapDomCallback(toType, arity) : val) &&
$0.is$Value()); |
| 20789 } | 20813 } |
| 20790 else if ($notnull_bool(this._isDomCallback(toType)) && !$notnull_bool(this._
isDomCallback(this.type))) { | 20814 else if ($notnull_bool(this._isDomCallback(toType)) && !$notnull_bool(this._
isDomCallback(this.type))) { |
| 20791 return this._wrapDomCallback(toType, arity); | 20815 return this._wrapDomCallback(toType, arity); |
| 20792 } | 20816 } |
| 20793 } | 20817 } |
| 20794 var fromType = this.type; | 20818 var fromType = this.type; |
| 20795 if ($notnull_bool(this.type.get$isVar()) && (this.code != 'null' || !$notnull_
bool(toType.get$isNullable()))) { | 20819 if ($notnull_bool(this.type.get$isVar()) && (this.code != 'null' || !$notnull_
bool(toType.get$isNullable()))) { |
| 20796 fromType = world.objectType; | 20820 fromType = $globals.world.objectType; |
| 20797 } | 20821 } |
| 20798 var bothNum = $notnull_bool(this.type.get$isNum()) && $notnull_bool(toType.get
$isNum()); | 20822 var bothNum = $notnull_bool(this.type.get$isNum()) && $notnull_bool(toType.get
$isNum()); |
| 20799 if ($notnull_bool(fromType.isSubtypeOf(toType)) || $notnull_bool(bothNum)) { | 20823 if ($notnull_bool(fromType.isSubtypeOf(toType)) || $notnull_bool(bothNum)) { |
| 20800 return this; | 20824 return this; |
| 20801 } | 20825 } |
| 20802 if ($notnull_bool(checked) && !$notnull_bool(toType.isSubtypeOf(this.type))) { | 20826 if ($notnull_bool(checked) && !$notnull_bool(toType.isSubtypeOf(this.type))) { |
| 20803 this.convertWarning(toType, node); | 20827 this.convertWarning(toType, node); |
| 20804 } | 20828 } |
| 20805 if ($notnull_bool(options.enableTypeChecks)) { | 20829 if ($notnull_bool($globals.options.enableTypeChecks)) { |
| 20806 return this._typeAssert(context, toType, node); | 20830 return this._typeAssert(context, toType, node); |
| 20807 } | 20831 } |
| 20808 else { | 20832 else { |
| 20809 return this; | 20833 return this; |
| 20810 } | 20834 } |
| 20811 } | 20835 } |
| 20812 Value.prototype._isDomCallback = function(toType) { | 20836 Value.prototype._isDomCallback = function(toType) { |
| 20813 return ((toType.get$definition() instanceof FunctionTypeDefinition) && $notnul
l_bool($eq(toType.get$library(), world.get$dom()))); | 20837 return ((toType.get$definition() instanceof FunctionTypeDefinition) && $notnul
l_bool($eq(toType.get$library(), $globals.world.get$dom()))); |
| 20814 } | 20838 } |
| 20815 Value.prototype._wrapDomCallback = function(toType, arity) { | 20839 Value.prototype._wrapDomCallback = function(toType, arity) { |
| 20816 if (arity == 0) { | 20840 if (arity == 0) { |
| 20817 world.gen.corejs.useWrap0 = true; | 20841 $globals.world.gen.corejs.useWrap0 = true; |
| 20818 } | 20842 } |
| 20819 else { | 20843 else { |
| 20820 world.gen.corejs.useWrap1 = true; | 20844 $globals.world.gen.corejs.useWrap1 = true; |
| 20821 } | 20845 } |
| 20822 return new Value(toType, ('\$wrap_call\$' + arity + '(' + this.code + ')'), th
is.span, true); | 20846 return new Value(toType, ('\$wrap_call\$' + arity + '(' + this.code + ')'), th
is.span, true); |
| 20823 } | 20847 } |
| 20824 Value.prototype._typeAssert = function(context, toType, node) { | 20848 Value.prototype._typeAssert = function(context, toType, node) { |
| 20825 if ((toType instanceof ParameterType)) { | 20849 if ((toType instanceof ParameterType)) { |
| 20826 var p = (toType && toType.is$ParameterType()); | 20850 var p = (toType && toType.is$ParameterType()); |
| 20827 toType = p.extendsType; | 20851 toType = p.extendsType; |
| 20828 } | 20852 } |
| 20829 if (toType.getCallMethod() != null) { | 20853 if (toType.getCallMethod() != null) { |
| 20830 return this; | 20854 return this; |
| 20831 } | 20855 } |
| 20832 if ($notnull_bool(toType.get$isObject()) || $notnull_bool(toType.get$isVar()))
{ | 20856 if ($notnull_bool(toType.get$isObject()) || $notnull_bool(toType.get$isVar()))
{ |
| 20833 world.internalError(('We thought ' + this.type.name + ' is not a subtype of
' + toType.name + '?')); | 20857 $globals.world.internalError(('We thought ' + this.type.name + ' is not a su
btype of ' + toType.name + '?')); |
| 20834 } | 20858 } |
| 20835 if ($notnull_bool(toType.get$isNum())) toType = world.numType; | 20859 if ($notnull_bool(toType.get$isNum())) toType = $globals.world.numType; |
| 20836 var check; | 20860 var check; |
| 20837 if ($notnull_bool(toType.get$isVoid())) { | 20861 if ($notnull_bool(toType.get$isVoid())) { |
| 20838 check = ('\$assert_void(' + this.code + ')'); | 20862 check = ('\$assert_void(' + this.code + ')'); |
| 20839 if (toType.typeCheckCode == null) { | 20863 if (toType.typeCheckCode == null) { |
| 20840 toType.typeCheckCode = "function $assert_void(x) {\n return x == null ? x
: x.is$void(); // throws TypeError\n}"; | 20864 toType.typeCheckCode = "function $assert_void(x) {\n return x == null ? x
: x.is$void(); // throws TypeError\n}"; |
| 20841 } | 20865 } |
| 20842 } | 20866 } |
| 20843 else if ($eq(toType, world.nonNullBool)) { | 20867 else if ($eq(toType, $globals.world.nonNullBool)) { |
| 20844 world.gen.corejs.useNotNullBool = true; | 20868 $globals.world.gen.corejs.useNotNullBool = true; |
| 20845 check = ('\$notnull_bool(' + this.code + ')'); | 20869 check = ('\$notnull_bool(' + this.code + ')'); |
| 20846 } | 20870 } |
| 20847 else if ($notnull_bool(toType.get$library().get$isCore()) && toType.get$typeof
Name() != null) { | 20871 else if ($notnull_bool(toType.get$library().get$isCore()) && toType.get$typeof
Name() != null) { |
| 20848 check = ('\$assert_' + toType.name + '(' + this.code + ')'); | 20872 check = ('\$assert_' + toType.name + '(' + this.code + ')'); |
| 20849 if (toType.typeCheckCode == null) { | 20873 if (toType.typeCheckCode == null) { |
| 20850 toType.typeCheckCode = ("function $assert_" + toType.name + "(x) {\n if (
x == null || typeof(x) == \"" + toType.get$typeofName() + "\") return x;\n thro
w new TypeError(\"'\" + x + \"' is not a " + toType.name + ".\");\n}"); | 20874 toType.typeCheckCode = ("function $assert_" + toType.name + "(x) {\n if (
x == null || typeof(x) == \"" + toType.get$typeofName() + "\") return x;\n thro
w new TypeError(\"'\" + x + \"' is not a " + toType.name + ".\");\n}"); |
| 20851 } | 20875 } |
| 20852 } | 20876 } |
| 20853 else { | 20877 else { |
| 20854 toType.isTested = true; | 20878 toType.isTested = true; |
| 20855 var temp = context.getTemp(this); | 20879 var temp = context.getTemp(this); |
| 20856 check = ('(' + context.assignTemp((temp && temp.is$Value()), this).code + '
&&'); | 20880 check = ('(' + context.assignTemp((temp && temp.is$Value()), this).code + '
&&'); |
| 20857 check = check + (' ' + temp.get$code() + '.is\$' + toType.get$jsname() + '()
)'); | 20881 check = check + (' ' + temp.get$code() + '.is\$' + toType.get$jsname() + '()
)'); |
| 20858 if ($ne(this, temp)) context.freeTemp((temp && temp.is$Value())); | 20882 if ($ne(this, temp)) context.freeTemp((temp && temp.is$Value())); |
| 20859 } | 20883 } |
| 20860 return new Value(toType, check, this.span, true); | 20884 return new Value(toType, check, this.span, true); |
| 20861 } | 20885 } |
| 20862 Value.prototype.instanceOf = function(context, toType, span, isTrue, forceCheck)
{ | 20886 Value.prototype.instanceOf = function(context, toType, span, isTrue, forceCheck)
{ |
| 20863 if ($notnull_bool(toType.get$isVar())) { | 20887 if ($notnull_bool(toType.get$isVar())) { |
| 20864 world.error('can not resolve type', span); | 20888 $globals.world.error('can not resolve type', span); |
| 20865 } | 20889 } |
| 20866 var testCode = null; | 20890 var testCode = null; |
| 20867 if ($notnull_bool(toType.get$isVar()) || $notnull_bool(toType.get$isObject())
|| (toType instanceof ParameterType)) { | 20891 if ($notnull_bool(toType.get$isVar()) || $notnull_bool(toType.get$isObject())
|| (toType instanceof ParameterType)) { |
| 20868 if ($notnull_bool(this.needsTemp)) { | 20892 if ($notnull_bool(this.needsTemp)) { |
| 20869 return new Value(world.nonNullBool, ('(' + this.code + ', true)'), span, t
rue); | 20893 return new Value($globals.world.nonNullBool, ('(' + this.code + ', true)')
, span, true); |
| 20870 } | 20894 } |
| 20871 else { | 20895 else { |
| 20872 return EvaluatedValue.EvaluatedValue$factory(world.nonNullBool, true, 'tru
e', null); | 20896 return EvaluatedValue.EvaluatedValue$factory($globals.world.nonNullBool, t
rue, 'true', null); |
| 20873 } | 20897 } |
| 20874 } | 20898 } |
| 20875 if ($notnull_bool(toType.get$library().get$isCore())) { | 20899 if ($notnull_bool(toType.get$library().get$isCore())) { |
| 20876 var typeofName = toType.get$typeofName(); | 20900 var typeofName = toType.get$typeofName(); |
| 20877 if ($notnull_bool($ne(typeofName, null))) { | 20901 if ($notnull_bool($ne(typeofName, null))) { |
| 20878 testCode = ("(typeof(" + this.code + ") " + ($notnull_bool(isTrue) ? '=='
: '!=') + " '" + typeofName + "')"); | 20902 testCode = ("(typeof(" + this.code + ") " + ($notnull_bool(isTrue) ? '=='
: '!=') + " '" + typeofName + "')"); |
| 20879 } | 20903 } |
| 20880 } | 20904 } |
| 20881 if ($notnull_bool(toType.get$isClass()) && !(toType instanceof ConcreteType))
{ | 20905 if ($notnull_bool(toType.get$isClass()) && !(toType instanceof ConcreteType))
{ |
| 20882 toType.markUsed(); | 20906 toType.markUsed(); |
| 20883 testCode = ('(' + this.code + ' instanceof ' + toType.get$jsname() + ')'); | 20907 testCode = ('(' + this.code + ' instanceof ' + toType.get$jsname() + ')'); |
| 20884 if (!$notnull_bool(isTrue)) { | 20908 if (!$notnull_bool(isTrue)) { |
| 20885 testCode = '!' + testCode; | 20909 testCode = '!' + testCode; |
| 20886 } | 20910 } |
| 20887 } | 20911 } |
| 20888 if (testCode == null) { | 20912 if (testCode == null) { |
| 20889 toType.isTested = true; | 20913 toType.isTested = true; |
| 20890 var temp = context.getTemp(this); | 20914 var temp = context.getTemp(this); |
| 20891 testCode = ('(' + context.assignTemp((temp && temp.is$Value()), this).code +
' &&'); | 20915 testCode = ('(' + context.assignTemp((temp && temp.is$Value()), this).code +
' &&'); |
| 20892 testCode = testCode + (' ' + temp.get$code() + '.is\$' + toType.get$jsname()
+ ')'); | 20916 testCode = testCode + (' ' + temp.get$code() + '.is\$' + toType.get$jsname()
+ ')'); |
| 20893 if ($notnull_bool(isTrue)) { | 20917 if ($notnull_bool(isTrue)) { |
| 20894 testCode = '!!' + testCode; | 20918 testCode = '!!' + testCode; |
| 20895 } | 20919 } |
| 20896 else { | 20920 else { |
| 20897 testCode = '!' + testCode; | 20921 testCode = '!' + testCode; |
| 20898 } | 20922 } |
| 20899 if ($ne(this, temp)) context.freeTemp((temp && temp.is$Value())); | 20923 if ($ne(this, temp)) context.freeTemp((temp && temp.is$Value())); |
| 20900 } | 20924 } |
| 20901 return new Value(world.nonNullBool, testCode, span, true); | 20925 return new Value($globals.world.nonNullBool, testCode, span, true); |
| 20902 } | 20926 } |
| 20903 Value.prototype.convertWarning = function(toType, node) { | 20927 Value.prototype.convertWarning = function(toType, node) { |
| 20904 world.warning(('type "' + this.type.name + '" is not assignable to "' + toType
.name + '"'), node.span); | 20928 $globals.world.warning(('type "' + this.type.name + '" is not assignable to "'
+ toType.name + '"'), node.span); |
| 20905 } | 20929 } |
| 20906 Value.prototype.invokeNoSuchMethod = function(context, name, node, args) { | 20930 Value.prototype.invokeNoSuchMethod = function(context, name, node, args) { |
| 20907 var $0; | 20931 var $0; |
| 20908 var pos = ''; | 20932 var pos = ''; |
| 20909 if (args != null) { | 20933 if (args != null) { |
| 20910 var argsCode = []; | 20934 var argsCode = []; |
| 20911 for (var i = 0; | 20935 for (var i = 0; |
| 20912 i < args.get$length(); i++) { | 20936 i < args.get$length(); i++) { |
| 20913 argsCode.add$1(args.values.$index(i).get$code()); | 20937 argsCode.add$1(args.values.$index(i).get$code()); |
| 20914 } | 20938 } |
| 20915 pos = Strings.join((argsCode && argsCode.is$List$String()), ", "); | 20939 pos = Strings.join((argsCode && argsCode.is$List$String()), ", "); |
| 20916 } | 20940 } |
| 20917 var noSuchArgs = [new Value(world.stringType, ('"' + name + '"'), node.span, t
rue), new Value(world.listType, ('[' + pos + ']'), node.span, true)]; | 20941 var noSuchArgs = [new Value($globals.world.stringType, ('"' + name + '"'), nod
e.span, true), new Value($globals.world.listType, ('[' + pos + ']'), node.span,
true)]; |
| 20918 return (($0 = this._resolveMember(context, 'noSuchMethod', node, false).invoke
$4(context, node, this, new Arguments(null, noSuchArgs))) && $0.is$Value()); | 20942 return (($0 = this._resolveMember(context, 'noSuchMethod', node, false).invoke
$4(context, node, this, new Arguments(null, noSuchArgs))) && $0.is$Value()); |
| 20919 } | 20943 } |
| 20920 Value.prototype.invokeSpecial = function(name, args, returnType) { | 20944 Value.prototype.invokeSpecial = function(name, args, returnType) { |
| 20921 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 484, 12
); | 20945 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 484, 12
); |
| 20922 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4
85, 12); | 20946 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4
85, 12); |
| 20923 var argsString = args.getCode(); | 20947 var argsString = args.getCode(); |
| 20924 if (name == '\$index' || name == '\$setindex') { | 20948 if (name == '\$index' || name == '\$setindex') { |
| 20925 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString
+ ')'), this.span, true); | 20949 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString
+ ')'), this.span, true); |
| 20926 } | 20950 } |
| 20927 else { | 20951 else { |
| 20928 if (argsString.length > 0) argsString = (', ' + argsString); | 20952 if (argsString.length > 0) argsString = (', ' + argsString); |
| 20929 world.gen.corejs.useOperator(name); | 20953 $globals.world.gen.corejs.useOperator(name); |
| 20930 return new Value(returnType, ('' + name + '(' + this.code + argsString + ')'
), this.span, true); | 20954 return new Value(returnType, ('' + name + '(' + this.code + argsString + ')'
), this.span, true); |
| 20931 } | 20955 } |
| 20932 } | 20956 } |
| 20933 Value.prototype.checkFirstClass$1 = function($0) { | 20957 Value.prototype.checkFirstClass$1 = function($0) { |
| 20934 return this.checkFirstClass(($0 && $0.is$SourceSpan())); | 20958 return this.checkFirstClass(($0 && $0.is$SourceSpan())); |
| 20935 }; | 20959 }; |
| 20936 Value.prototype.convertTo$3 = function($0, $1, $2) { | 20960 Value.prototype.convertTo$3 = function($0, $1, $2) { |
| 20937 return this.convertTo(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Type(
)), ($2 && $2.is$lang_Node()), false); | 20961 return this.convertTo(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Type(
)), ($2 && $2.is$lang_Node()), false); |
| 20938 }; | 20962 }; |
| 20939 Value.prototype.convertTo$4 = function($0, $1, $2, $3) { | 20963 Value.prototype.convertTo$4 = function($0, $1, $2, $3) { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21038 fieldValues.sort((function (a, b) { | 21062 fieldValues.sort((function (a, b) { |
| 21039 return a.compareTo$1(b); | 21063 return a.compareTo$1(b); |
| 21040 }) | 21064 }) |
| 21041 ); | 21065 ); |
| 21042 var actualValue = ('const ' + type.get$jsname() + ' [') + Strings.join(fieldVa
lues, ',') + ']'; | 21066 var actualValue = ('const ' + type.get$jsname() + ' [') + Strings.join(fieldVa
lues, ',') + ']'; |
| 21043 return new ConstObjectValue._internal$ctor(type, fields, actualValue, canonica
lCode, span, EvaluatedValue.codeWithComments(canonicalCode, span)); | 21067 return new ConstObjectValue._internal$ctor(type, fields, actualValue, canonica
lCode, span, EvaluatedValue.codeWithComments(canonicalCode, span)); |
| 21044 } | 21068 } |
| 21045 ConstObjectValue.prototype.get$fields = function() { return this.fields; }; | 21069 ConstObjectValue.prototype.get$fields = function() { return this.fields; }; |
| 21046 ConstObjectValue.prototype.set$fields = function(value) { return this.fields = v
alue; }; | 21070 ConstObjectValue.prototype.set$fields = function(value) { return this.fields = v
alue; }; |
| 21047 // ********** Code for GlobalValue ************** | 21071 // ********** Code for GlobalValue ************** |
| 21048 function GlobalValue(type, code, isConst, field, name, exp, canonicalCode, span,
dependencies) { | 21072 function GlobalValue(type, code, isConst, field, name, exp, canonicalCode, span,
_dependencies) { |
| 21073 var $0; |
| 21049 this.field = field; | 21074 this.field = field; |
| 21050 this.name = name; | 21075 this.name = name; |
| 21051 this.exp = exp; | 21076 this.exp = exp; |
| 21052 this.canonicalCode = canonicalCode; | 21077 this.canonicalCode = canonicalCode; |
| 21053 this.dependencies = dependencies; | 21078 this.dependencies = []; |
| 21054 // Initializers done | 21079 // Initializers done |
| 21055 Value.call(this, type, code, span, !$notnull_bool(isConst)); | 21080 Value.call(this, type, code, span, !$notnull_bool(isConst)); |
| 21081 for (var $i = 0;$i < _dependencies.length; $i++) { |
| 21082 var dep = _dependencies.$index($i); |
| 21083 this.dependencies.add(dep); |
| 21084 this.dependencies.addAll((($0 = dep.get$dependencies()) && $0.is$Collection$
E())); |
| 21085 } |
| 21056 } | 21086 } |
| 21057 $inherits(GlobalValue, Value); | 21087 $inherits(GlobalValue, Value); |
| 21058 GlobalValue.prototype.is$GlobalValue = function(){return this;}; | 21088 GlobalValue.prototype.is$GlobalValue = function(){return this;}; |
| 21059 GlobalValue.prototype.is$Comparable = function(){return this;}; | 21089 GlobalValue.prototype.is$Comparable = function(){return this;}; |
| 21060 GlobalValue.GlobalValue$fromStatic$factory = function(field, exp, dependencies)
{ | 21090 GlobalValue.GlobalValue$fromStatic$factory = function(field, exp, dependencies)
{ |
| 21091 var $0; |
| 21061 var code = ($notnull_bool(exp.get$isConst()) ? exp.get$canonicalCode() : exp.c
ode); | 21092 var code = ($notnull_bool(exp.get$isConst()) ? exp.get$canonicalCode() : exp.c
ode); |
| 21062 var codeWithComment = ('' + code + '/*' + field.get$declaringType().get$name()
+ '.' + field.get$name() + '*/'); | 21093 var codeWithComment = ('' + code + '/*' + field.get$declaringType().get$name()
+ '.' + field.get$name() + '*/'); |
| 21063 return new GlobalValue(exp.type, $assert_String(codeWithComment), $assert_bool
(field.get$isFinal()), field, null, exp, code, exp.span, dependencies.filter$1((
function (d) { | 21094 return new GlobalValue(exp.type, $assert_String(codeWithComment), $assert_bool
(field.get$isFinal()), field, null, exp, code, exp.span, (($0 = dependencies.fil
ter$1((function (d) { |
| 21064 return (d instanceof GlobalValue); | 21095 return (d instanceof GlobalValue); |
| 21065 }) | 21096 }) |
| 21066 )); | 21097 )) && $0.is$List$GlobalValue())); |
| 21067 } | 21098 } |
| 21068 GlobalValue.GlobalValue$fromConst$factory = function(uniqueId, exp, dependencies
) { | 21099 GlobalValue.GlobalValue$fromConst$factory = function(uniqueId, exp, dependencies
) { |
| 21100 var $0; |
| 21069 var name = ("const\$" + uniqueId); | 21101 var name = ("const\$" + uniqueId); |
| 21070 var codeWithComment = ("" + name + "/*" + exp.span.get$text() + "*/"); | 21102 var codeWithComment = ("" + name + "/*" + exp.span.get$text() + "*/"); |
| 21071 return new GlobalValue(exp.type, $assert_String(codeWithComment), true, null,
name, exp, name, exp.span, dependencies.filter$1((function (d) { | 21103 return new GlobalValue(exp.type, $assert_String(codeWithComment), true, null,
name, exp, name, exp.span, (($0 = dependencies.filter$1((function (d) { |
| 21072 return (d instanceof GlobalValue); | 21104 return (d instanceof GlobalValue); |
| 21073 }) | 21105 }) |
| 21074 )); | 21106 )) && $0.is$List$GlobalValue())); |
| 21075 } | 21107 } |
| 21076 GlobalValue.prototype.get$field = function() { return this.field; }; | 21108 GlobalValue.prototype.get$field = function() { return this.field; }; |
| 21077 GlobalValue.prototype.set$field = function(value) { return this.field = value; }
; | 21109 GlobalValue.prototype.set$field = function(value) { return this.field = value; }
; |
| 21078 GlobalValue.prototype.get$name = function() { return this.name; }; | 21110 GlobalValue.prototype.get$name = function() { return this.name; }; |
| 21079 GlobalValue.prototype.set$name = function(value) { return this.name = value; }; | 21111 GlobalValue.prototype.set$name = function(value) { return this.name = value; }; |
| 21080 GlobalValue.prototype.get$exp = function() { return this.exp; }; | 21112 GlobalValue.prototype.get$exp = function() { return this.exp; }; |
| 21081 GlobalValue.prototype.set$exp = function(value) { return this.exp = value; }; | 21113 GlobalValue.prototype.set$exp = function(value) { return this.exp = value; }; |
| 21082 GlobalValue.prototype.get$canonicalCode = function() { return this.canonicalCode
; }; | 21114 GlobalValue.prototype.get$canonicalCode = function() { return this.canonicalCode
; }; |
| 21083 GlobalValue.prototype.set$canonicalCode = function(value) { return this.canonica
lCode = value; }; | 21115 GlobalValue.prototype.set$canonicalCode = function(value) { return this.canonica
lCode = value; }; |
| 21084 GlobalValue.prototype.get$isConst = function() { | 21116 GlobalValue.prototype.get$isConst = function() { |
| 21085 return $notnull_bool(this.exp.get$isConst()) && (this.field == null || $notnul
l_bool(this.field.isFinal)); | 21117 return $notnull_bool(this.exp.get$isConst()) && (this.field == null || $notnul
l_bool(this.field.isFinal)); |
| 21086 } | 21118 } |
| 21087 GlobalValue.prototype.get$actualValue = function() { | 21119 GlobalValue.prototype.get$actualValue = function() { |
| 21088 return this.exp.get$dynamic().get$actualValue(); | 21120 return this.exp.get$dynamic().get$actualValue(); |
| 21089 } | 21121 } |
| 21122 GlobalValue.prototype.get$dependencies = function() { return this.dependencies;
}; |
| 21123 GlobalValue.prototype.set$dependencies = function(value) { return this.dependenc
ies = value; }; |
| 21090 GlobalValue.prototype.compareTo = function(other) { | 21124 GlobalValue.prototype.compareTo = function(other) { |
| 21091 if ($eq(other, this)) { | 21125 if ($eq(other, this)) { |
| 21092 return 0; | 21126 return 0; |
| 21093 } | 21127 } |
| 21094 else if (this.dependencies.indexOf(other, 0) >= 0) { | 21128 else if (this.dependencies.indexOf(other, 0) >= 0) { |
| 21095 return 1; | 21129 return 1; |
| 21096 } | 21130 } |
| 21097 else if (other.dependencies.indexOf(this, 0) >= 0) { | 21131 else if (other.dependencies.indexOf(this, 0) >= 0) { |
| 21098 return -1; | 21132 return -1; |
| 21099 } | 21133 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 21130 BareValue.prototype._ensureCode = function() { | 21164 BareValue.prototype._ensureCode = function() { |
| 21131 if (this.code != null) return; | 21165 if (this.code != null) return; |
| 21132 if ($notnull_bool(this.isType)) { | 21166 if ($notnull_bool(this.isType)) { |
| 21133 this.code = this.type.get$jsname(); | 21167 this.code = this.type.get$jsname(); |
| 21134 } | 21168 } |
| 21135 else { | 21169 else { |
| 21136 this.code = this.home._makeThisCode(); | 21170 this.code = this.home._makeThisCode(); |
| 21137 } | 21171 } |
| 21138 } | 21172 } |
| 21139 BareValue.prototype._tryResolveMember = function(context, name) { | 21173 BareValue.prototype._tryResolveMember = function(context, name) { |
| 21140 $assert($eq(context, this.home), "context == home", "value.dart", 699, 12); | 21174 $assert($eq(context, this.home), "context == home", "value.dart", 705, 12); |
| 21141 var member = this.type.resolveMember(name); | 21175 var member = this.type.resolveMember(name); |
| 21142 if ($notnull_bool($ne(member, null))) { | 21176 if ($notnull_bool($ne(member, null))) { |
| 21143 this._ensureCode(); | 21177 this._ensureCode(); |
| 21144 return member; | 21178 return member; |
| 21145 } | 21179 } |
| 21146 member = this.home.get$library().lookup(name, this.span); | 21180 member = this.home.get$library().lookup(name, this.span); |
| 21147 if ($notnull_bool($ne(member, null))) { | 21181 if ($notnull_bool($ne(member, null))) { |
| 21148 return member; | 21182 return member; |
| 21149 } | 21183 } |
| 21150 this._ensureCode(); | 21184 this._ensureCode(); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21230 mset.get$members().add$1(member); | 21264 mset.get$members().add$1(member); |
| 21231 } | 21265 } |
| 21232 } | 21266 } |
| 21233 World.prototype._addTopName = function(named) { | 21267 World.prototype._addTopName = function(named) { |
| 21234 var $0; | 21268 var $0; |
| 21235 var existing = this._topNames.$index(named.get$name()); | 21269 var existing = this._topNames.$index(named.get$name()); |
| 21236 if ($notnull_bool($ne(existing, null))) { | 21270 if ($notnull_bool($ne(existing, null))) { |
| 21237 this.info(('mangling matching top level name "' + named.get$name() + '" in '
) + ('both "' + named.get$library().name + '" and "' + existing.get$library().ge
t$name() + '"')); | 21271 this.info(('mangling matching top level name "' + named.get$name() + '" in '
) + ('both "' + named.get$library().name + '" and "' + existing.get$library().ge
t$name() + '"')); |
| 21238 if ($notnull_bool(named.get$isNative())) { | 21272 if ($notnull_bool(named.get$isNative())) { |
| 21239 if ($notnull_bool(existing.get$isNative())) { | 21273 if ($notnull_bool(existing.get$isNative())) { |
| 21240 world.internalError(('conflicting native names "' + named.get$name() + '
" ') + ('(already defined in ' + existing.get$span().get$locationText() + ')'),
(($0 = named.get$span()) && $0.is$SourceSpan())); | 21274 $globals.world.internalError(('conflicting native names "' + named.get$n
ame() + '" ') + ('(already defined in ' + existing.get$span().get$locationText()
+ ')'), (($0 = named.get$span()) && $0.is$SourceSpan())); |
| 21241 } | 21275 } |
| 21242 else { | 21276 else { |
| 21243 this._topNames.$setindex(named.get$name(), named); | 21277 this._topNames.$setindex(named.get$name(), named); |
| 21244 this._addJavascriptTopName((existing && existing.is$Named())); | 21278 this._addJavascriptTopName((existing && existing.is$Named())); |
| 21245 } | 21279 } |
| 21246 } | 21280 } |
| 21247 else if ($notnull_bool(named.get$library().get$isCore())) { | 21281 else if ($notnull_bool(named.get$library().get$isCore())) { |
| 21248 if ($notnull_bool(existing.get$library().get$isCore())) { | 21282 if ($notnull_bool(existing.get$library().get$isCore())) { |
| 21249 world.internalError(('conflicting top-level names in core "' + named.get
$name() + '" ') + ('(previously defined in ' + existing.get$span().get$locationT
ext() + ')'), (($0 = named.get$span()) && $0.is$SourceSpan())); | 21283 $globals.world.internalError(('conflicting top-level names in core "' +
named.get$name() + '" ') + ('(previously defined in ' + existing.get$span().get$
locationText() + ')'), (($0 = named.get$span()) && $0.is$SourceSpan())); |
| 21250 } | 21284 } |
| 21251 else { | 21285 else { |
| 21252 this._topNames.$setindex(named.get$name(), named); | 21286 this._topNames.$setindex(named.get$name(), named); |
| 21253 this._addJavascriptTopName((existing && existing.is$Named())); | 21287 this._addJavascriptTopName((existing && existing.is$Named())); |
| 21254 } | 21288 } |
| 21255 } | 21289 } |
| 21256 else { | 21290 else { |
| 21257 this._addJavascriptTopName(named); | 21291 this._addJavascriptTopName(named); |
| 21258 } | 21292 } |
| 21259 } | 21293 } |
| 21260 else { | 21294 else { |
| 21261 this._topNames.$setindex(named.get$name(), named); | 21295 this._topNames.$setindex(named.get$name(), named); |
| 21262 } | 21296 } |
| 21263 } | 21297 } |
| 21264 World.prototype._addJavascriptTopName = function(named) { | 21298 World.prototype._addJavascriptTopName = function(named) { |
| 21265 var $0; | 21299 var $0; |
| 21266 named.set$jsname(('' + named.get$library().get$jsname() + '_' + named.get$name
())); | 21300 named.set$jsname(('' + named.get$library().get$jsname() + '_' + named.get$name
())); |
| 21267 var existing = this._topNames.$index(named.get$jsname()); | 21301 var existing = this._topNames.$index(named.get$jsname()); |
| 21268 if ($notnull_bool($ne(existing, null)) && $notnull_bool($ne(existing, named)))
{ | 21302 if ($notnull_bool($ne(existing, null)) && $notnull_bool($ne(existing, named)))
{ |
| 21269 world.internalError(('name mangling failed for "' + named.get$jsname() + '"
') + ('("' + named.get$jsname() + '" defined also in ' + existing.get$span().get
$locationText() + ')'), (($0 = named.get$span()) && $0.is$SourceSpan())); | 21303 $globals.world.internalError(('name mangling failed for "' + named.get$jsnam
e() + '" ') + ('("' + named.get$jsname() + '" defined also in ' + existing.get$s
pan().get$locationText() + ')'), (($0 = named.get$span()) && $0.is$SourceSpan())
); |
| 21270 } | 21304 } |
| 21271 this._topNames.$setindex(named.get$jsname(), named); | 21305 this._topNames.$setindex(named.get$jsname(), named); |
| 21272 } | 21306 } |
| 21273 World.prototype._addType = function(type) { | 21307 World.prototype._addType = function(type) { |
| 21274 if (!$notnull_bool(type.get$isTop())) this._addTopName(type); | 21308 if (!$notnull_bool(type.get$isTop())) this._addTopName(type); |
| 21275 } | 21309 } |
| 21276 World.prototype._addToCoreLib = function(name, isClass) { | 21310 World.prototype._addToCoreLib = function(name, isClass) { |
| 21277 var ret = new DefinedType(name, this.corelib, null, isClass); | 21311 var ret = new DefinedType(name, this.corelib, null, isClass); |
| 21278 this.corelib.types.$setindex(name, ret); | 21312 this.corelib.types.$setindex(name, ret); |
| 21279 return ret; | 21313 return ret; |
| 21280 } | 21314 } |
| 21281 World.prototype.toJsIdentifier = function(name) { | 21315 World.prototype.toJsIdentifier = function(name) { |
| 21282 if (this._jsKeywords == null) { | 21316 if (this._jsKeywords == null) { |
| 21283 this._jsKeywords = HashSetImplementation.HashSetImplementation$from$factory(
['break', 'case', 'catch', 'continue', 'debugger', 'default', 'delete', 'do', 'e
lse', 'finally', 'for', 'function', 'if', 'in', 'instanceof', 'new', 'return', '
switch', 'this', 'throw', 'try', 'typeof', 'var', 'void', 'while', 'with', 'clas
s', 'enum', 'export', 'extends', 'import', 'super', 'implements', 'interface', '
let', 'package', 'private', 'protected', 'public', 'static', 'yield', 'native'])
; | 21317 this._jsKeywords = HashSetImplementation.HashSetImplementation$from$factory(
['break', 'case', 'catch', 'continue', 'debugger', 'default', 'delete', 'do', 'e
lse', 'finally', 'for', 'function', 'if', 'in', 'instanceof', 'new', 'return', '
switch', 'this', 'throw', 'try', 'typeof', 'var', 'void', 'while', 'with', 'clas
s', 'enum', 'export', 'extends', 'import', 'super', 'implements', 'interface', '
let', 'package', 'private', 'protected', 'public', 'static', 'yield', 'native'])
; |
| 21284 } | 21318 } |
| 21285 if (this._jsKeywords.contains(name)) { | 21319 if (this._jsKeywords.contains(name)) { |
| 21286 return name + '_'; | 21320 return name + '_'; |
| 21287 } | 21321 } |
| 21288 else { | 21322 else { |
| 21289 return name; | 21323 return name; |
| 21290 } | 21324 } |
| 21291 } | 21325 } |
| 21292 World.prototype.compile = function() { | 21326 World.prototype.compile = function() { |
| 21293 if (options.dartScript == null) { | 21327 if ($globals.options.dartScript == null) { |
| 21294 this.fatal('no script provided to compile'); | 21328 this.fatal('no script provided to compile'); |
| 21295 return false; | 21329 return false; |
| 21296 } | 21330 } |
| 21297 try { | 21331 try { |
| 21298 this.info(('compiling ' + options.dartScript + ' with corelib ' + this.corel
ib)); | 21332 this.info(('compiling ' + $globals.options.dartScript + ' with corelib ' + t
his.corelib)); |
| 21299 if (!$notnull_bool(this.runLeg())) this.runCompilationPhases(); | 21333 if (!$notnull_bool(this.runLeg())) this.runCompilationPhases(); |
| 21300 } catch (exc) { | 21334 } catch (exc) { |
| 21301 exc = $toDartException(exc); | 21335 exc = $toDartException(exc); |
| 21302 if ($notnull_bool(this.get$hasErrors()) && !$notnull_bool(options.throwOnErr
ors)) { | 21336 if ($notnull_bool(this.get$hasErrors()) && !$notnull_bool($globals.options.t
hrowOnErrors)) { |
| 21303 } | 21337 } |
| 21304 else { | 21338 else { |
| 21305 throw exc; | 21339 throw exc; |
| 21306 } | 21340 } |
| 21307 } | 21341 } |
| 21308 this.printStatus(); | 21342 this.printStatus(); |
| 21309 return !$notnull_bool(this.get$hasErrors()); | 21343 return !$notnull_bool(this.get$hasErrors()); |
| 21310 } | 21344 } |
| 21311 World.prototype.runLeg = function() { | 21345 World.prototype.runLeg = function() { |
| 21312 var $this = this; // closure support | 21346 var $this = this; // closure support |
| 21313 if (!$notnull_bool(options.enableLeg)) return false; | 21347 if (!$notnull_bool($globals.options.enableLeg)) return false; |
| 21314 var res = $assert_bool(this.withTiming('try leg compile', (function () { | 21348 var res = $assert_bool(this.withTiming('try leg compile', (function () { |
| 21315 return compile($this); | 21349 return compile($this); |
| 21316 }) | 21350 }) |
| 21317 )); | 21351 )); |
| 21318 if (!$notnull_bool(res) && $notnull_bool(options.legOnly)) { | 21352 if (!$notnull_bool(res) && $notnull_bool($globals.options.legOnly)) { |
| 21319 this.fatal(("Leg could not compile " + options.dartScript)); | 21353 this.fatal(("Leg could not compile " + $globals.options.dartScript)); |
| 21320 return true; | 21354 return true; |
| 21321 } | 21355 } |
| 21322 return res; | 21356 return res; |
| 21323 } | 21357 } |
| 21324 World.prototype.runCompilationPhases = function() { | 21358 World.prototype.runCompilationPhases = function() { |
| 21325 var $this = this; // closure support | 21359 var $this = this; // closure support |
| 21326 var lib = this.withTiming('first pass', (function () { | 21360 var lib = this.withTiming('first pass', (function () { |
| 21327 return $this.processScript(options.dartScript); | 21361 return $this.processScript($globals.options.dartScript); |
| 21328 }) | 21362 }) |
| 21329 ); | 21363 ); |
| 21330 this.withTiming('resolve top level', (function () { | 21364 this.withTiming('resolve top level', (function () { |
| 21331 $this.resolveAll(); | 21365 $this.resolveAll(); |
| 21332 }) | 21366 }) |
| 21333 ); | 21367 ); |
| 21334 this.withTiming('generate code', (function () { | 21368 this.withTiming('generate code', (function () { |
| 21335 var $0; | 21369 var $0; |
| 21336 var mainMembers = lib.get$topType().resolveMember$1('main'); | 21370 var mainMembers = lib.get$topType().resolveMember$1('main'); |
| 21337 var main = null; | 21371 var main = null; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 21351 } | 21385 } |
| 21352 var codeWriter = new CodeWriter(); | 21386 var codeWriter = new CodeWriter(); |
| 21353 $this.gen = new WorldGenerator(main, codeWriter); | 21387 $this.gen = new WorldGenerator(main, codeWriter); |
| 21354 $this.gen.run(); | 21388 $this.gen.run(); |
| 21355 $this.jsBytesWritten = $assert_num(codeWriter.get$text().length); | 21389 $this.jsBytesWritten = $assert_num(codeWriter.get$text().length); |
| 21356 }) | 21390 }) |
| 21357 ); | 21391 ); |
| 21358 } | 21392 } |
| 21359 World.prototype.getGeneratedCode = function() { | 21393 World.prototype.getGeneratedCode = function() { |
| 21360 if (this.legCode != null) { | 21394 if (this.legCode != null) { |
| 21361 $assert(options.enableLeg, "options.enableLeg", "world.dart", 310, 14); | 21395 $assert($globals.options.enableLeg, "options.enableLeg", "world.dart", 310,
14); |
| 21362 return this.legCode; | 21396 return this.legCode; |
| 21363 } | 21397 } |
| 21364 else { | 21398 else { |
| 21365 return this.gen.writer.get$text(); | 21399 return this.gen.writer.get$text(); |
| 21366 } | 21400 } |
| 21367 } | 21401 } |
| 21368 World.prototype.readFile = function(filename) { | 21402 World.prototype.readFile = function(filename) { |
| 21369 try { | 21403 try { |
| 21370 var sourceFile = this.reader.readFile(filename); | 21404 var sourceFile = this.reader.readFile(filename); |
| 21371 this.dartBytesRead += sourceFile.get$text().length; | 21405 this.dartBytesRead += sourceFile.get$text().length; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21426 } | 21460 } |
| 21427 if (span2 != null) { | 21461 if (span2 != null) { |
| 21428 print(span2.toMessageString(message)); | 21462 print(span2.toMessageString(message)); |
| 21429 } | 21463 } |
| 21430 if ($notnull_bool(throwing)) { | 21464 if ($notnull_bool(throwing)) { |
| 21431 $throw(new CompilerException(message, span)); | 21465 $throw(new CompilerException(message, span)); |
| 21432 } | 21466 } |
| 21433 } | 21467 } |
| 21434 World.prototype.error = function(message, span, span1, span2) { | 21468 World.prototype.error = function(message, span, span1, span2) { |
| 21435 this.errors++; | 21469 this.errors++; |
| 21436 this._message(('error: ' + message), span, span1, span2, options.throwOnErrors
); | 21470 this._message(('error: ' + message), span, span1, span2, $globals.options.thro
wOnErrors); |
| 21437 } | 21471 } |
| 21438 World.prototype.warning = function(message, span, span1, span2) { | 21472 World.prototype.warning = function(message, span, span1, span2) { |
| 21439 this.warnings++; | 21473 this.warnings++; |
| 21440 if ($notnull_bool(options.showWarnings)) { | 21474 if ($notnull_bool($globals.options.showWarnings)) { |
| 21441 this._message(('warning: ' + message), span, span1, span2, options.throwOnWa
rnings); | 21475 this._message(('warning: ' + message), span, span1, span2, $globals.options.
throwOnWarnings); |
| 21442 } | 21476 } |
| 21443 } | 21477 } |
| 21444 World.prototype.fatal = function(message, span, span1, span2) { | 21478 World.prototype.fatal = function(message, span, span1, span2) { |
| 21445 this.errors++; | 21479 this.errors++; |
| 21446 this.seenFatal = true; | 21480 this.seenFatal = true; |
| 21447 this._message(('fatal: ' + message), span, span1, span2, $notnull_bool(options
.throwOnFatal) || $notnull_bool(options.throwOnErrors)); | 21481 this._message(('fatal: ' + message), span, span1, span2, $notnull_bool($global
s.options.throwOnFatal) || $notnull_bool($globals.options.throwOnErrors)); |
| 21448 } | 21482 } |
| 21449 World.prototype.internalError = function(message, span, span1, span2) { | 21483 World.prototype.internalError = function(message, span, span1, span2) { |
| 21450 this._message(('We are sorry, but... ' + message), span, span1, span2, true); | 21484 this._message(('We are sorry, but... ' + message), span, span1, span2, true); |
| 21451 } | 21485 } |
| 21452 World.prototype.info = function(message, span, span1, span2) { | 21486 World.prototype.info = function(message, span, span1, span2) { |
| 21453 if ($notnull_bool(options.showInfo)) { | 21487 if ($notnull_bool($globals.options.showInfo)) { |
| 21454 this._message(('info: ' + message), span, span1, span2, false); | 21488 this._message(('info: ' + message), span, span1, span2, false); |
| 21455 } | 21489 } |
| 21456 } | 21490 } |
| 21457 World.prototype.get$hasErrors = function() { | 21491 World.prototype.get$hasErrors = function() { |
| 21458 return this.errors > 0; | 21492 return this.errors > 0; |
| 21459 } | 21493 } |
| 21460 World.prototype.printStatus = function() { | 21494 World.prototype.printStatus = function() { |
| 21461 this.info(('compiled ' + this.dartBytesRead + ' bytes Dart -> ' + this.jsBytes
Written + ' bytes JS')); | 21495 this.info(('compiled ' + this.dartBytesRead + ' bytes Dart -> ' + this.jsBytes
Written + ' bytes JS')); |
| 21462 if ($notnull_bool(this.get$hasErrors())) { | 21496 if ($notnull_bool(this.get$hasErrors())) { |
| 21463 print(('compilation failed with ' + this.errors + ' errors')); | 21497 print(('compilation failed with ' + this.errors + ' errors')); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21600 this.libDir = $assert_String(temp); | 21634 this.libDir = $assert_String(temp); |
| 21601 } | 21635 } |
| 21602 else { | 21636 else { |
| 21603 this.libDir = 'lib'; | 21637 this.libDir = 'lib'; |
| 21604 } | 21638 } |
| 21605 } | 21639 } |
| 21606 } | 21640 } |
| 21607 // ********** Code for LibraryReader ************** | 21641 // ********** Code for LibraryReader ************** |
| 21608 function LibraryReader() { | 21642 function LibraryReader() { |
| 21609 // Initializers done | 21643 // Initializers done |
| 21610 this._specialLibs = $map(['dart:core', joinPaths(options.libDir, 'corelib.dart
'), 'dart:coreimpl', joinPaths(options.libDir, 'corelib_impl.dart'), 'dart:html'
, joinPaths(options.libDir, '../../client/html/release/html.dart'), 'dart:dom',
joinPaths(options.libDir, '../../client/dom/frog/frog_dom.dart'), 'dart:json', j
oinPaths(options.libDir, 'json.dart')]); | 21644 this._specialLibs = $map(['dart:core', joinPaths($globals.options.libDir, 'cor
elib.dart'), 'dart:coreimpl', joinPaths($globals.options.libDir, 'corelib_impl.d
art'), 'dart:html', joinPaths($globals.options.libDir, '../../client/html/releas
e/html.dart'), 'dart:dom', joinPaths($globals.options.libDir, '../../client/dom/
frog/frog_dom.dart'), 'dart:json', joinPaths($globals.options.libDir, 'json.dart
')]); |
| 21611 } | 21645 } |
| 21612 LibraryReader.prototype.readFile = function(fullname) { | 21646 LibraryReader.prototype.readFile = function(fullname) { |
| 21613 var filename = this._specialLibs.$index(fullname); | 21647 var filename = this._specialLibs.$index(fullname); |
| 21614 if ($notnull_bool(filename == null)) { | 21648 if ($notnull_bool(filename == null)) { |
| 21615 filename = fullname; | 21649 filename = fullname; |
| 21616 } | 21650 } |
| 21617 if ($notnull_bool(world.files.fileExists($assert_String(filename)))) { | 21651 if ($notnull_bool($globals.world.files.fileExists($assert_String(filename))))
{ |
| 21618 return new SourceFile(filename, world.files.readAll($assert_String(filename)
)); | 21652 return new SourceFile(filename, $globals.world.files.readAll($assert_String(
filename))); |
| 21619 } | 21653 } |
| 21620 else { | 21654 else { |
| 21621 world.error(('File not found: ' + filename)); | 21655 $globals.world.error(('File not found: ' + filename)); |
| 21622 return new SourceFile(filename, ''); | 21656 return new SourceFile(filename, ''); |
| 21623 } | 21657 } |
| 21624 } | 21658 } |
| 21625 // ********** Code for VarMember ************** | 21659 // ********** Code for VarMember ************** |
| 21626 function VarMember(name) { | 21660 function VarMember(name) { |
| 21627 this.name = name; | 21661 this.name = name; |
| 21628 // Initializers done | 21662 // Initializers done |
| 21629 } | 21663 } |
| 21630 VarMember.prototype.is$VarMember = function(){return this;}; | 21664 VarMember.prototype.is$VarMember = function(){return this;}; |
| 21631 VarMember.prototype.get$name = function() { return this.name; }; | 21665 VarMember.prototype.get$name = function() { return this.name; }; |
| 21632 VarMember.prototype.get$returnType = function() { | 21666 VarMember.prototype.get$returnType = function() { |
| 21633 return world.varType; | 21667 return $globals.world.varType; |
| 21634 } | 21668 } |
| 21635 VarMember.prototype.invoke = function(context, node, target, args) { | 21669 VarMember.prototype.invoke = function(context, node, target, args) { |
| 21636 return new Value(this.get$returnType(), ('' + target.code + '.' + this.name +
'(' + args.getCode() + ')'), node.span, true); | 21670 return new Value(this.get$returnType(), ('' + target.code + '.' + this.name +
'(' + args.getCode() + ')'), node.span, true); |
| 21637 } | 21671 } |
| 21638 VarMember.prototype.generate$1 = function($0) { | 21672 VarMember.prototype.generate$1 = function($0) { |
| 21639 return this.generate(($0 && $0.is$CodeWriter())); | 21673 return this.generate(($0 && $0.is$CodeWriter())); |
| 21640 }; | 21674 }; |
| 21641 VarMember.prototype.invoke$4 = function($0, $1, $2, $3) { | 21675 VarMember.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 21642 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments())); | 21676 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments())); |
| 21643 }; | 21677 }; |
| 21644 // ********** Code for VarFunctionStub ************** | 21678 // ********** Code for VarFunctionStub ************** |
| 21645 function VarFunctionStub(name, callArgs) { | 21679 function VarFunctionStub(name, callArgs) { |
| 21646 this.args = callArgs.toCallStubArgs(); | 21680 this.args = callArgs.toCallStubArgs(); |
| 21647 // Initializers done | 21681 // Initializers done |
| 21648 VarMember.call(this, name); | 21682 VarMember.call(this, name); |
| 21649 world.gen.corejs.useGenStub = true; | 21683 $globals.world.gen.corejs.useGenStub = true; |
| 21650 } | 21684 } |
| 21651 $inherits(VarFunctionStub, VarMember); | 21685 $inherits(VarFunctionStub, VarMember); |
| 21652 VarFunctionStub.prototype.is$VarFunctionStub = function(){return this;}; | 21686 VarFunctionStub.prototype.is$VarFunctionStub = function(){return this;}; |
| 21653 VarFunctionStub.prototype.generate = function(code) { | 21687 VarFunctionStub.prototype.generate = function(code) { |
| 21654 if ($notnull_bool(this.args.get$hasNames())) { | 21688 if ($notnull_bool(this.args.get$hasNames())) { |
| 21655 this.generateNamed(code); | 21689 this.generateNamed(code); |
| 21656 } | 21690 } |
| 21657 else { | 21691 else { |
| 21658 this.generatePositional(code); | 21692 this.generatePositional(code); |
| 21659 } | 21693 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 21687 this.member = member; | 21721 this.member = member; |
| 21688 this.args = args; | 21722 this.args = args; |
| 21689 this.body = body; | 21723 this.body = body; |
| 21690 // Initializers done | 21724 // Initializers done |
| 21691 VarMember.call(this, name); | 21725 VarMember.call(this, name); |
| 21692 } | 21726 } |
| 21693 $inherits(VarMethodStub, VarMember); | 21727 $inherits(VarMethodStub, VarMember); |
| 21694 VarMethodStub.prototype.get$body = function() { return this.body; }; | 21728 VarMethodStub.prototype.get$body = function() { return this.body; }; |
| 21695 VarMethodStub.prototype.get$returnType = function() { | 21729 VarMethodStub.prototype.get$returnType = function() { |
| 21696 var $0; | 21730 var $0; |
| 21697 return (($0 = this.member != null ? this.member.get$returnType() : world.varTy
pe) && $0.is$lang_Type()); | 21731 return (($0 = this.member != null ? this.member.get$returnType() : $globals.wo
rld.varType) && $0.is$lang_Type()); |
| 21698 } | 21732 } |
| 21699 VarMethodStub.prototype.get$typeName = function() { | 21733 VarMethodStub.prototype.get$typeName = function() { |
| 21700 return this.member != null ? this.member.declaringType.get$jsname() : 'Object'
; | 21734 return this.member != null ? this.member.declaringType.get$jsname() : 'Object'
; |
| 21701 } | 21735 } |
| 21702 VarMethodStub.prototype.generate = function(code) { | 21736 VarMethodStub.prototype.generate = function(code) { |
| 21703 code.write(('' + this.get$typeName() + '.prototype.' + this.name + ' = ')); | 21737 code.write(('' + this.get$typeName() + '.prototype.' + this.name + ' = ')); |
| 21704 this.generateBody(code, ';'); | 21738 this.generateBody(code, ';'); |
| 21705 } | 21739 } |
| 21706 VarMethodStub.prototype.generateBody = function(code, end) { | 21740 VarMethodStub.prototype.generateBody = function(code, end) { |
| 21707 if ($notnull_bool(this._useDirectCall(this.member, this.args))) { | 21741 if ($notnull_bool(this._useDirectCall(this.member, this.args))) { |
| 21708 code.writeln(('' + this.get$typeName() + '.prototype.' + this.member.get$jsn
ame() + end)); | 21742 code.writeln(('' + this.get$typeName() + '.prototype.' + this.member.get$jsn
ame() + end)); |
| 21709 } | 21743 } |
| 21710 else { | 21744 else { |
| 21711 code.enterBlock(('function(' + this.args.getCode() + ') {')); | 21745 code.enterBlock(('function(' + this.args.getCode() + ') {')); |
| 21712 code.writeln(('return ' + this.body.code + ';')); | 21746 code.writeln(('return ' + this.body.code + ';')); |
| 21713 code.exitBlock(('}' + end)); | 21747 code.exitBlock(('}' + end)); |
| 21714 } | 21748 } |
| 21715 } | 21749 } |
| 21716 VarMethodStub.prototype._useDirectCall = function(member, args) { | 21750 VarMethodStub.prototype._useDirectCall = function(member, args) { |
| 21717 if ((member instanceof MethodMember) && $ne(member.declaringType.get$library()
, world.get$dom())) { | 21751 if ((member instanceof MethodMember) && $ne(member.declaringType.get$library()
, $globals.world.get$dom())) { |
| 21718 var method = (member && member.is$MethodMember()); | 21752 var method = (member && member.is$MethodMember()); |
| 21719 if ($notnull_bool(method.needsArgumentConversion(args))) { | 21753 if ($notnull_bool(method.needsArgumentConversion(args))) { |
| 21720 return false; | 21754 return false; |
| 21721 } | 21755 } |
| 21722 for (var i = args.get$length(); | 21756 for (var i = args.get$length(); |
| 21723 i < method.parameters.length; i++) { | 21757 i < method.parameters.length; i++) { |
| 21724 if ($notnull_bool($ne(method.parameters.$index(i).get$value().get$code(),
'null'))) { | 21758 if ($notnull_bool($ne(method.parameters.$index(i).get$value().get$code(),
'null'))) { |
| 21725 return false; | 21759 return false; |
| 21726 } | 21760 } |
| 21727 } | 21761 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21762 var $list = this.members; | 21796 var $list = this.members; |
| 21763 for (var $i = 0;$i < $list.length; $i++) { | 21797 for (var $i = 0;$i < $list.length; $i++) { |
| 21764 var member = $list.$index($i); | 21798 var member = $list.$index($i); |
| 21765 var target = new Value(member.get$declaringType(), 'this', node.span, true); | 21799 var target = new Value(member.get$declaringType(), 'this', node.span, true); |
| 21766 var result = member.invoke$4$isDynamic(context, node, target, this.args, tru
e); | 21800 var result = member.invoke$4$isDynamic(context, node, target, this.args, tru
e); |
| 21767 var stub = new VarMethodStub(this.name, member, this.args, result); | 21801 var stub = new VarMethodStub(this.name, member, this.args, result); |
| 21768 var type = member.get$declaringType(); | 21802 var type = member.get$declaringType(); |
| 21769 if ($notnull_bool(type.get$isObject())) { | 21803 if ($notnull_bool(type.get$isObject())) { |
| 21770 objectStub = stub; | 21804 objectStub = stub; |
| 21771 } | 21805 } |
| 21772 else if ($notnull_bool($ne(type.get$library(), world.get$dom()))) { | 21806 else if ($notnull_bool($ne(type.get$library(), $globals.world.get$dom()))) { |
| 21773 VarMethodSet._addVarStub((type && type.is$lang_Type()), (stub && stub.is$V
arMember())); | 21807 VarMethodSet._addVarStub((type && type.is$lang_Type()), (stub && stub.is$V
arMember())); |
| 21774 } | 21808 } |
| 21775 else { | 21809 else { |
| 21776 this._fallbackStubs.add(stub); | 21810 this._fallbackStubs.add(stub); |
| 21777 } | 21811 } |
| 21778 } | 21812 } |
| 21779 if ($notnull_bool(objectStub == null)) { | 21813 if ($notnull_bool(objectStub == null)) { |
| 21780 var target = new Value(world.objectType, 'this', node.span, true); | 21814 var target = new Value($globals.world.objectType, 'this', node.span, true); |
| 21781 var result = target.invokeNoSuchMethod(context, this.get$baseName(), node, t
his.args); | 21815 var result = target.invokeNoSuchMethod(context, this.get$baseName(), node, t
his.args); |
| 21782 objectStub = new VarMethodStub(this.name, null, this.args, result); | 21816 objectStub = new VarMethodStub(this.name, null, this.args, result); |
| 21783 } | 21817 } |
| 21784 if (this._fallbackStubs.length == 0) { | 21818 if (this._fallbackStubs.length == 0) { |
| 21785 VarMethodSet._addVarStub(world.objectType, (objectStub && objectStub.is$VarM
ember())); | 21819 VarMethodSet._addVarStub($globals.world.objectType, (objectStub && objectStu
b.is$VarMember())); |
| 21786 } | 21820 } |
| 21787 else { | 21821 else { |
| 21788 this._fallbackStubs.add(objectStub); | 21822 this._fallbackStubs.add(objectStub); |
| 21789 world.gen.corejs.useVarMethod = true; | 21823 $globals.world.gen.corejs.useVarMethod = true; |
| 21790 } | 21824 } |
| 21791 } | 21825 } |
| 21792 VarMethodSet._addVarStub = function(type, stub) { | 21826 VarMethodSet._addVarStub = function(type, stub) { |
| 21793 if (type.varStubs == null) type.varStubs = $map([]); | 21827 if (type.varStubs == null) type.varStubs = $map([]); |
| 21794 type.varStubs.$setindex(stub.name, stub); | 21828 type.varStubs.$setindex(stub.name, stub); |
| 21795 } | 21829 } |
| 21796 VarMethodSet.prototype.generate = function(code) { | 21830 VarMethodSet.prototype.generate = function(code) { |
| 21797 if (this._fallbackStubs.length == 0) return; | 21831 if (this._fallbackStubs.length == 0) return; |
| 21798 code.enterBlock(('\$varMethod("' + this.name + '", {')); | 21832 code.enterBlock(('\$varMethod("' + this.name + '", {')); |
| 21799 var lastOne = this._fallbackStubs.last(); | 21833 var lastOne = this._fallbackStubs.last(); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21889 else { | 21923 else { |
| 21890 return text.substring(1); | 21924 return text.substring(1); |
| 21891 } | 21925 } |
| 21892 } | 21926 } |
| 21893 else { | 21927 else { |
| 21894 return text; | 21928 return text; |
| 21895 } | 21929 } |
| 21896 } | 21930 } |
| 21897 var world; | 21931 var world; |
| 21898 function initializeWorld(files) { | 21932 function initializeWorld(files) { |
| 21899 $assert(world == null, "world == null", "world.dart", 13, 10); | 21933 $assert($globals.world == null, "world == null", "world.dart", 13, 10); |
| 21900 world = new World(files); | 21934 $globals.world = new World(files); |
| 21901 world.init(); | 21935 $globals.world.init(); |
| 21902 } | 21936 } |
| 21903 function lang_compile(homedir, args, files) { | 21937 function lang_compile(homedir, args, files) { |
| 21904 parseOptions(homedir, args, files); | 21938 parseOptions(homedir, args, files); |
| 21905 initializeWorld(files); | 21939 initializeWorld(files); |
| 21906 var success = world.compile(); | 21940 var success = $globals.world.compile(); |
| 21907 if (options.outfile != null) { | 21941 if ($globals.options.outfile != null) { |
| 21908 if ($notnull_bool(success)) { | 21942 if ($notnull_bool(success)) { |
| 21909 var code = world.getGeneratedCode(); | 21943 var code = $globals.world.getGeneratedCode(); |
| 21910 if (!options.outfile.endsWith('.js')) { | 21944 if (!$globals.options.outfile.endsWith('.js')) { |
| 21911 code = '#!/usr/bin/env node\n' + code; | 21945 code = '#!/usr/bin/env node\n' + code; |
| 21912 } | 21946 } |
| 21913 world.files.writeString(options.outfile, $assert_String(code)); | 21947 $globals.world.files.writeString($globals.options.outfile, $assert_String(
code)); |
| 21914 } | 21948 } |
| 21915 else { | 21949 else { |
| 21916 world.files.writeString(options.outfile, "throw 'Sorry, but I could not ge
nerate reasonable code to run.\\n';"); | 21950 $globals.world.files.writeString($globals.options.outfile, "throw 'Sorry,
but I could not generate reasonable code to run.\\n';"); |
| 21917 } | 21951 } |
| 21918 } | 21952 } |
| 21919 return $assert_bool(success); | 21953 return $assert_bool(success); |
| 21920 } | 21954 } |
| 21921 var options; | 21955 var options; |
| 21922 function parseOptions(homedir, args, files) { | 21956 function parseOptions(homedir, args, files) { |
| 21923 $assert(options == null, "options == null", "frog_options.dart", 10, 10); | 21957 $assert($globals.options == null, "options == null", "frog_options.dart", 10,
10); |
| 21924 options = new FrogOptions(homedir, args, files); | 21958 $globals.options = new FrogOptions(homedir, args, files); |
| 21925 } | 21959 } |
| 21926 function _getCallStubName(name, args) { | 21960 function _getCallStubName(name, args) { |
| 21927 var nameBuilder = new StringBufferImpl(('' + name + '\$' + args.get$bareCount(
))); | 21961 var nameBuilder = new StringBufferImpl(('' + name + '\$' + args.get$bareCount(
))); |
| 21928 for (var i = args.get$bareCount(); | 21962 for (var i = args.get$bareCount(); |
| 21929 i < args.get$length(); i++) { | 21963 i < args.get$length(); i++) { |
| 21930 nameBuilder.add('\$').add(args.getName(i)); | 21964 nameBuilder.add('\$').add(args.getName(i)); |
| 21931 } | 21965 } |
| 21932 return nameBuilder.toString(); | 21966 return nameBuilder.toString(); |
| 21933 } | 21967 } |
| 21934 // ********** Library frog ************** | 21968 // ********** Library frog ************** |
| 21935 // ********** Code for top level ************** | 21969 // ********** Code for top level ************** |
| 21936 function main() { | 21970 function main() { |
| 21937 var homedir = path.dirname(fs.realpathSync($assert_String(process.argv.$index(
1)))); | 21971 var homedir = path.dirname(fs.realpathSync($assert_String(process.argv.$index(
1)))); |
| 21938 var argv = ListFactory.ListFactory$from$factory(process.argv); | 21972 var argv = ListFactory.ListFactory$from$factory(process.argv); |
| 21939 if ($notnull_bool(lang_compile($assert_String(homedir), (argv && argv.is$List$
String()), new NodeFileSystem()))) { | 21973 if ($notnull_bool(lang_compile($assert_String(homedir), (argv && argv.is$List$
String()), new NodeFileSystem()))) { |
| 21940 var code = world.getGeneratedCode(); | 21974 var code = $globals.world.getGeneratedCode(); |
| 21941 if (!$notnull_bool(options.compileOnly)) { | 21975 if (!$notnull_bool($globals.options.compileOnly)) { |
| 21942 process.argv = [argv.$index(0), argv.$index(1)]; | 21976 process.argv = [argv.$index(0), argv.$index(1)]; |
| 21943 process.argv.addAll(options.childArgs); | 21977 process.argv.addAll($globals.options.childArgs); |
| 21944 vm.runInNewContext($assert_String(code), createSandbox()); | 21978 vm.runInNewContext($assert_String(code), createSandbox()); |
| 21945 } | 21979 } |
| 21946 } | 21980 } |
| 21947 else { | 21981 else { |
| 21948 process.exit(1); | 21982 process.exit(1); |
| 21949 } | 21983 } |
| 21950 } | 21984 } |
| 21951 // ********** Globals ************** | 21985 // ********** Globals ************** |
| 21952 var const$0 = new NoMoreElementsException()/*const NoMoreElementsException()*/; | 21986 function $static_init(){ |
| 21953 var const$10 = new StringWrapper('String')/*const SourceString('String')*/; | 21987 $globals.HTracer__singleton = null; |
| 21954 var const$100 = new Keyword("operator", true)/*const Keyword("operator", true)*/
; | 21988 } |
| 21955 var const$102 = new Keyword("set", true)/*const Keyword("set", true)*/; | 21989 const$0 = new NoMoreElementsException()/*const NoMoreElementsException()*/; |
| 21956 var const$104 = new Keyword("source", true)/*const Keyword("source", true)*/; | 21990 const$1 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/; |
| 21957 var const$106 = new Keyword("static", true)/*const Keyword("static", true)*/; | 21991 const$10 = new StringWrapper('Dynamic')/*const SourceString('Dynamic')*/; |
| 21958 var const$108 = new Keyword("typedef", true)/*const Keyword("typedef", true)*/; | 21992 const$100 = new Keyword("negate", true)/*const Keyword("negate", true)*/; |
| 21959 var const$112 = new StringWrapper('EOF')/*const SourceString('EOF')*/; | 21993 const$102 = new Keyword("operator", true)/*const Keyword("operator", true)*/; |
| 21960 var const$12 = new IllegalAccessException()/*const IllegalAccessException()*/; | 21994 const$104 = new Keyword("set", true)/*const Keyword("set", true)*/; |
| 21961 var const$13 = ImmutableList.ImmutableList$from$factory([])/*const []*/; | 21995 const$106 = new Keyword("source", true)/*const Keyword("source", true)*/; |
| 21962 var const$14 = new LinkTail()/*const EmptyLink<Token>()*/; | 21996 const$108 = new Keyword("static", true)/*const Keyword("static", true)*/; |
| 21963 var const$199 = new ElementKind('class')/*const ElementKind('class')*/; | 21997 const$110 = new Keyword("typedef", true)/*const Keyword("typedef", true)*/; |
| 21964 var const$2 = new StringWrapper('global scope')/*const SourceString('global scop
e')*/; | 21998 const$114 = new StringWrapper('EOF')/*const SourceString('EOF')*/; |
| 21965 var const$201 = new ElementKind('function')/*const ElementKind('function')*/; | 21999 const$12 = new StringWrapper('String')/*const SourceString('String')*/; |
| 21966 var const$203 = new StringWrapper('JS')/*const SourceString('JS')*/; | 22000 const$14 = new IllegalAccessException()/*const IllegalAccessException()*/; |
| 21967 var const$204 = new ElementKind('foreign')/*const ElementKind('foreign')*/; | 22001 const$15 = ImmutableList.ImmutableList$from$factory([])/*const []*/; |
| 21968 var const$206 = new StringWrapper('main')/*const SourceString('main')*/; | 22002 const$16 = new LinkTail()/*const EmptyLink<Token>()*/; |
| 21969 var const$208 = new StringWrapper(';')/*const SourceString(';')*/; | 22003 const$201 = new ElementKind('class')/*const ElementKind('class')*/; |
| 21970 var const$209 = new NodeList()/*const Prefix()*/; | 22004 const$203 = new ElementKind('function')/*const ElementKind('function')*/; |
| 21971 var const$210 = new Prefix()/*const Prefix()*/; | 22005 const$205 = new StringWrapper('JS')/*const SourceString('JS')*/; |
| 21972 var const$211 = new Postfix()/*const Postfix()*/; | 22006 const$206 = new ElementKind('foreign')/*const ElementKind('foreign')*/; |
| 21973 var const$212 = new ImmutableMap([])/*const {}*/; | 22007 const$208 = new StringWrapper('main')/*const SourceString('main')*/; |
| 21974 var const$213 = new StringWrapper('+')/*const SourceString('+')*/; | 22008 const$210 = new StringWrapper(';')/*const SourceString(';')*/; |
| 21975 var const$214 = new StringWrapper('add')/*const SourceString('add')*/; | 22009 const$211 = new NodeList()/*const Prefix()*/; |
| 21976 var const$215 = new StringWrapper('-')/*const SourceString('-')*/; | 22010 const$212 = new Prefix()/*const Prefix()*/; |
| 21977 var const$216 = new StringWrapper('sub')/*const SourceString('sub')*/; | 22011 const$213 = new Postfix()/*const Postfix()*/; |
| 21978 var const$217 = new StringWrapper('*')/*const SourceString('*')*/; | 22012 const$214 = new ImmutableMap([])/*const {}*/; |
| 21979 var const$218 = new StringWrapper('mul')/*const SourceString('mul')*/; | 22013 const$215 = new StringWrapper('+')/*const SourceString('+')*/; |
| 21980 var const$219 = new StringWrapper('/')/*const SourceString('/')*/; | 22014 const$216 = new StringWrapper('add')/*const SourceString('add')*/; |
| 21981 var const$22 = new Keyword("break", false)/*const Keyword("break")*/; | 22015 const$217 = new StringWrapper('-')/*const SourceString('-')*/; |
| 21982 var const$220 = new StringWrapper('div')/*const SourceString('div')*/; | 22016 const$218 = new StringWrapper('sub')/*const SourceString('sub')*/; |
| 21983 var const$221 = new StringWrapper('~/')/*const SourceString('~/')*/; | 22017 const$219 = new StringWrapper('*')/*const SourceString('*')*/; |
| 21984 var const$222 = new StringWrapper('tdiv')/*const SourceString('tdiv')*/; | 22018 const$220 = new StringWrapper('mul')/*const SourceString('mul')*/; |
| 21985 var const$223 = new StringWrapper('==')/*const SourceString('==')*/; | 22019 const$221 = new StringWrapper('/')/*const SourceString('/')*/; |
| 21986 var const$224 = new StringWrapper('eq')/*const SourceString('eq')*/; | 22020 const$222 = new StringWrapper('div')/*const SourceString('div')*/; |
| 21987 var const$225 = new StringWrapper('<')/*const SourceString('<')*/; | 22021 const$223 = new StringWrapper('~/')/*const SourceString('~/')*/; |
| 21988 var const$226 = new StringWrapper('lt')/*const SourceString('lt')*/; | 22022 const$224 = new StringWrapper('tdiv')/*const SourceString('tdiv')*/; |
| 21989 var const$227 = new StringWrapper('&&')/*const SourceString('&&')*/; | 22023 const$225 = new StringWrapper('==')/*const SourceString('==')*/; |
| 21990 var const$228 = new StringWrapper('||')/*const SourceString('||')*/; | 22024 const$226 = new StringWrapper('eq')/*const SourceString('eq')*/; |
| 21991 var const$229 = new StringWrapper('var')/*const SourceString('var')*/; | 22025 const$227 = new StringWrapper('<')/*const SourceString('<')*/; |
| 21992 var const$230 = new ElementKind('variable')/*const ElementKind('variable')*/; | 22026 const$228 = new StringWrapper('lt')/*const SourceString('lt')*/; |
| 21993 var const$236 = new WarningKind('cannot return value from void function')/*const
WarningKind( | 22027 const$229 = new StringWrapper('&&')/*const SourceString('&&')*/; |
| 22028 const$230 = new StringWrapper('||')/*const SourceString('||')*/; |
| 22029 const$231 = new StringWrapper('var')/*const SourceString('var')*/; |
| 22030 const$232 = new ElementKind('variable')/*const ElementKind('variable')*/; |
| 22031 const$238 = new WarningKind('cannot return value from void function')/*const War
ningKind( |
| 21994 'cannot return value from void function')*/; | 22032 'cannot return value from void function')*/; |
| 21995 var const$238 = new WarningKind('#{1} is not assignable to #{2}')/*const Warning
Kind( | 22033 const$24 = new Keyword("break", false)/*const Keyword("break")*/; |
| 22034 const$240 = new WarningKind('#{1} is not assignable to #{2}')/*const WarningKind
( |
| 21996 '#{1} is not assignable to #{2}')*/; | 22035 '#{1} is not assignable to #{2}')*/; |
| 21997 var const$24 = new Keyword("case", false)/*const Keyword("case")*/; | 22036 const$242 = new WarningKind('value of type #{1} expected')/*const WarningKind( |
| 21998 var const$240 = new WarningKind('value of type #{1} expected')/*const WarningKin
d( | |
| 21999 'value of type #{1} expected')*/; | 22037 'value of type #{1} expected')*/; |
| 22000 var const$242 = new StringWrapper('=')/*const SourceString('=')*/; | 22038 const$244 = new StringWrapper('=')/*const SourceString('=')*/; |
| 22001 var const$243 = new WarningKind('variable cannot be of type void')/*const Warnin
gKind( | 22039 const$245 = new WarningKind('variable cannot be of type void')/*const WarningKin
d( |
| 22002 'variable cannot be of type void')*/; | 22040 'variable cannot be of type void')*/; |
| 22003 var const$245 = new WarningKind('expression does not yield a value')/*const Warn
ingKind( | 22041 const$247 = new WarningKind('expression does not yield a value')/*const WarningK
ind( |
| 22004 'expression does not yield a value')*/; | 22042 'expression does not yield a value')*/; |
| 22005 var const$255 = new StringWrapper("&&")/*const SourceString("&&")*/; | 22043 const$257 = new StringWrapper("&&")/*const SourceString("&&")*/; |
| 22006 var const$256 = new StringWrapper("||")/*const SourceString("||")*/; | 22044 const$258 = new StringWrapper("||")/*const SourceString("||")*/; |
| 22007 var const$257 = new StringWrapper("+")/*const SourceString("+")*/; | 22045 const$259 = new StringWrapper("+")/*const SourceString("+")*/; |
| 22008 var const$258 = new StringWrapper("-")/*const SourceString("-")*/; | 22046 const$26 = new Keyword("case", false)/*const Keyword("case")*/; |
| 22009 var const$259 = new StringWrapper("*")/*const SourceString("*")*/; | 22047 const$260 = new StringWrapper("-")/*const SourceString("-")*/; |
| 22010 var const$26 = new Keyword("catch", false)/*const Keyword("catch")*/; | 22048 const$261 = new StringWrapper("*")/*const SourceString("*")*/; |
| 22011 var const$260 = new StringWrapper("/")/*const SourceString("/")*/; | 22049 const$262 = new StringWrapper("/")/*const SourceString("/")*/; |
| 22012 var const$261 = new StringWrapper("~/")/*const SourceString("~/")*/; | 22050 const$263 = new StringWrapper("~/")/*const SourceString("~/")*/; |
| 22013 var const$262 = new StringWrapper("==")/*const SourceString("==")*/; | 22051 const$264 = new StringWrapper("==")/*const SourceString("==")*/; |
| 22014 var const$265 = ImmutableList.ImmutableList$from$factory(["__PROTO__", "prototyp
e"])/*const <String>["__PROTO__", "prototype"]*/; | 22052 const$267 = ImmutableList.ImmutableList$from$factory(["__PROTO__", "prototype"])
/*const <String>["__PROTO__", "prototype"]*/; |
| 22015 var const$267 = ImmutableList.ImmutableList$from$factory(["NaN", "Infinity", "un
defined", "eval", "parseInt", "parseFloat", "isNan", "isFinite", "decodeURI", "d
ecodeURIComponent", "encodeURI", "encodeURIComponent", "Object", "Function", "Ar
ray", "String", "Boolean", "Number", "Date", "RegExp", "Error", "EvalError", "Ra
ngeError", "ReferenceError", "SyntaxError", "TypeError", "URIError", "Math", "ar
guments", "escape", "unescape", "applicationCache", "closed", "Components", "con
tent", "controllers", "crypto", "defaultStatus", "dialogArguments", "directories
", "document", "frameElement", "frames", "fullScreen", "globalStorage", "history
", "innerHeight", "innerWidth", "length", "location", "locationbar", "localStora
ge", "menubar", "mozInnerScreenX", "mozInnerScreenY", "mozScreenPixelsPerCssPixe
l", "name", "navigator", "opener", "outerHeight", "outerWidth", "pageXOffset", "
pageYOffset", "parent", "personalbar", "pkcs11", "returnValue", "screen", "scrol
lbars", "scrollMaxX", "scrollMaxY", "self", "sessionStorage", "sidebar", "status
", "statusbar", "toolbar", "top", "window", "alert", "addEventListener", "atob",
"back", "blur", "btoa", "captureEvents", "clearInterval", "clearTimeout", "clos
e", "confirm", "disableExternalCapture", "dispatchEvent", "dump", "enableExterna
lCapture", "escape", "find", "focus", "forward", "GeckoActiveXObject", "getAtten
tion", "getAttentionWithCycleCount", "getComputedStyle", "getSelection", "home",
"maximize", "minimize", "moveBy", "moveTo", "open", "openDialog", "postMessage"
, "print", "prompt", "QueryInterface", "releaseEvents", "removeEventListener", "
resizeBy", "resizeTo", "restore", "routeEvent", "scroll", "scrollBy", "scrollByL
ines", "scrollByPages", "scrollTo", "setInterval", "setResizeable", "setTimeout"
, "showModalDialog", "sizeToContent", "stop", "uuescape", "updateCommands", "XPC
NativeWrapper", "XPCSafeJSOjbectWrapper", "onabort", "onbeforeunload", "onchange
", "onclick", "onclose", "oncontextmenu", "ondragdrop", "onerror", "onfocus", "o
nhashchange", "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "on
mousemove", "onmouseout", "onmouseover", "onmouseup", "onmozorientation", "onpai
nt", "onreset", "onresize", "onscroll", "onselect", "onsubmit", "onunload", "ont
ouchcancel", "ontouchend", "ontouchmove", "ontouchstart", "ongesturestart", "ong
esturechange", "ongestureend", "uneval", "getPrototypeOf", "let", "yield", "abst
ract", "int", "short", "boolean", "interface", "static", "byte", "long", "char",
"final", "native", "synchronized", "float", "package", "throws", "goto", "priva
te", "transient", "implements", "protected", "volatile", "double", "public", "at
tachEvent", "clientInformation", "clipboardData", "createPopup", "dialogHeight",
"dialogLeft", "dialogTop", "dialogWidth", "onafterprint", "onbeforedeactivate",
"onbeforeprint", "oncontrolselect", "ondeactivate", "onhelp", "onresizeend", "e
vent", "external", "Debug", "Enumerator", "Global", "Image", "ActiveXObject", "V
BArray", "Components", "toString", "getClass", "constructor", "prototype", "valu
eOf", "Anchor", "Applet", "Attr", "Canvas", "CanvasGradient", "CanvasPattern", "
CanvasRenderingContext2D", "CDATASection", "CharacterData", "Comment", "CSS2Prop
erties", "CSSRule", "CSSStyleSheet", "Document", "DocumentFragment", "DocumentTy
pe", "DOMException", "DOMImplementation", "DOMParser", "Element", "Event", "Exte
rnalInterface", "FlashPlayer", "Form", "Frame", "History", "HTMLCollection", "HT
MLDocument", "HTMLElement", "IFrame", "Image", "Input", "JSObject", "KeyEvent",
"Link", "Location", "MimeType", "MouseEvent", "Navigator", "Node", "NodeList", "
Option", "Plugin", "ProcessingInstruction", "Range", "RangeException", "Screen",
"Select", "Table", "TableCell", "TableRow", "TableSelection", "Text", "TextArea
", "UIEvent", "Window", "XMLHttpRequest", "XMLSerializer", "XPathException", "XP
athResult", "XSLTProcessor", "java", "Packages", "netscape", "sun", "JavaObject"
, "JavaClass", "JavaArray", "JavaMember", "\$wnd", "\$doc", "\$entry", "\$module
Name", "\$moduleBase", "\$gwt_version", "\$sessionId", "\$stack", "\$stackDepth"
, "\$location", "call"])/*const <String>[ | 22053 const$269 = ImmutableList.ImmutableList$from$factory(["NaN", "Infinity", "undefi
ned", "eval", "parseInt", "parseFloat", "isNan", "isFinite", "decodeURI", "decod
eURIComponent", "encodeURI", "encodeURIComponent", "Object", "Function", "Array"
, "String", "Boolean", "Number", "Date", "RegExp", "Error", "EvalError", "RangeE
rror", "ReferenceError", "SyntaxError", "TypeError", "URIError", "Math", "argume
nts", "escape", "unescape", "applicationCache", "closed", "Components", "content
", "controllers", "crypto", "defaultStatus", "dialogArguments", "directories", "
document", "frameElement", "frames", "fullScreen", "globalStorage", "history", "
innerHeight", "innerWidth", "length", "location", "locationbar", "localStorage",
"menubar", "mozInnerScreenX", "mozInnerScreenY", "mozScreenPixelsPerCssPixel",
"name", "navigator", "opener", "outerHeight", "outerWidth", "pageXOffset", "page
YOffset", "parent", "personalbar", "pkcs11", "returnValue", "screen", "scrollbar
s", "scrollMaxX", "scrollMaxY", "self", "sessionStorage", "sidebar", "status", "
statusbar", "toolbar", "top", "window", "alert", "addEventListener", "atob", "ba
ck", "blur", "btoa", "captureEvents", "clearInterval", "clearTimeout", "close",
"confirm", "disableExternalCapture", "dispatchEvent", "dump", "enableExternalCap
ture", "escape", "find", "focus", "forward", "GeckoActiveXObject", "getAttention
", "getAttentionWithCycleCount", "getComputedStyle", "getSelection", "home", "ma
ximize", "minimize", "moveBy", "moveTo", "open", "openDialog", "postMessage", "p
rint", "prompt", "QueryInterface", "releaseEvents", "removeEventListener", "resi
zeBy", "resizeTo", "restore", "routeEvent", "scroll", "scrollBy", "scrollByLines
", "scrollByPages", "scrollTo", "setInterval", "setResizeable", "setTimeout", "s
howModalDialog", "sizeToContent", "stop", "uuescape", "updateCommands", "XPCNati
veWrapper", "XPCSafeJSOjbectWrapper", "onabort", "onbeforeunload", "onchange", "
onclick", "onclose", "oncontextmenu", "ondragdrop", "onerror", "onfocus", "onhas
hchange", "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "onmous
emove", "onmouseout", "onmouseover", "onmouseup", "onmozorientation", "onpaint",
"onreset", "onresize", "onscroll", "onselect", "onsubmit", "onunload", "ontouch
cancel", "ontouchend", "ontouchmove", "ontouchstart", "ongesturestart", "ongestu
rechange", "ongestureend", "uneval", "getPrototypeOf", "let", "yield", "abstract
", "int", "short", "boolean", "interface", "static", "byte", "long", "char", "fi
nal", "native", "synchronized", "float", "package", "throws", "goto", "private",
"transient", "implements", "protected", "volatile", "double", "public", "attach
Event", "clientInformation", "clipboardData", "createPopup", "dialogHeight", "di
alogLeft", "dialogTop", "dialogWidth", "onafterprint", "onbeforedeactivate", "on
beforeprint", "oncontrolselect", "ondeactivate", "onhelp", "onresizeend", "event
", "external", "Debug", "Enumerator", "Global", "Image", "ActiveXObject", "VBArr
ay", "Components", "toString", "getClass", "constructor", "prototype", "valueOf"
, "Anchor", "Applet", "Attr", "Canvas", "CanvasGradient", "CanvasPattern", "Canv
asRenderingContext2D", "CDATASection", "CharacterData", "Comment", "CSS2Properti
es", "CSSRule", "CSSStyleSheet", "Document", "DocumentFragment", "DocumentType",
"DOMException", "DOMImplementation", "DOMParser", "Element", "Event", "External
Interface", "FlashPlayer", "Form", "Frame", "History", "HTMLCollection", "HTMLDo
cument", "HTMLElement", "IFrame", "Image", "Input", "JSObject", "KeyEvent", "Lin
k", "Location", "MimeType", "MouseEvent", "Navigator", "Node", "NodeList", "Opti
on", "Plugin", "ProcessingInstruction", "Range", "RangeException", "Screen", "Se
lect", "Table", "TableCell", "TableRow", "TableSelection", "Text", "TextArea", "
UIEvent", "Window", "XMLHttpRequest", "XMLSerializer", "XPathException", "XPathR
esult", "XSLTProcessor", "java", "Packages", "netscape", "sun", "JavaObject", "J
avaClass", "JavaArray", "JavaMember", "\$wnd", "\$doc", "\$entry", "\$moduleName
", "\$moduleBase", "\$gwt_version", "\$sessionId", "\$stack", "\$stackDepth", "\
$location", "call"])/*const <String>[ |
| 22016 // Section references are from Ecma-262 | 22054 // Section references are from Ecma-262 |
| 22017 // (http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pd
f) | 22055 // (http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pd
f) |
| 22018 | 22056 |
| 22019 // 15.1.1 Value Properties of the Global Object | 22057 // 15.1.1 Value Properties of the Global Object |
| 22020 "NaN", "Infinity", "undefined", | 22058 "NaN", "Infinity", "undefined", |
| 22021 | 22059 |
| 22022 // 15.1.2 Function Properties of the Global Object | 22060 // 15.1.2 Function Properties of the Global Object |
| 22023 "eval", "parseInt", "parseFloat", "isNan", "isFinite", | 22061 "eval", "parseInt", "parseFloat", "isNan", "isFinite", |
| 22024 | 22062 |
| 22025 // 15.1.3 URI Handling Function Properties | 22063 // 15.1.3 URI Handling Function Properties |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22136 // GWT-defined identifiers | 22174 // GWT-defined identifiers |
| 22137 "\$wnd", "\$doc", "\$entry", "\$moduleName", "\$moduleBase", | 22175 "\$wnd", "\$doc", "\$entry", "\$moduleName", "\$moduleBase", |
| 22138 "\$gwt_version", "\$sessionId", | 22176 "\$gwt_version", "\$sessionId", |
| 22139 | 22177 |
| 22140 // Identifiers used by JsStackEmulator; later set to obfuscatable | 22178 // Identifiers used by JsStackEmulator; later set to obfuscatable |
| 22141 "\$stack", "\$stackDepth", "\$location", | 22179 "\$stack", "\$stackDepth", "\$location", |
| 22142 | 22180 |
| 22143 // TODO: prove why this is necessary or remove it | 22181 // TODO: prove why this is necessary or remove it |
| 22144 "call" | 22182 "call" |
| 22145 ]*/; | 22183 ]*/; |
| 22146 var const$269 = ImmutableList.ImmutableList$from$factory(["break", "delete", "fu
nction", "return", "typeof", "case", "do", "if", "switch", "var", "catch", "else
", "in", "this", "void", "continue", "false", "instanceof", "throw", "while", "d
ebugger", "finally", "new", "true", "with", "default", "for", "null", "try", "ab
stract", "double", "goto", "native", "static", "boolean", "enum", "implements",
"package", "super", "byte", "export", "import", "private", "synchronized", "char
", "extends", "int", "protected", "throws", "class", "final", "interface", "publ
ic", "transient", "const", "float", "long", "short", "volatile"])/*const <String
>[ | 22184 const$271 = ImmutableList.ImmutableList$from$factory(["break", "delete", "functi
on", "return", "typeof", "case", "do", "if", "switch", "var", "catch", "else", "
in", "this", "void", "continue", "false", "instanceof", "throw", "while", "debug
ger", "finally", "new", "true", "with", "default", "for", "null", "try", "abstra
ct", "double", "goto", "native", "static", "boolean", "enum", "implements", "pac
kage", "super", "byte", "export", "import", "private", "synchronized", "char", "
extends", "int", "protected", "throws", "class", "final", "interface", "public",
"transient", "const", "float", "long", "short", "volatile"])/*const <String>[ |
| 22147 // These are current keywords | 22185 // These are current keywords |
| 22148 "break", "delete", "function", "return", "typeof", "case", "do", "if", | 22186 "break", "delete", "function", "return", "typeof", "case", "do", "if", |
| 22149 "switch", "var", "catch", "else", "in", "this", "void", "continue", | 22187 "switch", "var", "catch", "else", "in", "this", "void", "continue", |
| 22150 "false", "instanceof", "throw", "while", "debugger", "finally", "new", | 22188 "false", "instanceof", "throw", "while", "debugger", "finally", "new", |
| 22151 "true", "with", "default", "for", "null", "try", | 22189 "true", "with", "default", "for", "null", "try", |
| 22152 | 22190 |
| 22153 // These are future keywords | 22191 // These are future keywords |
| 22154 "abstract", "double", "goto", "native", "static", "boolean", "enum", | 22192 "abstract", "double", "goto", "native", "static", "boolean", "enum", |
| 22155 "implements", "package", "super", "byte", "export", "import", "private", | 22193 "implements", "package", "super", "byte", "export", "import", "private", |
| 22156 "synchronized", "char", "extends", "int", "protected", "throws", | 22194 "synchronized", "char", "extends", "int", "protected", "throws", |
| 22157 "class", "final", "interface", "public", "transient", "const", "float", | 22195 "class", "final", "interface", "public", "transient", "const", "float", |
| 22158 "long", "short", "volatile" | 22196 "long", "short", "volatile" |
| 22159 ]*/; | 22197 ]*/; |
| 22160 var const$271 = new ExceptionImplementation("Internal Error (Leg): UNREACHABLE")
/*const Exception("Internal Error (Leg): UNREACHABLE")*/; | 22198 const$273 = new ExceptionImplementation("Internal Error (Leg): UNREACHABLE")/*co
nst Exception("Internal Error (Leg): UNREACHABLE")*/; |
| 22161 var const$28 = new Keyword("const", false)/*const Keyword("const")*/; | 22199 const$28 = new Keyword("catch", false)/*const Keyword("catch")*/; |
| 22162 var const$3 = new EmptyQueueException()/*const EmptyQueueException()*/; | 22200 const$30 = new Keyword("const", false)/*const Keyword("const")*/; |
| 22163 var const$30 = new Keyword("continue", false)/*const Keyword("continue")*/; | 22201 const$32 = new Keyword("continue", false)/*const Keyword("continue")*/; |
| 22164 var const$32 = new Keyword("default", false)/*const Keyword("default")*/; | 22202 const$34 = new Keyword("default", false)/*const Keyword("default")*/; |
| 22165 var const$34 = new Keyword("do", false)/*const Keyword("do")*/; | 22203 const$36 = new Keyword("do", false)/*const Keyword("do")*/; |
| 22166 var const$36 = new Keyword("else", false)/*const Keyword("else")*/; | 22204 const$38 = new Keyword("else", false)/*const Keyword("else")*/; |
| 22167 var const$38 = new Keyword("false", false)/*const Keyword("false")*/; | 22205 const$386 = ImmutableList.ImmutableList$from$factory(['NullPointerException', 'O
bjectNotClosureException', 'NoSuchMethodException', 'StackOverflowException'])/*
const [ |
| 22168 var const$384 = ImmutableList.ImmutableList$from$factory(['NullPointerException'
, 'ObjectNotClosureException', 'NoSuchMethodException', 'StackOverflowException'
])/*const [ | |
| 22169 'NullPointerException', 'ObjectNotClosureException', | 22206 'NullPointerException', 'ObjectNotClosureException', |
| 22170 'NoSuchMethodException', 'StackOverflowException']*/; | 22207 'NoSuchMethodException', 'StackOverflowException']*/; |
| 22171 var const$4 = new StringWrapper('void')/*const SourceString('void')*/; | 22208 const$4 = new StringWrapper('global scope')/*const SourceString('global scope')*
/; |
| 22172 var const$40 = new Keyword("final", false)/*const Keyword("final")*/; | 22209 const$40 = new Keyword("false", false)/*const Keyword("false")*/; |
| 22173 var const$42 = new Keyword("finally", false)/*const Keyword("finally")*/; | 22210 const$42 = new Keyword("final", false)/*const Keyword("final")*/; |
| 22174 var const$44 = new Keyword("for", false)/*const Keyword("for")*/; | 22211 const$44 = new Keyword("finally", false)/*const Keyword("finally")*/; |
| 22175 var const$46 = new Keyword("if", false)/*const Keyword("if")*/; | 22212 const$46 = new Keyword("for", false)/*const Keyword("for")*/; |
| 22176 var const$48 = new Keyword("in", false)/*const Keyword("in")*/; | 22213 const$48 = new Keyword("if", false)/*const Keyword("if")*/; |
| 22177 var const$50 = new Keyword("is", false)/*const Keyword("is")*/; | 22214 const$5 = new EmptyQueueException()/*const EmptyQueueException()*/; |
| 22178 var const$52 = new Keyword("new", false)/*const Keyword("new")*/; | 22215 const$50 = new Keyword("in", false)/*const Keyword("in")*/; |
| 22179 var const$54 = new Keyword("null", false)/*const Keyword("null")*/; | 22216 const$52 = new Keyword("is", false)/*const Keyword("is")*/; |
| 22180 var const$56 = new Keyword("return", false)/*const Keyword("return")*/; | 22217 const$54 = new Keyword("new", false)/*const Keyword("new")*/; |
| 22181 var const$58 = new Keyword("super", false)/*const Keyword("super")*/; | 22218 const$56 = new Keyword("null", false)/*const Keyword("null")*/; |
| 22182 var const$6 = new StringWrapper('int')/*const SourceString('int')*/; | 22219 const$58 = new Keyword("return", false)/*const Keyword("return")*/; |
| 22183 var const$60 = new Keyword("switch", false)/*const Keyword("switch")*/; | 22220 const$6 = new StringWrapper('void')/*const SourceString('void')*/; |
| 22184 var const$62 = new Keyword("this", false)/*const Keyword("this")*/; | 22221 const$60 = new Keyword("super", false)/*const Keyword("super")*/; |
| 22185 var const$64 = new Keyword("throw", false)/*const Keyword("throw")*/; | 22222 const$62 = new Keyword("switch", false)/*const Keyword("switch")*/; |
| 22186 var const$66 = new Keyword("true", false)/*const Keyword("true")*/; | 22223 const$64 = new Keyword("this", false)/*const Keyword("this")*/; |
| 22187 var const$68 = new Keyword("try", false)/*const Keyword("try")*/; | 22224 const$66 = new Keyword("throw", false)/*const Keyword("throw")*/; |
| 22188 var const$70 = new Keyword("var", false)/*const Keyword("var")*/; | 22225 const$68 = new Keyword("true", false)/*const Keyword("true")*/; |
| 22189 var const$72 = new Keyword("void", false)/*const Keyword("void")*/; | 22226 const$70 = new Keyword("try", false)/*const Keyword("try")*/; |
| 22190 var const$74 = new Keyword("while", false)/*const Keyword("while")*/; | 22227 const$72 = new Keyword("var", false)/*const Keyword("var")*/; |
| 22191 var const$76 = new Keyword("abstract", true)/*const Keyword("abstract", true)*/; | 22228 const$74 = new Keyword("void", false)/*const Keyword("void")*/; |
| 22192 var const$78 = new Keyword("assert", true)/*const Keyword("assert", true)*/; | 22229 const$76 = new Keyword("while", false)/*const Keyword("while")*/; |
| 22193 var const$8 = new StringWrapper('Dynamic')/*const SourceString('Dynamic')*/; | 22230 const$78 = new Keyword("abstract", true)/*const Keyword("abstract", true)*/; |
| 22194 var const$80 = new Keyword("class", true)/*const Keyword("class", true)*/; | 22231 const$8 = new StringWrapper('int')/*const SourceString('int')*/; |
| 22195 var const$82 = new Keyword("extends", true)/*const Keyword("extends", true)*/; | 22232 const$80 = new Keyword("assert", true)/*const Keyword("assert", true)*/; |
| 22196 var const$84 = new Keyword("factory", true)/*const Keyword("factory", true)*/; | 22233 const$82 = new Keyword("class", true)/*const Keyword("class", true)*/; |
| 22197 var const$86 = new Keyword("get", true)/*const Keyword("get", true)*/; | 22234 const$84 = new Keyword("extends", true)/*const Keyword("extends", true)*/; |
| 22198 var const$88 = new Keyword("implements", true)/*const Keyword("implements", true
)*/; | 22235 const$86 = new Keyword("factory", true)/*const Keyword("factory", true)*/; |
| 22199 var const$90 = new Keyword("import", true)/*const Keyword("import", true)*/; | 22236 const$88 = new Keyword("get", true)/*const Keyword("get", true)*/; |
| 22200 var const$92 = new Keyword("interface", true)/*const Keyword("interface", true)*
/; | 22237 const$90 = new Keyword("implements", true)/*const Keyword("implements", true)*/; |
| 22201 var const$94 = new Keyword("library", true)/*const Keyword("library", true)*/; | 22238 const$92 = new Keyword("import", true)/*const Keyword("import", true)*/; |
| 22202 var const$96 = new Keyword("native", true)/*const Keyword("native", true)*/; | 22239 const$94 = new Keyword("interface", true)/*const Keyword("interface", true)*/; |
| 22203 var const$98 = new Keyword("negate", true)/*const Keyword("negate", true)*/; | 22240 const$96 = new Keyword("library", true)/*const Keyword("library", true)*/; |
| 22204 HTracer._singleton = null; | 22241 const$98 = new Keyword("native", true)/*const Keyword("native", true)*/; |
| 22205 var const$110 = ImmutableList.ImmutableList$from$factory([const$22, const$24, co
nst$26, const$28, const$30, const$32, const$34, const$36, const$38, const$40, co
nst$42, const$44, const$46, const$48, const$50, const$52, const$54, const$56, co
nst$58, const$60, const$62, const$64, const$66, const$68, const$70, const$72, co
nst$74, const$76, const$78, const$80, const$82, const$84, const$86, const$88, co
nst$90, const$92, const$94, const$96, const$98, const$100, const$102, const$104,
const$106, const$108])/*const <Keyword> [ | 22242 const$112 = ImmutableList.ImmutableList$from$factory([const$24, const$26, const$
28, const$30, const$32, const$34, const$36, const$38, const$40, const$42, const$
44, const$46, const$48, const$50, const$52, const$54, const$56, const$58, const$
60, const$62, const$64, const$66, const$68, const$70, const$72, const$74, const$
76, const$78, const$80, const$82, const$84, const$86, const$88, const$90, const$
92, const$94, const$96, const$98, const$100, const$102, const$104, const$106, co
nst$108, const$110])/*const <Keyword> [ |
| 22206 BREAK, | 22243 BREAK, |
| 22207 CASE, | 22244 CASE, |
| 22208 CATCH, | 22245 CATCH, |
| 22209 CONST, | 22246 CONST, |
| 22210 CONTINUE, | 22247 CONTINUE, |
| 22211 DEFAULT, | 22248 DEFAULT, |
| 22212 DO, | 22249 DO, |
| 22213 ELSE, | 22250 ELSE, |
| 22214 FALSE, | 22251 FALSE, |
| 22215 FINAL, | 22252 FINAL, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 22240 IMPORT, | 22277 IMPORT, |
| 22241 INTERFACE, | 22278 INTERFACE, |
| 22242 LIBRARY, | 22279 LIBRARY, |
| 22243 NATIVE, | 22280 NATIVE, |
| 22244 NEGATE, | 22281 NEGATE, |
| 22245 OPERATOR, | 22282 OPERATOR, |
| 22246 SET, | 22283 SET, |
| 22247 SOURCE, | 22284 SOURCE, |
| 22248 STATIC, | 22285 STATIC, |
| 22249 TYPEDEF ]*/; | 22286 TYPEDEF ]*/; |
| 22287 var $globals = {}; |
| 22288 $static_init(); |
| 22250 main(); | 22289 main(); |
| OLD | NEW |