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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dart/frog/type.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/minfrog
===================================================================
--- dart/frog/minfrog (revision 4024)
+++ dart/frog/minfrog (working copy)
@@ -135,7 +135,7 @@
"use strict"; return this;
});
$defProp(Object.prototype, "noSuchMethod", function(name, args) {
- $throw(new NoSuchMethodException(this, name, args, ""));
+ $throw(new NoSuchMethodException(this, name, args));
});
$defProp(Object.prototype, "_pushBlock$1", function($0) {
return this.noSuchMethod("_pushBlock", [$0]);
@@ -232,10 +232,10 @@
}
IllegalAccessException.prototype.toString$0 = IllegalAccessException.prototype.toString;
// ********** Code for NoSuchMethodException **************
-function NoSuchMethodException(_receiver, _functionName, _arguments, _extraMessage) {
+function NoSuchMethodException(_receiver, _functionName, _arguments, _existingArgumentNames) {
+ this._existingArgumentNames = _existingArgumentNames;
this._receiver = _receiver;
this._functionName = _functionName;
- this._extraMessage = _extraMessage;
this._arguments = _arguments;
}
NoSuchMethodException.prototype.toString = function() {
@@ -247,9 +247,22 @@
}
sb.add(this._arguments.$index(i));
}
- sb.add("]");
- var x = this._extraMessage;
- return $add(("NoSuchMethodException - receiver: '" + this._receiver + "' "), ("function name: '" + this._functionName + "' arguments: [" + sb + "]" + x));
+ if (null == this._existingArgumentNames) {
+ return $add($add(("NoSuchMethodException : method not found: '" + this._functionName + "'\n"), ("Receiver: " + this._receiver + "\n")), ("Arguments: [" + sb + "]"));
+ }
+ else {
+ var actualParameters = sb.toString();
+ sb = new StringBufferImpl("");
+ for (var i = (0);
+ i < this._existingArgumentNames.get$length(); i++) {
+ if (i > (0)) {
+ sb.add(", ");
+ }
+ sb.add(this._existingArgumentNames.$index(i));
+ }
+ var formalParameters = sb.toString();
+ return $add($add($add("NoSuchMethodException: incorrect number of arguments passed to ", ("method named '" + this._functionName + "'\nReceiver: " + this._receiver + "\n")), ("Tried calling: " + this._functionName + "(" + actualParameters + ")\n")), ("Found: " + this._functionName + "(" + formalParameters + ")"));
+ }
}
NoSuchMethodException.prototype.toString$0 = NoSuchMethodException.prototype.toString;
// ********** Code for ClosureArgumentMismatchException **************
@@ -895,44 +908,44 @@
this._values = new Array((8));
}
HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair.prototype.remove$1 = HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair.prototype.remove;
-// ********** Code for HashMapImplementation_Library$Library **************
-$inherits(HashMapImplementation_Library$Library, HashMapImplementation);
-function HashMapImplementation_Library$Library() {
+// ********** Code for HashMapImplementation_dart_core_String$dart_core_String **************
+$inherits(HashMapImplementation_dart_core_String$dart_core_String, HashMapImplementation);
+function HashMapImplementation_dart_core_String$dart_core_String() {
this._numberOfEntries = (0);
this._numberOfDeleted = (0);
this._loadLimit = HashMapImplementation._computeLoadLimit((8));
this._keys = new Array((8));
this._values = new Array((8));
}
-// ********** Code for HashMapImplementation_Member$Member **************
-$inherits(HashMapImplementation_Member$Member, HashMapImplementation);
-function HashMapImplementation_Member$Member() {
+HashMapImplementation_dart_core_String$dart_core_String.prototype.remove$1 = HashMapImplementation_dart_core_String$dart_core_String.prototype.remove;
+// ********** Code for HashMapImplementation_dart_core_String$VariableValue **************
+$inherits(HashMapImplementation_dart_core_String$VariableValue, HashMapImplementation);
+function HashMapImplementation_dart_core_String$VariableValue() {
this._numberOfEntries = (0);
this._numberOfDeleted = (0);
this._loadLimit = HashMapImplementation._computeLoadLimit((8));
this._keys = new Array((8));
this._values = new Array((8));
}
-// ********** Code for HashMapImplementation_dart_core_String$dart_core_String **************
-$inherits(HashMapImplementation_dart_core_String$dart_core_String, HashMapImplementation);
-function HashMapImplementation_dart_core_String$dart_core_String() {
+HashMapImplementation_dart_core_String$VariableValue.prototype.remove$1 = HashMapImplementation_dart_core_String$VariableValue.prototype.remove;
+// ********** Code for HashMapImplementation_Library$Library **************
+$inherits(HashMapImplementation_Library$Library, HashMapImplementation);
+function HashMapImplementation_Library$Library() {
this._numberOfEntries = (0);
this._numberOfDeleted = (0);
this._loadLimit = HashMapImplementation._computeLoadLimit((8));
this._keys = new Array((8));
this._values = new Array((8));
}
-HashMapImplementation_dart_core_String$dart_core_String.prototype.remove$1 = HashMapImplementation_dart_core_String$dart_core_String.prototype.remove;
-// ********** Code for HashMapImplementation_dart_core_String$VariableValue **************
-$inherits(HashMapImplementation_dart_core_String$VariableValue, HashMapImplementation);
-function HashMapImplementation_dart_core_String$VariableValue() {
+// ********** Code for HashMapImplementation_Member$Member **************
+$inherits(HashMapImplementation_Member$Member, HashMapImplementation);
+function HashMapImplementation_Member$Member() {
this._numberOfEntries = (0);
this._numberOfDeleted = (0);
this._loadLimit = HashMapImplementation._computeLoadLimit((8));
this._keys = new Array((8));
this._values = new Array((8));
}
-HashMapImplementation_dart_core_String$VariableValue.prototype.remove$1 = HashMapImplementation_dart_core_String$VariableValue.prototype.remove;
// ********** Code for HashMapImplementation_Type$Type **************
$inherits(HashMapImplementation_Type$Type, HashMapImplementation);
function HashMapImplementation_Type$Type() {
@@ -1013,6 +1026,12 @@
}
HashSetImplementation.prototype.contains$1 = HashSetImplementation.prototype.contains;
HashSetImplementation.prototype.remove$1 = HashSetImplementation.prototype.remove;
+// ********** Code for HashSetImplementation_dart_core_String **************
+$inherits(HashSetImplementation_dart_core_String, HashSetImplementation);
+function HashSetImplementation_dart_core_String() {
+ this._backingMap = new HashMapImplementation_dart_core_String$dart_core_String();
+}
+HashSetImplementation_dart_core_String.prototype.contains$1 = HashSetImplementation_dart_core_String.prototype.contains;
// ********** Code for HashSetImplementation_Library **************
$inherits(HashSetImplementation_Library, HashSetImplementation);
function HashSetImplementation_Library() {
@@ -1024,12 +1043,6 @@
function HashSetImplementation_Member() {
this._backingMap = new HashMapImplementation_Member$Member();
}
-// ********** Code for HashSetImplementation_dart_core_String **************
-$inherits(HashSetImplementation_dart_core_String, HashSetImplementation);
-function HashSetImplementation_dart_core_String() {
- this._backingMap = new HashMapImplementation_dart_core_String$dart_core_String();
-}
-HashSetImplementation_dart_core_String.prototype.contains$1 = HashSetImplementation_dart_core_String.prototype.contains;
// ********** Code for HashSetImplementation_Type **************
$inherits(HashSetImplementation_Type, HashSetImplementation);
function HashSetImplementation_Type() {
@@ -1457,6 +1470,17 @@
}
buffer.add(this.substring(lastMatchEnd));
}
+StringImplementation.prototype.split_ = function(pattern) {
+ if ((typeof(pattern) == 'string')) return this._split(pattern);
+ if (!!(pattern && pattern.is$RegExp())) return this._splitRegExp(pattern);
+ $throw("String.split(Pattern) unimplemented.");
+}
+StringImplementation.prototype._split = function(pattern) {
+ 'use strict'; return this.split(pattern);
+}
+StringImplementation.prototype._splitRegExp = function(pattern) {
+ 'use strict'; return this.split(pattern.re);
+}
StringImplementation.prototype.hashCode = function() {
'use strict';
var hash = 0;
@@ -1719,8 +1743,8 @@
function joinPaths(path1, path2) {
path1 = canonicalizePath(path1);
path2 = canonicalizePath(path2);
- var pieces = path1.split("/");
- var $$list = path2.split("/");
+ var pieces = path1.split_("/");
+ var $$list = path2.split_("/");
for (var $$i = $$list.iterator(); $$i.hasNext(); ) {
var piece = $$i.next();
if ($eq(piece, "..") && pieces.get$length() > (0) && $ne(pieces.last(), ".") && $ne(pieces.last(), "..")) {
@@ -2712,7 +2736,7 @@
if (text.length == (0)) return;
if (this._pendingIndent) this._indent();
if (text.indexOf("\n") != (-1)) {
- var lines = text.split("\n");
+ var lines = text.split_("\n");
for (var i = (0);
i < lines.get$length() - (1); i++) {
this.writeln(lines.$index(i));
@@ -12126,19 +12150,19 @@
if (!typeArg.get$isVar()) allVar = false;
var paramName = this.typeParameters.$index(i).name;
typeMap.$setindex(paramName, typeArg);
- names.add(typeArg.get$name());
+ names.add(typeArg.get$fullname());
jsnames.add(typeArg.get$jsname());
}
if (allVar) return this;
var jsname = ("" + this.get$jsname() + "_" + Strings.join(jsnames, "$"));
var simpleName = ("" + this.name + "<" + Strings.join(names, ", ") + ">");
- var ret = this._concreteTypes.$index(jsname);
+ var ret = this._concreteTypes.$index(simpleName);
if ($eq(ret)) {
ret = new DefinedType(simpleName, this.library, this.definition, this.isClass);
ret.set$baseGenericType(this);
ret.set$typeArgsInOrder(typeArgs);
ret.set$_jsname(jsname);
- this._concreteTypes.$setindex(jsname, ret);
+ this._concreteTypes.$setindex(simpleName, ret);
ret.resolve();
}
return ret;
@@ -13860,7 +13884,7 @@
$globals.world.info(msg, named.get$span(), existing.get$span());
}
else {
- $globals.world.internalError(msg, named.get$span(), existing.get$span());
+ this._renameJavascriptTopName(existing);
}
}
}
@@ -13878,7 +13902,7 @@
World.prototype.toJsIdentifier = function(name) {
if (name == null) return null;
if (this._jsKeywords == null) {
- this._jsKeywords = HashSetImplementation.HashSetImplementation$from$factory(["break", "case", "catch", "continue", "debugger", "default", "delete", "do", "else", "finally", "for", "function", "if", "in", "instanceof", "new", "return", "switch", "this", "throw", "try", "typeof", "var", "void", "while", "with", "class", "enum", "export", "extends", "import", "super", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "native"]);
+ this._jsKeywords = HashSetImplementation.HashSetImplementation$from$factory(["break", "case", "catch", "continue", "debugger", "default", "delete", "do", "else", "finally", "for", "function", "if", "in", "instanceof", "new", "return", "switch", "this", "throw", "try", "typeof", "var", "void", "while", "with", "class", "enum", "export", "extends", "import", "super", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "split", "native"]);
}
if (this._jsKeywords.contains(name)) {
return $add(name, "_");
« 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