Created
June 27, 2014 15:05
-
-
Save matthewrobb/7685866134d1ee8366b1 to your computer and use it in GitHub Desktop.
Async YUI Micro Templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(traceur.RUNTIME_PATH); | |
function compile() { | |
var tpl = Micro.precompile("ello <%= govna %>") + ""; | |
tpl = [ | |
"(async function() {", | |
tpl.slice(tpl.indexOf("{") + 1, tpl.length - 1), | |
"})();" | |
].join("\n"); | |
tpl = traceur.compile(tpl, { | |
modules : "commonjs", | |
asyncFunctions : true | |
}); | |
tpl = vm.createScript(tpl.js); | |
tpl.runInNewContext({ | |
$traceurRuntime: global.$traceurRuntime, | |
govna:"quimby", | |
$e:function(v) { return v; } | |
}).then(function(result) { | |
console.log(result) // ello quimby | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment