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

Unified Diff: frog/minfrog

Issue 9478021: Add some sweet XML classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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 | « frog/corejs.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/minfrog
diff --git a/frog/minfrog b/frog/minfrog
index e3aa956f0b862c6f8f4c0d74a121c71f461c94a6..95c2eb608f24a45bb35a8a49f2209fa14ce38531 100755
--- a/frog/minfrog
+++ b/frog/minfrog
@@ -1893,6 +1893,8 @@ $defProp(Object.prototype, '$typeNameOf', function() {
name = 'DOMWindow';
} else if (name == 'Document') {
name = 'HTMLDocument';
+ } else if (name == 'XMLDocument') {
+ name = 'Document';
}
return name;
});
@@ -3081,7 +3083,7 @@ CoreJs.prototype.ensureTypeNameOf = function() {
if (this._generatedTypeNameOf) return;
this._generatedTypeNameOf = true;
this.ensureDefProp();
- this.writer.writeln("$defProp(Object.prototype, '$typeNameOf', function() {\n var constructor = this.constructor;\n if (typeof(constructor) == 'function') {\n // The constructor isn't null or undefined at this point. Try\n // to grab hold of its name.\n var name = constructor.name;\n // If the name is a non-empty string, we use that as the type\n // name of this object. On Firefox, we often get 'Object' as\n // the constructor name even for more specialized objects so\n // we have to fall through to the toString() based implementation\n // below in that case.\n if (name && typeof(name) == 'string' && name != 'Object') return name;\n }\n var string = Object.prototype.toString.call(this);\n var name = string.substring(8, string.length - 1);\n if (name == 'Window') {\n name = 'DOMWindow';\n } else if (name == 'Document') {\n name = 'HTMLDocument';\n }\n return name;\n});");
+ this.writer.writeln("$defProp(Object.prototype, '$typeNameOf', function() {\n var constructor = this.constructor;\n if (typeof(constructor) == 'function') {\n // The constructor isn't null or undefined at this point. Try\n // to grab hold of its name.\n var name = constructor.name;\n // If the name is a non-empty string, we use that as the type\n // name of this object. On Firefox, we often get 'Object' as\n // the constructor name even for more specialized objects so\n // we have to fall through to the toString() based implementation\n // below in that case.\n if (name && typeof(name) == 'string' && name != 'Object') return name;\n }\n var string = Object.prototype.toString.call(this);\n var name = string.substring(8, string.length - 1);\n if (name == 'Window') {\n name = 'DOMWindow';\n } else if (name == 'Document') {\n name = 'HTMLDocument';\n } else if (name == 'XMLDocument') {\n name = 'Document';\n }\n return name;\n});");
}
CoreJs.prototype.ensureInheritsHelper = function() {
if (this._generatedInherits) return;
« no previous file with comments | « frog/corejs.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698