Skip to content

Instantly share code, notes, and snippets.

@kazuho
Created October 17, 2013 22:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazuho/7033195 to your computer and use it in GitHub Desktop.
Save kazuho/7033195 to your computer and use it in GitHub Desktop.
this does not work (yet)
import "js.jsx";
native class Base {
} = """
function () {
console.log("this.config = " + this.config);
}
""";
class Derived extends Base {
static const config = "abc";
}
class _Main {
static function _setConfig.<T>() : void {
(js.eval("""(function (src, klass, config) {
JSX.require(src)[klass].prototype.config = config;
})""") as function (: string, : string, : variant))(T.__FILE__, T.__CLASSNAME__, T.config);
}
static function main(args : string[]) : void {
_Main._setConfig.<Derived>();
new Derived;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment