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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 }; | 334 }; |
335 Object.prototype.contains$1 = function($0) { | 335 Object.prototype.contains$1 = function($0) { |
336 return this.noSuchMethod("contains", [$0]); | 336 return this.noSuchMethod("contains", [$0]); |
337 }; | 337 }; |
338 Object.prototype.convertTo$3 = function($0, $1, $2) { | 338 Object.prototype.convertTo$3 = function($0, $1, $2) { |
339 return this.noSuchMethod("convertTo", [$0, $1, $2]); | 339 return this.noSuchMethod("convertTo", [$0, $1, $2]); |
340 }; | 340 }; |
341 Object.prototype.convertTo$4 = function($0, $1, $2, $3) { | 341 Object.prototype.convertTo$4 = function($0, $1, $2, $3) { |
342 return this.noSuchMethod("convertTo", [$0, $1, $2, $3]); | 342 return this.noSuchMethod("convertTo", [$0, $1, $2, $3]); |
343 }; | 343 }; |
344 Object.prototype.copyWithNewType$1 = function($0) { | 344 Object.prototype.copyWithNewType$2 = function($0, $1) { |
345 return this.noSuchMethod("copyWithNewType", [$0]); | 345 return this.noSuchMethod("copyWithNewType", [$0, $1]); |
346 }; | 346 }; |
347 Object.prototype.dataEquals$1 = function($0) { | 347 Object.prototype.dataEquals$1 = function($0) { |
348 return this.noSuchMethod("dataEquals", [$0]); | 348 return this.noSuchMethod("dataEquals", [$0]); |
349 }; | 349 }; |
350 Object.prototype.endArguments$3 = function($0, $1, $2) { | 350 Object.prototype.endArguments$3 = function($0, $1, $2) { |
351 return this.noSuchMethod("endArguments", [$0, $1, $2]); | 351 return this.noSuchMethod("endArguments", [$0, $1, $2]); |
352 }; | 352 }; |
353 Object.prototype.endBlock$3 = function($0, $1, $2) { | 353 Object.prototype.endBlock$3 = function($0, $1, $2) { |
354 return this.noSuchMethod("endBlock", [$0, $1, $2]); | 354 return this.noSuchMethod("endBlock", [$0, $1, $2]); |
355 }; | 355 }; |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 }; | 652 }; |
653 Object.prototype.replaceFirst$2 = function($0, $1) { | 653 Object.prototype.replaceFirst$2 = function($0, $1) { |
654 return this.noSuchMethod("replaceFirst", [$0, $1]); | 654 return this.noSuchMethod("replaceFirst", [$0, $1]); |
655 }; | 655 }; |
656 Object.prototype.resolve$0 = function() { | 656 Object.prototype.resolve$0 = function() { |
657 return this.noSuchMethod("resolve", []); | 657 return this.noSuchMethod("resolve", []); |
658 }; | 658 }; |
659 Object.prototype.resolve$1 = function($0) { | 659 Object.prototype.resolve$1 = function($0) { |
660 return this.noSuchMethod("resolve", [$0]); | 660 return this.noSuchMethod("resolve", [$0]); |
661 }; | 661 }; |
662 Object.prototype.resolve$2 = function($0, $1) { | |
663 return this.noSuchMethod("resolve", [$0, $1]); | |
664 }; | |
665 Object.prototype.resolveMember$1 = function($0) { | 662 Object.prototype.resolveMember$1 = function($0) { |
666 return this.noSuchMethod("resolveMember", [$0]); | 663 return this.noSuchMethod("resolveMember", [$0]); |
667 }; | 664 }; |
668 Object.prototype.resolveTypeParams$1 = function($0) { | 665 Object.prototype.resolveTypeParams$1 = function($0) { |
669 return this.noSuchMethod("resolveTypeParams", [$0]); | 666 return this.noSuchMethod("resolveTypeParams", [$0]); |
670 }; | 667 }; |
671 Object.prototype.setDefinition$1 = function($0) { | 668 Object.prototype.setDefinition$1 = function($0) { |
672 return this.noSuchMethod("setDefinition", [$0]); | 669 return this.noSuchMethod("setDefinition", [$0]); |
673 }; | 670 }; |
674 Object.prototype.setGenerateAtUseSite$0 = function() { | 671 Object.prototype.setGenerateAtUseSite$0 = function() { |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 } else { | 872 } else { |
876 write(obj); | 873 write(obj); |
877 write('\n'); | 874 write('\n'); |
878 } | 875 } |
879 } | 876 } |
880 // ********** Library dart:coreimpl ************** | 877 // ********** Library dart:coreimpl ************** |
881 // ********** Code for ListFactory ************** | 878 // ********** Code for ListFactory ************** |
882 ListFactory = Array; | 879 ListFactory = Array; |
883 ListFactory.prototype.is$ListFactory = function(){return this;}; | 880 ListFactory.prototype.is$ListFactory = function(){return this;}; |
884 ListFactory.prototype.is$List = function(){return this;}; | 881 ListFactory.prototype.is$List = function(){return this;}; |
885 ListFactory.prototype.is$List$ArgumentNode = function(){return this;}; | 882 ListFactory.prototype.is$List_ArgumentNode = function(){return this;}; |
886 ListFactory.prototype.is$List$Definition = function(){return this;}; | 883 ListFactory.prototype.is$List_Definition = function(){return this;}; |
887 ListFactory.prototype.is$List$EvaluatedValue = function(){return this;}; | 884 ListFactory.prototype.is$List_EvaluatedValue = function(){return this;}; |
888 ListFactory.prototype.is$List$GlobalValue = function(){return this;}; | 885 ListFactory.prototype.is$List_GlobalValue = function(){return this;}; |
889 ListFactory.prototype.is$List$HInstruction = function(){return this;}; | 886 ListFactory.prototype.is$List_HInstruction = function(){return this;}; |
890 ListFactory.prototype.is$List$Member = function(){return this;}; | 887 ListFactory.prototype.is$List_Member = function(){return this;}; |
891 ListFactory.prototype.is$List$String = function(){return this;}; | 888 ListFactory.prototype.is$List_ParameterType = function(){return this;}; |
892 ListFactory.prototype.is$List$Token = function(){return this;}; | 889 ListFactory.prototype.is$List_String = function(){return this;}; |
893 ListFactory.prototype.is$List$Type = function(){return this;}; | 890 ListFactory.prototype.is$List_Token = function(){return this;}; |
894 ListFactory.prototype.is$List$Value = function(){return this;}; | 891 ListFactory.prototype.is$List_Type = function(){return this;}; |
895 ListFactory.prototype.is$List$int = function(){return this;}; | 892 ListFactory.prototype.is$List_Value = function(){return this;}; |
896 ListFactory.prototype.is$Collection$E = function(){return this;}; | 893 ListFactory.prototype.is$List_int = function(){return this;}; |
897 ListFactory.prototype.is$Collection$Object = function(){return this;}; | 894 ListFactory.prototype.is$Collection_E = function(){return this;}; |
898 ListFactory.prototype.is$Collection$Type = function(){return this;}; | 895 ListFactory.prototype.is$Collection_Object = function(){return this;}; |
| 896 ListFactory.prototype.is$Collection_Type = function(){return this;}; |
899 ListFactory.prototype.is$Iterable = function(){return this;}; | 897 ListFactory.prototype.is$Iterable = function(){return this;}; |
900 ListFactory.ListFactory$from$factory = function(other) { | 898 ListFactory.ListFactory$from$factory = function(other) { |
901 var list = []; | 899 var list = []; |
902 for (var $i = other.iterator(); $i.hasNext$0(); ) { | 900 for (var $i = other.iterator(); $i.hasNext$0(); ) { |
903 var e = $i.next$0(); | 901 var e = $i.next$0(); |
904 list.add(e); | 902 list.add(e); |
905 } | 903 } |
906 return (list && list.is$ListFactory()); | 904 return (list && list.is$ListFactory()); |
907 } | 905 } |
908 ListFactory.prototype.add = function(value) { | 906 ListFactory.prototype.add = function(value) { |
(...skipping 21 matching lines...) Expand all Loading... |
930 return this.slice(start, start + length); | 928 return this.slice(start, start + length); |
931 } | 929 } |
932 ListFactory.prototype.isEmpty = function() { | 930 ListFactory.prototype.isEmpty = function() { |
933 return this.length == 0; | 931 return this.length == 0; |
934 } | 932 } |
935 ListFactory.prototype.iterator = function() { | 933 ListFactory.prototype.iterator = function() { |
936 return new ListIterator(this); | 934 return new ListIterator(this); |
937 } | 935 } |
938 ListFactory.prototype.add$1 = ListFactory.prototype.add; | 936 ListFactory.prototype.add$1 = ListFactory.prototype.add; |
939 ListFactory.prototype.addAll$1 = function($0) { | 937 ListFactory.prototype.addAll$1 = function($0) { |
940 return this.addAll(($0 && $0.is$Collection$E())); | 938 return this.addAll(($0 && $0.is$Collection_E())); |
941 }; | 939 }; |
942 ListFactory.prototype.every$1 = function($0) { | 940 ListFactory.prototype.every$1 = function($0) { |
943 return this.every(to$call$1($0)); | 941 return this.every(to$call$1($0)); |
944 }; | 942 }; |
945 ListFactory.prototype.filter$1 = function($0) { | 943 ListFactory.prototype.filter$1 = function($0) { |
946 return this.filter(to$call$1($0)); | 944 return this.filter(to$call$1($0)); |
947 }; | 945 }; |
948 ListFactory.prototype.forEach$1 = function($0) { | 946 ListFactory.prototype.forEach$1 = function($0) { |
949 return this.forEach(to$call$1($0)); | 947 return this.forEach(to$call$1($0)); |
950 }; | 948 }; |
951 ListFactory.prototype.indexOf$2 = function($0, $1) { | 949 ListFactory.prototype.indexOf$2 = function($0, $1) { |
952 return this.indexOf($0, $assert_num($1)); | 950 return this.indexOf($0, $assert_num($1)); |
953 }; | 951 }; |
954 ListFactory.prototype.isEmpty$0 = ListFactory.prototype.isEmpty; | 952 ListFactory.prototype.isEmpty$0 = ListFactory.prototype.isEmpty; |
955 ListFactory.prototype.iterator$0 = ListFactory.prototype.iterator; | 953 ListFactory.prototype.iterator$0 = ListFactory.prototype.iterator; |
956 ListFactory.prototype.last$0 = ListFactory.prototype.last; | 954 ListFactory.prototype.last$0 = ListFactory.prototype.last; |
957 ListFactory.prototype.removeLast$0 = ListFactory.prototype.removeLast; | 955 ListFactory.prototype.removeLast$0 = ListFactory.prototype.removeLast; |
958 ListFactory.prototype.some$1 = function($0) { | 956 ListFactory.prototype.some$1 = function($0) { |
959 return this.some(to$call$1($0)); | 957 return this.some(to$call$1($0)); |
960 }; | 958 }; |
961 ListFactory.prototype.sort$1 = function($0) { | 959 ListFactory.prototype.sort$1 = function($0) { |
962 return this.sort(to$call$2($0)); | 960 return this.sort(to$call$2($0)); |
963 }; | 961 }; |
964 ListFactory$E = ListFactory; | 962 ListFactory_E = ListFactory; |
965 ListFactory$HBasicBlock = ListFactory; | 963 ListFactory_HBasicBlock = ListFactory; |
966 ListFactory$HInstruction = ListFactory; | 964 ListFactory_HInstruction = ListFactory; |
967 ListFactory$K = ListFactory; | 965 ListFactory_K = ListFactory; |
968 ListFactory$KeywordState = ListFactory; | 966 ListFactory_KeywordState = ListFactory; |
969 ListFactory$String = ListFactory; | 967 ListFactory_String = ListFactory; |
970 ListFactory$T = ListFactory; | 968 ListFactory_T = ListFactory; |
971 ListFactory$V = ListFactory; | 969 ListFactory_V = ListFactory; |
972 ListFactory$ValueSetNode = ListFactory; | 970 ListFactory_ValueSetNode = ListFactory; |
973 ListFactory$int = ListFactory; | 971 ListFactory_int = ListFactory; |
974 // ********** Code for ListIterator ************** | 972 // ********** Code for ListIterator ************** |
975 function ListIterator(array) { | 973 function ListIterator(array) { |
976 this._array = array; | 974 this._array = array; |
977 this._pos = 0; | 975 this._pos = 0; |
978 // Initializers done | 976 // Initializers done |
979 } | 977 } |
980 ListIterator.prototype.is$Iterator$T = function(){return this;}; | 978 ListIterator.prototype.is$Iterator_T = function(){return this;}; |
981 ListIterator.prototype.hasNext = function() { | 979 ListIterator.prototype.hasNext = function() { |
982 return this._array.length > this._pos; | 980 return this._array.length > this._pos; |
983 } | 981 } |
984 ListIterator.prototype.next = function() { | 982 ListIterator.prototype.next = function() { |
985 if (!this.hasNext()) { | 983 if (!this.hasNext()) { |
986 $throw(const$0/*const NoMoreElementsException()*/); | 984 $throw(const$0/*const NoMoreElementsException()*/); |
987 } | 985 } |
988 return this._array.$index(this._pos++); | 986 return this._array.$index(this._pos++); |
989 } | 987 } |
990 ListIterator.prototype.hasNext$0 = ListIterator.prototype.hasNext; | 988 ListIterator.prototype.hasNext$0 = ListIterator.prototype.hasNext; |
991 ListIterator.prototype.next$0 = ListIterator.prototype.next; | 989 ListIterator.prototype.next$0 = ListIterator.prototype.next; |
992 // ********** Code for ImmutableList ************** | 990 // ********** Code for ImmutableList ************** |
993 function ImmutableList(length) { | 991 function ImmutableList(length) { |
994 this._length = length; | 992 this._length = length; |
995 // Initializers done | 993 // Initializers done |
996 ListFactory$E.call(this, length); | 994 ListFactory_E.call(this, length); |
997 } | 995 } |
998 /** Implements extends for Dart classes on JavaScript prototypes. */ | 996 /** Implements extends for Dart classes on JavaScript prototypes. */ |
999 function $inherits(child, parent) { | 997 function $inherits(child, parent) { |
1000 if (child.prototype.__proto__) { | 998 if (child.prototype.__proto__) { |
1001 child.prototype.__proto__ = parent.prototype; | 999 child.prototype.__proto__ = parent.prototype; |
1002 } else { | 1000 } else { |
1003 function tmp() {}; | 1001 function tmp() {}; |
1004 tmp.prototype = parent.prototype; | 1002 tmp.prototype = parent.prototype; |
1005 child.prototype = new tmp(); | 1003 child.prototype = new tmp(); |
1006 child.prototype.constructor = child; | 1004 child.prototype.constructor = child; |
1007 } | 1005 } |
1008 } | 1006 } |
1009 $inherits(ImmutableList, ListFactory$E); | 1007 $inherits(ImmutableList, ListFactory_E); |
1010 ImmutableList.ImmutableList$from$factory = function(other) { | 1008 ImmutableList.ImmutableList$from$factory = function(other) { |
1011 var list = new ImmutableList(other.length); | 1009 var list = new ImmutableList(other.length); |
1012 for (var i = 0; | 1010 for (var i = 0; |
1013 i < other.length; i++) { | 1011 i < other.length; i++) { |
1014 list._setindex(i, other.$index(i)); | 1012 list._setindex(i, other.$index(i)); |
1015 } | 1013 } |
1016 return list; | 1014 return list; |
1017 } | 1015 } |
1018 ImmutableList.prototype.get$length = function() { | 1016 ImmutableList.prototype.get$length = function() { |
1019 return this._length; | 1017 return this._length; |
(...skipping 30 matching lines...) Expand all Loading... |
1050 $throw(const$14/*const IllegalAccessException()*/); | 1048 $throw(const$14/*const IllegalAccessException()*/); |
1051 } | 1049 } |
1052 ImmutableList.prototype.clear = function() { | 1050 ImmutableList.prototype.clear = function() { |
1053 $throw(const$14/*const IllegalAccessException()*/); | 1051 $throw(const$14/*const IllegalAccessException()*/); |
1054 } | 1052 } |
1055 ImmutableList.prototype.removeLast = function() { | 1053 ImmutableList.prototype.removeLast = function() { |
1056 $throw(const$14/*const IllegalAccessException()*/); | 1054 $throw(const$14/*const IllegalAccessException()*/); |
1057 } | 1055 } |
1058 ImmutableList.prototype.add$1 = ImmutableList.prototype.add; | 1056 ImmutableList.prototype.add$1 = ImmutableList.prototype.add; |
1059 ImmutableList.prototype.addAll$1 = function($0) { | 1057 ImmutableList.prototype.addAll$1 = function($0) { |
1060 return this.addAll(($0 && $0.is$Collection$E())); | 1058 return this.addAll(($0 && $0.is$Collection_E())); |
1061 }; | 1059 }; |
1062 ImmutableList.prototype.removeLast$0 = ImmutableList.prototype.removeLast; | 1060 ImmutableList.prototype.removeLast$0 = ImmutableList.prototype.removeLast; |
1063 ImmutableList.prototype.sort$1 = function($0) { | 1061 ImmutableList.prototype.sort$1 = function($0) { |
1064 return this.sort(to$call$2($0)); | 1062 return this.sort(to$call$2($0)); |
1065 }; | 1063 }; |
1066 // ********** Code for ImmutableMap ************** | 1064 // ********** Code for ImmutableMap ************** |
1067 function ImmutableMap(keyValuePairs) { | 1065 function ImmutableMap(keyValuePairs) { |
1068 this._internal = $map([]); | 1066 this._internal = $map([]); |
1069 // Initializers done | 1067 // Initializers done |
1070 for (var i = 0; | 1068 for (var i = 0; |
1071 i < keyValuePairs.length; i += 2) { | 1069 i < keyValuePairs.length; i += 2) { |
1072 this._internal.$setindex(keyValuePairs.$index(i), keyValuePairs.$index(i + 1
)); | 1070 this._internal.$setindex(keyValuePairs.$index(i), keyValuePairs.$index(i + 1
)); |
1073 } | 1071 } |
1074 } | 1072 } |
1075 ImmutableMap.prototype.is$Map$Node$Element = function(){return this;}; | 1073 ImmutableMap.prototype.is$Map_Node$Element = function(){return this;}; |
1076 ImmutableMap.prototype.is$Map$String$Member = function(){return this;}; | 1074 ImmutableMap.prototype.is$Map_String$Member = function(){return this;}; |
1077 ImmutableMap.prototype.$index = function(key) { | 1075 ImmutableMap.prototype.$index = function(key) { |
1078 return this._internal.$index(key); | 1076 return this._internal.$index(key); |
1079 } | 1077 } |
1080 ImmutableMap.prototype.isEmpty = function() { | 1078 ImmutableMap.prototype.isEmpty = function() { |
1081 return this._internal.isEmpty(); | 1079 return this._internal.isEmpty(); |
1082 } | 1080 } |
1083 ImmutableMap.prototype.get$length = function() { | 1081 ImmutableMap.prototype.get$length = function() { |
1084 return this._internal.get$length(); | 1082 return this._internal.get$length(); |
1085 } | 1083 } |
1086 Object.defineProperty(ImmutableMap.prototype, "length", { | 1084 Object.defineProperty(ImmutableMap.prototype, "length", { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 // ********** Code for HashMapImplementation ************** | 1181 // ********** Code for HashMapImplementation ************** |
1184 function HashMapImplementation() { | 1182 function HashMapImplementation() { |
1185 // Initializers done | 1183 // Initializers done |
1186 this._numberOfEntries = 0; | 1184 this._numberOfEntries = 0; |
1187 this._numberOfDeleted = 0; | 1185 this._numberOfDeleted = 0; |
1188 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); | 1186 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); |
1189 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); | 1187 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); |
1190 this._values = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); | 1188 this._values = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); |
1191 } | 1189 } |
1192 HashMapImplementation.prototype.is$HashMapImplementation = function(){return thi
s;}; | 1190 HashMapImplementation.prototype.is$HashMapImplementation = function(){return thi
s;}; |
1193 HashMapImplementation.prototype.is$Map$Node$Element = function(){return this;}; | 1191 HashMapImplementation.prototype.is$Map_Node$Element = function(){return this;}; |
1194 HashMapImplementation.prototype.is$Map$String$Member = function(){return this;}; | 1192 HashMapImplementation.prototype.is$Map_String$Member = function(){return this;}; |
1195 HashMapImplementation.HashMapImplementation$from$factory = function(other) { | 1193 HashMapImplementation.HashMapImplementation$from$factory = function(other) { |
1196 var result = new HashMapImplementation(); | 1194 var result = new HashMapImplementation(); |
1197 other.forEach((function (key, value) { | 1195 other.forEach((function (key, value) { |
1198 result.$setindex(key, value); | 1196 result.$setindex(key, value); |
1199 }) | 1197 }) |
1200 ); | 1198 ); |
1201 return (result && result.is$HashMapImplementation()); | 1199 return (result && result.is$HashMapImplementation()); |
1202 } | 1200 } |
1203 HashMapImplementation._computeLoadLimit = function(capacity) { | 1201 HashMapImplementation._computeLoadLimit = function(capacity) { |
1204 return $truncdiv((capacity * 3), 4); | 1202 return $truncdiv((capacity * 3), 4); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1358 } | 1356 } |
1359 HashMapImplementation.prototype.containsKey = function(key) { | 1357 HashMapImplementation.prototype.containsKey = function(key) { |
1360 return (this._probeForLookup(key) != -1); | 1358 return (this._probeForLookup(key) != -1); |
1361 } | 1359 } |
1362 HashMapImplementation.prototype.forEach$1 = function($0) { | 1360 HashMapImplementation.prototype.forEach$1 = function($0) { |
1363 return this.forEach(to$call$2($0)); | 1361 return this.forEach(to$call$2($0)); |
1364 }; | 1362 }; |
1365 HashMapImplementation.prototype.getKeys$0 = HashMapImplementation.prototype.getK
eys; | 1363 HashMapImplementation.prototype.getKeys$0 = HashMapImplementation.prototype.getK
eys; |
1366 HashMapImplementation.prototype.getValues$0 = HashMapImplementation.prototype.ge
tValues; | 1364 HashMapImplementation.prototype.getValues$0 = HashMapImplementation.prototype.ge
tValues; |
1367 HashMapImplementation.prototype.isEmpty$0 = HashMapImplementation.prototype.isEm
pty; | 1365 HashMapImplementation.prototype.isEmpty$0 = HashMapImplementation.prototype.isEm
pty; |
1368 // ********** Code for HashMapImplementation$E$E ************** | 1366 // ********** Code for HashMapImplementation_E$E ************** |
1369 function HashMapImplementation$E$E() { | 1367 function HashMapImplementation_E$E() { |
1370 // Initializers done | 1368 // Initializers done |
1371 this._numberOfEntries = 0; | 1369 this._numberOfEntries = 0; |
1372 this._numberOfDeleted = 0; | 1370 this._numberOfDeleted = 0; |
1373 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); | 1371 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); |
1374 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); | 1372 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); |
1375 this._values = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); | 1373 this._values = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); |
1376 } | 1374 } |
1377 $inherits(HashMapImplementation$E$E, HashMapImplementation); | 1375 $inherits(HashMapImplementation_E$E, HashMapImplementation); |
1378 HashMapImplementation$E$E.prototype.is$Map$Node$Element = function(){return this
;}; | 1376 HashMapImplementation_E$E.prototype.is$Map_Node$Element = function(){return this
;}; |
1379 HashMapImplementation$E$E.prototype.is$Map$String$Member = function(){return thi
s;}; | 1377 HashMapImplementation_E$E.prototype.is$Map_String$Member = function(){return thi
s;}; |
1380 HashMapImplementation$E$E._computeLoadLimit = function(capacity) { | 1378 HashMapImplementation_E$E._computeLoadLimit = function(capacity) { |
1381 return $truncdiv((capacity * 3), 4); | 1379 return $truncdiv((capacity * 3), 4); |
1382 } | 1380 } |
1383 HashMapImplementation$E$E._firstProbe = function(hashCode, length) { | 1381 HashMapImplementation_E$E._firstProbe = function(hashCode, length) { |
1384 return hashCode & (length - 1); | 1382 return hashCode & (length - 1); |
1385 } | 1383 } |
1386 HashMapImplementation$E$E._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { | 1384 HashMapImplementation_E$E._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { |
1387 return (currentProbe + numberOfProbes) & (length - 1); | 1385 return (currentProbe + numberOfProbes) & (length - 1); |
1388 } | 1386 } |
1389 HashMapImplementation$E$E.prototype._probeForAdding = function(key) { | 1387 HashMapImplementation_E$E.prototype._probeForAdding = function(key) { |
1390 var hash = HashMapImplementation._firstProbe($assert_num(key.hashCode$0()), th
is._keys.length); | 1388 var hash = HashMapImplementation._firstProbe($assert_num(key.hashCode$0()), th
is._keys.length); |
1391 var numberOfProbes = 1; | 1389 var numberOfProbes = 1; |
1392 var initialHash = hash; | 1390 var initialHash = hash; |
1393 var insertionIndex = -1; | 1391 var insertionIndex = -1; |
1394 while (true) { | 1392 while (true) { |
1395 var existingKey = this._keys.$index(hash); | 1393 var existingKey = this._keys.$index(hash); |
1396 if (existingKey == null) { | 1394 if (existingKey == null) { |
1397 if (insertionIndex < 0) return hash; | 1395 if (insertionIndex < 0) return hash; |
1398 return insertionIndex; | 1396 return insertionIndex; |
1399 } | 1397 } |
1400 else if ($notnull_bool($eq(existingKey, key))) { | 1398 else if ($notnull_bool($eq(existingKey, key))) { |
1401 return hash; | 1399 return hash; |
1402 } | 1400 } |
1403 else if ((insertionIndex < 0) && (const$1/*HashMapImplementation._DELETED_KE
Y*/ === existingKey)) { | 1401 else if ((insertionIndex < 0) && (const$1/*HashMapImplementation._DELETED_KE
Y*/ === existingKey)) { |
1404 insertionIndex = hash; | 1402 insertionIndex = hash; |
1405 } | 1403 } |
1406 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); | 1404 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); |
1407 } | 1405 } |
1408 } | 1406 } |
1409 HashMapImplementation$E$E.prototype._probeForLookup = function(key) { | 1407 HashMapImplementation_E$E.prototype._probeForLookup = function(key) { |
1410 var hash = HashMapImplementation._firstProbe($assert_num(key.hashCode$0()), th
is._keys.length); | 1408 var hash = HashMapImplementation._firstProbe($assert_num(key.hashCode$0()), th
is._keys.length); |
1411 var numberOfProbes = 1; | 1409 var numberOfProbes = 1; |
1412 var initialHash = hash; | 1410 var initialHash = hash; |
1413 while (true) { | 1411 while (true) { |
1414 var existingKey = this._keys.$index(hash); | 1412 var existingKey = this._keys.$index(hash); |
1415 if (existingKey == null) return -1; | 1413 if (existingKey == null) return -1; |
1416 if ($notnull_bool($eq(existingKey, key))) return hash; | 1414 if ($notnull_bool($eq(existingKey, key))) return hash; |
1417 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); | 1415 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); |
1418 } | 1416 } |
1419 } | 1417 } |
1420 HashMapImplementation$E$E.prototype._ensureCapacity = function() { | 1418 HashMapImplementation_E$E.prototype._ensureCapacity = function() { |
1421 var newNumberOfEntries = this._numberOfEntries + 1; | 1419 var newNumberOfEntries = this._numberOfEntries + 1; |
1422 if (newNumberOfEntries >= this._loadLimit) { | 1420 if (newNumberOfEntries >= this._loadLimit) { |
1423 this._grow(this._keys.length * 2); | 1421 this._grow(this._keys.length * 2); |
1424 return; | 1422 return; |
1425 } | 1423 } |
1426 var capacity = this._keys.length; | 1424 var capacity = this._keys.length; |
1427 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; | 1425 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; |
1428 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; | 1426 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; |
1429 if (this._numberOfDeleted > numberOfFree) { | 1427 if (this._numberOfDeleted > numberOfFree) { |
1430 this._grow(this._keys.length); | 1428 this._grow(this._keys.length); |
1431 } | 1429 } |
1432 } | 1430 } |
1433 HashMapImplementation$E$E._isPowerOfTwo = function(x) { | 1431 HashMapImplementation_E$E._isPowerOfTwo = function(x) { |
1434 return ((x & (x - 1)) == 0); | 1432 return ((x & (x - 1)) == 0); |
1435 } | 1433 } |
1436 HashMapImplementation$E$E.prototype._grow = function(newCapacity) { | 1434 HashMapImplementation_E$E.prototype._grow = function(newCapacity) { |
1437 $assert(HashMapImplementation._isPowerOfTwo(newCapacity), "_isPowerOfTwo(newCa
pacity)", "hash_map_set.dart", 149, 12); | 1435 $assert(HashMapImplementation._isPowerOfTwo(newCapacity), "_isPowerOfTwo(newCa
pacity)", "hash_map_set.dart", 149, 12); |
1438 var capacity = this._keys.length; | 1436 var capacity = this._keys.length; |
1439 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 1437 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
1440 var oldKeys = this._keys; | 1438 var oldKeys = this._keys; |
1441 var oldValues = this._values; | 1439 var oldValues = this._values; |
1442 this._keys = new ListFactory(newCapacity); | 1440 this._keys = new ListFactory(newCapacity); |
1443 this._values = new ListFactory(newCapacity); | 1441 this._values = new ListFactory(newCapacity); |
1444 for (var i = 0; | 1442 for (var i = 0; |
1445 i < capacity; i++) { | 1443 i < capacity; i++) { |
1446 var key = oldKeys.$index(i); | 1444 var key = oldKeys.$index(i); |
1447 if (key == null || key === const$1/*HashMapImplementation._DELETED_KEY*/) { | 1445 if (key == null || key === const$1/*HashMapImplementation._DELETED_KEY*/) { |
1448 continue; | 1446 continue; |
1449 } | 1447 } |
1450 var value = oldValues.$index(i); | 1448 var value = oldValues.$index(i); |
1451 var newIndex = this._probeForAdding(key); | 1449 var newIndex = this._probeForAdding(key); |
1452 this._keys.$setindex(newIndex, key); | 1450 this._keys.$setindex(newIndex, key); |
1453 this._values.$setindex(newIndex, value); | 1451 this._values.$setindex(newIndex, value); |
1454 } | 1452 } |
1455 this._numberOfDeleted = 0; | 1453 this._numberOfDeleted = 0; |
1456 } | 1454 } |
1457 HashMapImplementation$E$E.prototype.clear = function() { | 1455 HashMapImplementation_E$E.prototype.clear = function() { |
1458 this._numberOfEntries = 0; | 1456 this._numberOfEntries = 0; |
1459 this._numberOfDeleted = 0; | 1457 this._numberOfDeleted = 0; |
1460 var length = this._keys.length; | 1458 var length = this._keys.length; |
1461 for (var i = 0; | 1459 for (var i = 0; |
1462 i < length; i++) { | 1460 i < length; i++) { |
1463 this._keys.$setindex(i); | 1461 this._keys.$setindex(i); |
1464 this._values.$setindex(i); | 1462 this._values.$setindex(i); |
1465 } | 1463 } |
1466 } | 1464 } |
1467 HashMapImplementation$E$E.prototype.$setindex = function(key, value) { | 1465 HashMapImplementation_E$E.prototype.$setindex = function(key, value) { |
1468 this._ensureCapacity(); | 1466 this._ensureCapacity(); |
1469 var index = this._probeForAdding(key); | 1467 var index = this._probeForAdding(key); |
1470 if ((this._keys.$index(index) == null) || (this._keys.$index(index) === const$
1/*HashMapImplementation._DELETED_KEY*/)) { | 1468 if ((this._keys.$index(index) == null) || (this._keys.$index(index) === const$
1/*HashMapImplementation._DELETED_KEY*/)) { |
1471 this._numberOfEntries++; | 1469 this._numberOfEntries++; |
1472 } | 1470 } |
1473 this._keys.$setindex(index, key); | 1471 this._keys.$setindex(index, key); |
1474 this._values.$setindex(index, value); | 1472 this._values.$setindex(index, value); |
1475 } | 1473 } |
1476 HashMapImplementation$E$E.prototype.remove = function(key) { | 1474 HashMapImplementation_E$E.prototype.remove = function(key) { |
1477 var index = this._probeForLookup(key); | 1475 var index = this._probeForLookup(key); |
1478 if (index >= 0) { | 1476 if (index >= 0) { |
1479 this._numberOfEntries--; | 1477 this._numberOfEntries--; |
1480 var value = this._values.$index(index); | 1478 var value = this._values.$index(index); |
1481 this._values.$setindex(index); | 1479 this._values.$setindex(index); |
1482 this._keys.$setindex(index, const$1/*HashMapImplementation._DELETED_KEY*/); | 1480 this._keys.$setindex(index, const$1/*HashMapImplementation._DELETED_KEY*/); |
1483 this._numberOfDeleted++; | 1481 this._numberOfDeleted++; |
1484 return value; | 1482 return value; |
1485 } | 1483 } |
1486 return null; | 1484 return null; |
1487 } | 1485 } |
1488 HashMapImplementation$E$E.prototype.isEmpty = function() { | 1486 HashMapImplementation_E$E.prototype.isEmpty = function() { |
1489 return this._numberOfEntries == 0; | 1487 return this._numberOfEntries == 0; |
1490 } | 1488 } |
1491 HashMapImplementation$E$E.prototype.forEach = function(f) { | 1489 HashMapImplementation_E$E.prototype.forEach = function(f) { |
1492 var length = this._keys.length; | 1490 var length = this._keys.length; |
1493 for (var i = 0; | 1491 for (var i = 0; |
1494 i < length; i++) { | 1492 i < length; i++) { |
1495 if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== const$1/*Has
hMapImplementation._DELETED_KEY*/)) { | 1493 if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== const$1/*Has
hMapImplementation._DELETED_KEY*/)) { |
1496 f(this._keys.$index(i), this._values.$index(i)); | 1494 f(this._keys.$index(i), this._values.$index(i)); |
1497 } | 1495 } |
1498 } | 1496 } |
1499 } | 1497 } |
1500 HashMapImplementation$E$E.prototype.getKeys = function() { | 1498 HashMapImplementation_E$E.prototype.getKeys = function() { |
1501 var list = new ListFactory(this.get$length()); | 1499 var list = new ListFactory(this.get$length()); |
1502 var i = 0; | 1500 var i = 0; |
1503 this.forEach(function _(key, value) { | 1501 this.forEach(function _(key, value) { |
1504 list.$setindex(i++, key); | 1502 list.$setindex(i++, key); |
1505 } | 1503 } |
1506 ); | 1504 ); |
1507 return list; | 1505 return list; |
1508 } | 1506 } |
1509 HashMapImplementation$E$E.prototype.containsKey = function(key) { | 1507 HashMapImplementation_E$E.prototype.containsKey = function(key) { |
1510 return (this._probeForLookup(key) != -1); | 1508 return (this._probeForLookup(key) != -1); |
1511 } | 1509 } |
1512 // ********** Code for HashMapImplementation$Element$HInstruction ************** | 1510 // ********** Code for HashMapImplementation_Element$HInstruction ************** |
1513 function HashMapImplementation$Element$HInstruction() {} | 1511 function HashMapImplementation_Element$HInstruction() {} |
1514 $inherits(HashMapImplementation$Element$HInstruction, HashMapImplementation); | 1512 $inherits(HashMapImplementation_Element$HInstruction, HashMapImplementation); |
1515 HashMapImplementation$Element$HInstruction.prototype.is$Map$Node$Element = false
; | 1513 HashMapImplementation_Element$HInstruction.prototype.is$Map_Node$Element = false
; |
1516 HashMapImplementation$Element$HInstruction.prototype.is$Map$String$Member = fals
e; | 1514 HashMapImplementation_Element$HInstruction.prototype.is$Map_String$Member = fals
e; |
1517 // ********** Code for HashMapImplementation$Element$HLocal ************** | 1515 // ********** Code for HashMapImplementation_Element$HLocal ************** |
1518 function HashMapImplementation$Element$HLocal() {} | 1516 function HashMapImplementation_Element$HLocal() {} |
1519 $inherits(HashMapImplementation$Element$HLocal, HashMapImplementation); | 1517 $inherits(HashMapImplementation_Element$HLocal, HashMapImplementation); |
1520 HashMapImplementation$Element$HLocal.prototype.is$Map$Node$Element = false; | 1518 HashMapImplementation_Element$HLocal.prototype.is$Map_Node$Element = false; |
1521 HashMapImplementation$Element$HLocal.prototype.is$Map$String$Member = false; | 1519 HashMapImplementation_Element$HLocal.prototype.is$Map_String$Member = false; |
1522 // ********** Code for HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePa
ir$K$V ************** | 1520 // ********** Code for HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePa
ir_K$V ************** |
1523 function HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V() {} | 1521 function HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePair_K$V() {} |
1524 $inherits(HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V, HashM
apImplementation); | 1522 $inherits(HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePair_K$V, HashM
apImplementation); |
1525 HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype.is$Map
$Node$Element = false; | 1523 HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.is$Map
_Node$Element = false; |
1526 HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype.is$Map
$String$Member = false; | 1524 HashMapImplementation_K$DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.is$Map
_String$Member = false; |
1527 // ********** Code for HashMapImplementation$String$EvaluatedValue *************
* | 1525 // ********** Code for HashMapImplementation_String$EvaluatedValue *************
* |
1528 function HashMapImplementation$String$EvaluatedValue() {} | 1526 function HashMapImplementation_String$EvaluatedValue() {} |
1529 $inherits(HashMapImplementation$String$EvaluatedValue, HashMapImplementation); | 1527 $inherits(HashMapImplementation_String$EvaluatedValue, HashMapImplementation); |
1530 HashMapImplementation$String$EvaluatedValue.prototype.is$Map$Node$Element = fals
e; | 1528 HashMapImplementation_String$EvaluatedValue.prototype.is$Map_Node$Element = fals
e; |
1531 HashMapImplementation$String$EvaluatedValue.prototype.is$Map$String$Member = fal
se; | 1529 HashMapImplementation_String$EvaluatedValue.prototype.is$Map_String$Member = fal
se; |
1532 // ********** Code for HashMapImplementation$String$int ************** | 1530 // ********** Code for HashMapImplementation_String$int ************** |
1533 function HashMapImplementation$String$int() {} | 1531 function HashMapImplementation_String$int() {} |
1534 $inherits(HashMapImplementation$String$int, HashMapImplementation); | 1532 $inherits(HashMapImplementation_String$int, HashMapImplementation); |
1535 HashMapImplementation$String$int.prototype.is$Map$Node$Element = false; | 1533 HashMapImplementation_String$int.prototype.is$Map_Node$Element = false; |
1536 HashMapImplementation$String$int.prototype.is$Map$String$Member = false; | 1534 HashMapImplementation_String$int.prototype.is$Map_String$Member = false; |
1537 // ********** Code for HashMapImplementation$int$HInstruction ************** | 1535 // ********** Code for HashMapImplementation_int$HInstruction ************** |
1538 function HashMapImplementation$int$HInstruction() {} | 1536 function HashMapImplementation_int$HInstruction() {} |
1539 $inherits(HashMapImplementation$int$HInstruction, HashMapImplementation); | 1537 $inherits(HashMapImplementation_int$HInstruction, HashMapImplementation); |
1540 HashMapImplementation$int$HInstruction.prototype.is$Map$Node$Element = false; | 1538 HashMapImplementation_int$HInstruction.prototype.is$Map_Node$Element = false; |
1541 HashMapImplementation$int$HInstruction.prototype.is$Map$String$Member = false; | 1539 HashMapImplementation_int$HInstruction.prototype.is$Map_String$Member = false; |
1542 // ********** Code for HashMapImplementation$int$String ************** | 1540 // ********** Code for HashMapImplementation_int$String ************** |
1543 function HashMapImplementation$int$String() {} | 1541 function HashMapImplementation_int$String() {} |
1544 $inherits(HashMapImplementation$int$String, HashMapImplementation); | 1542 $inherits(HashMapImplementation_int$String, HashMapImplementation); |
1545 HashMapImplementation$int$String.prototype.is$Map$Node$Element = false; | 1543 HashMapImplementation_int$String.prototype.is$Map_Node$Element = false; |
1546 HashMapImplementation$int$String.prototype.is$Map$String$Member = false; | 1544 HashMapImplementation_int$String.prototype.is$Map_String$Member = false; |
1547 // ********** Code for HashSetImplementation ************** | 1545 // ********** Code for HashSetImplementation ************** |
1548 function HashSetImplementation() { | 1546 function HashSetImplementation() { |
1549 // Initializers done | 1547 // Initializers done |
1550 this._backingMap = new HashMapImplementation$E$E(); | 1548 this._backingMap = new HashMapImplementation_E$E(); |
1551 } | 1549 } |
1552 HashSetImplementation.prototype.is$HashSetImplementation = function(){return thi
s;}; | 1550 HashSetImplementation.prototype.is$HashSetImplementation = function(){return thi
s;}; |
1553 HashSetImplementation.prototype.is$Collection$E = function(){return this;}; | 1551 HashSetImplementation.prototype.is$Collection_E = function(){return this;}; |
1554 HashSetImplementation.prototype.is$Collection$Object = function(){return this;}; | 1552 HashSetImplementation.prototype.is$Collection_Object = function(){return this;}; |
1555 HashSetImplementation.prototype.is$Collection$Type = function(){return this;}; | 1553 HashSetImplementation.prototype.is$Collection_Type = function(){return this;}; |
1556 HashSetImplementation.prototype.is$Iterable = function(){return this;}; | 1554 HashSetImplementation.prototype.is$Iterable = function(){return this;}; |
1557 HashSetImplementation.HashSetImplementation$from$factory = function(other) { | 1555 HashSetImplementation.HashSetImplementation$from$factory = function(other) { |
1558 var set = new HashSetImplementation(); | 1556 var set = new HashSetImplementation(); |
1559 for (var $i = other.iterator(); $i.hasNext$0(); ) { | 1557 for (var $i = other.iterator(); $i.hasNext$0(); ) { |
1560 var e = $i.next$0(); | 1558 var e = $i.next$0(); |
1561 set.add(e); | 1559 set.add(e); |
1562 } | 1560 } |
1563 return (set && set.is$HashSetImplementation()); | 1561 return (set && set.is$HashSetImplementation()); |
1564 } | 1562 } |
1565 HashSetImplementation.prototype.clear = function() { | 1563 HashSetImplementation.prototype.clear = function() { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1608 HashSetImplementation.prototype.isEmpty = function() { | 1606 HashSetImplementation.prototype.isEmpty = function() { |
1609 return this._backingMap.isEmpty(); | 1607 return this._backingMap.isEmpty(); |
1610 } | 1608 } |
1611 HashSetImplementation.prototype.get$length = function() { | 1609 HashSetImplementation.prototype.get$length = function() { |
1612 return this._backingMap.get$length(); | 1610 return this._backingMap.get$length(); |
1613 } | 1611 } |
1614 Object.defineProperty(HashSetImplementation.prototype, "length", { | 1612 Object.defineProperty(HashSetImplementation.prototype, "length", { |
1615 get: HashSetImplementation.prototype.get$length | 1613 get: HashSetImplementation.prototype.get$length |
1616 }); | 1614 }); |
1617 HashSetImplementation.prototype.iterator = function() { | 1615 HashSetImplementation.prototype.iterator = function() { |
1618 return new HashSetIterator$E(this); | 1616 return new HashSetIterator_E(this); |
1619 } | 1617 } |
1620 HashSetImplementation.prototype.add$1 = HashSetImplementation.prototype.add; | 1618 HashSetImplementation.prototype.add$1 = HashSetImplementation.prototype.add; |
1621 HashSetImplementation.prototype.addAll$1 = function($0) { | 1619 HashSetImplementation.prototype.addAll$1 = function($0) { |
1622 return this.addAll(($0 && $0.is$Collection$E())); | 1620 return this.addAll(($0 && $0.is$Collection_E())); |
1623 }; | 1621 }; |
1624 HashSetImplementation.prototype.contains$1 = HashSetImplementation.prototype.con
tains; | 1622 HashSetImplementation.prototype.contains$1 = HashSetImplementation.prototype.con
tains; |
1625 HashSetImplementation.prototype.every$1 = function($0) { | 1623 HashSetImplementation.prototype.every$1 = function($0) { |
1626 return this.every(to$call$1($0)); | 1624 return this.every(to$call$1($0)); |
1627 }; | 1625 }; |
1628 HashSetImplementation.prototype.filter$1 = function($0) { | 1626 HashSetImplementation.prototype.filter$1 = function($0) { |
1629 return this.filter(to$call$1($0)); | 1627 return this.filter(to$call$1($0)); |
1630 }; | 1628 }; |
1631 HashSetImplementation.prototype.forEach$1 = function($0) { | 1629 HashSetImplementation.prototype.forEach$1 = function($0) { |
1632 return this.forEach(to$call$1($0)); | 1630 return this.forEach(to$call$1($0)); |
1633 }; | 1631 }; |
1634 HashSetImplementation.prototype.isEmpty$0 = HashSetImplementation.prototype.isEm
pty; | 1632 HashSetImplementation.prototype.isEmpty$0 = HashSetImplementation.prototype.isEm
pty; |
1635 HashSetImplementation.prototype.iterator$0 = HashSetImplementation.prototype.ite
rator; | 1633 HashSetImplementation.prototype.iterator$0 = HashSetImplementation.prototype.ite
rator; |
1636 HashSetImplementation.prototype.some$1 = function($0) { | 1634 HashSetImplementation.prototype.some$1 = function($0) { |
1637 return this.some(to$call$1($0)); | 1635 return this.some(to$call$1($0)); |
1638 }; | 1636 }; |
1639 // ********** Code for HashSetImplementation$E ************** | 1637 // ********** Code for HashSetImplementation_E ************** |
1640 function HashSetImplementation$E() {} | 1638 function HashSetImplementation_E() {} |
1641 $inherits(HashSetImplementation$E, HashSetImplementation); | 1639 $inherits(HashSetImplementation_E, HashSetImplementation); |
1642 HashSetImplementation$E.prototype.is$Collection$E = function(){return this;}; | 1640 HashSetImplementation_E.prototype.is$Collection_E = function(){return this;}; |
1643 HashSetImplementation$E.prototype.is$Collection$Object = function(){return this;
}; | 1641 HashSetImplementation_E.prototype.is$Collection_Object = function(){return this;
}; |
1644 HashSetImplementation$E.prototype.is$Collection$Type = function(){return this;}; | 1642 HashSetImplementation_E.prototype.is$Collection_Type = function(){return this;}; |
1645 HashSetImplementation$E.prototype.is$Iterable = function(){return this;}; | 1643 HashSetImplementation_E.prototype.is$Iterable = function(){return this;}; |
1646 // ********** Code for HashSetImplementation$HPhi ************** | 1644 // ********** Code for HashSetImplementation_HPhi ************** |
1647 function HashSetImplementation$HPhi() {} | 1645 function HashSetImplementation_HPhi() {} |
1648 $inherits(HashSetImplementation$HPhi, HashSetImplementation); | 1646 $inherits(HashSetImplementation_HPhi, HashSetImplementation); |
1649 HashSetImplementation$HPhi.prototype.is$Collection$E = function(){return this;}; | 1647 HashSetImplementation_HPhi.prototype.is$Collection_E = function(){return this;}; |
1650 HashSetImplementation$HPhi.prototype.is$Collection$Object = function(){return th
is;}; | 1648 HashSetImplementation_HPhi.prototype.is$Collection_Object = function(){return th
is;}; |
1651 HashSetImplementation$HPhi.prototype.is$Collection$Type = false; | 1649 HashSetImplementation_HPhi.prototype.is$Collection_Type = false; |
1652 HashSetImplementation$HPhi.prototype.is$Iterable = function(){return this;}; | 1650 HashSetImplementation_HPhi.prototype.is$Iterable = function(){return this;}; |
1653 // ********** Code for HashSetImplementation$String ************** | 1651 // ********** Code for HashSetImplementation_String ************** |
1654 function HashSetImplementation$String() {} | 1652 function HashSetImplementation_String() {} |
1655 $inherits(HashSetImplementation$String, HashSetImplementation); | 1653 $inherits(HashSetImplementation_String, HashSetImplementation); |
1656 HashSetImplementation$String.prototype.is$Collection$E = function(){return this;
}; | 1654 HashSetImplementation_String.prototype.is$Collection_E = function(){return this;
}; |
1657 HashSetImplementation$String.prototype.is$Collection$Object = function(){return
this;}; | 1655 HashSetImplementation_String.prototype.is$Collection_Object = function(){return
this;}; |
1658 HashSetImplementation$String.prototype.is$Collection$Type = false; | 1656 HashSetImplementation_String.prototype.is$Collection_Type = false; |
1659 HashSetImplementation$String.prototype.is$Iterable = function(){return this;}; | 1657 HashSetImplementation_String.prototype.is$Iterable = function(){return this;}; |
1660 // ********** Code for HashSetImplementation$Type ************** | 1658 // ********** Code for HashSetImplementation_lang_Type ************** |
1661 function HashSetImplementation$Type() {} | 1659 function HashSetImplementation_lang_Type() {} |
1662 $inherits(HashSetImplementation$Type, HashSetImplementation); | 1660 $inherits(HashSetImplementation_lang_Type, HashSetImplementation); |
1663 HashSetImplementation$Type.prototype.is$Collection$E = function(){return this;}; | 1661 HashSetImplementation_lang_Type.prototype.is$Collection_E = function(){return th
is;}; |
1664 HashSetImplementation$Type.prototype.is$Collection$Object = function(){return th
is;}; | 1662 HashSetImplementation_lang_Type.prototype.is$Collection_Object = function(){retu
rn this;}; |
1665 HashSetImplementation$Type.prototype.is$Collection$Type = function(){return this
;}; | 1663 HashSetImplementation_lang_Type.prototype.is$Collection_Type = function(){return
this;}; |
1666 HashSetImplementation$Type.prototype.is$Iterable = function(){return this;}; | 1664 HashSetImplementation_lang_Type.prototype.is$Iterable = function(){return this;}
; |
1667 // ********** Code for HashSetImplementation$int ************** | 1665 // ********** Code for HashSetImplementation_int ************** |
1668 function HashSetImplementation$int() {} | 1666 function HashSetImplementation_int() {} |
1669 $inherits(HashSetImplementation$int, HashSetImplementation); | 1667 $inherits(HashSetImplementation_int, HashSetImplementation); |
1670 HashSetImplementation$int.prototype.is$Collection$E = function(){return this;}; | 1668 HashSetImplementation_int.prototype.is$Collection_E = function(){return this;}; |
1671 HashSetImplementation$int.prototype.is$Collection$Object = function(){return thi
s;}; | 1669 HashSetImplementation_int.prototype.is$Collection_Object = function(){return thi
s;}; |
1672 HashSetImplementation$int.prototype.is$Collection$Type = false; | 1670 HashSetImplementation_int.prototype.is$Collection_Type = false; |
1673 HashSetImplementation$int.prototype.is$Iterable = function(){return this;}; | 1671 HashSetImplementation_int.prototype.is$Iterable = function(){return this;}; |
1674 // ********** Code for HashSetIterator ************** | 1672 // ********** Code for HashSetIterator ************** |
1675 function HashSetIterator(set_) { | 1673 function HashSetIterator(set_) { |
1676 this._nextValidIndex = -1; | 1674 this._nextValidIndex = -1; |
1677 this._entries = set_._backingMap._keys; | 1675 this._entries = set_._backingMap._keys; |
1678 // Initializers done | 1676 // Initializers done |
1679 this._advance(); | 1677 this._advance(); |
1680 } | 1678 } |
1681 HashSetIterator.prototype.is$Iterator$T = function(){return this;}; | 1679 HashSetIterator.prototype.is$Iterator_T = function(){return this;}; |
1682 HashSetIterator.prototype.hasNext = function() { | 1680 HashSetIterator.prototype.hasNext = function() { |
1683 if (this._nextValidIndex >= this._entries.length) return false; | 1681 if (this._nextValidIndex >= this._entries.length) return false; |
1684 if (this._entries.$index(this._nextValidIndex) === const$1/*HashMapImplementat
ion._DELETED_KEY*/) { | 1682 if (this._entries.$index(this._nextValidIndex) === const$1/*HashMapImplementat
ion._DELETED_KEY*/) { |
1685 this._advance(); | 1683 this._advance(); |
1686 } | 1684 } |
1687 return this._nextValidIndex < this._entries.length; | 1685 return this._nextValidIndex < this._entries.length; |
1688 } | 1686 } |
1689 HashSetIterator.prototype.next = function() { | 1687 HashSetIterator.prototype.next = function() { |
1690 if (!this.hasNext()) { | 1688 if (!this.hasNext()) { |
1691 $throw(const$0/*const NoMoreElementsException()*/); | 1689 $throw(const$0/*const NoMoreElementsException()*/); |
1692 } | 1690 } |
1693 var res = this._entries.$index(this._nextValidIndex); | 1691 var res = this._entries.$index(this._nextValidIndex); |
1694 this._advance(); | 1692 this._advance(); |
1695 return res; | 1693 return res; |
1696 } | 1694 } |
1697 HashSetIterator.prototype._advance = function() { | 1695 HashSetIterator.prototype._advance = function() { |
1698 var length = this._entries.length; | 1696 var length = this._entries.length; |
1699 var entry; | 1697 var entry; |
1700 var deletedKey = const$1/*HashMapImplementation._DELETED_KEY*/; | 1698 var deletedKey = const$1/*HashMapImplementation._DELETED_KEY*/; |
1701 do { | 1699 do { |
1702 if (++this._nextValidIndex >= length) break; | 1700 if (++this._nextValidIndex >= length) break; |
1703 entry = this._entries.$index(this._nextValidIndex); | 1701 entry = this._entries.$index(this._nextValidIndex); |
1704 } | 1702 } |
1705 while ((entry == null) || (entry === deletedKey)) | 1703 while ((entry == null) || (entry === deletedKey)) |
1706 } | 1704 } |
1707 HashSetIterator.prototype.hasNext$0 = HashSetIterator.prototype.hasNext; | 1705 HashSetIterator.prototype.hasNext$0 = HashSetIterator.prototype.hasNext; |
1708 HashSetIterator.prototype.next$0 = HashSetIterator.prototype.next; | 1706 HashSetIterator.prototype.next$0 = HashSetIterator.prototype.next; |
1709 // ********** Code for HashSetIterator$E ************** | 1707 // ********** Code for HashSetIterator_E ************** |
1710 function HashSetIterator$E(set_) { | 1708 function HashSetIterator_E(set_) { |
1711 this._nextValidIndex = -1; | 1709 this._nextValidIndex = -1; |
1712 this._entries = set_._backingMap._keys; | 1710 this._entries = set_._backingMap._keys; |
1713 // Initializers done | 1711 // Initializers done |
1714 this._advance(); | 1712 this._advance(); |
1715 } | 1713 } |
1716 $inherits(HashSetIterator$E, HashSetIterator); | 1714 $inherits(HashSetIterator_E, HashSetIterator); |
1717 HashSetIterator$E.prototype.is$Iterator$T = function(){return this;}; | 1715 HashSetIterator_E.prototype.is$Iterator_T = function(){return this;}; |
1718 HashSetIterator$E.prototype._advance = function() { | 1716 HashSetIterator_E.prototype._advance = function() { |
1719 var length = this._entries.length; | 1717 var length = this._entries.length; |
1720 var entry; | 1718 var entry; |
1721 var deletedKey = const$1/*HashMapImplementation._DELETED_KEY*/; | 1719 var deletedKey = const$1/*HashMapImplementation._DELETED_KEY*/; |
1722 do { | 1720 do { |
1723 if (++this._nextValidIndex >= length) break; | 1721 if (++this._nextValidIndex >= length) break; |
1724 entry = this._entries.$index(this._nextValidIndex); | 1722 entry = this._entries.$index(this._nextValidIndex); |
1725 } | 1723 } |
1726 while ((entry == null) || (entry === deletedKey)) | 1724 while ((entry == null) || (entry === deletedKey)) |
1727 } | 1725 } |
1728 // ********** Code for _DeletedKeySentinel ************** | 1726 // ********** Code for _DeletedKeySentinel ************** |
1729 function _DeletedKeySentinel() { | 1727 function _DeletedKeySentinel() { |
1730 // Initializers done | 1728 // Initializers done |
1731 } | 1729 } |
1732 // ********** Code for KeyValuePair ************** | 1730 // ********** Code for KeyValuePair ************** |
1733 function KeyValuePair(key, value) { | 1731 function KeyValuePair(key, value) { |
1734 this.key = key; | 1732 this.key = key; |
1735 this.value = value; | 1733 this.value = value; |
1736 // Initializers done | 1734 // Initializers done |
1737 } | 1735 } |
1738 KeyValuePair.prototype.get$value = function() { return this.value; }; | 1736 KeyValuePair.prototype.get$value = function() { return this.value; }; |
1739 KeyValuePair.prototype.set$value = function(value) { return this.value = value;
}; | 1737 KeyValuePair.prototype.set$value = function(value) { return this.value = value;
}; |
1740 // ********** Code for KeyValuePair$K$V ************** | 1738 // ********** Code for KeyValuePair_K$V ************** |
1741 function KeyValuePair$K$V(key, value) { | 1739 function KeyValuePair_K$V(key, value) { |
1742 this.key = key; | 1740 this.key = key; |
1743 this.value = value; | 1741 this.value = value; |
1744 // Initializers done | 1742 // Initializers done |
1745 } | 1743 } |
1746 $inherits(KeyValuePair$K$V, KeyValuePair); | 1744 $inherits(KeyValuePair_K$V, KeyValuePair); |
1747 // ********** Code for LinkedHashMapImplementation ************** | 1745 // ********** Code for LinkedHashMapImplementation ************** |
1748 function LinkedHashMapImplementation() { | 1746 function LinkedHashMapImplementation() { |
1749 // Initializers done | 1747 // Initializers done |
1750 this._map = new HashMapImplementation(); | 1748 this._map = new HashMapImplementation(); |
1751 this._list = new DoubleLinkedQueue$KeyValuePair$K$V(); | 1749 this._list = new DoubleLinkedQueue_KeyValuePair_K$V(); |
1752 } | 1750 } |
1753 LinkedHashMapImplementation.prototype.is$Map$Node$Element = function(){return th
is;}; | 1751 LinkedHashMapImplementation.prototype.is$Map_Node$Element = function(){return th
is;}; |
1754 LinkedHashMapImplementation.prototype.is$Map$String$Member = function(){return t
his;}; | 1752 LinkedHashMapImplementation.prototype.is$Map_String$Member = function(){return t
his;}; |
1755 LinkedHashMapImplementation.prototype.$setindex = function(key, value) { | 1753 LinkedHashMapImplementation.prototype.$setindex = function(key, value) { |
1756 if (this._map.containsKey(key)) { | 1754 if (this._map.containsKey(key)) { |
1757 this._map.$index(key).get$element().set$value(value); | 1755 this._map.$index(key).get$element().set$value(value); |
1758 } | 1756 } |
1759 else { | 1757 else { |
1760 this._list.addLast(new KeyValuePair$K$V(key, value)); | 1758 this._list.addLast(new KeyValuePair_K$V(key, value)); |
1761 this._map.$setindex(key, this._list.lastEntry()); | 1759 this._map.$setindex(key, this._list.lastEntry()); |
1762 } | 1760 } |
1763 } | 1761 } |
1764 LinkedHashMapImplementation.prototype.$index = function(key) { | 1762 LinkedHashMapImplementation.prototype.$index = function(key) { |
1765 var $0; | 1763 var $0; |
1766 var entry = (($0 = this._map.$index(key)) && $0.is$DoubleLinkedQueueEntry$KeyV
aluePair$K$V()); | 1764 var entry = (($0 = this._map.$index(key)) && $0.is$DoubleLinkedQueueEntry_KeyV
aluePair_K$V()); |
1767 if (entry == null) return null; | 1765 if (entry == null) return null; |
1768 return entry.get$element().get$value(); | 1766 return entry.get$element().get$value(); |
1769 } | 1767 } |
1770 LinkedHashMapImplementation.prototype.remove = function(key) { | 1768 LinkedHashMapImplementation.prototype.remove = function(key) { |
1771 var $0; | 1769 var $0; |
1772 var entry = (($0 = this._map.remove(key)) && $0.is$DoubleLinkedQueueEntry$KeyV
aluePair$K$V()); | 1770 var entry = (($0 = this._map.remove(key)) && $0.is$DoubleLinkedQueueEntry_KeyV
aluePair_K$V()); |
1773 if (entry == null) return null; | 1771 if (entry == null) return null; |
1774 entry.remove(); | 1772 entry.remove(); |
1775 return entry.get$element().get$value(); | 1773 return entry.get$element().get$value(); |
1776 } | 1774 } |
1777 LinkedHashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { | 1775 LinkedHashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { |
1778 var value = this.$index(key); | 1776 var value = this.$index(key); |
1779 if ((this.$index(key) == null) && !(this.containsKey(key))) { | 1777 if ((this.$index(key) == null) && !(this.containsKey(key))) { |
1780 value = ifAbsent(); | 1778 value = ifAbsent(); |
1781 this.$setindex(key, value); | 1779 this.$setindex(key, value); |
1782 } | 1780 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1819 }); | 1817 }); |
1820 LinkedHashMapImplementation.prototype.isEmpty = function() { | 1818 LinkedHashMapImplementation.prototype.isEmpty = function() { |
1821 return this.get$length() == 0; | 1819 return this.get$length() == 0; |
1822 } | 1820 } |
1823 LinkedHashMapImplementation.prototype.forEach$1 = function($0) { | 1821 LinkedHashMapImplementation.prototype.forEach$1 = function($0) { |
1824 return this.forEach(to$call$2($0)); | 1822 return this.forEach(to$call$2($0)); |
1825 }; | 1823 }; |
1826 LinkedHashMapImplementation.prototype.getKeys$0 = LinkedHashMapImplementation.pr
ototype.getKeys; | 1824 LinkedHashMapImplementation.prototype.getKeys$0 = LinkedHashMapImplementation.pr
ototype.getKeys; |
1827 LinkedHashMapImplementation.prototype.getValues$0 = LinkedHashMapImplementation.
prototype.getValues; | 1825 LinkedHashMapImplementation.prototype.getValues$0 = LinkedHashMapImplementation.
prototype.getValues; |
1828 LinkedHashMapImplementation.prototype.isEmpty$0 = LinkedHashMapImplementation.pr
ototype.isEmpty; | 1826 LinkedHashMapImplementation.prototype.isEmpty$0 = LinkedHashMapImplementation.pr
ototype.isEmpty; |
1829 // ********** Code for LinkedHashMapImplementation$Element$String ************** | 1827 // ********** Code for LinkedHashMapImplementation_Element$String ************** |
1830 function LinkedHashMapImplementation$Element$String() {} | 1828 function LinkedHashMapImplementation_Element$String() {} |
1831 $inherits(LinkedHashMapImplementation$Element$String, LinkedHashMapImplementatio
n); | 1829 $inherits(LinkedHashMapImplementation_Element$String, LinkedHashMapImplementatio
n); |
1832 LinkedHashMapImplementation$Element$String.prototype.is$Map$Node$Element = false
; | 1830 LinkedHashMapImplementation_Element$String.prototype.is$Map_Node$Element = false
; |
1833 LinkedHashMapImplementation$Element$String.prototype.is$Map$String$Member = fals
e; | 1831 LinkedHashMapImplementation_Element$String.prototype.is$Map_String$Member = fals
e; |
1834 // ********** Code for LinkedHashMapImplementation$Node$Element ************** | 1832 // ********** Code for LinkedHashMapImplementation_Node$Element ************** |
1835 function LinkedHashMapImplementation$Node$Element() {} | 1833 function LinkedHashMapImplementation_Node$Element() {} |
1836 $inherits(LinkedHashMapImplementation$Node$Element, LinkedHashMapImplementation)
; | 1834 $inherits(LinkedHashMapImplementation_Node$Element, LinkedHashMapImplementation)
; |
1837 LinkedHashMapImplementation$Node$Element.prototype.is$Map$Node$Element = functio
n(){return this;}; | 1835 LinkedHashMapImplementation_Node$Element.prototype.is$Map_Node$Element = functio
n(){return this;}; |
1838 LinkedHashMapImplementation$Node$Element.prototype.is$Map$String$Member = false; | 1836 LinkedHashMapImplementation_Node$Element.prototype.is$Map_String$Member = false; |
1839 // ********** Code for LinkedHashMapImplementation$String$Keyword ************** | 1837 // ********** Code for LinkedHashMapImplementation_String$Keyword ************** |
1840 function LinkedHashMapImplementation$String$Keyword() {} | 1838 function LinkedHashMapImplementation_String$Keyword() {} |
1841 $inherits(LinkedHashMapImplementation$String$Keyword, LinkedHashMapImplementatio
n); | 1839 $inherits(LinkedHashMapImplementation_String$Keyword, LinkedHashMapImplementatio
n); |
1842 LinkedHashMapImplementation$String$Keyword.prototype.is$Map$Node$Element = false
; | 1840 LinkedHashMapImplementation_String$Keyword.prototype.is$Map_Node$Element = false
; |
1843 LinkedHashMapImplementation$String$Keyword.prototype.is$Map$String$Member = fals
e; | 1841 LinkedHashMapImplementation_String$Keyword.prototype.is$Map_String$Member = fals
e; |
1844 // ********** Code for DoubleLinkedQueueEntry ************** | 1842 // ********** Code for DoubleLinkedQueueEntry ************** |
1845 function DoubleLinkedQueueEntry(e) { | 1843 function DoubleLinkedQueueEntry(e) { |
1846 // Initializers done | 1844 // Initializers done |
1847 this._element = e; | 1845 this._element = e; |
1848 } | 1846 } |
1849 DoubleLinkedQueueEntry.prototype.is$DoubleLinkedQueueEntry$KeyValuePair$K$V = fu
nction(){return this;}; | 1847 DoubleLinkedQueueEntry.prototype.is$DoubleLinkedQueueEntry_KeyValuePair_K$V = fu
nction(){return this;}; |
1850 DoubleLinkedQueueEntry.prototype._link = function(p, n) { | 1848 DoubleLinkedQueueEntry.prototype._link = function(p, n) { |
1851 this._next = n; | 1849 this._next = n; |
1852 this._previous = p; | 1850 this._previous = p; |
1853 p._next = this; | 1851 p._next = this; |
1854 n._previous = this; | 1852 n._previous = this; |
1855 } | 1853 } |
1856 DoubleLinkedQueueEntry.prototype.prepend = function(e) { | 1854 DoubleLinkedQueueEntry.prototype.prepend = function(e) { |
1857 new DoubleLinkedQueueEntry$E(e)._link(this._previous, this); | 1855 new DoubleLinkedQueueEntry_E(e)._link(this._previous, this); |
1858 } | 1856 } |
1859 DoubleLinkedQueueEntry.prototype.remove = function() { | 1857 DoubleLinkedQueueEntry.prototype.remove = function() { |
1860 this._previous._next = this._next; | 1858 this._previous._next = this._next; |
1861 this._next._previous = this._previous; | 1859 this._next._previous = this._previous; |
1862 this._next = null; | 1860 this._next = null; |
1863 this._previous = null; | 1861 this._previous = null; |
1864 return this._element; | 1862 return this._element; |
1865 } | 1863 } |
1866 DoubleLinkedQueueEntry.prototype._asNonSentinelEntry = function() { | 1864 DoubleLinkedQueueEntry.prototype._asNonSentinelEntry = function() { |
1867 return this; | 1865 return this; |
1868 } | 1866 } |
1869 DoubleLinkedQueueEntry.prototype.previousEntry = function() { | 1867 DoubleLinkedQueueEntry.prototype.previousEntry = function() { |
1870 return this._previous._asNonSentinelEntry(); | 1868 return this._previous._asNonSentinelEntry(); |
1871 } | 1869 } |
1872 DoubleLinkedQueueEntry.prototype.get$element = function() { | 1870 DoubleLinkedQueueEntry.prototype.get$element = function() { |
1873 return this._element; | 1871 return this._element; |
1874 } | 1872 } |
1875 // ********** Code for DoubleLinkedQueueEntry$E ************** | 1873 // ********** Code for DoubleLinkedQueueEntry_E ************** |
1876 function DoubleLinkedQueueEntry$E(e) { | 1874 function DoubleLinkedQueueEntry_E(e) { |
1877 // Initializers done | 1875 // Initializers done |
1878 this._element = e; | 1876 this._element = e; |
1879 } | 1877 } |
1880 $inherits(DoubleLinkedQueueEntry$E, DoubleLinkedQueueEntry); | 1878 $inherits(DoubleLinkedQueueEntry_E, DoubleLinkedQueueEntry); |
1881 DoubleLinkedQueueEntry$E.prototype.is$DoubleLinkedQueueEntry$KeyValuePair$K$V =
function(){return this;}; | 1879 DoubleLinkedQueueEntry_E.prototype.is$DoubleLinkedQueueEntry_KeyValuePair_K$V =
function(){return this;}; |
1882 DoubleLinkedQueueEntry$E.prototype._link = function(p, n) { | 1880 DoubleLinkedQueueEntry_E.prototype._link = function(p, n) { |
1883 this._next = n; | 1881 this._next = n; |
1884 this._previous = p; | 1882 this._previous = p; |
1885 p._next = this; | 1883 p._next = this; |
1886 n._previous = this; | 1884 n._previous = this; |
1887 } | 1885 } |
1888 DoubleLinkedQueueEntry$E.prototype.prepend = function(e) { | 1886 DoubleLinkedQueueEntry_E.prototype.prepend = function(e) { |
1889 new DoubleLinkedQueueEntry$E(e)._link(this._previous, this); | 1887 new DoubleLinkedQueueEntry_E(e)._link(this._previous, this); |
1890 } | 1888 } |
1891 DoubleLinkedQueueEntry$E.prototype.remove = function() { | 1889 DoubleLinkedQueueEntry_E.prototype.remove = function() { |
1892 this._previous._next = this._next; | 1890 this._previous._next = this._next; |
1893 this._next._previous = this._previous; | 1891 this._next._previous = this._previous; |
1894 this._next = null; | 1892 this._next = null; |
1895 this._previous = null; | 1893 this._previous = null; |
1896 return this._element; | 1894 return this._element; |
1897 } | 1895 } |
1898 DoubleLinkedQueueEntry$E.prototype._asNonSentinelEntry = function() { | 1896 DoubleLinkedQueueEntry_E.prototype._asNonSentinelEntry = function() { |
1899 return this; | 1897 return this; |
1900 } | 1898 } |
1901 DoubleLinkedQueueEntry$E.prototype.previousEntry = function() { | 1899 DoubleLinkedQueueEntry_E.prototype.previousEntry = function() { |
1902 return this._previous._asNonSentinelEntry(); | 1900 return this._previous._asNonSentinelEntry(); |
1903 } | 1901 } |
1904 // ********** Code for DoubleLinkedQueueEntry$KeyValuePair$K$V ************** | 1902 // ********** Code for DoubleLinkedQueueEntry_KeyValuePair_K$V ************** |
1905 function DoubleLinkedQueueEntry$KeyValuePair$K$V(e) { | 1903 function DoubleLinkedQueueEntry_KeyValuePair_K$V(e) { |
1906 // Initializers done | 1904 // Initializers done |
1907 this._element = e; | 1905 this._element = e; |
1908 } | 1906 } |
1909 $inherits(DoubleLinkedQueueEntry$KeyValuePair$K$V, DoubleLinkedQueueEntry); | 1907 $inherits(DoubleLinkedQueueEntry_KeyValuePair_K$V, DoubleLinkedQueueEntry); |
1910 DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype.is$DoubleLinkedQueueEntry$KeyV
aluePair$K$V = function(){return this;}; | 1908 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.is$DoubleLinkedQueueEntry_KeyV
aluePair_K$V = function(){return this;}; |
1911 DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype._link = function(p, n) { | 1909 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype._link = function(p, n) { |
1912 this._next = n; | 1910 this._next = n; |
1913 this._previous = p; | 1911 this._previous = p; |
1914 p._next = this; | 1912 p._next = this; |
1915 n._previous = this; | 1913 n._previous = this; |
1916 } | 1914 } |
1917 DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype.prepend = function(e) { | 1915 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.prepend = function(e) { |
1918 new DoubleLinkedQueueEntry$KeyValuePair$K$V(e)._link(this._previous, this); | 1916 new DoubleLinkedQueueEntry_KeyValuePair_K$V(e)._link(this._previous, this); |
1919 } | 1917 } |
1920 DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype.remove = function() { | 1918 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.remove = function() { |
1921 this._previous._next = this._next; | 1919 this._previous._next = this._next; |
1922 this._next._previous = this._previous; | 1920 this._next._previous = this._previous; |
1923 this._next = null; | 1921 this._next = null; |
1924 this._previous = null; | 1922 this._previous = null; |
1925 return this._element; | 1923 return this._element; |
1926 } | 1924 } |
1927 DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype._asNonSentinelEntry = function
() { | 1925 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype._asNonSentinelEntry = function
() { |
1928 return this; | 1926 return this; |
1929 } | 1927 } |
1930 DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype.previousEntry = function() { | 1928 DoubleLinkedQueueEntry_KeyValuePair_K$V.prototype.previousEntry = function() { |
1931 var $0; | 1929 var $0; |
1932 return (($0 = this._previous._asNonSentinelEntry()) && $0.is$DoubleLinkedQueue
Entry$KeyValuePair$K$V()); | 1930 return (($0 = this._previous._asNonSentinelEntry()) && $0.is$DoubleLinkedQueue
Entry_KeyValuePair_K$V()); |
1933 } | 1931 } |
1934 // ********** Code for _DoubleLinkedQueueEntrySentinel ************** | 1932 // ********** Code for _DoubleLinkedQueueEntrySentinel ************** |
1935 function _DoubleLinkedQueueEntrySentinel() { | 1933 function _DoubleLinkedQueueEntrySentinel() { |
1936 // Initializers done | 1934 // Initializers done |
1937 DoubleLinkedQueueEntry$E.call(this, null); | 1935 DoubleLinkedQueueEntry_E.call(this, null); |
1938 this._link(this, this); | 1936 this._link(this, this); |
1939 } | 1937 } |
1940 $inherits(_DoubleLinkedQueueEntrySentinel, DoubleLinkedQueueEntry$E); | 1938 $inherits(_DoubleLinkedQueueEntrySentinel, DoubleLinkedQueueEntry_E); |
1941 _DoubleLinkedQueueEntrySentinel.prototype.remove = function() { | 1939 _DoubleLinkedQueueEntrySentinel.prototype.remove = function() { |
1942 $throw(const$5/*const EmptyQueueException()*/); | 1940 $throw(const$5/*const EmptyQueueException()*/); |
1943 } | 1941 } |
1944 _DoubleLinkedQueueEntrySentinel.prototype._asNonSentinelEntry = function() { | 1942 _DoubleLinkedQueueEntrySentinel.prototype._asNonSentinelEntry = function() { |
1945 return null; | 1943 return null; |
1946 } | 1944 } |
1947 _DoubleLinkedQueueEntrySentinel.prototype.get$element = function() { | 1945 _DoubleLinkedQueueEntrySentinel.prototype.get$element = function() { |
1948 $throw(const$5/*const EmptyQueueException()*/); | 1946 $throw(const$5/*const EmptyQueueException()*/); |
1949 } | 1947 } |
1950 // ********** Code for _DoubleLinkedQueueEntrySentinel$E ************** | 1948 // ********** Code for _DoubleLinkedQueueEntrySentinel_E ************** |
1951 function _DoubleLinkedQueueEntrySentinel$E() { | 1949 function _DoubleLinkedQueueEntrySentinel_E() { |
1952 // Initializers done | 1950 // Initializers done |
1953 DoubleLinkedQueueEntry$E.call(this, null); | 1951 DoubleLinkedQueueEntry_E.call(this, null); |
1954 this._link(this, this); | 1952 this._link(this, this); |
1955 } | 1953 } |
1956 $inherits(_DoubleLinkedQueueEntrySentinel$E, _DoubleLinkedQueueEntrySentinel); | 1954 $inherits(_DoubleLinkedQueueEntrySentinel_E, _DoubleLinkedQueueEntrySentinel); |
1957 // ********** Code for _DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V ********
****** | 1955 // ********** Code for _DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V ********
****** |
1958 function _DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V() { | 1956 function _DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V() { |
1959 // Initializers done | 1957 // Initializers done |
1960 DoubleLinkedQueueEntry$KeyValuePair$K$V.call(this, null); | 1958 DoubleLinkedQueueEntry_KeyValuePair_K$V.call(this, null); |
1961 this._link(this, this); | 1959 this._link(this, this); |
1962 } | 1960 } |
1963 $inherits(_DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V, _DoubleLinkedQueueEn
trySentinel); | 1961 $inherits(_DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V, _DoubleLinkedQueueEn
trySentinel); |
1964 // ********** Code for DoubleLinkedQueue ************** | 1962 // ********** Code for DoubleLinkedQueue ************** |
1965 function DoubleLinkedQueue() { | 1963 function DoubleLinkedQueue() { |
1966 // Initializers done | 1964 // Initializers done |
1967 this._sentinel = new _DoubleLinkedQueueEntrySentinel$E(); | 1965 this._sentinel = new _DoubleLinkedQueueEntrySentinel_E(); |
1968 } | 1966 } |
1969 DoubleLinkedQueue.prototype.is$Collection$E = function(){return this;}; | 1967 DoubleLinkedQueue.prototype.is$Collection_E = function(){return this;}; |
1970 DoubleLinkedQueue.prototype.is$Collection$Object = function(){return this;}; | 1968 DoubleLinkedQueue.prototype.is$Collection_Object = function(){return this;}; |
1971 DoubleLinkedQueue.prototype.is$Collection$Type = function(){return this;}; | 1969 DoubleLinkedQueue.prototype.is$Collection_Type = function(){return this;}; |
1972 DoubleLinkedQueue.prototype.is$Iterable = function(){return this;}; | 1970 DoubleLinkedQueue.prototype.is$Iterable = function(){return this;}; |
1973 DoubleLinkedQueue.prototype.addLast = function(value) { | 1971 DoubleLinkedQueue.prototype.addLast = function(value) { |
1974 this._sentinel.prepend(value); | 1972 this._sentinel.prepend(value); |
1975 } | 1973 } |
1976 DoubleLinkedQueue.prototype.add = function(value) { | 1974 DoubleLinkedQueue.prototype.add = function(value) { |
1977 this.addLast(value); | 1975 this.addLast(value); |
1978 } | 1976 } |
1979 DoubleLinkedQueue.prototype.addAll = function(collection) { | 1977 DoubleLinkedQueue.prototype.addAll = function(collection) { |
1980 for (var $i = collection.iterator(); $i.hasNext$0(); ) { | 1978 for (var $i = collection.iterator(); $i.hasNext$0(); ) { |
1981 var e = $i.next$0(); | 1979 var e = $i.next$0(); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2038 var other = new DoubleLinkedQueue(); | 2036 var other = new DoubleLinkedQueue(); |
2039 var entry = this._sentinel._next; | 2037 var entry = this._sentinel._next; |
2040 while (entry !== this._sentinel) { | 2038 while (entry !== this._sentinel) { |
2041 var nextEntry = entry._next; | 2039 var nextEntry = entry._next; |
2042 if (f(entry._element)) other.addLast(entry._element); | 2040 if (f(entry._element)) other.addLast(entry._element); |
2043 entry = nextEntry; | 2041 entry = nextEntry; |
2044 } | 2042 } |
2045 return other; | 2043 return other; |
2046 } | 2044 } |
2047 DoubleLinkedQueue.prototype.iterator = function() { | 2045 DoubleLinkedQueue.prototype.iterator = function() { |
2048 return new _DoubleLinkedQueueIterator$E(this._sentinel); | 2046 return new _DoubleLinkedQueueIterator_E(this._sentinel); |
2049 } | 2047 } |
2050 DoubleLinkedQueue.prototype.add$1 = DoubleLinkedQueue.prototype.add; | 2048 DoubleLinkedQueue.prototype.add$1 = DoubleLinkedQueue.prototype.add; |
2051 DoubleLinkedQueue.prototype.addAll$1 = function($0) { | 2049 DoubleLinkedQueue.prototype.addAll$1 = function($0) { |
2052 return this.addAll(($0 && $0.is$Collection$E())); | 2050 return this.addAll(($0 && $0.is$Collection_E())); |
2053 }; | 2051 }; |
2054 DoubleLinkedQueue.prototype.every$1 = function($0) { | 2052 DoubleLinkedQueue.prototype.every$1 = function($0) { |
2055 return this.every(to$call$1($0)); | 2053 return this.every(to$call$1($0)); |
2056 }; | 2054 }; |
2057 DoubleLinkedQueue.prototype.filter$1 = function($0) { | 2055 DoubleLinkedQueue.prototype.filter$1 = function($0) { |
2058 return this.filter(to$call$1($0)); | 2056 return this.filter(to$call$1($0)); |
2059 }; | 2057 }; |
2060 DoubleLinkedQueue.prototype.forEach$1 = function($0) { | 2058 DoubleLinkedQueue.prototype.forEach$1 = function($0) { |
2061 return this.forEach(to$call$1($0)); | 2059 return this.forEach(to$call$1($0)); |
2062 }; | 2060 }; |
2063 DoubleLinkedQueue.prototype.isEmpty$0 = DoubleLinkedQueue.prototype.isEmpty; | 2061 DoubleLinkedQueue.prototype.isEmpty$0 = DoubleLinkedQueue.prototype.isEmpty; |
2064 DoubleLinkedQueue.prototype.iterator$0 = DoubleLinkedQueue.prototype.iterator; | 2062 DoubleLinkedQueue.prototype.iterator$0 = DoubleLinkedQueue.prototype.iterator; |
2065 DoubleLinkedQueue.prototype.last$0 = DoubleLinkedQueue.prototype.last; | 2063 DoubleLinkedQueue.prototype.last$0 = DoubleLinkedQueue.prototype.last; |
2066 DoubleLinkedQueue.prototype.removeLast$0 = DoubleLinkedQueue.prototype.removeLas
t; | 2064 DoubleLinkedQueue.prototype.removeLast$0 = DoubleLinkedQueue.prototype.removeLas
t; |
2067 DoubleLinkedQueue.prototype.some$1 = function($0) { | 2065 DoubleLinkedQueue.prototype.some$1 = function($0) { |
2068 return this.some(to$call$1($0)); | 2066 return this.some(to$call$1($0)); |
2069 }; | 2067 }; |
2070 // ********** Code for DoubleLinkedQueue$ClassElement ************** | 2068 // ********** Code for DoubleLinkedQueue_ClassElement ************** |
2071 function DoubleLinkedQueue$ClassElement() {} | 2069 function DoubleLinkedQueue_ClassElement() {} |
2072 $inherits(DoubleLinkedQueue$ClassElement, DoubleLinkedQueue); | 2070 $inherits(DoubleLinkedQueue_ClassElement, DoubleLinkedQueue); |
2073 DoubleLinkedQueue$ClassElement.prototype.is$Collection$E = function(){return thi
s;}; | 2071 DoubleLinkedQueue_ClassElement.prototype.is$Collection_E = function(){return thi
s;}; |
2074 DoubleLinkedQueue$ClassElement.prototype.is$Collection$Object = function(){retur
n this;}; | 2072 DoubleLinkedQueue_ClassElement.prototype.is$Collection_Object = function(){retur
n this;}; |
2075 DoubleLinkedQueue$ClassElement.prototype.is$Collection$Type = false; | 2073 DoubleLinkedQueue_ClassElement.prototype.is$Collection_Type = false; |
2076 DoubleLinkedQueue$ClassElement.prototype.is$Iterable = function(){return this;}; | 2074 DoubleLinkedQueue_ClassElement.prototype.is$Iterable = function(){return this;}; |
2077 // ********** Code for DoubleLinkedQueue$E ************** | 2075 // ********** Code for DoubleLinkedQueue_E ************** |
2078 function DoubleLinkedQueue$E() {} | 2076 function DoubleLinkedQueue_E() {} |
2079 $inherits(DoubleLinkedQueue$E, DoubleLinkedQueue); | 2077 $inherits(DoubleLinkedQueue_E, DoubleLinkedQueue); |
2080 DoubleLinkedQueue$E.prototype.is$Collection$E = function(){return this;}; | 2078 DoubleLinkedQueue_E.prototype.is$Collection_E = function(){return this;}; |
2081 DoubleLinkedQueue$E.prototype.is$Collection$Object = function(){return this;}; | 2079 DoubleLinkedQueue_E.prototype.is$Collection_Object = function(){return this;}; |
2082 DoubleLinkedQueue$E.prototype.is$Collection$Type = function(){return this;}; | 2080 DoubleLinkedQueue_E.prototype.is$Collection_Type = function(){return this;}; |
2083 DoubleLinkedQueue$E.prototype.is$Iterable = function(){return this;}; | 2081 DoubleLinkedQueue_E.prototype.is$Iterable = function(){return this;}; |
2084 // ********** Code for DoubleLinkedQueue$Element ************** | 2082 // ********** Code for DoubleLinkedQueue_Element ************** |
2085 function DoubleLinkedQueue$Element() {} | 2083 function DoubleLinkedQueue_Element() {} |
2086 $inherits(DoubleLinkedQueue$Element, DoubleLinkedQueue); | 2084 $inherits(DoubleLinkedQueue_Element, DoubleLinkedQueue); |
2087 DoubleLinkedQueue$Element.prototype.is$Collection$E = function(){return this;}; | 2085 DoubleLinkedQueue_Element.prototype.is$Collection_E = function(){return this;}; |
2088 DoubleLinkedQueue$Element.prototype.is$Collection$Object = function(){return thi
s;}; | 2086 DoubleLinkedQueue_Element.prototype.is$Collection_Object = function(){return thi
s;}; |
2089 DoubleLinkedQueue$Element.prototype.is$Collection$Type = false; | 2087 DoubleLinkedQueue_Element.prototype.is$Collection_Type = false; |
2090 DoubleLinkedQueue$Element.prototype.is$Iterable = function(){return this;}; | 2088 DoubleLinkedQueue_Element.prototype.is$Iterable = function(){return this;}; |
2091 // ********** Code for DoubleLinkedQueue$KeyValuePair$K$V ************** | 2089 // ********** Code for DoubleLinkedQueue_KeyValuePair_K$V ************** |
2092 function DoubleLinkedQueue$KeyValuePair$K$V() { | 2090 function DoubleLinkedQueue_KeyValuePair_K$V() { |
2093 // Initializers done | 2091 // Initializers done |
2094 this._sentinel = new _DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V(); | 2092 this._sentinel = new _DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V(); |
2095 } | 2093 } |
2096 $inherits(DoubleLinkedQueue$KeyValuePair$K$V, DoubleLinkedQueue); | 2094 $inherits(DoubleLinkedQueue_KeyValuePair_K$V, DoubleLinkedQueue); |
2097 DoubleLinkedQueue$KeyValuePair$K$V.prototype.is$Collection$E = function(){return
this;}; | 2095 DoubleLinkedQueue_KeyValuePair_K$V.prototype.is$Collection_E = function(){return
this;}; |
2098 DoubleLinkedQueue$KeyValuePair$K$V.prototype.is$Collection$Object = function(){r
eturn this;}; | 2096 DoubleLinkedQueue_KeyValuePair_K$V.prototype.is$Collection_Object = function(){r
eturn this;}; |
2099 DoubleLinkedQueue$KeyValuePair$K$V.prototype.is$Collection$Type = false; | 2097 DoubleLinkedQueue_KeyValuePair_K$V.prototype.is$Collection_Type = false; |
2100 DoubleLinkedQueue$KeyValuePair$K$V.prototype.is$Iterable = function(){return thi
s;}; | 2098 DoubleLinkedQueue_KeyValuePair_K$V.prototype.is$Iterable = function(){return thi
s;}; |
2101 DoubleLinkedQueue$KeyValuePair$K$V.prototype.addLast = function(value) { | 2099 DoubleLinkedQueue_KeyValuePair_K$V.prototype.addLast = function(value) { |
2102 this._sentinel.prepend(value); | 2100 this._sentinel.prepend(value); |
2103 } | 2101 } |
2104 DoubleLinkedQueue$KeyValuePair$K$V.prototype.lastEntry = function() { | 2102 DoubleLinkedQueue_KeyValuePair_K$V.prototype.lastEntry = function() { |
2105 return this._sentinel.previousEntry(); | 2103 return this._sentinel.previousEntry(); |
2106 } | 2104 } |
2107 DoubleLinkedQueue$KeyValuePair$K$V.prototype.forEach = function(f) { | 2105 DoubleLinkedQueue_KeyValuePair_K$V.prototype.forEach = function(f) { |
2108 var entry = this._sentinel._next; | 2106 var entry = this._sentinel._next; |
2109 while (entry !== this._sentinel) { | 2107 while (entry !== this._sentinel) { |
2110 var nextEntry = entry._next; | 2108 var nextEntry = entry._next; |
2111 f(entry._element); | 2109 f(entry._element); |
2112 entry = nextEntry; | 2110 entry = nextEntry; |
2113 } | 2111 } |
2114 } | 2112 } |
2115 // ********** Code for _DoubleLinkedQueueIterator ************** | 2113 // ********** Code for _DoubleLinkedQueueIterator ************** |
2116 function _DoubleLinkedQueueIterator(_sentinel) { | 2114 function _DoubleLinkedQueueIterator(_sentinel) { |
2117 this._sentinel = _sentinel; | 2115 this._sentinel = _sentinel; |
2118 // Initializers done | 2116 // Initializers done |
2119 this._currentEntry = this._sentinel; | 2117 this._currentEntry = this._sentinel; |
2120 } | 2118 } |
2121 _DoubleLinkedQueueIterator.prototype.is$Iterator$T = function(){return this;}; | 2119 _DoubleLinkedQueueIterator.prototype.is$Iterator_T = function(){return this;}; |
2122 _DoubleLinkedQueueIterator.prototype.hasNext = function() { | 2120 _DoubleLinkedQueueIterator.prototype.hasNext = function() { |
2123 return this._currentEntry._next !== this._sentinel; | 2121 return this._currentEntry._next !== this._sentinel; |
2124 } | 2122 } |
2125 _DoubleLinkedQueueIterator.prototype.next = function() { | 2123 _DoubleLinkedQueueIterator.prototype.next = function() { |
2126 if (!this.hasNext()) { | 2124 if (!this.hasNext()) { |
2127 $throw(const$0/*const NoMoreElementsException()*/); | 2125 $throw(const$0/*const NoMoreElementsException()*/); |
2128 } | 2126 } |
2129 this._currentEntry = this._currentEntry._next; | 2127 this._currentEntry = this._currentEntry._next; |
2130 return this._currentEntry.get$element(); | 2128 return this._currentEntry.get$element(); |
2131 } | 2129 } |
2132 _DoubleLinkedQueueIterator.prototype.hasNext$0 = _DoubleLinkedQueueIterator.prot
otype.hasNext; | 2130 _DoubleLinkedQueueIterator.prototype.hasNext$0 = _DoubleLinkedQueueIterator.prot
otype.hasNext; |
2133 _DoubleLinkedQueueIterator.prototype.next$0 = _DoubleLinkedQueueIterator.prototy
pe.next; | 2131 _DoubleLinkedQueueIterator.prototype.next$0 = _DoubleLinkedQueueIterator.prototy
pe.next; |
2134 // ********** Code for _DoubleLinkedQueueIterator$E ************** | 2132 // ********** Code for _DoubleLinkedQueueIterator_E ************** |
2135 function _DoubleLinkedQueueIterator$E(_sentinel) { | 2133 function _DoubleLinkedQueueIterator_E(_sentinel) { |
2136 this._sentinel = _sentinel; | 2134 this._sentinel = _sentinel; |
2137 // Initializers done | 2135 // Initializers done |
2138 this._currentEntry = this._sentinel; | 2136 this._currentEntry = this._sentinel; |
2139 } | 2137 } |
2140 $inherits(_DoubleLinkedQueueIterator$E, _DoubleLinkedQueueIterator); | 2138 $inherits(_DoubleLinkedQueueIterator_E, _DoubleLinkedQueueIterator); |
2141 _DoubleLinkedQueueIterator$E.prototype.is$Iterator$T = function(){return this;}; | 2139 _DoubleLinkedQueueIterator_E.prototype.is$Iterator_T = function(){return this;}; |
2142 // ********** Code for StopwatchImplementation ************** | 2140 // ********** Code for StopwatchImplementation ************** |
2143 function StopwatchImplementation() { | 2141 function StopwatchImplementation() { |
2144 this._start = null; | 2142 this._start = null; |
2145 this._stop = null; | 2143 this._stop = null; |
2146 // Initializers done | 2144 // Initializers done |
2147 } | 2145 } |
2148 StopwatchImplementation.prototype.start = function() { | 2146 StopwatchImplementation.prototype.start = function() { |
2149 if (this._start == null) { | 2147 if (this._start == null) { |
2150 this._start = Clock.now(); | 2148 this._start = Clock.now(); |
2151 } | 2149 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2215 StringBufferImpl.prototype.toString = function() { | 2213 StringBufferImpl.prototype.toString = function() { |
2216 if (this._buffer.length == 0) return ""; | 2214 if (this._buffer.length == 0) return ""; |
2217 if (this._buffer.length == 1) return $assert_String(this._buffer.$index(0)); | 2215 if (this._buffer.length == 1) return $assert_String(this._buffer.$index(0)); |
2218 var result = StringBase.concatAll(this._buffer); | 2216 var result = StringBase.concatAll(this._buffer); |
2219 this._buffer.clear(); | 2217 this._buffer.clear(); |
2220 this._buffer.add(result); | 2218 this._buffer.add(result); |
2221 return result; | 2219 return result; |
2222 } | 2220 } |
2223 StringBufferImpl.prototype.add$1 = StringBufferImpl.prototype.add; | 2221 StringBufferImpl.prototype.add$1 = StringBufferImpl.prototype.add; |
2224 StringBufferImpl.prototype.addAll$1 = function($0) { | 2222 StringBufferImpl.prototype.addAll$1 = function($0) { |
2225 return this.addAll(($0 && $0.is$Collection$Object())); | 2223 return this.addAll(($0 && $0.is$Collection_Object())); |
2226 }; | 2224 }; |
2227 StringBufferImpl.prototype.isEmpty$0 = StringBufferImpl.prototype.isEmpty; | 2225 StringBufferImpl.prototype.isEmpty$0 = StringBufferImpl.prototype.isEmpty; |
2228 StringBufferImpl.prototype.toString$0 = StringBufferImpl.prototype.toString; | 2226 StringBufferImpl.prototype.toString$0 = StringBufferImpl.prototype.toString; |
2229 // ********** Code for StringBase ************** | 2227 // ********** Code for StringBase ************** |
2230 function StringBase() {} | 2228 function StringBase() {} |
2231 StringBase.createFromCharCodes = function(charCodes) { | 2229 StringBase.createFromCharCodes = function(charCodes) { |
2232 if (Object.getPrototypeOf(charCodes) !== Array.prototype) { | 2230 if (Object.getPrototypeOf(charCodes) !== Array.prototype) { |
2233 var length = charCodes.length; | 2231 var length = charCodes.length; |
2234 var tmp = new Array(length); | 2232 var tmp = new Array(length); |
2235 for (var i = 0; i < length; i++) { | 2233 for (var i = 0; i < length; i++) { |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2489 if ($notnull_bool($eq(piece, '..')) && pieces.length > 0 && $notnull_bool($n
e(pieces.last$0(), '.')) && $notnull_bool($ne(pieces.last$0(), '..'))) { | 2487 if ($notnull_bool($eq(piece, '..')) && pieces.length > 0 && $notnull_bool($n
e(pieces.last$0(), '.')) && $notnull_bool($ne(pieces.last$0(), '..'))) { |
2490 pieces.removeLast$0(); | 2488 pieces.removeLast$0(); |
2491 } | 2489 } |
2492 else if ($notnull_bool($ne(piece, ''))) { | 2490 else if ($notnull_bool($ne(piece, ''))) { |
2493 if (pieces.length > 0 && $notnull_bool($eq(pieces.last$0(), '.'))) { | 2491 if (pieces.length > 0 && $notnull_bool($eq(pieces.last$0(), '.'))) { |
2494 pieces.removeLast$0(); | 2492 pieces.removeLast$0(); |
2495 } | 2493 } |
2496 pieces.add$1(piece); | 2494 pieces.add$1(piece); |
2497 } | 2495 } |
2498 } | 2496 } |
2499 return Strings.join((pieces && pieces.is$List$String()), '/'); | 2497 return Strings.join((pieces && pieces.is$List_String()), '/'); |
2500 } | 2498 } |
2501 function dirname(path) { | 2499 function dirname(path) { |
2502 var lastSlash = path.lastIndexOf('/', path.length); | 2500 var lastSlash = path.lastIndexOf('/', path.length); |
2503 if (lastSlash == -1) { | 2501 if (lastSlash == -1) { |
2504 return '.'; | 2502 return '.'; |
2505 } | 2503 } |
2506 else { | 2504 else { |
2507 return path.substring(0, lastSlash); | 2505 return path.substring(0, lastSlash); |
2508 } | 2506 } |
2509 } | 2507 } |
(...skipping 24 matching lines...) Expand all Loading... |
2534 // ********** Library io ************** | 2532 // ********** Library io ************** |
2535 // ********** Code for top level ************** | 2533 // ********** Code for top level ************** |
2536 function join(strings) { | 2534 function join(strings) { |
2537 return Strings.join(strings, '/'); | 2535 return Strings.join(strings, '/'); |
2538 } | 2536 } |
2539 // ********** Library util_implementation ************** | 2537 // ********** Library util_implementation ************** |
2540 // ********** Code for LinkFactory ************** | 2538 // ********** Code for LinkFactory ************** |
2541 function LinkFactory() {} | 2539 function LinkFactory() {} |
2542 LinkFactory.Link$factory = function(head, tail) { | 2540 LinkFactory.Link$factory = function(head, tail) { |
2543 if (tail == null) { | 2541 if (tail == null) { |
2544 tail = new LinkTail$Dynamic(); | 2542 tail = new LinkTail_T(); |
2545 } | 2543 } |
2546 return new LinkEntry$Dynamic(head, tail); | 2544 return new LinkEntry_T(head, tail); |
2547 } | 2545 } |
2548 // ********** Code for AbstractLink ************** | 2546 // ********** Code for AbstractLink ************** |
2549 function AbstractLink() { | 2547 function AbstractLink() { |
2550 // Initializers done | 2548 // Initializers done |
2551 } | 2549 } |
2552 AbstractLink.prototype.is$Link$Element = function(){return this;}; | 2550 AbstractLink.prototype.is$Link_Element = function(){return this;}; |
2553 AbstractLink.prototype.is$Link$Node = function(){return this;}; | 2551 AbstractLink.prototype.is$Link_Node = function(){return this;}; |
2554 AbstractLink.prototype.is$Link$Token = function(){return this;}; | 2552 AbstractLink.prototype.is$Link_Token = function(){return this;}; |
2555 AbstractLink.prototype.is$Link$Type = function(){return this;}; | 2553 AbstractLink.prototype.is$Link_Type = function(){return this;}; |
2556 AbstractLink.prototype.is$Iterable = function(){return this;}; | 2554 AbstractLink.prototype.is$Iterable = function(){return this;}; |
2557 AbstractLink.prototype.get$head = function() { | 2555 AbstractLink.prototype.get$head = function() { |
2558 $throw("bug"); | 2556 $throw("bug"); |
2559 } | 2557 } |
2560 AbstractLink.prototype.get$tail = function() { | 2558 AbstractLink.prototype.get$tail = function() { |
2561 $throw("bug"); | 2559 $throw("bug"); |
2562 } | 2560 } |
2563 AbstractLink.prototype.prepend = function(element) { | 2561 AbstractLink.prototype.prepend = function(element) { |
2564 return new LinkEntry$T(element, this); | 2562 return new LinkEntry_T(element, this); |
2565 } | 2563 } |
2566 AbstractLink.prototype.iterator = function() { | 2564 AbstractLink.prototype.iterator = function() { |
2567 var $0; | 2565 var $0; |
2568 return (($0 = this.toList().iterator$0()) && $0.is$Iterator$T()); | 2566 return (($0 = this.toList().iterator$0()) && $0.is$Iterator_T()); |
2569 } | 2567 } |
2570 AbstractLink.prototype.printOn = function(buffer, separatedBy) { | 2568 AbstractLink.prototype.printOn = function(buffer, separatedBy) { |
2571 if ($notnull_bool(this.isEmpty())) return; | 2569 if ($notnull_bool(this.isEmpty())) return; |
2572 buffer.add(this.get$head() == null ? 'null' : this.get$head()); | 2570 buffer.add(this.get$head() == null ? 'null' : this.get$head()); |
2573 if (separatedBy == null) separatedBy = ''; | 2571 if (separatedBy == null) separatedBy = ''; |
2574 for (var link = this.get$tail(); | 2572 for (var link = this.get$tail(); |
2575 !$notnull_bool(link.isEmpty()); link = link.get$tail()) { | 2573 !$notnull_bool(link.isEmpty()); link = link.get$tail()) { |
2576 buffer.add(separatedBy); | 2574 buffer.add(separatedBy); |
2577 buffer.add(link.get$head() == null ? 'null' : link.get$head()); | 2575 buffer.add(link.get$head() == null ? 'null' : link.get$head()); |
2578 } | 2576 } |
2579 } | 2577 } |
2580 AbstractLink.prototype.toString = function() { | 2578 AbstractLink.prototype.toString = function() { |
2581 var buffer = new StringBufferImpl(""); | 2579 var buffer = new StringBufferImpl(""); |
2582 buffer.add('[ '); | 2580 buffer.add('[ '); |
2583 this.printOn(buffer, ', '); | 2581 this.printOn(buffer, ', '); |
2584 buffer.add(' ]'); | 2582 buffer.add(' ]'); |
2585 return buffer.toString(); | 2583 return buffer.toString(); |
2586 } | 2584 } |
2587 AbstractLink.prototype.isEmpty$0 = AbstractLink.prototype.isEmpty; | 2585 AbstractLink.prototype.isEmpty$0 = AbstractLink.prototype.isEmpty; |
2588 AbstractLink.prototype.iterator$0 = AbstractLink.prototype.iterator; | 2586 AbstractLink.prototype.iterator$0 = AbstractLink.prototype.iterator; |
2589 AbstractLink.prototype.printOn$1 = function($0) { | 2587 AbstractLink.prototype.printOn$1 = function($0) { |
2590 return this.printOn(($0 && $0.is$StringBuffer())); | 2588 return this.printOn(($0 && $0.is$StringBuffer())); |
2591 }; | 2589 }; |
2592 AbstractLink.prototype.toString$0 = AbstractLink.prototype.toString; | 2590 AbstractLink.prototype.toString$0 = AbstractLink.prototype.toString; |
2593 // ********** Code for AbstractLink$Dynamic ************** | 2591 // ********** Code for AbstractLink_T ************** |
2594 function AbstractLink$Dynamic() { | 2592 function AbstractLink_T() { |
2595 // Initializers done | 2593 // Initializers done |
2596 } | 2594 } |
2597 $inherits(AbstractLink$Dynamic, AbstractLink); | 2595 $inherits(AbstractLink_T, AbstractLink); |
2598 AbstractLink$Dynamic.prototype.is$Link$Element = function(){return this;}; | 2596 AbstractLink_T.prototype.is$Link_Element = function(){return this;}; |
2599 AbstractLink$Dynamic.prototype.is$Link$Node = function(){return this;}; | 2597 AbstractLink_T.prototype.is$Link_Node = function(){return this;}; |
2600 AbstractLink$Dynamic.prototype.is$Link$Token = function(){return this;}; | 2598 AbstractLink_T.prototype.is$Link_Token = function(){return this;}; |
2601 AbstractLink$Dynamic.prototype.is$Link$Type = function(){return this;}; | 2599 AbstractLink_T.prototype.is$Link_Type = function(){return this;}; |
2602 AbstractLink$Dynamic.prototype.is$Iterable = function(){return this;}; | 2600 AbstractLink_T.prototype.is$Iterable = function(){return this;}; |
2603 // ********** Code for AbstractLink$T ************** | 2601 AbstractLink_T.prototype.prepend = function(element) { |
2604 function AbstractLink$T() { | 2602 return new LinkEntry_T(element, this); |
2605 // Initializers done | |
2606 } | 2603 } |
2607 $inherits(AbstractLink$T, AbstractLink); | 2604 AbstractLink_T.prototype.iterator = function() { |
2608 AbstractLink$T.prototype.is$Link$Element = function(){return this;}; | 2605 var $0; |
2609 AbstractLink$T.prototype.is$Link$Node = function(){return this;}; | 2606 return (($0 = this.toList().iterator$0()) && $0.is$Iterator_T()); |
2610 AbstractLink$T.prototype.is$Link$Token = function(){return this;}; | |
2611 AbstractLink$T.prototype.is$Link$Type = function(){return this;}; | |
2612 AbstractLink$T.prototype.is$Iterable = function(){return this;}; | |
2613 AbstractLink$T.prototype.prepend = function(element) { | |
2614 return new LinkEntry$T(element, this); | |
2615 } | 2607 } |
2616 AbstractLink$T.prototype.iterator = function() { | 2608 AbstractLink_T.prototype.printOn = function(buffer, separatedBy) { |
2617 var $0; | |
2618 return (($0 = this.toList().iterator$0()) && $0.is$Iterator$T()); | |
2619 } | |
2620 AbstractLink$T.prototype.printOn = function(buffer, separatedBy) { | |
2621 if ($notnull_bool(this.isEmpty())) return; | 2609 if ($notnull_bool(this.isEmpty())) return; |
2622 buffer.add(this.get$head() == null ? 'null' : this.get$head()); | 2610 buffer.add(this.get$head() == null ? 'null' : this.get$head()); |
2623 if (separatedBy == null) separatedBy = ''; | 2611 if (separatedBy == null) separatedBy = ''; |
2624 for (var link = this.get$tail(); | 2612 for (var link = this.get$tail(); |
2625 !$notnull_bool(link.isEmpty()); link = link.get$tail()) { | 2613 !$notnull_bool(link.isEmpty()); link = link.get$tail()) { |
2626 buffer.add(separatedBy); | 2614 buffer.add(separatedBy); |
2627 buffer.add(link.get$head() == null ? 'null' : link.get$head()); | 2615 buffer.add(link.get$head() == null ? 'null' : link.get$head()); |
2628 } | 2616 } |
2629 } | 2617 } |
2630 AbstractLink$T.prototype.toString = function() { | 2618 AbstractLink_T.prototype.toString = function() { |
2631 var buffer = new StringBufferImpl(""); | 2619 var buffer = new StringBufferImpl(""); |
2632 buffer.add('[ '); | 2620 buffer.add('[ '); |
2633 this.printOn(buffer, ', '); | 2621 this.printOn(buffer, ', '); |
2634 buffer.add(' ]'); | 2622 buffer.add(' ]'); |
2635 return buffer.toString(); | 2623 return buffer.toString(); |
2636 } | 2624 } |
2637 // ********** Code for LinkTail ************** | 2625 // ********** Code for LinkTail ************** |
2638 function LinkTail() { | 2626 function LinkTail() { |
2639 // Initializers done | 2627 // Initializers done |
2640 AbstractLink$T.call(this); | 2628 AbstractLink_T.call(this); |
2641 } | 2629 } |
2642 $inherits(LinkTail, AbstractLink$T); | 2630 $inherits(LinkTail, AbstractLink_T); |
2643 LinkTail.prototype.is$Link$Element = function(){return this;}; | 2631 LinkTail.prototype.is$Link_Element = function(){return this;}; |
2644 LinkTail.prototype.is$Link$Node = function(){return this;}; | 2632 LinkTail.prototype.is$Link_Node = function(){return this;}; |
2645 LinkTail.prototype.is$Link$Token = function(){return this;}; | 2633 LinkTail.prototype.is$Link_Token = function(){return this;}; |
2646 LinkTail.prototype.is$Link$Type = function(){return this;}; | 2634 LinkTail.prototype.is$Link_Type = function(){return this;}; |
2647 LinkTail.prototype.is$Iterable = function(){return this;}; | 2635 LinkTail.prototype.is$Iterable = function(){return this;}; |
2648 LinkTail.prototype.get$head = function() { | 2636 LinkTail.prototype.get$head = function() { |
2649 return null; | 2637 return null; |
2650 } | 2638 } |
2651 LinkTail.prototype.get$tail = function() { | 2639 LinkTail.prototype.get$tail = function() { |
2652 return null; | 2640 return null; |
2653 } | 2641 } |
2654 LinkTail.prototype.toList = function() { | 2642 LinkTail.prototype.toList = function() { |
2655 return const$15/*const []*/; | 2643 return const$15/*const []*/; |
2656 } | 2644 } |
2657 LinkTail.prototype.isEmpty = function() { | 2645 LinkTail.prototype.isEmpty = function() { |
2658 return true; | 2646 return true; |
2659 } | 2647 } |
2660 LinkTail.prototype.isEmpty$0 = LinkTail.prototype.isEmpty; | 2648 LinkTail.prototype.isEmpty$0 = LinkTail.prototype.isEmpty; |
2661 // ********** Code for LinkTail$Dynamic ************** | 2649 // ********** Code for LinkTail_Element ************** |
2662 function LinkTail$Dynamic() { | 2650 function LinkTail_Element() {} |
| 2651 $inherits(LinkTail_Element, LinkTail); |
| 2652 LinkTail_Element.prototype.is$Link_Element = function(){return this;}; |
| 2653 LinkTail_Element.prototype.is$Link_Node = false; |
| 2654 LinkTail_Element.prototype.is$Link_Token = false; |
| 2655 LinkTail_Element.prototype.is$Link_Type = false; |
| 2656 LinkTail_Element.prototype.is$Iterable = function(){return this;}; |
| 2657 // ********** Code for LinkTail_Node ************** |
| 2658 function LinkTail_Node() {} |
| 2659 $inherits(LinkTail_Node, LinkTail); |
| 2660 LinkTail_Node.prototype.is$Link_Element = false; |
| 2661 LinkTail_Node.prototype.is$Link_Node = function(){return this;}; |
| 2662 LinkTail_Node.prototype.is$Link_Token = false; |
| 2663 LinkTail_Node.prototype.is$Link_Type = false; |
| 2664 LinkTail_Node.prototype.is$Iterable = function(){return this;}; |
| 2665 // ********** Code for LinkTail_T ************** |
| 2666 function LinkTail_T() { |
2663 // Initializers done | 2667 // Initializers done |
2664 AbstractLink$Dynamic.call(this); | 2668 AbstractLink_T.call(this); |
2665 } | 2669 } |
2666 $inherits(LinkTail$Dynamic, LinkTail); | 2670 $inherits(LinkTail_T, LinkTail); |
2667 LinkTail$Dynamic.prototype.is$Link$Element = function(){return this;}; | 2671 LinkTail_T.prototype.is$Link_Element = function(){return this;}; |
2668 LinkTail$Dynamic.prototype.is$Link$Node = function(){return this;}; | 2672 LinkTail_T.prototype.is$Link_Node = function(){return this;}; |
2669 LinkTail$Dynamic.prototype.is$Link$Token = function(){return this;}; | 2673 LinkTail_T.prototype.is$Link_Token = function(){return this;}; |
2670 LinkTail$Dynamic.prototype.is$Link$Type = function(){return this;}; | 2674 LinkTail_T.prototype.is$Link_Type = function(){return this;}; |
2671 LinkTail$Dynamic.prototype.is$Iterable = function(){return this;}; | 2675 LinkTail_T.prototype.is$Iterable = function(){return this;}; |
2672 // ********** Code for LinkTail$Element ************** | 2676 // ********** Code for LinkTail_Token ************** |
2673 function LinkTail$Element() {} | 2677 function LinkTail_Token() {} |
2674 $inherits(LinkTail$Element, LinkTail); | 2678 $inherits(LinkTail_Token, LinkTail); |
2675 LinkTail$Element.prototype.is$Link$Element = function(){return this;}; | 2679 LinkTail_Token.prototype.is$Link_Element = false; |
2676 LinkTail$Element.prototype.is$Link$Node = false; | 2680 LinkTail_Token.prototype.is$Link_Node = false; |
2677 LinkTail$Element.prototype.is$Link$Token = false; | 2681 LinkTail_Token.prototype.is$Link_Token = function(){return this;}; |
2678 LinkTail$Element.prototype.is$Link$Type = false; | 2682 LinkTail_Token.prototype.is$Link_Type = false; |
2679 LinkTail$Element.prototype.is$Iterable = function(){return this;}; | 2683 LinkTail_Token.prototype.is$Iterable = function(){return this;}; |
2680 // ********** Code for LinkTail$Node ************** | 2684 // ********** Code for LinkTail_Type ************** |
2681 function LinkTail$Node() {} | 2685 function LinkTail_Type() {} |
2682 $inherits(LinkTail$Node, LinkTail); | 2686 $inherits(LinkTail_Type, LinkTail); |
2683 LinkTail$Node.prototype.is$Link$Element = false; | 2687 LinkTail_Type.prototype.is$Link_Element = false; |
2684 LinkTail$Node.prototype.is$Link$Node = function(){return this;}; | 2688 LinkTail_Type.prototype.is$Link_Node = false; |
2685 LinkTail$Node.prototype.is$Link$Token = false; | 2689 LinkTail_Type.prototype.is$Link_Token = false; |
2686 LinkTail$Node.prototype.is$Link$Type = false; | 2690 LinkTail_Type.prototype.is$Link_Type = function(){return this;}; |
2687 LinkTail$Node.prototype.is$Iterable = function(){return this;}; | 2691 LinkTail_Type.prototype.is$Iterable = function(){return this;}; |
2688 // ********** Code for LinkTail$T ************** | |
2689 function LinkTail$T() {} | |
2690 $inherits(LinkTail$T, LinkTail); | |
2691 LinkTail$T.prototype.is$Link$Element = function(){return this;}; | |
2692 LinkTail$T.prototype.is$Link$Node = function(){return this;}; | |
2693 LinkTail$T.prototype.is$Link$Token = function(){return this;}; | |
2694 LinkTail$T.prototype.is$Link$Type = function(){return this;}; | |
2695 LinkTail$T.prototype.is$Iterable = function(){return this;}; | |
2696 // ********** Code for LinkTail$Token ************** | |
2697 function LinkTail$Token() {} | |
2698 $inherits(LinkTail$Token, LinkTail); | |
2699 LinkTail$Token.prototype.is$Link$Element = false; | |
2700 LinkTail$Token.prototype.is$Link$Node = false; | |
2701 LinkTail$Token.prototype.is$Link$Token = function(){return this;}; | |
2702 LinkTail$Token.prototype.is$Link$Type = false; | |
2703 LinkTail$Token.prototype.is$Iterable = function(){return this;}; | |
2704 // ********** Code for LinkTail$Type ************** | |
2705 function LinkTail$Type() {} | |
2706 $inherits(LinkTail$Type, LinkTail); | |
2707 LinkTail$Type.prototype.is$Link$Element = false; | |
2708 LinkTail$Type.prototype.is$Link$Node = false; | |
2709 LinkTail$Type.prototype.is$Link$Token = false; | |
2710 LinkTail$Type.prototype.is$Link$Type = function(){return this;}; | |
2711 LinkTail$Type.prototype.is$Iterable = function(){return this;}; | |
2712 // ********** Code for LinkEntry ************** | 2692 // ********** Code for LinkEntry ************** |
2713 function LinkEntry(head, realTail) { | 2693 function LinkEntry(head, realTail) { |
2714 this.head = head; | 2694 this.head = head; |
2715 this.realTail = realTail; | 2695 this.realTail = realTail; |
2716 // Initializers done | 2696 // Initializers done |
2717 AbstractLink$T.call(this); | 2697 AbstractLink_T.call(this); |
2718 } | 2698 } |
2719 $inherits(LinkEntry, AbstractLink$T); | 2699 $inherits(LinkEntry, AbstractLink_T); |
2720 LinkEntry.prototype.get$head = function() { return this.head; }; | 2700 LinkEntry.prototype.get$head = function() { return this.head; }; |
2721 LinkEntry.prototype.get$tail = function() { | 2701 LinkEntry.prototype.get$tail = function() { |
2722 return this.realTail; | 2702 return this.realTail; |
2723 } | 2703 } |
2724 LinkEntry.prototype.isEmpty = function() { | 2704 LinkEntry.prototype.isEmpty = function() { |
2725 return false; | 2705 return false; |
2726 } | 2706 } |
2727 LinkEntry.prototype.toList = function() { | 2707 LinkEntry.prototype.toList = function() { |
2728 var list = new ListFactory(); | 2708 var list = new ListFactory(); |
2729 for (var link = this; | 2709 for (var link = this; |
2730 !$notnull_bool(link.isEmpty()); link = link.get$tail()) { | 2710 !$notnull_bool(link.isEmpty()); link = link.get$tail()) { |
2731 list.addLast(link.get$head()); | 2711 list.addLast(link.get$head()); |
2732 } | 2712 } |
2733 return list; | 2713 return list; |
2734 } | 2714 } |
2735 LinkEntry.prototype.isEmpty$0 = LinkEntry.prototype.isEmpty; | 2715 LinkEntry.prototype.isEmpty$0 = LinkEntry.prototype.isEmpty; |
2736 // ********** Code for LinkEntry$Dynamic ************** | 2716 // ********** Code for LinkEntry_T ************** |
2737 function LinkEntry$Dynamic(head, realTail) { | 2717 function LinkEntry_T(head, realTail) { |
2738 this.head = head; | 2718 this.head = head; |
2739 this.realTail = realTail; | 2719 this.realTail = realTail; |
2740 // Initializers done | 2720 // Initializers done |
2741 AbstractLink$Dynamic.call(this); | 2721 AbstractLink_T.call(this); |
2742 } | 2722 } |
2743 $inherits(LinkEntry$Dynamic, LinkEntry); | 2723 $inherits(LinkEntry_T, LinkEntry); |
2744 // ********** Code for LinkEntry$T ************** | |
2745 function LinkEntry$T(head, realTail) { | |
2746 this.head = head; | |
2747 this.realTail = realTail; | |
2748 // Initializers done | |
2749 AbstractLink$T.call(this); | |
2750 } | |
2751 $inherits(LinkEntry$T, LinkEntry); | |
2752 // ********** Code for LinkBuilderImplementation ************** | 2724 // ********** Code for LinkBuilderImplementation ************** |
2753 function LinkBuilderImplementation() { | 2725 function LinkBuilderImplementation() { |
2754 this.head = null | 2726 this.head = null |
2755 this.lastLink = null | 2727 this.lastLink = null |
2756 // Initializers done | 2728 // Initializers done |
2757 } | 2729 } |
2758 LinkBuilderImplementation.prototype.get$head = function() { return this.head; }; | 2730 LinkBuilderImplementation.prototype.get$head = function() { return this.head; }; |
2759 LinkBuilderImplementation.prototype.set$head = function(value) { return this.hea
d = value; }; | 2731 LinkBuilderImplementation.prototype.set$head = function(value) { return this.hea
d = value; }; |
2760 LinkBuilderImplementation.prototype.toLink = function() { | 2732 LinkBuilderImplementation.prototype.toLink = function() { |
2761 if (this.head == null) return const$232/*const LinkTail()*/; | 2733 if (this.head == null) return const$232/*const LinkTail()*/; |
2762 this.lastLink.realTail = const$232/*const LinkTail()*/; | 2734 this.lastLink.realTail = const$232/*const LinkTail()*/; |
2763 var link = this.head; | 2735 var link = this.head; |
2764 this.lastLink = null; | 2736 this.lastLink = null; |
2765 this.head = null; | 2737 this.head = null; |
2766 return link; | 2738 return link; |
2767 } | 2739 } |
2768 LinkBuilderImplementation.prototype.addLast = function(t) { | 2740 LinkBuilderImplementation.prototype.addLast = function(t) { |
2769 var entry = new LinkEntry$T(t, null); | 2741 var entry = new LinkEntry_T(t, null); |
2770 if (this.head == null) { | 2742 if (this.head == null) { |
2771 this.head = entry; | 2743 this.head = entry; |
2772 } | 2744 } |
2773 else { | 2745 else { |
2774 this.lastLink.realTail = entry; | 2746 this.lastLink.realTail = entry; |
2775 } | 2747 } |
2776 this.lastLink = entry; | 2748 this.lastLink = entry; |
2777 } | 2749 } |
2778 // ********** Code for LinkBuilderImplementation$Element ************** | 2750 // ********** Code for LinkBuilderImplementation_Element ************** |
2779 function LinkBuilderImplementation$Element() {} | 2751 function LinkBuilderImplementation_Element() {} |
2780 $inherits(LinkBuilderImplementation$Element, LinkBuilderImplementation); | 2752 $inherits(LinkBuilderImplementation_Element, LinkBuilderImplementation); |
2781 // ********** Code for LinkBuilderImplementation$T ************** | 2753 // ********** Code for LinkBuilderImplementation_T ************** |
2782 function LinkBuilderImplementation$T() {} | 2754 function LinkBuilderImplementation_T() {} |
2783 $inherits(LinkBuilderImplementation$T, LinkBuilderImplementation); | 2755 $inherits(LinkBuilderImplementation_T, LinkBuilderImplementation); |
2784 // ********** Code for LinkBuilderImplementation$Type ************** | 2756 // ********** Code for LinkBuilderImplementation_Type ************** |
2785 function LinkBuilderImplementation$Type() {} | 2757 function LinkBuilderImplementation_Type() {} |
2786 $inherits(LinkBuilderImplementation$Type, LinkBuilderImplementation); | 2758 $inherits(LinkBuilderImplementation_Type, LinkBuilderImplementation); |
2787 // ********** Code for top level ************** | 2759 // ********** Code for top level ************** |
2788 // ********** Library util ************** | 2760 // ********** Library util ************** |
2789 // ********** Code for top level ************** | 2761 // ********** Code for top level ************** |
2790 // ********** Library scanner_implementation ************** | 2762 // ********** Library scanner_implementation ************** |
2791 // ********** Code for ArrayBasedScanner ************** | 2763 // ********** Code for ArrayBasedScanner ************** |
2792 function ArrayBasedScanner() { | 2764 function ArrayBasedScanner() { |
2793 this.groupingStack = const$16/*const EmptyLink<Token>()*/ | 2765 this.groupingStack = const$16/*const EmptyLink<Token>()*/ |
2794 this.extraCharOffset = 0; | 2766 this.extraCharOffset = 0; |
2795 this.tokenStart = -1; | 2767 this.tokenStart = -1; |
2796 this.byteOffset = -1; | 2768 this.byteOffset = -1; |
2797 this.tokens = new Token(0/*null.EOF_TOKEN*/, -1); | 2769 this.tokens = new Token(0/*null.EOF_TOKEN*/, -1); |
2798 // Initializers done | 2770 // Initializers done |
2799 AbstractScanner$S.call(this); | 2771 AbstractScanner_S.call(this); |
2800 this.tail = this.tokens; | 2772 this.tail = this.tokens; |
2801 } | 2773 } |
2802 $inherits(ArrayBasedScanner, AbstractScanner$S); | 2774 $inherits(ArrayBasedScanner, AbstractScanner_S); |
2803 ArrayBasedScanner.prototype.get$charOffset = function() { | 2775 ArrayBasedScanner.prototype.get$charOffset = function() { |
2804 return this.byteOffset + this.extraCharOffset; | 2776 return this.byteOffset + this.extraCharOffset; |
2805 } | 2777 } |
2806 ArrayBasedScanner.prototype.get$byteOffset = function() { return this.byteOffset
; }; | 2778 ArrayBasedScanner.prototype.get$byteOffset = function() { return this.byteOffset
; }; |
2807 ArrayBasedScanner.prototype.set$byteOffset = function(value) { return this.byteO
ffset = value; }; | 2779 ArrayBasedScanner.prototype.set$byteOffset = function(value) { return this.byteO
ffset = value; }; |
2808 ArrayBasedScanner.prototype.advance = function() { | 2780 ArrayBasedScanner.prototype.advance = function() { |
2809 var next = this.nextByte(); | 2781 var next = this.nextByte(); |
2810 return next; | 2782 return next; |
2811 } | 2783 } |
2812 ArrayBasedScanner.prototype.select = function(choice, yes, no) { | 2784 ArrayBasedScanner.prototype.select = function(choice, yes, no) { |
(...skipping 30 matching lines...) Expand all Loading... |
2843 } | 2815 } |
2844 ArrayBasedScanner.prototype.appendWhiteSpace = function(next) { | 2816 ArrayBasedScanner.prototype.appendWhiteSpace = function(next) { |
2845 | 2817 |
2846 } | 2818 } |
2847 ArrayBasedScanner.prototype.appendBeginGroup = function(kind, value) { | 2819 ArrayBasedScanner.prototype.appendBeginGroup = function(kind, value) { |
2848 var $0; | 2820 var $0; |
2849 var token = new BeginGroupToken(kind, value, this.tokenStart); | 2821 var token = new BeginGroupToken(kind, value, this.tokenStart); |
2850 this.tail.next = token; | 2822 this.tail.next = token; |
2851 this.tail = this.tail.next; | 2823 this.tail = this.tail.next; |
2852 while (kind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.isEmp
ty()) && this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { | 2824 while (kind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.isEmp
ty()) && this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { |
2853 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Tok
en()); | 2825 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Tok
en()); |
2854 } | 2826 } |
2855 this.groupingStack = (($0 = this.groupingStack.prepend(token)) && $0.is$Link$T
oken()); | 2827 this.groupingStack = (($0 = this.groupingStack.prepend(token)) && $0.is$Link_T
oken()); |
2856 } | 2828 } |
2857 ArrayBasedScanner.prototype.appendEndGroup = function(kind, value, openKind) { | 2829 ArrayBasedScanner.prototype.appendEndGroup = function(kind, value, openKind) { |
2858 var $0; | 2830 var $0; |
2859 var oldTail = this.tail; | 2831 var oldTail = this.tail; |
2860 this.appendStringToken(kind, value); | 2832 this.appendStringToken(kind, value); |
2861 if ($notnull_bool(this.groupingStack.isEmpty())) { | 2833 if ($notnull_bool(this.groupingStack.isEmpty())) { |
2862 if (openKind === 60/*null.LT_TOKEN*/) return; | 2834 if (openKind === 60/*null.LT_TOKEN*/) return; |
2863 $throw(new MalformedInputException(('Unmatched ' + value))); | 2835 $throw(new MalformedInputException(('Unmatched ' + value))); |
2864 } | 2836 } |
2865 while (openKind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.i
sEmpty()) && this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { | 2837 while (openKind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.i
sEmpty()) && this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { |
2866 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Tok
en()); | 2838 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Tok
en()); |
2867 } | 2839 } |
2868 if (this.groupingStack.get$head().get$kind() !== openKind) { | 2840 if (this.groupingStack.get$head().get$kind() !== openKind) { |
2869 if (openKind === 60/*null.LT_TOKEN*/) return; | 2841 if (openKind === 60/*null.LT_TOKEN*/) return; |
2870 $throw(new MalformedInputException(('Unmatched ' + value))); | 2842 $throw(new MalformedInputException(('Unmatched ' + value))); |
2871 } | 2843 } |
2872 this.groupingStack.get$head().set$endGroup(oldTail.next); | 2844 this.groupingStack.get$head().set$endGroup(oldTail.next); |
2873 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token
()); | 2845 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Token
()); |
2874 } | 2846 } |
2875 ArrayBasedScanner.prototype.appendGtGt = function(kind, value) { | 2847 ArrayBasedScanner.prototype.appendGtGt = function(kind, value) { |
2876 var $0; | 2848 var $0; |
2877 var oldTail = this.tail; | 2849 var oldTail = this.tail; |
2878 this.appendStringToken(kind, value); | 2850 this.appendStringToken(kind, value); |
2879 if ($notnull_bool(this.groupingStack.isEmpty())) return; | 2851 if ($notnull_bool(this.groupingStack.isEmpty())) return; |
2880 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { | 2852 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { |
2881 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Tok
en()); | 2853 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Tok
en()); |
2882 } | 2854 } |
2883 if ($notnull_bool(this.groupingStack.isEmpty())) return; | 2855 if ($notnull_bool(this.groupingStack.isEmpty())) return; |
2884 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { | 2856 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { |
2885 this.groupingStack.get$head().set$endGroup(oldTail.next); | 2857 this.groupingStack.get$head().set$endGroup(oldTail.next); |
2886 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Tok
en()); | 2858 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Tok
en()); |
2887 } | 2859 } |
2888 } | 2860 } |
2889 ArrayBasedScanner.prototype.appendGtGtGt = function(kind, value) { | 2861 ArrayBasedScanner.prototype.appendGtGtGt = function(kind, value) { |
2890 var $0; | 2862 var $0; |
2891 var oldTail = this.tail; | 2863 var oldTail = this.tail; |
2892 this.appendStringToken(kind, value); | 2864 this.appendStringToken(kind, value); |
2893 if ($notnull_bool(this.groupingStack.isEmpty())) return; | 2865 if ($notnull_bool(this.groupingStack.isEmpty())) return; |
2894 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { | 2866 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { |
2895 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Tok
en()); | 2867 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Tok
en()); |
2896 } | 2868 } |
2897 if ($notnull_bool(this.groupingStack.isEmpty())) return; | 2869 if ($notnull_bool(this.groupingStack.isEmpty())) return; |
2898 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { | 2870 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { |
2899 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Tok
en()); | 2871 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Tok
en()); |
2900 } | 2872 } |
2901 if ($notnull_bool(this.groupingStack.isEmpty())) return; | 2873 if ($notnull_bool(this.groupingStack.isEmpty())) return; |
2902 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { | 2874 if (this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) { |
2903 this.groupingStack.get$head().set$endGroup(oldTail.next); | 2875 this.groupingStack.get$head().set$endGroup(oldTail.next); |
2904 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Tok
en()); | 2876 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link_Tok
en()); |
2905 } | 2877 } |
2906 } | 2878 } |
2907 // ********** Code for ArrayBasedScanner$SourceString ************** | 2879 // ********** Code for ArrayBasedScanner_SourceString ************** |
2908 function ArrayBasedScanner$SourceString() { | 2880 function ArrayBasedScanner_SourceString() { |
2909 this.groupingStack = const$16/*const EmptyLink<Token>()*/ | 2881 this.groupingStack = const$16/*const EmptyLink<Token>()*/ |
2910 this.extraCharOffset = 0; | 2882 this.extraCharOffset = 0; |
2911 this.tokenStart = -1; | 2883 this.tokenStart = -1; |
2912 this.byteOffset = -1; | 2884 this.byteOffset = -1; |
2913 this.tokens = new Token(0/*null.EOF_TOKEN*/, -1); | 2885 this.tokens = new Token(0/*null.EOF_TOKEN*/, -1); |
2914 // Initializers done | 2886 // Initializers done |
2915 AbstractScanner$SourceString.call(this); | 2887 AbstractScanner_SourceString.call(this); |
2916 this.tail = this.tokens; | 2888 this.tail = this.tokens; |
2917 } | 2889 } |
2918 $inherits(ArrayBasedScanner$SourceString, ArrayBasedScanner); | 2890 $inherits(ArrayBasedScanner_SourceString, ArrayBasedScanner); |
2919 // ********** Code for top level ************** | 2891 // ********** Code for top level ************** |
2920 // ********** Library scanner ************** | 2892 // ********** Library scanner ************** |
2921 // ********** Code for AbstractScanner ************** | 2893 // ********** Code for AbstractScanner ************** |
2922 function AbstractScanner() { | 2894 function AbstractScanner() { |
2923 // Initializers done | 2895 // Initializers done |
2924 } | 2896 } |
2925 AbstractScanner.prototype.tokenize = function() { | 2897 AbstractScanner.prototype.tokenize = function() { |
2926 var next = this.advance(); | 2898 var next = this.advance(); |
2927 while (next != 0/*null.$EOF*/) { | 2899 while (next != 0/*null.$EOF*/) { |
2928 next = this.bigSwitch(next); | 2900 next = this.bigSwitch(next); |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3496 } | 3468 } |
3497 } | 3469 } |
3498 } | 3470 } |
3499 next = this.advance(); | 3471 next = this.advance(); |
3500 } | 3472 } |
3501 return next; | 3473 return next; |
3502 } | 3474 } |
3503 AbstractScanner.prototype.appendByteStringToken$2 = function($0, $1) { | 3475 AbstractScanner.prototype.appendByteStringToken$2 = function($0, $1) { |
3504 return this.appendByteStringToken($assert_num($0), $1); | 3476 return this.appendByteStringToken($assert_num($0), $1); |
3505 }; | 3477 }; |
3506 // ********** Code for AbstractScanner$S ************** | 3478 // ********** Code for AbstractScanner_S ************** |
3507 function AbstractScanner$S() { | 3479 function AbstractScanner_S() { |
3508 // Initializers done | 3480 // Initializers done |
3509 } | 3481 } |
3510 $inherits(AbstractScanner$S, AbstractScanner); | 3482 $inherits(AbstractScanner_S, AbstractScanner); |
3511 // ********** Code for AbstractScanner$SourceString ************** | 3483 // ********** Code for AbstractScanner_SourceString ************** |
3512 function AbstractScanner$SourceString() { | 3484 function AbstractScanner_SourceString() { |
3513 // Initializers done | 3485 // Initializers done |
3514 } | 3486 } |
3515 $inherits(AbstractScanner$SourceString, AbstractScanner); | 3487 $inherits(AbstractScanner_SourceString, AbstractScanner); |
3516 AbstractScanner$SourceString.prototype.tokenize = function() { | 3488 AbstractScanner_SourceString.prototype.tokenize = function() { |
3517 var next = this.advance(); | 3489 var next = this.advance(); |
3518 while (next != 0/*null.$EOF*/) { | 3490 while (next != 0/*null.$EOF*/) { |
3519 next = this.bigSwitch(next); | 3491 next = this.bigSwitch(next); |
3520 } | 3492 } |
3521 this.appendEofToken(); | 3493 this.appendEofToken(); |
3522 return this.firstToken(); | 3494 return this.firstToken(); |
3523 } | 3495 } |
3524 AbstractScanner$SourceString.prototype.bigSwitch = function(next) { | 3496 AbstractScanner_SourceString.prototype.bigSwitch = function(next) { |
3525 this.beginToken(); | 3497 this.beginToken(); |
3526 if (next === 9/*null.$TAB*/ || next === 10/*null.$LF*/ || next === 13/*null.$C
R*/ || next === 32/*null.$SPACE*/) { | 3498 if (next === 9/*null.$TAB*/ || next === 10/*null.$LF*/ || next === 13/*null.$C
R*/ || next === 32/*null.$SPACE*/) { |
3527 this.appendWhiteSpace(next); | 3499 this.appendWhiteSpace(next); |
3528 return this.advance(); | 3500 return this.advance(); |
3529 } | 3501 } |
3530 if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) { | 3502 if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) { |
3531 return this.tokenizeKeywordOrIdentifier(next); | 3503 return this.tokenizeKeywordOrIdentifier(next); |
3532 } | 3504 } |
3533 if ((65/*null.$A*/ <= next && next <= 90/*null.$Z*/) || next === 95/*null.$_*/
|| next === 36/*null.$DOLLAR*/) { | 3505 if ((65/*null.$A*/ <= next && next <= 90/*null.$Z*/) || next === 95/*null.$_*/
|| next === 36/*null.$DOLLAR*/) { |
3534 return this.tokenizeIdentifier(next, this.get$byteOffset()); | 3506 return this.tokenizeIdentifier(next, this.get$byteOffset()); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3638 return this.tokenizeNumber(next); | 3610 return this.tokenizeNumber(next); |
3639 } | 3611 } |
3640 if (next === 0/*null.$EOF*/) { | 3612 if (next === 0/*null.$EOF*/) { |
3641 return 0/*null.$EOF*/; | 3613 return 0/*null.$EOF*/; |
3642 } | 3614 } |
3643 if (next < 0x1f) { | 3615 if (next < 0x1f) { |
3644 $throw(new MalformedInputException(this.get$charOffset())); | 3616 $throw(new MalformedInputException(this.get$charOffset())); |
3645 } | 3617 } |
3646 return this.tokenizeIdentifier(next, this.get$byteOffset()); | 3618 return this.tokenizeIdentifier(next, this.get$byteOffset()); |
3647 } | 3619 } |
3648 AbstractScanner$SourceString.prototype.tokenizeTag = function(next) { | 3620 AbstractScanner_SourceString.prototype.tokenizeTag = function(next) { |
3649 if (this.get$byteOffset() === 0) { | 3621 if (this.get$byteOffset() === 0) { |
3650 if (this.peek() === 33/*null.$BANG*/) { | 3622 if (this.peek() === 33/*null.$BANG*/) { |
3651 do { | 3623 do { |
3652 next = this.advance(); | 3624 next = this.advance(); |
3653 } | 3625 } |
3654 while (next != 10/*null.$LF*/ && next != 13/*null.$CR*/) | 3626 while (next != 10/*null.$LF*/ && next != 13/*null.$CR*/) |
3655 return next; | 3627 return next; |
3656 } | 3628 } |
3657 } | 3629 } |
3658 this.appendStringToken(35/*null.HASH_TOKEN*/, "#"); | 3630 this.appendStringToken(35/*null.HASH_TOKEN*/, "#"); |
3659 return this.advance(); | 3631 return this.advance(); |
3660 } | 3632 } |
3661 AbstractScanner$SourceString.prototype.tokenizeTilde = function(next) { | 3633 AbstractScanner_SourceString.prototype.tokenizeTilde = function(next) { |
3662 next = this.advance(); | 3634 next = this.advance(); |
3663 if (next === 47/*null.$SLASH*/) { | 3635 if (next === 47/*null.$SLASH*/) { |
3664 return this.select(61/*null.$EQ*/, "~/=", "~/"); | 3636 return this.select(61/*null.$EQ*/, "~/=", "~/"); |
3665 } | 3637 } |
3666 else { | 3638 else { |
3667 this.appendStringToken(126/*null.TILDE_TOKEN*/, "~"); | 3639 this.appendStringToken(126/*null.TILDE_TOKEN*/, "~"); |
3668 return next; | 3640 return next; |
3669 } | 3641 } |
3670 } | 3642 } |
3671 AbstractScanner$SourceString.prototype.tokenizeOpenBracket = function(next) { | 3643 AbstractScanner_SourceString.prototype.tokenizeOpenBracket = function(next) { |
3672 next = this.advance(); | 3644 next = this.advance(); |
3673 if (next === 93/*null.$RBRACKET*/) { | 3645 if (next === 93/*null.$RBRACKET*/) { |
3674 return this.select(61/*null.$EQ*/, "[]=", "[]"); | 3646 return this.select(61/*null.$EQ*/, "[]=", "[]"); |
3675 } | 3647 } |
3676 else { | 3648 else { |
3677 this.appendBeginGroup(91/*null.LBRACKET_TOKEN*/, "["); | 3649 this.appendBeginGroup(91/*null.LBRACKET_TOKEN*/, "["); |
3678 return next; | 3650 return next; |
3679 } | 3651 } |
3680 } | 3652 } |
3681 AbstractScanner$SourceString.prototype.tokenizeCaret = function(next) { | 3653 AbstractScanner_SourceString.prototype.tokenizeCaret = function(next) { |
3682 return this.select(61/*null.$EQ*/, "^=", "^"); | 3654 return this.select(61/*null.$EQ*/, "^=", "^"); |
3683 } | 3655 } |
3684 AbstractScanner$SourceString.prototype.tokenizeBar = function(next) { | 3656 AbstractScanner_SourceString.prototype.tokenizeBar = function(next) { |
3685 next = this.advance(); | 3657 next = this.advance(); |
3686 if (next === 124/*null.$BAR*/) { | 3658 if (next === 124/*null.$BAR*/) { |
3687 this.appendStringToken(124/*null.BAR_TOKEN*/, "||"); | 3659 this.appendStringToken(124/*null.BAR_TOKEN*/, "||"); |
3688 return this.advance(); | 3660 return this.advance(); |
3689 } | 3661 } |
3690 else if (next === 61/*null.$EQ*/) { | 3662 else if (next === 61/*null.$EQ*/) { |
3691 this.appendStringToken(124/*null.BAR_TOKEN*/, "|="); | 3663 this.appendStringToken(124/*null.BAR_TOKEN*/, "|="); |
3692 return this.advance(); | 3664 return this.advance(); |
3693 } | 3665 } |
3694 else { | 3666 else { |
3695 this.appendStringToken(124/*null.BAR_TOKEN*/, "|"); | 3667 this.appendStringToken(124/*null.BAR_TOKEN*/, "|"); |
3696 return next; | 3668 return next; |
3697 } | 3669 } |
3698 } | 3670 } |
3699 AbstractScanner$SourceString.prototype.tokenizeAmpersand = function(next) { | 3671 AbstractScanner_SourceString.prototype.tokenizeAmpersand = function(next) { |
3700 next = this.advance(); | 3672 next = this.advance(); |
3701 if (next === 38/*null.$AMPERSAND*/) { | 3673 if (next === 38/*null.$AMPERSAND*/) { |
3702 this.appendStringToken(38/*null.AMPERSAND_TOKEN*/, "&&"); | 3674 this.appendStringToken(38/*null.AMPERSAND_TOKEN*/, "&&"); |
3703 return this.advance(); | 3675 return this.advance(); |
3704 } | 3676 } |
3705 else if (next === 61/*null.$EQ*/) { | 3677 else if (next === 61/*null.$EQ*/) { |
3706 this.appendStringToken(38/*null.AMPERSAND_TOKEN*/, "&="); | 3678 this.appendStringToken(38/*null.AMPERSAND_TOKEN*/, "&="); |
3707 return this.advance(); | 3679 return this.advance(); |
3708 } | 3680 } |
3709 else { | 3681 else { |
3710 this.appendStringToken(38/*null.AMPERSAND_TOKEN*/, "&"); | 3682 this.appendStringToken(38/*null.AMPERSAND_TOKEN*/, "&"); |
3711 return next; | 3683 return next; |
3712 } | 3684 } |
3713 } | 3685 } |
3714 AbstractScanner$SourceString.prototype.tokenizePercent = function(next) { | 3686 AbstractScanner_SourceString.prototype.tokenizePercent = function(next) { |
3715 return this.select(61/*null.$EQ*/, "%=", "%"); | 3687 return this.select(61/*null.$EQ*/, "%=", "%"); |
3716 } | 3688 } |
3717 AbstractScanner$SourceString.prototype.tokenizeMultiply = function(next) { | 3689 AbstractScanner_SourceString.prototype.tokenizeMultiply = function(next) { |
3718 return this.select(61/*null.$EQ*/, "*=", "*"); | 3690 return this.select(61/*null.$EQ*/, "*=", "*"); |
3719 } | 3691 } |
3720 AbstractScanner$SourceString.prototype.tokenizeMinus = function(next) { | 3692 AbstractScanner_SourceString.prototype.tokenizeMinus = function(next) { |
3721 next = this.advance(); | 3693 next = this.advance(); |
3722 if (next === 45/*null.$MINUS*/) { | 3694 if (next === 45/*null.$MINUS*/) { |
3723 this.appendStringToken(45/*null.MINUS_TOKEN*/, "--"); | 3695 this.appendStringToken(45/*null.MINUS_TOKEN*/, "--"); |
3724 return this.advance(); | 3696 return this.advance(); |
3725 } | 3697 } |
3726 else if (next === 61/*null.$EQ*/) { | 3698 else if (next === 61/*null.$EQ*/) { |
3727 this.appendStringToken(45/*null.MINUS_TOKEN*/, "-="); | 3699 this.appendStringToken(45/*null.MINUS_TOKEN*/, "-="); |
3728 return this.advance(); | 3700 return this.advance(); |
3729 } | 3701 } |
3730 else { | 3702 else { |
3731 this.appendStringToken(45/*null.MINUS_TOKEN*/, "-"); | 3703 this.appendStringToken(45/*null.MINUS_TOKEN*/, "-"); |
3732 return next; | 3704 return next; |
3733 } | 3705 } |
3734 } | 3706 } |
3735 AbstractScanner$SourceString.prototype.tokenizePlus = function(next) { | 3707 AbstractScanner_SourceString.prototype.tokenizePlus = function(next) { |
3736 next = this.advance(); | 3708 next = this.advance(); |
3737 if (43/*null.$PLUS*/ === next) { | 3709 if (43/*null.$PLUS*/ === next) { |
3738 this.appendStringToken(43/*null.PLUS_TOKEN*/, "++"); | 3710 this.appendStringToken(43/*null.PLUS_TOKEN*/, "++"); |
3739 return this.advance(); | 3711 return this.advance(); |
3740 } | 3712 } |
3741 else if (61/*null.$EQ*/ === next) { | 3713 else if (61/*null.$EQ*/ === next) { |
3742 this.appendStringToken(43/*null.PLUS_TOKEN*/, "+="); | 3714 this.appendStringToken(43/*null.PLUS_TOKEN*/, "+="); |
3743 return this.advance(); | 3715 return this.advance(); |
3744 } | 3716 } |
3745 else { | 3717 else { |
3746 this.appendStringToken(43/*null.PLUS_TOKEN*/, "+"); | 3718 this.appendStringToken(43/*null.PLUS_TOKEN*/, "+"); |
3747 return next; | 3719 return next; |
3748 } | 3720 } |
3749 } | 3721 } |
3750 AbstractScanner$SourceString.prototype.tokenizeExclamation = function(next) { | 3722 AbstractScanner_SourceString.prototype.tokenizeExclamation = function(next) { |
3751 next = this.advance(); | 3723 next = this.advance(); |
3752 if (next === 61/*null.$EQ*/) { | 3724 if (next === 61/*null.$EQ*/) { |
3753 return this.select(61/*null.$EQ*/, "!==", "!="); | 3725 return this.select(61/*null.$EQ*/, "!==", "!="); |
3754 } | 3726 } |
3755 this.appendStringToken(33/*null.BANG_TOKEN*/, "!"); | 3727 this.appendStringToken(33/*null.BANG_TOKEN*/, "!"); |
3756 return next; | 3728 return next; |
3757 } | 3729 } |
3758 AbstractScanner$SourceString.prototype.tokenizeEquals = function(next) { | 3730 AbstractScanner_SourceString.prototype.tokenizeEquals = function(next) { |
3759 next = this.advance(); | 3731 next = this.advance(); |
3760 if (next === 61/*null.$EQ*/) { | 3732 if (next === 61/*null.$EQ*/) { |
3761 return this.select(61/*null.$EQ*/, "===", "=="); | 3733 return this.select(61/*null.$EQ*/, "===", "=="); |
3762 } | 3734 } |
3763 this.appendStringToken(61/*null.EQ_TOKEN*/, "="); | 3735 this.appendStringToken(61/*null.EQ_TOKEN*/, "="); |
3764 return next; | 3736 return next; |
3765 } | 3737 } |
3766 AbstractScanner$SourceString.prototype.tokenizeGreaterThan = function(next) { | 3738 AbstractScanner_SourceString.prototype.tokenizeGreaterThan = function(next) { |
3767 next = this.advance(); | 3739 next = this.advance(); |
3768 if (61/*null.$EQ*/ === next) { | 3740 if (61/*null.$EQ*/ === next) { |
3769 this.appendStringToken(62/*null.GT_TOKEN*/, ">="); | 3741 this.appendStringToken(62/*null.GT_TOKEN*/, ">="); |
3770 return this.advance(); | 3742 return this.advance(); |
3771 } | 3743 } |
3772 else if (62/*null.$GT*/ === next) { | 3744 else if (62/*null.$GT*/ === next) { |
3773 next = this.advance(); | 3745 next = this.advance(); |
3774 if (61/*null.$EQ*/ === next) { | 3746 if (61/*null.$EQ*/ === next) { |
3775 this.appendStringToken(62/*null.GT_TOKEN*/, ">>="); | 3747 this.appendStringToken(62/*null.GT_TOKEN*/, ">>="); |
3776 return this.advance(); | 3748 return this.advance(); |
(...skipping 12 matching lines...) Expand all Loading... |
3789 else { | 3761 else { |
3790 this.appendGtGt(62/*null.GT_TOKEN*/, ">>"); | 3762 this.appendGtGt(62/*null.GT_TOKEN*/, ">>"); |
3791 return next; | 3763 return next; |
3792 } | 3764 } |
3793 } | 3765 } |
3794 else { | 3766 else { |
3795 this.appendEndGroup(62/*null.GT_TOKEN*/, ">", 60/*null.LT_TOKEN*/); | 3767 this.appendEndGroup(62/*null.GT_TOKEN*/, ">", 60/*null.LT_TOKEN*/); |
3796 return next; | 3768 return next; |
3797 } | 3769 } |
3798 } | 3770 } |
3799 AbstractScanner$SourceString.prototype.tokenizeLessThan = function(next) { | 3771 AbstractScanner_SourceString.prototype.tokenizeLessThan = function(next) { |
3800 next = this.advance(); | 3772 next = this.advance(); |
3801 if (61/*null.$EQ*/ === next) { | 3773 if (61/*null.$EQ*/ === next) { |
3802 this.appendStringToken(188/*null.LT_EQ_TOKEN*/, "<="); | 3774 this.appendStringToken(188/*null.LT_EQ_TOKEN*/, "<="); |
3803 return this.advance(); | 3775 return this.advance(); |
3804 } | 3776 } |
3805 else if (60/*null.$LT*/ === next) { | 3777 else if (60/*null.$LT*/ === next) { |
3806 return this.select(61/*null.$EQ*/, "<<=", "<<"); | 3778 return this.select(61/*null.$EQ*/, "<<=", "<<"); |
3807 } | 3779 } |
3808 else { | 3780 else { |
3809 this.appendBeginGroup(60/*null.LT_TOKEN*/, "<"); | 3781 this.appendBeginGroup(60/*null.LT_TOKEN*/, "<"); |
3810 return next; | 3782 return next; |
3811 } | 3783 } |
3812 } | 3784 } |
3813 AbstractScanner$SourceString.prototype.tokenizeNumber = function(next) { | 3785 AbstractScanner_SourceString.prototype.tokenizeNumber = function(next) { |
3814 var start = this.get$byteOffset(); | 3786 var start = this.get$byteOffset(); |
3815 while (true) { | 3787 while (true) { |
3816 next = this.advance(); | 3788 next = this.advance(); |
3817 if (48/*null.$0*/ <= next && next <= 57/*null.$9*/) { | 3789 if (48/*null.$0*/ <= next && next <= 57/*null.$9*/) { |
3818 continue; | 3790 continue; |
3819 } | 3791 } |
3820 else if (next === 46/*null.$PERIOD*/) { | 3792 else if (next === 46/*null.$PERIOD*/) { |
3821 return this.tokenizeFractionPart(this.advance(), start); | 3793 return this.tokenizeFractionPart(this.advance(), start); |
3822 } | 3794 } |
3823 else if (next === 101/*null.$e*/ || next === 69/*null.$E*/ || next === 100/*
null.$d*/ || next === 68/*null.$D*/) { | 3795 else if (next === 101/*null.$e*/ || next === 69/*null.$E*/ || next === 100/*
null.$d*/ || next === 68/*null.$D*/) { |
3824 return this.tokenizeFractionPart(next, start); | 3796 return this.tokenizeFractionPart(next, start); |
3825 } | 3797 } |
3826 else { | 3798 else { |
3827 this.appendByteStringToken(105/*null.INT_TOKEN*/, this.asciiString(start))
; | 3799 this.appendByteStringToken(105/*null.INT_TOKEN*/, this.asciiString(start))
; |
3828 return next; | 3800 return next; |
3829 } | 3801 } |
3830 } | 3802 } |
3831 } | 3803 } |
3832 AbstractScanner$SourceString.prototype.tokenizeHexOrNumber = function(next) { | 3804 AbstractScanner_SourceString.prototype.tokenizeHexOrNumber = function(next) { |
3833 var x = this.peek(); | 3805 var x = this.peek(); |
3834 if (x === 120/*null.$x*/ || x === 88/*null.$X*/) { | 3806 if (x === 120/*null.$x*/ || x === 88/*null.$X*/) { |
3835 this.advance(); | 3807 this.advance(); |
3836 return this.tokenizeHex(x); | 3808 return this.tokenizeHex(x); |
3837 } | 3809 } |
3838 return this.tokenizeNumber(next); | 3810 return this.tokenizeNumber(next); |
3839 } | 3811 } |
3840 AbstractScanner$SourceString.prototype.tokenizeHex = function(next) { | 3812 AbstractScanner_SourceString.prototype.tokenizeHex = function(next) { |
3841 var start = this.get$byteOffset(); | 3813 var start = this.get$byteOffset(); |
3842 var hasDigits = false; | 3814 var hasDigits = false; |
3843 while (true) { | 3815 while (true) { |
3844 next = this.advance(); | 3816 next = this.advance(); |
3845 if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/) || (65/*null.$A*/ <= ne
xt && next <= 70/*null.$F*/) || (97/*null.$a*/ <= next && next <= 102/*null.$f*/
)) { | 3817 if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/) || (65/*null.$A*/ <= ne
xt && next <= 70/*null.$F*/) || (97/*null.$a*/ <= next && next <= 102/*null.$f*/
)) { |
3846 hasDigits = true; | 3818 hasDigits = true; |
3847 } | 3819 } |
3848 else { | 3820 else { |
3849 if (!$notnull_bool(hasDigits)) { | 3821 if (!$notnull_bool(hasDigits)) { |
3850 $throw(new MalformedInputException(this.get$charOffset())); | 3822 $throw(new MalformedInputException(this.get$charOffset())); |
3851 } | 3823 } |
3852 this.appendByteStringToken(120/*null.HEXADECIMAL_TOKEN*/, this.asciiString
(start)); | 3824 this.appendByteStringToken(120/*null.HEXADECIMAL_TOKEN*/, this.asciiString
(start)); |
3853 return next; | 3825 return next; |
3854 } | 3826 } |
3855 } | 3827 } |
3856 } | 3828 } |
3857 AbstractScanner$SourceString.prototype.tokenizeDotOrNumber = function(next) { | 3829 AbstractScanner_SourceString.prototype.tokenizeDotOrNumber = function(next) { |
3858 var start = this.get$byteOffset(); | 3830 var start = this.get$byteOffset(); |
3859 next = this.advance(); | 3831 next = this.advance(); |
3860 if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/)) { | 3832 if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/)) { |
3861 return this.tokenizeFractionPart(next, start); | 3833 return this.tokenizeFractionPart(next, start); |
3862 } | 3834 } |
3863 else if (46/*null.$PERIOD*/ === next) { | 3835 else if (46/*null.$PERIOD*/ === next) { |
3864 return this.select(46/*null.$PERIOD*/, "...", ".."); | 3836 return this.select(46/*null.$PERIOD*/, "...", ".."); |
3865 } | 3837 } |
3866 else { | 3838 else { |
3867 this.appendStringToken(46/*null.PERIOD_TOKEN*/, "."); | 3839 this.appendStringToken(46/*null.PERIOD_TOKEN*/, "."); |
3868 return next; | 3840 return next; |
3869 } | 3841 } |
3870 } | 3842 } |
3871 AbstractScanner$SourceString.prototype.tokenizeFractionPart = function(next, sta
rt) { | 3843 AbstractScanner_SourceString.prototype.tokenizeFractionPart = function(next, sta
rt) { |
3872 var done = false; | 3844 var done = false; |
3873 LOOP: | 3845 LOOP: |
3874 while (!$notnull_bool(done)) { | 3846 while (!$notnull_bool(done)) { |
3875 if (48/*null.$0*/ <= next && next <= 57/*null.$9*/) { | 3847 if (48/*null.$0*/ <= next && next <= 57/*null.$9*/) { |
3876 } | 3848 } |
3877 else if (101/*null.$e*/ === next || 69/*null.$E*/ === next) { | 3849 else if (101/*null.$e*/ === next || 69/*null.$E*/ === next) { |
3878 next = this.tokenizeExponent(this.advance()); | 3850 next = this.tokenizeExponent(this.advance()); |
3879 done = true; | 3851 done = true; |
3880 continue LOOP; | 3852 continue LOOP; |
3881 } | 3853 } |
3882 else { | 3854 else { |
3883 done = true; | 3855 done = true; |
3884 continue LOOP; | 3856 continue LOOP; |
3885 } | 3857 } |
3886 next = this.advance(); | 3858 next = this.advance(); |
3887 } | 3859 } |
3888 if (next === 100/*null.$d*/ || next === 68/*null.$D*/) { | 3860 if (next === 100/*null.$d*/ || next === 68/*null.$D*/) { |
3889 next = this.advance(); | 3861 next = this.advance(); |
3890 } | 3862 } |
3891 this.appendByteStringToken(100/*null.DOUBLE_TOKEN*/, this.asciiString(start)); | 3863 this.appendByteStringToken(100/*null.DOUBLE_TOKEN*/, this.asciiString(start)); |
3892 return next; | 3864 return next; |
3893 } | 3865 } |
3894 AbstractScanner$SourceString.prototype.tokenizeExponent = function(next) { | 3866 AbstractScanner_SourceString.prototype.tokenizeExponent = function(next) { |
3895 if (next === 43/*null.$PLUS*/ || next === 45/*null.$MINUS*/) { | 3867 if (next === 43/*null.$PLUS*/ || next === 45/*null.$MINUS*/) { |
3896 next = this.advance(); | 3868 next = this.advance(); |
3897 } | 3869 } |
3898 var hasDigits = false; | 3870 var hasDigits = false; |
3899 while (true) { | 3871 while (true) { |
3900 if (48/*null.$0*/ <= next && next <= 57/*null.$9*/) { | 3872 if (48/*null.$0*/ <= next && next <= 57/*null.$9*/) { |
3901 hasDigits = true; | 3873 hasDigits = true; |
3902 } | 3874 } |
3903 else { | 3875 else { |
3904 if (!$notnull_bool(hasDigits)) { | 3876 if (!$notnull_bool(hasDigits)) { |
3905 $throw(new MalformedInputException(this.get$charOffset())); | 3877 $throw(new MalformedInputException(this.get$charOffset())); |
3906 } | 3878 } |
3907 return next; | 3879 return next; |
3908 } | 3880 } |
3909 next = this.advance(); | 3881 next = this.advance(); |
3910 } | 3882 } |
3911 } | 3883 } |
3912 AbstractScanner$SourceString.prototype.tokenizeSlashOrComment = function(next) { | 3884 AbstractScanner_SourceString.prototype.tokenizeSlashOrComment = function(next) { |
3913 next = this.advance(); | 3885 next = this.advance(); |
3914 if (42/*null.$STAR*/ === next) { | 3886 if (42/*null.$STAR*/ === next) { |
3915 return this.tokenizeMultiLineComment(next); | 3887 return this.tokenizeMultiLineComment(next); |
3916 } | 3888 } |
3917 else if (47/*null.$SLASH*/ === next) { | 3889 else if (47/*null.$SLASH*/ === next) { |
3918 return this.tokenizeSingleLineComment(next); | 3890 return this.tokenizeSingleLineComment(next); |
3919 } | 3891 } |
3920 else if (61/*null.$EQ*/ === next) { | 3892 else if (61/*null.$EQ*/ === next) { |
3921 this.appendStringToken(47/*null.SLASH_TOKEN*/, "/="); | 3893 this.appendStringToken(47/*null.SLASH_TOKEN*/, "/="); |
3922 return this.advance(); | 3894 return this.advance(); |
3923 } | 3895 } |
3924 else { | 3896 else { |
3925 this.appendStringToken(47/*null.SLASH_TOKEN*/, "/"); | 3897 this.appendStringToken(47/*null.SLASH_TOKEN*/, "/"); |
3926 return next; | 3898 return next; |
3927 } | 3899 } |
3928 } | 3900 } |
3929 AbstractScanner$SourceString.prototype.tokenizeSingleLineComment = function(next
) { | 3901 AbstractScanner_SourceString.prototype.tokenizeSingleLineComment = function(next
) { |
3930 while (true) { | 3902 while (true) { |
3931 next = this.advance(); | 3903 next = this.advance(); |
3932 if (10/*null.$LF*/ === next || 13/*null.$CR*/ === next || 0/*null.$EOF*/ ===
next) { | 3904 if (10/*null.$LF*/ === next || 13/*null.$CR*/ === next || 0/*null.$EOF*/ ===
next) { |
3933 return next; | 3905 return next; |
3934 } | 3906 } |
3935 } | 3907 } |
3936 } | 3908 } |
3937 AbstractScanner$SourceString.prototype.tokenizeMultiLineComment = function(next)
{ | 3909 AbstractScanner_SourceString.prototype.tokenizeMultiLineComment = function(next)
{ |
3938 next = this.advance(); | 3910 next = this.advance(); |
3939 while (true) { | 3911 while (true) { |
3940 if (0/*null.$EOF*/ === next) { | 3912 if (0/*null.$EOF*/ === next) { |
3941 return next; | 3913 return next; |
3942 } | 3914 } |
3943 else if (42/*null.$STAR*/ === next) { | 3915 else if (42/*null.$STAR*/ === next) { |
3944 next = this.advance(); | 3916 next = this.advance(); |
3945 if (next === 47/*null.$SLASH*/) { | 3917 if (next === 47/*null.$SLASH*/) { |
3946 return this.advance(); | 3918 return this.advance(); |
3947 } | 3919 } |
3948 else if (next === 0/*null.$EOF*/) { | 3920 else if (next === 0/*null.$EOF*/) { |
3949 return next; | 3921 return next; |
3950 } | 3922 } |
3951 } | 3923 } |
3952 else { | 3924 else { |
3953 next = this.advance(); | 3925 next = this.advance(); |
3954 } | 3926 } |
3955 } | 3927 } |
3956 } | 3928 } |
3957 AbstractScanner$SourceString.prototype.tokenizeKeywordOrIdentifier = function(ne
xt) { | 3929 AbstractScanner_SourceString.prototype.tokenizeKeywordOrIdentifier = function(ne
xt) { |
3958 var state = KeywordState.get$KEYWORD_STATE(); | 3930 var state = KeywordState.get$KEYWORD_STATE(); |
3959 var start = this.get$byteOffset(); | 3931 var start = this.get$byteOffset(); |
3960 while (state != null && 97/*null.$a*/ <= next && next <= 122/*null.$z*/) { | 3932 while (state != null && 97/*null.$a*/ <= next && next <= 122/*null.$z*/) { |
3961 state = state.next(next); | 3933 state = state.next(next); |
3962 next = this.advance(); | 3934 next = this.advance(); |
3963 } | 3935 } |
3964 if (state == null || !$notnull_bool(state.isLeaf())) { | 3936 if (state == null || !$notnull_bool(state.isLeaf())) { |
3965 return this.tokenizeIdentifier(next, start); | 3937 return this.tokenizeIdentifier(next, start); |
3966 } | 3938 } |
3967 if ((65/*null.$A*/ <= next && next <= 90/*null.$Z*/) || (48/*null.$0*/ <= next
&& next <= 57/*null.$9*/) || next === 95/*null.$_*/ || next === 36/*null.$DOLLA
R*/) { | 3939 if ((65/*null.$A*/ <= next && next <= 90/*null.$Z*/) || (48/*null.$0*/ <= next
&& next <= 57/*null.$9*/) || next === 95/*null.$_*/ || next === 36/*null.$DOLLA
R*/) { |
3968 return this.tokenizeIdentifier(next, start); | 3940 return this.tokenizeIdentifier(next, start); |
3969 } | 3941 } |
3970 else if (next < 128) { | 3942 else if (next < 128) { |
3971 this.appendKeywordToken(state.get$keyword()); | 3943 this.appendKeywordToken(state.get$keyword()); |
3972 return next; | 3944 return next; |
3973 } | 3945 } |
3974 else { | 3946 else { |
3975 return this.tokenizeIdentifier(next, start); | 3947 return this.tokenizeIdentifier(next, start); |
3976 } | 3948 } |
3977 } | 3949 } |
3978 AbstractScanner$SourceString.prototype.tokenizeIdentifier = function(next, start
) { | 3950 AbstractScanner_SourceString.prototype.tokenizeIdentifier = function(next, start
) { |
3979 var isAscii = true; | 3951 var isAscii = true; |
3980 while (true) { | 3952 while (true) { |
3981 if ((97/*null.$a*/ <= next && next <= 122/*null.$z*/) || (65/*null.$A*/ <= n
ext && next <= 90/*null.$Z*/) || (48/*null.$0*/ <= next && next <= 57/*null.$9*/
) || next === 95/*null.$_*/ || next === 36/*null.$DOLLAR*/) { | 3953 if ((97/*null.$a*/ <= next && next <= 122/*null.$z*/) || (65/*null.$A*/ <= n
ext && next <= 90/*null.$Z*/) || (48/*null.$0*/ <= next && next <= 57/*null.$9*/
) || next === 95/*null.$_*/ || next === 36/*null.$DOLLAR*/) { |
3982 next = this.advance(); | 3954 next = this.advance(); |
3983 } | 3955 } |
3984 else if (next < 128) { | 3956 else if (next < 128) { |
3985 if ($notnull_bool(isAscii)) { | 3957 if ($notnull_bool(isAscii)) { |
3986 this.appendByteStringToken(97/*null.IDENTIFIER_TOKEN*/, this.asciiString
(start)); | 3958 this.appendByteStringToken(97/*null.IDENTIFIER_TOKEN*/, this.asciiString
(start)); |
3987 } | 3959 } |
3988 else { | 3960 else { |
3989 this.appendByteStringToken(97/*null.IDENTIFIER_TOKEN*/, this.utf8String(
start, -1)); | 3961 this.appendByteStringToken(97/*null.IDENTIFIER_TOKEN*/, this.utf8String(
start, -1)); |
3990 } | 3962 } |
3991 return next; | 3963 return next; |
3992 } | 3964 } |
3993 else { | 3965 else { |
3994 var nonAsciiStart = this.get$byteOffset(); | 3966 var nonAsciiStart = this.get$byteOffset(); |
3995 do { | 3967 do { |
3996 next = this.nextByte(); | 3968 next = this.nextByte(); |
3997 } | 3969 } |
3998 while (next > 127) | 3970 while (next > 127) |
3999 var string = this.utf8String(nonAsciiStart, -1).toString(); | 3971 var string = this.utf8String(nonAsciiStart, -1).toString(); |
4000 isAscii = false; | 3972 isAscii = false; |
4001 var byteLength = nonAsciiStart - this.get$byteOffset(); | 3973 var byteLength = nonAsciiStart - this.get$byteOffset(); |
4002 this.addToCharOffset(string.length - byteLength); | 3974 this.addToCharOffset(string.length - byteLength); |
4003 } | 3975 } |
4004 } | 3976 } |
4005 } | 3977 } |
4006 AbstractScanner$SourceString.prototype.tokenizeRawString = function(next) { | 3978 AbstractScanner_SourceString.prototype.tokenizeRawString = function(next) { |
4007 var start = this.get$byteOffset(); | 3979 var start = this.get$byteOffset(); |
4008 next = this.advance(); | 3980 next = this.advance(); |
4009 if (next === 34/*null.$DQ*/ || next === 39/*null.$SQ*/) { | 3981 if (next === 34/*null.$DQ*/ || next === 39/*null.$SQ*/) { |
4010 return this.tokenizeString(next, start, true); | 3982 return this.tokenizeString(next, start, true); |
4011 } | 3983 } |
4012 else { | 3984 else { |
4013 $throw(new MalformedInputException(this.get$charOffset())); | 3985 $throw(new MalformedInputException(this.get$charOffset())); |
4014 } | 3986 } |
4015 } | 3987 } |
4016 AbstractScanner$SourceString.prototype.tokenizeString = function(next, start, ra
w) { | 3988 AbstractScanner_SourceString.prototype.tokenizeString = function(next, start, ra
w) { |
4017 var q = next; | 3989 var q = next; |
4018 next = this.advance(); | 3990 next = this.advance(); |
4019 if (q === next) { | 3991 if (q === next) { |
4020 next = this.advance(); | 3992 next = this.advance(); |
4021 if (q === next) { | 3993 if (q === next) { |
4022 return this.tokenizeMultiLineString(q, start, raw); | 3994 return this.tokenizeMultiLineString(q, start, raw); |
4023 } | 3995 } |
4024 else { | 3996 else { |
4025 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start,
-1)); | 3997 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start,
-1)); |
4026 return next; | 3998 return next; |
4027 } | 3999 } |
4028 } | 4000 } |
4029 if ($notnull_bool(raw)) { | 4001 if ($notnull_bool(raw)) { |
4030 return this.tokenizeSingleLineRawString(next, q, start); | 4002 return this.tokenizeSingleLineRawString(next, q, start); |
4031 } | 4003 } |
4032 else { | 4004 else { |
4033 return this.tokenizeSingleLineString(next, q, start); | 4005 return this.tokenizeSingleLineString(next, q, start); |
4034 } | 4006 } |
4035 } | 4007 } |
4036 AbstractScanner$SourceString.prototype.tokenizeSingleLineString = function(next,
q1, start) { | 4008 AbstractScanner_SourceString.prototype.tokenizeSingleLineString = function(next,
q1, start) { |
4037 while (next != 0/*null.$EOF*/) { | 4009 while (next != 0/*null.$EOF*/) { |
4038 if (next === q1) { | 4010 if (next === q1) { |
4039 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start,
0)); | 4011 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start,
0)); |
4040 return this.advance(); | 4012 return this.advance(); |
4041 } | 4013 } |
4042 else if (next === 92/*null.$BACKSLASH*/) { | 4014 else if (next === 92/*null.$BACKSLASH*/) { |
4043 next = this.advance(); | 4015 next = this.advance(); |
4044 if (next === 0/*null.$EOF*/) { | 4016 if (next === 0/*null.$EOF*/) { |
4045 $throw(new MalformedInputException(this.get$charOffset())); | 4017 $throw(new MalformedInputException(this.get$charOffset())); |
4046 } | 4018 } |
4047 } | 4019 } |
4048 else if (next === 10/*null.$LF*/ || next === 13/*null.$CR*/) { | 4020 else if (next === 10/*null.$LF*/ || next === 13/*null.$CR*/) { |
4049 $throw(new MalformedInputException(this.get$charOffset())); | 4021 $throw(new MalformedInputException(this.get$charOffset())); |
4050 } | 4022 } |
4051 next = this.advance(); | 4023 next = this.advance(); |
4052 } | 4024 } |
4053 $throw(new MalformedInputException(this.get$charOffset())); | 4025 $throw(new MalformedInputException(this.get$charOffset())); |
4054 } | 4026 } |
4055 AbstractScanner$SourceString.prototype.tokenizeSingleLineRawString = function(ne
xt, q1, start) { | 4027 AbstractScanner_SourceString.prototype.tokenizeSingleLineRawString = function(ne
xt, q1, start) { |
4056 next = this.advance(); | 4028 next = this.advance(); |
4057 while (next != 0/*null.$EOF*/) { | 4029 while (next != 0/*null.$EOF*/) { |
4058 if (next === q1) { | 4030 if (next === q1) { |
4059 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start,
0)); | 4031 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start,
0)); |
4060 return this.advance(); | 4032 return this.advance(); |
4061 } | 4033 } |
4062 else if (next === 10/*null.$LF*/ || next === 13/*null.$CR*/) { | 4034 else if (next === 10/*null.$LF*/ || next === 13/*null.$CR*/) { |
4063 $throw(new MalformedInputException(this.get$charOffset())); | 4035 $throw(new MalformedInputException(this.get$charOffset())); |
4064 } | 4036 } |
4065 next = this.advance(); | 4037 next = this.advance(); |
4066 } | 4038 } |
4067 $throw(new MalformedInputException(this.get$charOffset())); | 4039 $throw(new MalformedInputException(this.get$charOffset())); |
4068 } | 4040 } |
4069 AbstractScanner$SourceString.prototype.tokenizeMultiLineString = function(q, sta
rt, raw) { | 4041 AbstractScanner_SourceString.prototype.tokenizeMultiLineString = function(q, sta
rt, raw) { |
4070 var next = this.advance(); | 4042 var next = this.advance(); |
4071 while (next != 0/*null.$EOF*/) { | 4043 while (next != 0/*null.$EOF*/) { |
4072 if (next === q) { | 4044 if (next === q) { |
4073 next = this.advance(); | 4045 next = this.advance(); |
4074 if (next === q) { | 4046 if (next === q) { |
4075 next = this.advance(); | 4047 next = this.advance(); |
4076 if (next === q) { | 4048 if (next === q) { |
4077 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(st
art, 0)); | 4049 this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(st
art, 0)); |
4078 return this.advance(); | 4050 return this.advance(); |
4079 } | 4051 } |
(...skipping 20 matching lines...) Expand all Loading... |
4100 $inherits(ScannerTask, CompilerTask); | 4072 $inherits(ScannerTask, CompilerTask); |
4101 ScannerTask.prototype.get$name = function() { | 4073 ScannerTask.prototype.get$name = function() { |
4102 return 'Scanner'; | 4074 return 'Scanner'; |
4103 } | 4075 } |
4104 ScannerTask.prototype.scan = function(script) { | 4076 ScannerTask.prototype.scan = function(script) { |
4105 var $this = this; // closure support | 4077 var $this = this; // closure support |
4106 this.measure((function () { | 4078 this.measure((function () { |
4107 var $0; | 4079 var $0; |
4108 var elements = $this.scanElements(script.get$text()); | 4080 var elements = $this.scanElements(script.get$text()); |
4109 for (var link = elements; | 4081 for (var link = elements; |
4110 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Lin
k$Element())) { | 4082 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Lin
k_Element())) { |
4111 $this.compiler.universe.define((($0 = link.get$head()) && $0.is$Element())
); | 4083 $this.compiler.universe.define((($0 = link.get$head()) && $0.is$Element())
); |
4112 } | 4084 } |
4113 }) | 4085 }) |
4114 ); | 4086 ); |
4115 } | 4087 } |
4116 ScannerTask.prototype.scanElements = function(text) { | 4088 ScannerTask.prototype.scanElements = function(text) { |
4117 var tokens = new StringScanner(text).tokenize(); | 4089 var tokens = new StringScanner(text).tokenize(); |
4118 var listener = new ElementListener(this.compiler); | 4090 var listener = new ElementListener(this.compiler); |
4119 var parser = new PartialParser(listener); | 4091 var parser = new PartialParser(listener); |
4120 parser.parseUnit(tokens); | 4092 parser.parseUnit(tokens); |
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5648 this.canceler.cancel(("Expected a type, but got '" + token + "'"), null, token
); | 5620 this.canceler.cancel(("Expected a type, but got '" + token + "'"), null, token
); |
5649 } | 5621 } |
5650 ElementListener.prototype.expectedBlock = function(token) { | 5622 ElementListener.prototype.expectedBlock = function(token) { |
5651 this.canceler.cancel(("Expected a block, but got '" + token + "'"), null, toke
n); | 5623 this.canceler.cancel(("Expected a block, but got '" + token + "'"), null, toke
n); |
5652 } | 5624 } |
5653 ElementListener.prototype.unexpected = function(token) { | 5625 ElementListener.prototype.unexpected = function(token) { |
5654 this.canceler.cancel(("Unexpected token '" + token + "'"), null, token); | 5626 this.canceler.cancel(("Unexpected token '" + token + "'"), null, token); |
5655 } | 5627 } |
5656 ElementListener.prototype.pushElement = function(element) { | 5628 ElementListener.prototype.pushElement = function(element) { |
5657 var $0; | 5629 var $0; |
5658 this.topLevelElements = (($0 = this.topLevelElements.prepend(element)) && $0.i
s$Link$Element()); | 5630 this.topLevelElements = (($0 = this.topLevelElements.prepend(element)) && $0.i
s$Link_Element()); |
5659 } | 5631 } |
5660 ElementListener.prototype.pushNode = function(node) { | 5632 ElementListener.prototype.pushNode = function(node) { |
5661 var $0; | 5633 var $0; |
5662 this.nodes = (($0 = this.nodes.prepend(node)) && $0.is$Link$Node()); | 5634 this.nodes = (($0 = this.nodes.prepend(node)) && $0.is$Link_Node()); |
5663 if (false/*null.VERBOSE*/) this.log(("push " + this.nodes)); | 5635 if (false/*null.VERBOSE*/) this.log(("push " + this.nodes)); |
5664 } | 5636 } |
5665 ElementListener.prototype.popNode = function() { | 5637 ElementListener.prototype.popNode = function() { |
5666 var $0; | 5638 var $0; |
5667 $assert(!$notnull_bool(this.nodes.isEmpty()), "!nodes.isEmpty()", "listener.da
rt", 346, 12); | 5639 $assert(!$notnull_bool(this.nodes.isEmpty()), "!nodes.isEmpty()", "listener.da
rt", 346, 12); |
5668 var node = (($0 = this.nodes.get$head()) && $0.is$Node()); | 5640 var node = (($0 = this.nodes.get$head()) && $0.is$Node()); |
5669 this.nodes = (($0 = this.nodes.get$tail()) && $0.is$Link$Node()); | 5641 this.nodes = (($0 = this.nodes.get$tail()) && $0.is$Link_Node()); |
5670 if (false/*null.VERBOSE*/) this.log(("pop " + this.nodes)); | 5642 if (false/*null.VERBOSE*/) this.log(("pop " + this.nodes)); |
5671 return node; | 5643 return node; |
5672 } | 5644 } |
5673 ElementListener.prototype.log = function(message) { | 5645 ElementListener.prototype.log = function(message) { |
5674 | 5646 |
5675 } | 5647 } |
5676 ElementListener.prototype.beginLibraryTag$1 = function($0) { | 5648 ElementListener.prototype.beginLibraryTag$1 = function($0) { |
5677 return this.beginLibraryTag(($0 && $0.is$Token())); | 5649 return this.beginLibraryTag(($0 && $0.is$Token())); |
5678 }; | 5650 }; |
5679 ElementListener.prototype.endClass$5 = function($0, $1, $2, $3, $4) { | 5651 ElementListener.prototype.endClass$5 = function($0, $1, $2, $3, $4) { |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5879 NodeListener.prototype.handleUnaryPostfixExpression = function(token) { | 5851 NodeListener.prototype.handleUnaryPostfixExpression = function(token) { |
5880 this.pushNode(new Send.postfix$ctor(this.popNode(), new Operator(token))); | 5852 this.pushNode(new Send.postfix$ctor(this.popNode(), new Operator(token))); |
5881 } | 5853 } |
5882 NodeListener.prototype.handleUnaryPrefixExpression = function(token) { | 5854 NodeListener.prototype.handleUnaryPrefixExpression = function(token) { |
5883 this.pushNode(new Send.prefix$ctor(this.popNode(), new Operator(token))); | 5855 this.pushNode(new Send.prefix$ctor(this.popNode(), new Operator(token))); |
5884 } | 5856 } |
5885 NodeListener.prototype.makeNodeList = function(count, beginToken, endToken, deli
miter) { | 5857 NodeListener.prototype.makeNodeList = function(count, beginToken, endToken, deli
miter) { |
5886 var $0; | 5858 var $0; |
5887 var nodes = const$202/*const EmptyLink<Node>()*/; | 5859 var nodes = const$202/*const EmptyLink<Node>()*/; |
5888 for (; count > 0; --count) { | 5860 for (; count > 0; --count) { |
5889 nodes = (($0 = nodes.prepend(this.popNode())) && $0.is$Link$Node()); | 5861 nodes = (($0 = nodes.prepend(this.popNode())) && $0.is$Link_Node()); |
5890 } | 5862 } |
5891 var sourceDelimiter = (($0 = (delimiter == null) ? null : new StringWrapper(de
limiter)) && $0.is$SourceString()); | 5863 var sourceDelimiter = (($0 = (delimiter == null) ? null : new StringWrapper(de
limiter)) && $0.is$SourceString()); |
5892 return new NodeList(beginToken, nodes, endToken, sourceDelimiter); | 5864 return new NodeList(beginToken, nodes, endToken, sourceDelimiter); |
5893 } | 5865 } |
5894 NodeListener.prototype.log = function(message) { | 5866 NodeListener.prototype.log = function(message) { |
5895 this.logger.log(message); | 5867 this.logger.log(message); |
5896 } | 5868 } |
5897 NodeListener.prototype.endArguments$3 = function($0, $1, $2) { | 5869 NodeListener.prototype.endArguments$3 = function($0, $1, $2) { |
5898 return this.endArguments($assert_num($0), ($1 && $1.is$Token()), ($2 && $2.is$
Token())); | 5870 return this.endArguments($assert_num($0), ($1 && $1.is$Token()), ($2 && $2.is$
Token())); |
5899 }; | 5871 }; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6017 this.node = (($0 = parse(canceler, logger, (function (p) { | 5989 this.node = (($0 = parse(canceler, logger, (function (p) { |
6018 return p.parseClass$1($this.beginToken); | 5990 return p.parseClass$1($this.beginToken); |
6019 }) | 5991 }) |
6020 )) && $0.is$ClassNode()); | 5992 )) && $0.is$ClassNode()); |
6021 return this.node; | 5993 return this.node; |
6022 } | 5994 } |
6023 // ********** Code for StringScanner ************** | 5995 // ********** Code for StringScanner ************** |
6024 function StringScanner(string) { | 5996 function StringScanner(string) { |
6025 this.string = string; | 5997 this.string = string; |
6026 // Initializers done | 5998 // Initializers done |
6027 ArrayBasedScanner$SourceString.call(this); | 5999 ArrayBasedScanner_SourceString.call(this); |
6028 } | 6000 } |
6029 $inherits(StringScanner, ArrayBasedScanner$SourceString); | 6001 $inherits(StringScanner, ArrayBasedScanner_SourceString); |
6030 StringScanner.prototype.nextByte = function() { | 6002 StringScanner.prototype.nextByte = function() { |
6031 return this.charAt(++this.byteOffset); | 6003 return this.charAt(++this.byteOffset); |
6032 } | 6004 } |
6033 StringScanner.prototype.peek = function() { | 6005 StringScanner.prototype.peek = function() { |
6034 return this.charAt(this.byteOffset + 1); | 6006 return this.charAt(this.byteOffset + 1); |
6035 } | 6007 } |
6036 StringScanner.prototype.charAt = function(index) { | 6008 StringScanner.prototype.charAt = function(index) { |
6037 return (this.string.length > $assert_num(index)) ? this.string.charCodeAt($ass
ert_num(index)) : 0/*null.$EOF*/; | 6009 return (this.string.length > $assert_num(index)) ? this.string.charCodeAt($ass
ert_num(index)) : 0/*null.$EOF*/; |
6038 } | 6010 } |
6039 StringScanner.prototype.asciiString = function(start) { | 6011 StringScanner.prototype.asciiString = function(start) { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6228 strings.sort((function (a, b) { | 6200 strings.sort((function (a, b) { |
6229 return a.compareTo$1(b); | 6201 return a.compareTo$1(b); |
6230 }) | 6202 }) |
6231 ); | 6203 ); |
6232 $globals.KeywordState__KEYWORD_STATE = KeywordState.computeKeywordStateTable
(0, strings, 0, $assert_num(strings.length)); | 6204 $globals.KeywordState__KEYWORD_STATE = KeywordState.computeKeywordStateTable
(0, strings, 0, $assert_num(strings.length)); |
6233 } | 6205 } |
6234 return $globals.KeywordState__KEYWORD_STATE; | 6206 return $globals.KeywordState__KEYWORD_STATE; |
6235 } | 6207 } |
6236 KeywordState.computeKeywordStateTable = function(start, strings, offset, length)
{ | 6208 KeywordState.computeKeywordStateTable = function(start, strings, offset, length)
{ |
6237 var result = new ListFactory(26); | 6209 var result = new ListFactory(26); |
6238 $assert(length != 0, "length != 0", "keyword.dart", 162, 12); | 6210 $assert(length != 0, "length != 0", "keyword.dart", 161, 12); |
6239 var chunk = 0; | 6211 var chunk = 0; |
6240 var chunkStart = -1; | 6212 var chunkStart = -1; |
6241 for (var i = offset; | 6213 for (var i = offset; |
6242 i < offset + length; i++) { | 6214 i < offset + length; i++) { |
6243 if (strings.$index(i).length > start) { | 6215 if (strings.$index(i).length > start) { |
6244 var c = $assert_num(strings.$index(i).charCodeAt$1(start)); | 6216 var c = $assert_num(strings.$index(i).charCodeAt$1(start)); |
6245 if (chunk != c) { | 6217 if (chunk != c) { |
6246 if (chunkStart != -1) { | 6218 if (chunkStart != -1) { |
6247 result.$setindex(chunk - 97/*null.$a*/, KeywordState.computeKeywordSta
teTable(start + 1, strings, chunkStart, i - chunkStart)); | 6219 result.$setindex(chunk - 97/*null.$a*/, KeywordState.computeKeywordSta
teTable(start + 1, strings, chunkStart, i - chunkStart)); |
6248 } | 6220 } |
6249 chunkStart = i; | 6221 chunkStart = i; |
6250 chunk = c; | 6222 chunk = c; |
6251 } | 6223 } |
6252 } | 6224 } |
6253 } | 6225 } |
6254 if (chunkStart != -1) { | 6226 if (chunkStart != -1) { |
6255 result.$setindex(chunk - 97/*null.$a*/, KeywordState.computeKeywordStateTabl
e(start + 1, strings, chunkStart, offset + length - chunkStart)); | 6227 result.$setindex(chunk - 97/*null.$a*/, KeywordState.computeKeywordStateTabl
e(start + 1, strings, chunkStart, offset + length - chunkStart)); |
6256 } | 6228 } |
6257 else { | 6229 else { |
6258 $assert(length == 1, "length == 1", "keyword.dart", 184, 14); | 6230 $assert(length == 1, "length == 1", "keyword.dart", 183, 14); |
6259 return new LeafKeywordState($assert_String(strings.$index(offset))); | 6231 return new LeafKeywordState($assert_String(strings.$index(offset))); |
6260 } | 6232 } |
6261 return new ArrayKeywordState(result); | 6233 return new ArrayKeywordState(result); |
6262 } | 6234 } |
6263 // ********** Code for ArrayKeywordState ************** | 6235 // ********** Code for ArrayKeywordState ************** |
6264 function ArrayKeywordState(table) { | 6236 function ArrayKeywordState(table) { |
6265 this.table = table; | 6237 this.table = table; |
6266 // Initializers done | 6238 // Initializers done |
6267 KeywordState.call(this); | 6239 KeywordState.call(this); |
6268 } | 6240 } |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6491 } | 6463 } |
6492 SendSet.prototype.copyWithReceiver = function(receiver) { | 6464 SendSet.prototype.copyWithReceiver = function(receiver) { |
6493 $throw('not implemented'); | 6465 $throw('not implemented'); |
6494 } | 6466 } |
6495 SendSet.prototype.accept$1 = function($0) { | 6467 SendSet.prototype.accept$1 = function($0) { |
6496 return this.accept(($0 && $0.is$Visitor())); | 6468 return this.accept(($0 && $0.is$Visitor())); |
6497 }; | 6469 }; |
6498 // ********** Code for NodeList ************** | 6470 // ********** Code for NodeList ************** |
6499 function NodeList(beginToken, nodes, endToken, delimiter) { | 6471 function NodeList(beginToken, nodes, endToken, delimiter) { |
6500 this.beginToken = beginToken; | 6472 this.beginToken = beginToken; |
6501 this._nodes = nodes; | |
6502 this.endToken = endToken; | 6473 this.endToken = endToken; |
6503 this.delimiter = delimiter; | 6474 this.delimiter = delimiter; |
| 6475 this._nodes = nodes; |
6504 // Initializers done | 6476 // Initializers done |
6505 Node.call(this); | 6477 Node.call(this); |
6506 } | 6478 } |
6507 NodeList.singleton$ctor = function(node) { | 6479 NodeList.singleton$ctor = function(node) { |
6508 // Initializers done | 6480 // Initializers done |
6509 NodeList.call(this, null, LinkFactory.Link$factory(node)); | 6481 NodeList.call(this, null, LinkFactory.Link$factory(node)); |
6510 } | 6482 } |
6511 NodeList.singleton$ctor.prototype = NodeList.prototype; | 6483 NodeList.singleton$ctor.prototype = NodeList.prototype; |
6512 $inherits(NodeList, Node); | 6484 $inherits(NodeList, Node); |
6513 NodeList.prototype.is$NodeList = function(){return this;}; | 6485 NodeList.prototype.is$NodeList = function(){return this;}; |
6514 NodeList.prototype.get$nodes = function() { | 6486 NodeList.prototype.get$nodes = function() { |
6515 var $0; | 6487 var $0; |
6516 return (($0 = this._nodes != null ? this._nodes : const$202/*const EmptyLink<N
ode>()*/) && $0.is$Link$Node()); | 6488 return (($0 = this._nodes != null ? this._nodes : const$202/*const EmptyLink<N
ode>()*/) && $0.is$Link_Node()); |
6517 } | 6489 } |
6518 NodeList.prototype.accept = function(visitor) { | 6490 NodeList.prototype.accept = function(visitor) { |
6519 return visitor.visitNodeList(this); | 6491 return visitor.visitNodeList(this); |
6520 } | 6492 } |
6521 NodeList.prototype.getBeginToken = function() { | 6493 NodeList.prototype.getBeginToken = function() { |
6522 var $0; | 6494 var $0; |
6523 if (this.beginToken != null) return this.beginToken; | 6495 if (this.beginToken != null) return this.beginToken; |
6524 if (this.get$nodes() != null) { | 6496 if (this.get$nodes() != null) { |
6525 for (var link = this.get$nodes(); | 6497 for (var link = this.get$nodes(); |
6526 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Lin
k$Node())) { | 6498 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Lin
k_Node())) { |
6527 if (link.get$head().getBeginToken$0() != null) { | 6499 if (link.get$head().getBeginToken$0() != null) { |
6528 return (($0 = link.get$head().getBeginToken$0()) && $0.is$Token()); | 6500 return (($0 = link.get$head().getBeginToken$0()) && $0.is$Token()); |
6529 } | 6501 } |
6530 if (link.get$head().getEndToken$0() != null) { | 6502 if (link.get$head().getEndToken$0() != null) { |
6531 return (($0 = link.get$head().getEndToken$0()) && $0.is$Token()); | 6503 return (($0 = link.get$head().getEndToken$0()) && $0.is$Token()); |
6532 } | 6504 } |
6533 } | 6505 } |
6534 } | 6506 } |
6535 return this.endToken; | 6507 return this.endToken; |
6536 } | 6508 } |
6537 NodeList.prototype.getEndToken = function() { | 6509 NodeList.prototype.getEndToken = function() { |
6538 var $0; | 6510 var $0; |
6539 if (this.endToken != null) return this.endToken; | 6511 if (this.endToken != null) return this.endToken; |
6540 if (this.get$nodes() != null) { | 6512 if (this.get$nodes() != null) { |
6541 var link = this.get$nodes(); | 6513 var link = this.get$nodes(); |
6542 if ($notnull_bool(link.isEmpty())) return this.beginToken; | 6514 if ($notnull_bool(link.isEmpty())) return this.beginToken; |
6543 while (!$notnull_bool(link.get$tail().isEmpty$0())) link = (($0 = link.get$t
ail()) && $0.is$Link$Node()); | 6515 while (!$notnull_bool(link.get$tail().isEmpty$0())) link = (($0 = link.get$t
ail()) && $0.is$Link_Node()); |
6544 if (link.get$head().getEndToken$0() != null) return (($0 = link.get$head().g
etEndToken$0()) && $0.is$Token()); | 6516 if (link.get$head().getEndToken$0() != null) return (($0 = link.get$head().g
etEndToken$0()) && $0.is$Token()); |
6545 if (link.get$head().getBeginToken$0() != null) return (($0 = link.get$head()
.getBeginToken$0()) && $0.is$Token()); | 6517 if (link.get$head().getBeginToken$0() != null) return (($0 = link.get$head()
.getBeginToken$0()) && $0.is$Token()); |
6546 } | 6518 } |
6547 return this.beginToken; | 6519 return this.beginToken; |
6548 } | 6520 } |
6549 NodeList.prototype.accept$1 = function($0) { | 6521 NodeList.prototype.accept$1 = function($0) { |
6550 return this.accept(($0 && $0.is$Visitor())); | 6522 return this.accept(($0 && $0.is$Visitor())); |
6551 }; | 6523 }; |
6552 NodeList.prototype.getBeginToken$0 = NodeList.prototype.getBeginToken; | 6524 NodeList.prototype.getBeginToken$0 = NodeList.prototype.getBeginToken; |
6553 NodeList.prototype.getEndToken$0 = NodeList.prototype.getEndToken; | 6525 NodeList.prototype.getEndToken$0 = NodeList.prototype.getEndToken; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6666 } | 6638 } |
6667 $inherits(Literal, Expression); | 6639 $inherits(Literal, Expression); |
6668 Literal.prototype.getBeginToken = function() { | 6640 Literal.prototype.getBeginToken = function() { |
6669 return this.token; | 6641 return this.token; |
6670 } | 6642 } |
6671 Literal.prototype.getEndToken = function() { | 6643 Literal.prototype.getEndToken = function() { |
6672 return this.token; | 6644 return this.token; |
6673 } | 6645 } |
6674 Literal.prototype.getBeginToken$0 = Literal.prototype.getBeginToken; | 6646 Literal.prototype.getBeginToken$0 = Literal.prototype.getBeginToken; |
6675 Literal.prototype.getEndToken$0 = Literal.prototype.getEndToken; | 6647 Literal.prototype.getEndToken$0 = Literal.prototype.getEndToken; |
6676 // ********** Code for Literal$SourceString ************** | 6648 // ********** Code for Literal_SourceString ************** |
6677 function Literal$SourceString(token, handler) { | 6649 function Literal_SourceString(token, handler) { |
6678 this.token = token; | 6650 this.token = token; |
6679 this.handler = handler; | 6651 this.handler = handler; |
6680 // Initializers done | 6652 // Initializers done |
6681 Expression.call(this); | 6653 Expression.call(this); |
6682 } | 6654 } |
6683 $inherits(Literal$SourceString, Literal); | 6655 $inherits(Literal_SourceString, Literal); |
6684 // ********** Code for Literal$bool ************** | 6656 // ********** Code for Literal_bool ************** |
6685 function Literal$bool(token, handler) { | 6657 function Literal_bool(token, handler) { |
6686 this.token = token; | 6658 this.token = token; |
6687 this.handler = handler; | 6659 this.handler = handler; |
6688 // Initializers done | 6660 // Initializers done |
6689 Expression.call(this); | 6661 Expression.call(this); |
6690 } | 6662 } |
6691 $inherits(Literal$bool, Literal); | 6663 $inherits(Literal_bool, Literal); |
6692 // ********** Code for Literal$double ************** | 6664 // ********** Code for Literal_double ************** |
6693 function Literal$double(token, handler) { | 6665 function Literal_double(token, handler) { |
6694 this.token = token; | 6666 this.token = token; |
6695 this.handler = handler; | 6667 this.handler = handler; |
6696 // Initializers done | 6668 // Initializers done |
6697 Expression.call(this); | 6669 Expression.call(this); |
6698 } | 6670 } |
6699 $inherits(Literal$double, Literal); | 6671 $inherits(Literal_double, Literal); |
6700 // ********** Code for Literal$int ************** | 6672 // ********** Code for Literal_int ************** |
6701 function Literal$int(token, handler) { | 6673 function Literal_int(token, handler) { |
6702 this.token = token; | 6674 this.token = token; |
6703 this.handler = handler; | 6675 this.handler = handler; |
6704 // Initializers done | 6676 // Initializers done |
6705 Expression.call(this); | 6677 Expression.call(this); |
6706 } | 6678 } |
6707 $inherits(Literal$int, Literal); | 6679 $inherits(Literal_int, Literal); |
6708 // ********** Code for LiteralInt ************** | 6680 // ********** Code for LiteralInt ************** |
6709 function LiteralInt(token, handler) { | 6681 function LiteralInt(token, handler) { |
6710 // Initializers done | 6682 // Initializers done |
6711 Literal$int.call(this, token, handler); | 6683 Literal_int.call(this, token, handler); |
6712 } | 6684 } |
6713 $inherits(LiteralInt, Literal$int); | 6685 $inherits(LiteralInt, Literal_int); |
6714 LiteralInt.prototype.get$value = function() { | 6686 LiteralInt.prototype.get$value = function() { |
6715 try { | 6687 try { |
6716 return Math.parseInt(this.token.get$value().toString$0()); | 6688 return Math.parseInt(this.token.get$value().toString$0()); |
6717 } catch (ex) { | 6689 } catch (ex) { |
6718 ex = $toDartException(ex); | 6690 ex = $toDartException(ex); |
6719 if (!(ex instanceof BadNumberFormatException)) throw ex; | 6691 if (!(ex instanceof BadNumberFormatException)) throw ex; |
6720 (this.handler)(this.token, ex); | 6692 (this.handler)(this.token, ex); |
6721 } | 6693 } |
6722 } | 6694 } |
6723 LiteralInt.prototype.accept = function(visitor) { | 6695 LiteralInt.prototype.accept = function(visitor) { |
6724 return visitor.visitLiteralInt(this); | 6696 return visitor.visitLiteralInt(this); |
6725 } | 6697 } |
6726 LiteralInt.prototype.accept$1 = function($0) { | 6698 LiteralInt.prototype.accept$1 = function($0) { |
6727 return this.accept(($0 && $0.is$Visitor())); | 6699 return this.accept(($0 && $0.is$Visitor())); |
6728 }; | 6700 }; |
6729 // ********** Code for LiteralDouble ************** | 6701 // ********** Code for LiteralDouble ************** |
6730 function LiteralDouble(token, handler) { | 6702 function LiteralDouble(token, handler) { |
6731 // Initializers done | 6703 // Initializers done |
6732 Literal$double.call(this, token, handler); | 6704 Literal_double.call(this, token, handler); |
6733 } | 6705 } |
6734 $inherits(LiteralDouble, Literal$double); | 6706 $inherits(LiteralDouble, Literal_double); |
6735 LiteralDouble.prototype.get$value = function() { | 6707 LiteralDouble.prototype.get$value = function() { |
6736 try { | 6708 try { |
6737 return Math.parseDouble(this.token.get$value().toString$0()); | 6709 return Math.parseDouble(this.token.get$value().toString$0()); |
6738 } catch (ex) { | 6710 } catch (ex) { |
6739 ex = $toDartException(ex); | 6711 ex = $toDartException(ex); |
6740 if (!(ex instanceof BadNumberFormatException)) throw ex; | 6712 if (!(ex instanceof BadNumberFormatException)) throw ex; |
6741 (this.handler)(this.token, ex); | 6713 (this.handler)(this.token, ex); |
6742 } | 6714 } |
6743 } | 6715 } |
6744 LiteralDouble.prototype.accept = function(visitor) { | 6716 LiteralDouble.prototype.accept = function(visitor) { |
6745 return visitor.visitLiteralDouble(this); | 6717 return visitor.visitLiteralDouble(this); |
6746 } | 6718 } |
6747 LiteralDouble.prototype.accept$1 = function($0) { | 6719 LiteralDouble.prototype.accept$1 = function($0) { |
6748 return this.accept(($0 && $0.is$Visitor())); | 6720 return this.accept(($0 && $0.is$Visitor())); |
6749 }; | 6721 }; |
6750 // ********** Code for LiteralBool ************** | 6722 // ********** Code for LiteralBool ************** |
6751 function LiteralBool(token, handler) { | 6723 function LiteralBool(token, handler) { |
6752 // Initializers done | 6724 // Initializers done |
6753 Literal$bool.call(this, token, handler); | 6725 Literal_bool.call(this, token, handler); |
6754 } | 6726 } |
6755 $inherits(LiteralBool, Literal$bool); | 6727 $inherits(LiteralBool, Literal_bool); |
6756 LiteralBool.prototype.get$value = function() { | 6728 LiteralBool.prototype.get$value = function() { |
6757 switch (this.token.get$value()) { | 6729 switch (this.token.get$value()) { |
6758 case const$69/*Keyword.TRUE*/: | 6730 case const$69/*Keyword.TRUE*/: |
6759 | 6731 |
6760 return true; | 6732 return true; |
6761 | 6733 |
6762 case const$41/*Keyword.FALSE*/: | 6734 case const$41/*Keyword.FALSE*/: |
6763 | 6735 |
6764 return false; | 6736 return false; |
6765 | 6737 |
6766 default: | 6738 default: |
6767 | 6739 |
6768 (this.handler)(this.token, ("not a bool " + this.token.get$value())); | 6740 (this.handler)(this.token, ("not a bool " + this.token.get$value())); |
6769 | 6741 |
6770 } | 6742 } |
6771 } | 6743 } |
6772 LiteralBool.prototype.accept = function(visitor) { | 6744 LiteralBool.prototype.accept = function(visitor) { |
6773 return visitor.visitLiteralBool(this); | 6745 return visitor.visitLiteralBool(this); |
6774 } | 6746 } |
6775 LiteralBool.prototype.accept$1 = function($0) { | 6747 LiteralBool.prototype.accept$1 = function($0) { |
6776 return this.accept(($0 && $0.is$Visitor())); | 6748 return this.accept(($0 && $0.is$Visitor())); |
6777 }; | 6749 }; |
6778 // ********** Code for LiteralString ************** | 6750 // ********** Code for LiteralString ************** |
6779 function LiteralString(token) { | 6751 function LiteralString(token) { |
6780 // Initializers done | 6752 // Initializers done |
6781 Literal$SourceString.call(this, token, to$call$2(null)); | 6753 Literal_SourceString.call(this, token, to$call$2(null)); |
6782 } | 6754 } |
6783 $inherits(LiteralString, Literal$SourceString); | 6755 $inherits(LiteralString, Literal_SourceString); |
6784 LiteralString.prototype.is$LiteralString = function(){return this;}; | 6756 LiteralString.prototype.is$LiteralString = function(){return this;}; |
6785 LiteralString.prototype.get$value = function() { | 6757 LiteralString.prototype.get$value = function() { |
6786 var $0; | 6758 var $0; |
6787 return (($0 = this.token.get$value()) && $0.is$SourceString()); | 6759 return (($0 = this.token.get$value()) && $0.is$SourceString()); |
6788 } | 6760 } |
6789 LiteralString.prototype.accept = function(visitor) { | 6761 LiteralString.prototype.accept = function(visitor) { |
6790 return visitor.visitLiteralString(this); | 6762 return visitor.visitLiteralString(this); |
6791 } | 6763 } |
6792 LiteralString.prototype.accept$1 = function($0) { | 6764 LiteralString.prototype.accept$1 = function($0) { |
6793 return this.accept(($0 && $0.is$Visitor())); | 6765 return this.accept(($0 && $0.is$Visitor())); |
6794 }; | 6766 }; |
6795 // ********** Code for LiteralNull ************** | 6767 // ********** Code for LiteralNull ************** |
6796 function LiteralNull(token) { | 6768 function LiteralNull(token) { |
6797 // Initializers done | 6769 // Initializers done |
6798 Literal$SourceString.call(this, token, to$call$2(null)); | 6770 Literal_SourceString.call(this, token, to$call$2(null)); |
6799 } | 6771 } |
6800 $inherits(LiteralNull, Literal$SourceString); | 6772 $inherits(LiteralNull, Literal_SourceString); |
6801 LiteralNull.prototype.get$value = function() { | 6773 LiteralNull.prototype.get$value = function() { |
6802 return null; | 6774 return null; |
6803 } | 6775 } |
6804 LiteralNull.prototype.accept = function(visitor) { | 6776 LiteralNull.prototype.accept = function(visitor) { |
6805 return visitor.visitLiteralNull(this); | 6777 return visitor.visitLiteralNull(this); |
6806 } | 6778 } |
6807 LiteralNull.prototype.accept$1 = function($0) { | 6779 LiteralNull.prototype.accept$1 = function($0) { |
6808 return this.accept(($0 && $0.is$Visitor())); | 6780 return this.accept(($0 && $0.is$Visitor())); |
6809 }; | 6781 }; |
6810 // ********** Code for Identifier ************** | 6782 // ********** Code for Identifier ************** |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7156 } | 7128 } |
7157 AbstractVisitor.prototype.visitLiteral = function(node) { | 7129 AbstractVisitor.prototype.visitLiteral = function(node) { |
7158 return this.visitExpression(node); | 7130 return this.visitExpression(node); |
7159 } | 7131 } |
7160 AbstractVisitor.prototype.visitSend = function(node) { | 7132 AbstractVisitor.prototype.visitSend = function(node) { |
7161 return this.visitExpression(node); | 7133 return this.visitExpression(node); |
7162 } | 7134 } |
7163 AbstractVisitor.prototype.visitStatement = function(node) { | 7135 AbstractVisitor.prototype.visitStatement = function(node) { |
7164 return this.visitNode(node); | 7136 return this.visitNode(node); |
7165 } | 7137 } |
7166 // ********** Code for AbstractVisitor$Element ************** | 7138 // ********** Code for AbstractVisitor_Element ************** |
7167 function AbstractVisitor$Element() { | 7139 function AbstractVisitor_Element() { |
7168 // Initializers done | 7140 // Initializers done |
7169 } | 7141 } |
7170 $inherits(AbstractVisitor$Element, AbstractVisitor); | 7142 $inherits(AbstractVisitor_Element, AbstractVisitor); |
7171 AbstractVisitor$Element.prototype.is$Visitor = function(){return this;}; | 7143 AbstractVisitor_Element.prototype.is$Visitor = function(){return this;}; |
7172 AbstractVisitor$Element.prototype.visitClassNode = function(node) { | 7144 AbstractVisitor_Element.prototype.visitClassNode = function(node) { |
7173 var $0; | 7145 var $0; |
7174 return (($0 = this.visitNode(node)) && $0.is$Element()); | 7146 return (($0 = this.visitNode(node)) && $0.is$Element()); |
7175 } | 7147 } |
7176 AbstractVisitor$Element.prototype.visitTypeAnnotation = function(node) { | 7148 AbstractVisitor_Element.prototype.visitTypeAnnotation = function(node) { |
7177 var $0; | 7149 var $0; |
7178 return (($0 = this.visitNode(node)) && $0.is$Element()); | 7150 return (($0 = this.visitNode(node)) && $0.is$Element()); |
7179 } | 7151 } |
7180 // ********** Code for AbstractVisitor$SourceString ************** | 7152 // ********** Code for AbstractVisitor_SourceString ************** |
7181 function AbstractVisitor$SourceString() { | 7153 function AbstractVisitor_SourceString() { |
7182 // Initializers done | 7154 // Initializers done |
7183 } | 7155 } |
7184 $inherits(AbstractVisitor$SourceString, AbstractVisitor); | 7156 $inherits(AbstractVisitor_SourceString, AbstractVisitor); |
7185 AbstractVisitor$SourceString.prototype.is$Visitor = function(){return this;}; | 7157 AbstractVisitor_SourceString.prototype.is$Visitor = function(){return this;}; |
7186 // ********** Code for AbstractVisitor$Type ************** | 7158 // ********** Code for AbstractVisitor_Type ************** |
7187 function AbstractVisitor$Type() { | 7159 function AbstractVisitor_Type() { |
7188 // Initializers done | 7160 // Initializers done |
7189 } | 7161 } |
7190 $inherits(AbstractVisitor$Type, AbstractVisitor); | 7162 $inherits(AbstractVisitor_Type, AbstractVisitor); |
7191 AbstractVisitor$Type.prototype.is$Visitor = function(){return this;}; | 7163 AbstractVisitor_Type.prototype.is$Visitor = function(){return this;}; |
7192 AbstractVisitor$Type.prototype.visitBlock = function(node) { | 7164 AbstractVisitor_Type.prototype.visitBlock = function(node) { |
7193 return this.visitStatement(node); | 7165 return this.visitStatement(node); |
7194 } | 7166 } |
7195 AbstractVisitor$Type.prototype.visitExpression = function(node) { | 7167 AbstractVisitor_Type.prototype.visitExpression = function(node) { |
7196 var $0; | 7168 var $0; |
7197 return (($0 = this.visitNode(node)) && $0.is$Type()); | 7169 return (($0 = this.visitNode(node)) && $0.is$Type()); |
7198 } | 7170 } |
7199 AbstractVisitor$Type.prototype.visitExpressionStatement = function(node) { | 7171 AbstractVisitor_Type.prototype.visitExpressionStatement = function(node) { |
7200 return this.visitStatement(node); | 7172 return this.visitStatement(node); |
7201 } | 7173 } |
7202 AbstractVisitor$Type.prototype.visitFor = function(node) { | 7174 AbstractVisitor_Type.prototype.visitFor = function(node) { |
7203 return this.visitStatement(node); | 7175 return this.visitStatement(node); |
7204 } | 7176 } |
7205 AbstractVisitor$Type.prototype.visitFunctionExpression = function(node) { | 7177 AbstractVisitor_Type.prototype.visitFunctionExpression = function(node) { |
7206 return this.visitExpression(node); | 7178 return this.visitExpression(node); |
7207 } | 7179 } |
7208 AbstractVisitor$Type.prototype.visitIdentifier = function(node) { | 7180 AbstractVisitor_Type.prototype.visitIdentifier = function(node) { |
7209 return this.visitExpression(node); | 7181 return this.visitExpression(node); |
7210 } | 7182 } |
7211 AbstractVisitor$Type.prototype.visitIf = function(node) { | 7183 AbstractVisitor_Type.prototype.visitIf = function(node) { |
7212 return this.visitStatement(node); | 7184 return this.visitStatement(node); |
7213 } | 7185 } |
7214 AbstractVisitor$Type.prototype.visitLiteral = function(node) { | 7186 AbstractVisitor_Type.prototype.visitLiteral = function(node) { |
7215 return this.visitExpression(node); | 7187 return this.visitExpression(node); |
7216 } | 7188 } |
7217 AbstractVisitor$Type.prototype.visitLiteralBool = function(node) { | 7189 AbstractVisitor_Type.prototype.visitLiteralBool = function(node) { |
7218 return this.visitLiteral(node); | 7190 return this.visitLiteral(node); |
7219 } | 7191 } |
7220 AbstractVisitor$Type.prototype.visitLiteralDouble = function(node) { | 7192 AbstractVisitor_Type.prototype.visitLiteralDouble = function(node) { |
7221 return this.visitLiteral(node); | 7193 return this.visitLiteral(node); |
7222 } | 7194 } |
7223 AbstractVisitor$Type.prototype.visitLiteralInt = function(node) { | 7195 AbstractVisitor_Type.prototype.visitLiteralInt = function(node) { |
7224 return this.visitLiteral(node); | 7196 return this.visitLiteral(node); |
7225 } | 7197 } |
7226 AbstractVisitor$Type.prototype.visitLiteralNull = function(node) { | 7198 AbstractVisitor_Type.prototype.visitLiteralNull = function(node) { |
7227 return this.visitLiteral(node); | 7199 return this.visitLiteral(node); |
7228 } | 7200 } |
7229 AbstractVisitor$Type.prototype.visitLiteralString = function(node) { | 7201 AbstractVisitor_Type.prototype.visitLiteralString = function(node) { |
7230 return this.visitLiteral(node); | 7202 return this.visitLiteral(node); |
7231 } | 7203 } |
7232 AbstractVisitor$Type.prototype.visitNodeList = function(node) { | 7204 AbstractVisitor_Type.prototype.visitNodeList = function(node) { |
7233 var $0; | 7205 var $0; |
7234 return (($0 = this.visitNode(node)) && $0.is$Type()); | 7206 return (($0 = this.visitNode(node)) && $0.is$Type()); |
7235 } | 7207 } |
7236 AbstractVisitor$Type.prototype.visitOperator = function(node) { | 7208 AbstractVisitor_Type.prototype.visitOperator = function(node) { |
7237 var $0; | 7209 var $0; |
7238 return (($0 = this.visitIdentifier(node)) && $0.is$Type()); | 7210 return (($0 = this.visitIdentifier(node)) && $0.is$Type()); |
7239 } | 7211 } |
7240 AbstractVisitor$Type.prototype.visitReturn = function(node) { | 7212 AbstractVisitor_Type.prototype.visitReturn = function(node) { |
7241 return this.visitStatement(node); | 7213 return this.visitStatement(node); |
7242 } | 7214 } |
7243 AbstractVisitor$Type.prototype.visitSend = function(node) { | 7215 AbstractVisitor_Type.prototype.visitSend = function(node) { |
7244 return this.visitExpression(node); | 7216 return this.visitExpression(node); |
7245 } | 7217 } |
7246 AbstractVisitor$Type.prototype.visitSendSet = function(node) { | 7218 AbstractVisitor_Type.prototype.visitSendSet = function(node) { |
7247 return this.visitSend(node); | 7219 return this.visitSend(node); |
7248 } | 7220 } |
7249 AbstractVisitor$Type.prototype.visitStatement = function(node) { | 7221 AbstractVisitor_Type.prototype.visitStatement = function(node) { |
7250 var $0; | 7222 var $0; |
7251 return (($0 = this.visitNode(node)) && $0.is$Type()); | 7223 return (($0 = this.visitNode(node)) && $0.is$Type()); |
7252 } | 7224 } |
7253 AbstractVisitor$Type.prototype.visitThrow = function(node) { | 7225 AbstractVisitor_Type.prototype.visitThrow = function(node) { |
7254 return this.visitStatement(node); | 7226 return this.visitStatement(node); |
7255 } | 7227 } |
7256 AbstractVisitor$Type.prototype.visitVariableDefinitions = function(node) { | 7228 AbstractVisitor_Type.prototype.visitVariableDefinitions = function(node) { |
7257 return this.visitStatement(node); | 7229 return this.visitStatement(node); |
7258 } | 7230 } |
7259 // ********** Code for top level ************** | 7231 // ********** Code for top level ************** |
7260 function firstBeginToken(first, second) { | 7232 function firstBeginToken(first, second) { |
7261 var $0; | 7233 var $0; |
7262 return (($0 = (first != null) ? first.getBeginToken() : second.getBeginToken()
) && $0.is$Token()); | 7234 return (($0 = (first != null) ? first.getBeginToken() : second.getBeginToken()
) && $0.is$Token()); |
7263 } | 7235 } |
7264 // ********** Library elements ************** | 7236 // ********** Library elements ************** |
7265 // ********** Code for ElementKind ************** | 7237 // ********** Code for ElementKind ************** |
7266 function ElementKind(id) { | 7238 function ElementKind(id) { |
7267 this.id = id; | 7239 this.id = id; |
7268 // Initializers done | 7240 // Initializers done |
7269 } | 7241 } |
7270 ElementKind.prototype.get$id = function() { return this.id; }; | 7242 ElementKind.prototype.get$id = function() { return this.id; }; |
7271 ElementKind.prototype.toString = function() { | 7243 ElementKind.prototype.toString = function() { |
7272 return this.id; | 7244 return this.id; |
7273 } | 7245 } |
7274 ElementKind.prototype.toString$0 = ElementKind.prototype.toString; | 7246 ElementKind.prototype.toString$0 = ElementKind.prototype.toString; |
7275 // ********** Code for Element ************** | 7247 // ********** Code for Element ************** |
7276 function Element(name, kind, enclosingElement) { | 7248 function Element(name, kind, enclosingElement) { |
7277 this.name = name; | 7249 this.name = name; |
7278 this.kind = kind; | 7250 this.kind = kind; |
7279 this.enclosingElement = enclosingElement; | 7251 this.enclosingElement = enclosingElement; |
7280 // Initializers done | 7252 // Initializers done |
7281 } | 7253 } |
7282 Element.prototype.is$Element = function(){return this;}; | 7254 Element.prototype.is$Element = function(){return this;}; |
7283 Element.prototype.get$name = function() { return this.name; }; | 7255 Element.prototype.get$name = function() { return this.name; }; |
7284 Element.prototype.get$kind = function() { return this.kind; }; | 7256 Element.prototype.get$kind = function() { return this.kind; }; |
| 7257 Element.prototype.get$enclosingElement = function() { return this.enclosingEleme
nt; }; |
7285 Element.prototype.hashCode = function() { | 7258 Element.prototype.hashCode = function() { |
7286 return this.name.hashCode(); | 7259 return this.name.hashCode(); |
7287 } | 7260 } |
7288 Element.prototype.computeType$2 = function($0, $1) { | 7261 Element.prototype.computeType$2 = function($0, $1) { |
7289 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); | 7262 return this.computeType(($0 && $0.is$Compiler()), ($1 && $1.is$Types())); |
7290 }; | 7263 }; |
7291 Element.prototype.hashCode$0 = Element.prototype.hashCode; | 7264 Element.prototype.hashCode$0 = Element.prototype.hashCode; |
7292 // ********** Code for VariableElement ************** | 7265 // ********** Code for VariableElement ************** |
7293 function VariableElement(node, typeAnnotation, kind, name, enclosingElement) { | 7266 function VariableElement(node, typeAnnotation, kind, name, enclosingElement) { |
7294 this.node = node; | 7267 this.node = node; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7336 FunctionElement.prototype.set$type = function(value) { return this.type = value;
}; | 7309 FunctionElement.prototype.set$type = function(value) { return this.type = value;
}; |
7337 FunctionElement.prototype.computeType = function(compiler, types) { | 7310 FunctionElement.prototype.computeType = function(compiler, types) { |
7338 var $0; | 7311 var $0; |
7339 if (this.type != null) return (($0 = this.type) && $0.is$FunctionType()); | 7312 if (this.type != null) return (($0 = this.type) && $0.is$FunctionType()); |
7340 if (this.parameters == null) compiler.resolveSignature(this); | 7313 if (this.parameters == null) compiler.resolveSignature(this); |
7341 var node = (($0 = this.parseNode(compiler, compiler)) && $0.is$FunctionExpress
ion()); | 7314 var node = (($0 = this.parseNode(compiler, compiler)) && $0.is$FunctionExpress
ion()); |
7342 var returnType = getType(node.returnType, types); | 7315 var returnType = getType(node.returnType, types); |
7343 if (returnType == null) compiler.cancel(('unknown type ' + returnType)); | 7316 if (returnType == null) compiler.cancel(('unknown type ' + returnType)); |
7344 var parameterTypes = new LinkBuilderImplementation(); | 7317 var parameterTypes = new LinkBuilderImplementation(); |
7345 for (var link = this.parameters; | 7318 for (var link = this.parameters; |
7346 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$
Element())) { | 7319 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_
Element())) { |
7347 parameterTypes.addLast(link.get$head().computeType$2(compiler, types)); | 7320 parameterTypes.addLast(link.get$head().computeType$2(compiler, types)); |
7348 } | 7321 } |
7349 this.type = new FunctionType(returnType, (($0 = parameterTypes.toLink()) && $0
.is$Link$Type())); | 7322 this.type = new FunctionType(returnType, (($0 = parameterTypes.toLink()) && $0
.is$Link_Type())); |
7350 return (($0 = this.type) && $0.is$FunctionType()); | 7323 return (($0 = this.type) && $0.is$FunctionType()); |
7351 } | 7324 } |
7352 FunctionElement.prototype.computeType$2 = function($0, $1) { | 7325 FunctionElement.prototype.computeType$2 = function($0, $1) { |
7353 return this.computeType(($0 && $0.is$Compiler()), $1); | 7326 return this.computeType(($0 && $0.is$Compiler()), $1); |
7354 }; | 7327 }; |
7355 // ********** Code for ClassElement ************** | 7328 // ********** Code for ClassElement ************** |
7356 function ClassElement(name) { | 7329 function ClassElement(name) { |
7357 this.interfaces = const$205/*const EmptyLink<Type>()*/ | 7330 this.interfaces = const$205/*const EmptyLink<Type>()*/ |
7358 this.isResolved = false | 7331 this.isResolved = false |
7359 // Initializers done | 7332 // Initializers done |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7484 } | 7457 } |
7485 return value; | 7458 return value; |
7486 } | 7459 } |
7487 SsaBuilder.prototype.visit = function(node) { | 7460 SsaBuilder.prototype.visit = function(node) { |
7488 if (node != null) node.accept(this); | 7461 if (node != null) node.accept(this); |
7489 } | 7462 } |
7490 SsaBuilder.prototype.visitParameterValues = function(parameters) { | 7463 SsaBuilder.prototype.visitParameterValues = function(parameters) { |
7491 var $0; | 7464 var $0; |
7492 var parameterIndex = 0; | 7465 var parameterIndex = 0; |
7493 for (var link = parameters.get$nodes(); | 7466 for (var link = parameters.get$nodes(); |
7494 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$
Node())) { | 7467 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_
Node())) { |
7495 var container = (($0 = link.get$head()) && $0.is$VariableDefinitions()); | 7468 var container = (($0 = link.get$head()) && $0.is$VariableDefinitions()); |
7496 var identifierLink = container.definitions.get$nodes(); | 7469 var identifierLink = container.definitions.get$nodes(); |
7497 $assert(!$notnull_bool(identifierLink.isEmpty()) && $notnull_bool(identifier
Link.get$tail().isEmpty$0()), "!identifierLink.isEmpty() && identifierLink.tail.
isEmpty()", "builder.dart", 130, 14); | 7470 $assert(!$notnull_bool(identifierLink.isEmpty()) && $notnull_bool(identifier
Link.get$tail().isEmpty$0()), "!identifierLink.isEmpty() && identifierLink.tail.
isEmpty()", "builder.dart", 130, 14); |
7498 if (!(identifierLink.get$head() instanceof Identifier)) { | 7471 if (!(identifierLink.get$head() instanceof Identifier)) { |
7499 this.compiler.unimplemented("SsaBuilder.visitParameterValues non-identifie
r"); | 7472 this.compiler.unimplemented("SsaBuilder.visitParameterValues non-identifie
r"); |
7500 } | 7473 } |
7501 var parameterId = (($0 = identifierLink.get$head()) && $0.is$Identifier()); | 7474 var parameterId = (($0 = identifierLink.get$head()) && $0.is$Identifier()); |
7502 var element = (($0 = this.elements.$index(parameterId)) && $0.is$VariableEle
ment()); | 7475 var element = (($0 = this.elements.$index(parameterId)) && $0.is$VariableEle
ment()); |
7503 var parameter = new HParameterValue(element); | 7476 var parameter = new HParameterValue(element); |
7504 this.add(parameter); | 7477 this.add(parameter); |
7505 this.definitions.$setindex(element, this.guard(element.type, parameter)); | 7478 this.definitions.$setindex(element, this.guard(element.type, parameter)); |
7506 } | 7479 } |
7507 } | 7480 } |
7508 SsaBuilder.prototype.visitBlock = function(node) { | 7481 SsaBuilder.prototype.visitBlock = function(node) { |
7509 var $0; | 7482 var $0; |
7510 for (var link = node.statements.get$nodes(); | 7483 for (var link = node.statements.get$nodes(); |
7511 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$
Node())) { | 7484 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_
Node())) { |
7512 this.visit((($0 = link.get$head()) && $0.is$Node())); | 7485 this.visit((($0 = link.get$head()) && $0.is$Node())); |
7513 if ($notnull_bool(this.isAborted())) { | 7486 if ($notnull_bool(this.isAborted())) { |
7514 if (!this.stack.isEmpty()) this.compiler.cancel('non-empty instruction sta
ck'); | 7487 if (!this.stack.isEmpty()) this.compiler.cancel('non-empty instruction sta
ck'); |
7515 return; | 7488 return; |
7516 } | 7489 } |
7517 } | 7490 } |
7518 $assert(!$notnull_bool(this.current.isClosed()), "!current.isClosed()", "build
er.dart", 153, 12); | 7491 $assert(!$notnull_bool(this.current.isClosed()), "!current.isClosed()", "build
er.dart", 153, 12); |
7519 if (!this.stack.isEmpty()) this.compiler.cancel('non-empty instruction stack')
; | 7492 if (!this.stack.isEmpty()) this.compiler.cancel('non-empty instruction stack')
; |
7520 } | 7493 } |
7521 SsaBuilder.prototype.visitClassNode = function(node) { | 7494 SsaBuilder.prototype.visitClassNode = function(node) { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7638 } | 7611 } |
7639 SsaBuilder.prototype.unquote = function(literal) { | 7612 SsaBuilder.prototype.unquote = function(literal) { |
7640 var str = ('' + literal.get$value()); | 7613 var str = ('' + literal.get$value()); |
7641 this.compiler.ensure(str[0] == '@'); | 7614 this.compiler.ensure(str[0] == '@'); |
7642 var quotes = 1; | 7615 var quotes = 1; |
7643 var quote = str[1]; | 7616 var quote = str[1]; |
7644 while (str[quotes + 1] === quote) quotes++; | 7617 while (str[quotes + 1] === quote) quotes++; |
7645 return new StringWrapper(str.substring(quotes + 1, str.length - quotes)); | 7618 return new StringWrapper(str.substring(quotes + 1, str.length - quotes)); |
7646 } | 7619 } |
7647 SsaBuilder.prototype.visitLogicalAndOr = function(node, op) { | 7620 SsaBuilder.prototype.visitLogicalAndOr = function(node, op) { |
7648 var isAnd = $assert_bool(($eq(const$280/*const SourceString("&&")*/, op.get$so
urce()))); | 7621 var isAnd = $assert_bool(($eq(const$276/*const SourceString("&&")*/, op.get$so
urce()))); |
7649 this.visit(node.receiver); | 7622 this.visit(node.receiver); |
7650 var boolifiedLeft = this.popBoolified(); | 7623 var boolifiedLeft = this.popBoolified(); |
7651 var condition; | 7624 var condition; |
7652 if ($notnull_bool(isAnd)) { | 7625 if ($notnull_bool(isAnd)) { |
7653 condition = boolifiedLeft; | 7626 condition = boolifiedLeft; |
7654 } | 7627 } |
7655 else { | 7628 else { |
7656 condition = new HNot(boolifiedLeft); | 7629 condition = new HNot(boolifiedLeft); |
7657 this.add(condition); | 7630 this.add(condition); |
7658 } | 7631 } |
(...skipping 21 matching lines...) Expand all Loading... |
7680 this.push(not); | 7653 this.push(not); |
7681 } | 7654 } |
7682 SsaBuilder.prototype.visitUnary = function(node, op, element) { | 7655 SsaBuilder.prototype.visitUnary = function(node, op, element) { |
7683 this.compiler.unimplemented("visitUnary"); | 7656 this.compiler.unimplemented("visitUnary"); |
7684 } | 7657 } |
7685 SsaBuilder.prototype.visitBinary = function(node, op, element) { | 7658 SsaBuilder.prototype.visitBinary = function(node, op, element) { |
7686 this.visit(node.receiver); | 7659 this.visit(node.receiver); |
7687 this.visit(node.argumentsNode); | 7660 this.visit(node.argumentsNode); |
7688 var right = this.pop(); | 7661 var right = this.pop(); |
7689 var left = this.pop(); | 7662 var left = this.pop(); |
7690 if ($notnull_bool($eq(const$283/*const SourceString("+")*/, op.get$source())))
{ | 7663 if ($notnull_bool($eq(const$279/*const SourceString("+")*/, op.get$source())))
{ |
7691 this.push(new HAdd(element, [left, right])); | 7664 this.push(new HAdd(element, [left, right])); |
7692 } | 7665 } |
7693 else if ($notnull_bool($eq(const$284/*const SourceString("-")*/, op.get$source
()))) { | 7666 else if ($notnull_bool($eq(const$280/*const SourceString("-")*/, op.get$source
()))) { |
7694 this.push(new HSubtract(element, [left, right])); | 7667 this.push(new HSubtract(element, [left, right])); |
7695 } | 7668 } |
7696 else if ($notnull_bool($eq(const$285/*const SourceString("*")*/, op.get$source
()))) { | 7669 else if ($notnull_bool($eq(const$281/*const SourceString("*")*/, op.get$source
()))) { |
7697 this.push(new HMultiply(element, [left, right])); | 7670 this.push(new HMultiply(element, [left, right])); |
7698 } | 7671 } |
7699 else if ($notnull_bool($eq(const$286/*const SourceString("/")*/, op.get$source
()))) { | 7672 else if ($notnull_bool($eq(const$282/*const SourceString("/")*/, op.get$source
()))) { |
7700 this.push(new HDivide(element, [left, right])); | 7673 this.push(new HDivide(element, [left, right])); |
7701 } | 7674 } |
7702 else if ($notnull_bool($eq(const$287/*const SourceString("~/")*/, op.get$sourc
e()))) { | 7675 else if ($notnull_bool($eq(const$283/*const SourceString("~/")*/, op.get$sourc
e()))) { |
7703 this.push(new HTruncatingDivide(element, [left, right])); | 7676 this.push(new HTruncatingDivide(element, [left, right])); |
7704 } | 7677 } |
7705 else if ($notnull_bool($eq(const$288/*const SourceString("%")*/, op.get$source
()))) { | 7678 else if ($notnull_bool($eq(const$284/*const SourceString("%")*/, op.get$source
()))) { |
7706 this.push(new HModulo(element, [left, right])); | 7679 this.push(new HModulo(element, [left, right])); |
7707 } | 7680 } |
7708 else if ($notnull_bool($eq(const$289/*const SourceString("==")*/, op.get$sourc
e()))) { | 7681 else if ($notnull_bool($eq(const$285/*const SourceString("==")*/, op.get$sourc
e()))) { |
7709 this.push(new HEquals(element, [left, right])); | 7682 this.push(new HEquals(element, [left, right])); |
7710 } | 7683 } |
7711 else if ($notnull_bool($eq(const$290/*const SourceString("<")*/, op.get$source
()))) { | 7684 else if ($notnull_bool($eq(const$286/*const SourceString("<")*/, op.get$source
()))) { |
7712 this.push(new HLess(element, [left, right])); | 7685 this.push(new HLess(element, [left, right])); |
7713 } | 7686 } |
7714 else if ($notnull_bool($eq(const$291/*const SourceString("<=")*/, op.get$sourc
e()))) { | 7687 else if ($notnull_bool($eq(const$287/*const SourceString("<=")*/, op.get$sourc
e()))) { |
7715 this.push(new HLessEqual(element, [left, right])); | 7688 this.push(new HLessEqual(element, [left, right])); |
7716 } | 7689 } |
7717 else if ($notnull_bool($eq(const$292/*const SourceString(">")*/, op.get$source
()))) { | 7690 else if ($notnull_bool($eq(const$288/*const SourceString(">")*/, op.get$source
()))) { |
7718 this.push(new HGreater(element, [left, right])); | 7691 this.push(new HGreater(element, [left, right])); |
7719 } | 7692 } |
7720 else if ($notnull_bool($eq(const$293/*const SourceString(">=")*/, op.get$sourc
e()))) { | 7693 else if ($notnull_bool($eq(const$289/*const SourceString(">=")*/, op.get$sourc
e()))) { |
7721 this.push(new HGreaterEqual(element, [left, right])); | 7694 this.push(new HGreaterEqual(element, [left, right])); |
7722 } | 7695 } |
7723 } | 7696 } |
7724 SsaBuilder.prototype.visitSend = function(node) { | 7697 SsaBuilder.prototype.visitSend = function(node) { |
7725 var $0; | 7698 var $0; |
7726 var element = (($0 = this.elements.$index(node)) && $0.is$Element()); | 7699 var element = (($0 = this.elements.$index(node)) && $0.is$Element()); |
7727 if ((node.selector instanceof Operator)) { | 7700 if ((node.selector instanceof Operator)) { |
7728 var op = (($0 = node.selector) && $0.is$Operator()); | 7701 var op = (($0 = node.selector) && $0.is$Operator()); |
7729 if ($notnull_bool($eq(const$280/*const SourceString("&&")*/, op.get$source()
)) || $notnull_bool($eq(const$281/*const SourceString("||")*/, op.get$source()))
) { | 7702 if ($notnull_bool($eq(const$276/*const SourceString("&&")*/, op.get$source()
)) || $notnull_bool($eq(const$277/*const SourceString("||")*/, op.get$source()))
) { |
7730 this.visitLogicalAndOr(node, op); | 7703 this.visitLogicalAndOr(node, op); |
7731 } | 7704 } |
7732 else if ($notnull_bool($eq(const$282/*const SourceString("!")*/, op.get$sour
ce()))) { | 7705 else if ($notnull_bool($eq(const$278/*const SourceString("!")*/, op.get$sour
ce()))) { |
7733 this.visitLogicalNot(node); | 7706 this.visitLogicalNot(node); |
7734 } | 7707 } |
7735 else if (node.argumentsNode === const$217/*const Prefix()*/ || node.argument
sNode === const$219/*const Postfix()*/) { | 7708 else if (node.argumentsNode === const$217/*const Prefix()*/ || node.argument
sNode === const$219/*const Postfix()*/) { |
7736 this.visitUnary(node, op, element); | 7709 this.visitUnary(node, op, element); |
7737 } | 7710 } |
7738 else { | 7711 else { |
7739 this.visitBinary(node, op, element); | 7712 this.visitBinary(node, op, element); |
7740 } | 7713 } |
7741 } | 7714 } |
7742 else if ($notnull_bool(node.get$isPropertyAccess())) { | 7715 else if ($notnull_bool(node.get$isPropertyAccess())) { |
7743 if (node.receiver != null) { | 7716 if (node.receiver != null) { |
7744 this.compiler.unimplemented("SsaBuilder.visitSend with receiver"); | 7717 this.compiler.unimplemented("SsaBuilder.visitSend with receiver"); |
7745 } | 7718 } |
7746 this.stack.add(this.definitions.$index(element)); | 7719 this.stack.add(this.definitions.$index(element)); |
7747 } | 7720 } |
7748 else { | 7721 else { |
7749 var link = node.get$arguments(); | 7722 var link = node.get$arguments(); |
7750 if (element.kind === const$211/*ElementKind.FOREIGN*/) { | 7723 if (element.kind === const$211/*ElementKind.FOREIGN*/) { |
7751 link = (($0 = link.get$tail()) && $0.is$Link$Node()); | 7724 link = (($0 = link.get$tail()) && $0.is$Link_Node()); |
7752 } | 7725 } |
7753 var arguments = []; | 7726 var arguments = []; |
7754 for (; !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.
is$Link$Node())) { | 7727 for (; !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.
is$Link_Node())) { |
7755 this.visit((($0 = link.get$head()) && $0.is$Node())); | 7728 this.visit((($0 = link.get$head()) && $0.is$Node())); |
7756 arguments.add$1(this.pop()); | 7729 arguments.add$1(this.pop()); |
7757 } | 7730 } |
7758 if (element.kind === const$211/*ElementKind.FOREIGN*/) { | 7731 if (element.kind === const$211/*ElementKind.FOREIGN*/) { |
7759 var literal = (($0 = node.get$arguments().get$head()) && $0.is$LiteralStri
ng()); | 7732 var literal = (($0 = node.get$arguments().get$head()) && $0.is$LiteralStri
ng()); |
7760 this.compiler.ensure((literal instanceof LiteralString)); | 7733 this.compiler.ensure((literal instanceof LiteralString)); |
7761 this.push(new HInvokeForeign(element, arguments, this.unquote(literal))); | 7734 this.push(new HInvokeForeign(element, arguments, this.unquote(literal))); |
7762 } | 7735 } |
7763 else { | 7736 else { |
7764 var selector = (($0 = node.selector) && $0.is$Identifier()); | 7737 var selector = (($0 = node.selector) && $0.is$Identifier()); |
(...skipping 15 matching lines...) Expand all Loading... |
7780 } | 7753 } |
7781 SsaBuilder.prototype.visitLiteralString = function(node) { | 7754 SsaBuilder.prototype.visitLiteralString = function(node) { |
7782 this.push(new HLiteral(node.get$value())); | 7755 this.push(new HLiteral(node.get$value())); |
7783 } | 7756 } |
7784 SsaBuilder.prototype.visitLiteralNull = function(node) { | 7757 SsaBuilder.prototype.visitLiteralNull = function(node) { |
7785 this.push(new HLiteral(null)); | 7758 this.push(new HLiteral(null)); |
7786 } | 7759 } |
7787 SsaBuilder.prototype.visitNodeList = function(node) { | 7760 SsaBuilder.prototype.visitNodeList = function(node) { |
7788 var $0; | 7761 var $0; |
7789 for (var link = node.get$nodes(); | 7762 for (var link = node.get$nodes(); |
7790 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$
Node())) { | 7763 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_
Node())) { |
7791 this.visit((($0 = link.get$head()) && $0.is$Node())); | 7764 this.visit((($0 = link.get$head()) && $0.is$Node())); |
7792 } | 7765 } |
7793 } | 7766 } |
7794 SsaBuilder.prototype.visitOperator = function(node) { | 7767 SsaBuilder.prototype.visitOperator = function(node) { |
7795 unreachable(); | 7768 unreachable(); |
7796 } | 7769 } |
7797 SsaBuilder.prototype.visitReturn = function(node) { | 7770 SsaBuilder.prototype.visitReturn = function(node) { |
7798 var value; | 7771 var value; |
7799 if (node.expression == null) { | 7772 if (node.expression == null) { |
7800 value = new HLiteral(null); | 7773 value = new HLiteral(null); |
(...skipping 24 matching lines...) Expand all Loading... |
7825 $assert(!$notnull_bool(link.isEmpty()) && $notnull_bool(link.get$tail().isEmpt
y$0()), "!link.isEmpty() && link.tail.isEmpty()", "builder.dart", 520, 12); | 7798 $assert(!$notnull_bool(link.isEmpty()) && $notnull_bool(link.get$tail().isEmpt
y$0()), "!link.isEmpty() && link.tail.isEmpty()", "builder.dart", 520, 12); |
7826 this.visit((($0 = link.get$head()) && $0.is$Node())); | 7799 this.visit((($0 = link.get$head()) && $0.is$Node())); |
7827 var value = this.pop(); | 7800 var value = this.pop(); |
7828 var element = (($0 = this.elements.$index(node)) && $0.is$VariableElement()); | 7801 var element = (($0 = this.elements.$index(node)) && $0.is$VariableElement()); |
7829 this.definitions.$setindex(element, this.guard(element.type, value)); | 7802 this.definitions.$setindex(element, this.guard(element.type, value)); |
7830 return value; | 7803 return value; |
7831 } | 7804 } |
7832 SsaBuilder.prototype.visitVariableDefinitions = function(node) { | 7805 SsaBuilder.prototype.visitVariableDefinitions = function(node) { |
7833 var $0; | 7806 var $0; |
7834 for (var link = node.definitions.get$nodes(); | 7807 for (var link = node.definitions.get$nodes(); |
7835 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$
Node())) { | 7808 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_
Node())) { |
7836 var definition = (($0 = link.get$head()) && $0.is$Node()); | 7809 var definition = (($0 = link.get$head()) && $0.is$Node()); |
7837 if ((definition instanceof Identifier)) { | 7810 if ((definition instanceof Identifier)) { |
7838 var initialValue = new HLiteral(null); | 7811 var initialValue = new HLiteral(null); |
7839 this.add(initialValue); | 7812 this.add(initialValue); |
7840 this.definitions.$setindex(this.elements.$index(definition), initialValue)
; | 7813 this.definitions.$setindex(this.elements.$index(definition), initialValue)
; |
7841 } | 7814 } |
7842 else { | 7815 else { |
7843 $assert((definition instanceof SendSet), "definition is SendSet", "builder
.dart", 538, 16); | 7816 $assert((definition instanceof SendSet), "definition is SendSet", "builder
.dart", 538, 16); |
7844 this.updateDefinition((definition && definition.is$SendSet())); | 7817 this.updateDefinition((definition && definition.is$SendSet())); |
7845 } | 7818 } |
(...skipping 13 matching lines...) Expand all Loading... |
7859 $inherits(SsaCodeGeneratorTask, CompilerTask); | 7832 $inherits(SsaCodeGeneratorTask, CompilerTask); |
7860 SsaCodeGeneratorTask.prototype.get$name = function() { | 7833 SsaCodeGeneratorTask.prototype.get$name = function() { |
7861 return 'SSA code generator'; | 7834 return 'SSA code generator'; |
7862 } | 7835 } |
7863 SsaCodeGeneratorTask.prototype.generate = function(function_, graph) { | 7836 SsaCodeGeneratorTask.prototype.generate = function(function_, graph) { |
7864 var $this = this; // closure support | 7837 var $this = this; // closure support |
7865 return $assert_String(this.measure((function () { | 7838 return $assert_String(this.measure((function () { |
7866 var $0; | 7839 var $0; |
7867 var parameterNames = new LinkedHashMapImplementation(); | 7840 var parameterNames = new LinkedHashMapImplementation(); |
7868 for (var link = function_.parameters; | 7841 for (var link = function_.parameters; |
7869 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Lin
k$Element())) { | 7842 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Lin
k_Element())) { |
7870 var element = (($0 = link.get$head()) && $0.is$Element()); | 7843 var element = (($0 = link.get$head()) && $0.is$Element()); |
7871 parameterNames.$setindex(element, JsNames.getValid(('' + element.name))); | 7844 parameterNames.$setindex(element, JsNames.getValid(('' + element.name))); |
7872 } | 7845 } |
7873 if (false/*null.GENERATE_SSA_TRACE*/) { | 7846 if (false/*null.GENERATE_SSA_TRACE*/) { |
7874 HTracer.HTracer$singleton$factory().traceGraph("codegen", graph); | 7847 HTracer.HTracer$singleton$factory().traceGraph("codegen", graph); |
7875 } | 7848 } |
7876 var code = $this.generateMethod(function_.name, parameterNames, graph); | 7849 var code = $this.generateMethod(function_.name, parameterNames, graph); |
7877 return code; | 7850 return code; |
7878 }) | 7851 }) |
7879 )); | 7852 )); |
7880 } | 7853 } |
7881 SsaCodeGeneratorTask.prototype.generateMethod = function(methodName, parameterNa
mes, graph) { | 7854 SsaCodeGeneratorTask.prototype.generateMethod = function(methodName, parameterNa
mes, graph) { |
7882 var $0; | 7855 var $0; |
7883 new SsaPhiEliminator().visitGraph(graph); | 7856 new SsaPhiEliminator().visitGraph(graph); |
7884 if (false/*null.GENERATE_SSA_TRACE*/) { | 7857 if (false/*null.GENERATE_SSA_TRACE*/) { |
7885 HTracer.HTracer$singleton$factory().traceGraph("no-phi", graph); | 7858 HTracer.HTracer$singleton$factory().traceGraph("no-phi", graph); |
7886 } | 7859 } |
7887 var buffer = new StringBufferImpl(""); | 7860 var buffer = new StringBufferImpl(""); |
7888 var codegen = new SsaCodeGenerator(this.compiler, buffer, parameterNames); | 7861 var codegen = new SsaCodeGenerator(this.compiler, buffer, parameterNames); |
7889 codegen.visitGraph(graph); | 7862 codegen.visitGraph(graph); |
7890 var parameters = new StringBufferImpl(""); | 7863 var parameters = new StringBufferImpl(""); |
7891 var names = (($0 = parameterNames.getValues()) && $0.is$List$String()); | 7864 var names = (($0 = parameterNames.getValues()) && $0.is$List_String()); |
7892 for (var i = 0; | 7865 for (var i = 0; |
7893 i < $assert_num(names.length); i++) { | 7866 i < $assert_num(names.length); i++) { |
7894 if (i != 0) parameters.add(', '); | 7867 if (i != 0) parameters.add(', '); |
7895 parameters.add(names.$index(i)); | 7868 parameters.add(names.$index(i)); |
7896 } | 7869 } |
7897 return ('function ' + methodName + '(' + parameters + ') {\n' + buffer + '}\n'
); | 7870 return ('function ' + methodName + '(' + parameters + ') {\n' + buffer + '}\n'
); |
7898 } | 7871 } |
7899 // ********** Code for SsaCodeGenerator ************** | 7872 // ********** Code for SsaCodeGenerator ************** |
7900 function SsaCodeGenerator(compiler, buffer, parameterNames) { | 7873 function SsaCodeGenerator(compiler, buffer, parameterNames) { |
7901 this.indent = 0 | 7874 this.indent = 0 |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8202 SsaCodeGenerator.prototype.visitThrow = function(node) { | 8175 SsaCodeGenerator.prototype.visitThrow = function(node) { |
8203 var $0; | 8176 var $0; |
8204 this.buffer.add('throw '); | 8177 this.buffer.add('throw '); |
8205 this.use((($0 = node.inputs.$index(0)) && $0.is$HInstruction())); | 8178 this.use((($0 = node.inputs.$index(0)) && $0.is$HInstruction())); |
8206 this.buffer.add(';\n'); | 8179 this.buffer.add(';\n'); |
8207 } | 8180 } |
8208 SsaCodeGenerator.prototype.visitTypeGuard = function(node) { | 8181 SsaCodeGenerator.prototype.visitTypeGuard = function(node) { |
8209 var $0; | 8182 var $0; |
8210 var name; | 8183 var name; |
8211 if ($notnull_bool(node.isNumber())) { | 8184 if ($notnull_bool(node.isNumber())) { |
8212 name = const$310/*const SourceString('guard\$num')*/; | 8185 name = const$306/*const SourceString('guard\$num')*/; |
8213 } | 8186 } |
8214 else { | 8187 else { |
8215 unreachable(); | 8188 unreachable(); |
8216 } | 8189 } |
8217 var element = this.compiler.universe.find(name); | 8190 var element = this.compiler.universe.find(name); |
8218 this.compiler.worklist.add(element); | 8191 this.compiler.worklist.add(element); |
8219 this.buffer.add(('' + name + '(')); | 8192 this.buffer.add(('' + name + '(')); |
8220 this.use((($0 = node.inputs.$index(0)) && $0.is$HInstruction())); | 8193 this.use((($0 = node.inputs.$index(0)) && $0.is$HInstruction())); |
8221 this.buffer.add(')'); | 8194 this.buffer.add(')'); |
8222 } | 8195 } |
(...skipping 15 matching lines...) Expand all Loading... |
8238 } | 8211 } |
8239 SsaCodeGenerator.prototype.visitLocal = function(node) { | 8212 SsaCodeGenerator.prototype.visitLocal = function(node) { |
8240 this.buffer.add(('var ' + this.local(node))); | 8213 this.buffer.add(('var ' + this.local(node))); |
8241 } | 8214 } |
8242 SsaCodeGenerator.prototype.visit$1 = SsaCodeGenerator.prototype.visit; | 8215 SsaCodeGenerator.prototype.visit$1 = SsaCodeGenerator.prototype.visit; |
8243 // ********** Code for JsNames ************** | 8216 // ********** Code for JsNames ************** |
8244 function JsNames() {} | 8217 function JsNames() {} |
8245 JsNames.get$reserved = function() { | 8218 JsNames.get$reserved = function() { |
8246 if ($globals.JsNames__reserved == null) { | 8219 if ($globals.JsNames__reserved == null) { |
8247 $globals.JsNames__reserved = new HashSetImplementation(); | 8220 $globals.JsNames__reserved = new HashSetImplementation(); |
8248 $globals.JsNames__reserved.addAll(const$304/*JsNames.reservedPropertySymbols
*/); | 8221 $globals.JsNames__reserved.addAll(const$300/*JsNames.reservedPropertySymbols
*/); |
8249 $globals.JsNames__reserved.addAll(const$306/*JsNames.reservedGlobalSymbols*/
); | 8222 $globals.JsNames__reserved.addAll(const$302/*JsNames.reservedGlobalSymbols*/
); |
8250 $globals.JsNames__reserved.addAll(const$308/*JsNames.javaScriptKeywords*/); | 8223 $globals.JsNames__reserved.addAll(const$304/*JsNames.javaScriptKeywords*/); |
8251 } | 8224 } |
8252 return $globals.JsNames__reserved; | 8225 return $globals.JsNames__reserved; |
8253 } | 8226 } |
8254 JsNames.getValid = function(name) { | 8227 JsNames.getValid = function(name) { |
8255 if (JsNames.get$reserved().contains(name)) { | 8228 if (JsNames.get$reserved().contains(name)) { |
8256 name = ('\$' + name); | 8229 name = ('\$' + name); |
8257 $assert(!JsNames.get$reserved().contains(name), "!reserved.contains(name)",
"js_names.dart", 171, 14); | 8230 $assert(!JsNames.get$reserved().contains(name), "!reserved.contains(name)",
"js_names.dart", 171, 14); |
8258 } | 8231 } |
8259 else if (name.contains("$")) { | 8232 else if (name.contains("$")) { |
8260 name = name.replaceAll("$", "_$"); | 8233 name = name.replaceAll("$", "_$"); |
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9512 } | 9485 } |
9513 HRelational.prototype.computeType = function() { | 9486 HRelational.prototype.computeType = function() { |
9514 return $notnull_bool(this.inputs.$index(0).isNumber$0()) ? 1/*HInstruction.TYP
E_BOOLEAN*/ : 0/*HInstruction.TYPE_UNKNOWN*/; | 9487 return $notnull_bool(this.inputs.$index(0).isNumber$0()) ? 1/*HInstruction.TYP
E_BOOLEAN*/ : 0/*HInstruction.TYPE_UNKNOWN*/; |
9515 } | 9488 } |
9516 HRelational.prototype.hasOnlyNumberInputs = function() { | 9489 HRelational.prototype.hasOnlyNumberInputs = function() { |
9517 return this.computeInputsType() == 2/*HInstruction.TYPE_NUMBER*/; | 9490 return this.computeInputsType() == 2/*HInstruction.TYPE_NUMBER*/; |
9518 } | 9491 } |
9519 // ********** Code for HEquals ************** | 9492 // ********** Code for HEquals ************** |
9520 function HEquals(element, inputs) { | 9493 function HEquals(element, inputs) { |
9521 // Initializers done | 9494 // Initializers done |
9522 HRelational.call(this, (element && element.is$Element()), (inputs && inputs.is
$List$HInstruction())); | 9495 HRelational.call(this, (element && element.is$Element()), (inputs && inputs.is
$List_HInstruction())); |
9523 } | 9496 } |
9524 $inherits(HEquals, HRelational); | 9497 $inherits(HEquals, HRelational); |
9525 HEquals.prototype.evaluate = function(a, b) { | 9498 HEquals.prototype.evaluate = function(a, b) { |
9526 return a == b; | 9499 return a == b; |
9527 } | 9500 } |
9528 HEquals.prototype.accept = function(visitor) { | 9501 HEquals.prototype.accept = function(visitor) { |
9529 return visitor.visitEquals(this); | 9502 return visitor.visitEquals(this); |
9530 } | 9503 } |
9531 HEquals.prototype.typeEquals = function(other) { | 9504 HEquals.prototype.typeEquals = function(other) { |
9532 return (other instanceof HEquals); | 9505 return (other instanceof HEquals); |
9533 } | 9506 } |
9534 HEquals.prototype.dataEquals = function(other) { | 9507 HEquals.prototype.dataEquals = function(other) { |
9535 return true; | 9508 return true; |
9536 } | 9509 } |
9537 HEquals.prototype.accept$1 = function($0) { | 9510 HEquals.prototype.accept$1 = function($0) { |
9538 return this.accept(($0 && $0.is$HVisitor())); | 9511 return this.accept(($0 && $0.is$HVisitor())); |
9539 }; | 9512 }; |
9540 HEquals.prototype.dataEquals$1 = function($0) { | 9513 HEquals.prototype.dataEquals$1 = function($0) { |
9541 return this.dataEquals(($0 && $0.is$HInstruction())); | 9514 return this.dataEquals(($0 && $0.is$HInstruction())); |
9542 }; | 9515 }; |
9543 // ********** Code for HGreater ************** | 9516 // ********** Code for HGreater ************** |
9544 function HGreater(element, inputs) { | 9517 function HGreater(element, inputs) { |
9545 // Initializers done | 9518 // Initializers done |
9546 HRelational.call(this, (element && element.is$Element()), (inputs && inputs.is
$List$HInstruction())); | 9519 HRelational.call(this, (element && element.is$Element()), (inputs && inputs.is
$List_HInstruction())); |
9547 } | 9520 } |
9548 $inherits(HGreater, HRelational); | 9521 $inherits(HGreater, HRelational); |
9549 HGreater.prototype.evaluate = function(a, b) { | 9522 HGreater.prototype.evaluate = function(a, b) { |
9550 return a > b; | 9523 return a > b; |
9551 } | 9524 } |
9552 HGreater.prototype.accept = function(visitor) { | 9525 HGreater.prototype.accept = function(visitor) { |
9553 return visitor.visitGreater(this); | 9526 return visitor.visitGreater(this); |
9554 } | 9527 } |
9555 HGreater.prototype.typeEquals = function(other) { | 9528 HGreater.prototype.typeEquals = function(other) { |
9556 return (other instanceof HGreater); | 9529 return (other instanceof HGreater); |
9557 } | 9530 } |
9558 HGreater.prototype.dataEquals = function(other) { | 9531 HGreater.prototype.dataEquals = function(other) { |
9559 return true; | 9532 return true; |
9560 } | 9533 } |
9561 HGreater.prototype.accept$1 = function($0) { | 9534 HGreater.prototype.accept$1 = function($0) { |
9562 return this.accept(($0 && $0.is$HVisitor())); | 9535 return this.accept(($0 && $0.is$HVisitor())); |
9563 }; | 9536 }; |
9564 HGreater.prototype.dataEquals$1 = function($0) { | 9537 HGreater.prototype.dataEquals$1 = function($0) { |
9565 return this.dataEquals(($0 && $0.is$HInstruction())); | 9538 return this.dataEquals(($0 && $0.is$HInstruction())); |
9566 }; | 9539 }; |
9567 // ********** Code for HGreaterEqual ************** | 9540 // ********** Code for HGreaterEqual ************** |
9568 function HGreaterEqual(element, inputs) { | 9541 function HGreaterEqual(element, inputs) { |
9569 // Initializers done | 9542 // Initializers done |
9570 HRelational.call(this, (element && element.is$Element()), (inputs && inputs.is
$List$HInstruction())); | 9543 HRelational.call(this, (element && element.is$Element()), (inputs && inputs.is
$List_HInstruction())); |
9571 } | 9544 } |
9572 $inherits(HGreaterEqual, HRelational); | 9545 $inherits(HGreaterEqual, HRelational); |
9573 HGreaterEqual.prototype.evaluate = function(a, b) { | 9546 HGreaterEqual.prototype.evaluate = function(a, b) { |
9574 return a >= b; | 9547 return a >= b; |
9575 } | 9548 } |
9576 HGreaterEqual.prototype.accept = function(visitor) { | 9549 HGreaterEqual.prototype.accept = function(visitor) { |
9577 return visitor.visitGreaterEqual(this); | 9550 return visitor.visitGreaterEqual(this); |
9578 } | 9551 } |
9579 HGreaterEqual.prototype.typeEquals = function(other) { | 9552 HGreaterEqual.prototype.typeEquals = function(other) { |
9580 return (other instanceof HGreaterEqual); | 9553 return (other instanceof HGreaterEqual); |
9581 } | 9554 } |
9582 HGreaterEqual.prototype.dataEquals = function(other) { | 9555 HGreaterEqual.prototype.dataEquals = function(other) { |
9583 return true; | 9556 return true; |
9584 } | 9557 } |
9585 HGreaterEqual.prototype.accept$1 = function($0) { | 9558 HGreaterEqual.prototype.accept$1 = function($0) { |
9586 return this.accept(($0 && $0.is$HVisitor())); | 9559 return this.accept(($0 && $0.is$HVisitor())); |
9587 }; | 9560 }; |
9588 HGreaterEqual.prototype.dataEquals$1 = function($0) { | 9561 HGreaterEqual.prototype.dataEquals$1 = function($0) { |
9589 return this.dataEquals(($0 && $0.is$HInstruction())); | 9562 return this.dataEquals(($0 && $0.is$HInstruction())); |
9590 }; | 9563 }; |
9591 // ********** Code for HLess ************** | 9564 // ********** Code for HLess ************** |
9592 function HLess(element, inputs) { | 9565 function HLess(element, inputs) { |
9593 // Initializers done | 9566 // Initializers done |
9594 HRelational.call(this, (element && element.is$Element()), (inputs && inputs.is
$List$HInstruction())); | 9567 HRelational.call(this, (element && element.is$Element()), (inputs && inputs.is
$List_HInstruction())); |
9595 } | 9568 } |
9596 $inherits(HLess, HRelational); | 9569 $inherits(HLess, HRelational); |
9597 HLess.prototype.evaluate = function(a, b) { | 9570 HLess.prototype.evaluate = function(a, b) { |
9598 return a < b; | 9571 return a < b; |
9599 } | 9572 } |
9600 HLess.prototype.accept = function(visitor) { | 9573 HLess.prototype.accept = function(visitor) { |
9601 return visitor.visitLess(this); | 9574 return visitor.visitLess(this); |
9602 } | 9575 } |
9603 HLess.prototype.typeEquals = function(other) { | 9576 HLess.prototype.typeEquals = function(other) { |
9604 return (other instanceof HLess); | 9577 return (other instanceof HLess); |
9605 } | 9578 } |
9606 HLess.prototype.dataEquals = function(other) { | 9579 HLess.prototype.dataEquals = function(other) { |
9607 return true; | 9580 return true; |
9608 } | 9581 } |
9609 HLess.prototype.accept$1 = function($0) { | 9582 HLess.prototype.accept$1 = function($0) { |
9610 return this.accept(($0 && $0.is$HVisitor())); | 9583 return this.accept(($0 && $0.is$HVisitor())); |
9611 }; | 9584 }; |
9612 HLess.prototype.dataEquals$1 = function($0) { | 9585 HLess.prototype.dataEquals$1 = function($0) { |
9613 return this.dataEquals(($0 && $0.is$HInstruction())); | 9586 return this.dataEquals(($0 && $0.is$HInstruction())); |
9614 }; | 9587 }; |
9615 // ********** Code for HLessEqual ************** | 9588 // ********** Code for HLessEqual ************** |
9616 function HLessEqual(element, inputs) { | 9589 function HLessEqual(element, inputs) { |
9617 // Initializers done | 9590 // Initializers done |
9618 HRelational.call(this, (element && element.is$Element()), (inputs && inputs.is
$List$HInstruction())); | 9591 HRelational.call(this, (element && element.is$Element()), (inputs && inputs.is
$List_HInstruction())); |
9619 } | 9592 } |
9620 $inherits(HLessEqual, HRelational); | 9593 $inherits(HLessEqual, HRelational); |
9621 HLessEqual.prototype.evaluate = function(a, b) { | 9594 HLessEqual.prototype.evaluate = function(a, b) { |
9622 return a <= b; | 9595 return a <= b; |
9623 } | 9596 } |
9624 HLessEqual.prototype.accept = function(visitor) { | 9597 HLessEqual.prototype.accept = function(visitor) { |
9625 return visitor.visitLessEqual(this); | 9598 return visitor.visitLessEqual(this); |
9626 } | 9599 } |
9627 HLessEqual.prototype.typeEquals = function(other) { | 9600 HLessEqual.prototype.typeEquals = function(other) { |
9628 return (other instanceof HLessEqual); | 9601 return (other instanceof HLessEqual); |
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10722 } | 10695 } |
10723 if (!$notnull_bool(f.call$2(current, count))) return false; | 10696 if (!$notnull_bool(f.call$2(current, count))) return false; |
10724 } | 10697 } |
10725 return true; | 10698 return true; |
10726 } | 10699 } |
10727 HValidator.prototype.visitInstruction = function(instruction) { | 10700 HValidator.prototype.visitInstruction = function(instruction) { |
10728 var $this = this; // closure support | 10701 var $this = this; // closure support |
10729 function hasCorrectInputs(instruction) { | 10702 function hasCorrectInputs(instruction) { |
10730 var $0; | 10703 var $0; |
10731 var inBasicBlock = $assert_bool(instruction.isInBasicBlock$0()); | 10704 var inBasicBlock = $assert_bool(instruction.isInBasicBlock$0()); |
10732 return HValidator.everyInstruction((($0 = instruction.get$inputs()) && $0.is
$List$HInstruction()), (function (input, count) { | 10705 return HValidator.everyInstruction((($0 = instruction.get$inputs()) && $0.is
$List_HInstruction()), (function (input, count) { |
10733 var $0; | 10706 var $0; |
10734 if ($notnull_bool(inBasicBlock)) { | 10707 if ($notnull_bool(inBasicBlock)) { |
10735 return HValidator.countInstruction((($0 = input.get$usedBy()) && $0.is$L
ist$HInstruction()), (instruction && instruction.is$HInstruction())) == count; | 10708 return HValidator.countInstruction((($0 = input.get$usedBy()) && $0.is$L
ist_HInstruction()), (instruction && instruction.is$HInstruction())) == count; |
10736 } | 10709 } |
10737 else { | 10710 else { |
10738 return HValidator.countInstruction((($0 = input.get$usedBy()) && $0.is$L
ist$HInstruction()), (instruction && instruction.is$HInstruction())) == 0; | 10711 return HValidator.countInstruction((($0 = input.get$usedBy()) && $0.is$L
ist_HInstruction()), (instruction && instruction.is$HInstruction())) == 0; |
10739 } | 10712 } |
10740 }) | 10713 }) |
10741 ); | 10714 ); |
10742 } | 10715 } |
10743 function hasCorrectUses(instruction) { | 10716 function hasCorrectUses(instruction) { |
10744 var $0; | 10717 var $0; |
10745 if (!$notnull_bool(instruction.isInBasicBlock$0())) return true; | 10718 if (!$notnull_bool(instruction.isInBasicBlock$0())) return true; |
10746 return HValidator.everyInstruction((($0 = instruction.get$usedBy()) && $0.is
$List$HInstruction()), (function (use, count) { | 10719 return HValidator.everyInstruction((($0 = instruction.get$usedBy()) && $0.is
$List_HInstruction()), (function (use, count) { |
10747 var $0; | 10720 var $0; |
10748 return HValidator.countInstruction((($0 = use.get$inputs()) && $0.is$List$
HInstruction()), (instruction && instruction.is$HInstruction())) == count; | 10721 return HValidator.countInstruction((($0 = use.get$inputs()) && $0.is$List_
HInstruction()), (instruction && instruction.is$HInstruction())) == count; |
10749 }) | 10722 }) |
10750 ); | 10723 ); |
10751 } | 10724 } |
10752 if (instruction.block !== this.currentBlock) { | 10725 if (instruction.block !== this.currentBlock) { |
10753 this.markInvalid("Instruction in wrong block"); | 10726 this.markInvalid("Instruction in wrong block"); |
10754 } | 10727 } |
10755 if (!$notnull_bool(hasCorrectInputs(instruction))) { | 10728 if (!$notnull_bool(hasCorrectInputs(instruction))) { |
10756 this.markInvalid("Incorrect inputs"); | 10729 this.markInvalid("Incorrect inputs"); |
10757 } | 10730 } |
10758 if (!$notnull_bool(hasCorrectUses(instruction))) { | 10731 if (!$notnull_bool(hasCorrectUses(instruction))) { |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10930 var $0; | 10903 var $0; |
10931 this.resolver.resolveType((($0 = this.parser.parse(element)) && $0.is$ClassNod
e())); | 10904 this.resolver.resolveType((($0 = this.parser.parse(element)) && $0.is$ClassNod
e())); |
10932 } | 10905 } |
10933 Compiler.prototype.resolveSignature = function(element) { | 10906 Compiler.prototype.resolveSignature = function(element) { |
10934 var $0; | 10907 var $0; |
10935 this.resolver.resolveSignature((($0 = this.parser.parse(element)) && $0.is$Fun
ctionExpression())); | 10908 this.resolver.resolveSignature((($0 = this.parser.parse(element)) && $0.is$Fun
ctionExpression())); |
10936 } | 10909 } |
10937 Compiler.prototype.getGeneratedCode = function() { | 10910 Compiler.prototype.getGeneratedCode = function() { |
10938 var $0; | 10911 var $0; |
10939 var buffer = new StringBufferImpl(""); | 10912 var buffer = new StringBufferImpl(""); |
10940 var codeBlocks = (($0 = this.universe.generatedCode.getValues()) && $0.is$List
$String()); | 10913 var codeBlocks = (($0 = this.universe.generatedCode.getValues()) && $0.is$List
_String()); |
10941 for (var i = codeBlocks.length - 1; | 10914 for (var i = codeBlocks.length - 1; |
10942 i >= 0; i--) { | 10915 i >= 0; i--) { |
10943 buffer.add(codeBlocks.$index(i)); | 10916 buffer.add(codeBlocks.$index(i)); |
10944 } | 10917 } |
10945 buffer.add('main();\n'); | 10918 buffer.add('main();\n'); |
10946 return buffer.toString(); | 10919 return buffer.toString(); |
10947 } | 10920 } |
10948 Compiler.prototype.reportWarning = function(node, message) { | 10921 Compiler.prototype.reportWarning = function(node, message) { |
10949 | 10922 |
10950 } | 10923 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10998 return (($0 = this.measure((function () { | 10971 return (($0 = this.measure((function () { |
10999 var visitor = new SignatureResolverVisitor($this.compiler); | 10972 var visitor = new SignatureResolverVisitor($this.compiler); |
11000 visitor.visit(tree); | 10973 visitor.visit(tree); |
11001 visitor = new FullResolverVisitor.from$ctor(visitor); | 10974 visitor = new FullResolverVisitor.from$ctor(visitor); |
11002 visitor.visit(tree.body); | 10975 visitor.visit(tree.body); |
11003 while (!$this.toResolve.isEmpty()) { | 10976 while (!$this.toResolve.isEmpty()) { |
11004 $this.toResolve.removeFirst().resolve$1($this.compiler); | 10977 $this.toResolve.removeFirst().resolve$1($this.compiler); |
11005 } | 10978 } |
11006 return visitor.mapping; | 10979 return visitor.mapping; |
11007 }) | 10980 }) |
11008 )) && $0.is$Map$Node$Element()); | 10981 )) && $0.is$Map_Node$Element()); |
11009 } | 10982 } |
11010 ResolverTask.prototype.resolveType = function(tree) { | 10983 ResolverTask.prototype.resolveType = function(tree) { |
11011 var $this = this; // closure support | 10984 var $this = this; // closure support |
11012 this.measure((function () { | 10985 this.measure((function () { |
11013 var visitor = new ClassResolverVisitor($this.compiler); | 10986 var visitor = new ClassResolverVisitor($this.compiler); |
11014 visitor.visit(tree); | 10987 visitor.visit(tree); |
11015 }) | 10988 }) |
11016 ); | 10989 ); |
11017 } | 10990 } |
11018 ResolverTask.prototype.resolveSignature = function(node) { | 10991 ResolverTask.prototype.resolveSignature = function(node) { |
(...skipping 16 matching lines...) Expand all Loading... |
11035 } | 11008 } |
11036 ResolverVisitor.from$ctor = function(other) { | 11009 ResolverVisitor.from$ctor = function(other) { |
11037 this.compiler = other.compiler; | 11010 this.compiler = other.compiler; |
11038 this.mapping = other.mapping; | 11011 this.mapping = other.mapping; |
11039 this.context = other.context; | 11012 this.context = other.context; |
11040 // Initializers done | 11013 // Initializers done |
11041 } | 11014 } |
11042 ResolverVisitor.from$ctor.prototype = ResolverVisitor.prototype; | 11015 ResolverVisitor.from$ctor.prototype = ResolverVisitor.prototype; |
11043 ResolverVisitor.prototype.is$Visitor = function(){return this;}; | 11016 ResolverVisitor.prototype.is$Visitor = function(){return this;}; |
11044 ResolverVisitor.prototype.error = function(node, kind, arguments) { | 11017 ResolverVisitor.prototype.error = function(node, kind, arguments) { |
11045 var error = new ResolutionError(kind, (arguments && arguments.is$List$Type()))
; | 11018 var error = new ResolutionError(kind, (arguments && arguments.is$List_Type()))
; |
11046 this.compiler.cancel(error.toString()); | 11019 this.compiler.cancel(error.toString()); |
11047 } | 11020 } |
11048 ResolverVisitor.prototype.warning = function(node, kind, arguments) { | 11021 ResolverVisitor.prototype.warning = function(node, kind, arguments) { |
11049 var warning = new ResolutionWarning(kind, (arguments && arguments.is$List$Type
())); | 11022 var warning = new ResolutionWarning(kind, (arguments && arguments.is$List_Type
())); |
11050 this.compiler.reportWarning(node, warning.toString()); | 11023 this.compiler.reportWarning(node, warning.toString()); |
11051 } | 11024 } |
11052 ResolverVisitor.prototype.cancel = function(node, message) { | 11025 ResolverVisitor.prototype.cancel = function(node, message) { |
11053 this.compiler.cancel(message); | 11026 this.compiler.cancel(message); |
11054 } | 11027 } |
11055 ResolverVisitor.prototype.visit = function(node) { | 11028 ResolverVisitor.prototype.visit = function(node) { |
11056 if (node == null) return null; | 11029 if (node == null) return null; |
11057 return node.accept(this); | 11030 return node.accept(this); |
11058 } | 11031 } |
11059 ResolverVisitor.prototype.visitIdentifier = function(node) { | 11032 ResolverVisitor.prototype.visitIdentifier = function(node) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11099 ResolverVisitor.call(this, compiler); | 11072 ResolverVisitor.call(this, compiler); |
11100 } | 11073 } |
11101 $inherits(SignatureResolverVisitor, ResolverVisitor); | 11074 $inherits(SignatureResolverVisitor, ResolverVisitor); |
11102 SignatureResolverVisitor.prototype.visitFunctionExpression = function(node) { | 11075 SignatureResolverVisitor.prototype.visitFunctionExpression = function(node) { |
11103 var $0; | 11076 var $0; |
11104 var enclosingElement = (($0 = this.visit(node.name)) && $0.is$FunctionElement(
)); | 11077 var enclosingElement = (($0 = this.visit(node.name)) && $0.is$FunctionElement(
)); |
11105 this.context = new Scope.enclosing$ctor(this.context, enclosingElement); | 11078 this.context = new Scope.enclosing$ctor(this.context, enclosingElement); |
11106 if (enclosingElement.parameters == null) { | 11079 if (enclosingElement.parameters == null) { |
11107 var visitor = new ParametersVisitor(this); | 11080 var visitor = new ParametersVisitor(this); |
11108 visitor.visit(node.parameters); | 11081 visitor.visit(node.parameters); |
11109 enclosingElement.parameters = (($0 = visitor.elements.toLink()) && $0.is$Lin
k$Element()); | 11082 enclosingElement.parameters = (($0 = visitor.elements.toLink()) && $0.is$Lin
k_Element()); |
11110 } | 11083 } |
11111 else { | 11084 else { |
11112 var parameterNodes = node.parameters.get$nodes(); | 11085 var parameterNodes = node.parameters.get$nodes(); |
11113 for (var link = enclosingElement.parameters; | 11086 for (var link = enclosingElement.parameters; |
11114 !$notnull_bool(link.isEmpty()) && !$notnull_bool(parameterNodes.isEmpty());
link = (($0 = link.get$tail()) && $0.is$Link$Element()), parameterNodes = (($0
= parameterNodes.get$tail()) && $0.is$Link$Node())) { | 11087 !$notnull_bool(link.isEmpty()) && !$notnull_bool(parameterNodes.isEmpty());
link = (($0 = link.get$tail()) && $0.is$Link_Element()), parameterNodes = (($0
= parameterNodes.get$tail()) && $0.is$Link_Node())) { |
11115 this.defineElement((($0 = parameterNodes.get$head().get$definitions().get$
nodes().get$head()) && $0.is$Node()), (($0 = link.get$head()) && $0.is$Element()
)); | 11088 this.defineElement((($0 = parameterNodes.get$head().get$definitions().get$
nodes().get$head()) && $0.is$Node()), (($0 = link.get$head()) && $0.is$Element()
)); |
11116 } | 11089 } |
11117 } | 11090 } |
11118 return enclosingElement; | 11091 return enclosingElement; |
11119 } | 11092 } |
11120 // ********** Code for FullResolverVisitor ************** | 11093 // ********** Code for FullResolverVisitor ************** |
11121 function FullResolverVisitor() {} | 11094 function FullResolverVisitor() {} |
11122 FullResolverVisitor.from$ctor = function(other) { | 11095 FullResolverVisitor.from$ctor = function(other) { |
11123 // Initializers done | 11096 // Initializers done |
11124 ResolverVisitor.from$ctor.call(this, other); | 11097 ResolverVisitor.from$ctor.call(this, other); |
(...skipping 23 matching lines...) Expand all Loading... |
11148 this.visitIn(node.update, scope); | 11121 this.visitIn(node.update, scope); |
11149 this.visitIn(node.body, scope); | 11122 this.visitIn(node.body, scope); |
11150 } | 11123 } |
11151 FullResolverVisitor.prototype.visitFunctionExpression = function(node) { | 11124 FullResolverVisitor.prototype.visitFunctionExpression = function(node) { |
11152 var $0; | 11125 var $0; |
11153 this.visit(node.returnType); | 11126 this.visit(node.returnType); |
11154 var enclosingElement = (($0 = this.visit(node.name)) && $0.is$FunctionElement(
)); | 11127 var enclosingElement = (($0 = this.visit(node.name)) && $0.is$FunctionElement(
)); |
11155 this.context = new Scope.enclosing$ctor(this.context, enclosingElement); | 11128 this.context = new Scope.enclosing$ctor(this.context, enclosingElement); |
11156 var visitor = new ParametersVisitor(this); | 11129 var visitor = new ParametersVisitor(this); |
11157 visitor.visit(node.parameters); | 11130 visitor.visit(node.parameters); |
11158 enclosingElement.parameters = (($0 = visitor.elements.toLink()) && $0.is$Link$
Element()); | 11131 enclosingElement.parameters = (($0 = visitor.elements.toLink()) && $0.is$Link_
Element()); |
11159 this.visit(node.body); | 11132 this.visit(node.body); |
11160 this.context = this.context.parent; | 11133 this.context = this.context.parent; |
11161 return enclosingElement; | 11134 return enclosingElement; |
11162 } | 11135 } |
11163 FullResolverVisitor.prototype.visitIf = function(node) { | 11136 FullResolverVisitor.prototype.visitIf = function(node) { |
11164 this.visit(node.condition); | 11137 this.visit(node.condition); |
11165 this.visit(node.thenPart); | 11138 this.visit(node.thenPart); |
11166 this.visit(node.elsePart); | 11139 this.visit(node.elsePart); |
11167 } | 11140 } |
11168 FullResolverVisitor.prototype.potentiallyMapOperatorToMethodName = function(name
) { | 11141 FullResolverVisitor.prototype.potentiallyMapOperatorToMethodName = function(name
) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11219 } | 11192 } |
11220 FullResolverVisitor.prototype.visitLiteralString = function(node) { | 11193 FullResolverVisitor.prototype.visitLiteralString = function(node) { |
11221 | 11194 |
11222 } | 11195 } |
11223 FullResolverVisitor.prototype.visitLiteralNull = function(node) { | 11196 FullResolverVisitor.prototype.visitLiteralNull = function(node) { |
11224 | 11197 |
11225 } | 11198 } |
11226 FullResolverVisitor.prototype.visitNodeList = function(node) { | 11199 FullResolverVisitor.prototype.visitNodeList = function(node) { |
11227 var $0; | 11200 var $0; |
11228 for (var link = node.get$nodes(); | 11201 for (var link = node.get$nodes(); |
11229 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$
Node())) { | 11202 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_
Node())) { |
11230 this.visit((($0 = link.get$head()) && $0.is$Node())); | 11203 this.visit((($0 = link.get$head()) && $0.is$Node())); |
11231 } | 11204 } |
11232 } | 11205 } |
11233 FullResolverVisitor.prototype.visitOperator = function(node) { | 11206 FullResolverVisitor.prototype.visitOperator = function(node) { |
11234 this.cancel(node, "Unimplemented"); | 11207 this.cancel(node, "Unimplemented"); |
11235 } | 11208 } |
11236 FullResolverVisitor.prototype.visitReturn = function(node) { | 11209 FullResolverVisitor.prototype.visitReturn = function(node) { |
11237 this.visit(node.expression); | 11210 this.visit(node.expression); |
11238 } | 11211 } |
11239 FullResolverVisitor.prototype.visitThrow = function(node) { | 11212 FullResolverVisitor.prototype.visitThrow = function(node) { |
11240 this.visit(node.expression); | 11213 this.visit(node.expression); |
11241 } | 11214 } |
11242 FullResolverVisitor.prototype.visitVariableDefinitions = function(node) { | 11215 FullResolverVisitor.prototype.visitVariableDefinitions = function(node) { |
11243 this.visit(node.type); | 11216 this.visit(node.type); |
11244 var visitor = new VariableDefinitionsVisitor(node, this, const$258/*ElementKin
d.VARIABLE*/); | 11217 var visitor = new VariableDefinitionsVisitor(node, this, const$258/*ElementKin
d.VARIABLE*/); |
11245 visitor.visit(node.definitions); | 11218 visitor.visit(node.definitions); |
11246 } | 11219 } |
11247 // ********** Code for ClassResolverVisitor ************** | 11220 // ********** Code for ClassResolverVisitor ************** |
11248 function ClassResolverVisitor(compiler) { | 11221 function ClassResolverVisitor(compiler) { |
11249 this.compiler = compiler; | 11222 this.compiler = compiler; |
11250 this.context = new TopScope(compiler.universe); | 11223 this.context = new TopScope(compiler.universe); |
11251 // Initializers done | 11224 // Initializers done |
11252 AbstractVisitor$Type.call(this); | 11225 AbstractVisitor_Type.call(this); |
11253 } | 11226 } |
11254 $inherits(ClassResolverVisitor, AbstractVisitor$Type); | 11227 $inherits(ClassResolverVisitor, AbstractVisitor_Type); |
11255 ClassResolverVisitor.prototype.visitClassNode = function(node) { | 11228 ClassResolverVisitor.prototype.visitClassNode = function(node) { |
11256 var $0; | 11229 var $0; |
11257 var element = (($0 = this.context.lookup(node.name.get$source())) && $0.is$Cla
ssElement()); | 11230 var element = (($0 = this.context.lookup(node.name.get$source())) && $0.is$Cla
ssElement()); |
11258 this.compiler.ensure(element != null); | 11231 this.compiler.ensure(element != null); |
11259 this.compiler.ensure(!$notnull_bool(element.isResolved)); | 11232 this.compiler.ensure(!$notnull_bool(element.isResolved)); |
11260 element.supertype = this.visit(node.superclass); | 11233 element.supertype = this.visit(node.superclass); |
11261 for (var link = node.interfaces.get$nodes(); | 11234 for (var link = node.interfaces.get$nodes(); |
11262 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$
Node())) { | 11235 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_
Node())) { |
11263 element.interfaces = (($0 = element.interfaces.prepend(this.visit((($0 = lin
k.get$head()) && $0.is$Node())))) && $0.is$Link$Type()); | 11236 element.interfaces = (($0 = element.interfaces.prepend(this.visit((($0 = lin
k.get$head()) && $0.is$Node())))) && $0.is$Link_Type()); |
11264 } | 11237 } |
11265 return element.computeType(this.compiler, null); | 11238 return element.computeType(this.compiler, null); |
11266 } | 11239 } |
11267 ClassResolverVisitor.prototype.visitTypeAnnotation = function(node) { | 11240 ClassResolverVisitor.prototype.visitTypeAnnotation = function(node) { |
11268 var $0; | 11241 var $0; |
11269 var name = node.typeName; | 11242 var name = node.typeName; |
11270 var element = this.context.lookup(name.get$source()); | 11243 var element = this.context.lookup(name.get$source()); |
11271 if (element == null) { | 11244 if (element == null) { |
11272 this.compiler.cancel(new ResolutionError(const$224/*MessageKind.CANNOT_RESOL
VE_TYPE*/, [name]).toString()); | 11245 this.compiler.cancel(new ResolutionError(const$224/*MessageKind.CANNOT_RESOL
VE_TYPE*/, [name]).toString()); |
11273 } | 11246 } |
(...skipping 16 matching lines...) Expand all Loading... |
11290 } | 11263 } |
11291 ClassResolverVisitor.prototype.visit$1 = function($0) { | 11264 ClassResolverVisitor.prototype.visit$1 = function($0) { |
11292 return this.visit(($0 && $0.is$Node())); | 11265 return this.visit(($0 && $0.is$Node())); |
11293 }; | 11266 }; |
11294 // ********** Code for VariableDefinitionsVisitor ************** | 11267 // ********** Code for VariableDefinitionsVisitor ************** |
11295 function VariableDefinitionsVisitor(definitions, resolver, kind) { | 11268 function VariableDefinitionsVisitor(definitions, resolver, kind) { |
11296 this.definitions = definitions; | 11269 this.definitions = definitions; |
11297 this.resolver = resolver; | 11270 this.resolver = resolver; |
11298 this.kind = kind; | 11271 this.kind = kind; |
11299 // Initializers done | 11272 // Initializers done |
11300 AbstractVisitor$SourceString.call(this); | 11273 AbstractVisitor_SourceString.call(this); |
11301 } | 11274 } |
11302 $inherits(VariableDefinitionsVisitor, AbstractVisitor$SourceString); | 11275 $inherits(VariableDefinitionsVisitor, AbstractVisitor_SourceString); |
11303 VariableDefinitionsVisitor.prototype.get$definitions = function() { return this.
definitions; }; | 11276 VariableDefinitionsVisitor.prototype.get$definitions = function() { return this.
definitions; }; |
11304 VariableDefinitionsVisitor.prototype.set$definitions = function(value) { return
this.definitions = value; }; | 11277 VariableDefinitionsVisitor.prototype.set$definitions = function(value) { return
this.definitions = value; }; |
11305 VariableDefinitionsVisitor.prototype.get$kind = function() { return this.kind; }
; | 11278 VariableDefinitionsVisitor.prototype.get$kind = function() { return this.kind; }
; |
11306 VariableDefinitionsVisitor.prototype.set$kind = function(value) { return this.ki
nd = value; }; | 11279 VariableDefinitionsVisitor.prototype.set$kind = function(value) { return this.ki
nd = value; }; |
11307 VariableDefinitionsVisitor.prototype.visitSendSet = function(node) { | 11280 VariableDefinitionsVisitor.prototype.visitSendSet = function(node) { |
11308 var $0; | 11281 var $0; |
11309 $assert(node.get$arguments().get$tail().isEmpty$0(), "node.arguments.tail.isEm
pty()", "resolver.dart", 355, 12); | 11282 $assert(node.get$arguments().get$tail().isEmpty$0(), "node.arguments.tail.isEm
pty()", "resolver.dart", 355, 12); |
11310 if (node.receiver != null) { | 11283 if (node.receiver != null) { |
11311 this.resolver.cancel(node, "receiver on a variable definition not implemente
d"); | 11284 this.resolver.cancel(node, "receiver on a variable definition not implemente
d"); |
11312 } | 11285 } |
11313 var selector = (($0 = node.selector) && $0.is$Identifier()); | 11286 var selector = (($0 = node.selector) && $0.is$Identifier()); |
11314 this.resolver.visit((($0 = node.get$arguments().get$head()) && $0.is$Node())); | 11287 this.resolver.visit((($0 = node.get$arguments().get$head()) && $0.is$Node())); |
11315 return (($0 = this.visit(node.selector)) && $0.is$SourceString()); | 11288 return (($0 = this.visit(node.selector)) && $0.is$SourceString()); |
11316 } | 11289 } |
11317 VariableDefinitionsVisitor.prototype.visitIdentifier = function(node) { | 11290 VariableDefinitionsVisitor.prototype.visitIdentifier = function(node) { |
11318 return node.get$source(); | 11291 return node.get$source(); |
11319 } | 11292 } |
11320 VariableDefinitionsVisitor.prototype.visitNodeList = function(node) { | 11293 VariableDefinitionsVisitor.prototype.visitNodeList = function(node) { |
11321 var $0; | 11294 var $0; |
11322 for (var link = node.get$nodes(); | 11295 for (var link = node.get$nodes(); |
11323 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$
Node())) { | 11296 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_
Node())) { |
11324 var name = (($0 = this.visit((($0 = link.get$head()) && $0.is$Node()))) && $
0.is$SourceString()); | 11297 var name = (($0 = this.visit((($0 = link.get$head()) && $0.is$Node()))) && $
0.is$SourceString()); |
11325 var element = new VariableElement((($0 = link.get$head()) && $0.is$Node()),
this.definitions.type, this.kind, name, this.resolver.context.enclosingElement); | 11298 var element = new VariableElement((($0 = link.get$head()) && $0.is$Node()),
this.definitions.type, this.kind, name, this.resolver.context.enclosingElement); |
11326 var existing = this.resolver.defineElement((($0 = link.get$head()) && $0.is$
Node()), element); | 11299 var existing = this.resolver.defineElement((($0 = link.get$head()) && $0.is$
Node()), element); |
11327 if ($ne(existing, element)) { | 11300 if ($ne(existing, element)) { |
11328 this.resolver.error(node, const$230/*MessageKind.DUPLICATE_DEFINITION*/, [
link.get$head()]); | 11301 this.resolver.error(node, const$230/*MessageKind.DUPLICATE_DEFINITION*/, [
link.get$head()]); |
11329 } | 11302 } |
11330 } | 11303 } |
11331 } | 11304 } |
11332 VariableDefinitionsVisitor.prototype.visit = function(node) { | 11305 VariableDefinitionsVisitor.prototype.visit = function(node) { |
11333 return node.accept(this); | 11306 return node.accept(this); |
11334 } | 11307 } |
11335 VariableDefinitionsVisitor.prototype.visit$1 = function($0) { | 11308 VariableDefinitionsVisitor.prototype.visit$1 = function($0) { |
11336 return this.visit(($0 && $0.is$Node())); | 11309 return this.visit(($0 && $0.is$Node())); |
11337 }; | 11310 }; |
11338 // ********** Code for ParametersVisitor ************** | 11311 // ********** Code for ParametersVisitor ************** |
11339 function ParametersVisitor(resolver) { | 11312 function ParametersVisitor(resolver) { |
11340 this.resolver = resolver; | 11313 this.resolver = resolver; |
11341 this.elements = new LinkBuilderImplementation(); | 11314 this.elements = new LinkBuilderImplementation(); |
11342 // Initializers done | 11315 // Initializers done |
11343 AbstractVisitor$Element.call(this); | 11316 AbstractVisitor_Element.call(this); |
11344 } | 11317 } |
11345 $inherits(ParametersVisitor, AbstractVisitor$Element); | 11318 $inherits(ParametersVisitor, AbstractVisitor_Element); |
11346 ParametersVisitor.prototype.visitNodeList = function(node) { | 11319 ParametersVisitor.prototype.visitNodeList = function(node) { |
11347 var $0; | 11320 var $0; |
11348 for (var link = node.get$nodes(); | 11321 for (var link = node.get$nodes(); |
11349 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$
Node())) { | 11322 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_
Node())) { |
11350 this.elements.addLast(this.visit((($0 = link.get$head()) && $0.is$Node()))); | 11323 this.elements.addLast(this.visit((($0 = link.get$head()) && $0.is$Node()))); |
11351 } | 11324 } |
11352 } | 11325 } |
11353 ParametersVisitor.prototype.visitVariableDefinitions = function(node) { | 11326 ParametersVisitor.prototype.visitVariableDefinitions = function(node) { |
11354 this.resolver.visit(node.type); | 11327 this.resolver.visit(node.type); |
11355 var visitor = new VariableDefinitionsVisitor(node, this.resolver, const$228/*E
lementKind.PARAMETER*/); | 11328 var visitor = new VariableDefinitionsVisitor(node, this.resolver, const$228/*E
lementKind.PARAMETER*/); |
11356 visitor.visit(node.definitions); | 11329 visitor.visit(node.definitions); |
11357 return this.resolver.mapping.$index(node.definitions.get$nodes().get$head()); | 11330 return this.resolver.mapping.$index(node.definitions.get$nodes().get$head()); |
11358 } | 11331 } |
11359 ParametersVisitor.prototype.visit = function(node) { | 11332 ParametersVisitor.prototype.visit = function(node) { |
(...skipping 15 matching lines...) Expand all Loading... |
11375 } | 11348 } |
11376 Scope.top$ctor.prototype = Scope.prototype; | 11349 Scope.top$ctor.prototype = Scope.prototype; |
11377 Scope.enclosing$ctor = function(parent, enclosingElement) { | 11350 Scope.enclosing$ctor = function(parent, enclosingElement) { |
11378 this.parent = parent; | 11351 this.parent = parent; |
11379 this.enclosingElement = enclosingElement; | 11352 this.enclosingElement = enclosingElement; |
11380 this.elements = $map([]); | 11353 this.elements = $map([]); |
11381 // Initializers done | 11354 // Initializers done |
11382 } | 11355 } |
11383 Scope.enclosing$ctor.prototype = Scope.prototype; | 11356 Scope.enclosing$ctor.prototype = Scope.prototype; |
11384 Scope.prototype.get$parent = function() { return this.parent; }; | 11357 Scope.prototype.get$parent = function() { return this.parent; }; |
| 11358 Scope.prototype.get$enclosingElement = function() { return this.enclosingElement
; }; |
11385 Scope.prototype.lookup = function(name) { | 11359 Scope.prototype.lookup = function(name) { |
11386 var $0; | 11360 var $0; |
11387 var element = (($0 = this.elements.$index(name)) && $0.is$Element()); | 11361 var element = (($0 = this.elements.$index(name)) && $0.is$Element()); |
11388 if (element != null) return element; | 11362 if (element != null) return element; |
11389 return this.parent.lookup(name); | 11363 return this.parent.lookup(name); |
11390 } | 11364 } |
11391 Scope.prototype.add = function(element) { | 11365 Scope.prototype.add = function(element) { |
11392 var $0; | 11366 var $0; |
11393 if (this.elements.containsKey(element.name)) return (($0 = this.elements.$inde
x(element.name)) && $0.is$Element()); | 11367 if (this.elements.containsKey(element.name)) return (($0 = this.elements.$inde
x(element.name)) && $0.is$Element()); |
11394 this.elements.$setindex(element.name, element); | 11368 this.elements.$setindex(element.name, element); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11547 message = ('' + message + ': ' + reason); | 11521 message = ('' + message + ': ' + reason); |
11548 } | 11522 } |
11549 $throw(new CancelTypeCheckException(node, message)); | 11523 $throw(new CancelTypeCheckException(node, message)); |
11550 } | 11524 } |
11551 TypeCheckerVisitor.prototype.reportTypeWarning = function(node, kind, arguments)
{ | 11525 TypeCheckerVisitor.prototype.reportTypeWarning = function(node, kind, arguments)
{ |
11552 this.compiler.reportWarning(node, new TypeWarning(kind, arguments).toString())
; | 11526 this.compiler.reportWarning(node, new TypeWarning(kind, arguments).toString())
; |
11553 } | 11527 } |
11554 TypeCheckerVisitor.prototype.nonVoidType = function(node) { | 11528 TypeCheckerVisitor.prototype.nonVoidType = function(node) { |
11555 var type = this.type(node); | 11529 var type = this.type(node); |
11556 if ($eq(type, this.types.voidType)) { | 11530 if ($eq(type, this.types.voidType)) { |
11557 this.reportTypeWarning(node, const$273/*MessageKind.VOID_EXPRESSION*/, const
$15/*const []*/); | 11531 this.reportTypeWarning(node, const$269/*MessageKind.VOID_EXPRESSION*/, const
$15/*const []*/); |
11558 } | 11532 } |
11559 return type; | 11533 return type; |
11560 } | 11534 } |
11561 TypeCheckerVisitor.prototype.typeWithDefault = function(node, defaultValue) { | 11535 TypeCheckerVisitor.prototype.typeWithDefault = function(node, defaultValue) { |
11562 return node != null ? this.type(node) : defaultValue; | 11536 return node != null ? this.type(node) : defaultValue; |
11563 } | 11537 } |
11564 TypeCheckerVisitor.prototype.type = function(node) { | 11538 TypeCheckerVisitor.prototype.type = function(node) { |
11565 var $0; | 11539 var $0; |
11566 if (node == null) this.fail(null, 'unexpected node: null'); | 11540 if (node == null) this.fail(null, 'unexpected node: null'); |
11567 var result = (($0 = node.accept(this)) && $0.is$Type()); | 11541 var result = (($0 = node.accept(this)) && $0.is$Type()); |
11568 return result; | 11542 return result; |
11569 } | 11543 } |
11570 TypeCheckerVisitor.prototype.get$type = function() { | 11544 TypeCheckerVisitor.prototype.get$type = function() { |
11571 return TypeCheckerVisitor.prototype.type.bind(this); | 11545 return TypeCheckerVisitor.prototype.type.bind(this); |
11572 } | 11546 } |
11573 TypeCheckerVisitor.prototype.checkAssignable = function(node, s, t) { | 11547 TypeCheckerVisitor.prototype.checkAssignable = function(node, s, t) { |
11574 if (!$notnull_bool(this.types.isAssignable(s, t))) { | 11548 if (!$notnull_bool(this.types.isAssignable(s, t))) { |
11575 this.reportTypeWarning(node, const$266/*MessageKind.NOT_ASSIGNABLE*/, [s, t]
); | 11549 this.reportTypeWarning(node, const$262/*MessageKind.NOT_ASSIGNABLE*/, [s, t]
); |
11576 } | 11550 } |
11577 } | 11551 } |
11578 TypeCheckerVisitor.prototype.visitBlock = function(node) { | 11552 TypeCheckerVisitor.prototype.visitBlock = function(node) { |
11579 this.type(node.statements); | 11553 this.type(node.statements); |
11580 return this.types.voidType; | 11554 return this.types.voidType; |
11581 } | 11555 } |
11582 TypeCheckerVisitor.prototype.visitClassNode = function(node) { | 11556 TypeCheckerVisitor.prototype.visitClassNode = function(node) { |
11583 this.fail(node); | 11557 this.fail(node); |
11584 } | 11558 } |
11585 TypeCheckerVisitor.prototype.visitExpressionStatement = function(node) { | 11559 TypeCheckerVisitor.prototype.visitExpressionStatement = function(node) { |
(...skipping 20 matching lines...) Expand all Loading... |
11606 this.type(node.thenPart); | 11580 this.type(node.thenPart); |
11607 if ($notnull_bool(node.get$hasElsePart())) this.type(node.elsePart); | 11581 if ($notnull_bool(node.get$hasElsePart())) this.type(node.elsePart); |
11608 return this.types.voidType; | 11582 return this.types.voidType; |
11609 } | 11583 } |
11610 TypeCheckerVisitor.prototype.visitSend = function(node) { | 11584 TypeCheckerVisitor.prototype.visitSend = function(node) { |
11611 var $0; | 11585 var $0; |
11612 var target = this.elements.$index(node); | 11586 var target = this.elements.$index(node); |
11613 var selector = (($0 = node.selector) && $0.is$Identifier()); | 11587 var selector = (($0 = node.selector) && $0.is$Identifier()); |
11614 if (target != null) { | 11588 if (target != null) { |
11615 var name = selector.get$source(); | 11589 var name = selector.get$source(); |
11616 if ($notnull_bool($eq(name, const$233/*const SourceString('+')*/)) || $notnu
ll_bool($eq(name, const$270/*const SourceString('=')*/)) || $notnull_bool($eq(na
me, const$235/*const SourceString('-')*/)) || $notnull_bool($eq(name, const$237/
*const SourceString('*')*/)) || $notnull_bool($eq(name, const$239/*const SourceS
tring('/')*/)) || $notnull_bool($eq(name, const$247/*const SourceString('<')*/))
|| $notnull_bool($eq(name, const$241/*const SourceString('~/')*/))) { | 11590 if ($notnull_bool($eq(name, const$233/*const SourceString('+')*/)) || $notnu
ll_bool($eq(name, const$266/*const SourceString('=')*/)) || $notnull_bool($eq(na
me, const$235/*const SourceString('-')*/)) || $notnull_bool($eq(name, const$237/
*const SourceString('*')*/)) || $notnull_bool($eq(name, const$239/*const SourceS
tring('/')*/)) || $notnull_bool($eq(name, const$247/*const SourceString('<')*/))
|| $notnull_bool($eq(name, const$241/*const SourceString('~/')*/))) { |
11617 return this.types.dynamicType; | 11591 return this.types.dynamicType; |
11618 } | 11592 } |
11619 var targetType = target.computeType$2(this.compiler, this.types); | 11593 var targetType = target.computeType$2(this.compiler, this.types); |
11620 if ($notnull_bool(node.get$isPropertyAccess())) { | 11594 if ($notnull_bool(node.get$isPropertyAccess())) { |
11621 return (targetType && targetType.is$Type()); | 11595 return (targetType && targetType.is$Type()); |
11622 } | 11596 } |
11623 else if ($notnull_bool(node.get$isFunctionObjectInvocation())) { | 11597 else if ($notnull_bool(node.get$isFunctionObjectInvocation())) { |
11624 this.fail(node); | 11598 this.fail(node); |
11625 } | 11599 } |
11626 else { | 11600 else { |
11627 if (!(targetType instanceof FunctionType)) { | 11601 if (!(targetType instanceof FunctionType)) { |
11628 if ((target instanceof ForeignElement)) { | 11602 if ((target instanceof ForeignElement)) { |
11629 return this.types.dynamicType; | 11603 return this.types.dynamicType; |
11630 } | 11604 } |
11631 this.fail(node, 'can only handle function types'); | 11605 this.fail(node, 'can only handle function types'); |
11632 } | 11606 } |
11633 var funType = (targetType && targetType.is$FunctionType()); | 11607 var funType = (targetType && targetType.is$FunctionType()); |
11634 var formals = funType.parameterTypes; | 11608 var formals = funType.parameterTypes; |
11635 var arguments = node.get$arguments(); | 11609 var arguments = node.get$arguments(); |
11636 while ((!$notnull_bool(formals.isEmpty())) && (!$notnull_bool(arguments.is
Empty()))) { | 11610 while ((!$notnull_bool(formals.isEmpty())) && (!$notnull_bool(arguments.is
Empty()))) { |
11637 var argument = (($0 = arguments.get$head()) && $0.is$Node()); | 11611 var argument = (($0 = arguments.get$head()) && $0.is$Node()); |
11638 var argumentType = this.type(argument); | 11612 var argumentType = this.type(argument); |
11639 this.checkAssignable(argument, argumentType, (($0 = formals.get$head())
&& $0.is$Type())); | 11613 this.checkAssignable(argument, argumentType, (($0 = formals.get$head())
&& $0.is$Type())); |
11640 formals = (($0 = formals.get$tail()) && $0.is$Link$Type()); | 11614 formals = (($0 = formals.get$tail()) && $0.is$Link_Type()); |
11641 arguments = (($0 = arguments.get$tail()) && $0.is$Link$Node()); | 11615 arguments = (($0 = arguments.get$tail()) && $0.is$Link_Node()); |
11642 } | 11616 } |
11643 if (!$notnull_bool(formals.isEmpty())) { | 11617 if (!$notnull_bool(formals.isEmpty())) { |
11644 this.compiler.reportWarning(node, 'missing argument'); | 11618 this.compiler.reportWarning(node, 'missing argument'); |
11645 } | 11619 } |
11646 if (!$notnull_bool(arguments.isEmpty())) { | 11620 if (!$notnull_bool(arguments.isEmpty())) { |
11647 this.compiler.reportWarning((($0 = arguments.get$head()) && $0.is$Node()
), 'additional arguments'); | 11621 this.compiler.reportWarning((($0 = arguments.get$head()) && $0.is$Node()
), 'additional arguments'); |
11648 } | 11622 } |
11649 return funType.returnType; | 11623 return funType.returnType; |
11650 } | 11624 } |
11651 } | 11625 } |
(...skipping 20 matching lines...) Expand all Loading... |
11672 } | 11646 } |
11673 TypeCheckerVisitor.prototype.visitLiteralString = function(node) { | 11647 TypeCheckerVisitor.prototype.visitLiteralString = function(node) { |
11674 return this.types.stringType; | 11648 return this.types.stringType; |
11675 } | 11649 } |
11676 TypeCheckerVisitor.prototype.visitLiteralNull = function(node) { | 11650 TypeCheckerVisitor.prototype.visitLiteralNull = function(node) { |
11677 return this.types.dynamicType; | 11651 return this.types.dynamicType; |
11678 } | 11652 } |
11679 TypeCheckerVisitor.prototype.visitNodeList = function(node) { | 11653 TypeCheckerVisitor.prototype.visitNodeList = function(node) { |
11680 var $0; | 11654 var $0; |
11681 for (var link = node.get$nodes(); | 11655 for (var link = node.get$nodes(); |
11682 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$
Node())) { | 11656 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_
Node())) { |
11683 this.type((($0 = link.get$head()) && $0.is$Node())); | 11657 this.type((($0 = link.get$head()) && $0.is$Node())); |
11684 } | 11658 } |
11685 return null; | 11659 return null; |
11686 } | 11660 } |
11687 TypeCheckerVisitor.prototype.visitOperator = function(node) { | 11661 TypeCheckerVisitor.prototype.visitOperator = function(node) { |
11688 return this.types.dynamicType; | 11662 return this.types.dynamicType; |
11689 } | 11663 } |
11690 TypeCheckerVisitor.prototype.visitReturn = function(node) { | 11664 TypeCheckerVisitor.prototype.visitReturn = function(node) { |
11691 var expression = node.expression; | 11665 var expression = node.expression; |
11692 var isVoidFunction = (this.expectedReturnType === this.types.voidType); | 11666 var isVoidFunction = (this.expectedReturnType === this.types.voidType); |
11693 if (expression != null) { | 11667 if (expression != null) { |
11694 var expressionType = this.type(expression); | 11668 var expressionType = this.type(expression); |
11695 if (isVoidFunction && !$notnull_bool(this.types.isAssignable(expressionType,
this.types.voidType))) { | 11669 if (isVoidFunction && !$notnull_bool(this.types.isAssignable(expressionType,
this.types.voidType))) { |
11696 this.reportTypeWarning(expression, const$264/*MessageKind.RETURN_VALUE_IN_
VOID*/, const$15/*const []*/); | 11670 this.reportTypeWarning(expression, const$260/*MessageKind.RETURN_VALUE_IN_
VOID*/, const$15/*const []*/); |
11697 } | 11671 } |
11698 else { | 11672 else { |
11699 this.checkAssignable(expression, expressionType, this.expectedReturnType); | 11673 this.checkAssignable(expression, expressionType, this.expectedReturnType); |
11700 } | 11674 } |
11701 } | 11675 } |
11702 else if (!$notnull_bool(this.types.isAssignable(this.expectedReturnType, this.
types.voidType))) { | 11676 else if (!$notnull_bool(this.types.isAssignable(this.expectedReturnType, this.
types.voidType))) { |
11703 this.reportTypeWarning(node, const$268/*MessageKind.RETURN_NOTHING*/, [this.
expectedReturnType]); | 11677 this.reportTypeWarning(node, const$264/*MessageKind.RETURN_NOTHING*/, [this.
expectedReturnType]); |
11704 } | 11678 } |
11705 return null; | 11679 return null; |
11706 } | 11680 } |
11707 TypeCheckerVisitor.prototype.visitThrow = function(node) { | 11681 TypeCheckerVisitor.prototype.visitThrow = function(node) { |
11708 if (node.expression != null) this.type(node.expression); | 11682 if (node.expression != null) this.type(node.expression); |
11709 return this.types.voidType; | 11683 return this.types.voidType; |
11710 } | 11684 } |
11711 TypeCheckerVisitor.prototype.visitTypeAnnotation = function(node) { | 11685 TypeCheckerVisitor.prototype.visitTypeAnnotation = function(node) { |
11712 if (node.typeName == null) return this.types.dynamicType; | 11686 if (node.typeName == null) return this.types.dynamicType; |
11713 var name = node.typeName.get$source(); | 11687 var name = node.typeName.get$source(); |
11714 var type = this.types.lookup(name); | 11688 var type = this.types.lookup(name); |
11715 if (type == null) this.fail(node, ('unsupported type ' + name)); | 11689 if (type == null) this.fail(node, ('unsupported type ' + name)); |
11716 return type; | 11690 return type; |
11717 } | 11691 } |
11718 TypeCheckerVisitor.prototype.visitVariableDefinitions = function(node) { | 11692 TypeCheckerVisitor.prototype.visitVariableDefinitions = function(node) { |
11719 var $0; | 11693 var $0; |
11720 var type = this.typeWithDefault(node.type, this.types.dynamicType); | 11694 var type = this.typeWithDefault(node.type, this.types.dynamicType); |
11721 if ($eq(type, this.types.voidType)) { | 11695 if ($eq(type, this.types.voidType)) { |
11722 this.reportTypeWarning(node.type, const$271/*MessageKind.VOID_VARIABLE*/, co
nst$15/*const []*/); | 11696 this.reportTypeWarning(node.type, const$267/*MessageKind.VOID_VARIABLE*/, co
nst$15/*const []*/); |
11723 type = this.types.dynamicType; | 11697 type = this.types.dynamicType; |
11724 } | 11698 } |
11725 for (var link = node.definitions.get$nodes(); | 11699 for (var link = node.definitions.get$nodes(); |
11726 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$
Node())) { | 11700 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link_
Node())) { |
11727 var initialization = (($0 = link.get$head()) && $0.is$Node()); | 11701 var initialization = (($0 = link.get$head()) && $0.is$Node()); |
11728 this.compiler.ensure((initialization instanceof Identifier) || (initializati
on instanceof Send)); | 11702 this.compiler.ensure((initialization instanceof Identifier) || (initializati
on instanceof Send)); |
11729 if ((initialization instanceof Send)) { | 11703 if ((initialization instanceof Send)) { |
11730 var initializer = this.nonVoidType((($0 = link.get$head()) && $0.is$Node()
)); | 11704 var initializer = this.nonVoidType((($0 = link.get$head()) && $0.is$Node()
)); |
11731 this.checkAssignable(node, type, initializer); | 11705 this.checkAssignable(node, type, initializer); |
11732 } | 11706 } |
11733 } | 11707 } |
11734 return null; | 11708 return null; |
11735 } | 11709 } |
11736 // ********** Code for Universe ************** | 11710 // ********** Code for Universe ************** |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11800 function ResolutionWarning(kind, arguments) { | 11774 function ResolutionWarning(kind, arguments) { |
11801 this.message = new Message(kind, arguments); | 11775 this.message = new Message(kind, arguments); |
11802 // Initializers done | 11776 // Initializers done |
11803 } | 11777 } |
11804 ResolutionWarning.prototype.toString = function() { | 11778 ResolutionWarning.prototype.toString = function() { |
11805 return this.message.toString(); | 11779 return this.message.toString(); |
11806 } | 11780 } |
11807 ResolutionWarning.prototype.toString$0 = ResolutionWarning.prototype.toString; | 11781 ResolutionWarning.prototype.toString$0 = ResolutionWarning.prototype.toString; |
11808 // ********** Code for top level ************** | 11782 // ********** Code for top level ************** |
11809 function unreachable() { | 11783 function unreachable() { |
11810 $throw(const$275/*const Exception("Internal Error (Leg): UNREACHABLE")*/); | 11784 $throw(const$271/*const Exception("Internal Error (Leg): UNREACHABLE")*/); |
11811 } | 11785 } |
11812 // ********** Library frog_leg ************** | 11786 // ********** Library frog_leg ************** |
11813 // ********** Code for WorldCompiler ************** | 11787 // ********** Code for WorldCompiler ************** |
11814 function WorldCompiler(world, script) { | 11788 function WorldCompiler(world, script) { |
11815 this.world = world; | 11789 this.world = world; |
11816 // Initializers done | 11790 // Initializers done |
11817 Compiler.call(this, script); | 11791 Compiler.call(this, script); |
11818 } | 11792 } |
11819 $inherits(WorldCompiler, Compiler); | 11793 $inherits(WorldCompiler, Compiler); |
11820 WorldCompiler.prototype.log = function(message) { | 11794 WorldCompiler.prototype.log = function(message) { |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12066 } | 12040 } |
12067 var $list = orderValuesByKeys(this._usedOperators); | 12041 var $list = orderValuesByKeys(this._usedOperators); |
12068 for (var $i = 0;$i < $list.length; $i++) { | 12042 for (var $i = 0;$i < $list.length; $i++) { |
12069 var opImpl = $list.$index($i); | 12043 var opImpl = $list.$index($i); |
12070 w.writeln($assert_String(opImpl)); | 12044 w.writeln($assert_String(opImpl)); |
12071 } | 12045 } |
12072 } | 12046 } |
12073 CoreJs.prototype.generate$1 = function($0) { | 12047 CoreJs.prototype.generate$1 = function($0) { |
12074 return this.generate(($0 && $0.is$CodeWriter())); | 12048 return this.generate(($0 && $0.is$CodeWriter())); |
12075 }; | 12049 }; |
| 12050 // ********** Code for lang_Element ************** |
| 12051 function lang_Element(name, _enclosingElement) { |
| 12052 this.name = name; |
| 12053 this._enclosingElement = _enclosingElement; |
| 12054 // Initializers done |
| 12055 this._jsname = this.name; |
| 12056 } |
| 12057 lang_Element.prototype.is$lang_Element = function(){return this;}; |
| 12058 lang_Element.prototype.get$name = function() { return this.name; }; |
| 12059 lang_Element.prototype.set$name = function(value) { return this.name = value; }; |
| 12060 lang_Element.prototype.get$library = function() { |
| 12061 return null; |
| 12062 } |
| 12063 lang_Element.prototype.get$span = function() { |
| 12064 return null; |
| 12065 } |
| 12066 lang_Element.prototype.get$isNative = function() { |
| 12067 return false; |
| 12068 } |
| 12069 lang_Element.prototype.hashCode = function() { |
| 12070 return this.name.hashCode(); |
| 12071 } |
| 12072 lang_Element.prototype.get$jsname = function() { |
| 12073 return this._jsname; |
| 12074 } |
| 12075 lang_Element.prototype.resolve = function() { |
| 12076 |
| 12077 } |
| 12078 lang_Element.prototype.get$typeParameters = function() { |
| 12079 return null; |
| 12080 } |
| 12081 lang_Element.prototype.get$enclosingElement = function() { |
| 12082 var $0; |
| 12083 return (($0 = this._enclosingElement == null ? this.get$library() : this._encl
osingElement) && $0.is$lang_Element()); |
| 12084 } |
| 12085 lang_Element.prototype.set$enclosingElement = function(e) { |
| 12086 return this._enclosingElement = e; |
| 12087 } |
| 12088 lang_Element.prototype.resolveType = function(node, typeErrors) { |
| 12089 var $0; |
| 12090 if (node == null) return $globals.world.varType; |
| 12091 if (node.type != null) return node.type; |
| 12092 if ((node instanceof NameTypeReference)) { |
| 12093 var typeRef = (node && node.is$NameTypeReference()); |
| 12094 var name; |
| 12095 if (typeRef.names != null) { |
| 12096 name = $assert_String(typeRef.names.last().get$name()); |
| 12097 } |
| 12098 else { |
| 12099 name = typeRef.name.name; |
| 12100 } |
| 12101 if (this.get$typeParameters() != null) { |
| 12102 var $list = this.get$typeParameters(); |
| 12103 for (var $i = 0;$i < $list.length; $i++) { |
| 12104 var tp = $list.$index($i); |
| 12105 if ($notnull_bool($eq(tp.get$name(), name))) { |
| 12106 typeRef.type = (tp && tp.is$lang_Type()); |
| 12107 } |
| 12108 } |
| 12109 } |
| 12110 if (typeRef.type != null) { |
| 12111 return typeRef.type; |
| 12112 } |
| 12113 return this.get$enclosingElement().resolveType(node, typeErrors); |
| 12114 } |
| 12115 else if ((node instanceof GenericTypeReference)) { |
| 12116 var typeRef = (node && node.is$GenericTypeReference()); |
| 12117 var baseType = this.resolveType(typeRef.baseType, typeErrors); |
| 12118 if (!$notnull_bool(baseType.get$isGeneric())) { |
| 12119 $globals.world.error(('' + baseType.get$name() + ' is not generic'), typeR
ef.span); |
| 12120 return null; |
| 12121 } |
| 12122 if (typeRef.typeArguments.length != baseType.get$typeParameters().length) { |
| 12123 $globals.world.error('wrong number of type arguments', typeRef.span); |
| 12124 return null; |
| 12125 } |
| 12126 var typeArgs = []; |
| 12127 for (var i = 0; |
| 12128 i < typeRef.typeArguments.length; i++) { |
| 12129 var extendsType = baseType.get$typeParameters().$index(i).get$extendsType(
); |
| 12130 var typeArg = this.resolveType((($0 = typeRef.typeArguments.$index(i)) &&
$0.is$TypeReference()), typeErrors); |
| 12131 typeArgs.add$1(typeArg); |
| 12132 if ($notnull_bool($ne(extendsType, null)) && !(typeArg instanceof Paramete
rType)) { |
| 12133 typeArg.ensureSubtypeOf$3(extendsType, typeRef.typeArguments.$index(i).g
et$span(), typeErrors); |
| 12134 } |
| 12135 } |
| 12136 typeRef.type = (($0 = baseType.getOrMakeConcreteType$1(typeArgs)) && $0.is$l
ang_Type()); |
| 12137 } |
| 12138 else if ((node instanceof FunctionTypeReference)) { |
| 12139 var typeRef = (node && node.is$FunctionTypeReference()); |
| 12140 var name = ''; |
| 12141 if (typeRef.func.name != null) { |
| 12142 name = typeRef.func.name.name; |
| 12143 } |
| 12144 typeRef.type = this.get$library().getOrAddFunctionType(this, $assert_String(
name), typeRef.func); |
| 12145 } |
| 12146 else { |
| 12147 $globals.world.internalError('unknown type reference', node.span); |
| 12148 } |
| 12149 return node.type; |
| 12150 } |
| 12151 lang_Element.prototype.hashCode$0 = lang_Element.prototype.hashCode; |
| 12152 lang_Element.prototype.resolve$0 = lang_Element.prototype.resolve; |
12076 // ********** Code for WorldGenerator ************** | 12153 // ********** Code for WorldGenerator ************** |
12077 function WorldGenerator(main, writer) { | 12154 function WorldGenerator(main, writer) { |
12078 this.hasStatics = false | 12155 this.hasStatics = false |
12079 this._inheritsGenerated = false | 12156 this._inheritsGenerated = false |
12080 this.main = main; | 12157 this.main = main; |
12081 this.writer = writer; | 12158 this.writer = writer; |
12082 this.globals = $map([]); | 12159 this.globals = $map([]); |
12083 this.corejs = new CoreJs(); | 12160 this.corejs = new CoreJs(); |
12084 // Initializers done | 12161 // Initializers done |
12085 } | 12162 } |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12222 this.writer.writeln(('' + onType.get$jsname() + '.prototype.is\$' + checkType.
get$jsname() + ' = ') + ('' + value + ';')); | 12299 this.writer.writeln(('' + onType.get$jsname() + '.prototype.is\$' + checkType.
get$jsname() + ' = ') + ('' + value + ';')); |
12223 } | 12300 } |
12224 WorldGenerator.prototype.writeType = function(type) { | 12301 WorldGenerator.prototype.writeType = function(type) { |
12225 var $0; | 12302 var $0; |
12226 if (type.name != null && (type instanceof ConcreteType) && $eq(type.get$librar
y(), $globals.world.get$coreimpl()) && type.name.startsWith('ListFactory')) { | 12303 if (type.name != null && (type instanceof ConcreteType) && $eq(type.get$librar
y(), $globals.world.get$coreimpl()) && type.name.startsWith('ListFactory')) { |
12227 this.writer.writeln(('' + type.get$jsname() + ' = ' + type.get$genericType()
.get$jsname() + ';')); | 12304 this.writer.writeln(('' + type.get$jsname() + ' = ' + type.get$genericType()
.get$jsname() + ';')); |
12228 return; | 12305 return; |
12229 } | 12306 } |
12230 var typeName = type.get$jsname() != null ? type.get$jsname() : 'top level'; | 12307 var typeName = type.get$jsname() != null ? type.get$jsname() : 'top level'; |
12231 this.writer.comment(('// ********** Code for ' + typeName + ' **************')
); | 12308 this.writer.comment(('// ********** Code for ' + typeName + ' **************')
); |
12232 if ($notnull_bool(type.get$isNativeType()) && !$notnull_bool(type.get$isTop())
) { | 12309 if ($notnull_bool(type.get$isNative()) && !$notnull_bool(type.get$isTop())) { |
12233 var nativeName = type.get$definition().get$nativeType().get$name(); | 12310 var nativeName = type.get$definition().get$nativeType().get$name(); |
12234 if ($notnull_bool($eq(nativeName, ''))) { | 12311 if ($notnull_bool($eq(nativeName, ''))) { |
12235 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); | 12312 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); |
12236 } | 12313 } |
12237 else if (type.get$jsname() != nativeName) { | 12314 else if (type.get$jsname() != nativeName) { |
12238 this.writer.writeln(('' + type.get$jsname() + ' = ' + nativeName + ';')); | 12315 this.writer.writeln(('' + type.get$jsname() + ' = ' + nativeName + ';')); |
12239 } | 12316 } |
12240 } | 12317 } |
12241 if ($notnull_bool(type.get$isTop())) { | 12318 if ($notnull_bool(type.get$isTop())) { |
12242 } | 12319 } |
12243 else if (type.get$constructors().get$length() == 0) { | 12320 else if (type.get$constructors().get$length() == 0) { |
12244 if (!$notnull_bool(type.get$isNativeType())) { | 12321 if (!$notnull_bool(type.get$isNative())) { |
12245 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); | 12322 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); |
12246 } | 12323 } |
12247 } | 12324 } |
12248 else { | 12325 else { |
12249 var standardConstructor = (($0 = type.get$constructors().$index('')) && $0.i
s$Member()); | 12326 var standardConstructor = (($0 = type.get$constructors().$index('')) && $0.i
s$Member()); |
12250 if (standardConstructor == null || standardConstructor.generator == null) { | 12327 if (standardConstructor == null || standardConstructor.generator == null) { |
12251 if (!$notnull_bool(type.get$isNativeType())) { | 12328 if (!$notnull_bool(type.get$isNative())) { |
12252 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); | 12329 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); |
12253 } | 12330 } |
12254 } | 12331 } |
12255 else { | 12332 else { |
12256 standardConstructor.generator.writeDefinition(this.writer, null); | 12333 standardConstructor.generator.writeDefinition(this.writer, null); |
12257 } | 12334 } |
12258 var $list = type.get$constructors().getValues(); | 12335 var $list = type.get$constructors().getValues(); |
12259 for (var $i = type.get$constructors().getValues().iterator$0(); $i.hasNext$0
(); ) { | 12336 for (var $i = type.get$constructors().getValues().iterator$0(); $i.hasNext$0
(); ) { |
12260 var c = $i.next$0(); | 12337 var c = $i.next$0(); |
12261 if ($notnull_bool($ne(c.get$generator(), null)) && $notnull_bool($ne(c, st
andardConstructor))) { | 12338 if ($notnull_bool($ne(c.get$generator(), null)) && $notnull_bool($ne(c, st
andardConstructor))) { |
12262 c.get$generator().writeDefinition$2(this.writer); | 12339 c.get$generator().writeDefinition$2(this.writer); |
12263 } | 12340 } |
12264 } | 12341 } |
12265 } | 12342 } |
12266 if (!$notnull_bool(type.get$isTop())) { | 12343 if (!$notnull_bool(type.get$isTop())) { |
12267 if ((type instanceof ConcreteType)) { | 12344 if ((type instanceof ConcreteType)) { |
12268 var c = (type && type.is$ConcreteType()); | 12345 var c = (type && type.is$ConcreteType()); |
12269 this._ensureInheritsHelper(); | 12346 this._ensureInheritsHelper(); |
12270 this.writer.writeln(('\$inherits(' + c.get$jsname() + ', ' + c.genericType
.get$jsname() + ');')); | 12347 this.writer.writeln(('\$inherits(' + c.get$jsname() + ', ' + c.genericType
.get$jsname() + ');')); |
12271 for (var p = c._parent; | 12348 for (var p = c._parent; |
12272 (p instanceof ConcreteType); p = p._parent) { | 12349 (p instanceof ConcreteType); p = p._parent) { |
12273 this._ensureInheritMembersHelper(); | 12350 this._ensureInheritMembersHelper(); |
12274 this._mixins.writeln(('\$inheritsMembers(' + c.get$jsname() + ', ' + p.g
et$jsname() + ');')); | 12351 this._mixins.writeln(('\$inheritsMembers(' + c.get$jsname() + ', ' + p.g
et$jsname() + ');')); |
12275 } | 12352 } |
12276 } | 12353 } |
12277 else if (!$notnull_bool(type.get$isNativeType())) { | 12354 else if (!$notnull_bool(type.get$isNative())) { |
12278 if (type.get$parent() != null && !$notnull_bool(type.get$parent().get$isOb
ject())) { | 12355 if (type.get$parent() != null && !$notnull_bool(type.get$parent().get$isOb
ject())) { |
12279 this._ensureInheritsHelper(); | 12356 this._ensureInheritsHelper(); |
12280 this.writer.writeln(('\$inherits(' + type.get$jsname() + ', ' + type.get
$parent().get$jsname() + ');')); | 12357 this.writer.writeln(('\$inherits(' + type.get$jsname() + ', ' + type.get
$parent().get$jsname() + ');')); |
12281 } | 12358 } |
12282 } | 12359 } |
12283 } | 12360 } |
12284 if (!(type instanceof ConcreteType)) { | 12361 if (!(type instanceof ConcreteType)) { |
12285 this._maybeIsTest(type, type); | 12362 this._maybeIsTest(type, type); |
12286 } | 12363 } |
12287 if (type.get$genericType()._concreteTypes != null) { | 12364 if (type.get$genericType()._concreteTypes != null) { |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12650 if (this.captures != null && this.captures.get$length() > 0) { | 12727 if (this.captures != null && this.captures.get$length() > 0) { |
12651 names = ListFactory.ListFactory$from$factory(this.captures); | 12728 names = ListFactory.ListFactory$from$factory(this.captures); |
12652 names.sort$1((function (x, y) { | 12729 names.sort$1((function (x, y) { |
12653 return x.compareTo$1(y); | 12730 return x.compareTo$1(y); |
12654 }) | 12731 }) |
12655 ); | 12732 ); |
12656 paramCode = ListFactory.ListFactory$from$factory((names && names.is$Iterable
())); | 12733 paramCode = ListFactory.ListFactory$from$factory((names && names.is$Iterable
())); |
12657 paramCode.addAll$1(this._paramCode); | 12734 paramCode.addAll$1(this._paramCode); |
12658 } | 12735 } |
12659 var _params = ('(' + Strings.join(this._paramCode, ", ") + ')'); | 12736 var _params = ('(' + Strings.join(this._paramCode, ", ") + ')'); |
12660 var params = ('(' + Strings.join((paramCode && paramCode.is$List$String()), ",
") + ')'); | 12737 var params = ('(' + Strings.join((paramCode && paramCode.is$List_String()), ",
") + ')'); |
12661 if ($notnull_bool(this.method.declaringType.get$isTop()) && !$notnull_bool(thi
s.get$isClosure())) { | 12738 if ($notnull_bool(this.method.declaringType.get$isTop()) && !$notnull_bool(thi
s.get$isClosure())) { |
12662 defWriter.enterBlock(('function ' + this.method.get$jsname() + params + ' {'
)); | 12739 defWriter.enterBlock(('function ' + this.method.get$jsname() + params + ' {'
)); |
12663 } | 12740 } |
12664 else if ($notnull_bool(this.get$isClosure())) { | 12741 else if ($notnull_bool(this.get$isClosure())) { |
12665 if (this.method.name == '') { | 12742 if (this.method.name == '') { |
12666 defWriter.enterBlock(('(function ' + params + ' {')); | 12743 defWriter.enterBlock(('(function ' + params + ' {')); |
12667 } | 12744 } |
12668 else if ($notnull_bool($ne(names, null))) { | 12745 else if ($notnull_bool($ne(names, null))) { |
12669 if (lambda == null) { | 12746 if (lambda == null) { |
12670 defWriter.enterBlock(('var ' + this.method.get$jsname() + ' = (function'
+ params + ' {')); | 12747 defWriter.enterBlock(('var ' + this.method.get$jsname() + ' = (function'
+ params + ' {')); |
(...skipping 30 matching lines...) Expand all Loading... |
12701 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da
rt", 803, 14); | 12778 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da
rt", 803, 14); |
12702 this._freeTemps.addAll(this._usedTemps); | 12779 this._freeTemps.addAll(this._usedTemps); |
12703 this._freeTemps.sort((function (x, y) { | 12780 this._freeTemps.sort((function (x, y) { |
12704 return x.compareTo$1(y); | 12781 return x.compareTo$1(y); |
12705 }) | 12782 }) |
12706 ); | 12783 ); |
12707 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';')); | 12784 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';')); |
12708 } | 12785 } |
12709 defWriter.writeln(this.writer.get$text()); | 12786 defWriter.writeln(this.writer.get$text()); |
12710 if ($notnull_bool($ne(names, null))) { | 12787 if ($notnull_bool($ne(names, null))) { |
12711 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List
$String()), ", ") + ')')); | 12788 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List
_String()), ", ") + ')')); |
12712 } | 12789 } |
12713 else if ($notnull_bool(this.get$isClosure()) && this.method.name == '') { | 12790 else if ($notnull_bool(this.get$isClosure()) && this.method.name == '') { |
12714 defWriter.exitBlock('})'); | 12791 defWriter.exitBlock('})'); |
12715 } | 12792 } |
12716 else { | 12793 else { |
12717 defWriter.exitBlock('}'); | 12794 defWriter.exitBlock('}'); |
12718 } | 12795 } |
12719 if ($notnull_bool(this.method.get$isConstructor()) && this.method.get$construc
torName() != '') { | 12796 if ($notnull_bool(this.method.get$isConstructor()) && this.method.get$construc
torName() != '') { |
12720 defWriter.writeln(('' + this.method.declaringType.get$jsname() + '.' + this.
method.get$constructorName() + '\$ctor.prototype = ') + ('' + this.method.declar
ingType.get$jsname() + '.prototype;')); | 12797 defWriter.writeln(('' + this.method.declaringType.get$jsname() + '.' + this.
method.get$constructorName() + '\$ctor.prototype = ') + ('' + this.method.declar
ingType.get$jsname() + '.prototype;')); |
12721 } | 12798 } |
(...skipping 30 matching lines...) Expand all Loading... |
12752 var start = ''; | 12829 var start = ''; |
12753 if ($notnull_bool(meth.isStatic)) { | 12830 if ($notnull_bool(meth.isStatic)) { |
12754 if (!$notnull_bool(meth.declaringType.get$isTop())) { | 12831 if (!$notnull_bool(meth.declaringType.get$isTop())) { |
12755 start = meth.declaringType.get$jsname() + '.'; | 12832 start = meth.declaringType.get$jsname() + '.'; |
12756 } | 12833 } |
12757 } | 12834 } |
12758 else { | 12835 else { |
12759 start = meth.declaringType.get$jsname() + '.prototype.'; | 12836 start = meth.declaringType.get$jsname() + '.prototype.'; |
12760 } | 12837 } |
12761 optNames.addAll$1(optValues); | 12838 optNames.addAll$1(optValues); |
12762 var optional = "['" + Strings.join((optNames && optNames.is$List$String(
)), "', '") + "']"; | 12839 var optional = "['" + Strings.join((optNames && optNames.is$List_String(
)), "', '") + "']"; |
12763 defWriter.writeln(('' + start + meth.get$jsname() + '.\$optional = ' + o
ptional)); | 12840 defWriter.writeln(('' + start + meth.get$jsname() + '.\$optional = ' + o
ptional)); |
12764 } | 12841 } |
12765 } | 12842 } |
12766 } | 12843 } |
12767 } | 12844 } |
12768 MethodGenerator.prototype.writeBody = function() { | 12845 MethodGenerator.prototype.writeBody = function() { |
12769 var $0; | 12846 var $0; |
12770 var initializers = null; | 12847 var initializers = null; |
12771 var initializedFields = null; | 12848 var initializedFields = null; |
12772 var allMembers = null; | 12849 var allMembers = null; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12958 } | 13035 } |
12959 MethodGenerator.prototype._pushBlock = function(reentrant) { | 13036 MethodGenerator.prototype._pushBlock = function(reentrant) { |
12960 this._scope = new BlockScope(this, this._scope, reentrant); | 13037 this._scope = new BlockScope(this, this._scope, reentrant); |
12961 } | 13038 } |
12962 MethodGenerator.prototype._popBlock = function() { | 13039 MethodGenerator.prototype._popBlock = function() { |
12963 this._scope = this._scope.parent; | 13040 this._scope = this._scope.parent; |
12964 } | 13041 } |
12965 MethodGenerator.prototype._makeLambdaMethod = function(name, func) { | 13042 MethodGenerator.prototype._makeLambdaMethod = function(name, func) { |
12966 var meth = new MethodMember(name, this.method.declaringType, func); | 13043 var meth = new MethodMember(name, this.method.declaringType, func); |
12967 meth.set$isLambda(true); | 13044 meth.set$isLambda(true); |
12968 meth.resolve$1(this.method.declaringType); | 13045 meth.set$enclosingElement(this.method); |
| 13046 meth.resolve$0(); |
12969 $globals.world.gen.genMethod((meth && meth.is$Member()), this); | 13047 $globals.world.gen.genMethod((meth && meth.is$Member()), this); |
12970 return (meth && meth.is$MethodMember()); | 13048 return (meth && meth.is$MethodMember()); |
12971 } | 13049 } |
12972 MethodGenerator.prototype.visitBool = function(node) { | 13050 MethodGenerator.prototype.visitBool = function(node) { |
12973 return this.visitValue(node).convertTo$3(this, $globals.world.nonNullBool, nod
e); | 13051 return this.visitValue(node).convertTo$3(this, $globals.world.nonNullBool, nod
e); |
12974 } | 13052 } |
12975 MethodGenerator.prototype.visitValue = function(node) { | 13053 MethodGenerator.prototype.visitValue = function(node) { |
12976 if (node == null) return null; | 13054 if (node == null) return null; |
12977 var value = node.visit(this); | 13055 var value = node.visit(this); |
12978 value.checkFirstClass$1(node.span); | 13056 value.checkFirstClass$1(node.span); |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13764 } | 13842 } |
13765 else { | 13843 else { |
13766 argsCode.add$1(arg.get$canonicalCode()); | 13844 argsCode.add$1(arg.get$canonicalCode()); |
13767 } | 13845 } |
13768 } | 13846 } |
13769 else { | 13847 else { |
13770 argsCode.add$1(arg.get$code()); | 13848 argsCode.add$1(arg.get$code()); |
13771 } | 13849 } |
13772 } | 13850 } |
13773 $globals.world.get$coreimpl().types.$index('ListFactory').markUsed$0(); | 13851 $globals.world.get$coreimpl().types.$index('ListFactory').markUsed$0(); |
13774 var code = ('[' + Strings.join((argsCode && argsCode.is$List$String()), ", ")
+ ']'); | 13852 var code = ('[' + Strings.join((argsCode && argsCode.is$List_String()), ", ")
+ ']'); |
13775 var value = new Value($globals.world.listType, code, node.span, true); | 13853 var value = new Value($globals.world.listType, code, node.span, true); |
13776 if ($notnull_bool(node.isConst)) { | 13854 if ($notnull_bool(node.isConst)) { |
13777 var immutableList = $globals.world.get$coreimpl().types.$index('ImmutableLis
t'); | 13855 var immutableList = $globals.world.get$coreimpl().types.$index('ImmutableLis
t'); |
13778 var immutableListCtor = immutableList.getConstructor$1('from'); | 13856 var immutableListCtor = immutableList.getConstructor$1('from'); |
13779 var result = immutableListCtor.invoke$4(this, node, new Value.type$ctor(valu
e.get$type(), node.span), new Arguments(null, [value])); | 13857 var result = immutableListCtor.invoke$4(this, node, new Value.type$ctor(valu
e.get$type(), node.span), new Arguments(null, [value])); |
13780 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())); | 13858 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())); |
13781 } | 13859 } |
13782 return value; | 13860 return value; |
13783 } | 13861 } |
13784 MethodGenerator.prototype.visitMapExpression = function(node) { | 13862 MethodGenerator.prototype.visitMapExpression = function(node) { |
13785 var $0; | 13863 var $0; |
13786 var mapImplType = $globals.world.gen.useMapFactory(); | 13864 var mapImplType = $globals.world.gen.useMapFactory(); |
13787 var argValues = []; | 13865 var argValues = []; |
13788 var argsCode = []; | 13866 var argsCode = []; |
13789 for (var i = 0; | 13867 for (var i = 0; |
13790 i < node.items.length; i += 2) { | 13868 i < node.items.length; i += 2) { |
(...skipping 11 matching lines...) Expand all Loading... |
13802 else { | 13880 else { |
13803 argsCode.add$1(key.get$canonicalCode()); | 13881 argsCode.add$1(key.get$canonicalCode()); |
13804 argsCode.add$1(value.get$canonicalCode()); | 13882 argsCode.add$1(value.get$canonicalCode()); |
13805 } | 13883 } |
13806 } | 13884 } |
13807 else { | 13885 else { |
13808 argsCode.add$1(key.get$code()); | 13886 argsCode.add$1(key.get$code()); |
13809 argsCode.add$1(value.get$code()); | 13887 argsCode.add$1(value.get$code()); |
13810 } | 13888 } |
13811 } | 13889 } |
13812 var argList = ('[' + Strings.join((argsCode && argsCode.is$List$String()), ",
") + ']'); | 13890 var argList = ('[' + Strings.join((argsCode && argsCode.is$List_String()), ",
") + ']'); |
13813 var code = ('\$map(' + argList + ')'); | 13891 var code = ('\$map(' + argList + ')'); |
13814 if ($notnull_bool(node.isConst)) { | 13892 if ($notnull_bool(node.isConst)) { |
13815 var immutableMap = $globals.world.get$coreimpl().types.$index('ImmutableMap'
); | 13893 var immutableMap = $globals.world.get$coreimpl().types.$index('ImmutableMap'
); |
13816 var immutableMapCtor = immutableMap.getConstructor$1(''); | 13894 var immutableMapCtor = immutableMap.getConstructor$1(''); |
13817 var argsValue = new Value($globals.world.listType, argList, node.span, true)
; | 13895 var argsValue = new Value($globals.world.listType, argList, node.span, true)
; |
13818 var result = immutableMapCtor.invoke$4(this, node, new Value.type$ctor(immut
ableMap, node.span), new Arguments(null, [argsValue])); | 13896 var result = immutableMapCtor.invoke$4(this, node, new Value.type$ctor(immut
ableMap, node.span), new Arguments(null, [argsValue])); |
13819 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); | 13897 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); |
13820 return $globals.world.gen.globalForConst(value, (argValues && argValues.is$L
ist$Value())); | 13898 return $globals.world.gen.globalForConst(value, (argValues && argValues.is$L
ist_Value())); |
13821 } | 13899 } |
13822 return new Value(mapImplType, code, node.span, true); | 13900 return new Value(mapImplType, code, node.span, true); |
13823 } | 13901 } |
13824 MethodGenerator.prototype.visitConditionalExpression = function(node) { | 13902 MethodGenerator.prototype.visitConditionalExpression = function(node) { |
13825 var $0; | 13903 var $0; |
13826 var test = this.visitBool(node.test); | 13904 var test = this.visitBool(node.test); |
13827 var trueBranch = this.visitValue(node.trueBranch); | 13905 var trueBranch = this.visitValue(node.trueBranch); |
13828 var falseBranch = this.visitValue(node.falseBranch); | 13906 var falseBranch = this.visitValue(node.falseBranch); |
13829 var code = ('' + test.get$code() + ' ? ' + trueBranch.get$code() + ' : ' + fal
seBranch.get$code()); | 13907 var code = ('' + test.get$code() + ' ? ' + trueBranch.get$code() + ' : ' + fal
seBranch.get$code()); |
13830 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); | 13908 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13873 var u = (item && item.is$UnaryExpression()); | 13951 var u = (item && item.is$UnaryExpression()); |
13874 return u.op.kind == 16/*TokenKind.INCR*/ || u.op.kind == 17/*TokenKind.DECR*
/; | 13952 return u.op.kind == 16/*TokenKind.INCR*/ || u.op.kind == 17/*TokenKind.DECR*
/; |
13875 } | 13953 } |
13876 else { | 13954 else { |
13877 return false; | 13955 return false; |
13878 } | 13956 } |
13879 } | 13957 } |
13880 MethodGenerator.prototype.visitLiteralExpression = function(node) { | 13958 MethodGenerator.prototype.visitLiteralExpression = function(node) { |
13881 var $0; | 13959 var $0; |
13882 var type = node.type.type; | 13960 var type = node.type.type; |
13883 $assert($ne(type, null), "type != null", "gen.dart", 2238, 12); | 13961 $assert($ne(type, null), "type != null", "gen.dart", 2239, 12); |
13884 if (!!(($0 = node.value) && $0.is$List)) { | 13962 if (!!(($0 = node.value) && $0.is$List)) { |
13885 var items = []; | 13963 var items = []; |
13886 var $list = node.value; | 13964 var $list = node.value; |
13887 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) { | 13965 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) { |
13888 var item = $i.next$0(); | 13966 var item = $i.next$0(); |
13889 var val = this.visitValue((item && item.is$lang_Expression())); | 13967 var val = this.visitValue((item && item.is$lang_Expression())); |
13890 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY()); | 13968 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY()); |
13891 var code = val.get$code(); | 13969 var code = val.get$code(); |
13892 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr
ession) || (item instanceof PostfixExpression) || $notnull_bool(this._isUnaryInc
rement((item && item.is$lang_Expression())))) { | 13970 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr
ession) || (item instanceof PostfixExpression) || $notnull_bool(this._isUnaryInc
rement((item && item.is$lang_Expression())))) { |
13893 code = ('(' + code + ')'); | 13971 code = ('(' + code + ')'); |
13894 } | 13972 } |
13895 if ($notnull_bool($eq(items.length, 0)) || ($notnull_bool($ne(code, "''"))
&& $notnull_bool($ne(code, '""')))) { | 13973 if ($notnull_bool($eq(items.length, 0)) || ($notnull_bool($ne(code, "''"))
&& $notnull_bool($ne(code, '""')))) { |
13896 items.add$1(code); | 13974 items.add$1(code); |
13897 } | 13975 } |
13898 } | 13976 } |
13899 return new Value(type, ('(' + Strings.join((items && items.is$List$String())
, " + ") + ')'), node.span, true); | 13977 return new Value(type, ('(' + Strings.join((items && items.is$List_String())
, " + ") + ')'), node.span, true); |
13900 } | 13978 } |
13901 var text = node.text; | 13979 var text = node.text; |
13902 if ($notnull_bool(type.get$isString())) { | 13980 if ($notnull_bool(type.get$isString())) { |
13903 if ($notnull_bool(text.startsWith$1('@'))) { | 13981 if ($notnull_bool(text.startsWith$1('@'))) { |
13904 text = MethodGenerator._escapeString(parseStringLiteral($assert_String(tex
t))); | 13982 text = MethodGenerator._escapeString(parseStringLiteral($assert_String(tex
t))); |
13905 text = ('"' + text + '"'); | 13983 text = ('"' + text + '"'); |
13906 } | 13984 } |
13907 else if ($notnull_bool(isMultilineString($assert_String(text)))) { | 13985 else if ($notnull_bool(isMultilineString($assert_String(text)))) { |
13908 text = parseStringLiteral($assert_String(text)); | 13986 text = parseStringLiteral($assert_String(text)); |
13909 text = text.replaceAll$2('\n', '\\n'); | 13987 text = text.replaceAll$2('\n', '\\n'); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13991 } | 14069 } |
13992 } | 14070 } |
13993 return this._bareCount; | 14071 return this._bareCount; |
13994 } | 14072 } |
13995 Arguments.prototype.getCode = function() { | 14073 Arguments.prototype.getCode = function() { |
13996 var argsCode = []; | 14074 var argsCode = []; |
13997 for (var i = 0; | 14075 for (var i = 0; |
13998 i < this.get$length(); i++) { | 14076 i < this.get$length(); i++) { |
13999 argsCode.add$1(this.values.$index(i).get$code()); | 14077 argsCode.add$1(this.values.$index(i).get$code()); |
14000 } | 14078 } |
14001 Arguments.removeTrailingNulls((argsCode && argsCode.is$List$Value())); | 14079 Arguments.removeTrailingNulls((argsCode && argsCode.is$List_Value())); |
14002 return Strings.join((argsCode && argsCode.is$List$String()), ", "); | 14080 return Strings.join((argsCode && argsCode.is$List_String()), ", "); |
14003 } | 14081 } |
14004 Arguments.removeTrailingNulls = function(argsCode) { | 14082 Arguments.removeTrailingNulls = function(argsCode) { |
14005 while (argsCode.length > 0 && $notnull_bool($eq(argsCode.last(), 'null'))) { | 14083 while (argsCode.length > 0 && $notnull_bool($eq(argsCode.last(), 'null'))) { |
14006 argsCode.removeLast(); | 14084 argsCode.removeLast(); |
14007 } | 14085 } |
14008 } | 14086 } |
14009 Arguments.prototype.getNames = function() { | 14087 Arguments.prototype.getNames = function() { |
14010 var names = []; | 14088 var names = []; |
14011 for (var i = this.get$bareCount(); | 14089 for (var i = this.get$bareCount(); |
14012 i < this.get$length(); i++) { | 14090 i < this.get$length(); i++) { |
14013 names.add$1(this.getName(i)); | 14091 names.add$1(this.getName(i)); |
14014 } | 14092 } |
14015 return (names && names.is$List$String()); | 14093 return (names && names.is$List_String()); |
14016 } | 14094 } |
14017 Arguments.prototype.toCallStubArgs = function() { | 14095 Arguments.prototype.toCallStubArgs = function() { |
14018 var result = []; | 14096 var result = []; |
14019 for (var i = 0; | 14097 for (var i = 0; |
14020 i < this.get$bareCount(); i++) { | 14098 i < this.get$bareCount(); i++) { |
14021 result.add$1(new Value($globals.world.varType, ('\$' + i), null, false)); | 14099 result.add$1(new Value($globals.world.varType, ('\$' + i), null, false)); |
14022 } | 14100 } |
14023 for (var i = this.get$bareCount(); | 14101 for (var i = this.get$bareCount(); |
14024 i < this.get$length(); i++) { | 14102 i < this.get$length(); i++) { |
14025 var name = this.getName(i); | 14103 var name = this.getName(i); |
(...skipping 11 matching lines...) Expand all Loading... |
14037 LibraryImport.prototype.get$prefix = function() { return this.prefix; }; | 14115 LibraryImport.prototype.get$prefix = function() { return this.prefix; }; |
14038 LibraryImport.prototype.set$prefix = function(value) { return this.prefix = valu
e; }; | 14116 LibraryImport.prototype.set$prefix = function(value) { return this.prefix = valu
e; }; |
14039 LibraryImport.prototype.get$library = function() { return this.library; }; | 14117 LibraryImport.prototype.get$library = function() { return this.library; }; |
14040 LibraryImport.prototype.set$library = function(value) { return this.library = va
lue; }; | 14118 LibraryImport.prototype.set$library = function(value) { return this.library = va
lue; }; |
14041 // ********** Code for Library ************** | 14119 // ********** Code for Library ************** |
14042 function Library(baseSource) { | 14120 function Library(baseSource) { |
14043 this.isWritten = false | 14121 this.isWritten = false |
14044 this.isMarked = false | 14122 this.isMarked = false |
14045 this.baseSource = baseSource; | 14123 this.baseSource = baseSource; |
14046 // Initializers done | 14124 // Initializers done |
| 14125 lang_Element.call(this, null, null); |
14047 this.sourceDir = dirname(this.baseSource.filename); | 14126 this.sourceDir = dirname(this.baseSource.filename); |
14048 this.topType = new DefinedType(null, this, null, true); | 14127 this.topType = new DefinedType(null, this, null, true); |
14049 this.types = $map(['', this.topType]); | 14128 this.types = $map(['', this.topType]); |
14050 this.imports = []; | 14129 this.imports = []; |
14051 this.natives = []; | 14130 this.natives = []; |
14052 this.sources = []; | 14131 this.sources = []; |
14053 this._privateMembers = $map([]); | 14132 this._privateMembers = $map([]); |
14054 } | 14133 } |
| 14134 $inherits(Library, lang_Element); |
14055 Library.prototype.is$Library = function(){return this;}; | 14135 Library.prototype.is$Library = function(){return this;}; |
14056 Library.prototype.get$baseSource = function() { return this.baseSource; }; | 14136 Library.prototype.get$baseSource = function() { return this.baseSource; }; |
14057 Library.prototype.get$types = function() { return this.types; }; | 14137 Library.prototype.get$types = function() { return this.types; }; |
14058 Library.prototype.set$types = function(value) { return this.types = value; }; | 14138 Library.prototype.set$types = function(value) { return this.types = value; }; |
14059 Library.prototype.get$name = function() { return this.name; }; | |
14060 Library.prototype.set$name = function(value) { return this.name = value; }; | |
14061 Library.prototype.get$topType = function() { return this.topType; }; | 14139 Library.prototype.get$topType = function() { return this.topType; }; |
14062 Library.prototype.set$topType = function(value) { return this.topType = value; }
; | 14140 Library.prototype.set$topType = function(value) { return this.topType = value; }
; |
| 14141 Library.prototype.get$enclosingElement = function() { |
| 14142 return null; |
| 14143 } |
| 14144 Library.prototype.get$library = function() { |
| 14145 return this; |
| 14146 } |
| 14147 Library.prototype.get$isNative = function() { |
| 14148 return this.topType.isNative; |
| 14149 } |
14063 Library.prototype.get$isCore = function() { | 14150 Library.prototype.get$isCore = function() { |
14064 return $eq(this, $globals.world.corelib); | 14151 return $eq(this, $globals.world.corelib); |
14065 } | 14152 } |
14066 Library.prototype.get$isCoreImpl = function() { | 14153 Library.prototype.get$isCoreImpl = function() { |
14067 return $eq(this, $globals.world.get$coreimpl()); | 14154 return $eq(this, $globals.world.get$coreimpl()); |
14068 } | 14155 } |
14069 Library.prototype.get$jsname = function() { | |
14070 if (this._jsname == null) { | |
14071 this._jsname = this.name.replaceAll('.', '_').replaceAll(':', '_').replaceAl
l(' ', '_'); | |
14072 } | |
14073 return this._jsname; | |
14074 } | |
14075 Library.prototype.get$span = function() { | 14156 Library.prototype.get$span = function() { |
14076 return new SourceSpan(this.baseSource, 0, 0); | 14157 return new SourceSpan(this.baseSource, 0, 0); |
14077 } | 14158 } |
14078 Library.prototype.makeFullPath = function(filename) { | 14159 Library.prototype.makeFullPath = function(filename) { |
14079 if (filename.startsWith('dart:')) return filename; | 14160 if (filename.startsWith('dart:')) return filename; |
14080 if (filename.startsWith('/')) return filename; | 14161 if (filename.startsWith('/')) return filename; |
14081 if (filename.startsWith('file:///')) return filename; | 14162 if (filename.startsWith('file:///')) return filename; |
14082 if (filename.startsWith('http://')) return filename; | 14163 if (filename.startsWith('http://')) return filename; |
14083 return joinPaths(this.sourceDir, filename); | 14164 return joinPaths(this.sourceDir, filename); |
14084 } | 14165 } |
(...skipping 20 matching lines...) Expand all Loading... |
14105 if ($notnull_bool(member.declaringType.get$isTop())) { | 14186 if ($notnull_bool(member.declaringType.get$isTop())) { |
14106 $globals.world._addTopName(member); | 14187 $globals.world._addTopName(member); |
14107 } | 14188 } |
14108 return; | 14189 return; |
14109 } | 14190 } |
14110 var mset = this._privateMembers.$index(member.name); | 14191 var mset = this._privateMembers.$index(member.name); |
14111 if ($notnull_bool(mset == null)) { | 14192 if ($notnull_bool(mset == null)) { |
14112 var $list = $globals.world.libraries.getValues(); | 14193 var $list = $globals.world.libraries.getValues(); |
14113 for (var $i = $globals.world.libraries.getValues().iterator$0(); $i.hasNex
t$0(); ) { | 14194 for (var $i = $globals.world.libraries.getValues().iterator$0(); $i.hasNex
t$0(); ) { |
14114 var lib = $i.next$0(); | 14195 var lib = $i.next$0(); |
14115 if (lib._privateMembers.containsKey(member.name)) { | 14196 if (lib._privateMembers.containsKey(member.get$jsname())) { |
14116 member.set$jsname(('_' + this.get$jsname() + member.name)); | 14197 member._jsname = ('_' + this.get$jsname() + member.get$jsname()); |
14117 break; | 14198 break; |
14118 } | 14199 } |
14119 } | 14200 } |
14120 mset = new MemberSet(member, false); | 14201 mset = new MemberSet(member, false); |
14121 this._privateMembers.$setindex(member.name, mset); | 14202 this._privateMembers.$setindex(member.name, mset); |
14122 } | 14203 } |
14123 else { | 14204 else { |
14124 mset.get$members().add$1(member); | 14205 mset.get$members().add$1(member); |
14125 } | 14206 } |
14126 } | 14207 } |
14127 else { | 14208 else { |
14128 $globals.world._addMember(member); | 14209 $globals.world._addMember(member); |
14129 } | 14210 } |
14130 } | 14211 } |
14131 Library.prototype.getOrAddFunctionType = function(name, func, inType) { | 14212 Library.prototype.getOrAddFunctionType = function(enclosingElement, name, func)
{ |
14132 var def = new FunctionTypeDefinition(func, null, func.span); | 14213 var def = new FunctionTypeDefinition(func, null, func.span); |
14133 var type = new DefinedType(name, this, def, false); | 14214 var type = new DefinedType(name, this, def, false); |
14134 type.addMethod('\$call', func); | 14215 type.addMethod('\$call', func); |
14135 type.members.$index('\$call').resolve$1(inType); | 14216 var m = type.members.$index('\$call'); |
| 14217 m.set$enclosingElement(enclosingElement); |
| 14218 m.resolve$0(); |
14136 type.interfaces = [$globals.world.functionType]; | 14219 type.interfaces = [$globals.world.functionType]; |
14137 return type; | 14220 return type; |
14138 } | 14221 } |
14139 Library.prototype.addType = function(name, definition, isClass) { | 14222 Library.prototype.addType = function(name, definition, isClass) { |
14140 var $0; | 14223 var $0; |
14141 if (this.types.containsKey(name)) { | 14224 if (this.types.containsKey(name)) { |
14142 var existingType = this.types.$index(name); | 14225 var existingType = this.types.$index(name); |
14143 if ($notnull_bool(this.get$isCore()) && $notnull_bool(existingType.get$defin
ition() == null)) { | 14226 if ($notnull_bool(this.get$isCore()) && $notnull_bool(existingType.get$defin
ition() == null)) { |
14144 existingType.setDefinition$1(definition); | 14227 existingType.setDefinition$1(definition); |
14145 } | 14228 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14183 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { | 14266 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { |
14184 $globals.world.error(('conflicting types for "' + name + '"'), (($0 = re
t.get$span()) && $0.is$SourceSpan()), (($0 = newRet.get$span()) && $0.is$SourceS
pan())); | 14267 $globals.world.error(('conflicting types for "' + name + '"'), (($0 = re
t.get$span()) && $0.is$SourceSpan()), (($0 = newRet.get$span()) && $0.is$SourceS
pan())); |
14185 } | 14268 } |
14186 else { | 14269 else { |
14187 ret = newRet; | 14270 ret = newRet; |
14188 } | 14271 } |
14189 } | 14272 } |
14190 } | 14273 } |
14191 return (ret && ret.is$lang_Type()); | 14274 return (ret && ret.is$lang_Type()); |
14192 } | 14275 } |
| 14276 Library.prototype.resolveType = function(node, typeErrors) { |
| 14277 if (node == null) return $globals.world.varType; |
| 14278 if (node.type != null) return node.type; |
| 14279 node.type = this.findType((node && node.is$NameTypeReference())); |
| 14280 if (node.type == null) { |
| 14281 var message = ('cannot find type ' + Library._getDottedName((node && node.is
$NameTypeReference()))); |
| 14282 if ($notnull_bool(typeErrors)) { |
| 14283 $globals.world.error($assert_String(message), node.span); |
| 14284 node.type = $globals.world.objectType; |
| 14285 } |
| 14286 else { |
| 14287 $globals.world.warning($assert_String(message), node.span); |
| 14288 node.type = $globals.world.varType; |
| 14289 } |
| 14290 } |
| 14291 return node.type; |
| 14292 } |
| 14293 Library._getDottedName = function(type) { |
| 14294 if (type.names != null) { |
| 14295 var names = map(type.names, (function (n) { |
| 14296 return n.get$name(); |
| 14297 }) |
| 14298 ); |
| 14299 return type.name.name + '.' + Strings.join((names && names.is$List_String())
, '.'); |
| 14300 } |
| 14301 else { |
| 14302 return type.name.name; |
| 14303 } |
| 14304 } |
14193 Library.prototype.lookup = function(name, span) { | 14305 Library.prototype.lookup = function(name, span) { |
14194 var $0; | 14306 var $0; |
14195 var retType = this.findTypeByName(name); | 14307 var retType = this.findTypeByName(name); |
14196 var ret = null; | 14308 var ret = null; |
14197 if ($notnull_bool($ne(retType, null))) { | 14309 if ($notnull_bool($ne(retType, null))) { |
14198 ret = retType.get$typeMember(); | 14310 ret = retType.get$typeMember(); |
14199 } | 14311 } |
14200 var newRet = this.topType.getMember(name); | 14312 var newRet = this.topType.getMember(name); |
14201 if ($notnull_bool($ne(newRet, null))) { | 14313 if ($notnull_bool($ne(newRet, null))) { |
14202 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { | 14314 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { |
(...skipping 25 matching lines...) Expand all Loading... |
14228 this.name = this.baseSource.filename; | 14340 this.name = this.baseSource.filename; |
14229 var index = this.name.lastIndexOf('/', this.name.length); | 14341 var index = this.name.lastIndexOf('/', this.name.length); |
14230 if (index >= 0) { | 14342 if (index >= 0) { |
14231 this.name = this.name.substring($assert_num(index + 1)); | 14343 this.name = this.name.substring($assert_num(index + 1)); |
14232 } | 14344 } |
14233 index = this.name.indexOf('.', 0); | 14345 index = this.name.indexOf('.', 0); |
14234 if (index > 0) { | 14346 if (index > 0) { |
14235 this.name = this.name.substring(0, $assert_num(index)); | 14347 this.name = this.name.substring(0, $assert_num(index)); |
14236 } | 14348 } |
14237 } | 14349 } |
| 14350 this._jsname = this.name.replaceAll('.', '_').replaceAll(':', '_').replaceAll(
' ', '_'); |
14238 var $list = this.types.getValues(); | 14351 var $list = this.types.getValues(); |
14239 for (var $i = this.types.getValues().iterator$0(); $i.hasNext$0(); ) { | 14352 for (var $i = this.types.getValues().iterator$0(); $i.hasNext$0(); ) { |
14240 var type = $i.next$0(); | 14353 var type = $i.next$0(); |
14241 type.resolve$0(); | 14354 type.resolve$0(); |
14242 } | 14355 } |
14243 } | 14356 } |
14244 Library.prototype.visitSources = function() { | 14357 Library.prototype.visitSources = function() { |
14245 var visitor = new _LibraryVisitor(this); | 14358 var visitor = new _LibraryVisitor(this); |
14246 visitor.addSource$1(this.baseSource); | 14359 visitor.addSource$1(this.baseSource); |
14247 } | 14360 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14294 $globals.world.error(('duplicate source file "' + source.filename + '"')); | 14407 $globals.world.error(('duplicate source file "' + source.filename + '"')); |
14295 return; | 14408 return; |
14296 } | 14409 } |
14297 this.library.sources.add(source); | 14410 this.library.sources.add(source); |
14298 var parser = new lang_Parser(source, $globals.options.dietParse, false, false,
0); | 14411 var parser = new lang_Parser(source, $globals.options.dietParse, false, false,
0); |
14299 var unit = parser.compilationUnit(); | 14412 var unit = parser.compilationUnit(); |
14300 unit.forEach((function (def) { | 14413 unit.forEach((function (def) { |
14301 return def.visit$1($this); | 14414 return def.visit$1($this); |
14302 }) | 14415 }) |
14303 ); | 14416 ); |
14304 $assert(this.sources.length == 0 || $notnull_bool(this.isTop), "sources.length
== 0 || isTop", "library.dart", 299, 12); | 14417 $assert(this.sources.length == 0 || $notnull_bool(this.isTop), "sources.length
== 0 || isTop", "library.dart", 330, 12); |
14305 this.isTop = false; | 14418 this.isTop = false; |
14306 var newSources = this.sources; | 14419 var newSources = this.sources; |
14307 this.sources = []; | 14420 this.sources = []; |
14308 for (var $i = newSources.iterator$0(); $i.hasNext$0(); ) { | 14421 for (var $i = newSources.iterator$0(); $i.hasNext$0(); ) { |
14309 var source0 = $i.next$0(); | 14422 var source0 = $i.next$0(); |
14310 this.addSource((source0 && source0.is$SourceFile())); | 14423 this.addSource((source0 && source0.is$SourceFile())); |
14311 } | 14424 } |
14312 } | 14425 } |
14313 _LibraryVisitor.prototype.visitDirectiveDefinition = function(node) { | 14426 _LibraryVisitor.prototype.visitDirectiveDefinition = function(node) { |
14314 if (!$notnull_bool(this.isTop)) { | 14427 if (!$notnull_bool(this.isTop)) { |
14315 $globals.world.error('directives not allowed in sourced file', node.span); | 14428 $globals.world.error('directives not allowed in sourced file', node.span); |
14316 return; | 14429 return; |
14317 } | 14430 } |
14318 var name; | 14431 var name; |
14319 switch (node.name.name) { | 14432 switch (node.name.name) { |
14320 case "library": | 14433 case "library": |
14321 | 14434 |
14322 name = this.getSingleStringArg(node); | 14435 name = this.getSingleStringArg(node); |
14323 if (this.library.name == null) { | 14436 if (this.library.name == null) { |
14324 this.library.name = $assert_String(name); | 14437 this.library.name = $assert_String(name); |
14325 if ($notnull_bool($eq(name, 'node')) || $notnull_bool($eq(name, 'dom')))
{ | 14438 if ($notnull_bool($eq(name, 'node')) || $notnull_bool($eq(name, 'dom')))
{ |
14326 this.library.topType.isNativeType = true; | 14439 this.library.topType.isNative = true; |
14327 } | 14440 } |
14328 if ($notnull_bool(this.seenImport) || $notnull_bool(this.seenSource) ||
$notnull_bool(this.seenResource)) { | 14441 if ($notnull_bool(this.seenImport) || $notnull_bool(this.seenSource) ||
$notnull_bool(this.seenResource)) { |
14329 $globals.world.error('#library must be first directive in file', node.
span); | 14442 $globals.world.error('#library must be first directive in file', node.
span); |
14330 } | 14443 } |
14331 } | 14444 } |
14332 else { | 14445 else { |
14333 $globals.world.error('already specified library name', node.span); | 14446 $globals.world.error('already specified library name', node.span); |
14334 } | 14447 } |
14335 break; | 14448 break; |
14336 | 14449 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14445 this.currentType.addMethod(node.name.name, node); | 14558 this.currentType.addMethod(node.name.name, node); |
14446 } | 14559 } |
14447 _LibraryVisitor.prototype.visitFunctionTypeDefinition = function(node) { | 14560 _LibraryVisitor.prototype.visitFunctionTypeDefinition = function(node) { |
14448 var type = this.library.addType(node.func.name.name, node, false); | 14561 var type = this.library.addType(node.func.name.name, node, false); |
14449 type.addMethod$2('\$call', node.func); | 14562 type.addMethod$2('\$call', node.func); |
14450 } | 14563 } |
14451 _LibraryVisitor.prototype.addSource$1 = function($0) { | 14564 _LibraryVisitor.prototype.addSource$1 = function($0) { |
14452 return this.addSource(($0 && $0.is$SourceFile())); | 14565 return this.addSource(($0 && $0.is$SourceFile())); |
14453 }; | 14566 }; |
14454 // ********** Code for Parameter ************** | 14567 // ********** Code for Parameter ************** |
14455 function Parameter(definition) { | 14568 function Parameter(definition, method) { |
14456 this.isInitializer = false | 14569 this.isInitializer = false |
14457 this.definition = definition; | 14570 this.definition = definition; |
| 14571 this.method = method; |
14458 // Initializers done | 14572 // Initializers done |
14459 } | 14573 } |
14460 Parameter.prototype.is$Parameter = function(){return this;}; | 14574 Parameter.prototype.is$Parameter = function(){return this;}; |
14461 Parameter.prototype.get$definition = function() { return this.definition; }; | 14575 Parameter.prototype.get$definition = function() { return this.definition; }; |
14462 Parameter.prototype.set$definition = function(value) { return this.definition =
value; }; | 14576 Parameter.prototype.set$definition = function(value) { return this.definition =
value; }; |
14463 Parameter.prototype.get$name = function() { return this.name; }; | 14577 Parameter.prototype.get$name = function() { return this.name; }; |
14464 Parameter.prototype.set$name = function(value) { return this.name = value; }; | 14578 Parameter.prototype.set$name = function(value) { return this.name = value; }; |
14465 Parameter.prototype.get$type = function() { return this.type; }; | 14579 Parameter.prototype.get$type = function() { return this.type; }; |
14466 Parameter.prototype.set$type = function(value) { return this.type = value; }; | 14580 Parameter.prototype.set$type = function(value) { return this.type = value; }; |
14467 Parameter.prototype.get$isInitializer = function() { return this.isInitializer;
}; | 14581 Parameter.prototype.get$isInitializer = function() { return this.isInitializer;
}; |
14468 Parameter.prototype.set$isInitializer = function(value) { return this.isInitiali
zer = value; }; | 14582 Parameter.prototype.set$isInitializer = function(value) { return this.isInitiali
zer = value; }; |
14469 Parameter.prototype.get$value = function() { return this.value; }; | 14583 Parameter.prototype.get$value = function() { return this.value; }; |
14470 Parameter.prototype.set$value = function(value) { return this.value = value; }; | 14584 Parameter.prototype.set$value = function(value) { return this.value = value; }; |
14471 Parameter.prototype.resolve = function(method, inType) { | 14585 Parameter.prototype.resolve = function() { |
14472 this.name = this.definition.name.name; | 14586 this.name = this.definition.name.name; |
14473 if (this.name.startsWith('this.')) { | 14587 if (this.name.startsWith('this.')) { |
14474 this.name = this.name.substring(5); | 14588 this.name = this.name.substring(5); |
14475 this.isInitializer = true; | 14589 this.isInitializer = true; |
14476 } | 14590 } |
14477 this.type = inType.resolveType(this.definition.type, false); | 14591 this.type = this.method.resolveType(this.definition.type, false); |
14478 if ($notnull_bool(method.get$isStatic()) && $notnull_bool(this.type.get$hasTyp
eParams())) { | 14592 if ($notnull_bool(this.method.get$isStatic()) && this.method.get$typeParameter
s() == null && $notnull_bool(this.type.get$hasTypeParams())) { |
14479 $globals.world.error('using type parameter in static context', this.definiti
on.span); | 14593 $globals.world.error('using type parameter in static context', this.definiti
on.span); |
14480 } | 14594 } |
14481 if (this.definition.value != null) { | 14595 if (this.definition.value != null) { |
14482 if ((this.definition.value instanceof NullExpression) && this.definition.val
ue.span.start == this.definition.span.start) { | 14596 if ((this.definition.value instanceof NullExpression) && this.definition.val
ue.span.start == this.definition.span.start) { |
14483 return; | 14597 return; |
14484 } | 14598 } |
14485 if (method.name == '\$call') { | 14599 if (this.method.name == '\$call') { |
14486 if ($notnull_bool(method.get$definition().get$body() == null)) { | 14600 if ($notnull_bool(this.method.get$definition().get$body() == null)) { |
14487 $globals.world.error('default value not allowed on function type', this.
definition.span); | 14601 $globals.world.error('default value not allowed on function type', this.
definition.span); |
14488 } | 14602 } |
14489 } | 14603 } |
14490 else if ($notnull_bool(method.get$isAbstract())) { | 14604 else if ($notnull_bool(this.method.get$isAbstract())) { |
14491 $globals.world.error('default value not allowed on abstract methods', this
.definition.span); | 14605 $globals.world.error('default value not allowed on abstract methods', this
.definition.span); |
14492 } | 14606 } |
14493 } | 14607 } |
14494 else if ($notnull_bool(this.isInitializer) && !$notnull_bool(method.get$isCons
tructor())) { | 14608 else if ($notnull_bool(this.isInitializer) && !$notnull_bool(this.method.get$i
sConstructor())) { |
14495 $globals.world.error('initializer parameters only allowed on constructors',
this.definition.span); | 14609 $globals.world.error('initializer parameters only allowed on constructors',
this.definition.span); |
14496 } | 14610 } |
14497 } | 14611 } |
14498 Parameter.prototype.genValue = function(method, context) { | 14612 Parameter.prototype.genValue = function(method, context) { |
14499 var $0; | 14613 var $0; |
14500 if (this.definition.value == null || this.value != null) return; | 14614 if (this.definition.value == null || this.value != null) return; |
14501 if (context == null) { | 14615 if (context == null) { |
14502 context = new MethodGenerator(method, null); | 14616 context = new MethodGenerator(method, null); |
14503 } | 14617 } |
14504 this.value = (($0 = this.definition.value.visit(context)) && $0.is$Value()); | 14618 this.value = (($0 = this.definition.value.visit(context)) && $0.is$Value()); |
14505 this.value = this.value.convertTo(context, this.type, this.definition.value, f
alse); | 14619 this.value = this.value.convertTo(context, this.type, this.definition.value, f
alse); |
14506 } | 14620 } |
14507 Parameter.prototype.copyWithNewType = function(newType) { | 14621 Parameter.prototype.copyWithNewType = function(newMethod, newType) { |
14508 var $0; | 14622 var $0; |
14509 var ret = new Parameter(this.definition); | 14623 var ret = new Parameter(this.definition, newMethod); |
14510 ret.set$type(newType); | 14624 ret.set$type(newType); |
14511 ret.set$name(this.name); | 14625 ret.set$name(this.name); |
14512 ret.set$isInitializer(this.isInitializer); | 14626 ret.set$isInitializer(this.isInitializer); |
14513 return (ret && ret.is$Parameter()); | 14627 return (ret && ret.is$Parameter()); |
14514 } | 14628 } |
14515 Parameter.prototype.get$isOptional = function() { | 14629 Parameter.prototype.get$isOptional = function() { |
14516 return this.definition != null && this.definition.value != null; | 14630 return this.definition != null && this.definition.value != null; |
14517 } | 14631 } |
14518 Parameter.prototype.copyWithNewType$1 = function($0) { | 14632 Parameter.prototype.copyWithNewType$2 = function($0, $1) { |
14519 return this.copyWithNewType(($0 && $0.is$lang_Type())); | 14633 return this.copyWithNewType(($0 && $0.is$Member()), ($1 && $1.is$lang_Type()))
; |
14520 }; | 14634 }; |
14521 Parameter.prototype.genValue$2 = function($0, $1) { | 14635 Parameter.prototype.genValue$2 = function($0, $1) { |
14522 return this.genValue(($0 && $0.is$MethodMember()), ($1 && $1.is$MethodGenerato
r())); | 14636 return this.genValue(($0 && $0.is$MethodMember()), ($1 && $1.is$MethodGenerato
r())); |
14523 }; | 14637 }; |
14524 Parameter.prototype.resolve$2 = function($0, $1) { | 14638 Parameter.prototype.resolve$0 = Parameter.prototype.resolve; |
14525 return this.resolve(($0 && $0.is$Member()), ($1 && $1.is$lang_Type())); | |
14526 }; | |
14527 // ********** Code for Member ************** | 14639 // ********** Code for Member ************** |
14528 function Member(name, declaringType) { | 14640 function Member(name, declaringType) { |
14529 this.name = name; | 14641 this.isGenerated = false; |
14530 this.declaringType = declaringType; | 14642 this.declaringType = declaringType; |
14531 this.isGenerated = false; | |
14532 // Initializers done | 14643 // Initializers done |
| 14644 lang_Element.call(this, name, declaringType); |
14533 } | 14645 } |
| 14646 $inherits(Member, lang_Element); |
14534 Member.prototype.is$Member = function(){return this;}; | 14647 Member.prototype.is$Member = function(){return this;}; |
14535 Member.prototype.is$Named = function(){return this;}; | |
14536 Member.prototype.get$name = function() { return this.name; }; | |
14537 Member.prototype.get$declaringType = function() { return this.declaringType; }; | 14648 Member.prototype.get$declaringType = function() { return this.declaringType; }; |
14538 Member.prototype.get$generator = function() { return this.generator; }; | 14649 Member.prototype.get$generator = function() { return this.generator; }; |
14539 Member.prototype.set$generator = function(value) { return this.generator = value
; }; | 14650 Member.prototype.set$generator = function(value) { return this.generator = value
; }; |
14540 Member.prototype.get$jsname = function() { | |
14541 return this._jsname == null ? this.name : this._jsname; | |
14542 } | |
14543 Member.prototype.set$jsname = function(name) { | |
14544 return this._jsname = name; | |
14545 } | |
14546 Member.prototype.get$library = function() { | 14651 Member.prototype.get$library = function() { |
14547 return this.declaringType.get$library(); | 14652 return this.declaringType.get$library(); |
14548 } | 14653 } |
14549 Member.prototype.get$isPrivate = function() { | 14654 Member.prototype.get$isPrivate = function() { |
14550 return this.name.startsWith('_'); | 14655 return this.name.startsWith('_'); |
14551 } | 14656 } |
14552 Member.prototype.get$isConstructor = function() { | 14657 Member.prototype.get$isConstructor = function() { |
14553 return false; | 14658 return false; |
14554 } | 14659 } |
14555 Member.prototype.get$isField = function() { | 14660 Member.prototype.get$isField = function() { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14632 $globals.world.error('static members can not hide parent members', this.get$
span(), other.get$span()); | 14737 $globals.world.error('static members can not hide parent members', this.get$
span(), other.get$span()); |
14633 return false; | 14738 return false; |
14634 } | 14739 } |
14635 else if ($notnull_bool(other.get$isStatic())) { | 14740 else if ($notnull_bool(other.get$isStatic())) { |
14636 $globals.world.error('can not override static member', this.get$span(), othe
r.get$span()); | 14741 $globals.world.error('can not override static member', this.get$span(), othe
r.get$span()); |
14637 return false; | 14742 return false; |
14638 } | 14743 } |
14639 return true; | 14744 return true; |
14640 } | 14745 } |
14641 Member.prototype.get$generatedFactoryName = function() { | 14746 Member.prototype.get$generatedFactoryName = function() { |
14642 $assert(this.get$isFactory(), "this.isFactory", "member.dart", 205, 12); | 14747 $assert(this.get$isFactory(), "this.isFactory", "member.dart", 187, 12); |
14643 var prefix = ('' + this.declaringType.get$jsname() + '.' + this.get$constructo
rName() + '\$'); | 14748 var prefix = ('' + this.declaringType.get$jsname() + '.' + this.get$constructo
rName() + '\$'); |
14644 if (this.name == '') { | 14749 if (this.name == '') { |
14645 return ('' + prefix + 'factory'); | 14750 return ('' + prefix + 'factory'); |
14646 } | 14751 } |
14647 else { | 14752 else { |
14648 return ('' + prefix + this.name + '\$factory'); | 14753 return ('' + prefix + this.name + '\$factory'); |
14649 } | 14754 } |
14650 } | 14755 } |
14651 Member.prototype.resolveType = function(node, isRequired) { | |
14652 var type = this.declaringType.resolveType(node, isRequired); | |
14653 if ($notnull_bool(this.get$isStatic()) && $notnull_bool(type.get$hasTypeParams
())) { | |
14654 $globals.world.error('using type parameter in static context', node.span); | |
14655 } | |
14656 return (type && type.is$lang_Type()); | |
14657 } | |
14658 Member.prototype.hashCode = function() { | 14756 Member.prototype.hashCode = function() { |
14659 return (this.declaringType.hashCode() << 4) ^ this.name.hashCode(); | 14757 return (this.declaringType.hashCode() << 4) ^ this.name.hashCode(); |
14660 } | 14758 } |
14661 Member.prototype._get$3 = function($0, $1, $2) { | 14759 Member.prototype._get$3 = function($0, $1, $2) { |
14662 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value())); | 14760 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value())); |
14663 }; | 14761 }; |
14664 Member.prototype._set$4 = function($0, $1, $2, $3) { | 14762 Member.prototype._set$4 = function($0, $1, $2, $3) { |
14665 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value())); | 14763 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value())); |
14666 }; | 14764 }; |
14667 Member.prototype.canInvoke$2 = function($0, $1) { | 14765 Member.prototype.canInvoke$2 = function($0, $1) { |
14668 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments(
))); | 14766 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments(
))); |
14669 }; | 14767 }; |
14670 Member.prototype.computeValue$0 = Member.prototype.computeValue; | 14768 Member.prototype.computeValue$0 = Member.prototype.computeValue; |
14671 Member.prototype.hashCode$0 = Member.prototype.hashCode; | 14769 Member.prototype.hashCode$0 = Member.prototype.hashCode; |
14672 Member.prototype.invoke$4 = function($0, $1, $2, $3) { | 14770 Member.prototype.invoke$4 = function($0, $1, $2, $3) { |
14673 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); | 14771 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); |
14674 }; | 14772 }; |
14675 Member.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { | 14773 Member.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { |
14676 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); | 14774 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); |
14677 }; | 14775 }; |
14678 Member.prototype.invoke$5 = function($0, $1, $2, $3, $4) { | 14776 Member.prototype.invoke$5 = function($0, $1, $2, $3, $4) { |
14679 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); | 14777 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); |
14680 }; | 14778 }; |
14681 Member.prototype.provideFieldSyntax$0 = Member.prototype.provideFieldSyntax; | 14779 Member.prototype.provideFieldSyntax$0 = Member.prototype.provideFieldSyntax; |
14682 Member.prototype.providePropertySyntax$0 = Member.prototype.providePropertySynta
x; | 14780 Member.prototype.providePropertySyntax$0 = Member.prototype.providePropertySynta
x; |
14683 Member.prototype.resolve$1 = function($0) { | |
14684 return this.resolve(($0 && $0.is$lang_Type())); | |
14685 }; | |
14686 // ********** Code for TypeMember ************** | 14781 // ********** Code for TypeMember ************** |
14687 function TypeMember(type) { | 14782 function TypeMember(type) { |
14688 this.type = type; | 14783 this.type = type; |
14689 // Initializers done | 14784 // Initializers done |
14690 Member.call(this, type.name, type.library.topType); | 14785 Member.call(this, type.name, type.library.topType); |
14691 } | 14786 } |
14692 $inherits(TypeMember, Member); | 14787 $inherits(TypeMember, Member); |
14693 TypeMember.prototype.is$TypeMember = function(){return this;}; | 14788 TypeMember.prototype.is$TypeMember = function(){return this;}; |
14694 TypeMember.prototype.get$type = function() { return this.type; }; | 14789 TypeMember.prototype.get$type = function() { return this.type; }; |
14695 TypeMember.prototype.get$span = function() { | 14790 TypeMember.prototype.get$span = function() { |
14696 return this.type.definition.span; | 14791 return this.type.definition.span; |
14697 } | 14792 } |
14698 TypeMember.prototype.get$isStatic = function() { | 14793 TypeMember.prototype.get$isStatic = function() { |
14699 return true; | 14794 return true; |
14700 } | 14795 } |
14701 TypeMember.prototype.get$returnType = function() { | 14796 TypeMember.prototype.get$returnType = function() { |
14702 return $globals.world.varType; | 14797 return $globals.world.varType; |
14703 } | 14798 } |
14704 TypeMember.prototype.canInvoke = function(context, args) { | 14799 TypeMember.prototype.canInvoke = function(context, args) { |
14705 return false; | 14800 return false; |
14706 } | 14801 } |
14707 TypeMember.prototype.get$canGet = function() { | 14802 TypeMember.prototype.get$canGet = function() { |
14708 return true; | 14803 return true; |
14709 } | 14804 } |
14710 TypeMember.prototype.get$canSet = function() { | 14805 TypeMember.prototype.get$canSet = function() { |
14711 return false; | 14806 return false; |
14712 } | 14807 } |
14713 TypeMember.prototype.resolve = function(inType) { | |
14714 | |
14715 } | |
14716 TypeMember.prototype._get = function(context, node, target, isDynamic) { | 14808 TypeMember.prototype._get = function(context, node, target, isDynamic) { |
14717 return new Value.type$ctor(this.type, node.span); | 14809 return new Value.type$ctor(this.type, node.span); |
14718 } | 14810 } |
14719 TypeMember.prototype._set = function(context, node, target, value, isDynamic) { | 14811 TypeMember.prototype._set = function(context, node, target, value, isDynamic) { |
14720 $globals.world.error('cannot set type', node.span); | 14812 $globals.world.error('cannot set type', node.span); |
14721 } | 14813 } |
14722 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) { | 14814 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) { |
14723 $globals.world.error('cannot invoke type', node.span); | 14815 $globals.world.error('cannot invoke type', node.span); |
14724 } | 14816 } |
14725 TypeMember.prototype._get$3 = function($0, $1, $2) { | 14817 TypeMember.prototype._get$3 = function($0, $1, $2) { |
14726 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), false); | 14818 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), false); |
14727 }; | 14819 }; |
14728 TypeMember.prototype._set$4 = function($0, $1, $2, $3) { | 14820 TypeMember.prototype._set$4 = function($0, $1, $2, $3) { |
14729 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value()), false); | 14821 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value()), false); |
14730 }; | 14822 }; |
14731 TypeMember.prototype.canInvoke$2 = function($0, $1) { | 14823 TypeMember.prototype.canInvoke$2 = function($0, $1) { |
14732 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments(
))); | 14824 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments(
))); |
14733 }; | 14825 }; |
14734 TypeMember.prototype.invoke$4 = function($0, $1, $2, $3) { | 14826 TypeMember.prototype.invoke$4 = function($0, $1, $2, $3) { |
14735 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); | 14827 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); |
14736 }; | 14828 }; |
14737 TypeMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { | 14829 TypeMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { |
14738 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); | 14830 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); |
14739 }; | 14831 }; |
14740 TypeMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) { | 14832 TypeMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) { |
14741 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); | 14833 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); |
14742 }; | 14834 }; |
14743 TypeMember.prototype.resolve$1 = function($0) { | |
14744 return this.resolve(($0 && $0.is$lang_Type())); | |
14745 }; | |
14746 // ********** Code for FieldMember ************** | 14835 // ********** Code for FieldMember ************** |
14747 function FieldMember(name, declaringType, definition, value) { | 14836 function FieldMember(name, declaringType, definition, value) { |
14748 this._providePropertySyntax = false | 14837 this._providePropertySyntax = false |
14749 this._computing = false | 14838 this._computing = false |
14750 this.definition = definition; | 14839 this.definition = definition; |
14751 this.value = value; | 14840 this.value = value; |
14752 this.isNative = false; | 14841 this.isNative = false; |
14753 // Initializers done | 14842 // Initializers done |
14754 Member.call(this, name, declaringType); | 14843 Member.call(this, name, declaringType); |
14755 } | 14844 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14796 } | 14885 } |
14797 FieldMember.prototype.get$canGet = function() { | 14886 FieldMember.prototype.get$canGet = function() { |
14798 return true; | 14887 return true; |
14799 } | 14888 } |
14800 FieldMember.prototype.get$canSet = function() { | 14889 FieldMember.prototype.get$canSet = function() { |
14801 return !$notnull_bool(this.isFinal); | 14890 return !$notnull_bool(this.isFinal); |
14802 } | 14891 } |
14803 FieldMember.prototype.get$isField = function() { | 14892 FieldMember.prototype.get$isField = function() { |
14804 return true; | 14893 return true; |
14805 } | 14894 } |
14806 FieldMember.prototype.resolve = function(inType) { | 14895 FieldMember.prototype.resolve = function() { |
14807 var $0; | 14896 var $0; |
14808 this.isStatic = this.declaringType.get$isTop(); | 14897 this.isStatic = this.declaringType.get$isTop(); |
14809 this.isFinal = false; | 14898 this.isFinal = false; |
14810 if (this.definition.modifiers != null) { | 14899 if (this.definition.modifiers != null) { |
14811 var $list = this.definition.modifiers; | 14900 var $list = this.definition.modifiers; |
14812 for (var $i = 0;$i < $list.length; $i++) { | 14901 for (var $i = 0;$i < $list.length; $i++) { |
14813 var mod = $list.$index($i); | 14902 var mod = $list.$index($i); |
14814 if ($notnull_bool($eq(mod.get$kind(), 86/*TokenKind.STATIC*/))) { | 14903 if ($notnull_bool($eq(mod.get$kind(), 86/*TokenKind.STATIC*/))) { |
14815 if ($notnull_bool(this.isStatic)) { | 14904 if ($notnull_bool(this.isStatic)) { |
14816 $globals.world.error('duplicate static modifier', (($0 = mod.get$span(
)) && $0.is$SourceSpan())); | 14905 $globals.world.error('duplicate static modifier', (($0 = mod.get$span(
)) && $0.is$SourceSpan())); |
14817 } | 14906 } |
14818 this.isStatic = true; | 14907 this.isStatic = true; |
14819 } | 14908 } |
14820 else if ($notnull_bool($eq(mod.get$kind(), 97/*TokenKind.FINAL*/))) { | 14909 else if ($notnull_bool($eq(mod.get$kind(), 97/*TokenKind.FINAL*/))) { |
14821 if ($notnull_bool(this.isFinal)) { | 14910 if ($notnull_bool(this.isFinal)) { |
14822 $globals.world.error('duplicate final modifier', (($0 = mod.get$span()
) && $0.is$SourceSpan())); | 14911 $globals.world.error('duplicate final modifier', (($0 = mod.get$span()
) && $0.is$SourceSpan())); |
14823 } | 14912 } |
14824 this.isFinal = true; | 14913 this.isFinal = true; |
14825 } | 14914 } |
14826 else { | 14915 else { |
14827 $globals.world.error(('' + mod + ' modifier not allowed on field'), (($0
= mod.get$span()) && $0.is$SourceSpan())); | 14916 $globals.world.error(('' + mod + ' modifier not allowed on field'), (($0
= mod.get$span()) && $0.is$SourceSpan())); |
14828 } | 14917 } |
14829 } | 14918 } |
14830 } | 14919 } |
14831 this.type = inType.resolveType(this.definition.type, false); | 14920 this.type = this.resolveType(this.definition.type, false); |
14832 if ($notnull_bool(this.isStatic) && $notnull_bool(this.type.get$hasTypeParams(
))) { | 14921 if ($notnull_bool(this.isStatic) && $notnull_bool(this.type.get$hasTypeParams(
))) { |
14833 $globals.world.error('using type parameter in static context', this.definiti
on.type.span); | 14922 $globals.world.error('using type parameter in static context', this.definiti
on.type.span); |
14834 } | 14923 } |
14835 if ($notnull_bool(this.isStatic) && $notnull_bool(this.isFinal) && this.value
== null) { | 14924 if ($notnull_bool(this.isStatic) && $notnull_bool(this.isFinal) && this.value
== null) { |
14836 $globals.world.error('static final field is missing initializer', this.get$s
pan()); | 14925 $globals.world.error('static final field is missing initializer', this.get$s
pan()); |
14837 } | 14926 } |
14838 this.get$library()._addMember(this); | 14927 this.get$library()._addMember(this); |
14839 } | 14928 } |
14840 FieldMember.prototype.computeValue = function() { | 14929 FieldMember.prototype.computeValue = function() { |
14841 var $0; | 14930 var $0; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14912 } | 15001 } |
14913 FieldMember.prototype._get$3 = function($0, $1, $2) { | 15002 FieldMember.prototype._get$3 = function($0, $1, $2) { |
14914 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), false); | 15003 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), false); |
14915 }; | 15004 }; |
14916 FieldMember.prototype._set$4 = function($0, $1, $2, $3) { | 15005 FieldMember.prototype._set$4 = function($0, $1, $2, $3) { |
14917 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value()), false); | 15006 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value()), false); |
14918 }; | 15007 }; |
14919 FieldMember.prototype.computeValue$0 = FieldMember.prototype.computeValue; | 15008 FieldMember.prototype.computeValue$0 = FieldMember.prototype.computeValue; |
14920 FieldMember.prototype.provideFieldSyntax$0 = FieldMember.prototype.provideFieldS
yntax; | 15009 FieldMember.prototype.provideFieldSyntax$0 = FieldMember.prototype.provideFieldS
yntax; |
14921 FieldMember.prototype.providePropertySyntax$0 = FieldMember.prototype.providePro
pertySyntax; | 15010 FieldMember.prototype.providePropertySyntax$0 = FieldMember.prototype.providePro
pertySyntax; |
14922 FieldMember.prototype.resolve$1 = function($0) { | 15011 FieldMember.prototype.resolve$0 = FieldMember.prototype.resolve; |
14923 return this.resolve(($0 && $0.is$lang_Type())); | |
14924 }; | |
14925 // ********** Code for PropertyMember ************** | 15012 // ********** Code for PropertyMember ************** |
14926 function PropertyMember(name, declaringType) { | 15013 function PropertyMember(name, declaringType) { |
14927 this._provideFieldSyntax = false | 15014 this._provideFieldSyntax = false |
14928 // Initializers done | 15015 // Initializers done |
14929 Member.call(this, name, declaringType); | 15016 Member.call(this, name, declaringType); |
14930 } | 15017 } |
14931 $inherits(PropertyMember, Member); | 15018 $inherits(PropertyMember, Member); |
14932 PropertyMember.prototype.is$PropertyMember = function(){return this;}; | 15019 PropertyMember.prototype.is$PropertyMember = function(){return this;}; |
14933 PropertyMember.prototype.get$getter = function() { return this.getter; }; | 15020 PropertyMember.prototype.get$getter = function() { return this.getter; }; |
14934 PropertyMember.prototype.set$getter = function(value) { return this.getter = val
ue; }; | 15021 PropertyMember.prototype.set$getter = function(value) { return this.getter = val
ue; }; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15001 if ((parentMember instanceof ConcreteMember)) { | 15088 if ((parentMember instanceof ConcreteMember)) { |
15002 var c = (parentMember && parentMember.is$ConcreteMember()); | 15089 var c = (parentMember && parentMember.is$ConcreteMember()); |
15003 parent = (($0 = c.baseMember) && $0.is$PropertyMember()); | 15090 parent = (($0 = c.baseMember) && $0.is$PropertyMember()); |
15004 } | 15091 } |
15005 else { | 15092 else { |
15006 parent = (parentMember && parentMember.is$PropertyMember()); | 15093 parent = (parentMember && parentMember.is$PropertyMember()); |
15007 } | 15094 } |
15008 if (this.getter == null) this.getter = parent.getter; | 15095 if (this.getter == null) this.getter = parent.getter; |
15009 if (this.setter == null) this.setter = parent.setter; | 15096 if (this.setter == null) this.setter = parent.setter; |
15010 } | 15097 } |
15011 PropertyMember.prototype.resolve = function(inType) { | 15098 PropertyMember.prototype.resolve = function() { |
15012 if (this.getter != null) this.getter.resolve(inType); | 15099 if (this.getter != null) this.getter.resolve(); |
15013 if (this.setter != null) this.setter.resolve(inType); | 15100 if (this.setter != null) this.setter.resolve(); |
15014 this.get$library()._addMember(this); | 15101 this.get$library()._addMember(this); |
15015 } | 15102 } |
15016 PropertyMember.prototype._get$3 = function($0, $1, $2) { | 15103 PropertyMember.prototype._get$3 = function($0, $1, $2) { |
15017 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), false); | 15104 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), false); |
15018 }; | 15105 }; |
15019 PropertyMember.prototype._set$4 = function($0, $1, $2, $3) { | 15106 PropertyMember.prototype._set$4 = function($0, $1, $2, $3) { |
15020 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value()), false); | 15107 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value()), false); |
15021 }; | 15108 }; |
15022 PropertyMember.prototype.provideFieldSyntax$0 = PropertyMember.prototype.provide
FieldSyntax; | 15109 PropertyMember.prototype.provideFieldSyntax$0 = PropertyMember.prototype.provide
FieldSyntax; |
15023 PropertyMember.prototype.providePropertySyntax$0 = PropertyMember.prototype.prov
idePropertySyntax; | 15110 PropertyMember.prototype.providePropertySyntax$0 = PropertyMember.prototype.prov
idePropertySyntax; |
15024 PropertyMember.prototype.resolve$1 = function($0) { | 15111 PropertyMember.prototype.resolve$0 = PropertyMember.prototype.resolve; |
15025 return this.resolve(($0 && $0.is$lang_Type())); | |
15026 }; | |
15027 // ********** Code for ConcreteMember ************** | 15112 // ********** Code for ConcreteMember ************** |
15028 function ConcreteMember(name, declaringType, baseMember) { | 15113 function ConcreteMember(name, declaringType, baseMember) { |
15029 this.baseMember = baseMember; | 15114 this.baseMember = baseMember; |
15030 // Initializers done | 15115 // Initializers done |
15031 Member.call(this, name, declaringType); | 15116 Member.call(this, name, declaringType); |
15032 this.parameters = []; | 15117 this.parameters = []; |
15033 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring
Type); | 15118 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring
Type); |
15034 var $list = this.baseMember.get$parameters(); | 15119 var $list = this.baseMember.get$parameters(); |
15035 for (var $i = 0;$i < $list.length; $i++) { | 15120 for (var $i = 0;$i < $list.length; $i++) { |
15036 var p = $list.$index($i); | 15121 var p = $list.$index($i); |
15037 var newType = p.get$type().resolveTypeParams$1(declaringType); | 15122 var newType = p.get$type().resolveTypeParams$1(declaringType); |
15038 if ($notnull_bool($ne(newType, p.get$type()))) { | 15123 if ($notnull_bool($ne(newType, p.get$type()))) { |
15039 this.parameters.add(p.copyWithNewType$1(newType)); | 15124 this.parameters.add(p.copyWithNewType$2(this, newType)); |
15040 } | 15125 } |
15041 else { | 15126 else { |
15042 this.parameters.add(p); | 15127 this.parameters.add(p); |
15043 } | 15128 } |
15044 } | 15129 } |
15045 } | 15130 } |
15046 $inherits(ConcreteMember, Member); | 15131 $inherits(ConcreteMember, Member); |
15047 ConcreteMember.prototype.is$ConcreteMember = function(){return this;}; | 15132 ConcreteMember.prototype.is$ConcreteMember = function(){return this;}; |
15048 ConcreteMember.prototype.get$returnType = function() { return this.returnType; }
; | 15133 ConcreteMember.prototype.get$returnType = function() { return this.returnType; }
; |
15049 ConcreteMember.prototype.set$returnType = function(value) { return this.returnTy
pe = value; }; | 15134 ConcreteMember.prototype.set$returnType = function(value) { return this.returnTy
pe = value; }; |
(...skipping 13 matching lines...) Expand all Loading... |
15063 } | 15148 } |
15064 ConcreteMember.prototype.get$isFactory = function() { | 15149 ConcreteMember.prototype.get$isFactory = function() { |
15065 return this.baseMember.get$isFactory(); | 15150 return this.baseMember.get$isFactory(); |
15066 } | 15151 } |
15067 ConcreteMember.prototype.get$isFinal = function() { | 15152 ConcreteMember.prototype.get$isFinal = function() { |
15068 return this.baseMember.get$isFinal(); | 15153 return this.baseMember.get$isFinal(); |
15069 } | 15154 } |
15070 ConcreteMember.prototype.get$jsname = function() { | 15155 ConcreteMember.prototype.get$jsname = function() { |
15071 return this.baseMember.get$jsname(); | 15156 return this.baseMember.get$jsname(); |
15072 } | 15157 } |
15073 ConcreteMember.prototype.set$jsname = function(name) { | |
15074 return $globals.world.internalError('bad set of jsname on ConcreteMember'); | |
15075 } | |
15076 ConcreteMember.prototype.get$canGet = function() { | 15158 ConcreteMember.prototype.get$canGet = function() { |
15077 return this.baseMember.get$canGet(); | 15159 return this.baseMember.get$canGet(); |
15078 } | 15160 } |
15079 ConcreteMember.prototype.get$canSet = function() { | 15161 ConcreteMember.prototype.get$canSet = function() { |
15080 return this.baseMember.get$canSet(); | 15162 return this.baseMember.get$canSet(); |
15081 } | 15163 } |
15082 ConcreteMember.prototype.canInvoke = function(context, args) { | 15164 ConcreteMember.prototype.canInvoke = function(context, args) { |
15083 return this.baseMember.canInvoke(context, args); | 15165 return this.baseMember.canInvoke(context, args); |
15084 } | 15166 } |
15085 ConcreteMember.prototype.get$isField = function() { | 15167 ConcreteMember.prototype.get$isField = function() { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15185 Member.call(this, name, declaringType); | 15267 Member.call(this, name, declaringType); |
15186 } | 15268 } |
15187 $inherits(MethodMember, Member); | 15269 $inherits(MethodMember, Member); |
15188 MethodMember.prototype.is$MethodMember = function(){return this;}; | 15270 MethodMember.prototype.is$MethodMember = function(){return this;}; |
15189 MethodMember.prototype.get$definition = function() { return this.definition; }; | 15271 MethodMember.prototype.get$definition = function() { return this.definition; }; |
15190 MethodMember.prototype.set$definition = function(value) { return this.definition
= value; }; | 15272 MethodMember.prototype.set$definition = function(value) { return this.definition
= value; }; |
15191 MethodMember.prototype.get$returnType = function() { return this.returnType; }; | 15273 MethodMember.prototype.get$returnType = function() { return this.returnType; }; |
15192 MethodMember.prototype.set$returnType = function(value) { return this.returnType
= value; }; | 15274 MethodMember.prototype.set$returnType = function(value) { return this.returnType
= value; }; |
15193 MethodMember.prototype.get$parameters = function() { return this.parameters; }; | 15275 MethodMember.prototype.get$parameters = function() { return this.parameters; }; |
15194 MethodMember.prototype.set$parameters = function(value) { return this.parameters
= value; }; | 15276 MethodMember.prototype.set$parameters = function(value) { return this.parameters
= value; }; |
| 15277 MethodMember.prototype.get$typeParameters = function() { return this.typeParamet
ers; }; |
| 15278 MethodMember.prototype.set$typeParameters = function(value) { return this.typePa
rameters = value; }; |
15195 MethodMember.prototype.get$isStatic = function() { return this.isStatic; }; | 15279 MethodMember.prototype.get$isStatic = function() { return this.isStatic; }; |
15196 MethodMember.prototype.set$isStatic = function(value) { return this.isStatic = v
alue; }; | 15280 MethodMember.prototype.set$isStatic = function(value) { return this.isStatic = v
alue; }; |
15197 MethodMember.prototype.get$isAbstract = function() { return this.isAbstract; }; | 15281 MethodMember.prototype.get$isAbstract = function() { return this.isAbstract; }; |
15198 MethodMember.prototype.set$isAbstract = function(value) { return this.isAbstract
= value; }; | 15282 MethodMember.prototype.set$isAbstract = function(value) { return this.isAbstract
= value; }; |
15199 MethodMember.prototype.get$isConst = function() { return this.isConst; }; | 15283 MethodMember.prototype.get$isConst = function() { return this.isConst; }; |
15200 MethodMember.prototype.set$isConst = function(value) { return this.isConst = val
ue; }; | 15284 MethodMember.prototype.set$isConst = function(value) { return this.isConst = val
ue; }; |
15201 MethodMember.prototype.get$isFactory = function() { return this.isFactory; }; | 15285 MethodMember.prototype.get$isFactory = function() { return this.isFactory; }; |
15202 MethodMember.prototype.set$isFactory = function(value) { return this.isFactory =
value; }; | 15286 MethodMember.prototype.set$isFactory = function(value) { return this.isFactory =
value; }; |
15203 MethodMember.prototype.get$isLambda = function() { return this.isLambda; }; | 15287 MethodMember.prototype.get$isLambda = function() { return this.isLambda; }; |
15204 MethodMember.prototype.set$isLambda = function(value) { return this.isLambda = v
alue; }; | 15288 MethodMember.prototype.set$isLambda = function(value) { return this.isLambda = v
alue; }; |
(...skipping 12 matching lines...) Expand all Loading... |
15217 return false; | 15301 return false; |
15218 } | 15302 } |
15219 MethodMember.prototype.get$canSet = function() { | 15303 MethodMember.prototype.get$canSet = function() { |
15220 return false; | 15304 return false; |
15221 } | 15305 } |
15222 MethodMember.prototype.get$span = function() { | 15306 MethodMember.prototype.get$span = function() { |
15223 var $0; | 15307 var $0; |
15224 return (($0 = this.definition == null ? null : this.definition.span) && $0.is$
SourceSpan()); | 15308 return (($0 = this.definition == null ? null : this.definition.span) && $0.is$
SourceSpan()); |
15225 } | 15309 } |
15226 MethodMember.prototype.get$constructorName = function() { | 15310 MethodMember.prototype.get$constructorName = function() { |
15227 var $0; | 15311 var returnType = this.definition.returnType; |
15228 var returnType = (($0 = this.definition.returnType) && $0.is$NameTypeReference
()); | 15312 if ($notnull_bool(returnType == null)) return ''; |
15229 if (returnType == null) return ''; | 15313 if ((returnType instanceof GenericTypeReference)) { |
15230 if (returnType.names != null) { | 15314 return ''; |
15231 return $assert_String(returnType.names.$index(0).get$name()); | |
15232 } | 15315 } |
15233 else if (returnType.name != null) { | 15316 if ($notnull_bool($ne(returnType.get$names(), null))) { |
15234 return returnType.name.name; | 15317 return $assert_String(returnType.get$names().$index(0).get$name()); |
| 15318 } |
| 15319 else if ($notnull_bool($ne(returnType.get$name(), null))) { |
| 15320 return $assert_String(returnType.get$name().get$name()); |
15235 } | 15321 } |
15236 $globals.world.internalError('no valid constructor name', this.definition.span
); | 15322 $globals.world.internalError('no valid constructor name', this.definition.span
); |
15237 } | 15323 } |
15238 MethodMember.prototype.get$functionType = function() { | 15324 MethodMember.prototype.get$functionType = function() { |
15239 if (this._functionType == null) { | 15325 if (this._functionType == null) { |
15240 this._functionType = this.get$library().getOrAddFunctionType(this.name, this
.definition, this.declaringType); | 15326 this._functionType = this.get$library().getOrAddFunctionType(this.declaringT
ype, this.name, this.definition); |
15241 if (this.parameters == null) { | 15327 if (this.parameters == null) { |
15242 this.resolve(this.declaringType); | 15328 this.resolve(); |
15243 } | 15329 } |
15244 } | 15330 } |
15245 return this._functionType; | 15331 return this._functionType; |
15246 } | 15332 } |
15247 MethodMember.prototype.override = function(other) { | 15333 MethodMember.prototype.override = function(other) { |
15248 if (!$notnull_bool(Member.prototype.override.call(this, other))) return false; | 15334 if (!$notnull_bool(Member.prototype.override.call(this, other))) return false; |
15249 if ($notnull_bool(other.get$isMethod())) { | 15335 if ($notnull_bool(other.get$isMethod())) { |
15250 return true; | 15336 return true; |
15251 } | 15337 } |
15252 else { | 15338 else { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15359 var $list = this.parameters; | 15445 var $list = this.parameters; |
15360 for (var $i = 0;$i < $list.length; $i++) { | 15446 for (var $i = 0;$i < $list.length; $i++) { |
15361 var p = $list.$index($i); | 15447 var p = $list.$index($i); |
15362 p.genValue$2(this, this.generator); | 15448 p.genValue$2(this, this.generator); |
15363 } | 15449 } |
15364 } | 15450 } |
15365 MethodMember.prototype.invoke = function(context, node, target, args, isDynamic)
{ | 15451 MethodMember.prototype.invoke = function(context, node, target, args, isDynamic)
{ |
15366 var $0; | 15452 var $0; |
15367 if (this.parameters == null) { | 15453 if (this.parameters == null) { |
15368 $globals.world.info(('surprised to need to resolve: ' + this.declaringType.n
ame + '.' + this.name)); | 15454 $globals.world.info(('surprised to need to resolve: ' + this.declaringType.n
ame + '.' + this.name)); |
15369 this.resolve(this.declaringType); | 15455 this.resolve(); |
15370 } | 15456 } |
15371 this.declaringType.genMethod(this); | 15457 this.declaringType.genMethod(this); |
15372 if ($notnull_bool(this.isStatic) || $notnull_bool(this.isFactory)) { | 15458 if ($notnull_bool(this.isStatic) || $notnull_bool(this.isFactory)) { |
15373 this.declaringType.markUsed(); | 15459 this.declaringType.markUsed(); |
15374 } | 15460 } |
15375 if ($notnull_bool(this.get$isNative()) && this.returnType != null) this.return
Type.markUsed(); | 15461 if ($notnull_bool(this.get$isNative()) && this.returnType != null) this.return
Type.markUsed(); |
15376 if (!$notnull_bool(this.namesInOrder(args))) { | 15462 if (!$notnull_bool(this.namesInOrder(args))) { |
15377 return context.findMembers(this.name).invokeOnVar(context, node, target, arg
s); | 15463 return context.findMembers(this.name).invokeOnVar(context, node, target, arg
s); |
15378 } | 15464 } |
15379 var argsCode = []; | 15465 var argsCode = []; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15429 var p = this.indexOfParameter($assert_String(name)); | 15515 var p = this.indexOfParameter($assert_String(name)); |
15430 if (p < 0) { | 15516 if (p < 0) { |
15431 return this._argError(context, node, target, args, ('method does not h
ave optional parameter "' + name + '"')); | 15517 return this._argError(context, node, target, args, ('method does not h
ave optional parameter "' + name + '"')); |
15432 } | 15518 } |
15433 else if (p < bareCount) { | 15519 else if (p < bareCount) { |
15434 return this._argError(context, node, target, args, ('argument "' + nam
e + '" passed as positional and named')); | 15520 return this._argError(context, node, target, args, ('argument "' + nam
e + '" passed as positional and named')); |
15435 } | 15521 } |
15436 } | 15522 } |
15437 $globals.world.internalError(('wrong named arguments calling ' + this.name
), node.span); | 15523 $globals.world.internalError(('wrong named arguments calling ' + this.name
), node.span); |
15438 } | 15524 } |
15439 Arguments.removeTrailingNulls((argsCode && argsCode.is$List$Value())); | 15525 Arguments.removeTrailingNulls((argsCode && argsCode.is$List_Value())); |
15440 } | 15526 } |
15441 var argsString = Strings.join((argsCode && argsCode.is$List$String()), ', '); | 15527 var argsString = Strings.join((argsCode && argsCode.is$List_String()), ', '); |
15442 if ($notnull_bool(this.get$isConstructor())) { | 15528 if ($notnull_bool(this.get$isConstructor())) { |
15443 return this._invokeConstructor(context, node, target, args, argsString); | 15529 return this._invokeConstructor(context, node, target, args, argsString); |
15444 } | 15530 } |
15445 if ($notnull_bool(target.isSuper)) { | 15531 if ($notnull_bool(target.isSuper)) { |
15446 return new Value(this.get$inferredResult(), ('' + this.declaringType.get$jsn
ame() + '.prototype.' + this.get$jsname() + '.call(' + argsString + ')'), node.s
pan, true); | 15532 return new Value(this.get$inferredResult(), ('' + this.declaringType.get$jsn
ame() + '.prototype.' + this.get$jsname() + '.call(' + argsString + ')'), node.s
pan, true); |
15447 } | 15533 } |
15448 if ($notnull_bool(this.get$isOperator())) { | 15534 if ($notnull_bool(this.get$isOperator())) { |
15449 return this._invokeBuiltin(context, node, target, args, argsCode, isDynamic)
; | 15535 return this._invokeBuiltin(context, node, target, args, argsCode, isDynamic)
; |
15450 } | 15536 } |
15451 if ($notnull_bool(this.isFactory)) { | 15537 if ($notnull_bool(this.isFactory)) { |
15452 $assert(target.isType, "target.isType", "member.dart", 969, 14); | 15538 $assert(target.isType, "target.isType", "member.dart", 945, 14); |
15453 return new Value(target.type, ('' + this.get$generatedFactoryName() + '(' +
argsString + ')'), node.span, true); | 15539 return new Value(target.type, ('' + this.get$generatedFactoryName() + '(' +
argsString + ')'), node.span, true); |
15454 } | 15540 } |
15455 if ($notnull_bool(this.isStatic)) { | 15541 if ($notnull_bool(this.isStatic)) { |
15456 if ($notnull_bool(this.declaringType.get$isTop())) { | 15542 if ($notnull_bool(this.declaringType.get$isTop())) { |
15457 return new Value(this.get$inferredResult(), ('' + this.get$jsname() + '('
+ argsString + ')'), node != null ? node.span : node, true); | 15543 return new Value(this.get$inferredResult(), ('' + this.get$jsname() + '('
+ argsString + ')'), node != null ? node.span : node, true); |
15458 } | 15544 } |
15459 return new Value(this.get$inferredResult(), ('' + this.declaringType.get$jsn
ame() + '.' + this.get$jsname() + '(' + argsString + ')'), node.span, true); | 15545 return new Value(this.get$inferredResult(), ('' + this.declaringType.get$jsn
ame() + '.' + this.get$jsname() + '(' + argsString + ')'), node.span, true); |
15460 } | 15546 } |
15461 var code = ('' + target.code + '.' + this.get$jsname() + '(' + argsString + ')
'); | 15547 var code = ('' + target.code + '.' + this.get$jsname() + '(' + argsString + ')
'); |
15462 if ($notnull_bool(target.get$isConst())) { | 15548 if ($notnull_bool(target.get$isConst())) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15529 if ($notnull_bool(value == null)) { | 15615 if ($notnull_bool(value == null)) { |
15530 value = this.parameters.$index(j).get$value(); | 15616 value = this.parameters.$index(j).get$value(); |
15531 } | 15617 } |
15532 } | 15618 } |
15533 this.generator._scope._vars.$setindex(name, value); | 15619 this.generator._scope._vars.$setindex(name, value); |
15534 } | 15620 } |
15535 var $list = this.definition.initializers; | 15621 var $list = this.definition.initializers; |
15536 for (var $i = 0;$i < $list.length; $i++) { | 15622 for (var $i = 0;$i < $list.length; $i++) { |
15537 var init = $list.$index($i); | 15623 var init = $list.$index($i); |
15538 if ((init instanceof CallExpression)) { | 15624 if ((init instanceof CallExpression)) { |
15539 var delegateArgs = this.generator._makeArgs((($0 = init.get$arguments())
&& $0.is$List$ArgumentNode())); | 15625 var delegateArgs = this.generator._makeArgs((($0 = init.get$arguments())
&& $0.is$List_ArgumentNode())); |
15540 var value = this.initDelegate.invoke(this.generator, node, target, (dele
gateArgs && delegateArgs.is$Arguments()), false); | 15626 var value = this.initDelegate.invoke(this.generator, node, target, (dele
gateArgs && delegateArgs.is$Arguments()), false); |
15541 if ((init.get$target() instanceof ThisExpression)) { | 15627 if ((init.get$target() instanceof ThisExpression)) { |
15542 return (value && value.is$Value()); | 15628 return (value && value.is$Value()); |
15543 } | 15629 } |
15544 else { | 15630 else { |
15545 if ((value instanceof GlobalValue)) { | 15631 if ((value instanceof GlobalValue)) { |
15546 value = value.get$exp(); | 15632 value = value.get$exp(); |
15547 } | 15633 } |
15548 var $list0 = value.get$fields().getKeys$0(); | 15634 var $list0 = value.get$fields().getKeys$0(); |
15549 for (var $i0 = value.get$fields().getKeys$0().iterator$0(); $i0.hasNex
t$0(); ) { | 15635 for (var $i0 = value.get$fields().getKeys$0().iterator$0(); $i0.hasNex
t$0(); ) { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15722 val1 = val1.substring$2(1, val1.length - 1); | 15808 val1 = val1.substring$2(1, val1.length - 1); |
15723 } | 15809 } |
15724 var value = ('' + val0 + val1); | 15810 var value = ('' + val0 + val1); |
15725 value = '"' + value.replaceAll$2('"', '\\"') + '"'; | 15811 value = '"' + value.replaceAll$2('"', '\\"') + '"'; |
15726 return EvaluatedValue.EvaluatedValue$factory($globals.world.stringType,
value, $assert_String(value), node.span); | 15812 return EvaluatedValue.EvaluatedValue$factory($globals.world.stringType,
value, $assert_String(value), node.span); |
15727 } | 15813 } |
15728 args.values.$index(0).invoke$4(context, 'toString', node, Arguments.get$EM
PTY()); | 15814 args.values.$index(0).invoke$4(context, 'toString', node, Arguments.get$EM
PTY()); |
15729 return new Value(this.declaringType, ('' + target.code + ' + ' + argsCode.
$index(0)), node.span, true); | 15815 return new Value(this.declaringType, ('' + target.code + ' + ' + argsCode.
$index(0)), node.span, true); |
15730 } | 15816 } |
15731 } | 15817 } |
15732 else if ($notnull_bool(this.declaringType.get$isNativeType())) { | 15818 else if ($notnull_bool(this.declaringType.get$isNative())) { |
15733 if (this.name == '\$index') { | 15819 if (this.name == '\$index') { |
15734 return new Value(this.returnType, ('' + target.code + '[' + argsCode.$inde
x(0) + ']'), node.span, true); | 15820 return new Value(this.returnType, ('' + target.code + '[' + argsCode.$inde
x(0) + ']'), node.span, true); |
15735 } | 15821 } |
15736 else if (this.name == '\$setindex') { | 15822 else if (this.name == '\$setindex') { |
15737 return new Value(this.returnType, ('' + target.code + '[' + argsCode.$inde
x(0) + '] = ' + argsCode.$index(1)), node.span, true); | 15823 return new Value(this.returnType, ('' + target.code + '[' + argsCode.$inde
x(0) + '] = ' + argsCode.$index(1)), node.span, true); |
15738 } | 15824 } |
15739 } | 15825 } |
15740 if (this.name == '\$eq' || this.name == '\$ne') { | 15826 if (this.name == '\$eq' || this.name == '\$ne') { |
15741 var op = this.name == '\$eq' ? '==' : '!='; | 15827 var op = this.name == '\$eq' ? '==' : '!='; |
15742 if (this.name == '\$ne') { | 15828 if (this.name == '\$ne') { |
15743 target.invoke(context, '\$eq', node, args, isDynamic); | 15829 target.invoke(context, '\$eq', node, args, isDynamic); |
15744 } | 15830 } |
15745 if ($notnull_bool(allConst)) { | 15831 if ($notnull_bool(allConst)) { |
15746 var val0 = target.get$dynamic().get$actualValue(); | 15832 var val0 = target.get$dynamic().get$actualValue(); |
15747 var val1 = args.values.$index(0).get$dynamic().get$actualValue(); | 15833 var val1 = args.values.$index(0).get$dynamic().get$actualValue(); |
15748 var newVal = this.name == '\$eq' ? $eq(val0, val1) : $ne(val0, val1); | 15834 var newVal = this.name == '\$eq' ? $eq(val0, val1) : $ne(val0, val1); |
15749 return EvaluatedValue.EvaluatedValue$factory($globals.world.nonNullBool, n
ewVal, ("" + newVal), node.span); | 15835 return EvaluatedValue.EvaluatedValue$factory($globals.world.nonNullBool, n
ewVal, ("" + newVal), node.span); |
15750 } | 15836 } |
15751 if ($notnull_bool($eq(argsCode.$index(0), 'null'))) { | 15837 if ($notnull_bool($eq(argsCode.$index(0), 'null'))) { |
15752 return new Value(this.get$inferredResult(), ('' + target.code + ' ' + op +
' null'), node.span, true); | 15838 return new Value(this.get$inferredResult(), ('' + target.code + ' ' + op +
' null'), node.span, true); |
15753 } | 15839 } |
15754 else if ($notnull_bool(target.type.get$isNum()) || $notnull_bool(target.type
.get$isString())) { | 15840 else if ($notnull_bool(target.type.get$isNum()) || $notnull_bool(target.type
.get$isString())) { |
15755 return new Value(this.get$inferredResult(), ('' + target.code + ' ' + op +
' ' + argsCode.$index(0)), node.span, true); | 15841 return new Value(this.get$inferredResult(), ('' + target.code + ' ' + op +
' ' + argsCode.$index(0)), node.span, true); |
15756 } | 15842 } |
15757 $globals.world.gen.corejs.useOperator(this.name); | 15843 $globals.world.gen.corejs.useOperator(this.name); |
15758 return new Value(this.get$inferredResult(), ('' + this.name + '(' + target.c
ode + ', ' + argsCode.$index(0) + ')'), node.span, true); | 15844 return new Value(this.get$inferredResult(), ('' + this.name + '(' + target.c
ode + ', ' + argsCode.$index(0) + ')'), node.span, true); |
15759 } | 15845 } |
15760 if ($notnull_bool(this.get$isCallMethod())) { | 15846 if ($notnull_bool(this.get$isCallMethod())) { |
15761 this.declaringType.markUsed(); | 15847 this.declaringType.markUsed(); |
15762 return new Value(this.get$inferredResult(), ('' + target.code + '(' + String
s.join((argsCode && argsCode.is$List$String()), ", ") + ')'), node.span, true); | 15848 return new Value(this.get$inferredResult(), ('' + target.code + '(' + String
s.join((argsCode && argsCode.is$List_String()), ", ") + ')'), node.span, true); |
15763 } | 15849 } |
15764 if (this.name == '\$index') { | 15850 if (this.name == '\$index') { |
15765 $globals.world.gen.corejs.useIndex = true; | 15851 $globals.world.gen.corejs.useIndex = true; |
15766 } | 15852 } |
15767 else if (this.name == '\$setindex') { | 15853 else if (this.name == '\$setindex') { |
15768 $globals.world.gen.corejs.useSetIndex = true; | 15854 $globals.world.gen.corejs.useSetIndex = true; |
15769 } | 15855 } |
15770 var argsString = Strings.join((argsCode && argsCode.is$List$String()), ', '); | 15856 var argsString = Strings.join((argsCode && argsCode.is$List_String()), ', '); |
15771 return new Value(this.get$inferredResult(), ('' + target.code + '.' + this.get
$jsname() + '(' + argsString + ')'), node.span, true); | 15857 return new Value(this.get$inferredResult(), ('' + target.code + '.' + this.get
$jsname() + '(' + argsString + ')'), node.span, true); |
15772 } | 15858 } |
15773 MethodMember.prototype.resolve = function(inType) { | 15859 MethodMember.prototype.resolve = function() { |
15774 var $0; | 15860 var $0; |
15775 this.isStatic = inType.get$isTop(); | 15861 this.isStatic = this.declaringType.get$isTop(); |
15776 this.isConst = false; | 15862 this.isConst = false; |
15777 this.isFactory = false; | 15863 this.isFactory = false; |
15778 this.isAbstract = !$notnull_bool(this.declaringType.get$isClass()); | 15864 this.isAbstract = !$notnull_bool(this.declaringType.get$isClass()); |
15779 if (this.definition.modifiers != null) { | 15865 if (this.definition.modifiers != null) { |
15780 var $list = this.definition.modifiers; | 15866 var $list = this.definition.modifiers; |
15781 for (var $i = 0;$i < $list.length; $i++) { | 15867 for (var $i = 0;$i < $list.length; $i++) { |
15782 var mod = $list.$index($i); | 15868 var mod = $list.$index($i); |
15783 if ($notnull_bool($eq(mod.get$kind(), 86/*TokenKind.STATIC*/))) { | 15869 if ($notnull_bool($eq(mod.get$kind(), 86/*TokenKind.STATIC*/))) { |
15784 if ($notnull_bool(this.isStatic)) { | 15870 if ($notnull_bool(this.isStatic)) { |
15785 $globals.world.error('duplicate static modifier', (($0 = mod.get$span(
)) && $0.is$SourceSpan())); | 15871 $globals.world.error('duplicate static modifier', (($0 = mod.get$span(
)) && $0.is$SourceSpan())); |
(...skipping 24 matching lines...) Expand all Loading... |
15810 this.isAbstract = true; | 15896 this.isAbstract = true; |
15811 } | 15897 } |
15812 else { | 15898 else { |
15813 $globals.world.error(('' + mod + ' modifier not allowed on method'), (($
0 = mod.get$span()) && $0.is$SourceSpan())); | 15899 $globals.world.error(('' + mod + ' modifier not allowed on method'), (($
0 = mod.get$span()) && $0.is$SourceSpan())); |
15814 } | 15900 } |
15815 } | 15901 } |
15816 } | 15902 } |
15817 if ($notnull_bool(this.isFactory)) { | 15903 if ($notnull_bool(this.isFactory)) { |
15818 this.isStatic = true; | 15904 this.isStatic = true; |
15819 } | 15905 } |
| 15906 if (this.definition.typeParameters != null) { |
| 15907 if (!$notnull_bool(this.isFactory)) { |
| 15908 $globals.world.error('Only factories are allowed to have explicit type par
ameters', (($0 = this.definition.typeParameters.$index(0).get$span()) && $0.is$S
ourceSpan())); |
| 15909 } |
| 15910 else { |
| 15911 this.typeParameters = this.definition.typeParameters; |
| 15912 var $list = this.definition.typeParameters; |
| 15913 for (var $i = 0;$i < $list.length; $i++) { |
| 15914 var tp = $list.$index($i); |
| 15915 tp.set$enclosingElement(this); |
| 15916 tp.resolve$0(); |
| 15917 } |
| 15918 } |
| 15919 } |
15820 if ($notnull_bool(this.get$isOperator()) && $notnull_bool(this.isStatic) && !$
notnull_bool(this.get$isCallMethod())) { | 15920 if ($notnull_bool(this.get$isOperator()) && $notnull_bool(this.isStatic) && !$
notnull_bool(this.get$isCallMethod())) { |
15821 $globals.world.error(('operator method may not be static "' + this.name + '"
'), this.get$span()); | 15921 $globals.world.error(('operator method may not be static "' + this.name + '"
'), this.get$span()); |
15822 } | 15922 } |
15823 if ($notnull_bool(this.isAbstract)) { | 15923 if ($notnull_bool(this.isAbstract)) { |
15824 if (this.definition.body != null && !(this.declaringType.get$definition() in
stanceof FunctionTypeDefinition)) { | 15924 if (this.definition.body != null && !(this.declaringType.get$definition() in
stanceof FunctionTypeDefinition)) { |
15825 $globals.world.error('abstract method can not have a body', this.get$span(
)); | 15925 $globals.world.error('abstract method can not have a body', this.get$span(
)); |
15826 } | 15926 } |
15827 if ($notnull_bool(this.isStatic) && !(this.declaringType.get$definition() in
stanceof FunctionTypeDefinition)) { | 15927 if ($notnull_bool(this.isStatic) && !(this.declaringType.get$definition() in
stanceof FunctionTypeDefinition)) { |
15828 $globals.world.error('static method can not be abstract', this.get$span())
; | 15928 $globals.world.error('static method can not be abstract', this.get$span())
; |
15829 } | 15929 } |
15830 } | 15930 } |
15831 else { | 15931 else { |
15832 if (this.definition.body == null && !$notnull_bool(this.get$isConstructor())
) { | 15932 if (this.definition.body == null && !$notnull_bool(this.get$isConstructor())
) { |
15833 $globals.world.error('method needs a body', this.get$span()); | 15933 $globals.world.error('method needs a body', this.get$span()); |
15834 } | 15934 } |
15835 } | 15935 } |
15836 if ($notnull_bool(this.get$isConstructor())) { | 15936 if ($notnull_bool(this.get$isConstructor()) && !$notnull_bool(this.isFactory))
{ |
15837 this.returnType = this.declaringType; | 15937 this.returnType = this.declaringType; |
15838 } | 15938 } |
15839 else { | 15939 else { |
15840 this.returnType = inType.resolveType(this.definition.returnType, false); | 15940 this.returnType = this.resolveType(this.definition.returnType, false); |
15841 if ($notnull_bool(this.isStatic) && $notnull_bool(this.returnType.get$hasTyp
eParams())) { | |
15842 $globals.world.error('using type parameter in static context', this.defini
tion.returnType.span); | |
15843 } | |
15844 } | 15941 } |
15845 this.parameters = []; | 15942 this.parameters = []; |
15846 var $list = this.definition.formals; | 15943 var $list = this.definition.formals; |
15847 for (var $i = 0;$i < $list.length; $i++) { | 15944 for (var $i = 0;$i < $list.length; $i++) { |
15848 var formal = $list.$index($i); | 15945 var formal = $list.$index($i); |
15849 var param = new Parameter(formal); | 15946 var param = new Parameter(formal, this); |
15850 param.resolve$2(this, inType); | 15947 param.resolve$0(); |
15851 this.parameters.add(param); | 15948 this.parameters.add(param); |
15852 } | 15949 } |
15853 if (!$notnull_bool(this.isLambda)) { | 15950 if (!$notnull_bool(this.isLambda)) { |
15854 this.get$library()._addMember(this); | 15951 this.get$library()._addMember(this); |
15855 } | 15952 } |
15856 } | 15953 } |
15857 MethodMember.prototype.findTypeVariable = function(node, isRequired) { | |
15858 if (!$notnull_bool(this.isFactory) || !(node instanceof NameTypeReference)) { | |
15859 return Member.prototype.resolveType.call(this, node, isRequired); | |
15860 } | |
15861 else { | |
15862 return Member.prototype.resolveType.call(this, node, false); | |
15863 } | |
15864 } | |
15865 MethodMember.prototype.resolveType = function(node, isRequired) { | |
15866 var $0; | |
15867 if (node != null && $notnull_bool(this.isFactory) && $notnull_bool(isRequired)
) { | |
15868 if ((node instanceof GenericTypeReference)) { | |
15869 var genericReference = (node && node.is$GenericTypeReference()); | |
15870 var baseType = Member.prototype.resolveType.call(this, genericReference.ba
seType, isRequired); | |
15871 var typeArguments = []; | |
15872 var $list = genericReference.typeArguments; | |
15873 for (var $i = 0;$i < $list.length; $i++) { | |
15874 var ref = $list.$index($i); | |
15875 typeArguments.add$1(this.findTypeVariable(ref, isRequired)); | |
15876 } | |
15877 node.type = (($0 = baseType.getOrMakeConcreteType$1(typeArguments)) && $0.
is$lang_Type()); | |
15878 return node.type; | |
15879 } | |
15880 } | |
15881 return Member.prototype.resolveType.call(this, node, isRequired); | |
15882 } | |
15883 MethodMember.prototype._get$3 = function($0, $1, $2) { | 15954 MethodMember.prototype._get$3 = function($0, $1, $2) { |
15884 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), false); | 15955 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), false); |
15885 }; | 15956 }; |
15886 MethodMember.prototype._set$4 = function($0, $1, $2, $3) { | 15957 MethodMember.prototype._set$4 = function($0, $1, $2, $3) { |
15887 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value()), false); | 15958 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), (
$2 && $2.is$Value()), ($3 && $3.is$Value()), false); |
15888 }; | 15959 }; |
15889 MethodMember.prototype.canInvoke$2 = function($0, $1) { | 15960 MethodMember.prototype.canInvoke$2 = function($0, $1) { |
15890 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments(
))); | 15961 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments(
))); |
15891 }; | 15962 }; |
15892 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) { | 15963 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) { |
15893 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); | 15964 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); |
15894 }; | 15965 }; |
15895 MethodMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic)
{ | 15966 MethodMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic)
{ |
15896 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); | 15967 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); |
15897 }; | 15968 }; |
15898 MethodMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) { | 15969 MethodMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) { |
15899 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); | 15970 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()),
($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); |
15900 }; | 15971 }; |
15901 MethodMember.prototype.namesInOrder$1 = function($0) { | 15972 MethodMember.prototype.namesInOrder$1 = function($0) { |
15902 return this.namesInOrder(($0 && $0.is$Arguments())); | 15973 return this.namesInOrder(($0 && $0.is$Arguments())); |
15903 }; | 15974 }; |
15904 MethodMember.prototype.provideFieldSyntax$0 = MethodMember.prototype.provideFiel
dSyntax; | 15975 MethodMember.prototype.provideFieldSyntax$0 = MethodMember.prototype.provideFiel
dSyntax; |
15905 MethodMember.prototype.providePropertySyntax$0 = MethodMember.prototype.provideP
ropertySyntax; | 15976 MethodMember.prototype.providePropertySyntax$0 = MethodMember.prototype.provideP
ropertySyntax; |
15906 MethodMember.prototype.resolve$1 = function($0) { | 15977 MethodMember.prototype.resolve$0 = MethodMember.prototype.resolve; |
15907 return this.resolve(($0 && $0.is$lang_Type())); | |
15908 }; | |
15909 // ********** Code for MemberSet ************** | 15978 // ********** Code for MemberSet ************** |
15910 function MemberSet(member, isVar) { | 15979 function MemberSet(member, isVar) { |
15911 this.name = member.name; | 15980 this.name = member.name; |
15912 this.members = [member]; | 15981 this.members = [member]; |
15913 this.jsname = member.get$jsname(); | 15982 this.jsname = member.get$jsname(); |
15914 this.isVar = isVar; | 15983 this.isVar = isVar; |
15915 // Initializers done | 15984 // Initializers done |
15916 } | 15985 } |
15917 MemberSet.prototype.is$MemberSet = function(){return this;}; | 15986 MemberSet.prototype.is$MemberSet = function(){return this;}; |
15918 MemberSet.prototype.get$name = function() { return this.name; }; | 15987 MemberSet.prototype.get$name = function() { return this.name; }; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15980 var returnValue; | 16049 var returnValue; |
15981 var targets = this.members.filter((function (m) { | 16050 var targets = this.members.filter((function (m) { |
15982 return m.get$canGet(); | 16051 return m.get$canGet(); |
15983 }) | 16052 }) |
15984 ); | 16053 ); |
15985 if ($notnull_bool(this.isVar)) { | 16054 if ($notnull_bool(this.isVar)) { |
15986 targets.forEach$1((function (m) { | 16055 targets.forEach$1((function (m) { |
15987 return m._get(context, node, target, true); | 16056 return m._get(context, node, target, true); |
15988 }) | 16057 }) |
15989 ); | 16058 ); |
15990 returnValue = new Value(this._foldTypes((targets && targets.is$List$Member()
)), null, node.span, true); | 16059 returnValue = new Value(this._foldTypes((targets && targets.is$List_Member()
)), null, node.span, true); |
15991 } | 16060 } |
15992 else { | 16061 else { |
15993 if (this.members.length == 1) { | 16062 if (this.members.length == 1) { |
15994 return this.members.$index(0)._get(context, node, target, isDynamic); | 16063 return this.members.$index(0)._get(context, node, target, isDynamic); |
15995 } | 16064 } |
15996 else if ($notnull_bool($eq(targets.length, 1))) { | 16065 else if ($notnull_bool($eq(targets.length, 1))) { |
15997 return targets.$index(0)._get(context, node, target, isDynamic); | 16066 return targets.$index(0)._get(context, node, target, isDynamic); |
15998 } | 16067 } |
15999 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) { | 16068 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) { |
16000 var member = $i.next$0(); | 16069 var member = $i.next$0(); |
(...skipping 18 matching lines...) Expand all Loading... |
16019 var returnValue; | 16088 var returnValue; |
16020 var targets = this.members.filter((function (m) { | 16089 var targets = this.members.filter((function (m) { |
16021 return m.get$canSet(); | 16090 return m.get$canSet(); |
16022 }) | 16091 }) |
16023 ); | 16092 ); |
16024 if ($notnull_bool(this.isVar)) { | 16093 if ($notnull_bool(this.isVar)) { |
16025 targets.forEach$1((function (m) { | 16094 targets.forEach$1((function (m) { |
16026 return m._set(context, node, target, value, true); | 16095 return m._set(context, node, target, value, true); |
16027 }) | 16096 }) |
16028 ); | 16097 ); |
16029 returnValue = new Value(this._foldTypes((targets && targets.is$List$Member()
)), null, node.span, true); | 16098 returnValue = new Value(this._foldTypes((targets && targets.is$List_Member()
)), null, node.span, true); |
16030 } | 16099 } |
16031 else { | 16100 else { |
16032 if (this.members.length == 1) { | 16101 if (this.members.length == 1) { |
16033 return this.members.$index(0)._set(context, node, target, value, isDynamic
); | 16102 return this.members.$index(0)._set(context, node, target, value, isDynamic
); |
16034 } | 16103 } |
16035 else if ($notnull_bool($eq(targets.length, 1))) { | 16104 else if ($notnull_bool($eq(targets.length, 1))) { |
16036 return targets.$index(0)._set(context, node, target, value, isDynamic); | 16105 return targets.$index(0)._set(context, node, target, value, isDynamic); |
16037 } | 16106 } |
16038 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) { | 16107 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) { |
16039 var member = $i.next$0(); | 16108 var member = $i.next$0(); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16123 $globals.world.objectType.varStubs = $map([]); | 16192 $globals.world.objectType.varStubs = $map([]); |
16124 } | 16193 } |
16125 var stubName = _getCallStubName(this.name, args); | 16194 var stubName = _getCallStubName(this.name, args); |
16126 var stub = $globals.world.objectType.varStubs.$index(stubName); | 16195 var stub = $globals.world.objectType.varStubs.$index(stubName); |
16127 if ($notnull_bool(stub == null)) { | 16196 if ($notnull_bool(stub == null)) { |
16128 var mset = context.findMembers(this.name).members; | 16197 var mset = context.findMembers(this.name).members; |
16129 var targets = mset.filter((function (m) { | 16198 var targets = mset.filter((function (m) { |
16130 return m.canInvoke$2(context, args); | 16199 return m.canInvoke$2(context, args); |
16131 }) | 16200 }) |
16132 ); | 16201 ); |
16133 stub = new VarMethodSet($assert_String(stubName), targets, args, this._foldT
ypes((targets && targets.is$List$Member()))); | 16202 stub = new VarMethodSet($assert_String(stubName), targets, args, this._foldT
ypes((targets && targets.is$List_Member()))); |
16134 $globals.world.objectType.varStubs.$setindex(stubName, stub); | 16203 $globals.world.objectType.varStubs.$setindex(stubName, stub); |
16135 } | 16204 } |
16136 return (stub && stub.is$VarMember()); | 16205 return (stub && stub.is$VarMember()); |
16137 } | 16206 } |
16138 MemberSet.prototype._foldTypes = function(targets) { | 16207 MemberSet.prototype._foldTypes = function(targets) { |
16139 var $0; | 16208 var $0; |
16140 return (($0 = reduce(map(targets, (function (t) { | 16209 return (($0 = reduce(map(targets, (function (t) { |
16141 return t.get$returnType(); | 16210 return t.get$returnType(); |
16142 }) | 16211 }) |
16143 ), lang_Type.union, $globals.world.varType)) && $0.is$lang_Type()); | 16212 ), lang_Type.union, $globals.world.varType)) && $0.is$lang_Type()); |
(...skipping 24 matching lines...) Expand all Loading... |
16168 function FactoryMap() { | 16237 function FactoryMap() { |
16169 this.factories = $map([]); | 16238 this.factories = $map([]); |
16170 // Initializers done | 16239 // Initializers done |
16171 } | 16240 } |
16172 FactoryMap.prototype.getFactoriesFor = function(typeName) { | 16241 FactoryMap.prototype.getFactoriesFor = function(typeName) { |
16173 var ret = this.factories.$index(typeName); | 16242 var ret = this.factories.$index(typeName); |
16174 if ($notnull_bool(ret == null)) { | 16243 if ($notnull_bool(ret == null)) { |
16175 ret = $map([]); | 16244 ret = $map([]); |
16176 this.factories.$setindex(typeName, ret); | 16245 this.factories.$setindex(typeName, ret); |
16177 } | 16246 } |
16178 return (ret && ret.is$Map$String$Member()); | 16247 return (ret && ret.is$Map_String$Member()); |
16179 } | 16248 } |
16180 FactoryMap.prototype.addFactory = function(typeName, name, member) { | 16249 FactoryMap.prototype.addFactory = function(typeName, name, member) { |
16181 this.getFactoriesFor(typeName).$setindex(name, member); | 16250 this.getFactoriesFor(typeName).$setindex(name, member); |
16182 } | 16251 } |
16183 FactoryMap.prototype.getFactory = function(typeName, name) { | 16252 FactoryMap.prototype.getFactory = function(typeName, name) { |
16184 var $0; | 16253 var $0; |
16185 return (($0 = this.getFactoriesFor(typeName).$index(name)) && $0.is$Member()); | 16254 return (($0 = this.getFactoriesFor(typeName).$index(name)) && $0.is$Member()); |
16186 } | 16255 } |
16187 FactoryMap.prototype.forEach = function(f) { | 16256 FactoryMap.prototype.forEach = function(f) { |
16188 this.factories.forEach((function (_, constructors) { | 16257 this.factories.forEach((function (_, constructors) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16248 SourceFile.prototype.get$lineStarts = function() { | 16317 SourceFile.prototype.get$lineStarts = function() { |
16249 if (this._lineStarts == null) { | 16318 if (this._lineStarts == null) { |
16250 var starts = [0]; | 16319 var starts = [0]; |
16251 var index = 0; | 16320 var index = 0; |
16252 while (index < this.get$text().length) { | 16321 while (index < this.get$text().length) { |
16253 index = this.get$text().indexOf('\n', $assert_num(index)) + 1; | 16322 index = this.get$text().indexOf('\n', $assert_num(index)) + 1; |
16254 if (index <= 0) break; | 16323 if (index <= 0) break; |
16255 starts.add$1(index); | 16324 starts.add$1(index); |
16256 } | 16325 } |
16257 starts.add$1(this.get$text().length + 1); | 16326 starts.add$1(this.get$text().length + 1); |
16258 this._lineStarts = (starts && starts.is$List$int()); | 16327 this._lineStarts = (starts && starts.is$List_int()); |
16259 } | 16328 } |
16260 return this._lineStarts; | 16329 return this._lineStarts; |
16261 } | 16330 } |
16262 SourceFile.prototype.getLine = function(position) { | 16331 SourceFile.prototype.getLine = function(position) { |
16263 var starts = this.get$lineStarts(); | 16332 var starts = this.get$lineStarts(); |
16264 for (var i = 0; | 16333 for (var i = 0; |
16265 i < $assert_num(starts.length); i++) { | 16334 i < $assert_num(starts.length); i++) { |
16266 if (starts.$index(i) > position) return i - 1; | 16335 if (starts.$index(i) > position) return i - 1; |
16267 } | 16336 } |
16268 $globals.world.internalError('bad position'); | 16337 $globals.world.internalError('bad position'); |
(...skipping 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18180 } | 18249 } |
18181 lang_Parser.prototype.compilationUnit = function() { | 18250 lang_Parser.prototype.compilationUnit = function() { |
18182 var ret = []; | 18251 var ret = []; |
18183 this._maybeEat(13/*TokenKind.HASHBANG*/); | 18252 this._maybeEat(13/*TokenKind.HASHBANG*/); |
18184 while ($notnull_bool(this._peekKind(12/*TokenKind.HASH*/))) { | 18253 while ($notnull_bool(this._peekKind(12/*TokenKind.HASH*/))) { |
18185 ret.add$1(this.directive()); | 18254 ret.add$1(this.directive()); |
18186 } | 18255 } |
18187 while (!$notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) { | 18256 while (!$notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) { |
18188 ret.add$1(this.topLevelDefinition()); | 18257 ret.add$1(this.topLevelDefinition()); |
18189 } | 18258 } |
18190 return (ret && ret.is$List$Definition()); | 18259 return (ret && ret.is$List_Definition()); |
18191 } | 18260 } |
18192 lang_Parser.prototype.directive = function() { | 18261 lang_Parser.prototype.directive = function() { |
18193 var start = this._peekToken.start; | 18262 var start = this._peekToken.start; |
18194 this._eat(12/*TokenKind.HASH*/); | 18263 this._eat(12/*TokenKind.HASH*/); |
18195 var name = this.identifier(); | 18264 var name = this.identifier(); |
18196 var args = this.arguments(); | 18265 var args = this.arguments(); |
18197 this._eatSemicolon(); | 18266 this._eatSemicolon(); |
18198 return new DirectiveDefinition(name, args, this._makeSpan(start)); | 18267 return new DirectiveDefinition(name, args, this._makeSpan(start)); |
18199 } | 18268 } |
18200 lang_Parser.prototype.topLevelDefinition = function() { | 18269 lang_Parser.prototype.topLevelDefinition = function() { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18257 lang_Parser.prototype.functionTypeAlias = function() { | 18326 lang_Parser.prototype.functionTypeAlias = function() { |
18258 var start = this._peekToken.start; | 18327 var start = this._peekToken.start; |
18259 this._eat(87/*TokenKind.TYPEDEF*/); | 18328 this._eat(87/*TokenKind.TYPEDEF*/); |
18260 var di = this.declaredIdentifier(false); | 18329 var di = this.declaredIdentifier(false); |
18261 var typeParams = null; | 18330 var typeParams = null; |
18262 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) { | 18331 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) { |
18263 typeParams = this.typeParameters(); | 18332 typeParams = this.typeParameters(); |
18264 } | 18333 } |
18265 var formals = this.formalParameterList(); | 18334 var formals = this.formalParameterList(); |
18266 this._eatSemicolon(); | 18335 this._eatSemicolon(); |
18267 var func = new FunctionDefinition(null, di.get$type(), di.get$name(), formals,
null, null, this._makeSpan(start)); | 18336 var func = new FunctionDefinition(null, di.get$type(), di.get$name(), formals,
null, null, null, this._makeSpan(start)); |
18268 return new FunctionTypeDefinition(func, typeParams, this._makeSpan(start)); | 18337 return new FunctionTypeDefinition(func, typeParams, this._makeSpan(start)); |
18269 } | 18338 } |
18270 lang_Parser.prototype.initializers = function() { | 18339 lang_Parser.prototype.initializers = function() { |
18271 this._inInitializers = true; | 18340 this._inInitializers = true; |
18272 var ret = []; | 18341 var ret = []; |
18273 do { | 18342 do { |
18274 ret.add$1(this.expression()); | 18343 ret.add$1(this.expression()); |
18275 } | 18344 } |
18276 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) | 18345 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) |
18277 this._inInitializers = false; | 18346 this._inInitializers = false; |
(...skipping 30 matching lines...) Expand all Loading... |
18308 this._eatSemicolon(); | 18377 this._eatSemicolon(); |
18309 return new NativeStatement(nativeBody, this._makeSpan(start)); | 18378 return new NativeStatement(nativeBody, this._makeSpan(start)); |
18310 } | 18379 } |
18311 else { | 18380 else { |
18312 return this.functionBody(inExpression); | 18381 return this.functionBody(inExpression); |
18313 } | 18382 } |
18314 } | 18383 } |
18315 } | 18384 } |
18316 this._lang_error('Expected function body (neither { nor => found)'); | 18385 this._lang_error('Expected function body (neither { nor => found)'); |
18317 } | 18386 } |
18318 lang_Parser.prototype.finishField = function(start, modifiers, type, name, value
) { | 18387 lang_Parser.prototype.finishField = function(start, modifiers, typeParams, type,
name, value) { |
| 18388 if (typeParams != null) { |
| 18389 $globals.world.internalError('trying to create a generic field', this._makeS
pan($assert_num(start))); |
| 18390 } |
18319 var names = [name]; | 18391 var names = [name]; |
18320 var values = [value]; | 18392 var values = [value]; |
18321 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { | 18393 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { |
18322 names.add$1(this.identifier()); | 18394 names.add$1(this.identifier()); |
18323 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { | 18395 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { |
18324 values.add$1(this.expression()); | 18396 values.add$1(this.expression()); |
18325 } | 18397 } |
18326 else { | 18398 else { |
18327 values.add$1(); | 18399 values.add$1(); |
18328 } | 18400 } |
18329 } | 18401 } |
18330 this._eatSemicolon(); | 18402 this._eatSemicolon(); |
18331 return new VariableDefinition(modifiers, type, names, values, this._makeSpan($
assert_num(start))); | 18403 return new VariableDefinition(modifiers, type, names, values, this._makeSpan($
assert_num(start))); |
18332 } | 18404 } |
18333 lang_Parser.prototype.finishDefinition = function(start, modifiers, di) { | 18405 lang_Parser.prototype.finishDefinition = function(start, modifiers, di, typePara
ms) { |
18334 var $0; | 18406 var $0; |
18335 switch (this._peek()) { | 18407 switch (this._peek()) { |
18336 case 2/*TokenKind.LPAREN*/: | 18408 case 2/*TokenKind.LPAREN*/: |
18337 | 18409 |
18338 var formals = this.formalParameterList(); | 18410 var formals = this.formalParameterList(); |
18339 var inits = null; | 18411 var inits = null; |
18340 if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) { | 18412 if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) { |
18341 inits = this.initializers(); | 18413 inits = this.initializers(); |
18342 } | 18414 } |
18343 var body = this.functionBody(false); | 18415 var body = this.functionBody(false); |
18344 if ($notnull_bool(di.get$name() == null)) { | 18416 if ($notnull_bool(di.get$name() == null)) { |
18345 di.set$name(di.get$type().get$name()); | 18417 di.set$name(di.get$type().get$name()); |
18346 } | 18418 } |
18347 return new FunctionDefinition(modifiers, di.get$type(), di.get$name(), for
mals, inits, body, this._makeSpan($assert_num(start))); | 18419 return new FunctionDefinition(modifiers, di.get$type(), di.get$name(), for
mals, typeParams, inits, body, this._makeSpan(start)); |
18348 | 18420 |
18349 case 20/*TokenKind.ASSIGN*/: | 18421 case 20/*TokenKind.ASSIGN*/: |
18350 | 18422 |
18351 this._eat(20/*TokenKind.ASSIGN*/); | 18423 this._eat(20/*TokenKind.ASSIGN*/); |
18352 var value = this.expression(); | 18424 var value = this.expression(); |
18353 return this.finishField(start, modifiers, di.get$type(), di.get$name(), va
lue); | 18425 return this.finishField(start, modifiers, typeParams, di.get$type(), di.ge
t$name(), value); |
18354 | 18426 |
18355 case 11/*TokenKind.COMMA*/: | 18427 case 11/*TokenKind.COMMA*/: |
18356 case 10/*TokenKind.SEMICOLON*/: | 18428 case 10/*TokenKind.SEMICOLON*/: |
18357 | 18429 |
18358 return this.finishField(start, modifiers, di.get$type(), di.get$name(), nu
ll); | 18430 return this.finishField(start, modifiers, typeParams, di.get$type(), di.ge
t$name(), null); |
18359 | 18431 |
18360 default: | 18432 default: |
18361 | 18433 |
18362 this._errorExpected('declaration'); | 18434 this._errorExpected('declaration'); |
18363 return null; | 18435 return null; |
18364 | 18436 |
18365 } | 18437 } |
18366 } | 18438 } |
18367 lang_Parser.prototype.declaration = function(includeOperators) { | 18439 lang_Parser.prototype.declaration = function(includeOperators) { |
18368 var start = this._peekToken.start; | 18440 var start = this._peekToken.start; |
18369 if ($notnull_bool(this._peekKind(75/*TokenKind.FACTORY*/))) { | 18441 if ($notnull_bool(this._peekKind(75/*TokenKind.FACTORY*/))) { |
18370 return this.factoryConstructorDeclaration(); | 18442 return this.factoryConstructorDeclaration(); |
18371 } | 18443 } |
18372 var modifiers = this._readModifiers(); | 18444 var modifiers = this._readModifiers(); |
18373 return this.finishDefinition(start, modifiers, this.declaredIdentifier(include
Operators)); | 18445 return this.finishDefinition(start, (modifiers && modifiers.is$List_Token()),
this.declaredIdentifier(includeOperators), null); |
18374 } | 18446 } |
18375 lang_Parser.prototype.factoryConstructorDeclaration = function() { | 18447 lang_Parser.prototype.factoryConstructorDeclaration = function() { |
18376 var $0; | 18448 var $0; |
18377 var start = this._peekToken.start; | 18449 var start = this._peekToken.start; |
18378 var factoryToken = this._lang_next(); | 18450 var factoryToken = this._lang_next(); |
18379 var names = [this.identifier()]; | 18451 var names = [this.identifier()]; |
18380 while ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) { | 18452 while ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) { |
18381 names.add$1(this.identifier()); | 18453 names.add$1(this.identifier()); |
18382 } | 18454 } |
18383 var typeParams = null; | 18455 var typeParams = null; |
(...skipping 14 matching lines...) Expand all Loading... |
18398 } | 18470 } |
18399 } | 18471 } |
18400 else { | 18472 else { |
18401 name = new lang_Identifier('', (($0 = names.$index(0).get$span()) && $0.is$S
ourceSpan())); | 18473 name = new lang_Identifier('', (($0 = names.$index(0).get$span()) && $0.is$S
ourceSpan())); |
18402 } | 18474 } |
18403 if (names.length > 1) { | 18475 if (names.length > 1) { |
18404 this._lang_error('unsupported qualified name for factory', (($0 = names.$ind
ex(0).get$span()) && $0.is$SourceSpan())); | 18476 this._lang_error('unsupported qualified name for factory', (($0 = names.$ind
ex(0).get$span()) && $0.is$SourceSpan())); |
18405 } | 18477 } |
18406 type = new NameTypeReference(false, names.$index(0), null, (($0 = names.$index
(0).get$span()) && $0.is$SourceSpan())); | 18478 type = new NameTypeReference(false, names.$index(0), null, (($0 = names.$index
(0).get$span()) && $0.is$SourceSpan())); |
18407 var di = new DeclaredIdentifier(type, name, this._makeSpan(start)); | 18479 var di = new DeclaredIdentifier(type, name, this._makeSpan(start)); |
18408 return this.finishDefinition(start, [factoryToken], di); | 18480 return this.finishDefinition(start, [factoryToken], di, (typeParams && typePar
ams.is$List_ParameterType())); |
18409 } | 18481 } |
18410 lang_Parser.prototype.statement = function() { | 18482 lang_Parser.prototype.statement = function() { |
18411 var $0; | 18483 var $0; |
18412 switch (this._peek()) { | 18484 switch (this._peek()) { |
18413 case 88/*TokenKind.BREAK*/: | 18485 case 88/*TokenKind.BREAK*/: |
18414 | 18486 |
18415 return (($0 = this.breakStatement()) && $0.is$lang_Statement()); | 18487 return (($0 = this.breakStatement()) && $0.is$lang_Statement()); |
18416 | 18488 |
18417 case 92/*TokenKind.CONTINUE*/: | 18489 case 92/*TokenKind.CONTINUE*/: |
18418 | 18490 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18488 this._eatSemicolon(); | 18560 this._eatSemicolon(); |
18489 expr.get$func().set$span(this._makeSpan(start)); | 18561 expr.get$func().set$span(this._makeSpan(start)); |
18490 } | 18562 } |
18491 return expr.get$func(); | 18563 return expr.get$func(); |
18492 } | 18564 } |
18493 else if ((expr instanceof DeclaredIdentifier)) { | 18565 else if ((expr instanceof DeclaredIdentifier)) { |
18494 var value = null; | 18566 var value = null; |
18495 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { | 18567 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { |
18496 value = this.expression(); | 18568 value = this.expression(); |
18497 } | 18569 } |
18498 return this.finishField(start, null, expr.get$type(), expr.get$name(), value
); | 18570 return this.finishField(start, null, null, expr.get$type(), expr.get$name(),
value); |
18499 } | 18571 } |
18500 else if ($notnull_bool(this._isBin(expr, 20/*TokenKind.ASSIGN*/)) && ((expr.ge
t$x() instanceof DeclaredIdentifier))) { | 18572 else if ($notnull_bool(this._isBin(expr, 20/*TokenKind.ASSIGN*/)) && ((expr.ge
t$x() instanceof DeclaredIdentifier))) { |
18501 var di = (($0 = expr.get$x()) && $0.is$DeclaredIdentifier()); | 18573 var di = (($0 = expr.get$x()) && $0.is$DeclaredIdentifier()); |
18502 return this.finishField(start, null, di.type, di.name, expr.get$y()); | 18574 return this.finishField(start, null, null, di.type, di.name, expr.get$y()); |
18503 } | 18575 } |
18504 else if ($notnull_bool(this._isBin(expr, 52/*TokenKind.LT*/)) && $notnull_bool
(this._maybeEat(11/*TokenKind.COMMA*/))) { | 18576 else if ($notnull_bool(this._isBin(expr, 52/*TokenKind.LT*/)) && $notnull_bool
(this._maybeEat(11/*TokenKind.COMMA*/))) { |
18505 var baseType = this._makeType(expr.get$x()); | 18577 var baseType = this._makeType(expr.get$x()); |
18506 var typeArgs = [this._makeType(expr.get$y())]; | 18578 var typeArgs = [this._makeType(expr.get$y())]; |
18507 var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference())
, 0, typeArgs); | 18579 var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference())
, 0, typeArgs); |
18508 var name = this.identifier(); | 18580 var name = this.identifier(); |
18509 var value = null; | 18581 var value = null; |
18510 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { | 18582 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { |
18511 value = this.expression(); | 18583 value = this.expression(); |
18512 } | 18584 } |
18513 return this.finishField(expr.get$span().get$start(), null, gt, name, value); | 18585 return this.finishField(expr.get$span().get$start(), null, null, gt, name, v
alue); |
18514 } | 18586 } |
18515 else { | 18587 else { |
18516 this._eatSemicolon(); | 18588 this._eatSemicolon(); |
18517 return new lang_ExpressionStatement(expr, this._makeSpan($assert_num(expr.ge
t$span().get$start()))); | 18589 return new lang_ExpressionStatement(expr, this._makeSpan($assert_num(expr.ge
t$span().get$start()))); |
18518 } | 18590 } |
18519 } | 18591 } |
18520 lang_Parser.prototype.testCondition = function() { | 18592 lang_Parser.prototype.testCondition = function() { |
18521 this._eatLeftParen(); | 18593 this._eatLeftParen(); |
18522 var ret = this.expression(); | 18594 var ret = this.expression(); |
18523 this._eat(3/*TokenKind.RPAREN*/); | 18595 this._eat(3/*TokenKind.RPAREN*/); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18772 } | 18844 } |
18773 lang_Parser.prototype.infixExpression = function(precedence) { | 18845 lang_Parser.prototype.infixExpression = function(precedence) { |
18774 var $0; | 18846 var $0; |
18775 return this.finishInfixExpression((($0 = this.unaryExpression()) && $0.is$lang
_Expression()), precedence); | 18847 return this.finishInfixExpression((($0 = this.unaryExpression()) && $0.is$lang
_Expression()), precedence); |
18776 } | 18848 } |
18777 lang_Parser.prototype._finishDeclaredId = function(type) { | 18849 lang_Parser.prototype._finishDeclaredId = function(type) { |
18778 var name = this.identifier(); | 18850 var name = this.identifier(); |
18779 return this.finishPostfixExpression(new DeclaredIdentifier(type, name, this._m
akeSpan($assert_num(type.get$span().get$start())))); | 18851 return this.finishPostfixExpression(new DeclaredIdentifier(type, name, this._m
akeSpan($assert_num(type.get$span().get$start())))); |
18780 } | 18852 } |
18781 lang_Parser.prototype._fixAsType = function(x) { | 18853 lang_Parser.prototype._fixAsType = function(x) { |
18782 $assert(this._isBin(x, 52/*TokenKind.LT*/), "_isBin(x, TokenKind.LT)", "parser
.dart", 803, 12); | 18854 $assert(this._isBin(x, 52/*TokenKind.LT*/), "_isBin(x, TokenKind.LT)", "parser
.dart", 805, 12); |
18783 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) { | 18855 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) { |
18784 var base = this._makeType(x.x); | 18856 var base = this._makeType(x.x); |
18785 var typeParam = this._makeType(x.y); | 18857 var typeParam = this._makeType(x.y); |
18786 var type = new GenericTypeReference(base, [typeParam], 0, this._makeSpan(x.s
pan.start)); | 18858 var type = new GenericTypeReference(base, [typeParam], 0, this._makeSpan(x.s
pan.start)); |
18787 return this._finishDeclaredId(type); | 18859 return this._finishDeclaredId(type); |
18788 } | 18860 } |
18789 else { | 18861 else { |
18790 $assert(this._peekKind(52/*TokenKind.LT*/), "_peekKind(TokenKind.LT)", "pars
er.dart", 814, 14); | 18862 $assert(this._peekKind(52/*TokenKind.LT*/), "_peekKind(TokenKind.LT)", "pars
er.dart", 816, 14); |
18791 var base = this._makeType(x.x); | 18863 var base = this._makeType(x.x); |
18792 var paramBase = this._makeType(x.y); | 18864 var paramBase = this._makeType(x.y); |
18793 var firstParam = this.addTypeArguments((paramBase && paramBase.is$TypeRefere
nce()), 1); | 18865 var firstParam = this.addTypeArguments((paramBase && paramBase.is$TypeRefere
nce()), 1); |
18794 var type; | 18866 var type; |
18795 if (firstParam.get$depth() <= 0) { | 18867 if (firstParam.get$depth() <= 0) { |
18796 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp
an.start)); | 18868 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp
an.start)); |
18797 } | 18869 } |
18798 else if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { | 18870 else if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { |
18799 type = this._finishTypeArguments((base && base.is$TypeReference()), 0, [fi
rstParam]); | 18871 type = this._finishTypeArguments((base && base.is$TypeReference()), 0, [fi
rstParam]); |
18800 } | 18872 } |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19134 this._errorExpected('string literal, but found incomplete string'); | 19206 this._errorExpected('string literal, but found incomplete string'); |
19135 } | 19207 } |
19136 return null; | 19208 return null; |
19137 } | 19209 } |
19138 lang_Parser.prototype._parenOrLambda = function() { | 19210 lang_Parser.prototype._parenOrLambda = function() { |
19139 var $0; | 19211 var $0; |
19140 var start = this._peekToken.start; | 19212 var start = this._peekToken.start; |
19141 if ($notnull_bool(this._atClosureParameters())) { | 19213 if ($notnull_bool(this._atClosureParameters())) { |
19142 var formals = this.formalParameterList(); | 19214 var formals = this.formalParameterList(); |
19143 var body = this.functionBody(true); | 19215 var body = this.functionBody(true); |
19144 var func = new FunctionDefinition(null, null, null, formals, null, body, thi
s._makeSpan(start)); | 19216 var func = new FunctionDefinition(null, null, null, formals, null, null, bod
y, this._makeSpan(start)); |
19145 return new LambdaExpression(func, (($0 = func.get$span()) && $0.is$SourceSpa
n())); | 19217 return new LambdaExpression(func, (($0 = func.get$span()) && $0.is$SourceSpa
n())); |
19146 } | 19218 } |
19147 else { | 19219 else { |
19148 var saved = this._inInitializers; | 19220 var saved = this._inInitializers; |
19149 this._inInitializers = false; | 19221 this._inInitializers = false; |
19150 var args = this.arguments(); | 19222 var args = this.arguments(); |
19151 this._inInitializers = $assert_bool(saved); | 19223 this._inInitializers = $assert_bool(saved); |
19152 if ($notnull_bool($eq(args.length, 1))) { | 19224 if ($notnull_bool($eq(args.length, 1))) { |
19153 return new ParenExpression(args.$index(0).get$value(), this._makeSpan(star
t)); | 19225 return new ParenExpression(args.$index(0).get$value(), this._makeSpan(star
t)); |
19154 } | 19226 } |
(...skipping 13 matching lines...) Expand all Loading... |
19168 this._afterParensIndex++; | 19240 this._afterParensIndex++; |
19169 } | 19241 } |
19170 lang_Parser.prototype._peekAfterCloseParen = function() { | 19242 lang_Parser.prototype._peekAfterCloseParen = function() { |
19171 var $0; | 19243 var $0; |
19172 if (this._afterParensIndex < this._afterParens.length) { | 19244 if (this._afterParensIndex < this._afterParens.length) { |
19173 return (($0 = this._afterParens.$index(this._afterParensIndex)) && $0.is$lan
g_Token()); | 19245 return (($0 = this._afterParens.$index(this._afterParensIndex)) && $0.is$lan
g_Token()); |
19174 } | 19246 } |
19175 this._afterParensIndex = 0; | 19247 this._afterParensIndex = 0; |
19176 this._afterParens.clear(); | 19248 this._afterParens.clear(); |
19177 var tokens = [this._lang_next()]; | 19249 var tokens = [this._lang_next()]; |
19178 this._lookaheadAfterParens((tokens && tokens.is$List$Token())); | 19250 this._lookaheadAfterParens((tokens && tokens.is$List_Token())); |
19179 var after = this._peekToken; | 19251 var after = this._peekToken; |
19180 tokens.add$1(after); | 19252 tokens.add$1(after); |
19181 this.tokenizer = new DivertedTokenSource(tokens, this, this.tokenizer); | 19253 this.tokenizer = new DivertedTokenSource(tokens, this, this.tokenizer); |
19182 this._lang_next(); | 19254 this._lang_next(); |
19183 return (after && after.is$lang_Token()); | 19255 return (after && after.is$lang_Token()); |
19184 } | 19256 } |
19185 lang_Parser.prototype._lookaheadAfterParens = function(tokens) { | 19257 lang_Parser.prototype._lookaheadAfterParens = function(tokens) { |
19186 var saved = this._afterParens.length; | 19258 var saved = this._afterParens.length; |
19187 this._afterParens.add(null); | 19259 this._afterParens.add(null); |
19188 while (true) { | 19260 while (true) { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19303 } | 19375 } |
19304 else { | 19376 else { |
19305 return -1; | 19377 return -1; |
19306 } | 19378 } |
19307 } | 19379 } |
19308 lang_Parser.parseHex = function(hex) { | 19380 lang_Parser.parseHex = function(hex) { |
19309 var result = 0; | 19381 var result = 0; |
19310 for (var i = 0; | 19382 for (var i = 0; |
19311 i < hex.length; i++) { | 19383 i < hex.length; i++) { |
19312 var digit = lang_Parser._hexDigit(hex.charCodeAt(i)); | 19384 var digit = lang_Parser._hexDigit(hex.charCodeAt(i)); |
19313 $assert($ne(digit, -1), "digit != -1", "parser.dart", 1343, 14); | 19385 $assert($ne(digit, -1), "digit != -1", "parser.dart", 1345, 14); |
19314 result = (result << 4) + $assert_num(digit); | 19386 result = (result << 4) + $assert_num(digit); |
19315 } | 19387 } |
19316 return $assert_num(result); | 19388 return $assert_num(result); |
19317 } | 19389 } |
19318 lang_Parser.prototype.finishNewExpression = function(start, isConst) { | 19390 lang_Parser.prototype.finishNewExpression = function(start, isConst) { |
19319 var type = this.type(0); | 19391 var type = this.type(0); |
19320 var name = null; | 19392 var name = null; |
19321 if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) { | 19393 if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) { |
19322 name = this.identifier(); | 19394 name = this.identifier(); |
19323 } | 19395 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19391 } | 19463 } |
19392 return null; | 19464 return null; |
19393 } | 19465 } |
19394 lang_Parser.prototype.typeParameter = function() { | 19466 lang_Parser.prototype.typeParameter = function() { |
19395 var start = this._peekToken.start; | 19467 var start = this._peekToken.start; |
19396 var name = this.identifier(); | 19468 var name = this.identifier(); |
19397 var myType = null; | 19469 var myType = null; |
19398 if ($notnull_bool(this._maybeEat(74/*TokenKind.EXTENDS*/))) { | 19470 if ($notnull_bool(this._maybeEat(74/*TokenKind.EXTENDS*/))) { |
19399 myType = this.type(1); | 19471 myType = this.type(1); |
19400 } | 19472 } |
19401 return new TypeParameter(name, myType, this._makeSpan(start)); | 19473 var tp = new TypeParameter(name, myType, this._makeSpan(start)); |
| 19474 return new ParameterType($assert_String(name.get$name()), tp); |
| 19475 } |
| 19476 lang_Parser.prototype.get$typeParameter = function() { |
| 19477 return lang_Parser.prototype.typeParameter.bind(this); |
19402 } | 19478 } |
19403 lang_Parser.prototype.typeParameters = function() { | 19479 lang_Parser.prototype.typeParameters = function() { |
19404 this._eat(52/*TokenKind.LT*/); | 19480 this._eat(52/*TokenKind.LT*/); |
19405 var closed = false; | 19481 var closed = false; |
19406 var ret = []; | 19482 var ret = []; |
19407 do { | 19483 do { |
19408 var tp = this.typeParameter(); | 19484 var tp = this.typeParameter(); |
19409 ret.add$1(tp); | 19485 ret.add$1(tp); |
19410 if ((tp.get$extendsType() instanceof GenericTypeReference) && $notnull_bool(
$eq(tp.get$extendsType().get$depth(), 0))) { | 19486 if ((tp.get$typeParameter().get$extendsType() instanceof GenericTypeReferenc
e) && $notnull_bool($eq(tp.get$typeParameter().get$extendsType().get$depth(), 0)
)) { |
19411 closed = true; | 19487 closed = true; |
19412 break; | 19488 break; |
19413 } | 19489 } |
19414 } | 19490 } |
19415 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) | 19491 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) |
19416 if (!$notnull_bool(closed)) { | 19492 if (!$notnull_bool(closed)) { |
19417 this._eat(53/*TokenKind.GT*/); | 19493 this._eat(53/*TokenKind.GT*/); |
19418 } | 19494 } |
19419 return ret; | 19495 return (ret && ret.is$List_ParameterType()); |
19420 } | 19496 } |
19421 lang_Parser.prototype.get$typeParameters = function() { | 19497 lang_Parser.prototype.get$typeParameters = function() { |
19422 return lang_Parser.prototype.typeParameters.bind(this); | 19498 return lang_Parser.prototype.typeParameters.bind(this); |
19423 } | 19499 } |
19424 lang_Parser.prototype._eatClosingAngle = function(depth) { | 19500 lang_Parser.prototype._eatClosingAngle = function(depth) { |
19425 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) { | 19501 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) { |
19426 return depth; | 19502 return depth; |
19427 } | 19503 } |
19428 else if (depth > 0 && $notnull_bool(this._maybeEat(40/*TokenKind.SAR*/))) { | 19504 else if (depth > 0 && $notnull_bool(this._maybeEat(40/*TokenKind.SAR*/))) { |
19429 return depth - 1; | 19505 return depth - 1; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19521 var name = di.get$name(); | 19597 var name = di.get$name(); |
19522 var value = null; | 19598 var value = null; |
19523 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { | 19599 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { |
19524 if (!$notnull_bool(inOptionalBlock)) { | 19600 if (!$notnull_bool(inOptionalBlock)) { |
19525 this._lang_error('default values only allowed inside [optional] section'); | 19601 this._lang_error('default values only allowed inside [optional] section'); |
19526 } | 19602 } |
19527 value = this.expression(); | 19603 value = this.expression(); |
19528 } | 19604 } |
19529 else if ($notnull_bool(this._peekKind(2/*TokenKind.LPAREN*/))) { | 19605 else if ($notnull_bool(this._peekKind(2/*TokenKind.LPAREN*/))) { |
19530 var formals = this.formalParameterList(); | 19606 var formals = this.formalParameterList(); |
19531 var func = new FunctionDefinition(null, type, name, formals, null, null, thi
s._makeSpan(start)); | 19607 var func = new FunctionDefinition(null, type, name, formals, null, null, nul
l, this._makeSpan(start)); |
19532 type = new FunctionTypeReference(false, func, (($0 = func.get$span()) && $0.
is$SourceSpan())); | 19608 type = new FunctionTypeReference(false, func, (($0 = func.get$span()) && $0.
is$SourceSpan())); |
19533 } | 19609 } |
19534 if ($notnull_bool(inOptionalBlock) && $notnull_bool(value == null)) { | 19610 if ($notnull_bool(inOptionalBlock) && $notnull_bool(value == null)) { |
19535 value = new NullExpression(this._makeSpan(start)); | 19611 value = new NullExpression(this._makeSpan(start)); |
19536 } | 19612 } |
19537 return new FormalNode(isThis, isRest, type, name, value, this._makeSpan(start)
); | 19613 return new FormalNode(isThis, isRest, type, name, value, this._makeSpan(start)
); |
19538 } | 19614 } |
19539 lang_Parser.prototype.formalParameterList = function() { | 19615 lang_Parser.prototype.formalParameterList = function() { |
19540 this._eatLeftParen(); | 19616 this._eatLeftParen(); |
19541 var formals = []; | 19617 var formals = []; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19577 type = null; | 19653 type = null; |
19578 } | 19654 } |
19579 else if ((expr instanceof DeclaredIdentifier)) { | 19655 else if ((expr instanceof DeclaredIdentifier)) { |
19580 name = expr.get$name(); | 19656 name = expr.get$name(); |
19581 type = expr.get$type(); | 19657 type = expr.get$type(); |
19582 } | 19658 } |
19583 else { | 19659 else { |
19584 this._lang_error('bad function body', (($0 = expr.get$span()) && $0.is$Sourc
eSpan())); | 19660 this._lang_error('bad function body', (($0 = expr.get$span()) && $0.is$Sourc
eSpan())); |
19585 } | 19661 } |
19586 var span = new SourceSpan(expr.get$span().get$file(), expr.get$span().get$star
t(), body.get$span().get$end()); | 19662 var span = new SourceSpan(expr.get$span().get$file(), expr.get$span().get$star
t(), body.get$span().get$end()); |
19587 var func = new FunctionDefinition(null, type, name, formals, null, body, (span
&& span.is$SourceSpan())); | 19663 var func = new FunctionDefinition(null, type, name, formals, null, null, body,
(span && span.is$SourceSpan())); |
19588 return new LambdaExpression(func, (($0 = func.get$span()) && $0.is$SourceSpan(
))); | 19664 return new LambdaExpression(func, (($0 = func.get$span()) && $0.is$SourceSpan(
))); |
19589 } | 19665 } |
19590 lang_Parser.prototype._makeDeclaredIdentifier = function(e) { | 19666 lang_Parser.prototype._makeDeclaredIdentifier = function(e) { |
19591 var $0; | 19667 var $0; |
19592 if ((e instanceof VarExpression)) { | 19668 if ((e instanceof VarExpression)) { |
19593 return new DeclaredIdentifier(null, e.get$name(), (($0 = e.get$span()) && $0
.is$SourceSpan())); | 19669 return new DeclaredIdentifier(null, e.get$name(), (($0 = e.get$span()) && $0
.is$SourceSpan())); |
19594 } | 19670 } |
19595 else if ((e instanceof DeclaredIdentifier)) { | 19671 else if ((e instanceof DeclaredIdentifier)) { |
19596 return e; | 19672 return e; |
19597 } | 19673 } |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19777 VariableDefinition.prototype.set$names = function(value) { return this.names = v
alue; }; | 19853 VariableDefinition.prototype.set$names = function(value) { return this.names = v
alue; }; |
19778 VariableDefinition.prototype.get$values = function() { return this.values; }; | 19854 VariableDefinition.prototype.get$values = function() { return this.values; }; |
19779 VariableDefinition.prototype.set$values = function(value) { return this.values =
value; }; | 19855 VariableDefinition.prototype.set$values = function(value) { return this.values =
value; }; |
19780 VariableDefinition.prototype.visit = function(visitor) { | 19856 VariableDefinition.prototype.visit = function(visitor) { |
19781 return visitor.visitVariableDefinition(this); | 19857 return visitor.visitVariableDefinition(this); |
19782 } | 19858 } |
19783 VariableDefinition.prototype.visit$1 = function($0) { | 19859 VariableDefinition.prototype.visit$1 = function($0) { |
19784 return this.visit(($0 && $0.is$TreeVisitor())); | 19860 return this.visit(($0 && $0.is$TreeVisitor())); |
19785 }; | 19861 }; |
19786 // ********** Code for FunctionDefinition ************** | 19862 // ********** Code for FunctionDefinition ************** |
19787 function FunctionDefinition(modifiers, returnType, name, formals, initializers,
body, span) { | 19863 function FunctionDefinition(modifiers, returnType, name, formals, typeParameters
, initializers, body, span) { |
19788 this.modifiers = modifiers; | 19864 this.modifiers = modifiers; |
19789 this.returnType = returnType; | 19865 this.returnType = returnType; |
19790 this.name = name; | 19866 this.name = name; |
19791 this.formals = formals; | 19867 this.formals = formals; |
| 19868 this.typeParameters = typeParameters; |
19792 this.initializers = initializers; | 19869 this.initializers = initializers; |
19793 this.body = body; | 19870 this.body = body; |
19794 // Initializers done | 19871 // Initializers done |
19795 Definition.call(this, span); | 19872 Definition.call(this, span); |
19796 } | 19873 } |
19797 $inherits(FunctionDefinition, Definition); | 19874 $inherits(FunctionDefinition, Definition); |
19798 FunctionDefinition.prototype.is$FunctionDefinition = function(){return this;}; | 19875 FunctionDefinition.prototype.is$FunctionDefinition = function(){return this;}; |
19799 FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp
e; }; | 19876 FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp
e; }; |
19800 FunctionDefinition.prototype.set$returnType = function(value) { return this.retu
rnType = value; }; | 19877 FunctionDefinition.prototype.set$returnType = function(value) { return this.retu
rnType = value; }; |
19801 FunctionDefinition.prototype.get$name = function() { return this.name; }; | 19878 FunctionDefinition.prototype.get$name = function() { return this.name; }; |
19802 FunctionDefinition.prototype.set$name = function(value) { return this.name = val
ue; }; | 19879 FunctionDefinition.prototype.set$name = function(value) { return this.name = val
ue; }; |
| 19880 FunctionDefinition.prototype.get$typeParameters = function() { return this.typeP
arameters; }; |
| 19881 FunctionDefinition.prototype.set$typeParameters = function(value) { return this.
typeParameters = value; }; |
19803 FunctionDefinition.prototype.get$initializers = function() { return this.initial
izers; }; | 19882 FunctionDefinition.prototype.get$initializers = function() { return this.initial
izers; }; |
19804 FunctionDefinition.prototype.set$initializers = function(value) { return this.in
itializers = value; }; | 19883 FunctionDefinition.prototype.set$initializers = function(value) { return this.in
itializers = value; }; |
19805 FunctionDefinition.prototype.get$body = function() { return this.body; }; | 19884 FunctionDefinition.prototype.get$body = function() { return this.body; }; |
19806 FunctionDefinition.prototype.set$body = function(value) { return this.body = val
ue; }; | 19885 FunctionDefinition.prototype.set$body = function(value) { return this.body = val
ue; }; |
19807 FunctionDefinition.prototype.visit = function(visitor) { | 19886 FunctionDefinition.prototype.visit = function(visitor) { |
19808 return visitor.visitFunctionDefinition(this); | 19887 return visitor.visitFunctionDefinition(this); |
19809 } | 19888 } |
19810 FunctionDefinition.prototype.visit$1 = function($0) { | 19889 FunctionDefinition.prototype.visit$1 = function($0) { |
19811 return this.visit(($0 && $0.is$TreeVisitor())); | 19890 return this.visit(($0 && $0.is$TreeVisitor())); |
19812 }; | 19891 }; |
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20596 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; | 20675 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; |
20597 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val
ue; }; | 20676 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val
ue; }; |
20598 DeclaredIdentifier.prototype.visit = function(visitor) { | 20677 DeclaredIdentifier.prototype.visit = function(visitor) { |
20599 return visitor.visitDeclaredIdentifier(this); | 20678 return visitor.visitDeclaredIdentifier(this); |
20600 } | 20679 } |
20601 DeclaredIdentifier.prototype.visit$1 = function($0) { | 20680 DeclaredIdentifier.prototype.visit$1 = function($0) { |
20602 return this.visit(($0 && $0.is$TreeVisitor())); | 20681 return this.visit(($0 && $0.is$TreeVisitor())); |
20603 }; | 20682 }; |
20604 // ********** Code for lang_Type ************** | 20683 // ********** Code for lang_Type ************** |
20605 function lang_Type(name) { | 20684 function lang_Type(name) { |
20606 this.name = name; | |
20607 this.isTested = false; | 20685 this.isTested = false; |
20608 this._resolvedMembers = $map([]); | 20686 this._resolvedMembers = $map([]); |
20609 // Initializers done | 20687 // Initializers done |
| 20688 lang_Element.call(this, name, null); |
20610 } | 20689 } |
| 20690 $inherits(lang_Type, lang_Element); |
20611 lang_Type.prototype.is$lang_Type = function(){return this;}; | 20691 lang_Type.prototype.is$lang_Type = function(){return this;}; |
20612 lang_Type.prototype.is$Named = function(){return this;}; | |
20613 lang_Type.prototype.get$name = function() { return this.name; }; | |
20614 lang_Type.prototype.get$isTested = function() { return this.isTested; }; | 20692 lang_Type.prototype.get$isTested = function() { return this.isTested; }; |
20615 lang_Type.prototype.set$isTested = function(value) { return this.isTested = valu
e; }; | 20693 lang_Type.prototype.set$isTested = function(value) { return this.isTested = valu
e; }; |
20616 lang_Type.prototype.get$typeCheckCode = function() { return this.typeCheckCode;
}; | 20694 lang_Type.prototype.get$typeCheckCode = function() { return this.typeCheckCode;
}; |
20617 lang_Type.prototype.set$typeCheckCode = function(value) { return this.typeCheckC
ode = value; }; | 20695 lang_Type.prototype.set$typeCheckCode = function(value) { return this.typeCheckC
ode = value; }; |
20618 lang_Type.prototype.get$varStubs = function() { return this.varStubs; }; | 20696 lang_Type.prototype.get$varStubs = function() { return this.varStubs; }; |
20619 lang_Type.prototype.set$varStubs = function(value) { return this.varStubs = valu
e; }; | 20697 lang_Type.prototype.set$varStubs = function(value) { return this.varStubs = valu
e; }; |
20620 lang_Type.prototype.markUsed = function() { | 20698 lang_Type.prototype.markUsed = function() { |
20621 | 20699 |
20622 } | 20700 } |
20623 lang_Type.prototype.get$typeMember = function() { | 20701 lang_Type.prototype.get$typeMember = function() { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20674 } | 20752 } |
20675 lang_Type.prototype.get$isClosed = function() { | 20753 lang_Type.prototype.get$isClosed = function() { |
20676 return $notnull_bool(this.get$isString()) || $notnull_bool(this.get$isBool())
|| $notnull_bool(this.get$isNum()) || $notnull_bool(this.get$isFunction()) || $n
otnull_bool(this.get$isVar()); | 20754 return $notnull_bool(this.get$isString()) || $notnull_bool(this.get$isBool())
|| $notnull_bool(this.get$isNum()) || $notnull_bool(this.get$isFunction()) || $n
otnull_bool(this.get$isVar()); |
20677 } | 20755 } |
20678 lang_Type.prototype.get$isUsed = function() { | 20756 lang_Type.prototype.get$isUsed = function() { |
20679 return false; | 20757 return false; |
20680 } | 20758 } |
20681 lang_Type.prototype.get$isGeneric = function() { | 20759 lang_Type.prototype.get$isGeneric = function() { |
20682 return false; | 20760 return false; |
20683 } | 20761 } |
20684 lang_Type.prototype.get$isNativeType = function() { | |
20685 return false; | |
20686 } | |
20687 lang_Type.prototype.get$isNative = function() { | |
20688 return this.get$isNativeType(); | |
20689 } | |
20690 lang_Type.prototype.get$isHiddenNativeType = function() { | 20762 lang_Type.prototype.get$isHiddenNativeType = function() { |
20691 return false; | 20763 return false; |
20692 } | 20764 } |
20693 lang_Type.prototype.get$hasTypeParams = function() { | 20765 lang_Type.prototype.get$hasTypeParams = function() { |
20694 return false; | 20766 return false; |
20695 } | 20767 } |
20696 lang_Type.prototype.get$typeofName = function() { | 20768 lang_Type.prototype.get$typeofName = function() { |
20697 return null; | 20769 return null; |
20698 } | 20770 } |
20699 lang_Type.prototype.get$jsname = function() { | |
20700 return this._jsname == null ? this.name : this._jsname; | |
20701 } | |
20702 lang_Type.prototype.set$jsname = function(name) { | |
20703 return this._jsname = name; | |
20704 } | |
20705 lang_Type.prototype.get$members = function() { | 20771 lang_Type.prototype.get$members = function() { |
20706 return null; | 20772 return null; |
20707 } | 20773 } |
20708 lang_Type.prototype.get$definition = function() { | 20774 lang_Type.prototype.get$definition = function() { |
20709 return null; | 20775 return null; |
20710 } | 20776 } |
20711 lang_Type.prototype.get$factories = function() { | 20777 lang_Type.prototype.get$factories = function() { |
20712 return null; | 20778 return null; |
20713 } | 20779 } |
20714 lang_Type.prototype.get$typeArgsInOrder = function() { | 20780 lang_Type.prototype.get$typeArgsInOrder = function() { |
20715 return null; | 20781 return null; |
20716 } | 20782 } |
20717 lang_Type.prototype.get$genericType = function() { | 20783 lang_Type.prototype.get$genericType = function() { |
20718 return (this && this.is$DefinedType()); | 20784 return (this && this.is$DefinedType()); |
20719 } | 20785 } |
20720 lang_Type.prototype.get$interfaces = function() { | 20786 lang_Type.prototype.get$interfaces = function() { |
20721 return null; | 20787 return null; |
20722 } | 20788 } |
20723 lang_Type.prototype.get$parent = function() { | 20789 lang_Type.prototype.get$parent = function() { |
20724 return null; | 20790 return null; |
20725 } | 20791 } |
20726 lang_Type.prototype.getAllMembers = function() { | 20792 lang_Type.prototype.getAllMembers = function() { |
20727 return $map([]); | 20793 return $map([]); |
20728 } | 20794 } |
20729 lang_Type.prototype.hashCode = function() { | |
20730 return this.name.hashCode(); | |
20731 } | |
20732 lang_Type.prototype.get$hasNativeSubtypes = function() { | 20795 lang_Type.prototype.get$hasNativeSubtypes = function() { |
20733 if (this._hasNativeSubtypes == null) { | 20796 if (this._hasNativeSubtypes == null) { |
20734 this._hasNativeSubtypes = this.get$subtypes().some((function (t) { | 20797 this._hasNativeSubtypes = this.get$subtypes().some((function (t) { |
20735 return t.get$isNativeType(); | 20798 return t.get$isNative(); |
20736 }) | 20799 }) |
20737 ); | 20800 ); |
20738 } | 20801 } |
20739 return this._hasNativeSubtypes; | 20802 return this._hasNativeSubtypes; |
20740 } | 20803 } |
20741 lang_Type.prototype._checkOverride = function(member) { | 20804 lang_Type.prototype._checkOverride = function(member) { |
20742 var parentMember = this._getMemberInParents(member.name); | 20805 var parentMember = this._getMemberInParents(member.name); |
20743 if ($notnull_bool($ne(parentMember, null))) { | 20806 if ($notnull_bool($ne(parentMember, null))) { |
20744 if (!$notnull_bool(member.get$isPrivate()) || $eq(member.get$library(), pare
ntMember.get$library())) { | 20807 if (!$notnull_bool(member.get$isPrivate()) || $eq(member.get$library(), pare
ntMember.get$library())) { |
20745 member.override((parentMember && parentMember.is$Member())); | 20808 member.override((parentMember && parentMember.is$Member())); |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20928 lang_Type.prototype.getConstructor$1 = function($0) { | 20991 lang_Type.prototype.getConstructor$1 = function($0) { |
20929 return this.getConstructor($assert_String($0)); | 20992 return this.getConstructor($assert_String($0)); |
20930 }; | 20993 }; |
20931 lang_Type.prototype.getFactory$2 = function($0, $1) { | 20994 lang_Type.prototype.getFactory$2 = function($0, $1) { |
20932 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1)); | 20995 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1)); |
20933 }; | 20996 }; |
20934 lang_Type.prototype.getMember$1 = function($0) { | 20997 lang_Type.prototype.getMember$1 = function($0) { |
20935 return this.getMember($assert_String($0)); | 20998 return this.getMember($assert_String($0)); |
20936 }; | 20999 }; |
20937 lang_Type.prototype.getOrMakeConcreteType$1 = function($0) { | 21000 lang_Type.prototype.getOrMakeConcreteType$1 = function($0) { |
20938 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); | 21001 return this.getOrMakeConcreteType(($0 && $0.is$List_Type())); |
20939 }; | 21002 }; |
20940 lang_Type.prototype.hashCode$0 = lang_Type.prototype.hashCode; | |
20941 lang_Type.prototype.isAssignable$1 = function($0) { | 21003 lang_Type.prototype.isAssignable$1 = function($0) { |
20942 return this.isAssignable(($0 && $0.is$lang_Type())); | 21004 return this.isAssignable(($0 && $0.is$lang_Type())); |
20943 }; | 21005 }; |
20944 lang_Type.prototype.isSubtypeOf$1 = function($0) { | 21006 lang_Type.prototype.isSubtypeOf$1 = function($0) { |
20945 return this.isSubtypeOf(($0 && $0.is$lang_Type())); | 21007 return this.isSubtypeOf(($0 && $0.is$lang_Type())); |
20946 }; | 21008 }; |
20947 lang_Type.prototype.markUsed$0 = lang_Type.prototype.markUsed; | 21009 lang_Type.prototype.markUsed$0 = lang_Type.prototype.markUsed; |
20948 lang_Type.prototype.resolveMember$1 = function($0) { | 21010 lang_Type.prototype.resolveMember$1 = function($0) { |
20949 return this.resolveMember($assert_String($0)); | 21011 return this.resolveMember($assert_String($0)); |
20950 }; | 21012 }; |
20951 lang_Type.prototype.resolveTypeParams$1 = function($0) { | 21013 lang_Type.prototype.resolveTypeParams$1 = function($0) { |
20952 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); | 21014 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); |
20953 }; | 21015 }; |
20954 // ********** Code for ParameterType ************** | 21016 // ********** Code for ParameterType ************** |
20955 function ParameterType(name, typeParameter) { | 21017 function ParameterType(name, typeParameter) { |
20956 this.typeParameter = typeParameter; | 21018 this.typeParameter = typeParameter; |
20957 // Initializers done | 21019 // Initializers done |
20958 lang_Type.call(this, name); | 21020 lang_Type.call(this, name); |
20959 } | 21021 } |
20960 $inherits(ParameterType, lang_Type); | 21022 $inherits(ParameterType, lang_Type); |
20961 ParameterType.prototype.is$ParameterType = function(){return this;}; | 21023 ParameterType.prototype.is$ParameterType = function(){return this;}; |
| 21024 ParameterType.prototype.get$typeParameter = function() { return this.typeParamet
er; }; |
| 21025 ParameterType.prototype.set$typeParameter = function(value) { return this.typePa
rameter = value; }; |
20962 ParameterType.prototype.get$extendsType = function() { return this.extendsType;
}; | 21026 ParameterType.prototype.get$extendsType = function() { return this.extendsType;
}; |
20963 ParameterType.prototype.set$extendsType = function(value) { return this.extendsT
ype = value; }; | 21027 ParameterType.prototype.set$extendsType = function(value) { return this.extendsT
ype = value; }; |
20964 ParameterType.prototype.get$isClass = function() { | 21028 ParameterType.prototype.get$isClass = function() { |
20965 return false; | 21029 return false; |
20966 } | 21030 } |
20967 ParameterType.prototype.get$library = function() { | 21031 ParameterType.prototype.get$library = function() { |
20968 return null; | 21032 return null; |
20969 } | 21033 } |
20970 ParameterType.prototype.get$span = function() { | 21034 ParameterType.prototype.get$span = function() { |
20971 return this.typeParameter.span; | 21035 return this.typeParameter.span; |
(...skipping 19 matching lines...) Expand all Loading... |
20991 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) { | 21055 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) { |
20992 $globals.world.internalError('no concrete types of type parameters yet', this.
get$span()); | 21056 $globals.world.internalError('no concrete types of type parameters yet', this.
get$span()); |
20993 } | 21057 } |
20994 ParameterType.prototype.resolveTypeParams = function(inType) { | 21058 ParameterType.prototype.resolveTypeParams = function(inType) { |
20995 var $0; | 21059 var $0; |
20996 return (($0 = inType.typeArguments.$index(this.name)) && $0.is$lang_Type()); | 21060 return (($0 = inType.typeArguments.$index(this.name)) && $0.is$lang_Type()); |
20997 } | 21061 } |
20998 ParameterType.prototype.addDirectSubtype = function(type) { | 21062 ParameterType.prototype.addDirectSubtype = function(type) { |
20999 $globals.world.internalError('no subtypes of type parameters yet', this.get$sp
an()); | 21063 $globals.world.internalError('no subtypes of type parameters yet', this.get$sp
an()); |
21000 } | 21064 } |
21001 ParameterType.prototype.resolve = function(inType) { | 21065 ParameterType.prototype.resolve = function() { |
21002 if (this.typeParameter.extendsType != null) { | 21066 if (this.typeParameter.extendsType != null) { |
21003 this.extendsType = inType.resolveType(this.typeParameter.extendsType, true); | 21067 this.extendsType = this.get$enclosingElement().resolveType(this.typeParamete
r.extendsType, true); |
21004 } | 21068 } |
21005 else { | 21069 else { |
21006 this.extendsType = $globals.world.objectType; | 21070 this.extendsType = $globals.world.objectType; |
21007 } | 21071 } |
21008 } | 21072 } |
21009 ParameterType.prototype.addDirectSubtype$1 = function($0) { | 21073 ParameterType.prototype.addDirectSubtype$1 = function($0) { |
21010 return this.addDirectSubtype(($0 && $0.is$lang_Type())); | 21074 return this.addDirectSubtype(($0 && $0.is$lang_Type())); |
21011 }; | 21075 }; |
21012 ParameterType.prototype.getConstructor$1 = function($0) { | 21076 ParameterType.prototype.getConstructor$1 = function($0) { |
21013 return this.getConstructor($assert_String($0)); | 21077 return this.getConstructor($assert_String($0)); |
21014 }; | 21078 }; |
21015 ParameterType.prototype.getOrMakeConcreteType$1 = function($0) { | 21079 ParameterType.prototype.getOrMakeConcreteType$1 = function($0) { |
21016 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); | 21080 return this.getOrMakeConcreteType(($0 && $0.is$List_Type())); |
21017 }; | 21081 }; |
21018 ParameterType.prototype.isSubtypeOf$1 = function($0) { | 21082 ParameterType.prototype.isSubtypeOf$1 = function($0) { |
21019 return this.isSubtypeOf(($0 && $0.is$lang_Type())); | 21083 return this.isSubtypeOf(($0 && $0.is$lang_Type())); |
21020 }; | 21084 }; |
21021 ParameterType.prototype.resolve$1 = function($0) { | 21085 ParameterType.prototype.resolve$0 = ParameterType.prototype.resolve; |
21022 return this.resolve(($0 && $0.is$lang_Type())); | |
21023 }; | |
21024 ParameterType.prototype.resolveMember$1 = function($0) { | 21086 ParameterType.prototype.resolveMember$1 = function($0) { |
21025 return this.resolveMember($assert_String($0)); | 21087 return this.resolveMember($assert_String($0)); |
21026 }; | 21088 }; |
21027 ParameterType.prototype.resolveTypeParams$1 = function($0) { | 21089 ParameterType.prototype.resolveTypeParams$1 = function($0) { |
21028 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); | 21090 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); |
21029 }; | 21091 }; |
21030 // ********** Code for NonNullableType ************** | 21092 // ********** Code for NonNullableType ************** |
21031 function NonNullableType(type) { | 21093 function NonNullableType(type) { |
21032 this.type = type; | 21094 this.type = type; |
21033 // Initializers done | 21095 // Initializers done |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21099 } | 21161 } |
21100 NonNullableType.prototype.get$hasTypeParams = function() { | 21162 NonNullableType.prototype.get$hasTypeParams = function() { |
21101 return this.type.get$hasTypeParams(); | 21163 return this.type.get$hasTypeParams(); |
21102 } | 21164 } |
21103 NonNullableType.prototype.get$typeofName = function() { | 21165 NonNullableType.prototype.get$typeofName = function() { |
21104 return this.type.get$typeofName(); | 21166 return this.type.get$typeofName(); |
21105 } | 21167 } |
21106 NonNullableType.prototype.get$jsname = function() { | 21168 NonNullableType.prototype.get$jsname = function() { |
21107 return this.type.get$jsname(); | 21169 return this.type.get$jsname(); |
21108 } | 21170 } |
21109 NonNullableType.prototype.set$jsname = function(name) { | |
21110 return this.type.set$jsname(name); | |
21111 } | |
21112 NonNullableType.prototype.get$members = function() { | 21171 NonNullableType.prototype.get$members = function() { |
21113 return this.type.get$members(); | 21172 return this.type.get$members(); |
21114 } | 21173 } |
21115 NonNullableType.prototype.get$definition = function() { | 21174 NonNullableType.prototype.get$definition = function() { |
21116 return this.type.get$definition(); | 21175 return this.type.get$definition(); |
21117 } | 21176 } |
21118 NonNullableType.prototype.get$factories = function() { | 21177 NonNullableType.prototype.get$factories = function() { |
21119 return this.type.get$factories(); | 21178 return this.type.get$factories(); |
21120 } | 21179 } |
21121 NonNullableType.prototype.get$typeArgsInOrder = function() { | 21180 NonNullableType.prototype.get$typeArgsInOrder = function() { |
21122 var $0; | 21181 var $0; |
21123 return (($0 = this.type.get$typeArgsInOrder()) && $0.is$Collection$Type()); | 21182 return (($0 = this.type.get$typeArgsInOrder()) && $0.is$Collection_Type()); |
21124 } | 21183 } |
21125 NonNullableType.prototype.get$genericType = function() { | 21184 NonNullableType.prototype.get$genericType = function() { |
21126 return this.type.get$genericType(); | 21185 return this.type.get$genericType(); |
21127 } | 21186 } |
21128 NonNullableType.prototype.get$interfaces = function() { | 21187 NonNullableType.prototype.get$interfaces = function() { |
21129 return this.type.get$interfaces(); | 21188 return this.type.get$interfaces(); |
21130 } | 21189 } |
21131 NonNullableType.prototype.get$parent = function() { | 21190 NonNullableType.prototype.get$parent = function() { |
21132 return this.type.get$parent(); | 21191 return this.type.get$parent(); |
21133 } | 21192 } |
21134 NonNullableType.prototype.getAllMembers = function() { | 21193 NonNullableType.prototype.getAllMembers = function() { |
21135 return this.type.getAllMembers(); | 21194 return this.type.getAllMembers(); |
21136 } | 21195 } |
21137 NonNullableType.prototype.get$isNativeType = function() { | 21196 NonNullableType.prototype.get$isNative = function() { |
21138 return this.type.get$isNativeType(); | 21197 return this.type.get$isNative(); |
21139 } | 21198 } |
21140 NonNullableType.prototype.addDirectSubtype$1 = function($0) { | 21199 NonNullableType.prototype.addDirectSubtype$1 = function($0) { |
21141 return this.addDirectSubtype(($0 && $0.is$lang_Type())); | 21200 return this.addDirectSubtype(($0 && $0.is$lang_Type())); |
21142 }; | 21201 }; |
21143 NonNullableType.prototype.getConstructor$1 = function($0) { | 21202 NonNullableType.prototype.getConstructor$1 = function($0) { |
21144 return this.getConstructor($assert_String($0)); | 21203 return this.getConstructor($assert_String($0)); |
21145 }; | 21204 }; |
21146 NonNullableType.prototype.getFactory$2 = function($0, $1) { | 21205 NonNullableType.prototype.getFactory$2 = function($0, $1) { |
21147 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1)); | 21206 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1)); |
21148 }; | 21207 }; |
21149 NonNullableType.prototype.getMember$1 = function($0) { | 21208 NonNullableType.prototype.getMember$1 = function($0) { |
21150 return this.getMember($assert_String($0)); | 21209 return this.getMember($assert_String($0)); |
21151 }; | 21210 }; |
21152 NonNullableType.prototype.getOrMakeConcreteType$1 = function($0) { | 21211 NonNullableType.prototype.getOrMakeConcreteType$1 = function($0) { |
21153 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); | 21212 return this.getOrMakeConcreteType(($0 && $0.is$List_Type())); |
21154 }; | 21213 }; |
21155 NonNullableType.prototype.isSubtypeOf$1 = function($0) { | 21214 NonNullableType.prototype.isSubtypeOf$1 = function($0) { |
21156 return this.isSubtypeOf(($0 && $0.is$lang_Type())); | 21215 return this.isSubtypeOf(($0 && $0.is$lang_Type())); |
21157 }; | 21216 }; |
21158 NonNullableType.prototype.markUsed$0 = NonNullableType.prototype.markUsed; | 21217 NonNullableType.prototype.markUsed$0 = NonNullableType.prototype.markUsed; |
21159 NonNullableType.prototype.resolveMember$1 = function($0) { | 21218 NonNullableType.prototype.resolveMember$1 = function($0) { |
21160 return this.resolveMember($assert_String($0)); | 21219 return this.resolveMember($assert_String($0)); |
21161 }; | 21220 }; |
21162 NonNullableType.prototype.resolveTypeParams$1 = function($0) { | 21221 NonNullableType.prototype.resolveTypeParams$1 = function($0) { |
21163 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); | 21222 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21206 var newTypeArgs = []; | 21265 var newTypeArgs = []; |
21207 var needsNewType = false; | 21266 var needsNewType = false; |
21208 var $list = this.typeArgsInOrder; | 21267 var $list = this.typeArgsInOrder; |
21209 for (var $i = 0;$i < $list.length; $i++) { | 21268 for (var $i = 0;$i < $list.length; $i++) { |
21210 var t = $list.$index($i); | 21269 var t = $list.$index($i); |
21211 var newType = t.resolveTypeParams$1(inType); | 21270 var newType = t.resolveTypeParams$1(inType); |
21212 if ($notnull_bool($ne(newType, t))) needsNewType = true; | 21271 if ($notnull_bool($ne(newType, t))) needsNewType = true; |
21213 newTypeArgs.add$1(newType); | 21272 newTypeArgs.add$1(newType); |
21214 } | 21273 } |
21215 if (!$notnull_bool(needsNewType)) return this; | 21274 if (!$notnull_bool(needsNewType)) return this; |
21216 return this.genericType.getOrMakeConcreteType((newTypeArgs && newTypeArgs.is$L
ist$Type())); | 21275 return this.genericType.getOrMakeConcreteType((newTypeArgs && newTypeArgs.is$L
ist_Type())); |
21217 } | 21276 } |
21218 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) { | 21277 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) { |
21219 return this.genericType.getOrMakeConcreteType(typeArgs); | 21278 return this.genericType.getOrMakeConcreteType(typeArgs); |
21220 } | 21279 } |
21221 ConcreteType.prototype.get$parent = function() { | 21280 ConcreteType.prototype.get$parent = function() { |
21222 if (this._parent == null && this.genericType.get$parent() != null) { | 21281 if (this._parent == null && this.genericType.get$parent() != null) { |
21223 this._parent = this.genericType.get$parent().resolveTypeParams(this); | 21282 this._parent = this.genericType.get$parent().resolveTypeParams(this); |
21224 } | 21283 } |
21225 return this._parent; | 21284 return this._parent; |
21226 } | 21285 } |
(...skipping 25 matching lines...) Expand all Loading... |
21252 ConcreteType.prototype.getAllMembers = function() { | 21311 ConcreteType.prototype.getAllMembers = function() { |
21253 var result = this.genericType.getAllMembers(); | 21312 var result = this.genericType.getAllMembers(); |
21254 var $list = result.getKeys$0(); | 21313 var $list = result.getKeys$0(); |
21255 for (var $i = result.getKeys$0().iterator$0(); $i.hasNext$0(); ) { | 21314 for (var $i = result.getKeys$0().iterator$0(); $i.hasNext$0(); ) { |
21256 var memberName = $i.next$0(); | 21315 var memberName = $i.next$0(); |
21257 var myMember = this.members.$index(memberName); | 21316 var myMember = this.members.$index(memberName); |
21258 if ($notnull_bool($ne(myMember, null))) { | 21317 if ($notnull_bool($ne(myMember, null))) { |
21259 result.$setindex(memberName, myMember); | 21318 result.$setindex(memberName, myMember); |
21260 } | 21319 } |
21261 } | 21320 } |
21262 return (result && result.is$Map$String$Member()); | 21321 return (result && result.is$Map_String$Member()); |
21263 } | 21322 } |
21264 ConcreteType.prototype.markUsed = function() { | 21323 ConcreteType.prototype.markUsed = function() { |
21265 this.genericType.markUsed(); | 21324 this.genericType.markUsed(); |
21266 } | 21325 } |
21267 ConcreteType.prototype.genMethod = function(method) { | 21326 ConcreteType.prototype.genMethod = function(method) { |
21268 this.genericType.genMethod(method); | 21327 this.genericType.genMethod(method); |
21269 } | 21328 } |
21270 ConcreteType.prototype.getFactory = function(type, constructorName) { | 21329 ConcreteType.prototype.getFactory = function(type, constructorName) { |
21271 return this.genericType.getFactory(type, constructorName); | 21330 return this.genericType.getFactory(type, constructorName); |
21272 } | 21331 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21322 ConcreteType.prototype.getConstructor$1 = function($0) { | 21381 ConcreteType.prototype.getConstructor$1 = function($0) { |
21323 return this.getConstructor($assert_String($0)); | 21382 return this.getConstructor($assert_String($0)); |
21324 }; | 21383 }; |
21325 ConcreteType.prototype.getFactory$2 = function($0, $1) { | 21384 ConcreteType.prototype.getFactory$2 = function($0, $1) { |
21326 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1)); | 21385 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1)); |
21327 }; | 21386 }; |
21328 ConcreteType.prototype.getMember$1 = function($0) { | 21387 ConcreteType.prototype.getMember$1 = function($0) { |
21329 return this.getMember($assert_String($0)); | 21388 return this.getMember($assert_String($0)); |
21330 }; | 21389 }; |
21331 ConcreteType.prototype.getOrMakeConcreteType$1 = function($0) { | 21390 ConcreteType.prototype.getOrMakeConcreteType$1 = function($0) { |
21332 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); | 21391 return this.getOrMakeConcreteType(($0 && $0.is$List_Type())); |
21333 }; | 21392 }; |
21334 ConcreteType.prototype.markUsed$0 = ConcreteType.prototype.markUsed; | 21393 ConcreteType.prototype.markUsed$0 = ConcreteType.prototype.markUsed; |
21335 ConcreteType.prototype.resolveTypeParams$1 = function($0) { | 21394 ConcreteType.prototype.resolveTypeParams$1 = function($0) { |
21336 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); | 21395 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); |
21337 }; | 21396 }; |
21338 // ********** Code for DefinedType ************** | 21397 // ********** Code for DefinedType ************** |
21339 function DefinedType(name, library, definition, isClass) { | 21398 function DefinedType(name, library, definition, isClass) { |
21340 this.isUsed = false | 21399 this.isUsed = false |
21341 this.isNativeType = false | 21400 this.isNative = false |
21342 this.library = library; | 21401 this.library = library; |
21343 this.isClass = isClass; | 21402 this.isClass = isClass; |
21344 this.directSubtypes = new HashSetImplementation(); | 21403 this.directSubtypes = new HashSetImplementation(); |
21345 this.constructors = $map([]); | 21404 this.constructors = $map([]); |
21346 this.members = $map([]); | 21405 this.members = $map([]); |
21347 this.factories = new FactoryMap(); | 21406 this.factories = new FactoryMap(); |
21348 // Initializers done | 21407 // Initializers done |
21349 lang_Type.call(this, name); | 21408 lang_Type.call(this, name); |
21350 this.setDefinition(definition); | 21409 this.setDefinition(definition); |
21351 } | 21410 } |
(...skipping 14 matching lines...) Expand all Loading... |
21366 DefinedType.prototype.get$typeParameters = function() { return this.typeParamete
rs; }; | 21425 DefinedType.prototype.get$typeParameters = function() { return this.typeParamete
rs; }; |
21367 DefinedType.prototype.set$typeParameters = function(value) { return this.typePar
ameters = value; }; | 21426 DefinedType.prototype.set$typeParameters = function(value) { return this.typePar
ameters = value; }; |
21368 DefinedType.prototype.get$constructors = function() { return this.constructors;
}; | 21427 DefinedType.prototype.get$constructors = function() { return this.constructors;
}; |
21369 DefinedType.prototype.set$constructors = function(value) { return this.construct
ors = value; }; | 21428 DefinedType.prototype.set$constructors = function(value) { return this.construct
ors = value; }; |
21370 DefinedType.prototype.get$members = function() { return this.members; }; | 21429 DefinedType.prototype.get$members = function() { return this.members; }; |
21371 DefinedType.prototype.set$members = function(value) { return this.members = valu
e; }; | 21430 DefinedType.prototype.set$members = function(value) { return this.members = valu
e; }; |
21372 DefinedType.prototype.get$factories = function() { return this.factories; }; | 21431 DefinedType.prototype.get$factories = function() { return this.factories; }; |
21373 DefinedType.prototype.set$factories = function(value) { return this.factories =
value; }; | 21432 DefinedType.prototype.set$factories = function(value) { return this.factories =
value; }; |
21374 DefinedType.prototype.get$isUsed = function() { return this.isUsed; }; | 21433 DefinedType.prototype.get$isUsed = function() { return this.isUsed; }; |
21375 DefinedType.prototype.set$isUsed = function(value) { return this.isUsed = value;
}; | 21434 DefinedType.prototype.set$isUsed = function(value) { return this.isUsed = value;
}; |
21376 DefinedType.prototype.get$isNativeType = function() { return this.isNativeType;
}; | 21435 DefinedType.prototype.get$isNative = function() { return this.isNative; }; |
21377 DefinedType.prototype.set$isNativeType = function(value) { return this.isNativeT
ype = value; }; | 21436 DefinedType.prototype.set$isNative = function(value) { return this.isNative = va
lue; }; |
21378 DefinedType.prototype.setDefinition = function(def) { | 21437 DefinedType.prototype.setDefinition = function(def) { |
21379 $assert(this.definition == null, "definition == null", "type.dart", 743, 12); | 21438 var $0; |
| 21439 $assert(this.definition == null, "definition == null", "type.dart", 725, 12); |
21380 this.definition = def; | 21440 this.definition = def; |
21381 if ((this.definition instanceof TypeDefinition) && $notnull_bool($ne(this.defi
nition.get$nativeType(), null))) { | 21441 if ((this.definition instanceof TypeDefinition) && $notnull_bool($ne(this.defi
nition.get$nativeType(), null))) { |
21382 this.isNativeType = true; | 21442 this.isNative = true; |
21383 } | 21443 } |
21384 if (this.definition != null && this.definition.get$typeParameters() != null) { | 21444 if (this.definition != null && $notnull_bool($ne(this.definition.get$typeParam
eters(), null))) { |
21385 this._concreteTypes = $map([]); | 21445 this._concreteTypes = $map([]); |
21386 this.typeParameters = []; | 21446 this.typeParameters = (($0 = this.definition.get$typeParameters()) && $0.is$
List_ParameterType()); |
21387 var $list = this.definition.get$typeParameters(); | |
21388 for (var $i = 0;$i < $list.length; $i++) { | |
21389 var tp = $list.$index($i); | |
21390 var paramName = tp.get$name().get$name(); | |
21391 this.typeParameters.add(new ParameterType($assert_String(paramName), tp)); | |
21392 } | |
21393 } | 21447 } |
21394 } | 21448 } |
21395 DefinedType.prototype.get$isHiddenNativeType = function() { | 21449 DefinedType.prototype.get$isHiddenNativeType = function() { |
21396 return $eq(this.library, $globals.world.get$dom()) || ($notnull_bool($ne(this.
definition.get$nativeType(), null)) && $notnull_bool(this.definition.get$nativeT
ype().get$isConstructorHidden())); | 21450 return $eq(this.library, $globals.world.get$dom()) || ($notnull_bool($ne(this.
definition.get$nativeType(), null)) && $notnull_bool(this.definition.get$nativeT
ype().get$isConstructorHidden())); |
21397 } | 21451 } |
21398 DefinedType.prototype.get$typeArgsInOrder = function() { | 21452 DefinedType.prototype.get$typeArgsInOrder = function() { |
21399 if (this.typeParameters == null) return null; | 21453 if (this.typeParameters == null) return null; |
21400 if (this._typeArgsInOrder == null) { | 21454 if (this._typeArgsInOrder == null) { |
21401 this._typeArgsInOrder = new FixedCollection$Type($globals.world.varType, thi
s.typeParameters.length); | 21455 this._typeArgsInOrder = new FixedCollection_lang_Type($globals.world.varType
, this.typeParameters.length); |
21402 } | 21456 } |
21403 return this._typeArgsInOrder; | 21457 return this._typeArgsInOrder; |
21404 } | 21458 } |
21405 DefinedType.prototype.get$isVar = function() { | 21459 DefinedType.prototype.get$isVar = function() { |
21406 return $eq(this, $globals.world.varType); | 21460 return $eq(this, $globals.world.varType); |
21407 } | 21461 } |
21408 DefinedType.prototype.get$isVoid = function() { | 21462 DefinedType.prototype.get$isVoid = function() { |
21409 return $eq(this, $globals.world.voidType); | 21463 return $eq(this, $globals.world.voidType); |
21410 } | 21464 } |
21411 DefinedType.prototype.get$isTop = function() { | 21465 DefinedType.prototype.get$isTop = function() { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21479 var interfaces = []; | 21533 var interfaces = []; |
21480 for (var $i = 0;$i < types.length; $i++) { | 21534 for (var $i = 0;$i < types.length; $i++) { |
21481 var type = types.$index($i); | 21535 var type = types.$index($i); |
21482 var resolvedInterface = this.resolveType((type && type.is$TypeReference()),
true); | 21536 var resolvedInterface = this.resolveType((type && type.is$TypeReference()),
true); |
21483 if ($notnull_bool(resolvedInterface.get$isClosed()) && !($notnull_bool(this.
library.get$isCore()) || $notnull_bool(this.library.get$isCoreImpl()))) { | 21537 if ($notnull_bool(resolvedInterface.get$isClosed()) && !($notnull_bool(this.
library.get$isCore()) || $notnull_bool(this.library.get$isCoreImpl()))) { |
21484 $globals.world.error(('can not implement "' + resolvedInterface.get$name()
+ '": ') + 'only native implementation allowed', (($0 = type.get$span()) && $0.
is$SourceSpan())); | 21538 $globals.world.error(('can not implement "' + resolvedInterface.get$name()
+ '": ') + 'only native implementation allowed', (($0 = type.get$span()) && $0.
is$SourceSpan())); |
21485 } | 21539 } |
21486 resolvedInterface.addDirectSubtype$1(this); | 21540 resolvedInterface.addDirectSubtype$1(this); |
21487 interfaces.add$1(resolvedInterface); | 21541 interfaces.add$1(resolvedInterface); |
21488 } | 21542 } |
21489 return (interfaces && interfaces.is$List$Type()); | 21543 return (interfaces && interfaces.is$List_Type()); |
21490 } | 21544 } |
21491 DefinedType.prototype.addDirectSubtype = function(type) { | 21545 DefinedType.prototype.addDirectSubtype = function(type) { |
21492 $assert(this._subtypes == null, "_subtypes == null", "type.dart", 864, 12); | 21546 $assert(this._subtypes == null, "_subtypes == null", "type.dart", 841, 12); |
21493 this.directSubtypes.add(type); | 21547 this.directSubtypes.add(type); |
21494 } | 21548 } |
21495 DefinedType.prototype.get$subtypes = function() { | 21549 DefinedType.prototype.get$subtypes = function() { |
21496 var $0; | 21550 var $0; |
21497 if (this._subtypes == null) { | 21551 if (this._subtypes == null) { |
21498 this._subtypes = new HashSetImplementation(); | 21552 this._subtypes = new HashSetImplementation(); |
21499 var $list = this.directSubtypes; | 21553 var $list = this.directSubtypes; |
21500 for (var $i = this.directSubtypes.iterator(); $i.hasNext$0(); ) { | 21554 for (var $i = this.directSubtypes.iterator(); $i.hasNext$0(); ) { |
21501 var st = $i.next$0(); | 21555 var st = $i.next$0(); |
21502 this._subtypes.add(st); | 21556 this._subtypes.add(st); |
21503 this._subtypes.addAll((($0 = st.get$subtypes()) && $0.is$Collection$E())); | 21557 this._subtypes.addAll((($0 = st.get$subtypes()) && $0.is$Collection_E())); |
21504 } | 21558 } |
21505 } | 21559 } |
21506 return this._subtypes; | 21560 return this._subtypes; |
21507 } | 21561 } |
21508 DefinedType.prototype._cycleInClassExtends = function() { | 21562 DefinedType.prototype._cycleInClassExtends = function() { |
21509 var seen = new HashSetImplementation(); | 21563 var seen = new HashSetImplementation(); |
21510 seen.add(this); | 21564 seen.add(this); |
21511 var ancestor = this.get$parent(); | 21565 var ancestor = this.get$parent(); |
21512 while ($notnull_bool($ne(ancestor, null))) { | 21566 while ($notnull_bool($ne(ancestor, null))) { |
21513 if (ancestor === this) { | 21567 if (ancestor === this) { |
(...skipping 27 matching lines...) Expand all Loading... |
21541 } | 21595 } |
21542 return false; | 21596 return false; |
21543 } | 21597 } |
21544 for (var i = 0; | 21598 for (var i = 0; |
21545 i < this.interfaces.length; i++) { | 21599 i < this.interfaces.length; i++) { |
21546 if ($notnull_bool(_helper(this.interfaces.$index(i)))) return i; | 21600 if ($notnull_bool(_helper(this.interfaces.$index(i)))) return i; |
21547 } | 21601 } |
21548 return -1; | 21602 return -1; |
21549 } | 21603 } |
21550 DefinedType.prototype.resolve = function() { | 21604 DefinedType.prototype.resolve = function() { |
21551 var $this = this; // closure support | |
21552 var $0; | 21605 var $0; |
21553 if ((this.definition instanceof TypeDefinition)) { | 21606 if ((this.definition instanceof TypeDefinition)) { |
21554 var typeDef = (($0 = this.definition) && $0.is$TypeDefinition()); | 21607 var typeDef = (($0 = this.definition) && $0.is$TypeDefinition()); |
21555 if ($notnull_bool(this.isClass)) { | 21608 if ($notnull_bool(this.isClass)) { |
21556 if (typeDef.extendsTypes != null && typeDef.extendsTypes.length > 0) { | 21609 if (typeDef.extendsTypes != null && typeDef.extendsTypes.length > 0) { |
21557 if (typeDef.extendsTypes.length > 1) { | 21610 if (typeDef.extendsTypes.length > 1) { |
21558 $globals.world.error('more than one base class', (($0 = typeDef.extend
sTypes.$index(1).get$span()) && $0.is$SourceSpan())); | 21611 $globals.world.error('more than one base class', (($0 = typeDef.extend
sTypes.$index(1).get$span()) && $0.is$SourceSpan())); |
21559 } | 21612 } |
21560 var extendsTypeRef = typeDef.extendsTypes.$index(0); | 21613 var extendsTypeRef = typeDef.extendsTypes.$index(0); |
21561 if ((extendsTypeRef instanceof GenericTypeReference)) { | 21614 if ((extendsTypeRef instanceof GenericTypeReference)) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21599 } | 21652 } |
21600 } | 21653 } |
21601 } | 21654 } |
21602 else if ((this.definition instanceof FunctionTypeDefinition)) { | 21655 else if ((this.definition instanceof FunctionTypeDefinition)) { |
21603 this.interfaces = [$globals.world.functionType]; | 21656 this.interfaces = [$globals.world.functionType]; |
21604 } | 21657 } |
21605 if (this.typeParameters != null) { | 21658 if (this.typeParameters != null) { |
21606 var $list = this.typeParameters; | 21659 var $list = this.typeParameters; |
21607 for (var $i = 0;$i < $list.length; $i++) { | 21660 for (var $i = 0;$i < $list.length; $i++) { |
21608 var tp = $list.$index($i); | 21661 var tp = $list.$index($i); |
21609 tp.resolve$1(this); | 21662 tp.set$enclosingElement(this); |
| 21663 tp.resolve$0(); |
21610 } | 21664 } |
21611 } | 21665 } |
21612 $globals.world._addType(this); | 21666 $globals.world._addType(this); |
21613 var $list = this.constructors.getValues(); | 21667 var $list = this.constructors.getValues(); |
21614 for (var $i = this.constructors.getValues().iterator$0(); $i.hasNext$0(); ) { | 21668 for (var $i = this.constructors.getValues().iterator$0(); $i.hasNext$0(); ) { |
21615 var c = $i.next$0(); | 21669 var c = $i.next$0(); |
21616 c.resolve$1(this); | 21670 c.resolve$0(); |
21617 } | 21671 } |
21618 var $list0 = this.members.getValues(); | 21672 var $list0 = this.members.getValues(); |
21619 for (var $i = this.members.getValues().iterator$0(); $i.hasNext$0(); ) { | 21673 for (var $i = this.members.getValues().iterator$0(); $i.hasNext$0(); ) { |
21620 var m = $i.next$0(); | 21674 var m = $i.next$0(); |
21621 m.resolve$1(this); | 21675 m.resolve$0(); |
21622 } | 21676 } |
21623 this.factories.forEach((function (f) { | 21677 this.factories.forEach((function (f) { |
21624 return f.resolve$1($this); | 21678 return f.resolve$0(); |
21625 }) | 21679 }) |
21626 ); | 21680 ); |
21627 } | 21681 } |
21628 DefinedType.prototype.addMethod = function(methodName, definition) { | 21682 DefinedType.prototype.addMethod = function(methodName, definition) { |
21629 if (methodName == null) methodName = definition.name.name; | 21683 if (methodName == null) methodName = definition.name.name; |
21630 var method = new MethodMember(methodName, this, definition); | 21684 var method = new MethodMember(methodName, this, definition); |
21631 if ($notnull_bool(method.get$isConstructor())) { | 21685 if ($notnull_bool(method.get$isConstructor())) { |
21632 if (this.constructors.containsKey(method.get$constructorName())) { | 21686 if (this.constructors.containsKey(method.get$constructorName())) { |
21633 $globals.world.error(('duplicate constructor definition of ' + method.get$
name()), definition.span); | 21687 $globals.world.error(('duplicate constructor definition of ' + method.get$
name()), definition.span); |
21634 return; | 21688 return; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21682 if (this.members.containsKey(name)) { | 21736 if (this.members.containsKey(name)) { |
21683 $globals.world.error(('duplicate field definition of "' + name + '"'), def
inition.span); | 21737 $globals.world.error(('duplicate field definition of "' + name + '"'), def
inition.span); |
21684 return; | 21738 return; |
21685 } | 21739 } |
21686 var value = null; | 21740 var value = null; |
21687 if (definition.values != null) { | 21741 if (definition.values != null) { |
21688 value = definition.values.$index(i); | 21742 value = definition.values.$index(i); |
21689 } | 21743 } |
21690 var field = new FieldMember($assert_String(name), this, definition, value); | 21744 var field = new FieldMember($assert_String(name), this, definition, value); |
21691 this.members.$setindex(name, field); | 21745 this.members.$setindex(name, field); |
21692 if ($notnull_bool(this.isNativeType)) { | 21746 if ($notnull_bool(this.isNative)) { |
21693 field.set$isNative(true); | 21747 field.set$isNative(true); |
21694 } | 21748 } |
21695 } | 21749 } |
21696 } | 21750 } |
21697 DefinedType.prototype.getFactory = function(type, constructorName) { | 21751 DefinedType.prototype.getFactory = function(type, constructorName) { |
21698 var ret = this.factories.getFactory(type.name, constructorName); | 21752 var ret = this.factories.getFactory(type.name, constructorName); |
21699 if ($notnull_bool($ne(ret, null))) return ret; | 21753 if ($notnull_bool($ne(ret, null))) return ret; |
21700 ret = this.factories.getFactory(this.name, constructorName); | 21754 ret = this.factories.getFactory(this.name, constructorName); |
21701 if ($notnull_bool($ne(ret, null))) return ret; | 21755 if ($notnull_bool($ne(ret, null))) return ret; |
21702 ret = this.constructors.$index(constructorName); | 21756 ret = this.constructors.$index(constructorName); |
(...skipping 10 matching lines...) Expand all Loading... |
21713 } | 21767 } |
21714 ret = this.factories.getFactory(this.name, constructorName); | 21768 ret = this.factories.getFactory(this.name, constructorName); |
21715 if ($notnull_bool($ne(ret, null))) return ret; | 21769 if ($notnull_bool($ne(ret, null))) return ret; |
21716 return this._tryCreateDefaultConstructor(constructorName); | 21770 return this._tryCreateDefaultConstructor(constructorName); |
21717 } | 21771 } |
21718 DefinedType.prototype._tryCreateDefaultConstructor = function(name) { | 21772 DefinedType.prototype._tryCreateDefaultConstructor = function(name) { |
21719 var $0; | 21773 var $0; |
21720 if (name == '' && this.definition != null && $notnull_bool(this.isClass) && th
is.constructors.get$length() == 0) { | 21774 if (name == '' && this.definition != null && $notnull_bool(this.isClass) && th
is.constructors.get$length() == 0) { |
21721 var span = this.definition.span; | 21775 var span = this.definition.span; |
21722 var inits = null, body = null; | 21776 var inits = null, body = null; |
21723 if ($notnull_bool(this.isNativeType)) { | 21777 if ($notnull_bool(this.isNative)) { |
21724 body = new NativeStatement(null, (span && span.is$SourceSpan())); | 21778 body = new NativeStatement(null, (span && span.is$SourceSpan())); |
21725 inits = null; | 21779 inits = null; |
21726 } | 21780 } |
21727 else { | 21781 else { |
21728 body = null; | 21782 body = null; |
21729 inits = [new CallExpression(new SuperExpression((span && span.is$SourceSpa
n())), [], (span && span.is$SourceSpan()))]; | 21783 inits = [new CallExpression(new SuperExpression((span && span.is$SourceSpa
n())), [], (span && span.is$SourceSpan()))]; |
21730 } | 21784 } |
21731 var typeDef = (($0 = this.definition) && $0.is$TypeDefinition()); | 21785 var typeDef = (($0 = this.definition) && $0.is$TypeDefinition()); |
21732 var c = new FunctionDefinition(null, null, typeDef.name, [], inits, body, (s
pan && span.is$SourceSpan())); | 21786 var c = new FunctionDefinition(null, null, typeDef.name, [], null, inits, bo
dy, (span && span.is$SourceSpan())); |
21733 this.addMethod(null, (c && c.is$FunctionDefinition())); | 21787 this.addMethod(null, (c && c.is$FunctionDefinition())); |
21734 this.constructors.$index('').resolve$1(this); | 21788 this.constructors.$index('').resolve$0(); |
21735 return this.constructors.$index(''); | 21789 return this.constructors.$index(''); |
21736 } | 21790 } |
21737 return null; | 21791 return null; |
21738 } | 21792 } |
21739 DefinedType.prototype.getMember = function(memberName) { | 21793 DefinedType.prototype.getMember = function(memberName) { |
21740 var $0; | 21794 var $0; |
21741 var member = (($0 = this.members.$index(memberName)) && $0.is$Member()); | 21795 var member = (($0 = this.members.$index(memberName)) && $0.is$Member()); |
21742 if (member != null) { | 21796 if (member != null) { |
21743 this._checkOverride(member); | 21797 this._checkOverride(member); |
21744 return member; | 21798 return member; |
21745 } | 21799 } |
21746 if ($notnull_bool(this.get$isTop())) { | 21800 if ($notnull_bool(this.get$isTop())) { |
21747 var libType = this.library.findTypeByName(memberName); | 21801 var libType = this.library.findTypeByName(memberName); |
21748 if ($notnull_bool($ne(libType, null))) { | 21802 if ($notnull_bool($ne(libType, null))) { |
21749 return (($0 = libType.get$typeMember()) && $0.is$Member()); | 21803 return (($0 = libType.get$typeMember()) && $0.is$Member()); |
21750 } | 21804 } |
21751 } | 21805 } |
21752 return this._getMemberInParents(memberName); | 21806 return this._getMemberInParents(memberName); |
21753 } | 21807 } |
21754 DefinedType._getDottedName = function(type) { | |
21755 if (type.names != null) { | |
21756 var names = map(type.names, (function (n) { | |
21757 return n.get$name(); | |
21758 }) | |
21759 ); | |
21760 return type.name.name + '.' + Strings.join((names && names.is$List$String())
, '.'); | |
21761 } | |
21762 else { | |
21763 return type.name.name; | |
21764 } | |
21765 } | |
21766 DefinedType.prototype.resolveType = function(node, typeErrors) { | |
21767 var $0; | |
21768 if (node == null) return $globals.world.varType; | |
21769 if (node.type != null) return node.type; | |
21770 if ((node instanceof NameTypeReference)) { | |
21771 var typeRef = (node && node.is$NameTypeReference()); | |
21772 var name; | |
21773 if (typeRef.names != null) { | |
21774 name = $assert_String(typeRef.names.last().get$name()); | |
21775 } | |
21776 else { | |
21777 name = typeRef.name.name; | |
21778 } | |
21779 if (this.typeParameters != null) { | |
21780 var $list = this.typeParameters; | |
21781 for (var $i = 0;$i < $list.length; $i++) { | |
21782 var tp = $list.$index($i); | |
21783 if ($notnull_bool($eq(tp.get$name(), name))) { | |
21784 typeRef.type = (tp && tp.is$lang_Type()); | |
21785 } | |
21786 } | |
21787 } | |
21788 if (typeRef.type == null) { | |
21789 typeRef.type = this.library.findType(typeRef); | |
21790 } | |
21791 if (typeRef.type == null) { | |
21792 var message = ('cannot find type ' + DefinedType._getDottedName(typeRef)); | |
21793 if ($notnull_bool(typeErrors)) { | |
21794 $globals.world.error($assert_String(message), typeRef.span); | |
21795 typeRef.type = $globals.world.objectType; | |
21796 } | |
21797 else { | |
21798 $globals.world.warning($assert_String(message), typeRef.span); | |
21799 typeRef.type = $globals.world.varType; | |
21800 } | |
21801 } | |
21802 } | |
21803 else if ((node instanceof GenericTypeReference)) { | |
21804 var typeRef = (node && node.is$GenericTypeReference()); | |
21805 var baseType = this.resolveType(typeRef.baseType, typeErrors); | |
21806 if (!$notnull_bool(baseType.get$isGeneric())) { | |
21807 $globals.world.error(('' + baseType.get$name() + ' is not generic'), typeR
ef.span); | |
21808 return null; | |
21809 } | |
21810 if (typeRef.typeArguments.length != baseType.get$typeParameters().length) { | |
21811 $globals.world.error('wrong number of type arguments', typeRef.span); | |
21812 return null; | |
21813 } | |
21814 var typeArgs = []; | |
21815 for (var i = 0; | |
21816 i < typeRef.typeArguments.length; i++) { | |
21817 var extendsType = baseType.get$typeParameters().$index(i).get$extendsType(
); | |
21818 var typeArg = this.resolveType((($0 = typeRef.typeArguments.$index(i)) &&
$0.is$TypeReference()), typeErrors); | |
21819 typeArgs.add$1(typeArg); | |
21820 if ($notnull_bool($ne(extendsType, null)) && !(typeArg instanceof Paramete
rType)) { | |
21821 typeArg.ensureSubtypeOf$3(extendsType, typeRef.typeArguments.$index(i).g
et$span(), typeErrors); | |
21822 } | |
21823 } | |
21824 typeRef.type = (($0 = baseType.getOrMakeConcreteType$1(typeArgs)) && $0.is$l
ang_Type()); | |
21825 } | |
21826 else if ((node instanceof FunctionTypeReference)) { | |
21827 var typeRef = (node && node.is$FunctionTypeReference()); | |
21828 var name = ''; | |
21829 if (typeRef.func.name != null) name = typeRef.func.name.name; | |
21830 typeRef.type = this.library.getOrAddFunctionType($assert_String(name), typeR
ef.func, this); | |
21831 } | |
21832 else { | |
21833 $globals.world.internalError('unknown type reference', node.span); | |
21834 } | |
21835 return node.type; | |
21836 } | |
21837 DefinedType.prototype.resolveTypeParams = function(inType) { | 21808 DefinedType.prototype.resolveTypeParams = function(inType) { |
21838 return this; | 21809 return this; |
21839 } | 21810 } |
21840 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { | 21811 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { |
21841 $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1261, 12); | 21812 $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1158, 12); |
21842 var names = [this.name]; | 21813 var jsnames = []; |
| 21814 var names = []; |
21843 var typeMap = $map([]); | 21815 var typeMap = $map([]); |
21844 for (var i = 0; | 21816 for (var i = 0; |
21845 i < typeArgs.length; i++) { | 21817 i < typeArgs.length; i++) { |
21846 var paramName = this.typeParameters.$index(i).get$name(); | 21818 var paramName = this.typeParameters.$index(i).get$name(); |
21847 typeMap.$setindex(paramName, typeArgs.$index(i)); | 21819 typeMap.$setindex(paramName, typeArgs.$index(i)); |
21848 names.add$1(typeArgs.$index(i).get$name()); | 21820 names.add$1(typeArgs.$index(i).get$name()); |
| 21821 jsnames.add$1(typeArgs.$index(i).get$jsname()); |
21849 } | 21822 } |
21850 var concreteName = Strings.join((names && names.is$List$String()), '\$'); | 21823 var jsname = ('' + this.get$jsname() + '_' + Strings.join((jsnames && jsnames.
is$List_String()), '\$')); |
21851 var ret = this._concreteTypes.$index(concreteName); | 21824 var simpleName = ('' + this.name + '<' + Strings.join((names && names.is$List_
String()), ', ') + '>'); |
| 21825 var key = Strings.join((names && names.is$List_String()), '\$'); |
| 21826 var ret = this._concreteTypes.$index(key); |
21852 if ($notnull_bool(ret == null)) { | 21827 if ($notnull_bool(ret == null)) { |
21853 ret = new ConcreteType($assert_String(concreteName), this, typeMap, typeArgs
); | 21828 ret = new ConcreteType($assert_String(simpleName), this, typeMap, typeArgs); |
21854 this._concreteTypes.$setindex(concreteName, ret); | 21829 ret._jsname = $assert_String(jsname); |
| 21830 this._concreteTypes.$setindex(key, ret); |
21855 } | 21831 } |
21856 return (ret && ret.is$lang_Type()); | 21832 return (ret && ret.is$lang_Type()); |
21857 } | 21833 } |
21858 DefinedType.prototype.getCallStub = function(args) { | 21834 DefinedType.prototype.getCallStub = function(args) { |
21859 $assert(this.get$isFunction(), "isFunction", "type.dart", 1281, 12); | 21835 $assert(this.get$isFunction(), "isFunction", "type.dart", 1185, 12); |
21860 var name = _getCallStubName('call', args); | 21836 var name = _getCallStubName('call', args); |
21861 if (this.varStubs == null) this.varStubs = $map([]); | 21837 if (this.varStubs == null) this.varStubs = $map([]); |
21862 var stub = this.varStubs.$index(name); | 21838 var stub = this.varStubs.$index(name); |
21863 if ($notnull_bool(stub == null)) { | 21839 if ($notnull_bool(stub == null)) { |
21864 stub = new VarFunctionStub($assert_String(name), args); | 21840 stub = new VarFunctionStub($assert_String(name), args); |
21865 this.varStubs.$setindex(name, stub); | 21841 this.varStubs.$setindex(name, stub); |
21866 } | 21842 } |
21867 return (stub && stub.is$VarFunctionStub()); | 21843 return (stub && stub.is$VarFunctionStub()); |
21868 } | 21844 } |
21869 DefinedType.prototype.addDirectSubtype$1 = function($0) { | 21845 DefinedType.prototype.addDirectSubtype$1 = function($0) { |
21870 return this.addDirectSubtype(($0 && $0.is$lang_Type())); | 21846 return this.addDirectSubtype(($0 && $0.is$lang_Type())); |
21871 }; | 21847 }; |
21872 DefinedType.prototype.addMethod$2 = function($0, $1) { | 21848 DefinedType.prototype.addMethod$2 = function($0, $1) { |
21873 return this.addMethod($assert_String($0), ($1 && $1.is$FunctionDefinition())); | 21849 return this.addMethod($assert_String($0), ($1 && $1.is$FunctionDefinition())); |
21874 }; | 21850 }; |
21875 DefinedType.prototype.getConstructor$1 = function($0) { | 21851 DefinedType.prototype.getConstructor$1 = function($0) { |
21876 return this.getConstructor($assert_String($0)); | 21852 return this.getConstructor($assert_String($0)); |
21877 }; | 21853 }; |
21878 DefinedType.prototype.getFactory$2 = function($0, $1) { | 21854 DefinedType.prototype.getFactory$2 = function($0, $1) { |
21879 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1)); | 21855 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1)); |
21880 }; | 21856 }; |
21881 DefinedType.prototype.getMember$1 = function($0) { | 21857 DefinedType.prototype.getMember$1 = function($0) { |
21882 return this.getMember($assert_String($0)); | 21858 return this.getMember($assert_String($0)); |
21883 }; | 21859 }; |
21884 DefinedType.prototype.getOrMakeConcreteType$1 = function($0) { | 21860 DefinedType.prototype.getOrMakeConcreteType$1 = function($0) { |
21885 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); | 21861 return this.getOrMakeConcreteType(($0 && $0.is$List_Type())); |
21886 }; | 21862 }; |
21887 DefinedType.prototype.markUsed$0 = DefinedType.prototype.markUsed; | 21863 DefinedType.prototype.markUsed$0 = DefinedType.prototype.markUsed; |
21888 DefinedType.prototype.resolve$0 = DefinedType.prototype.resolve; | 21864 DefinedType.prototype.resolve$0 = DefinedType.prototype.resolve; |
21889 DefinedType.prototype.resolveTypeParams$1 = function($0) { | 21865 DefinedType.prototype.resolveTypeParams$1 = function($0) { |
21890 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); | 21866 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); |
21891 }; | 21867 }; |
21892 DefinedType.prototype.setDefinition$1 = function($0) { | 21868 DefinedType.prototype.setDefinition$1 = function($0) { |
21893 return this.setDefinition(($0 && $0.is$Definition())); | 21869 return this.setDefinition(($0 && $0.is$Definition())); |
21894 }; | 21870 }; |
21895 // ********** Code for NativeType ************** | 21871 // ********** Code for NativeType ************** |
(...skipping 11 matching lines...) Expand all Loading... |
21907 NativeType.prototype.get$name = function() { return this.name; }; | 21883 NativeType.prototype.get$name = function() { return this.name; }; |
21908 NativeType.prototype.set$name = function(value) { return this.name = value; }; | 21884 NativeType.prototype.set$name = function(value) { return this.name = value; }; |
21909 NativeType.prototype.get$isConstructorHidden = function() { return this.isConstr
uctorHidden; }; | 21885 NativeType.prototype.get$isConstructorHidden = function() { return this.isConstr
uctorHidden; }; |
21910 NativeType.prototype.set$isConstructorHidden = function(value) { return this.isC
onstructorHidden = value; }; | 21886 NativeType.prototype.set$isConstructorHidden = function(value) { return this.isC
onstructorHidden = value; }; |
21911 // ********** Code for FixedCollection ************** | 21887 // ********** Code for FixedCollection ************** |
21912 function FixedCollection(value, length) { | 21888 function FixedCollection(value, length) { |
21913 this.value = value; | 21889 this.value = value; |
21914 this.length = length; | 21890 this.length = length; |
21915 // Initializers done | 21891 // Initializers done |
21916 } | 21892 } |
21917 FixedCollection.prototype.is$Collection$E = function(){return this;}; | 21893 FixedCollection.prototype.is$Collection_E = function(){return this;}; |
21918 FixedCollection.prototype.is$Collection$Object = function(){return this;}; | 21894 FixedCollection.prototype.is$Collection_Object = function(){return this;}; |
21919 FixedCollection.prototype.is$Collection$Type = function(){return this;}; | 21895 FixedCollection.prototype.is$Collection_Type = function(){return this;}; |
21920 FixedCollection.prototype.is$Iterable = function(){return this;}; | 21896 FixedCollection.prototype.is$Iterable = function(){return this;}; |
21921 FixedCollection.prototype.get$value = function() { return this.value; }; | 21897 FixedCollection.prototype.get$value = function() { return this.value; }; |
21922 FixedCollection.prototype.iterator = function() { | 21898 FixedCollection.prototype.iterator = function() { |
21923 return new FixedIterator$E(this.value, this.length); | 21899 return new FixedIterator_E(this.value, this.length); |
21924 } | 21900 } |
21925 FixedCollection.prototype.forEach = function(f) { | 21901 FixedCollection.prototype.forEach = function(f) { |
21926 Collections.forEach(this, f); | 21902 Collections.forEach(this, f); |
21927 } | 21903 } |
21928 FixedCollection.prototype.filter = function(f) { | 21904 FixedCollection.prototype.filter = function(f) { |
21929 return Collections.filter(this, new ListFactory(), f); | 21905 return Collections.filter(this, new ListFactory(), f); |
21930 } | 21906 } |
21931 FixedCollection.prototype.every = function(f) { | 21907 FixedCollection.prototype.every = function(f) { |
21932 return Collections.every(this, f); | 21908 return Collections.every(this, f); |
21933 } | 21909 } |
(...skipping 10 matching lines...) Expand all Loading... |
21944 return this.filter(to$call$1($0)); | 21920 return this.filter(to$call$1($0)); |
21945 }; | 21921 }; |
21946 FixedCollection.prototype.forEach$1 = function($0) { | 21922 FixedCollection.prototype.forEach$1 = function($0) { |
21947 return this.forEach(to$call$1($0)); | 21923 return this.forEach(to$call$1($0)); |
21948 }; | 21924 }; |
21949 FixedCollection.prototype.isEmpty$0 = FixedCollection.prototype.isEmpty; | 21925 FixedCollection.prototype.isEmpty$0 = FixedCollection.prototype.isEmpty; |
21950 FixedCollection.prototype.iterator$0 = FixedCollection.prototype.iterator; | 21926 FixedCollection.prototype.iterator$0 = FixedCollection.prototype.iterator; |
21951 FixedCollection.prototype.some$1 = function($0) { | 21927 FixedCollection.prototype.some$1 = function($0) { |
21952 return this.some(to$call$1($0)); | 21928 return this.some(to$call$1($0)); |
21953 }; | 21929 }; |
21954 // ********** Code for FixedCollection$Type ************** | 21930 // ********** Code for FixedCollection_lang_Type ************** |
21955 function FixedCollection$Type(value, length) { | 21931 function FixedCollection_lang_Type(value, length) { |
21956 this.value = value; | 21932 this.value = value; |
21957 this.length = length; | 21933 this.length = length; |
21958 // Initializers done | 21934 // Initializers done |
21959 } | 21935 } |
21960 $inherits(FixedCollection$Type, FixedCollection); | 21936 $inherits(FixedCollection_lang_Type, FixedCollection); |
21961 FixedCollection$Type.prototype.is$Collection$E = function(){return this;}; | 21937 FixedCollection_lang_Type.prototype.is$Collection_E = function(){return this;}; |
21962 FixedCollection$Type.prototype.is$Collection$Object = function(){return this;}; | 21938 FixedCollection_lang_Type.prototype.is$Collection_Object = function(){return thi
s;}; |
21963 FixedCollection$Type.prototype.is$Collection$Type = function(){return this;}; | 21939 FixedCollection_lang_Type.prototype.is$Collection_Type = function(){return this;
}; |
21964 FixedCollection$Type.prototype.is$Iterable = function(){return this;}; | 21940 FixedCollection_lang_Type.prototype.is$Iterable = function(){return this;}; |
21965 // ********** Code for FixedIterator ************** | 21941 // ********** Code for FixedIterator ************** |
21966 function FixedIterator(value, length) { | 21942 function FixedIterator(value, length) { |
21967 this._index = 0 | 21943 this._index = 0 |
21968 this.value = value; | 21944 this.value = value; |
21969 this.length = length; | 21945 this.length = length; |
21970 // Initializers done | 21946 // Initializers done |
21971 } | 21947 } |
21972 FixedIterator.prototype.is$Iterator$T = function(){return this;}; | 21948 FixedIterator.prototype.is$Iterator_T = function(){return this;}; |
21973 FixedIterator.prototype.get$value = function() { return this.value; }; | 21949 FixedIterator.prototype.get$value = function() { return this.value; }; |
21974 FixedIterator.prototype.hasNext = function() { | 21950 FixedIterator.prototype.hasNext = function() { |
21975 return this._index < this.length; | 21951 return this._index < this.length; |
21976 } | 21952 } |
21977 FixedIterator.prototype.next = function() { | 21953 FixedIterator.prototype.next = function() { |
21978 this._index++; | 21954 this._index++; |
21979 return this.value; | 21955 return this.value; |
21980 } | 21956 } |
21981 FixedIterator.prototype.hasNext$0 = FixedIterator.prototype.hasNext; | 21957 FixedIterator.prototype.hasNext$0 = FixedIterator.prototype.hasNext; |
21982 FixedIterator.prototype.next$0 = FixedIterator.prototype.next; | 21958 FixedIterator.prototype.next$0 = FixedIterator.prototype.next; |
21983 // ********** Code for FixedIterator$E ************** | 21959 // ********** Code for FixedIterator_E ************** |
21984 function FixedIterator$E(value, length) { | 21960 function FixedIterator_E(value, length) { |
21985 this._index = 0 | 21961 this._index = 0 |
21986 this.value = value; | 21962 this.value = value; |
21987 this.length = length; | 21963 this.length = length; |
21988 // Initializers done | 21964 // Initializers done |
21989 } | 21965 } |
21990 $inherits(FixedIterator$E, FixedIterator); | 21966 $inherits(FixedIterator_E, FixedIterator); |
21991 FixedIterator$E.prototype.is$Iterator$T = function(){return this;}; | 21967 FixedIterator_E.prototype.is$Iterator_T = function(){return this;}; |
21992 // ********** Code for Value ************** | 21968 // ********** Code for Value ************** |
21993 function Value(type, code, span, needsTemp) { | 21969 function Value(type, code, span, needsTemp) { |
21994 this.isSuper = false | 21970 this.isSuper = false |
21995 this.isType = false | 21971 this.isType = false |
21996 this.isFinal = false | 21972 this.isFinal = false |
21997 this.type = type; | 21973 this.type = type; |
21998 this.code = code; | 21974 this.code = code; |
21999 this.span = span; | 21975 this.span = span; |
22000 this.needsTemp = needsTemp; | 21976 this.needsTemp = needsTemp; |
22001 // Initializers done | 21977 // Initializers done |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22305 } | 22281 } |
22306 Value.prototype.invokeNoSuchMethod = function(context, name, node, args) { | 22282 Value.prototype.invokeNoSuchMethod = function(context, name, node, args) { |
22307 var $0; | 22283 var $0; |
22308 var pos = ''; | 22284 var pos = ''; |
22309 if (args != null) { | 22285 if (args != null) { |
22310 var argsCode = []; | 22286 var argsCode = []; |
22311 for (var i = 0; | 22287 for (var i = 0; |
22312 i < args.get$length(); i++) { | 22288 i < args.get$length(); i++) { |
22313 argsCode.add$1(args.values.$index(i).get$code()); | 22289 argsCode.add$1(args.values.$index(i).get$code()); |
22314 } | 22290 } |
22315 pos = Strings.join((argsCode && argsCode.is$List$String()), ", "); | 22291 pos = Strings.join((argsCode && argsCode.is$List_String()), ", "); |
22316 } | 22292 } |
22317 var noSuchArgs = [new Value($globals.world.stringType, ('"' + name + '"'), nod
e.span, true), new Value($globals.world.listType, ('[' + pos + ']'), node.span,
true)]; | 22293 var noSuchArgs = [new Value($globals.world.stringType, ('"' + name + '"'), nod
e.span, true), new Value($globals.world.listType, ('[' + pos + ']'), node.span,
true)]; |
22318 return (($0 = this._resolveMember(context, 'noSuchMethod', node, false).invoke
$4(context, node, this, new Arguments(null, noSuchArgs))) && $0.is$Value()); | 22294 return (($0 = this._resolveMember(context, 'noSuchMethod', node, false).invoke
$4(context, node, this, new Arguments(null, noSuchArgs))) && $0.is$Value()); |
22319 } | 22295 } |
22320 Value.prototype.invokeSpecial = function(name, args, returnType) { | 22296 Value.prototype.invokeSpecial = function(name, args, returnType) { |
22321 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 497, 12
); | 22297 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 496, 12
); |
22322 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4
98, 12); | 22298 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4
97, 12); |
22323 var argsString = args.getCode(); | 22299 var argsString = args.getCode(); |
22324 if (name == '\$index' || name == '\$setindex') { | 22300 if (name == '\$index' || name == '\$setindex') { |
22325 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString
+ ')'), this.span, true); | 22301 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString
+ ')'), this.span, true); |
22326 } | 22302 } |
22327 else { | 22303 else { |
22328 if (argsString.length > 0) argsString = (', ' + argsString); | 22304 if (argsString.length > 0) argsString = (', ' + argsString); |
22329 $globals.world.gen.corejs.useOperator(name); | 22305 $globals.world.gen.corejs.useOperator(name); |
22330 return new Value(returnType, ('' + name + '(' + this.code + argsString + ')'
), this.span, true); | 22306 return new Value(returnType, ('' + name + '(' + this.code + argsString + ')'
), this.span, true); |
22331 } | 22307 } |
22332 } | 22308 } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22450 this.field = field; | 22426 this.field = field; |
22451 this.name = name; | 22427 this.name = name; |
22452 this.exp = exp; | 22428 this.exp = exp; |
22453 this.canonicalCode = canonicalCode; | 22429 this.canonicalCode = canonicalCode; |
22454 this.dependencies = []; | 22430 this.dependencies = []; |
22455 // Initializers done | 22431 // Initializers done |
22456 Value.call(this, type, code, span, !$notnull_bool(isConst)); | 22432 Value.call(this, type, code, span, !$notnull_bool(isConst)); |
22457 for (var $i = 0;$i < _dependencies.length; $i++) { | 22433 for (var $i = 0;$i < _dependencies.length; $i++) { |
22458 var dep = _dependencies.$index($i); | 22434 var dep = _dependencies.$index($i); |
22459 this.dependencies.add(dep); | 22435 this.dependencies.add(dep); |
22460 this.dependencies.addAll((($0 = dep.get$dependencies()) && $0.is$Collection$
E())); | 22436 this.dependencies.addAll((($0 = dep.get$dependencies()) && $0.is$Collection_
E())); |
22461 } | 22437 } |
22462 } | 22438 } |
22463 $inherits(GlobalValue, Value); | 22439 $inherits(GlobalValue, Value); |
22464 GlobalValue.prototype.is$GlobalValue = function(){return this;}; | 22440 GlobalValue.prototype.is$GlobalValue = function(){return this;}; |
22465 GlobalValue.prototype.is$Comparable = function(){return this;}; | 22441 GlobalValue.prototype.is$Comparable = function(){return this;}; |
22466 GlobalValue.GlobalValue$fromStatic$factory = function(field, exp, dependencies)
{ | 22442 GlobalValue.GlobalValue$fromStatic$factory = function(field, exp, dependencies)
{ |
22467 var $0; | 22443 var $0; |
22468 var code = ($notnull_bool(exp.get$isConst()) ? exp.get$canonicalCode() : exp.c
ode); | 22444 var code = ($notnull_bool(exp.get$isConst()) ? exp.get$canonicalCode() : exp.c
ode); |
22469 var codeWithComment = ('' + code + '/*' + field.get$declaringType().get$name()
+ '.' + field.get$name() + '*/'); | 22445 var codeWithComment = ('' + code + '/*' + field.get$declaringType().get$name()
+ '.' + field.get$name() + '*/'); |
22470 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) { | 22446 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) { |
22471 return (d instanceof GlobalValue); | 22447 return (d instanceof GlobalValue); |
22472 }) | 22448 }) |
22473 )) && $0.is$List$GlobalValue())); | 22449 )) && $0.is$List_GlobalValue())); |
22474 } | 22450 } |
22475 GlobalValue.GlobalValue$fromConst$factory = function(uniqueId, exp, dependencies
) { | 22451 GlobalValue.GlobalValue$fromConst$factory = function(uniqueId, exp, dependencies
) { |
22476 var $0; | 22452 var $0; |
22477 var name = ("const\$" + uniqueId); | 22453 var name = ("const\$" + uniqueId); |
22478 var codeWithComment = ("" + name + "/*" + exp.span.get$text() + "*/"); | 22454 var codeWithComment = ("" + name + "/*" + exp.span.get$text() + "*/"); |
22479 return new GlobalValue(exp.type, $assert_String(codeWithComment), true, null,
name, exp, name, exp.span, (($0 = dependencies.filter$1((function (d) { | 22455 return new GlobalValue(exp.type, $assert_String(codeWithComment), true, null,
name, exp, name, exp.span, (($0 = dependencies.filter$1((function (d) { |
22480 return (d instanceof GlobalValue); | 22456 return (d instanceof GlobalValue); |
22481 }) | 22457 }) |
22482 )) && $0.is$List$GlobalValue())); | 22458 )) && $0.is$List_GlobalValue())); |
22483 } | 22459 } |
22484 GlobalValue.prototype.get$field = function() { return this.field; }; | 22460 GlobalValue.prototype.get$field = function() { return this.field; }; |
22485 GlobalValue.prototype.set$field = function(value) { return this.field = value; }
; | 22461 GlobalValue.prototype.set$field = function(value) { return this.field = value; }
; |
22486 GlobalValue.prototype.get$name = function() { return this.name; }; | 22462 GlobalValue.prototype.get$name = function() { return this.name; }; |
22487 GlobalValue.prototype.set$name = function(value) { return this.name = value; }; | 22463 GlobalValue.prototype.set$name = function(value) { return this.name = value; }; |
22488 GlobalValue.prototype.get$exp = function() { return this.exp; }; | 22464 GlobalValue.prototype.get$exp = function() { return this.exp; }; |
22489 GlobalValue.prototype.set$exp = function(value) { return this.exp = value; }; | 22465 GlobalValue.prototype.set$exp = function(value) { return this.exp = value; }; |
22490 GlobalValue.prototype.get$canonicalCode = function() { return this.canonicalCode
; }; | 22466 GlobalValue.prototype.get$canonicalCode = function() { return this.canonicalCode
; }; |
22491 GlobalValue.prototype.set$canonicalCode = function(value) { return this.canonica
lCode = value; }; | 22467 GlobalValue.prototype.set$canonicalCode = function(value) { return this.canonica
lCode = value; }; |
22492 GlobalValue.prototype.get$isConst = function() { | 22468 GlobalValue.prototype.get$isConst = function() { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22540 BareValue.prototype._ensureCode = function() { | 22516 BareValue.prototype._ensureCode = function() { |
22541 if (this.code != null) return; | 22517 if (this.code != null) return; |
22542 if ($notnull_bool(this.isType)) { | 22518 if ($notnull_bool(this.isType)) { |
22543 this.code = this.type.get$jsname(); | 22519 this.code = this.type.get$jsname(); |
22544 } | 22520 } |
22545 else { | 22521 else { |
22546 this.code = this.home._makeThisCode(); | 22522 this.code = this.home._makeThisCode(); |
22547 } | 22523 } |
22548 } | 22524 } |
22549 BareValue.prototype._tryResolveMember = function(context, name) { | 22525 BareValue.prototype._tryResolveMember = function(context, name) { |
22550 $assert($eq(context, this.home), "context == home", "value.dart", 718, 12); | 22526 $assert($eq(context, this.home), "context == home", "value.dart", 717, 12); |
22551 var member = this.type.resolveMember(name); | 22527 var member = this.type.resolveMember(name); |
22552 if ($notnull_bool($ne(member, null))) { | 22528 if ($notnull_bool($ne(member, null))) { |
22553 this._ensureCode(); | 22529 this._ensureCode(); |
22554 return member; | 22530 return member; |
22555 } | 22531 } |
22556 member = this.home.get$library().lookup(name, this.span); | 22532 member = this.home.get$library().lookup(name, this.span); |
22557 if ($notnull_bool($ne(member, null))) { | 22533 if ($notnull_bool($ne(member, null))) { |
22558 return member; | 22534 return member; |
22559 } | 22535 } |
22560 this._ensureCode(); | 22536 this._ensureCode(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22632 var mset = this._members.$index(member.name); | 22608 var mset = this._members.$index(member.name); |
22633 if ($notnull_bool(mset == null)) { | 22609 if ($notnull_bool(mset == null)) { |
22634 mset = new MemberSet(member, true); | 22610 mset = new MemberSet(member, true); |
22635 this._members.$setindex(mset.get$name(), mset); | 22611 this._members.$setindex(mset.get$name(), mset); |
22636 } | 22612 } |
22637 else { | 22613 else { |
22638 mset.get$members().add$1(member); | 22614 mset.get$members().add$1(member); |
22639 } | 22615 } |
22640 } | 22616 } |
22641 World.prototype._addTopName = function(named) { | 22617 World.prototype._addTopName = function(named) { |
22642 var existing = this._topNames.$index(named.get$name()); | 22618 var existing = this._topNames.$index(named.get$jsname()); |
22643 if ($notnull_bool($ne(existing, null))) { | 22619 if ($notnull_bool($ne(existing, null))) { |
22644 this.info(('mangling matching top level name "' + named.get$name() + '" in '
) + ('both "' + named.get$library().name + '" and "' + existing.get$library().ge
t$name() + '"')); | 22620 this.info(('mangling matching top level name "' + named.get$jsname() + '" in
') + ('both "' + named.get$library().get$jsname() + '" and "' + existing.get$li
brary().get$jsname() + '"')); |
22645 if ($notnull_bool(named.get$isNative())) { | 22621 if ($notnull_bool(named.get$isNative())) { |
22646 if ($notnull_bool(existing.get$isNative())) { | 22622 if ($notnull_bool(existing.get$isNative())) { |
22647 $globals.world.internalError(('conflicting native names "' + named.get$n
ame() + '" ') + ('(already defined in ' + existing.get$span().get$locationText()
+ ')'), named.get$span()); | 22623 $globals.world.internalError(('conflicting native names "' + named.get$j
sname() + '" ') + ('(already defined in ' + existing.get$span().get$locationText
() + ')'), named.get$span()); |
22648 } | 22624 } |
22649 else { | 22625 else { |
22650 this._topNames.$setindex(named.get$name(), named); | 22626 this._topNames.$setindex(named.get$jsname(), named); |
22651 this._addJavascriptTopName((existing && existing.is$Named())); | 22627 this._addJavascriptTopName((existing && existing.is$lang_Element())); |
22652 } | 22628 } |
22653 } | 22629 } |
22654 else if ($notnull_bool(named.get$library().get$isCore())) { | 22630 else if ($notnull_bool(named.get$library().get$isCore())) { |
22655 if ($notnull_bool(existing.get$library().get$isCore())) { | 22631 if ($notnull_bool(existing.get$library().get$isCore())) { |
22656 $globals.world.internalError(('conflicting top-level names in core "' +
named.get$name() + '" ') + ('(previously defined in ' + existing.get$span().get$
locationText() + ')'), named.get$span()); | 22632 $globals.world.internalError(('conflicting top-level names in core "' +
named.get$jsname() + '" ') + ('(previously defined in ' + existing.get$span().ge
t$locationText() + ')'), named.get$span()); |
22657 } | 22633 } |
22658 else { | 22634 else { |
22659 this._topNames.$setindex(named.get$name(), named); | 22635 this._topNames.$setindex(named.get$jsname(), named); |
22660 this._addJavascriptTopName((existing && existing.is$Named())); | 22636 this._addJavascriptTopName((existing && existing.is$lang_Element())); |
22661 } | 22637 } |
22662 } | 22638 } |
22663 else { | 22639 else { |
22664 this._addJavascriptTopName(named); | 22640 this._addJavascriptTopName(named); |
22665 } | 22641 } |
22666 } | 22642 } |
22667 else { | 22643 else { |
22668 this._topNames.$setindex(named.get$name(), named); | 22644 this._topNames.$setindex(named.get$jsname(), named); |
22669 } | 22645 } |
22670 } | 22646 } |
22671 World.prototype._addJavascriptTopName = function(named) { | 22647 World.prototype._addJavascriptTopName = function(named) { |
22672 named.set$jsname(('' + named.get$library().get$jsname() + '_' + named.get$name
())); | 22648 named._jsname = ('' + named.get$library().get$jsname() + '_' + named.get$jsnam
e()); |
22673 var existing = this._topNames.$index(named.get$jsname()); | 22649 var existing = this._topNames.$index(named.get$jsname()); |
22674 if ($notnull_bool($ne(existing, null)) && $notnull_bool($ne(existing, named)))
{ | 22650 if ($notnull_bool($ne(existing, null)) && $notnull_bool($ne(existing, named)))
{ |
22675 $globals.world.internalError(('name mangling failed for "' + named.get$jsnam
e() + '" ') + ('("' + named.get$jsname() + '" defined also in ' + existing.get$s
pan().get$locationText() + ')'), named.get$span()); | 22651 $globals.world.internalError(('name mangling failed for "' + named.get$jsnam
e() + '" ') + ('("' + named.get$jsname() + '" defined also in ' + existing.get$s
pan().get$locationText() + ')'), named.get$span()); |
22676 } | 22652 } |
22677 this._topNames.$setindex(named.get$jsname(), named); | 22653 this._topNames.$setindex(named.get$jsname(), named); |
22678 } | 22654 } |
22679 World.prototype._addType = function(type) { | 22655 World.prototype._addType = function(type) { |
22680 if (!$notnull_bool(type.get$isTop())) this._addTopName(type); | 22656 if (!$notnull_bool(type.get$isTop())) this._addTopName(type); |
22681 } | 22657 } |
22682 World.prototype._addToCoreLib = function(name, isClass) { | 22658 World.prototype._addToCoreLib = function(name, isClass) { |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22985 | 22961 |
22986 case '--compile-only': | 22962 case '--compile-only': |
22987 | 22963 |
22988 this.compileOnly = true; | 22964 this.compileOnly = true; |
22989 continue loop; | 22965 continue loop; |
22990 | 22966 |
22991 default: | 22967 default: |
22992 | 22968 |
22993 if ($notnull_bool(arg.endsWith$1('.dart'))) { | 22969 if ($notnull_bool(arg.endsWith$1('.dart'))) { |
22994 this.dartScript = $assert_String(arg); | 22970 this.dartScript = $assert_String(arg); |
22995 this.childArgs = (($0 = args.getRange(i + 1, args.length - i - 1)) &&
$0.is$List$String()); | 22971 this.childArgs = (($0 = args.getRange(i + 1, args.length - i - 1)) &&
$0.is$List_String()); |
22996 break loop; | 22972 break loop; |
22997 } | 22973 } |
22998 else if ($notnull_bool(arg.startsWith$1('--out='))) { | 22974 else if ($notnull_bool(arg.startsWith$1('--out='))) { |
22999 this.outfile = $assert_String(arg.substring$1('--out='.length)); | 22975 this.outfile = $assert_String(arg.substring$1('--out='.length)); |
23000 } | 22976 } |
23001 else if ($notnull_bool(arg.startsWith$1('--libdir='))) { | 22977 else if ($notnull_bool(arg.startsWith$1('--libdir='))) { |
23002 this.libDir = $assert_String(arg.substring$1('--libdir='.length)); | 22978 this.libDir = $assert_String(arg.substring$1('--libdir='.length)); |
23003 passedLibDir = true; | 22979 passedLibDir = true; |
23004 } | 22980 } |
23005 else { | 22981 else { |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
23345 i < args.get$length(); i++) { | 23321 i < args.get$length(); i++) { |
23346 nameBuilder.add('\$').add(args.getName(i)); | 23322 nameBuilder.add('\$').add(args.getName(i)); |
23347 } | 23323 } |
23348 return nameBuilder.toString(); | 23324 return nameBuilder.toString(); |
23349 } | 23325 } |
23350 // ********** Library frog ************** | 23326 // ********** Library frog ************** |
23351 // ********** Code for top level ************** | 23327 // ********** Code for top level ************** |
23352 function main() { | 23328 function main() { |
23353 var homedir = path.dirname(fs.realpathSync($assert_String(process.argv.$index(
1)))); | 23329 var homedir = path.dirname(fs.realpathSync($assert_String(process.argv.$index(
1)))); |
23354 var argv = ListFactory.ListFactory$from$factory(process.argv); | 23330 var argv = ListFactory.ListFactory$from$factory(process.argv); |
23355 if ($notnull_bool(lang_compile($assert_String(homedir), (argv && argv.is$List$
String()), new NodeFileSystem()))) { | 23331 if ($notnull_bool(lang_compile($assert_String(homedir), (argv && argv.is$List_
String()), new NodeFileSystem()))) { |
23356 var code = $globals.world.getGeneratedCode(); | 23332 var code = $globals.world.getGeneratedCode(); |
23357 if (!$notnull_bool($globals.options.compileOnly)) { | 23333 if (!$notnull_bool($globals.options.compileOnly)) { |
23358 process.argv = [argv.$index(0), argv.$index(1)]; | 23334 process.argv = [argv.$index(0), argv.$index(1)]; |
23359 process.argv.addAll($globals.options.childArgs); | 23335 process.argv.addAll($globals.options.childArgs); |
23360 vm.runInNewContext($assert_String(code), createSandbox()); | 23336 vm.runInNewContext($assert_String(code), createSandbox()); |
23361 } | 23337 } |
23362 } | 23338 } |
23363 else { | 23339 else { |
23364 process.exit(1); | 23340 process.exit(1); |
23365 } | 23341 } |
23366 } | 23342 } |
23367 // ********** Generic Type Inheritance ************** | 23343 // ********** Generic Type Inheritance ************** |
23368 /** Implements extends for generic types. */ | 23344 /** Implements extends for generic types. */ |
23369 function $inheritsMembers(child, parent) { | 23345 function $inheritsMembers(child, parent) { |
23370 child = child.prototype; | 23346 child = child.prototype; |
23371 parent = parent.prototype; | 23347 parent = parent.prototype; |
23372 Object.getOwnPropertyNames(parent).forEach(function(name) { | 23348 Object.getOwnPropertyNames(parent).forEach(function(name) { |
23373 if (typeof(child[name]) == 'undefined') child[name] = parent[name]; | 23349 if (typeof(child[name]) == 'undefined') child[name] = parent[name]; |
23374 }); | 23350 }); |
23375 } | 23351 } |
23376 $inheritsMembers(_DoubleLinkedQueueEntrySentinel$E, DoubleLinkedQueueEntry$E); | 23352 $inheritsMembers(_DoubleLinkedQueueEntrySentinel_E, DoubleLinkedQueueEntry_E); |
23377 $inheritsMembers(_DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V, DoubleLinkedQ
ueueEntry$KeyValuePair$K$V); | 23353 $inheritsMembers(_DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V, DoubleLinkedQ
ueueEntry_KeyValuePair_K$V); |
23378 $inheritsMembers(LinkTail$Dynamic, AbstractLink$Dynamic); | 23354 $inheritsMembers(LinkTail_T, AbstractLink_T); |
23379 $inheritsMembers(LinkEntry$Dynamic, AbstractLink$Dynamic); | 23355 $inheritsMembers(LinkEntry_T, AbstractLink_T); |
23380 $inheritsMembers(LinkEntry$T, AbstractLink$T); | 23356 $inheritsMembers(ArrayBasedScanner_SourceString, AbstractScanner_SourceString); |
23381 $inheritsMembers(ArrayBasedScanner$SourceString, AbstractScanner$SourceString); | |
23382 // ********** Globals ************** | 23357 // ********** Globals ************** |
23383 function $static_init(){ | 23358 function $static_init(){ |
23384 $globals.HTracer__singleton = null; | 23359 $globals.HTracer__singleton = null; |
23385 } | 23360 } |
23386 var const$0 = new NoMoreElementsException()/*const NoMoreElementsException()*/; | 23361 var const$0 = new NoMoreElementsException()/*const NoMoreElementsException()*/; |
23387 var const$1 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/; | 23362 var const$1 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/; |
23388 var const$10 = new StringWrapper('Dynamic')/*const SourceString('Dynamic')*/; | 23363 var const$10 = new StringWrapper('Dynamic')/*const SourceString('Dynamic')*/; |
23389 var const$101 = new Keyword("negate", true)/*const Keyword("negate", true)*/; | 23364 var const$101 = new Keyword("negate", true)/*const Keyword("negate", true)*/; |
23390 var const$103 = new Keyword("operator", true)/*const Keyword("operator", true)*/
; | 23365 var const$103 = new Keyword("operator", true)/*const Keyword("operator", true)*/
; |
23391 var const$105 = new Keyword("set", true)/*const Keyword("set", true)*/; | 23366 var const$105 = new Keyword("set", true)/*const Keyword("set", true)*/; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
23442 var const$25 = new Keyword("break", false)/*const Keyword("break")*/; | 23417 var const$25 = new Keyword("break", false)/*const Keyword("break")*/; |
23443 var const$250 = new StringWrapper('le')/*const SourceString('le')*/; | 23418 var const$250 = new StringWrapper('le')/*const SourceString('le')*/; |
23444 var const$251 = new StringWrapper('>')/*const SourceString('>')*/; | 23419 var const$251 = new StringWrapper('>')/*const SourceString('>')*/; |
23445 var const$252 = new StringWrapper('gt')/*const SourceString('gt')*/; | 23420 var const$252 = new StringWrapper('gt')/*const SourceString('gt')*/; |
23446 var const$253 = new StringWrapper('>=')/*const SourceString('>=')*/; | 23421 var const$253 = new StringWrapper('>=')/*const SourceString('>=')*/; |
23447 var const$254 = new StringWrapper('ge')/*const SourceString('ge')*/; | 23422 var const$254 = new StringWrapper('ge')/*const SourceString('ge')*/; |
23448 var const$255 = new StringWrapper('&&')/*const SourceString('&&')*/; | 23423 var const$255 = new StringWrapper('&&')/*const SourceString('&&')*/; |
23449 var const$256 = new StringWrapper('||')/*const SourceString('||')*/; | 23424 var const$256 = new StringWrapper('||')/*const SourceString('||')*/; |
23450 var const$257 = new StringWrapper('!')/*const SourceString('!')*/; | 23425 var const$257 = new StringWrapper('!')/*const SourceString('!')*/; |
23451 var const$258 = new ElementKind('variable')/*const ElementKind('variable')*/; | 23426 var const$258 = new ElementKind('variable')/*const ElementKind('variable')*/; |
23452 var const$264 = new MessageKind('cannot return value from void function')/*const
MessageKind( | 23427 var const$260 = new MessageKind('cannot return value from void function')/*const
MessageKind( |
23453 'cannot return value from void function')*/; | 23428 'cannot return value from void function')*/; |
23454 var const$266 = new MessageKind('#{1} is not assignable to #{2}')/*const Message
Kind( | 23429 var const$262 = new MessageKind('#{1} is not assignable to #{2}')/*const Message
Kind( |
23455 '#{1} is not assignable to #{2}')*/; | 23430 '#{1} is not assignable to #{2}')*/; |
23456 var const$268 = new MessageKind('value of type #{1} expected')/*const MessageKin
d( | 23431 var const$264 = new MessageKind('value of type #{1} expected')/*const MessageKin
d( |
23457 'value of type #{1} expected')*/; | 23432 'value of type #{1} expected')*/; |
| 23433 var const$266 = new StringWrapper('=')/*const SourceString('=')*/; |
| 23434 var const$267 = new MessageKind('variable cannot be of type void')/*const Messag
eKind( |
| 23435 'variable cannot be of type void')*/; |
| 23436 var const$269 = new MessageKind('expression does not yield a value')/*const Mess
ageKind( |
| 23437 'expression does not yield a value')*/; |
23458 var const$27 = new Keyword("case", false)/*const Keyword("case")*/; | 23438 var const$27 = new Keyword("case", false)/*const Keyword("case")*/; |
23459 var const$270 = new StringWrapper('=')/*const SourceString('=')*/; | 23439 var const$271 = new ExceptionImplementation("Internal Error (Leg): UNREACHABLE")
/*const Exception("Internal Error (Leg): UNREACHABLE")*/; |
23460 var const$271 = new MessageKind('variable cannot be of type void')/*const Messag
eKind( | 23440 var const$276 = new StringWrapper("&&")/*const SourceString("&&")*/; |
23461 'variable cannot be of type void')*/; | 23441 var const$277 = new StringWrapper("||")/*const SourceString("||")*/; |
23462 var const$273 = new MessageKind('expression does not yield a value')/*const Mess
ageKind( | 23442 var const$278 = new StringWrapper("!")/*const SourceString("!")*/; |
23463 'expression does not yield a value')*/; | 23443 var const$279 = new StringWrapper("+")/*const SourceString("+")*/; |
23464 var const$275 = new ExceptionImplementation("Internal Error (Leg): UNREACHABLE")
/*const Exception("Internal Error (Leg): UNREACHABLE")*/; | 23444 var const$280 = new StringWrapper("-")/*const SourceString("-")*/; |
23465 var const$280 = new StringWrapper("&&")/*const SourceString("&&")*/; | 23445 var const$281 = new StringWrapper("*")/*const SourceString("*")*/; |
23466 var const$281 = new StringWrapper("||")/*const SourceString("||")*/; | 23446 var const$282 = new StringWrapper("/")/*const SourceString("/")*/; |
23467 var const$282 = new StringWrapper("!")/*const SourceString("!")*/; | 23447 var const$283 = new StringWrapper("~/")/*const SourceString("~/")*/; |
23468 var const$283 = new StringWrapper("+")/*const SourceString("+")*/; | 23448 var const$284 = new StringWrapper("%")/*const SourceString("%")*/; |
23469 var const$284 = new StringWrapper("-")/*const SourceString("-")*/; | 23449 var const$285 = new StringWrapper("==")/*const SourceString("==")*/; |
23470 var const$285 = new StringWrapper("*")/*const SourceString("*")*/; | 23450 var const$286 = new StringWrapper("<")/*const SourceString("<")*/; |
23471 var const$286 = new StringWrapper("/")/*const SourceString("/")*/; | 23451 var const$287 = new StringWrapper("<=")/*const SourceString("<=")*/; |
23472 var const$287 = new StringWrapper("~/")/*const SourceString("~/")*/; | 23452 var const$288 = new StringWrapper(">")/*const SourceString(">")*/; |
23473 var const$288 = new StringWrapper("%")/*const SourceString("%")*/; | 23453 var const$289 = new StringWrapper(">=")/*const SourceString(">=")*/; |
23474 var const$289 = new StringWrapper("==")/*const SourceString("==")*/; | |
23475 var const$29 = new Keyword("catch", false)/*const Keyword("catch")*/; | 23454 var const$29 = new Keyword("catch", false)/*const Keyword("catch")*/; |
23476 var const$290 = new StringWrapper("<")/*const SourceString("<")*/; | 23455 var const$300 = ImmutableList.ImmutableList$from$factory(["__PROTO__", "prototyp
e"])/*const <String>["__PROTO__", "prototype"]*/; |
23477 var const$291 = new StringWrapper("<=")/*const SourceString("<=")*/; | 23456 var const$302 = 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>[ |
23478 var const$292 = new StringWrapper(">")/*const SourceString(">")*/; | |
23479 var const$293 = new StringWrapper(">=")/*const SourceString(">=")*/; | |
23480 var const$304 = ImmutableList.ImmutableList$from$factory(["__PROTO__", "prototyp
e"])/*const <String>["__PROTO__", "prototype"]*/; | |
23481 var const$306 = 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>[ | |
23482 // Section references are from Ecma-262 | 23457 // Section references are from Ecma-262 |
23483 // (http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pd
f) | 23458 // (http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pd
f) |
23484 | 23459 |
23485 // 15.1.1 Value Properties of the Global Object | 23460 // 15.1.1 Value Properties of the Global Object |
23486 "NaN", "Infinity", "undefined", | 23461 "NaN", "Infinity", "undefined", |
23487 | 23462 |
23488 // 15.1.2 Function Properties of the Global Object | 23463 // 15.1.2 Function Properties of the Global Object |
23489 "eval", "parseInt", "parseFloat", "isNan", "isFinite", | 23464 "eval", "parseInt", "parseFloat", "isNan", "isFinite", |
23490 | 23465 |
23491 // 15.1.3 URI Handling Function Properties | 23466 // 15.1.3 URI Handling Function Properties |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
23602 // GWT-defined identifiers | 23577 // GWT-defined identifiers |
23603 "\$wnd", "\$doc", "\$entry", "\$moduleName", "\$moduleBase", | 23578 "\$wnd", "\$doc", "\$entry", "\$moduleName", "\$moduleBase", |
23604 "\$gwt_version", "\$sessionId", | 23579 "\$gwt_version", "\$sessionId", |
23605 | 23580 |
23606 // Identifiers used by JsStackEmulator; later set to obfuscatable | 23581 // Identifiers used by JsStackEmulator; later set to obfuscatable |
23607 "\$stack", "\$stackDepth", "\$location", | 23582 "\$stack", "\$stackDepth", "\$location", |
23608 | 23583 |
23609 // TODO: prove why this is necessary or remove it | 23584 // TODO: prove why this is necessary or remove it |
23610 "call" | 23585 "call" |
23611 ]*/; | 23586 ]*/; |
23612 var const$308 = 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
>[ | 23587 var const$304 = 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
>[ |
23613 // These are current keywords | 23588 // These are current keywords |
23614 "break", "delete", "function", "return", "typeof", "case", "do", "if", | 23589 "break", "delete", "function", "return", "typeof", "case", "do", "if", |
23615 "switch", "var", "catch", "else", "in", "this", "void", "continue", | 23590 "switch", "var", "catch", "else", "in", "this", "void", "continue", |
23616 "false", "instanceof", "throw", "while", "debugger", "finally", "new", | 23591 "false", "instanceof", "throw", "while", "debugger", "finally", "new", |
23617 "true", "with", "default", "for", "null", "try", | 23592 "true", "with", "default", "for", "null", "try", |
23618 | 23593 |
23619 // These are future keywords | 23594 // These are future keywords |
23620 "abstract", "double", "goto", "native", "static", "boolean", "enum", | 23595 "abstract", "double", "goto", "native", "static", "boolean", "enum", |
23621 "implements", "package", "super", "byte", "export", "import", "private", | 23596 "implements", "package", "super", "byte", "export", "import", "private", |
23622 "synchronized", "char", "extends", "int", "protected", "throws", | 23597 "synchronized", "char", "extends", "int", "protected", "throws", |
23623 "class", "final", "interface", "public", "transient", "const", "float", | 23598 "class", "final", "interface", "public", "transient", "const", "float", |
23624 "long", "short", "volatile" | 23599 "long", "short", "volatile" |
23625 ]*/; | 23600 ]*/; |
| 23601 var const$306 = new StringWrapper('guard\$num')/*const SourceString('guard\$num'
)*/; |
23626 var const$31 = new Keyword("const", false)/*const Keyword("const")*/; | 23602 var const$31 = new Keyword("const", false)/*const Keyword("const")*/; |
23627 var const$310 = new StringWrapper('guard\$num')/*const SourceString('guard\$num'
)*/; | |
23628 var const$33 = new Keyword("continue", false)/*const Keyword("continue")*/; | 23603 var const$33 = new Keyword("continue", false)/*const Keyword("continue")*/; |
23629 var const$35 = new Keyword("default", false)/*const Keyword("default")*/; | 23604 var const$35 = new Keyword("default", false)/*const Keyword("default")*/; |
23630 var const$37 = new Keyword("do", false)/*const Keyword("do")*/; | 23605 var const$37 = new Keyword("do", false)/*const Keyword("do")*/; |
23631 var const$39 = new Keyword("else", false)/*const Keyword("else")*/; | 23606 var const$39 = new Keyword("else", false)/*const Keyword("else")*/; |
23632 var const$4 = new StringWrapper('global scope')/*const SourceString('global scop
e')*/; | 23607 var const$4 = new StringWrapper('global scope')/*const SourceString('global scop
e')*/; |
23633 var const$41 = new Keyword("false", false)/*const Keyword("false")*/; | 23608 var const$41 = new Keyword("false", false)/*const Keyword("false")*/; |
23634 var const$423 = ImmutableList.ImmutableList$from$factory(['NullPointerException'
, 'ObjectNotClosureException', 'NoSuchMethodException', 'StackOverflowException'
])/*const [ | 23609 var const$423 = ImmutableList.ImmutableList$from$factory(['NullPointerException'
, 'ObjectNotClosureException', 'NoSuchMethodException', 'StackOverflowException'
])/*const [ |
23635 'NullPointerException', 'ObjectNotClosureException', | 23610 'NullPointerException', 'ObjectNotClosureException', |
23636 'NoSuchMethodException', 'StackOverflowException']*/; | 23611 'NoSuchMethodException', 'StackOverflowException']*/; |
23637 var const$43 = new Keyword("final", false)/*const Keyword("final")*/; | 23612 var const$43 = new Keyword("final", false)/*const Keyword("final")*/; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
23707 NATIVE, | 23682 NATIVE, |
23708 NEGATE, | 23683 NEGATE, |
23709 OPERATOR, | 23684 OPERATOR, |
23710 SET, | 23685 SET, |
23711 SOURCE, | 23686 SOURCE, |
23712 STATIC, | 23687 STATIC, |
23713 TYPEDEF ]*/; | 23688 TYPEDEF ]*/; |
23714 var $globals = {}; | 23689 var $globals = {}; |
23715 $static_init(); | 23690 $static_init(); |
23716 main(); | 23691 main(); |
OLD | NEW |