diff --git a/test/hello-world.js b/test/hello-world.js new file mode 100644 index 0000000..5437df4 --- /dev/null +++ b/test/hello-world.js @@ -0,0 +1,32 @@ +function hello(arg) { + this.arg=arg; + this.act = { + main : function () { + log('Hello',this.arg); + }, + more : function () { + log('World'); + // throw error + function foo() { + return {}.x() + } + // try { foo() } catch (e) { log(e.toString()) } + foo() + }, + end : function () { + log('Terminate'); + } + } + this.trans = { + main : more, + more : end + } + this.on = { + // w/o handler agent will be terminated on error + error : function (err) { log('error',err,this.next) } + } + this.next='main'; +} +compile(hello,{verbose:1}); +create('hello','You') +start()