OLD | NEW |
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 5565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5576 } | 5576 } |
5577 else { | 5577 else { |
5578 var members = this._privateMembers.$index(member.name); | 5578 var members = this._privateMembers.$index(member.name); |
5579 if ($eq$(members)) { | 5579 if ($eq$(members)) { |
5580 members = new MemberSet(member, true); | 5580 members = new MemberSet(member, true); |
5581 this._privateMembers.$setindex(member.name, members); | 5581 this._privateMembers.$setindex(member.name, members); |
5582 } | 5582 } |
5583 else { | 5583 else { |
5584 members.add(member); | 5584 members.add(member); |
5585 } | 5585 } |
5586 this._makePrivateMembersUnique(member, members); | |
5587 } | 5586 } |
5588 } | 5587 } |
5589 else { | 5588 else { |
5590 $globals.world._addMember(member); | 5589 $globals.world._addMember(member); |
5591 } | 5590 } |
5592 } | 5591 } |
5593 Library.prototype._makePrivateMembersUnique = function(member, members) { | |
5594 if (members.jsnameUnique) { | |
5595 member._jsname = members.jsname; | |
5596 return; | |
5597 } | |
5598 var name = members.name; | |
5599 var $$list = $globals.world.libraries.getValues(); | |
5600 for (var $$i = $$list.iterator(); $$i.hasNext(); ) { | |
5601 var lib = $$i.next(); | |
5602 if ((null == lib ? null != (this) : lib !== this) && lib.get$_privateMembers
().containsKey(name)) { | |
5603 var uniqueName = ("_" + this.get$jsname() + members.jsname); | |
5604 members.jsname = uniqueName; | |
5605 members.jsnameUnique = true; | |
5606 members.members.forEach((function (uniqueName, each) { | |
5607 each.set$_jsname(uniqueName); | |
5608 }).bind(null, uniqueName) | |
5609 ); | |
5610 return; | |
5611 } | |
5612 } | |
5613 } | |
5614 Library.prototype.getOrAddFunctionType = function(enclosingElement, name, func,
data) { | 5592 Library.prototype.getOrAddFunctionType = function(enclosingElement, name, func,
data) { |
5615 var def = new FunctionTypeDefinition(func, null, func.span); | 5593 var def = new FunctionTypeDefinition(func, null, func.span); |
5616 var type = new DefinedType(name, this, def, false); | 5594 var type = new DefinedType(name, this, def, false); |
5617 type.addMethod(":call", func); | 5595 type.addMethod(":call", func); |
5618 var m = type.get$members().$index(":call"); | 5596 var m = type.get$members().$index(":call"); |
5619 m.set$enclosingElement(enclosingElement); | 5597 m.set$enclosingElement(enclosingElement); |
5620 m.resolve(); | 5598 m.resolve(); |
5621 m.set$_methodData(data); | 5599 m.set$_methodData(data); |
5622 type.set$interfaces([$globals.world.functionType]); | 5600 type.set$interfaces([$globals.world.functionType]); |
5623 return type; | 5601 return type; |
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6901 return this.factories.getValues().every((function (constructors) { | 6879 return this.factories.getValues().every((function (constructors) { |
6902 return constructors.isEmpty(); | 6880 return constructors.isEmpty(); |
6903 }) | 6881 }) |
6904 ); | 6882 ); |
6905 } | 6883 } |
6906 // ********** Code for MemberSet ************** | 6884 // ********** Code for MemberSet ************** |
6907 function MemberSet(member, isVar) { | 6885 function MemberSet(member, isVar) { |
6908 this.jsname = member.get$jsname(); | 6886 this.jsname = member.get$jsname(); |
6909 this.name = member.name; | 6887 this.name = member.name; |
6910 this._preparedForSet = false; | 6888 this._preparedForSet = false; |
6911 this.jsnameUnique = false; | |
6912 this.isVar = isVar; | 6889 this.isVar = isVar; |
6913 this.members = [member]; | 6890 this.members = [member]; |
6914 } | 6891 } |
6915 MemberSet.prototype.get$name = function() { return this.name; }; | 6892 MemberSet.prototype.get$name = function() { return this.name; }; |
6916 MemberSet.prototype.get$members = function() { return this.members; }; | 6893 MemberSet.prototype.get$members = function() { return this.members; }; |
6917 MemberSet.prototype.get$isVar = function() { return this.isVar; }; | 6894 MemberSet.prototype.get$isVar = function() { return this.isVar; }; |
6918 MemberSet.prototype.get$jsname = function() { return this.jsname; }; | 6895 MemberSet.prototype.get$jsname = function() { return this.jsname; }; |
| 6896 MemberSet.prototype.set$jsname = function(value) { return this.jsname = value; }
; |
6919 MemberSet.prototype.toString = function() { | 6897 MemberSet.prototype.toString = function() { |
6920 return ("" + this.name + ":" + this.members.get$length()); | 6898 return ("" + this.name + ":" + this.members.get$length()); |
6921 } | 6899 } |
6922 MemberSet.prototype.add = function(member) { | 6900 MemberSet.prototype.add = function(member) { |
6923 this.members.add(member); | 6901 this.members.add(member); |
6924 } | 6902 } |
6925 MemberSet.prototype.get$isOperator = function() { | 6903 MemberSet.prototype.get$isOperator = function() { |
6926 return this.members.$index((0)).get$isOperator(); | 6904 return this.members.$index((0)).get$isOperator(); |
6927 } | 6905 } |
6928 MemberSet.prototype.get$treatAsField = function() { | 6906 MemberSet.prototype.get$treatAsField = function() { |
(...skipping 7252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14181 } | 14159 } |
14182 return res; | 14160 return res; |
14183 } | 14161 } |
14184 World.prototype.runCompilationPhases = function() { | 14162 World.prototype.runCompilationPhases = function() { |
14185 var $this = this; // closure support | 14163 var $this = this; // closure support |
14186 var lib = this.withTiming("first pass", (function () { | 14164 var lib = this.withTiming("first pass", (function () { |
14187 return $this.processDartScript(); | 14165 return $this.processDartScript(); |
14188 }) | 14166 }) |
14189 ); | 14167 ); |
14190 this.withTiming("resolve top level", this.get$resolveAll()); | 14168 this.withTiming("resolve top level", this.get$resolveAll()); |
| 14169 this.withTiming("privatization", (function () { |
| 14170 $this.makePrivateMembersUnique(lib); |
| 14171 }) |
| 14172 ); |
14191 if ($globals.experimentalAwaitPhase != null) { | 14173 if ($globals.experimentalAwaitPhase != null) { |
14192 this.withTiming("await translation", to$call$0($globals.experimentalAwaitPha
se)); | 14174 this.withTiming("await translation", to$call$0($globals.experimentalAwaitPha
se)); |
14193 } | 14175 } |
14194 this.withTiming("analyze pass", (function () { | 14176 this.withTiming("analyze pass", (function () { |
14195 $this.analyzeCode(lib); | 14177 $this.analyzeCode(lib); |
14196 }) | 14178 }) |
14197 ); | 14179 ); |
14198 if ($globals.options.checkOnly) return; | 14180 if ($globals.options.checkOnly) return; |
14199 this.withTiming("generate code", (function () { | 14181 this.withTiming("generate code", (function () { |
14200 $this.generateCode(lib); | 14182 $this.generateCode(lib); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14266 } | 14248 } |
14267 var $$list = this.libraries.getValues(); | 14249 var $$list = this.libraries.getValues(); |
14268 for (var $$i = $$list.iterator(); $$i.hasNext(); ) { | 14250 for (var $$i = $$list.iterator(); $$i.hasNext(); ) { |
14269 var lib = $$i.next(); | 14251 var lib = $$i.next(); |
14270 lib.postResolveChecks(); | 14252 lib.postResolveChecks(); |
14271 } | 14253 } |
14272 } | 14254 } |
14273 World.prototype.get$resolveAll = function() { | 14255 World.prototype.get$resolveAll = function() { |
14274 return this.resolveAll.bind(this); | 14256 return this.resolveAll.bind(this); |
14275 } | 14257 } |
| 14258 World.prototype.makePrivateMembersUnique = function(rootLib) { |
| 14259 var usedNames = new HashSetImplementation_dart_core_String(); |
| 14260 function process(lib) { |
| 14261 var $$list = lib.get$_privateMembers().getKeys(); |
| 14262 for (var $$i = $$list.iterator(); $$i.hasNext(); ) { |
| 14263 var name = $$i.next(); |
| 14264 if (usedNames.contains$1(name)) { |
| 14265 var members = lib.get$_privateMembers().$index(name); |
| 14266 var uniqueName = ("_" + lib.get$jsname() + members.get$jsname()); |
| 14267 members.set$jsname(uniqueName); |
| 14268 var $list0 = members.get$members(); |
| 14269 for (var $i0 = $list0.iterator(); $i0.hasNext(); ) { |
| 14270 var member = $i0.next(); |
| 14271 member.set$_jsname(uniqueName); |
| 14272 } |
| 14273 } |
| 14274 else { |
| 14275 usedNames.add(name); |
| 14276 } |
| 14277 } |
| 14278 } |
| 14279 var visited = new HashSetImplementation_Library(); |
| 14280 function visit(lib) { |
| 14281 if (visited.contains$1(lib)) return; |
| 14282 visited.add(lib); |
| 14283 process(lib); |
| 14284 var $$list = lib.get$imports(); |
| 14285 for (var $$i = $$list.iterator(); $$i.hasNext(); ) { |
| 14286 var import_ = $$i.next(); |
| 14287 visit(import_.get$library()); |
| 14288 } |
| 14289 } |
| 14290 visit(rootLib); |
| 14291 } |
14276 World.prototype.findMainMethod = function(lib) { | 14292 World.prototype.findMainMethod = function(lib) { |
14277 var main = lib.lookup("main", lib.get$span()); | 14293 var main = lib.lookup("main", lib.get$span()); |
14278 if ($eq$(main)) { | 14294 if ($eq$(main)) { |
14279 if (!$globals.options.checkOnly) this.fatal("no main method specified"); | 14295 if (!$globals.options.checkOnly) this.fatal("no main method specified"); |
14280 } | 14296 } |
14281 return main; | 14297 return main; |
14282 } | 14298 } |
14283 World.prototype.analyzeCode = function(lib) { | 14299 World.prototype.analyzeCode = function(lib) { |
14284 this.gen = new WorldGenerator(this.findMainMethod(lib), new CodeWriter()); | 14300 this.gen = new WorldGenerator(this.findMainMethod(lib), new CodeWriter()); |
14285 this.gen.analyze(); | 14301 this.gen.analyze(); |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14889 var const$0002 = Object.create(EmptyQueueException.prototype, {}); | 14905 var const$0002 = Object.create(EmptyQueueException.prototype, {}); |
14890 var const$0006 = Object.create(IllegalAccessException.prototype, {}); | 14906 var const$0006 = Object.create(IllegalAccessException.prototype, {}); |
14891 var const$0007 = ImmutableList.ImmutableList$from$factory([]); | 14907 var const$0007 = ImmutableList.ImmutableList$from$factory([]); |
14892 var const$0009 = new JSSyntaxRegExp("^[a-zA-Z]:/"); | 14908 var const$0009 = new JSSyntaxRegExp("^[a-zA-Z]:/"); |
14893 var const$0010 = ImmutableList.ImmutableList$from$factory(["__PROTO__", "prototy
pe", "constructor"]); | 14909 var const$0010 = ImmutableList.ImmutableList$from$factory(["__PROTO__", "prototy
pe", "constructor"]); |
14894 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"]); | 14910 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"]); |
14895 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"]); | 14911 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"]); |
14896 var $globals = {}; | 14912 var $globals = {}; |
14897 $static_init(); | 14913 $static_init(); |
14898 main(); | 14914 main(); |
OLD | NEW |