| 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) { return this($0, $1, true, capture); } | 7 * function($0, $1, capture) { return 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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 } | 807 } |
| 808 } | 808 } |
| 809 NumImplementation.prototype.compareTo$1 = NumImplementation.prototype.compareTo; | 809 NumImplementation.prototype.compareTo$1 = NumImplementation.prototype.compareTo; |
| 810 NumImplementation.prototype.hashCode$0 = NumImplementation.prototype.hashCode; | 810 NumImplementation.prototype.hashCode$0 = NumImplementation.prototype.hashCode; |
| 811 // ********** Code for HashMapImplementation ************** | 811 // ********** Code for HashMapImplementation ************** |
| 812 function HashMapImplementation() { | 812 function HashMapImplementation() { |
| 813 // Initializers done | 813 // Initializers done |
| 814 this._numberOfEntries = 0; | 814 this._numberOfEntries = 0; |
| 815 this._numberOfDeleted = 0; | 815 this._numberOfDeleted = 0; |
| 816 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); | 816 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); |
| 817 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); | 817 this._keys = new Array(8/*HashMapImplementation._INITIAL_CAPACITY*/); |
| 818 this._values = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); | 818 this._values = new Array(8/*HashMapImplementation._INITIAL_CAPACITY*/); |
| 819 } | 819 } |
| 820 HashMapImplementation.HashMapImplementation$from$factory = function(other) { | 820 HashMapImplementation.HashMapImplementation$from$factory = function(other) { |
| 821 var result = new HashMapImplementation(); | 821 var result = new HashMapImplementation(); |
| 822 other.forEach((function (key, value) { | 822 other.forEach((function (key, value) { |
| 823 result.$setindex(key, value); | 823 result.$setindex(key, value); |
| 824 }) | 824 }) |
| 825 ); | 825 ); |
| 826 return result; | 826 return result; |
| 827 } | 827 } |
| 828 HashMapImplementation._computeLoadLimit = function(capacity) { | 828 HashMapImplementation._computeLoadLimit = function(capacity) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 } | 879 } |
| 880 } | 880 } |
| 881 HashMapImplementation._isPowerOfTwo = function(x) { | 881 HashMapImplementation._isPowerOfTwo = function(x) { |
| 882 return ((x & (x - 1)) == 0); | 882 return ((x & (x - 1)) == 0); |
| 883 } | 883 } |
| 884 HashMapImplementation.prototype._grow = function(newCapacity) { | 884 HashMapImplementation.prototype._grow = function(newCapacity) { |
| 885 var capacity = this._keys.get$length(); | 885 var capacity = this._keys.get$length(); |
| 886 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 886 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 887 var oldKeys = this._keys; | 887 var oldKeys = this._keys; |
| 888 var oldValues = this._values; | 888 var oldValues = this._values; |
| 889 this._keys = new ListFactory(newCapacity); | 889 this._keys = new Array(newCapacity); |
| 890 this._values = new ListFactory(newCapacity); | 890 this._values = new Array(newCapacity); |
| 891 for (var i = 0; | 891 for (var i = 0; |
| 892 i < capacity; i++) { | 892 i < capacity; i++) { |
| 893 var key = oldKeys.$index(i); | 893 var key = oldKeys.$index(i); |
| 894 if (key == null || key === const$3/*HashMapImplementation._DELETED_KEY*/) { | 894 if (key == null || key === const$3/*HashMapImplementation._DELETED_KEY*/) { |
| 895 continue; | 895 continue; |
| 896 } | 896 } |
| 897 var value = oldValues.$index(i); | 897 var value = oldValues.$index(i); |
| 898 var newIndex = this._probeForAdding(key); | 898 var newIndex = this._probeForAdding(key); |
| 899 this._keys.$setindex(newIndex, key); | 899 this._keys.$setindex(newIndex, key); |
| 900 this._values.$setindex(newIndex, value); | 900 this._values.$setindex(newIndex, value); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 HashMapImplementation.prototype.forEach = function(f) { | 936 HashMapImplementation.prototype.forEach = function(f) { |
| 937 var length = this._keys.get$length(); | 937 var length = this._keys.get$length(); |
| 938 for (var i = 0; | 938 for (var i = 0; |
| 939 i < length; i++) { | 939 i < length; i++) { |
| 940 if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== const$3/*Has
hMapImplementation._DELETED_KEY*/)) { | 940 if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== const$3/*Has
hMapImplementation._DELETED_KEY*/)) { |
| 941 f(this._keys.$index(i), this._values.$index(i)); | 941 f(this._keys.$index(i), this._values.$index(i)); |
| 942 } | 942 } |
| 943 } | 943 } |
| 944 } | 944 } |
| 945 HashMapImplementation.prototype.getKeys = function() { | 945 HashMapImplementation.prototype.getKeys = function() { |
| 946 var list = new ListFactory(this.get$length()); | 946 var list = new Array(this.get$length()); |
| 947 var i = 0; | 947 var i = 0; |
| 948 this.forEach(function _(key, value) { | 948 this.forEach(function _(key, value) { |
| 949 list.$setindex(i++, key); | 949 list.$setindex(i++, key); |
| 950 } | 950 } |
| 951 ); | 951 ); |
| 952 return list; | 952 return list; |
| 953 } | 953 } |
| 954 HashMapImplementation.prototype.getValues = function() { | 954 HashMapImplementation.prototype.getValues = function() { |
| 955 var list = new ListFactory(this.get$length()); | 955 var list = new Array(this.get$length()); |
| 956 var i = 0; | 956 var i = 0; |
| 957 this.forEach(function _(key, value) { | 957 this.forEach(function _(key, value) { |
| 958 list.$setindex(i++, value); | 958 list.$setindex(i++, value); |
| 959 } | 959 } |
| 960 ); | 960 ); |
| 961 return list; | 961 return list; |
| 962 } | 962 } |
| 963 HashMapImplementation.prototype.containsKey = function(key) { | 963 HashMapImplementation.prototype.containsKey = function(key) { |
| 964 return (this._probeForLookup(key) != -1); | 964 return (this._probeForLookup(key) != -1); |
| 965 } | 965 } |
| 966 HashMapImplementation.prototype.containsKey$1 = HashMapImplementation.prototype.
containsKey; | 966 HashMapImplementation.prototype.containsKey$1 = HashMapImplementation.prototype.
containsKey; |
| 967 HashMapImplementation.prototype.forEach$1 = function($0) { | 967 HashMapImplementation.prototype.forEach$1 = function($0) { |
| 968 return this.forEach(to$call$2($0)); | 968 return this.forEach(to$call$2($0)); |
| 969 }; | 969 }; |
| 970 HashMapImplementation.prototype.getKeys$0 = HashMapImplementation.prototype.getK
eys; | 970 HashMapImplementation.prototype.getKeys$0 = HashMapImplementation.prototype.getK
eys; |
| 971 HashMapImplementation.prototype.getValues$0 = HashMapImplementation.prototype.ge
tValues; | 971 HashMapImplementation.prototype.getValues$0 = HashMapImplementation.prototype.ge
tValues; |
| 972 HashMapImplementation.prototype.isEmpty$0 = HashMapImplementation.prototype.isEm
pty; | 972 HashMapImplementation.prototype.isEmpty$0 = HashMapImplementation.prototype.isEm
pty; |
| 973 // ********** Code for HashMapImplementation_E$E ************** | 973 // ********** Code for HashMapImplementation_E$E ************** |
| 974 $inherits(HashMapImplementation_E$E, HashMapImplementation); | 974 $inherits(HashMapImplementation_E$E, HashMapImplementation); |
| 975 function HashMapImplementation_E$E() { | 975 function HashMapImplementation_E$E() { |
| 976 // Initializers done | 976 // Initializers done |
| 977 this._numberOfEntries = 0; | 977 this._numberOfEntries = 0; |
| 978 this._numberOfDeleted = 0; | 978 this._numberOfDeleted = 0; |
| 979 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); | 979 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); |
| 980 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); | 980 this._keys = new Array(8/*HashMapImplementation._INITIAL_CAPACITY*/); |
| 981 this._values = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); | 981 this._values = new Array(8/*HashMapImplementation._INITIAL_CAPACITY*/); |
| 982 } | 982 } |
| 983 HashMapImplementation_E$E._computeLoadLimit = function(capacity) { | 983 HashMapImplementation_E$E._computeLoadLimit = function(capacity) { |
| 984 return $truncdiv((capacity * 3), 4); | 984 return $truncdiv((capacity * 3), 4); |
| 985 } | 985 } |
| 986 HashMapImplementation_E$E._firstProbe = function(hashCode, length) { | 986 HashMapImplementation_E$E._firstProbe = function(hashCode, length) { |
| 987 return hashCode & (length - 1); | 987 return hashCode & (length - 1); |
| 988 } | 988 } |
| 989 HashMapImplementation_E$E._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { | 989 HashMapImplementation_E$E._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { |
| 990 return (currentProbe + numberOfProbes) & (length - 1); | 990 return (currentProbe + numberOfProbes) & (length - 1); |
| 991 } | 991 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 } | 1034 } |
| 1035 } | 1035 } |
| 1036 HashMapImplementation_E$E._isPowerOfTwo = function(x) { | 1036 HashMapImplementation_E$E._isPowerOfTwo = function(x) { |
| 1037 return ((x & (x - 1)) == 0); | 1037 return ((x & (x - 1)) == 0); |
| 1038 } | 1038 } |
| 1039 HashMapImplementation_E$E.prototype._grow = function(newCapacity) { | 1039 HashMapImplementation_E$E.prototype._grow = function(newCapacity) { |
| 1040 var capacity = this._keys.get$length(); | 1040 var capacity = this._keys.get$length(); |
| 1041 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 1041 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 1042 var oldKeys = this._keys; | 1042 var oldKeys = this._keys; |
| 1043 var oldValues = this._values; | 1043 var oldValues = this._values; |
| 1044 this._keys = new ListFactory(newCapacity); | 1044 this._keys = new Array(newCapacity); |
| 1045 this._values = new ListFactory(newCapacity); | 1045 this._values = new Array(newCapacity); |
| 1046 for (var i = 0; | 1046 for (var i = 0; |
| 1047 i < capacity; i++) { | 1047 i < capacity; i++) { |
| 1048 var key = oldKeys.$index(i); | 1048 var key = oldKeys.$index(i); |
| 1049 if (key == null || key === const$3/*HashMapImplementation._DELETED_KEY*/) { | 1049 if (key == null || key === const$3/*HashMapImplementation._DELETED_KEY*/) { |
| 1050 continue; | 1050 continue; |
| 1051 } | 1051 } |
| 1052 var value = oldValues.$index(i); | 1052 var value = oldValues.$index(i); |
| 1053 var newIndex = this._probeForAdding(key); | 1053 var newIndex = this._probeForAdding(key); |
| 1054 this._keys.$setindex(newIndex, key); | 1054 this._keys.$setindex(newIndex, key); |
| 1055 this._values.$setindex(newIndex, value); | 1055 this._values.$setindex(newIndex, value); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1083 HashMapImplementation_E$E.prototype.forEach = function(f) { | 1083 HashMapImplementation_E$E.prototype.forEach = function(f) { |
| 1084 var length = this._keys.get$length(); | 1084 var length = this._keys.get$length(); |
| 1085 for (var i = 0; | 1085 for (var i = 0; |
| 1086 i < length; i++) { | 1086 i < length; i++) { |
| 1087 if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== const$3/*Has
hMapImplementation._DELETED_KEY*/)) { | 1087 if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== const$3/*Has
hMapImplementation._DELETED_KEY*/)) { |
| 1088 f(this._keys.$index(i), this._values.$index(i)); | 1088 f(this._keys.$index(i), this._values.$index(i)); |
| 1089 } | 1089 } |
| 1090 } | 1090 } |
| 1091 } | 1091 } |
| 1092 HashMapImplementation_E$E.prototype.getKeys = function() { | 1092 HashMapImplementation_E$E.prototype.getKeys = function() { |
| 1093 var list = new ListFactory(this.get$length()); | 1093 var list = new Array(this.get$length()); |
| 1094 var i = 0; | 1094 var i = 0; |
| 1095 this.forEach(function _(key, value) { | 1095 this.forEach(function _(key, value) { |
| 1096 list.$setindex(i++, key); | 1096 list.$setindex(i++, key); |
| 1097 } | 1097 } |
| 1098 ); | 1098 ); |
| 1099 return list; | 1099 return list; |
| 1100 } | 1100 } |
| 1101 HashMapImplementation_E$E.prototype.containsKey = function(key) { | 1101 HashMapImplementation_E$E.prototype.containsKey = function(key) { |
| 1102 return (this._probeForLookup(key) != -1); | 1102 return (this._probeForLookup(key) != -1); |
| 1103 } | 1103 } |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1283 this._list.addLast(new KeyValuePair_K$V(key, value)); | 1283 this._list.addLast(new KeyValuePair_K$V(key, value)); |
| 1284 this._map.$setindex(key, this._list.lastEntry()); | 1284 this._map.$setindex(key, this._list.lastEntry()); |
| 1285 } | 1285 } |
| 1286 } | 1286 } |
| 1287 LinkedHashMapImplementation.prototype.$index = function(key) { | 1287 LinkedHashMapImplementation.prototype.$index = function(key) { |
| 1288 var entry = this._map.$index(key); | 1288 var entry = this._map.$index(key); |
| 1289 if (entry == null) return null; | 1289 if (entry == null) return null; |
| 1290 return entry.get$element().get$value(); | 1290 return entry.get$element().get$value(); |
| 1291 } | 1291 } |
| 1292 LinkedHashMapImplementation.prototype.getKeys = function() { | 1292 LinkedHashMapImplementation.prototype.getKeys = function() { |
| 1293 var list = new ListFactory(this.get$length()); | 1293 var list = new Array(this.get$length()); |
| 1294 var index = 0; | 1294 var index = 0; |
| 1295 this._list.forEach(function _(entry) { | 1295 this._list.forEach(function _(entry) { |
| 1296 list.$setindex(index++, entry.key); | 1296 list.$setindex(index++, entry.key); |
| 1297 } | 1297 } |
| 1298 ); | 1298 ); |
| 1299 return list; | 1299 return list; |
| 1300 } | 1300 } |
| 1301 LinkedHashMapImplementation.prototype.getValues = function() { | 1301 LinkedHashMapImplementation.prototype.getValues = function() { |
| 1302 var list = new ListFactory(this.get$length()); | 1302 var list = new Array(this.get$length()); |
| 1303 var index = 0; | 1303 var index = 0; |
| 1304 this._list.forEach(function _(entry) { | 1304 this._list.forEach(function _(entry) { |
| 1305 list.$setindex(index++, entry.value); | 1305 list.$setindex(index++, entry.value); |
| 1306 } | 1306 } |
| 1307 ); | 1307 ); |
| 1308 return list; | 1308 return list; |
| 1309 } | 1309 } |
| 1310 LinkedHashMapImplementation.prototype.forEach = function(f) { | 1310 LinkedHashMapImplementation.prototype.forEach = function(f) { |
| 1311 this._list.forEach(function _(entry) { | 1311 this._list.forEach(function _(entry) { |
| 1312 f(entry.key, entry.value); | 1312 f(entry.key, entry.value); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1650 return this; | 1650 return this; |
| 1651 } | 1651 } |
| 1652 StringBufferImpl.prototype.addAll = function(objects) { | 1652 StringBufferImpl.prototype.addAll = function(objects) { |
| 1653 for (var $$i = objects.iterator(); $$i.hasNext$0(); ) { | 1653 for (var $$i = objects.iterator(); $$i.hasNext$0(); ) { |
| 1654 var obj = $$i.next$0(); | 1654 var obj = $$i.next$0(); |
| 1655 this.add(obj); | 1655 this.add(obj); |
| 1656 } | 1656 } |
| 1657 return this; | 1657 return this; |
| 1658 } | 1658 } |
| 1659 StringBufferImpl.prototype.clear = function() { | 1659 StringBufferImpl.prototype.clear = function() { |
| 1660 this._buffer = new ListFactory(); | 1660 this._buffer = new Array(); |
| 1661 this._length = 0; | 1661 this._length = 0; |
| 1662 return this; | 1662 return this; |
| 1663 } | 1663 } |
| 1664 StringBufferImpl.prototype.toString = function() { | 1664 StringBufferImpl.prototype.toString = function() { |
| 1665 if (this._buffer.get$length() == 0) return ""; | 1665 if (this._buffer.get$length() == 0) return ""; |
| 1666 if (this._buffer.get$length() == 1) return this._buffer.$index(0); | 1666 if (this._buffer.get$length() == 1) return this._buffer.$index(0); |
| 1667 var result = StringBase.concatAll(this._buffer); | 1667 var result = StringBase.concatAll(this._buffer); |
| 1668 this._buffer.clear(); | 1668 this._buffer.clear(); |
| 1669 this._buffer.add(result); | 1669 this._buffer.add(result); |
| 1670 return result; | 1670 return result; |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2364 } | 2364 } |
| 2365 var typeName = type.get$jsname() != null ? type.get$jsname() : 'top level'; | 2365 var typeName = type.get$jsname() != null ? type.get$jsname() : 'top level'; |
| 2366 this.writer.comment(('// ********** Code for ' + typeName + ' **************')
); | 2366 this.writer.comment(('// ********** Code for ' + typeName + ' **************')
); |
| 2367 if (type.get$isNative() && !type.get$isTop()) { | 2367 if (type.get$isNative() && !type.get$isTop()) { |
| 2368 var nativeName = type.get$definition().get$nativeType().get$name(); | 2368 var nativeName = type.get$definition().get$nativeType().get$name(); |
| 2369 if ($eq(nativeName, '')) { | 2369 if ($eq(nativeName, '')) { |
| 2370 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); | 2370 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); |
| 2371 } | 2371 } |
| 2372 else if (type.get$jsname() != nativeName) { | 2372 else if (type.get$jsname() != nativeName) { |
| 2373 if (type.get$isHiddenNativeType()) { | 2373 if (type.get$isHiddenNativeType()) { |
| 2374 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); | 2374 this.writer.writeln(('var ' + type.get$jsname() + ' = {};')); |
| 2375 } | 2375 } |
| 2376 else { | 2376 else { |
| 2377 this.writer.writeln(('' + type.get$jsname() + ' = ' + nativeName + ';'))
; | 2377 this.writer.writeln(('' + type.get$jsname() + ' = ' + nativeName + ';'))
; |
| 2378 } | 2378 } |
| 2379 } | 2379 } |
| 2380 } | 2380 } |
| 2381 if (!type.get$isTop()) { | 2381 if (!type.get$isTop()) { |
| 2382 if ((type instanceof ConcreteType)) { | 2382 if ((type instanceof ConcreteType)) { |
| 2383 var c = type; | 2383 var c = type; |
| 2384 this.corejs.ensureInheritsHelper(); | 2384 this.corejs.ensureInheritsHelper(); |
| (...skipping 3277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5662 } | 5662 } |
| 5663 return new Value(this.get$inferredResult(), code, node.span, true); | 5663 return new Value(this.get$inferredResult(), code, node.span, true); |
| 5664 } | 5664 } |
| 5665 MethodMember.prototype._invokeConstructor = function(context, node, target, args
, argsString) { | 5665 MethodMember.prototype._invokeConstructor = function(context, node, target, args
, argsString) { |
| 5666 this.declaringType.markUsed(); | 5666 this.declaringType.markUsed(); |
| 5667 if (!target.isType) { | 5667 if (!target.isType) { |
| 5668 var code = (this.get$constructorName() != '') ? ('' + this.declaringType.get
$jsname() + '.' + this.get$constructorName() + '\$ctor.call(' + argsString + ')'
) : ('' + this.declaringType.get$jsname() + '.call(' + argsString + ')'); | 5668 var code = (this.get$constructorName() != '') ? ('' + this.declaringType.get
$jsname() + '.' + this.get$constructorName() + '\$ctor.call(' + argsString + ')'
) : ('' + this.declaringType.get$jsname() + '.call(' + argsString + ')'); |
| 5669 return new Value(target.get$type(), code, node.span, true); | 5669 return new Value(target.get$type(), code, node.span, true); |
| 5670 } | 5670 } |
| 5671 else { | 5671 else { |
| 5672 var code = (this.get$constructorName() != '') ? ('new ' + this.declaringType
.get$jsname() + '.' + this.get$constructorName() + '\$ctor(' + argsString + ')')
: ('new ' + this.declaringType.get$jsname() + '(' + argsString + ')'); | 5672 var typeName = this.declaringType.get$isNative() ? this.declaringType.get$na
tiveType().name : this.declaringType.get$jsname(); |
| 5673 var code = (this.get$constructorName() != '') ? ('new ' + typeName + '.' + t
his.get$constructorName() + '\$ctor(' + argsString + ')') : ('new ' + typeName +
'(' + argsString + ')'); |
| 5673 if (this.isConst && (node instanceof NewExpression) && node.get$dynamic().ge
t$isConst()) { | 5674 if (this.isConst && (node instanceof NewExpression) && node.get$dynamic().ge
t$isConst()) { |
| 5674 return this._invokeConstConstructor(node, code, target, args); | 5675 return this._invokeConstConstructor(node, code, target, args); |
| 5675 } | 5676 } |
| 5676 else { | 5677 else { |
| 5677 return new Value(target.get$type(), code, node.span, true); | 5678 return new Value(target.get$type(), code, node.span, true); |
| 5678 } | 5679 } |
| 5679 } | 5680 } |
| 5680 } | 5681 } |
| 5681 MethodMember.prototype._invokeConstConstructor = function(node, code, target, ar
gs) { | 5682 MethodMember.prototype._invokeConstConstructor = function(node, code, target, ar
gs) { |
| 5682 var fields = new HashMapImplementation(); | 5683 var fields = new HashMapImplementation(); |
| (...skipping 6249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11932 } | 11933 } |
| 11933 FixedCollection.prototype.get$value = function() { return this.value; }; | 11934 FixedCollection.prototype.get$value = function() { return this.value; }; |
| 11934 FixedCollection.prototype.get$length = function() { return this.length; }; | 11935 FixedCollection.prototype.get$length = function() { return this.length; }; |
| 11935 FixedCollection.prototype.iterator = function() { | 11936 FixedCollection.prototype.iterator = function() { |
| 11936 return new FixedIterator_E(this.value, this.length); | 11937 return new FixedIterator_E(this.value, this.length); |
| 11937 } | 11938 } |
| 11938 FixedCollection.prototype.forEach = function(f) { | 11939 FixedCollection.prototype.forEach = function(f) { |
| 11939 Collections.forEach(this, f); | 11940 Collections.forEach(this, f); |
| 11940 } | 11941 } |
| 11941 FixedCollection.prototype.filter = function(f) { | 11942 FixedCollection.prototype.filter = function(f) { |
| 11942 return Collections.filter(this, new ListFactory(), f); | 11943 return Collections.filter(this, new Array(), f); |
| 11943 } | 11944 } |
| 11944 FixedCollection.prototype.every = function(f) { | 11945 FixedCollection.prototype.every = function(f) { |
| 11945 return Collections.every(this, f); | 11946 return Collections.every(this, f); |
| 11946 } | 11947 } |
| 11947 FixedCollection.prototype.some = function(f) { | 11948 FixedCollection.prototype.some = function(f) { |
| 11948 return Collections.some(this, f); | 11949 return Collections.some(this, f); |
| 11949 } | 11950 } |
| 11950 FixedCollection.prototype.isEmpty = function() { | 11951 FixedCollection.prototype.isEmpty = function() { |
| 11951 return this.length == 0; | 11952 return this.length == 0; |
| 11952 } | 11953 } |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12616 var mset = this._members.$index(member.name); | 12617 var mset = this._members.$index(member.name); |
| 12617 if (mset == null) { | 12618 if (mset == null) { |
| 12618 mset = new MemberSet(member, true); | 12619 mset = new MemberSet(member, true); |
| 12619 this._members.$setindex(mset.get$name(), mset); | 12620 this._members.$setindex(mset.get$name(), mset); |
| 12620 } | 12621 } |
| 12621 else { | 12622 else { |
| 12622 mset.get$members().add$1(member); | 12623 mset.get$members().add$1(member); |
| 12623 } | 12624 } |
| 12624 } | 12625 } |
| 12625 World.prototype._addTopName = function(named) { | 12626 World.prototype._addTopName = function(named) { |
| 12627 if (named.get$isNative() && (named instanceof Type)) { |
| 12628 var namedType = named; |
| 12629 if (namedType.get$isHiddenNativeType()) { |
| 12630 var nativeName = namedType.get$definition().get$nativeType().get$name(); |
| 12631 var existing = this._topNames.$index(nativeName); |
| 12632 if (existing != null) { |
| 12633 if (existing.get$isNative()) { |
| 12634 $globals.world.internalError(('conflicting native names "' + named.get
$jsname() + '" ') + ('(already defined in ' + existing.get$span().get$locationTe
xt() + ')'), named.get$span()); |
| 12635 } |
| 12636 else { |
| 12637 this._addJavascriptTopName(existing); |
| 12638 } |
| 12639 } |
| 12640 this._topNames.$setindex(nativeName, named); |
| 12641 if ($eq(nativeName, named.get$jsname())) { |
| 12642 this._addJavascriptTopName(named); |
| 12643 return; |
| 12644 } |
| 12645 } |
| 12646 } |
| 12626 var existing = this._topNames.$index(named.get$jsname()); | 12647 var existing = this._topNames.$index(named.get$jsname()); |
| 12627 if (existing != null) { | 12648 if (existing != null) { |
| 12628 this.info(('mangling matching top level name "' + named.get$jsname() + '" in
') + ('both "' + named.get$library().get$jsname() + '" and "' + existing.get$li
brary().get$jsname() + '"')); | 12649 this.info(('mangling matching top level name "' + named.get$jsname() + '" in
') + ('both "' + named.get$library().get$jsname() + '" and "' + existing.get$li
brary().get$jsname() + '"')); |
| 12629 if (named.get$isNative()) { | 12650 if (named.get$isNative()) { |
| 12630 if (existing.get$isNative()) { | 12651 if (existing.get$isNative()) { |
| 12631 $globals.world.internalError(('conflicting native names "' + named.get$j
sname() + '" ') + ('(already defined in ' + existing.get$span().get$locationText
() + ')'), named.get$span()); | 12652 $globals.world.internalError(('conflicting native names "' + named.get$j
sname() + '" ') + ('(already defined in ' + existing.get$span().get$locationText
() + ')'), named.get$span()); |
| 12632 } | 12653 } |
| 12633 else { | 12654 else { |
| 12634 this._topNames.$setindex(named.get$jsname(), named); | 12655 this._topNames.$setindex(named.get$jsname(), named); |
| 12635 this._addJavascriptTopName(existing); | 12656 this._addJavascriptTopName(existing); |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13261 VarMethodSet.prototype.generate = function(code) { | 13282 VarMethodSet.prototype.generate = function(code) { |
| 13262 | 13283 |
| 13263 } | 13284 } |
| 13264 VarMethodSet.prototype.generate$1 = VarMethodSet.prototype.generate; | 13285 VarMethodSet.prototype.generate$1 = VarMethodSet.prototype.generate; |
| 13265 VarMethodSet.prototype.invoke$4 = VarMethodSet.prototype.invoke; | 13286 VarMethodSet.prototype.invoke$4 = VarMethodSet.prototype.invoke; |
| 13266 // ********** Code for top level ************** | 13287 // ********** Code for top level ************** |
| 13267 function _otherOperator(jsname, op) { | 13288 function _otherOperator(jsname, op) { |
| 13268 return ("function " + jsname + "(x, y) {\n return (typeof(x) == 'number' && t
ypeof(y) == 'number')\n ? x " + op + " y : x." + jsname + "(y);\n}"); | 13289 return ("function " + jsname + "(x, y) {\n return (typeof(x) == 'number' && t
ypeof(y) == 'number')\n ? x " + op + " y : x." + jsname + "(y);\n}"); |
| 13269 } | 13290 } |
| 13270 function map(source, mapper) { | 13291 function map(source, mapper) { |
| 13271 var result = new ListFactory(); | 13292 var result = new Array(); |
| 13272 if (!!(source && source.is$List())) { | 13293 if (!!(source && source.is$List())) { |
| 13273 var list = source; | 13294 var list = source; |
| 13274 result.set$length(list.get$length()); | 13295 result.set$length(list.get$length()); |
| 13275 for (var i = 0; | 13296 for (var i = 0; |
| 13276 i < list.get$length(); i++) { | 13297 i < list.get$length(); i++) { |
| 13277 result.$setindex(i, mapper(list.$index(i))); | 13298 result.$setindex(i, mapper(list.$index(i))); |
| 13278 } | 13299 } |
| 13279 } | 13300 } |
| 13280 else { | 13301 else { |
| 13281 for (var $$i = source.iterator(); $$i.hasNext$0(); ) { | 13302 for (var $$i = source.iterator(); $$i.hasNext$0(); ) { |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13438 } | 13459 } |
| 13439 var const$0 = new EnvMap()/*const EnvMap()*/; | 13460 var const$0 = new EnvMap()/*const EnvMap()*/; |
| 13440 var const$127 = new IllegalAccessException()/*const IllegalAccessException()*/; | 13461 var const$127 = new IllegalAccessException()/*const IllegalAccessException()*/; |
| 13441 var const$128 = ImmutableList.ImmutableList$from$factory([])/*const []*/; | 13462 var const$128 = ImmutableList.ImmutableList$from$factory([])/*const []*/; |
| 13442 var const$2 = new EmptyQueueException()/*const EmptyQueueException()*/; | 13463 var const$2 = new EmptyQueueException()/*const EmptyQueueException()*/; |
| 13443 var const$3 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/; | 13464 var const$3 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/; |
| 13444 var const$8 = new NoMoreElementsException()/*const NoMoreElementsException()*/; | 13465 var const$8 = new NoMoreElementsException()/*const NoMoreElementsException()*/; |
| 13445 var $globals = {}; | 13466 var $globals = {}; |
| 13446 $static_init(); | 13467 $static_init(); |
| 13447 main(); | 13468 main(); |
| OLD | NEW |