Created
October 17, 2013 22:12
-
-
Save kazuho/7033195 to your computer and use it in GitHub Desktop.
this does not work (yet)
This file contains hidden or 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
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