Created
October 2, 2009 18:57
-
-
Save matschaffer/199998 to your computer and use it in GitHub Desktop.
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
js> load('ejs.js') | |
js> ; | |
js> var world="world"; | |
js> var template='hello <%= world %>'; | |
js> print(template); | |
hello <%= world %> | |
js> var compiler = EjsCompiler(source); | |
js: "<stdin>", line 7: uncaught JavaScript runtime exception: ReferenceError: "source" is not defined. | |
at <stdin>:7 | |
js> var compiler = EjsCompiler(template); | |
js> print(compiler.compile()); | |
js: "<stdin>", line 9: uncaught JavaScript runtime exception: TypeError: Cannot call method "compile" of undefined | |
at <stdin>:9 | |
js> var compiler = new EjsCompiler(template); | |
js> print(compiler.compile()); | |
undefined | |
js> print(compiler.out); | |
___ejsO = "";; ___ejsO += "hello "; ___ejsO += (EjsScanner.to_text( world )); | |
js> eval(compiler.out); | |
hello world |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment