Tue 9 Mar 2010
A quick hack for making imports work more like script tags in GJS
Posted by J5 under UncategorizedComments Off
// Because sometime you just need everything in the global context
var Module = imports.module;
for (i in Module)
this[i] = Module[i];
// note this only works from scripts eval'ed via the C API
// gjs_context_eval or gjs_context_eval_file
// as this == [global object]
[read this post in: ar de es fr it ja ko pt ru zh-CN ] 