From acfd035720193bcff8b365c204dad1a7ae3d6194 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Mon, 19 Sep 2016 20:16:27 +0100 Subject: [PATCH] refactor: replaced remaining eval with Function constructor --- lib/async.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/async.js b/lib/async.js index 46992d5..e5eac8c 100644 --- a/lib/async.js +++ b/lib/async.js @@ -68,7 +68,7 @@ function setupAsync(opts, required) { function checkGenerators(opts, required) { /* jshint evil: true */ try { - eval('(function*(){})()'); + (new Function('(function*(){})()'))(); return true; } catch(e) { /* istanbul ignore next */ @@ -80,7 +80,7 @@ function checkGenerators(opts, required) { function checkAsyncFunction(opts, required) { /* jshint evil: true */ try { - eval('(async function(){})()'); + (new Function('(async function(){})()'))(); /* istanbul ignore next */ return true; } catch(e) { diff --git a/package.json b/package.json index 9da4f40..3452d0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ajv", - "version": "4.7.1", + "version": "4.7.2", "description": "Another JSON Schema Validator", "main": "lib/ajv.js", "webpack": "dist/ajv.bundle.js",