Skip to content

Instantly share code, notes, and snippets.

@claudiodangelis
Created August 3, 2014 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save claudiodangelis/22ed749ba20d556e5f13 to your computer and use it in GitHub Desktop.
Save claudiodangelis/22ed749ba20d556e5f13 to your computer and use it in GitHub Desktop.
// Generated by dart2js, the Dart to JavaScript compiler version: 1.5.3.
(function($){function dart(){this.x=0}var A=new dart
delete A.x
var B=new dart
delete B.x
var C=new dart
delete C.x
var D=new dart
delete D.x
var E=new dart
delete E.x
var F=new dart
delete F.x
var G=new dart
delete G.x
var H=new dart
delete H.x
var J=new dart
delete J.x
var K=new dart
delete K.x
var L=new dart
delete L.x
var M=new dart
delete M.x
var N=new dart
delete N.x
var O=new dart
delete O.x
var P=new dart
delete P.x
var Q=new dart
delete Q.x
var R=new dart
delete R.x
var S=new dart
delete S.x
var T=new dart
delete T.x
var U=new dart
delete U.x
var V=new dart
delete V.x
var W=new dart
delete W.x
var X=new dart
delete X.x
var Y=new dart
delete Y.x
var Z=new dart
delete Z.x
function I(){}
init()
$=I.p
;(function(a){"use strict"
function map(b){b={x:b}
delete b.x
return b}function processStatics(a3){for(var h in a3){if(!u.call(a3,h))continue
if(h==="^")continue
var g=a3[h]
var f=h.substring(0,1)
var e
if(f==="+"){v[e]=h.substring(1)
var d=a3[h]
if(d>0)a3[e].$reflectable=d
if(g&&g.length)init.typeInformation[e]=g}else if(f==="@"){h=h.substring(1)
$[h]["@"]=g}else if(f==="*"){n[e].$defaultValues=g
var c=a3.$methodsWithOptionalArguments
if(!c){a3.$methodsWithOptionalArguments=c={}}c[h]=e}else if(typeof g==="function"){n[e=h]=g
i.push(h)
init.globalFunctions[h]=g}else if(g.constructor===Array){addStubs(n,g,h,true,a3,i)}else{e=h
var b={}
var a0
for(var a1 in g){if(!u.call(g,a1))continue
f=a1.substring(0,1)
if(a1==="static"){processStatics(init.statics[h]=g[a1])}else if(f==="+"){w[a0]=a1.substring(1)
var d=g[a1]
if(d>0)g[a0].$reflectable=d}else if(f==="@"&&a1!=="@"){b[a1.substring(1)]["@"]=g[a1]}else if(f==="*"){b[a0].$defaultValues=g[a1]
var c=b.$methodsWithOptionalArguments
if(!c){b.$methodsWithOptionalArguments=c={}}c[a1]=a0}else{var a2=g[a1]
if(a1!=="^"&&a2!=null&&a2.constructor===Array&&a1!=="<>"){addStubs(b,a2,a1,false,g,[])}else{b[a0=a1]=a2}}}$$[h]=[n,b]
j.push(h)}}}function addStubs(b3,b4,b5,b6,b7,b8){var h,g=[b7[b5]=b3[b5]=h=b4[0]]
h.$stubName=b5
b8.push(b5)
for(var f=0;f<b4.length;f+=2){h=b4[f+1]
if(typeof h!="function")break
h.$stubName=b4[f+2]
g.push(h)
if(h.$stubName){b7[h.$stubName]=b3[h.$stubName]=h
b8.push(h.$stubName)}}for(var e=0;e<g.length;f++,e++){g[e].$callName=b4[f+1]}var d=b4[++f]
b4=b4.slice(++f)
var c=b4[0]
var b=c>>1
var a0=(c&1)===1
var a1=c===3
var a2=c===1
var a3=b4[1]
var a4=a3>>1
var a5=(a3&1)===1
var a6=b+a4!=g[0].length
var a7=b4[2]
var a8=2*a4+b+3
var a9=b4.length>a8
if(d){h=tearOff(g,b4,b6,b5,a6)
b3[b5].$getter=h
h.$getterStub=true
if(b6)init.globalFunctions[b5]=h
b7[d]=b3[d]=h
g.push(h)
if(d)b8.push(d)
h.$stubName=d
h.$callName=null
if(a6)init.interceptedNames[d]=true}if(a9){for(var e=0;e<g.length;e++){g[e].$reflectable=1
g[e].$reflectionInfo=b4}var b0=b6?init.mangledGlobalNames:init.mangledNames
var b1=b4[a8]
var b2=b1
if(d)b0[d]=b2
if(a1){b2+="="}else if(!a2){b2+=":"+b+":"+a4}b0[b5]=b2
g[0].$reflectionName=b2
g[0].$metadataIndex=a8+1
if(a4)b3[b1+"*"]=g[0]}}function tearOffGetterNoCsp(b,c,d,e){return e?new Function("funcs","reflectionInfo","name","H","c","return function tearOff_"+d+z+++"(x) {"+"if (c === null) c = H.qm("+"this, funcs, reflectionInfo, false, [x], name);"+"return new c(this, funcs[0], x, name);"+"}")(b,c,d,H,null):new Function("funcs","reflectionInfo","name","H","c","return function tearOff_"+d+z+++"() {"+"if (c === null) c = H.qm("+"this, funcs, reflectionInfo, false, [], name);"+"return new c(this, funcs[0], null, name);"+"}")(b,c,d,H,null)}function tearOffGetterCsp(b,c,d,e){var h=null
return e?function(f){if(h===null)h=H.qm(this,b,c,false,[f],d)
return new h(this,b[0],f,d)}:function(){if(h===null)h=H.qm(this,b,c,false,[],d)
return new h(this,b[0],null,d)}}function tearOff(b,c,d,e,f){var h
return d?function(){if(h===void 0)h=H.qm(this,b,c,true,[],e).prototype
return h}:y(b,c,e,f)}var z=0
var y=typeof dart_precompiled=="function"?tearOffGetterCsp:tearOffGetterNoCsp
if(!init.libraries)init.libraries=[]
if(!init.mangledNames)init.mangledNames=map()
if(!init.mangledGlobalNames)init.mangledGlobalNames=map()
if(!init.statics)init.statics=map()
if(!init.typeInformation)init.typeInformation=map()
if(!init.globalFunctions)init.globalFunctions=map()
if(!init.interceptedNames)init.interceptedNames=map()
var x=init.libraries
var w=init.mangledNames
var v=init.mangledGlobalNames
var u=Object.prototype.hasOwnProperty
var t=a.length
for(var s=0;s<t;s++){var r=a[s]
var q=r[0]
var p=r[1]
var o=r[2]
var n=r[3]
var m=r[4]
var l=!!r[5]
var k=m&&m["^"]
if(k instanceof Array)k=k[0]
var j=[]
var i=[]
processStatics(m)
x.push([q,p,j,i,o,k,l,n])}})([["","asd.dart",,A,{
"^":"",
E2:function(){P.JS("Ciao Giuseppe")
P.JS("Ciao Claudio")}},1],["dart.core","dart:core",,P,{
"^":"",
JS:function(a){H.qw(a)}}],["dart2js._js_primitives","dart:_js_primitives",,H,{
"^":"",
qw:function(a){if(typeof dartPrint=="function"){dartPrint(a)
return}if(typeof console=="object"&&typeof console.log!="undefined"){console.log(a)
return}if(typeof window=="object")return
if(typeof print=="function"){print(a)
return}throw"Unable to print message: "+String(a)}}],])
$.libraries_to_load = {}
$.yj=0
$.mJ=null
$.P4=null
$.oK=null
init.functionAliases={}
init.metadata=[];$=null
I = I.$finishIsolateConstructor(I)
$=new I()
function convertToFastObject(a){function MyClass(){}MyClass.prototype=a
new MyClass()
return a}
A = convertToFastObject(A)
B = convertToFastObject(B)
C = convertToFastObject(C)
D = convertToFastObject(D)
E = convertToFastObject(E)
F = convertToFastObject(F)
G = convertToFastObject(G)
H = convertToFastObject(H)
J = convertToFastObject(J)
K = convertToFastObject(K)
L = convertToFastObject(L)
M = convertToFastObject(M)
N = convertToFastObject(N)
O = convertToFastObject(O)
P = convertToFastObject(P)
Q = convertToFastObject(Q)
R = convertToFastObject(R)
S = convertToFastObject(S)
T = convertToFastObject(T)
U = convertToFastObject(U)
V = convertToFastObject(V)
W = convertToFastObject(W)
X = convertToFastObject(X)
Y = convertToFastObject(Y)
Z = convertToFastObject(Z)
;(function(a){if(typeof document==="undefined"){a(null)
return}if(document.currentScript){a(document.currentScript)
return}var z=document.scripts
function onLoad(b){for(var x=0;x<z.length;++x){z[x].removeEventListener("load",onLoad,false)}a(b.target)}for(var y=0;y<z.length;++y){z[y].addEventListener("load",onLoad,false)}})(function(a){init.currentScript=a
if(typeof dartMainRunner==="function"){dartMainRunner(A.E2,[])}else{A.E2([])}})
function init(){I.p={}
I.$lazy=function(a,b,c,d,e){var z={}
var y={}
a[c]=z
a[d]=function(){var x=$[c]
try{if(x===z){$[c]=y
try{x=$[c]=e()}finally{if(x===z)if($[c]===y)$[c]=null}}else{if(x===y)H.eQ(b)}return x}finally{$[d]=function(){return this[c]}}}}
I.$finishIsolateConstructor=function(a){var z=a.p
function Isolate(){var y=Object.prototype.hasOwnProperty
for(var x in z)if(y.call(z,x))this[x]=z[x]
function ForceEfficientMap(){}ForceEfficientMap.prototype=this
new ForceEfficientMap()}Isolate.prototype=a.prototype
Isolate.prototype.constructor=Isolate
Isolate.p=z
return Isolate}}
})()
//# sourceMappingURL=out.mini.js.map
//@ sourceMappingURL=out.mini.js.map
class Persona {
final String nome;
Persona(this.nome);
}
main() {
Persona a = new Persona("Giuseppe");
Persona b = new Persona("Claudio");
print("Ciao ${a.nome}");
print("Ciao ${b.nome}");
}
// Generated by dart2js, the Dart to JavaScript compiler version: 1.5.3.
// The code supports the following hooks:
// dartPrint(message):
// if this function is defined it is called instead of the Dart [print]
// method.
//
// dartMainRunner(main, args):
// if this function is defined, the Dart [main] method will not be invoked
// directly. Instead, a closure that will invoke [main], and its arguments
// [args] is passed to [dartMainRunner].
(function($) {
function dart(){ this.x = 0 }var A = new dart;
delete A.x;
var B = new dart;
delete B.x;
var C = new dart;
delete C.x;
var D = new dart;
delete D.x;
var E = new dart;
delete E.x;
var F = new dart;
delete F.x;
var G = new dart;
delete G.x;
var H = new dart;
delete H.x;
var J = new dart;
delete J.x;
var K = new dart;
delete K.x;
var L = new dart;
delete L.x;
var M = new dart;
delete M.x;
var N = new dart;
delete N.x;
var O = new dart;
delete O.x;
var P = new dart;
delete P.x;
var Q = new dart;
delete Q.x;
var R = new dart;
delete R.x;
var S = new dart;
delete S.x;
var T = new dart;
delete T.x;
var U = new dart;
delete U.x;
var V = new dart;
delete V.x;
var W = new dart;
delete W.x;
var X = new dart;
delete X.x;
var Y = new dart;
delete Y.x;
var Z = new dart;
delete Z.x;
function Isolate() {}
init();
$ = Isolate.$isolateProperties;
(function(reflectionData) {
"use strict";
function map(x) {
x = {x: x};
delete x.x;
return x;
}
function processStatics(descriptor) {
for (var property in descriptor) {
if (!hasOwnProperty.call(descriptor, property))
continue;
if (property === "^")
continue;
var element = descriptor[property];
var firstChar = property.substring(0, 1);
var previousProperty;
if (firstChar === "+") {
mangledGlobalNames[previousProperty] = property.substring(1);
var flag = descriptor[property];
if (flag > 0)
descriptor[previousProperty].$reflectable = flag;
if (element && element.length)
init.typeInformation[previousProperty] = element;
} else if (firstChar === "@") {
property = property.substring(1);
$[property]["@"] = element;
} else if (firstChar === "*") {
globalObject[previousProperty].$defaultValues = element;
var optionalMethods = descriptor.$methodsWithOptionalArguments;
if (!optionalMethods) {
descriptor.$methodsWithOptionalArguments = optionalMethods = {};
}
optionalMethods[property] = previousProperty;
} else if (typeof element === "function") {
globalObject[previousProperty = property] = element;
functions.push(property);
init.globalFunctions[property] = element;
} else if (element.constructor === Array) {
addStubs(globalObject, element, property, true, descriptor, functions);
} else {
previousProperty = property;
var newDesc = {};
var previousProp;
for (var prop in element) {
if (!hasOwnProperty.call(element, prop))
continue;
firstChar = prop.substring(0, 1);
if (prop === "static") {
processStatics(init.statics[property] = element[prop]);
} else if (firstChar === "+") {
mangledNames[previousProp] = prop.substring(1);
var flag = element[prop];
if (flag > 0)
element[previousProp].$reflectable = flag;
} else if (firstChar === "@" && prop !== "@") {
newDesc[prop.substring(1)]["@"] = element[prop];
} else if (firstChar === "*") {
newDesc[previousProp].$defaultValues = element[prop];
var optionalMethods = newDesc.$methodsWithOptionalArguments;
if (!optionalMethods) {
newDesc.$methodsWithOptionalArguments = optionalMethods = {};
}
optionalMethods[prop] = previousProp;
} else {
var elem = element[prop];
if (prop !== "^" && elem != null && elem.constructor === Array && prop !== "<>") {
addStubs(newDesc, elem, prop, false, element, []);
} else {
newDesc[previousProp = prop] = elem;
}
}
}
$$[property] = [globalObject, newDesc];
classes.push(property);
}
}
}
function addStubs(descriptor, array, name, isStatic, originalDescriptor, functions) {
var f, funcs = [originalDescriptor[name] = descriptor[name] = f = array[0]];
f.$stubName = name;
functions.push(name);
for (var index = 0; index < array.length; index += 2) {
f = array[index + 1];
if (typeof f != "function")
break;
f.$stubName = array[index + 2];
funcs.push(f);
if (f.$stubName) {
originalDescriptor[f.$stubName] = descriptor[f.$stubName] = f;
functions.push(f.$stubName);
}
}
for (var i = 0; i < funcs.length; index++, i++) {
funcs[i].$callName = array[index + 1];
}
var getterStubName = array[++index];
array = array.slice(++index);
var requiredParameterInfo = array[0];
var requiredParameterCount = requiredParameterInfo >> 1;
var isAccessor = (requiredParameterInfo & 1) === 1;
var isSetter = requiredParameterInfo === 3;
var isGetter = requiredParameterInfo === 1;
var optionalParameterInfo = array[1];
var optionalParameterCount = optionalParameterInfo >> 1;
var optionalParametersAreNamed = (optionalParameterInfo & 1) === 1;
var isIntercepted = requiredParameterCount + optionalParameterCount != funcs[0].length;
var functionTypeIndex = array[2];
var unmangledNameIndex = 2 * optionalParameterCount + requiredParameterCount + 3;
var isReflectable = array.length > unmangledNameIndex;
if (getterStubName) {
f = tearOff(funcs, array, isStatic, name, isIntercepted);
descriptor[name].$getter = f;
f.$getterStub = true;
if (isStatic)
init.globalFunctions[name] = f;
originalDescriptor[getterStubName] = descriptor[getterStubName] = f;
funcs.push(f);
if (getterStubName)
functions.push(getterStubName);
f.$stubName = getterStubName;
f.$callName = null;
if (isIntercepted)
init.interceptedNames[getterStubName] = true;
}
if (isReflectable) {
for (var i = 0; i < funcs.length; i++) {
funcs[i].$reflectable = 1;
funcs[i].$reflectionInfo = array;
}
var mangledNames = isStatic ? init.mangledGlobalNames : init.mangledNames;
var unmangledName = array[unmangledNameIndex];
var reflectionName = unmangledName;
if (getterStubName)
mangledNames[getterStubName] = reflectionName;
if (isSetter) {
reflectionName += "=";
} else if (!isGetter) {
reflectionName += ":" + requiredParameterCount + ":" + optionalParameterCount;
}
mangledNames[name] = reflectionName;
funcs[0].$reflectionName = reflectionName;
funcs[0].$metadataIndex = unmangledNameIndex + 1;
if (optionalParameterCount)
descriptor[unmangledName + "*"] = funcs[0];
}
}
function tearOffGetterNoCsp(funcs, reflectionInfo, name, isIntercepted) {
return isIntercepted ? new Function("funcs", "reflectionInfo", "name", "H", "c", "return function tearOff_" + name + functionCounter++ + "(x) {" + "if (c === null) c = H.closureFromTearOff(" + "this, funcs, reflectionInfo, false, [x], name);" + "return new c(this, funcs[0], x, name);" + "}")(funcs, reflectionInfo, name, H, null) : new Function("funcs", "reflectionInfo", "name", "H", "c", "return function tearOff_" + name + functionCounter++ + "() {" + "if (c === null) c = H.closureFromTearOff(" + "this, funcs, reflectionInfo, false, [], name);" + "return new c(this, funcs[0], null, name);" + "}")(funcs, reflectionInfo, name, H, null);
}
function tearOffGetterCsp(funcs, reflectionInfo, name, isIntercepted) {
var cache = null;
return isIntercepted ? function(x) {
if (cache === null)
cache = H.closureFromTearOff(this, funcs, reflectionInfo, false, [x], name);
return new cache(this, funcs[0], x, name);
} : function() {
if (cache === null)
cache = H.closureFromTearOff(this, funcs, reflectionInfo, false, [], name);
return new cache(this, funcs[0], null, name);
};
}
function tearOff(funcs, reflectionInfo, isStatic, name, isIntercepted) {
var cache;
return isStatic ? function() {
if (cache === void 0)
cache = H.closureFromTearOff(this, funcs, reflectionInfo, true, [], name).prototype;
return cache;
} : tearOffGetter(funcs, reflectionInfo, name, isIntercepted);
}
var functionCounter = 0;
var tearOffGetter = typeof dart_precompiled == "function" ? tearOffGetterCsp : tearOffGetterNoCsp;
if (!init.libraries)
init.libraries = [];
if (!init.mangledNames)
init.mangledNames = map();
if (!init.mangledGlobalNames)
init.mangledGlobalNames = map();
if (!init.statics)
init.statics = map();
if (!init.typeInformation)
init.typeInformation = map();
if (!init.globalFunctions)
init.globalFunctions = map();
if (!init.interceptedNames)
init.interceptedNames = map();
var libraries = init.libraries;
var mangledNames = init.mangledNames;
var mangledGlobalNames = init.mangledGlobalNames;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var length = reflectionData.length;
for (var i = 0; i < length; i++) {
var data = reflectionData[i];
var name = data[0];
var uri = data[1];
var metadata = data[2];
var globalObject = data[3];
var descriptor = data[4];
var isRoot = !!data[5];
var fields = descriptor && descriptor["^"];
if (fields instanceof Array)
fields = fields[0];
var classes = [];
var functions = [];
processStatics(descriptor);
libraries.push([name, uri, classes, functions, metadata, fields, isRoot, globalObject]);
}
})([
["", "asd.dart", , A, {
"^": "",
main: function() {
P.print("Ciao Giuseppe");
P.print("Ciao Claudio");
}
},
1],
["dart.core", "dart:core", , P, {
"^": "",
print: function(object) {
H.printString(object);
}
}],
["dart2js._js_primitives", "dart:_js_primitives", , H, {
"^": "",
printString: function(string) {
if (typeof dartPrint == "function") {
dartPrint(string);
return;
}
if (typeof console == "object" && typeof console.log != "undefined") {
console.log(string);
return;
}
if (typeof window == "object")
return;
if (typeof print == "function") {
print(string);
return;
}
throw "Unable to print message: " + String(string);
}
}],
]);
// Runtime type support
// getInterceptor methods
$.libraries_to_load = {};
$.Closure_functionCounter = 0;
$.BoundClosure_selfFieldNameCache = null;
$.BoundClosure_receiverFieldNameCache = null;
$.printToZone = null;
init.functionAliases = {};
;
init.metadata = [];
$ = null;
Isolate = Isolate.$finishIsolateConstructor(Isolate);
$ = new Isolate();
function convertToFastObject(properties) {
function MyClass() {
}
MyClass.prototype = properties;
new MyClass();
return properties;
}
;
A = convertToFastObject(A);
B = convertToFastObject(B);
C = convertToFastObject(C);
D = convertToFastObject(D);
E = convertToFastObject(E);
F = convertToFastObject(F);
G = convertToFastObject(G);
H = convertToFastObject(H);
J = convertToFastObject(J);
K = convertToFastObject(K);
L = convertToFastObject(L);
M = convertToFastObject(M);
N = convertToFastObject(N);
O = convertToFastObject(O);
P = convertToFastObject(P);
Q = convertToFastObject(Q);
R = convertToFastObject(R);
S = convertToFastObject(S);
T = convertToFastObject(T);
U = convertToFastObject(U);
V = convertToFastObject(V);
W = convertToFastObject(W);
X = convertToFastObject(X);
Y = convertToFastObject(Y);
Z = convertToFastObject(Z);
// BEGIN invoke [main].
;(function(callback) {
if (typeof document === "undefined") {
callback(null);
return;
}
if (document.currentScript) {
callback(document.currentScript);
return;
}
var scripts = document.scripts;
function onLoad(event) {
for (var i = 0; i < scripts.length; ++i) {
scripts[i].removeEventListener("load", onLoad, false);
}
callback(event.target);
}
for (var i = 0; i < scripts.length; ++i) {
scripts[i].addEventListener("load", onLoad, false);
}
})(function(currentScript) {
init.currentScript = currentScript;
if (typeof dartMainRunner === "function") {
dartMainRunner(A.main, []);
} else {
A.main([]);
}
});
;
// END invoke [main].
function init() {
Isolate.$isolateProperties = {};
Isolate.$lazy = function(prototype, staticName, fieldName, getterName, lazyValue) {
var sentinelUndefined = {};
var sentinelInProgress = {};
prototype[fieldName] = sentinelUndefined;
prototype[getterName] = function() {
var result = $[fieldName];
try {
if (result === sentinelUndefined) {
$[fieldName] = sentinelInProgress;
try {
result = $[fieldName] = lazyValue();
} finally {
if (result === sentinelUndefined)
if ($[fieldName] === sentinelInProgress)
$[fieldName] = null;
}
} else {
if (result === sentinelInProgress)
H.throwCyclicInit(staticName);
}
return result;
} finally {
$[getterName] = function() {
return this[fieldName];
};
}
};
};
Isolate.$finishIsolateConstructor = function(oldIsolate) {
var isolateProperties = oldIsolate.$isolateProperties;
function Isolate() {
var hasOwnProperty = Object.prototype.hasOwnProperty;
for (var staticName in isolateProperties)
if (hasOwnProperty.call(isolateProperties, staticName))
this[staticName] = isolateProperties[staticName];
function ForceEfficientMap() {
}
ForceEfficientMap.prototype = this;
new ForceEfficientMap();
}
Isolate.prototype = oldIsolate.prototype;
Isolate.prototype.constructor = Isolate;
Isolate.$isolateProperties = isolateProperties;
return Isolate;
};
}
})()
//# sourceMappingURL=out.js.map
//@ sourceMappingURL=out.js.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment