Skip to content

Commit

Permalink
remove vm use plain function (#77)
Browse files Browse the repository at this point in the history
remove vm use `new Function`
  • Loading branch information
barisusakli authored and pitaj committed Jun 16, 2018
1 parent f23e051 commit fa4e4e2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/evaluate.js
@@ -1,7 +1,5 @@
'use strict';

const vm = require('vm');

/**
* Evaluate a compiled template for use on the server
* @private
Expand All @@ -14,9 +12,11 @@ function evaluate(code) {
exports: {},
},
};
vm.runInNewContext(code, context, {
timeout: 50,
});

// eslint-disable-next-line no-new-func
const renderFunction = new Function('module', code);
renderFunction(context.module);

const template = context.module.exports;

return template;
Expand Down

0 comments on commit fa4e4e2

Please sign in to comment.