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

Side by Side Diff: dart/frog/minfrog

Issue 9361030: Fix for http://code.google.com/p/dart/issues/detail?id=1363: use the simplename for the key, not ... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/frog/type.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env node 1 #!/usr/bin/env node
2 // ********** Library dart:core ************** 2 // ********** Library dart:core **************
3 // ********** Natives dart:core ************** 3 // ********** Natives dart:core **************
4 function $defProp(obj, prop, value) { 4 function $defProp(obj, prop, value) {
5 Object.defineProperty(obj, prop, 5 Object.defineProperty(obj, prop,
6 {value: value, enumerable: false, writable: true, configurable: true}); 6 {value: value, enumerable: false, writable: true, configurable: true});
7 } 7 }
8 function $throw(e) { 8 function $throw(e) {
9 // If e is not a value, we can use V8's captureStackTrace utility method. 9 // If e is not a value, we can use V8's captureStackTrace utility method.
10 // TODO(jmesserly): capture the stack trace on other JS engines. 10 // TODO(jmesserly): capture the stack trace on other JS engines.
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 return (tmp < 0) ? Math.ceil(tmp) : Math.floor(tmp); 128 return (tmp < 0) ? Math.ceil(tmp) : Math.floor(tmp);
129 } else { 129 } else {
130 return x.$truncdiv(y); 130 return x.$truncdiv(y);
131 } 131 }
132 } 132 }
133 // ********** Code for Object ************** 133 // ********** Code for Object **************
134 $defProp(Object.prototype, "get$dynamic", function() { 134 $defProp(Object.prototype, "get$dynamic", function() {
135 "use strict"; return this; 135 "use strict"; return this;
136 }); 136 });
137 $defProp(Object.prototype, "noSuchMethod", function(name, args) { 137 $defProp(Object.prototype, "noSuchMethod", function(name, args) {
138 $throw(new NoSuchMethodException(this, name, args, "")); 138 $throw(new NoSuchMethodException(this, name, args));
139 }); 139 });
140 $defProp(Object.prototype, "_pushBlock$1", function($0) { 140 $defProp(Object.prototype, "_pushBlock$1", function($0) {
141 return this.noSuchMethod("_pushBlock", [$0]); 141 return this.noSuchMethod("_pushBlock", [$0]);
142 }); 142 });
143 $defProp(Object.prototype, "analyze$1", function($0) { 143 $defProp(Object.prototype, "analyze$1", function($0) {
144 return this.noSuchMethod("analyze", [$0]); 144 return this.noSuchMethod("analyze", [$0]);
145 }); 145 });
146 $defProp(Object.prototype, "contains$1", function($0) { 146 $defProp(Object.prototype, "contains$1", function($0) {
147 return this.noSuchMethod("contains", [$0]); 147 return this.noSuchMethod("contains", [$0]);
148 }); 148 });
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 IndexOutOfRangeException.prototype.toString$0 = IndexOutOfRangeException.prototy pe.toString; 225 IndexOutOfRangeException.prototype.toString$0 = IndexOutOfRangeException.prototy pe.toString;
226 // ********** Code for IllegalAccessException ************** 226 // ********** Code for IllegalAccessException **************
227 function IllegalAccessException() { 227 function IllegalAccessException() {
228 228
229 } 229 }
230 IllegalAccessException.prototype.toString = function() { 230 IllegalAccessException.prototype.toString = function() {
231 return "Attempt to modify an immutable object"; 231 return "Attempt to modify an immutable object";
232 } 232 }
233 IllegalAccessException.prototype.toString$0 = IllegalAccessException.prototype.t oString; 233 IllegalAccessException.prototype.toString$0 = IllegalAccessException.prototype.t oString;
234 // ********** Code for NoSuchMethodException ************** 234 // ********** Code for NoSuchMethodException **************
235 function NoSuchMethodException(_receiver, _functionName, _arguments, _extraMessa ge) { 235 function NoSuchMethodException(_receiver, _functionName, _arguments, _existingAr gumentNames) {
236 this._existingArgumentNames = _existingArgumentNames;
236 this._receiver = _receiver; 237 this._receiver = _receiver;
237 this._functionName = _functionName; 238 this._functionName = _functionName;
238 this._extraMessage = _extraMessage;
239 this._arguments = _arguments; 239 this._arguments = _arguments;
240 } 240 }
241 NoSuchMethodException.prototype.toString = function() { 241 NoSuchMethodException.prototype.toString = function() {
242 var sb = new StringBufferImpl(""); 242 var sb = new StringBufferImpl("");
243 for (var i = (0); 243 for (var i = (0);
244 i < this._arguments.get$length(); i++) { 244 i < this._arguments.get$length(); i++) {
245 if (i > (0)) { 245 if (i > (0)) {
246 sb.add(", "); 246 sb.add(", ");
247 } 247 }
248 sb.add(this._arguments.$index(i)); 248 sb.add(this._arguments.$index(i));
249 } 249 }
250 sb.add("]"); 250 if (null == this._existingArgumentNames) {
251 var x = this._extraMessage; 251 return $add($add(("NoSuchMethodException : method not found: '" + this._func tionName + "'\n"), ("Receiver: " + this._receiver + "\n")), ("Arguments: [" + sb + "]"));
252 return $add(("NoSuchMethodException - receiver: '" + this._receiver + "' "), ( "function name: '" + this._functionName + "' arguments: [" + sb + "]" + x)); 252 }
253 else {
254 var actualParameters = sb.toString();
255 sb = new StringBufferImpl("");
256 for (var i = (0);
257 i < this._existingArgumentNames.get$length(); i++) {
258 if (i > (0)) {
259 sb.add(", ");
260 }
261 sb.add(this._existingArgumentNames.$index(i));
262 }
263 var formalParameters = sb.toString();
264 return $add($add($add("NoSuchMethodException: incorrect number of arguments passed to ", ("method named '" + this._functionName + "'\nReceiver: " + this._re ceiver + "\n")), ("Tried calling: " + this._functionName + "(" + actualParameter s + ")\n")), ("Found: " + this._functionName + "(" + formalParameters + ")"));
265 }
253 } 266 }
254 NoSuchMethodException.prototype.toString$0 = NoSuchMethodException.prototype.toS tring; 267 NoSuchMethodException.prototype.toString$0 = NoSuchMethodException.prototype.toS tring;
255 // ********** Code for ClosureArgumentMismatchException ************** 268 // ********** Code for ClosureArgumentMismatchException **************
256 function ClosureArgumentMismatchException() { 269 function ClosureArgumentMismatchException() {
257 270
258 } 271 }
259 ClosureArgumentMismatchException.prototype.toString = function() { 272 ClosureArgumentMismatchException.prototype.toString = function() {
260 return "Closure argument mismatch"; 273 return "Closure argument mismatch";
261 } 274 }
262 ClosureArgumentMismatchException.prototype.toString$0 = ClosureArgumentMismatchE xception.prototype.toString; 275 ClosureArgumentMismatchException.prototype.toString$0 = ClosureArgumentMismatchE xception.prototype.toString;
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 // ********** Code for HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyV aluePair ************** 901 // ********** Code for HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyV aluePair **************
889 $inherits(HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair, Has hMapImplementation); 902 $inherits(HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair, Has hMapImplementation);
890 function HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair() { 903 function HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair() {
891 this._numberOfEntries = (0); 904 this._numberOfEntries = (0);
892 this._numberOfDeleted = (0); 905 this._numberOfDeleted = (0);
893 this._loadLimit = HashMapImplementation._computeLoadLimit((8)); 906 this._loadLimit = HashMapImplementation._computeLoadLimit((8));
894 this._keys = new Array((8)); 907 this._keys = new Array((8));
895 this._values = new Array((8)); 908 this._values = new Array((8));
896 } 909 }
897 HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair.prototype.remo ve$1 = HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair.prototy pe.remove; 910 HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair.prototype.remo ve$1 = HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair.prototy pe.remove;
898 // ********** Code for HashMapImplementation_Library$Library **************
899 $inherits(HashMapImplementation_Library$Library, HashMapImplementation);
900 function HashMapImplementation_Library$Library() {
901 this._numberOfEntries = (0);
902 this._numberOfDeleted = (0);
903 this._loadLimit = HashMapImplementation._computeLoadLimit((8));
904 this._keys = new Array((8));
905 this._values = new Array((8));
906 }
907 // ********** Code for HashMapImplementation_Member$Member **************
908 $inherits(HashMapImplementation_Member$Member, HashMapImplementation);
909 function HashMapImplementation_Member$Member() {
910 this._numberOfEntries = (0);
911 this._numberOfDeleted = (0);
912 this._loadLimit = HashMapImplementation._computeLoadLimit((8));
913 this._keys = new Array((8));
914 this._values = new Array((8));
915 }
916 // ********** Code for HashMapImplementation_dart_core_String$dart_core_String * ************* 911 // ********** Code for HashMapImplementation_dart_core_String$dart_core_String * *************
917 $inherits(HashMapImplementation_dart_core_String$dart_core_String, HashMapImplem entation); 912 $inherits(HashMapImplementation_dart_core_String$dart_core_String, HashMapImplem entation);
918 function HashMapImplementation_dart_core_String$dart_core_String() { 913 function HashMapImplementation_dart_core_String$dart_core_String() {
919 this._numberOfEntries = (0); 914 this._numberOfEntries = (0);
920 this._numberOfDeleted = (0); 915 this._numberOfDeleted = (0);
921 this._loadLimit = HashMapImplementation._computeLoadLimit((8)); 916 this._loadLimit = HashMapImplementation._computeLoadLimit((8));
922 this._keys = new Array((8)); 917 this._keys = new Array((8));
923 this._values = new Array((8)); 918 this._values = new Array((8));
924 } 919 }
925 HashMapImplementation_dart_core_String$dart_core_String.prototype.remove$1 = Has hMapImplementation_dart_core_String$dart_core_String.prototype.remove; 920 HashMapImplementation_dart_core_String$dart_core_String.prototype.remove$1 = Has hMapImplementation_dart_core_String$dart_core_String.prototype.remove;
926 // ********** Code for HashMapImplementation_dart_core_String$VariableValue **** ********** 921 // ********** Code for HashMapImplementation_dart_core_String$VariableValue **** **********
927 $inherits(HashMapImplementation_dart_core_String$VariableValue, HashMapImplement ation); 922 $inherits(HashMapImplementation_dart_core_String$VariableValue, HashMapImplement ation);
928 function HashMapImplementation_dart_core_String$VariableValue() { 923 function HashMapImplementation_dart_core_String$VariableValue() {
929 this._numberOfEntries = (0); 924 this._numberOfEntries = (0);
930 this._numberOfDeleted = (0); 925 this._numberOfDeleted = (0);
931 this._loadLimit = HashMapImplementation._computeLoadLimit((8)); 926 this._loadLimit = HashMapImplementation._computeLoadLimit((8));
932 this._keys = new Array((8)); 927 this._keys = new Array((8));
933 this._values = new Array((8)); 928 this._values = new Array((8));
934 } 929 }
935 HashMapImplementation_dart_core_String$VariableValue.prototype.remove$1 = HashMa pImplementation_dart_core_String$VariableValue.prototype.remove; 930 HashMapImplementation_dart_core_String$VariableValue.prototype.remove$1 = HashMa pImplementation_dart_core_String$VariableValue.prototype.remove;
931 // ********** Code for HashMapImplementation_Library$Library **************
932 $inherits(HashMapImplementation_Library$Library, HashMapImplementation);
933 function HashMapImplementation_Library$Library() {
934 this._numberOfEntries = (0);
935 this._numberOfDeleted = (0);
936 this._loadLimit = HashMapImplementation._computeLoadLimit((8));
937 this._keys = new Array((8));
938 this._values = new Array((8));
939 }
940 // ********** Code for HashMapImplementation_Member$Member **************
941 $inherits(HashMapImplementation_Member$Member, HashMapImplementation);
942 function HashMapImplementation_Member$Member() {
943 this._numberOfEntries = (0);
944 this._numberOfDeleted = (0);
945 this._loadLimit = HashMapImplementation._computeLoadLimit((8));
946 this._keys = new Array((8));
947 this._values = new Array((8));
948 }
936 // ********** Code for HashMapImplementation_Type$Type ************** 949 // ********** Code for HashMapImplementation_Type$Type **************
937 $inherits(HashMapImplementation_Type$Type, HashMapImplementation); 950 $inherits(HashMapImplementation_Type$Type, HashMapImplementation);
938 function HashMapImplementation_Type$Type() { 951 function HashMapImplementation_Type$Type() {
939 this._numberOfEntries = (0); 952 this._numberOfEntries = (0);
940 this._numberOfDeleted = (0); 953 this._numberOfDeleted = (0);
941 this._loadLimit = HashMapImplementation._computeLoadLimit((8)); 954 this._loadLimit = HashMapImplementation._computeLoadLimit((8));
942 this._keys = new Array((8)); 955 this._keys = new Array((8));
943 this._values = new Array((8)); 956 this._values = new Array((8));
944 } 957 }
945 // ********** Code for HashSetImplementation ************** 958 // ********** Code for HashSetImplementation **************
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 return this._backingMap.isEmpty(); 1019 return this._backingMap.isEmpty();
1007 } 1020 }
1008 HashSetImplementation.prototype.get$length = function() { 1021 HashSetImplementation.prototype.get$length = function() {
1009 return this._backingMap.get$length(); 1022 return this._backingMap.get$length();
1010 } 1023 }
1011 HashSetImplementation.prototype.iterator = function() { 1024 HashSetImplementation.prototype.iterator = function() {
1012 return new HashSetIterator(this); 1025 return new HashSetIterator(this);
1013 } 1026 }
1014 HashSetImplementation.prototype.contains$1 = HashSetImplementation.prototype.con tains; 1027 HashSetImplementation.prototype.contains$1 = HashSetImplementation.prototype.con tains;
1015 HashSetImplementation.prototype.remove$1 = HashSetImplementation.prototype.remov e; 1028 HashSetImplementation.prototype.remove$1 = HashSetImplementation.prototype.remov e;
1029 // ********** Code for HashSetImplementation_dart_core_String **************
1030 $inherits(HashSetImplementation_dart_core_String, HashSetImplementation);
1031 function HashSetImplementation_dart_core_String() {
1032 this._backingMap = new HashMapImplementation_dart_core_String$dart_core_String ();
1033 }
1034 HashSetImplementation_dart_core_String.prototype.contains$1 = HashSetImplementat ion_dart_core_String.prototype.contains;
1016 // ********** Code for HashSetImplementation_Library ************** 1035 // ********** Code for HashSetImplementation_Library **************
1017 $inherits(HashSetImplementation_Library, HashSetImplementation); 1036 $inherits(HashSetImplementation_Library, HashSetImplementation);
1018 function HashSetImplementation_Library() { 1037 function HashSetImplementation_Library() {
1019 this._backingMap = new HashMapImplementation_Library$Library(); 1038 this._backingMap = new HashMapImplementation_Library$Library();
1020 } 1039 }
1021 HashSetImplementation_Library.prototype.contains$1 = HashSetImplementation_Libra ry.prototype.contains; 1040 HashSetImplementation_Library.prototype.contains$1 = HashSetImplementation_Libra ry.prototype.contains;
1022 // ********** Code for HashSetImplementation_Member ************** 1041 // ********** Code for HashSetImplementation_Member **************
1023 $inherits(HashSetImplementation_Member, HashSetImplementation); 1042 $inherits(HashSetImplementation_Member, HashSetImplementation);
1024 function HashSetImplementation_Member() { 1043 function HashSetImplementation_Member() {
1025 this._backingMap = new HashMapImplementation_Member$Member(); 1044 this._backingMap = new HashMapImplementation_Member$Member();
1026 } 1045 }
1027 // ********** Code for HashSetImplementation_dart_core_String **************
1028 $inherits(HashSetImplementation_dart_core_String, HashSetImplementation);
1029 function HashSetImplementation_dart_core_String() {
1030 this._backingMap = new HashMapImplementation_dart_core_String$dart_core_String ();
1031 }
1032 HashSetImplementation_dart_core_String.prototype.contains$1 = HashSetImplementat ion_dart_core_String.prototype.contains;
1033 // ********** Code for HashSetImplementation_Type ************** 1046 // ********** Code for HashSetImplementation_Type **************
1034 $inherits(HashSetImplementation_Type, HashSetImplementation); 1047 $inherits(HashSetImplementation_Type, HashSetImplementation);
1035 function HashSetImplementation_Type() { 1048 function HashSetImplementation_Type() {
1036 this._backingMap = new HashMapImplementation_Type$Type(); 1049 this._backingMap = new HashMapImplementation_Type$Type();
1037 } 1050 }
1038 HashSetImplementation_Type.prototype.contains$1 = HashSetImplementation_Type.pro totype.contains; 1051 HashSetImplementation_Type.prototype.contains$1 = HashSetImplementation_Type.pro totype.contains;
1039 // ********** Code for HashSetIterator ************** 1052 // ********** Code for HashSetIterator **************
1040 function HashSetIterator(set_) { 1053 function HashSetIterator(set_) {
1041 this._entries = set_._backingMap._keys; 1054 this._entries = set_._backingMap._keys;
1042 this._nextValidIndex = (-1); 1055 this._nextValidIndex = (-1);
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 var lastMatchEnd = (0); 1463 var lastMatchEnd = (0);
1451 var $$list = from.allMatches(this); 1464 var $$list = from.allMatches(this);
1452 for (var $$i = $$list.iterator(); $$i.hasNext(); ) { 1465 for (var $$i = $$list.iterator(); $$i.hasNext(); ) {
1453 var match = $$i.next(); 1466 var match = $$i.next();
1454 buffer.add(this.substring(lastMatchEnd, match.start())); 1467 buffer.add(this.substring(lastMatchEnd, match.start()));
1455 buffer.add(to); 1468 buffer.add(to);
1456 lastMatchEnd = match.end$0(); 1469 lastMatchEnd = match.end$0();
1457 } 1470 }
1458 buffer.add(this.substring(lastMatchEnd)); 1471 buffer.add(this.substring(lastMatchEnd));
1459 } 1472 }
1473 StringImplementation.prototype.split_ = function(pattern) {
1474 if ((typeof(pattern) == 'string')) return this._split(pattern);
1475 if (!!(pattern && pattern.is$RegExp())) return this._splitRegExp(pattern);
1476 $throw("String.split(Pattern) unimplemented.");
1477 }
1478 StringImplementation.prototype._split = function(pattern) {
1479 'use strict'; return this.split(pattern);
1480 }
1481 StringImplementation.prototype._splitRegExp = function(pattern) {
1482 'use strict'; return this.split(pattern.re);
1483 }
1460 StringImplementation.prototype.hashCode = function() { 1484 StringImplementation.prototype.hashCode = function() {
1461 'use strict'; 1485 'use strict';
1462 var hash = 0; 1486 var hash = 0;
1463 for (var i = 0; i < this.length; i++) { 1487 for (var i = 0; i < this.length; i++) {
1464 hash = 0x1fffffff & (hash + this.charCodeAt(i)); 1488 hash = 0x1fffffff & (hash + this.charCodeAt(i));
1465 hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); 1489 hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
1466 hash ^= hash >> 6; 1490 hash ^= hash >> 6;
1467 } 1491 }
1468 1492
1469 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); 1493 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 return new Process(get$_process()); 1736 return new Process(get$_process());
1713 } 1737 }
1714 // ********** Library file_system ************** 1738 // ********** Library file_system **************
1715 // ********** Code for top level ************** 1739 // ********** Code for top level **************
1716 function canonicalizePath(path) { 1740 function canonicalizePath(path) {
1717 return path.replaceAll("\\", "/"); 1741 return path.replaceAll("\\", "/");
1718 } 1742 }
1719 function joinPaths(path1, path2) { 1743 function joinPaths(path1, path2) {
1720 path1 = canonicalizePath(path1); 1744 path1 = canonicalizePath(path1);
1721 path2 = canonicalizePath(path2); 1745 path2 = canonicalizePath(path2);
1722 var pieces = path1.split("/"); 1746 var pieces = path1.split_("/");
1723 var $$list = path2.split("/"); 1747 var $$list = path2.split_("/");
1724 for (var $$i = $$list.iterator(); $$i.hasNext(); ) { 1748 for (var $$i = $$list.iterator(); $$i.hasNext(); ) {
1725 var piece = $$i.next(); 1749 var piece = $$i.next();
1726 if ($eq(piece, "..") && pieces.get$length() > (0) && $ne(pieces.last(), ".") && $ne(pieces.last(), "..")) { 1750 if ($eq(piece, "..") && pieces.get$length() > (0) && $ne(pieces.last(), ".") && $ne(pieces.last(), "..")) {
1727 pieces.removeLast(); 1751 pieces.removeLast();
1728 } 1752 }
1729 else if ($ne(piece, "")) { 1753 else if ($ne(piece, "")) {
1730 if (pieces.get$length() > (0) && $eq(pieces.last(), ".")) { 1754 if (pieces.get$length() > (0) && $eq(pieces.last(), ".")) {
1731 pieces.removeLast(); 1755 pieces.removeLast();
1732 } 1756 }
1733 pieces.add(piece); 1757 pieces.add(piece);
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
2705 } 2729 }
2706 CodeWriter.prototype.comment = function(text) { 2730 CodeWriter.prototype.comment = function(text) {
2707 if (this.writeComments) { 2731 if (this.writeComments) {
2708 this.writeln(text); 2732 this.writeln(text);
2709 } 2733 }
2710 } 2734 }
2711 CodeWriter.prototype.write = function(text) { 2735 CodeWriter.prototype.write = function(text) {
2712 if (text.length == (0)) return; 2736 if (text.length == (0)) return;
2713 if (this._pendingIndent) this._indent(); 2737 if (this._pendingIndent) this._indent();
2714 if (text.indexOf("\n") != (-1)) { 2738 if (text.indexOf("\n") != (-1)) {
2715 var lines = text.split("\n"); 2739 var lines = text.split_("\n");
2716 for (var i = (0); 2740 for (var i = (0);
2717 i < lines.get$length() - (1); i++) { 2741 i < lines.get$length() - (1); i++) {
2718 this.writeln(lines.$index(i)); 2742 this.writeln(lines.$index(i));
2719 } 2743 }
2720 this.write(lines.$index(lines.get$length() - (1))); 2744 this.write(lines.$index(lines.get$length() - (1)));
2721 } 2745 }
2722 else { 2746 else {
2723 this._buf.add(text); 2747 this._buf.add(text);
2724 } 2748 }
2725 } 2749 }
(...skipping 9393 matching lines...) Expand 10 before | Expand all | Expand 10 after
12119 for (var i = (0); 12143 for (var i = (0);
12120 i < typeArgs.get$length(); i++) { 12144 i < typeArgs.get$length(); i++) {
12121 var typeArg = typeArgs.$index(i); 12145 var typeArg = typeArgs.$index(i);
12122 if ((typeArg instanceof ParameterType)) { 12146 if ((typeArg instanceof ParameterType)) {
12123 typeArg = $globals.world.varType; 12147 typeArg = $globals.world.varType;
12124 typeArgs.$setindex(i, typeArg); 12148 typeArgs.$setindex(i, typeArg);
12125 } 12149 }
12126 if (!typeArg.get$isVar()) allVar = false; 12150 if (!typeArg.get$isVar()) allVar = false;
12127 var paramName = this.typeParameters.$index(i).name; 12151 var paramName = this.typeParameters.$index(i).name;
12128 typeMap.$setindex(paramName, typeArg); 12152 typeMap.$setindex(paramName, typeArg);
12129 names.add(typeArg.get$name()); 12153 names.add(typeArg.get$fullname());
12130 jsnames.add(typeArg.get$jsname()); 12154 jsnames.add(typeArg.get$jsname());
12131 } 12155 }
12132 if (allVar) return this; 12156 if (allVar) return this;
12133 var jsname = ("" + this.get$jsname() + "_" + Strings.join(jsnames, "$")); 12157 var jsname = ("" + this.get$jsname() + "_" + Strings.join(jsnames, "$"));
12134 var simpleName = ("" + this.name + "<" + Strings.join(names, ", ") + ">"); 12158 var simpleName = ("" + this.name + "<" + Strings.join(names, ", ") + ">");
12135 var ret = this._concreteTypes.$index(jsname); 12159 var ret = this._concreteTypes.$index(simpleName);
12136 if ($eq(ret)) { 12160 if ($eq(ret)) {
12137 ret = new DefinedType(simpleName, this.library, this.definition, this.isClas s); 12161 ret = new DefinedType(simpleName, this.library, this.definition, this.isClas s);
12138 ret.set$baseGenericType(this); 12162 ret.set$baseGenericType(this);
12139 ret.set$typeArgsInOrder(typeArgs); 12163 ret.set$typeArgsInOrder(typeArgs);
12140 ret.set$_jsname(jsname); 12164 ret.set$_jsname(jsname);
12141 this._concreteTypes.$setindex(jsname, ret); 12165 this._concreteTypes.$setindex(simpleName, ret);
12142 ret.resolve(); 12166 ret.resolve();
12143 } 12167 }
12144 return ret; 12168 return ret;
12145 } 12169 }
12146 DefinedType.prototype.getCallStub = function(args) { 12170 DefinedType.prototype.getCallStub = function(args) {
12147 var name = _getCallStubName("call", args); 12171 var name = _getCallStubName("call", args);
12148 var stub = this.varStubs.$index(name); 12172 var stub = this.varStubs.$index(name);
12149 if ($eq(stub)) { 12173 if ($eq(stub)) {
12150 stub = new VarFunctionStub(name, args); 12174 stub = new VarFunctionStub(name, args);
12151 this.varStubs.$setindex(name, stub); 12175 this.varStubs.$setindex(name, stub);
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
13853 } 13877 }
13854 else if (namedPri > existingPri) { 13878 else if (namedPri > existingPri) {
13855 this._renameJavascriptTopName(existing); 13879 this._renameJavascriptTopName(existing);
13856 } 13880 }
13857 else { 13881 else {
13858 var msg = $add($add(("conflicting JS name \"" + name + "\" of same "), ("pri ority " + existingPri + ": (already defined in) ")), ("" + existing.get$span().g et$locationText() + " with priority " + namedPri + ")")); 13882 var msg = $add($add(("conflicting JS name \"" + name + "\" of same "), ("pri ority " + existingPri + ": (already defined in) ")), ("" + existing.get$span().g et$locationText() + " with priority " + namedPri + ")"));
13859 if (named.get$isNative()) { 13883 if (named.get$isNative()) {
13860 $globals.world.info(msg, named.get$span(), existing.get$span()); 13884 $globals.world.info(msg, named.get$span(), existing.get$span());
13861 } 13885 }
13862 else { 13886 else {
13863 $globals.world.internalError(msg, named.get$span(), existing.get$span()); 13887 this._renameJavascriptTopName(existing);
13864 } 13888 }
13865 } 13889 }
13866 } 13890 }
13867 World.prototype._renameJavascriptTopName = function(named) { 13891 World.prototype._renameJavascriptTopName = function(named) {
13868 named._jsname = ("" + named.get$library().get$jsname() + "_" + named.get$jsnam e()); 13892 named._jsname = ("" + named.get$library().get$jsname() + "_" + named.get$jsnam e());
13869 var existing = this._topNames.$index(named.get$jsname()); 13893 var existing = this._topNames.$index(named.get$jsname());
13870 if ($ne(existing) && $ne(existing, named)) { 13894 if ($ne(existing) && $ne(existing, named)) {
13871 $globals.world.internalError($add(("name mangling failed for \"" + named.get $jsname() + "\" "), ("(\"" + named.get$jsname() + "\" defined also in " + existi ng.get$span().get$locationText() + ")")), named.get$span()); 13895 $globals.world.internalError($add(("name mangling failed for \"" + named.get $jsname() + "\" "), ("(\"" + named.get$jsname() + "\" defined also in " + existi ng.get$span().get$locationText() + ")")), named.get$span());
13872 } 13896 }
13873 this._topNames.$setindex(named.get$jsname(), named); 13897 this._topNames.$setindex(named.get$jsname(), named);
13874 } 13898 }
13875 World.prototype._addType = function(type) { 13899 World.prototype._addType = function(type) {
13876 if (!type.get$isTop()) this._addTopName(type); 13900 if (!type.get$isTop()) this._addTopName(type);
13877 } 13901 }
13878 World.prototype.toJsIdentifier = function(name) { 13902 World.prototype.toJsIdentifier = function(name) {
13879 if (name == null) return null; 13903 if (name == null) return null;
13880 if (this._jsKeywords == null) { 13904 if (this._jsKeywords == null) {
13881 this._jsKeywords = HashSetImplementation.HashSetImplementation$from$factory( ["break", "case", "catch", "continue", "debugger", "default", "delete", "do", "e lse", "finally", "for", "function", "if", "in", "instanceof", "new", "return", " switch", "this", "throw", "try", "typeof", "var", "void", "while", "with", "clas s", "enum", "export", "extends", "import", "super", "implements", "interface", " let", "package", "private", "protected", "public", "static", "yield", "native"]) ; 13905 this._jsKeywords = HashSetImplementation.HashSetImplementation$from$factory( ["break", "case", "catch", "continue", "debugger", "default", "delete", "do", "e lse", "finally", "for", "function", "if", "in", "instanceof", "new", "return", " switch", "this", "throw", "try", "typeof", "var", "void", "while", "with", "clas s", "enum", "export", "extends", "import", "super", "implements", "interface", " let", "package", "private", "protected", "public", "static", "yield", "split", " native"]);
13882 } 13906 }
13883 if (this._jsKeywords.contains(name)) { 13907 if (this._jsKeywords.contains(name)) {
13884 return $add(name, "_"); 13908 return $add(name, "_");
13885 } 13909 }
13886 else { 13910 else {
13887 return name.replaceAll("$", "$$").replaceAll(":", "$"); 13911 return name.replaceAll("$", "$$").replaceAll(":", "$");
13888 } 13912 }
13889 } 13913 }
13890 World.prototype.compileAndSave = function() { 13914 World.prototype.compileAndSave = function() {
13891 var success = this.compile(); 13915 var success = this.compile();
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
14625 } 14649 }
14626 var const$0000 = Object.create(_DeletedKeySentinel.prototype, {}); 14650 var const$0000 = Object.create(_DeletedKeySentinel.prototype, {});
14627 var const$0001 = Object.create(NoMoreElementsException.prototype, {}); 14651 var const$0001 = Object.create(NoMoreElementsException.prototype, {});
14628 var const$0002 = Object.create(EmptyQueueException.prototype, {}); 14652 var const$0002 = Object.create(EmptyQueueException.prototype, {});
14629 var const$0006 = Object.create(IllegalAccessException.prototype, {}); 14653 var const$0006 = Object.create(IllegalAccessException.prototype, {});
14630 var const$0007 = ImmutableList.ImmutableList$from$factory([]); 14654 var const$0007 = ImmutableList.ImmutableList$from$factory([]);
14631 var const$0009 = new JSSyntaxRegExp("^[a-zA-Z]:/"); 14655 var const$0009 = new JSSyntaxRegExp("^[a-zA-Z]:/");
14632 var $globals = {}; 14656 var $globals = {};
14633 $static_init(); 14657 $static_init();
14634 main(); 14658 main();
OLDNEW
« no previous file with comments | « no previous file | dart/frog/type.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698