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

Side by Side Diff: frog/minfrog

Issue 9513015: Fix XML tests on Safari and IE. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 8 years, 9 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 | « frog/corejs.dart ('k') | no next file » | 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.prototype.bind = Function.prototype.bind || 8 Function.prototype.bind = Function.prototype.bind ||
9 function(thisObj) { 9 function(thisObj) {
10 var func = this; 10 var func = this;
(...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after
1867 } 1867 }
1868 // ********** Code for EnvMap ************** 1868 // ********** Code for EnvMap **************
1869 function EnvMap(_process) { 1869 function EnvMap(_process) {
1870 this._process = _process; 1870 this._process = _process;
1871 } 1871 }
1872 EnvMap.prototype.$index = function(key) { 1872 EnvMap.prototype.$index = function(key) {
1873 return this._process.env[key]; 1873 return this._process.env[key];
1874 } 1874 }
1875 // ********** Code for ReadableStream ************** 1875 // ********** Code for ReadableStream **************
1876 // ********** Code for WritableStream ************** 1876 // ********** Code for WritableStream **************
1877 $defProp(Object.prototype, '$typeNameOf', function() { 1877 $defProp(Object.prototype, '$typeNameOf', (function() {
1878 var constructor = this.constructor; 1878 function constructorNameWithFallback(obj) {
1879 if (typeof(constructor) == 'function') { 1879 var constructor = obj.constructor;
1880 // The constructor isn't null or undefined at this point. Try 1880 if (typeof(constructor) == 'function') {
1881 // to grab hold of its name. 1881 // The constructor isn't null or undefined at this point. Try
1882 var name = constructor.name; 1882 // to grab hold of its name.
1883 // If the name is a non-empty string, we use that as the type 1883 var name = constructor.name;
1884 // name of this object. On Firefox, we often get 'Object' as 1884 // If the name is a non-empty string, we use that as the type
1885 // the constructor name even for more specialized objects so 1885 // name of this object. On Firefox, we often get 'Object' as
1886 // we have to fall through to the toString() based implementation 1886 // the constructor name even for more specialized objects so
1887 // below in that case. 1887 // we have to fall through to the toString() based implementation
1888 if (name && typeof(name) == 'string' && name != 'Object') return name; 1888 // below in that case.
1889 if (typeof(name) == 'string' && name && name != 'Object') return name;
1890 }
1891 var string = Object.prototype.toString.call(obj);
1892 return string.substring(8, string.length - 1);
1889 } 1893 }
1890 var string = Object.prototype.toString.call(this); 1894
1891 var name = string.substring(8, string.length - 1); 1895 function chrome$typeNameOf() {
1892 if (name == 'Window') { 1896 return this.constructor.name;
1893 name = 'DOMWindow';
1894 } else if (name == 'Document') {
1895 name = 'HTMLDocument';
1896 } else if (name == 'XMLDocument') {
1897 name = 'Document';
1898 } 1897 }
1899 return name; 1898
1900 }); 1899 function firefox$typeNameOf() {
1900 var name = constructorNameWithFallback(this);
1901 if (name == 'Window') return 'DOMWindow';
1902 if (name == 'Document') return 'HTMLDocument';
1903 if (name == 'XMLDocument') return 'Document';
1904 return name;
1905 }
1906
1907 function ie$typeNameOf() {
1908 var name = constructorNameWithFallback(this);
1909 if (name == 'Window') return 'DOMWindow';
1910 // IE calls both HTML and XML documents 'Document', so we check for the
1911 // xmlVersion property, which is the empty string on HTML documents.
1912 if (name == 'Document' && this.xmlVersion) return 'Document';
1913 if (name == 'Document') return 'HTMLDocument';
1914 return name;
1915 }
1916
1917 // If we're not in the browser, we're almost certainly running on v8.
1918 if (typeof(navigator) != 'object') return chrome$typeNameOf;
1919
1920 var userAgent = navigator.userAgent;
1921 if (/Chrome/.test(userAgent)) return chrome$typeNameOf;
1922 if (/Firefox/.test(userAgent)) return firefox$typeNameOf;
1923 if (/MSIE/.test(userAgent)) return ie$typeNameOf;
1924 return function() { return constructorNameWithFallback(this); };
1925 })());
1901 function $dynamic(name) { 1926 function $dynamic(name) {
1902 var f = Object.prototype[name]; 1927 var f = Object.prototype[name];
1903 if (f && f.methods) return f.methods; 1928 if (f && f.methods) return f.methods;
1904 1929
1905 var methods = {}; 1930 var methods = {};
1906 if (f) methods.Object = f; 1931 if (f) methods.Object = f;
1907 function $dynamicBind() { 1932 function $dynamicBind() {
1908 // Find the target method 1933 // Find the target method
1909 var obj = this; 1934 var obj = this;
1910 var tag = obj.$typeNameOf(); 1935 var tag = obj.$typeNameOf();
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after
3076 } 3101 }
3077 CoreJs.prototype.ensureDynamicSetMetadata = function() { 3102 CoreJs.prototype.ensureDynamicSetMetadata = function() {
3078 if (this._generatedDynamicSetMetadata) return; 3103 if (this._generatedDynamicSetMetadata) return;
3079 this._generatedDynamicSetMetadata = true; 3104 this._generatedDynamicSetMetadata = true;
3080 this.writer.writeln("function $dynamicSetMetadata(inputTable) {\n // TODO: De al with light isolates.\n var table = [];\n for (var i = 0; i < inputTable.len gth; i++) {\n var tag = inputTable[i][0];\n var tags = inputTable[i][1];\n var map = {};\n var tagNames = tags.split('|');\n for (var j = 0; j < tagNames.length; j++) {\n map[tagNames[j]] = true;\n }\n table.push({ tag: tag, tags: tags, map: map});\n }\n $dynamicMetadata = table;\n}\n"); 3105 this.writer.writeln("function $dynamicSetMetadata(inputTable) {\n // TODO: De al with light isolates.\n var table = [];\n for (var i = 0; i < inputTable.len gth; i++) {\n var tag = inputTable[i][0];\n var tags = inputTable[i][1];\n var map = {};\n var tagNames = tags.split('|');\n for (var j = 0; j < tagNames.length; j++) {\n map[tagNames[j]] = true;\n }\n table.push({ tag: tag, tags: tags, map: map});\n }\n $dynamicMetadata = table;\n}\n");
3081 } 3106 }
3082 CoreJs.prototype.ensureTypeNameOf = function() { 3107 CoreJs.prototype.ensureTypeNameOf = function() {
3083 if (this._generatedTypeNameOf) return; 3108 if (this._generatedTypeNameOf) return;
3084 this._generatedTypeNameOf = true; 3109 this._generatedTypeNameOf = true;
3085 this.ensureDefProp(); 3110 this.ensureDefProp();
3086 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 g rab 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 Firef ox, we often get 'Object' as\n // the constructor name even for more speciali zed objects so\n // we have to fall through to the toString() based implement ation\n // below in that case.\n if (name && typeof(name) == 'string' && n ame != 'Object') return name;\n }\n var string = Object.prototype.toString.cal l(this);\n var name = string.substring(8, string.length - 1);\n if (name == 'W indow') {\n name = 'DOMWindow';\n } else if (name == 'Document') {\n name = 'HTMLDocument';\n } else if (name == 'XMLDocument') {\n name = 'Document' ;\n }\n return name;\n});"); 3111 this.writer.writeln("$defProp(Object.prototype, '$typeNameOf', (function() {\n function constructorNameWithFallback(obj) {\n var constructor = obj.constru ctor;\n if (typeof(constructor) == 'function') {\n // The constructor is n'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 'O bject' 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 (typeof(name) == 'string' && name && name != 'Obj ect') return name;\n }\n var string = Object.prototype.toString.call(obj); \n return string.substring(8, string.length - 1);\n }\n\n function chrome$t ypeNameOf() {\n return this.constructor.name;\n }\n\n function firefox$type NameOf() {\n var name = constructorNameWithFallback(this);\n if (name == ' Window') return 'DOMWindow';\n if (name == 'Document') return 'HTMLDocument'; \n if (name == 'XMLDocument') return 'Document';\n return name;\n }\n\n function ie$typeNameOf() {\n var name = constructorNameWithFallback(this);\n if (name == 'Window') return 'DOMWindow';\n // IE calls both HTML and XML documents 'Document', so we check for the\n // xmlVersion property, which is the empty string on HTML documents.\n if (name == 'Document' && this.xmlVersi on) return 'Document';\n if (name == 'Document') return 'HTMLDocument';\n return name;\n }\n\n // If we're not in the browser, we're almost certainly ru nning on v8.\n if (typeof(navigator) != 'object') return chrome$typeNameOf;\n\n var userAgent = navigator.userAgent;\n if (/Chrome/.test(userAgent)) return c hrome$typeNameOf;\n if (/Firefox/.test(userAgent)) return firefox$typeNameOf;\n if (/MSIE/.test(userAgent)) return ie$typeNameOf;\n return function() { retur n constructorNameWithFallback(this); };\n})());");
3087 } 3112 }
3088 CoreJs.prototype.ensureInheritsHelper = function() { 3113 CoreJs.prototype.ensureInheritsHelper = function() {
3089 if (this._generatedInherits) return; 3114 if (this._generatedInherits) return;
3090 this._generatedInherits = true; 3115 this._generatedInherits = true;
3091 this.writer.writeln("/** Implements extends for Dart classes on JavaScript pro totypes. */\nfunction $inherits(child, parent) {\n if (child.prototype.__proto_ _) {\n child.prototype.__proto__ = parent.prototype;\n } else {\n functio n tmp() {};\n tmp.prototype = parent.prototype;\n child.prototype = new tm p();\n child.prototype.constructor = child;\n }\n}"); 3116 this.writer.writeln("/** Implements extends for Dart classes on JavaScript pro totypes. */\nfunction $inherits(child, parent) {\n if (child.prototype.__proto_ _) {\n child.prototype.__proto__ = parent.prototype;\n } else {\n functio n tmp() {};\n tmp.prototype = parent.prototype;\n child.prototype = new tm p();\n child.prototype.constructor = child;\n }\n}");
3092 } 3117 }
3093 CoreJs.prototype.ensureDefProp = function() { 3118 CoreJs.prototype.ensureDefProp = function() {
3094 if (this._generatedDefProp) return; 3119 if (this._generatedDefProp) return;
3095 this._generatedDefProp = true; 3120 this._generatedDefProp = true;
3096 this.writer.writeln("function $defProp(obj, prop, value) {\n Object.definePro perty(obj, prop,\n {value: value, enumerable: false, writable: true, config urable: true});\n}"); 3121 this.writer.writeln("function $defProp(obj, prop, value) {\n Object.definePro perty(obj, prop,\n {value: value, enumerable: false, writable: true, config urable: true});\n}");
(...skipping 11726 matching lines...) Expand 10 before | Expand all | Expand 10 after
14823 var const$0002 = Object.create(EmptyQueueException.prototype, {}); 14848 var const$0002 = Object.create(EmptyQueueException.prototype, {});
14824 var const$0006 = Object.create(IllegalAccessException.prototype, {}); 14849 var const$0006 = Object.create(IllegalAccessException.prototype, {});
14825 var const$0007 = ImmutableList.ImmutableList$from$factory([]); 14850 var const$0007 = ImmutableList.ImmutableList$from$factory([]);
14826 var const$0009 = new JSSyntaxRegExp("^[a-zA-Z]:/"); 14851 var const$0009 = new JSSyntaxRegExp("^[a-zA-Z]:/");
14827 var const$0010 = ImmutableList.ImmutableList$from$factory(["__PROTO__", "prototy pe", "constructor"]); 14852 var const$0010 = ImmutableList.ImmutableList$from$factory(["__PROTO__", "prototy pe", "constructor"]);
14828 var const$0011 = ImmutableList.ImmutableList$from$factory(["NaN", "Infinity", "u ndefined", "eval", "parseInt", "parseFloat", "isNan", "isFinite", "decodeURI", " decodeURIComponent", "encodeURI", "encodeURIComponent", "Object", "Function", "A rray", "String", "Boolean", "Number", "Date", "RegExp", "Error", "EvalError", "R angeError", "ReferenceError", "SyntaxError", "TypeError", "URIError", "Math", "a rguments", "escape", "unescape", "applicationCache", "closed", "Components", "co ntent", "controllers", "crypto", "defaultStatus", "dialogArguments", "directorie s", "document", "frameElement", "frames", "fullScreen", "globalStorage", "histor y", "innerHeight", "innerWidth", "length", "location", "locationbar", "localStor age", "menubar", "mozInnerScreenX", "mozInnerScreenY", "mozScreenPixelsPerCssPix el", "name", "navigator", "opener", "outerHeight", "outerWidth", "pageXOffset", "pageYOffset", "parent", "personalbar", "pkcs11", "returnValue", "screen", "scro llbars", "scrollMaxX", "scrollMaxY", "self", "sessionStorage", "sidebar", "statu s", "statusbar", "toolbar", "top", "window", "alert", "addEventListener", "atob" , "back", "blur", "btoa", "captureEvents", "clearInterval", "clearTimeout", "clo se", "confirm", "disableExternalCapture", "dispatchEvent", "dump", "enableExtern alCapture", "escape", "find", "focus", "forward", "GeckoActiveXObject", "getAtte ntion", "getAttentionWithCycleCount", "getComputedStyle", "getSelection", "home" , "maximize", "minimize", "moveBy", "moveTo", "open", "openDialog", "postMessage ", "print", "prompt", "QueryInterface", "releaseEvents", "removeEventListener", "resizeBy", "resizeTo", "restore", "routeEvent", "scroll", "scrollBy", "scrollBy Lines", "scrollByPages", "scrollTo", "setInterval", "setResizeable", "setTimeout ", "showModalDialog", "sizeToContent", "stop", "uuescape", "updateCommands", "XP CNativeWrapper", "XPCSafeJSOjbectWrapper", "onabort", "onbeforeunload", "onchang e", "onclick", "onclose", "oncontextmenu", "ondragdrop", "onerror", "onfocus", " onhashchange", "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "o nmousemove", "onmouseout", "onmouseover", "onmouseup", "onmozorientation", "onpa int", "onreset", "onresize", "onscroll", "onselect", "onsubmit", "onunload", "on touchcancel", "ontouchend", "ontouchmove", "ontouchstart", "ongesturestart", "on gesturechange", "ongestureend", "uneval", "getPrototypeOf", "let", "yield", "abs tract", "int", "short", "boolean", "interface", "static", "byte", "long", "char" , "final", "native", "synchronized", "float", "package", "throws", "goto", "priv ate", "transient", "implements", "protected", "volatile", "double", "public", "a ttachEvent", "clientInformation", "clipboardData", "createPopup", "dialogHeight" , "dialogLeft", "dialogTop", "dialogWidth", "onafterprint", "onbeforedeactivate" , "onbeforeprint", "oncontrolselect", "ondeactivate", "onhelp", "onresizeend", " event", "external", "Debug", "Enumerator", "Global", "Image", "ActiveXObject", " VBArray", "Components", "toString", "getClass", "constructor", "prototype", "val ueOf", "Anchor", "Applet", "Attr", "Canvas", "CanvasGradient", "CanvasPattern", "CanvasRenderingContext2D", "CDATASection", "CharacterData", "Comment", "CSS2Pro perties", "CSSRule", "CSSStyleSheet", "Document", "DocumentFragment", "DocumentT ype", "DOMException", "DOMImplementation", "DOMParser", "Element", "Event", "Ext ernalInterface", "FlashPlayer", "Form", "Frame", "History", "HTMLCollection", "H TMLDocument", "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", "TextAre a", "UIEvent", "Window", "XMLHttpRequest", "XMLSerializer", "XPathException", "X PathResult", "XSLTProcessor", "java", "Packages", "netscape", "sun", "JavaObject ", "JavaClass", "JavaArray", "JavaMember", "$wnd", "$doc", "$entry", "$moduleNam e", "$moduleBase", "$gwt_version", "$sessionId", "$stack", "$stackDepth", "$loca tion", "call"]); 14853 var const$0011 = ImmutableList.ImmutableList$from$factory(["NaN", "Infinity", "u ndefined", "eval", "parseInt", "parseFloat", "isNan", "isFinite", "decodeURI", " decodeURIComponent", "encodeURI", "encodeURIComponent", "Object", "Function", "A rray", "String", "Boolean", "Number", "Date", "RegExp", "Error", "EvalError", "R angeError", "ReferenceError", "SyntaxError", "TypeError", "URIError", "Math", "a rguments", "escape", "unescape", "applicationCache", "closed", "Components", "co ntent", "controllers", "crypto", "defaultStatus", "dialogArguments", "directorie s", "document", "frameElement", "frames", "fullScreen", "globalStorage", "histor y", "innerHeight", "innerWidth", "length", "location", "locationbar", "localStor age", "menubar", "mozInnerScreenX", "mozInnerScreenY", "mozScreenPixelsPerCssPix el", "name", "navigator", "opener", "outerHeight", "outerWidth", "pageXOffset", "pageYOffset", "parent", "personalbar", "pkcs11", "returnValue", "screen", "scro llbars", "scrollMaxX", "scrollMaxY", "self", "sessionStorage", "sidebar", "statu s", "statusbar", "toolbar", "top", "window", "alert", "addEventListener", "atob" , "back", "blur", "btoa", "captureEvents", "clearInterval", "clearTimeout", "clo se", "confirm", "disableExternalCapture", "dispatchEvent", "dump", "enableExtern alCapture", "escape", "find", "focus", "forward", "GeckoActiveXObject", "getAtte ntion", "getAttentionWithCycleCount", "getComputedStyle", "getSelection", "home" , "maximize", "minimize", "moveBy", "moveTo", "open", "openDialog", "postMessage ", "print", "prompt", "QueryInterface", "releaseEvents", "removeEventListener", "resizeBy", "resizeTo", "restore", "routeEvent", "scroll", "scrollBy", "scrollBy Lines", "scrollByPages", "scrollTo", "setInterval", "setResizeable", "setTimeout ", "showModalDialog", "sizeToContent", "stop", "uuescape", "updateCommands", "XP CNativeWrapper", "XPCSafeJSOjbectWrapper", "onabort", "onbeforeunload", "onchang e", "onclick", "onclose", "oncontextmenu", "ondragdrop", "onerror", "onfocus", " onhashchange", "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "o nmousemove", "onmouseout", "onmouseover", "onmouseup", "onmozorientation", "onpa int", "onreset", "onresize", "onscroll", "onselect", "onsubmit", "onunload", "on touchcancel", "ontouchend", "ontouchmove", "ontouchstart", "ongesturestart", "on gesturechange", "ongestureend", "uneval", "getPrototypeOf", "let", "yield", "abs tract", "int", "short", "boolean", "interface", "static", "byte", "long", "char" , "final", "native", "synchronized", "float", "package", "throws", "goto", "priv ate", "transient", "implements", "protected", "volatile", "double", "public", "a ttachEvent", "clientInformation", "clipboardData", "createPopup", "dialogHeight" , "dialogLeft", "dialogTop", "dialogWidth", "onafterprint", "onbeforedeactivate" , "onbeforeprint", "oncontrolselect", "ondeactivate", "onhelp", "onresizeend", " event", "external", "Debug", "Enumerator", "Global", "Image", "ActiveXObject", " VBArray", "Components", "toString", "getClass", "constructor", "prototype", "val ueOf", "Anchor", "Applet", "Attr", "Canvas", "CanvasGradient", "CanvasPattern", "CanvasRenderingContext2D", "CDATASection", "CharacterData", "Comment", "CSS2Pro perties", "CSSRule", "CSSStyleSheet", "Document", "DocumentFragment", "DocumentT ype", "DOMException", "DOMImplementation", "DOMParser", "Element", "Event", "Ext ernalInterface", "FlashPlayer", "Form", "Frame", "History", "HTMLCollection", "H TMLDocument", "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", "TextAre a", "UIEvent", "Window", "XMLHttpRequest", "XMLSerializer", "XPathException", "X PathResult", "XSLTProcessor", "java", "Packages", "netscape", "sun", "JavaObject ", "JavaClass", "JavaArray", "JavaMember", "$wnd", "$doc", "$entry", "$moduleNam e", "$moduleBase", "$gwt_version", "$sessionId", "$stack", "$stackDepth", "$loca tion", "call"]);
14829 var const$0012 = ImmutableList.ImmutableList$from$factory(["break", "delete", "f unction", "return", "typeof", "case", "do", "if", "switch", "var", "catch", "els e", "in", "this", "void", "continue", "false", "instanceof", "throw", "while", " debugger", "finally", "new", "true", "with", "default", "for", "null", "try", "a bstract", "double", "goto", "native", "static", "boolean", "enum", "implements", "package", "super", "byte", "export", "import", "private", "synchronized", "cha r", "extends", "int", "protected", "throws", "class", "final", "interface", "pub lic", "transient", "const", "float", "long", "short", "volatile"]); 14854 var const$0012 = ImmutableList.ImmutableList$from$factory(["break", "delete", "f unction", "return", "typeof", "case", "do", "if", "switch", "var", "catch", "els e", "in", "this", "void", "continue", "false", "instanceof", "throw", "while", " debugger", "finally", "new", "true", "with", "default", "for", "null", "try", "a bstract", "double", "goto", "native", "static", "boolean", "enum", "implements", "package", "super", "byte", "export", "import", "private", "synchronized", "cha r", "extends", "int", "protected", "throws", "class", "final", "interface", "pub lic", "transient", "const", "float", "long", "short", "volatile"]);
14830 var $globals = {}; 14855 var $globals = {};
14831 $static_init(); 14856 $static_init();
14832 main(); 14857 main();
OLDNEW
« 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