Skip to content

Commit

Permalink
additional check for compatibility with nodent
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Jan 29, 2016
1 parent a951e66 commit dba7096
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function setTranspile(opts) {

function generatorsSupported() {
/* jshint evil: true */
try { eval("(function*(){})()"); return true; }
try { eval('(function*(){})()'); return true; }
catch(e) {}
}

Expand All @@ -71,7 +71,10 @@ function regeneratorTranspile(code) {


function getNodent() {
/* jshint evil: true */
try {
// nodent declares functions not only on the top level, won't work in node 0.10-0.12
eval('(function () { "use strict"; if (true) { b(); function b() {} } })()');
if (!nodent) nodent = require('' + 'nodent')({ log: noop });
return nodentTranspile;
} catch(e) {}
Expand Down
2 changes: 1 addition & 1 deletion spec/async_validate.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var g = typeof global == 'object' ? global :
g.Promise = g.Promise || Promise;


describe.only('async schemas, formats and keywords', function() {
describe('async schemas, formats and keywords', function() {
var ajv, instances;

beforeEach(function () {
Expand Down

0 comments on commit dba7096

Please sign in to comment.