From a219d4d1f227675283969e3162bc9212ed6a2ec2 Mon Sep 17 00:00:00 2001 From: Taylor Zane Glaeser Date: Thu, 9 Mar 2017 20:02:05 -0600 Subject: [PATCH] Changed `create` API method to use `new Function()` instead of anindirect eval. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index ceb94442f4..4e25696241 100644 --- a/src/index.js +++ b/src/index.js @@ -57,7 +57,7 @@ export function create ( source, _options = {} ) { let result; try { - result = ( 1, eval )( compiled.code ); + result = (new Function( 'return ' + compiled.code ))(); } catch ( err ) { if ( _options.onerror ) { _options.onerror( err );