Changeset 27630
- Timestamp:
- 12/30/08 22:57:49 (4 years ago)
- Location:
- lang/javascript/hsp-on-js/trunk/src
- Files:
-
- 1 added
- 2 modified
-
evaluator.js (modified) (2 diffs)
-
head-for-run-in-shell.js (added)
-
run-in-shell (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/hsp-on-js/trunk/src/evaluator.js
r27520 r27630 52 52 Evaluator.prototype = { 53 53 evaluate: function evaluate() { 54 this.mainLoop = eval('Object(function mainLoop(stack, literals, variables, userDefFuncs) {\n' + 55 this.createMainLoop(this.literals, this.userDefFuncs) + '\n})'); 54 this.mainLoop = this.createMainLoop(); 56 55 try { 57 56 this.mainLoop(this.stack, this.literals, this.variables, this.userDefFuncs); … … 130 129 onStop: function onStop() { 131 130 }, 132 createMainLoop: function createMainLoop(literals, userDefFuncs) { 131 createMainLoop: function createMainLoop() { 132 var src = ''; 133 for(var prop in HSPonJS) { 134 src += 'var '+prop+' = HSPonJS.'+prop+';\n'; 135 } 136 src += 'return function mainLoop(stack, literals, variables, userDefFuncs) {\n'; 137 src += this.createMainLoopSrc(this.literals, this.userDefFuncs) + '\n};'; 138 return Function(src)(); 139 }, 140 createMainLoopSrc: function createMainLoopSrc(literals, userDefFuncs) { 133 141 function push(line) { 134 142 lines.push(Utils.strTimes('\t', indent) + line); -
lang/javascript/hsp-on-js/trunk/src/run-in-shell
r27513 r27630 40 40 else 41 41 filenames = %w[ 42 head-for-run-in-shell.js 42 43 binary-parser.js 43 44 cp932.js
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)