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

Side by Side Diff: frog/minfrog

Issue 9877008: Move the DOMContentLoaded logic into the generated JavaScript (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
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 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1603 this.clear(); 1603 this.clear();
1604 this.add(content); 1604 this.add(content);
1605 } 1605 }
1606 StringBufferImpl.prototype.get$length = function() { 1606 StringBufferImpl.prototype.get$length = function() {
1607 return this._length; 1607 return this._length;
1608 } 1608 }
1609 StringBufferImpl.prototype.isEmpty = function() { 1609 StringBufferImpl.prototype.isEmpty = function() {
1610 return this._length == (0); 1610 return this._length == (0);
1611 } 1611 }
1612 StringBufferImpl.prototype.add = function(obj) { 1612 StringBufferImpl.prototype.add = function(obj) {
1613 var str = obj.toString$0(); 1613 var str = obj.toString();
1614 if (null == str || str.isEmpty()) return this; 1614 if (null == str || str.isEmpty()) return this;
1615 this._buffer.add(str); 1615 this._buffer.add(str);
1616 this._length = this._length + str.length; 1616 this._length = this._length + str.length;
1617 return this; 1617 return this;
1618 } 1618 }
1619 StringBufferImpl.prototype.addAll = function(objects) { 1619 StringBufferImpl.prototype.addAll = function(objects) {
1620 for (var $$i = objects.iterator(); $$i.hasNext(); ) { 1620 for (var $$i = objects.iterator(); $$i.hasNext(); ) {
1621 var obj = $$i.next(); 1621 var obj = $$i.next();
1622 this.add(obj); 1622 this.add(obj);
1623 } 1623 }
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after
3376 var isolateMain = $globals.world.isolatelib.lookup("startRootIsolate", this. main.get$span()); 3376 var isolateMain = $globals.world.isolatelib.lookup("startRootIsolate", this. main.get$span());
3377 mainCall = isolateMain.invoke(this.mainContext, null, new TypeValue($globals .world.isolatelib.topType, this.main.get$span()), new Arguments(null, [this.main ._get(this.mainContext, this.main.definition, null)])); 3377 mainCall = isolateMain.invoke(this.mainContext, null, new TypeValue($globals .world.isolatelib.topType, this.main.get$span()), new Arguments(null, [this.main ._get(this.mainContext, this.main.definition, null)]));
3378 } 3378 }
3379 this.typeEmittedTests = new HashMapImplementation_Type$Map_dart_core_String$bo ol(); 3379 this.typeEmittedTests = new HashMapImplementation_Type$Map_dart_core_String$bo ol();
3380 this.writeTypes($globals.world.coreimpl); 3380 this.writeTypes($globals.world.coreimpl);
3381 this.writeTypes($globals.world.corelib); 3381 this.writeTypes($globals.world.corelib);
3382 this.writeTypes(this.main.declaringType.get$library()); 3382 this.writeTypes(this.main.declaringType.get$library());
3383 if (this._mixins != null) this.writer.write(this._mixins.get$text()); 3383 if (this._mixins != null) this.writer.write(this._mixins.get$text());
3384 this.writeDynamicDispatchMetadata(); 3384 this.writeDynamicDispatchMetadata();
3385 this.writeGlobals(); 3385 this.writeGlobals();
3386 this.writer.writeln(("" + mainCall.get$code() + ";")); 3386 this.writer.writeln("if (typeof window != 'undefined' && window.addEventListen er) {");
3387 this.writer.writeln(" window.addEventListener('DOMContentLoaded', function(e) {");
3388 this.writer.writeln((" " + mainCall.get$code() + ";"));
3389 this.writer.writeln(" });");
3390 this.writer.writeln("} else {");
3391 this.writer.writeln((" " + mainCall.get$code() + ";"));
3392 this.writer.writeln("}");
3387 } 3393 }
3388 WorldGenerator.prototype.markLibrariesUsed = function(libs) { 3394 WorldGenerator.prototype.markLibrariesUsed = function(libs) {
3389 return this.getAllTypes(libs).forEach(this.get$markTypeUsed()); 3395 return this.getAllTypes(libs).forEach(this.get$markTypeUsed());
3390 } 3396 }
3391 WorldGenerator.prototype.markTypeUsed = function(type) { 3397 WorldGenerator.prototype.markTypeUsed = function(type) {
3392 if (!type.get$isClass()) return; 3398 if (!type.get$isClass()) return;
3393 type.markUsed(); 3399 type.markUsed();
3394 type.isTested = true; 3400 type.isTested = true;
3395 type.isTested = !type.get$isTop() && !(type.get$isNative() && type.get$members ().getValues().every((function (m) { 3401 type.isTested = !type.get$isTop() && !(type.get$isNative() && type.get$members ().getValues().every((function (m) {
3396 return m.get$isStatic() && !m.get$isFactory(); 3402 return m.get$isStatic() && !m.get$isFactory();
(...skipping 11638 matching lines...) Expand 10 before | Expand all | Expand 10 after
15035 var const$0001 = Object.create(NoMoreElementsException.prototype, {}); 15041 var const$0001 = Object.create(NoMoreElementsException.prototype, {});
15036 var const$0002 = Object.create(EmptyQueueException.prototype, {}); 15042 var const$0002 = Object.create(EmptyQueueException.prototype, {});
15037 var const$0006 = Object.create(IllegalAccessException.prototype, {}); 15043 var const$0006 = Object.create(IllegalAccessException.prototype, {});
15038 var const$0007 = ImmutableList.ImmutableList$from$factory([]); 15044 var const$0007 = ImmutableList.ImmutableList$from$factory([]);
15039 var const$0009 = new JSSyntaxRegExp("^[a-zA-Z]:/"); 15045 var const$0009 = new JSSyntaxRegExp("^[a-zA-Z]:/");
15040 var const$0010 = ImmutableList.ImmutableList$from$factory(["__PROTO__", "prototy pe", "constructor"]); 15046 var const$0010 = ImmutableList.ImmutableList$from$factory(["__PROTO__", "prototy pe", "constructor"]);
15041 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"]); 15047 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"]);
15042 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"]); 15048 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"]);
15043 var $globals = {}; 15049 var $globals = {};
15044 $static_init(); 15050 $static_init();
15045 main(); 15051 if (typeof window != 'undefined' && window.addEventListener) {
15052 window.addEventListener('DOMContentLoaded', function(e) {
15053 main();
15054 });
15055 } else {
15056 main();
15057 }
OLDNEW
« frog/gen.dart ('K') | « frog/gen.dart ('k') | lib/compiler/implementation/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698