Skip to content
This repository was archived by the owner on Jul 26, 2025. It is now read-only.

Commit 8690b32

Browse files
committed
Used 'vm.runInThisContext' instead of 'process.compile'.
1 parent ee8874b commit 8690b32

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

grasshopper/lib/ghp.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
*/
1616
exports.api = {};
1717

18-
var fs = require('fs');
18+
var fs = require('fs'),
19+
vm = require('vm');
1920

2021
var cache = {},
2122
bufferSize = 8 * 1024;
@@ -95,7 +96,7 @@ function compile(text, helpersCount, fileName) {
9596
funcBody += "}";
9697
}
9798

98-
return process.compile('tmpl = function(out, model, helpers) {'
99+
return vm.runInThisContext('tmpl = function(out, model, helpers) {'
99100
+ funcBody
100101
+ '}', fileName);
101102
}

0 commit comments

Comments
 (0)