Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #5 from n0valyfe/master

Bugs with latest node (0.6.6)
  • Loading branch information...
commit e7c4a20ba1606e0c52ab313b05e4169260fc1a53 2 parents b55e980 + 5815184
Oliver Morgan authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 index.js
16 index.js
View
@@ -23,7 +23,7 @@
*/
var crypto = require('crypto'),
- Script = process.binding('evals').Script,
+ Script = require('vm'),
cache = { };
// Defines parrot's version
@@ -153,13 +153,13 @@ exports.render = function(data, config, onprint) {
// Compile the input into executable javascript
data = data
- .replace(new RegExp(':\\s*' + et, ['g', 'm']), '{ %>')
- .replace(new RegExp(st + '=(.+)' + et, ['g', 'm']), '"); print($1); print("')
- .replace(new RegExp(st + '\\s*end(if|while|for|switch);*\\s*' + et, ['g', 'm', 'i']), '"); } print("')
- .replace(new RegExp(st + '(.+)' + et, ['g', 'm']), '"); $1 print("')
- .replace(new RegExp('\n', ['g', 'm']), '\\n')
- .replace(new RegExp('\r', ['g', 'm']), '\\r')
- .replace(new RegExp('\t', ['g', 'm']), '\\t');
+ .replace(new RegExp(':\\s*' + et, 'gm'), '{ %>')
+ .replace(new RegExp(st + '=(.+)' + et, 'gm'), '"); print($1); print("')
+ .replace(new RegExp(st + '\\s*end(if|while|for|switch);*\\s*' + et, 'gmi'), '"); } print("')
+ .replace(new RegExp(st + '(.+)' + et, 'gm'), '"); $1 print("')
+ .replace(new RegExp('\n', 'gm'), '\\n')
+ .replace(new RegExp('\r', 'gm'), '\\r')
+ .replace(new RegExp('\t', 'gm'), '\\t');
// Execute the script, rendering the template
Script.runInNewContext(data, config.sandbox);
Please sign in to comment.
Something went wrong with that request. Please try again.