aboutsummaryrefslogtreecommitdiff
path: root/node_modules/ajv/lib/compile/index.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
commitbbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch)
treec58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/ajv/lib/compile/index.js
parent003fb34971cf63466184351b4db5f7c67df4f444 (diff)
update packages
Diffstat (limited to 'node_modules/ajv/lib/compile/index.js')
-rw-r--r--node_modules/ajv/lib/compile/index.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/node_modules/ajv/lib/compile/index.js b/node_modules/ajv/lib/compile/index.js
index cf4f5b86b..8e369db3d 100644
--- a/node_modules/ajv/lib/compile/index.js
+++ b/node_modules/ajv/lib/compile/index.js
@@ -11,7 +11,6 @@ var validateGenerator = require('../dotjs/validate');
* Functions below are used inside compiled validations function
*/
-var co = require('co');
var ucs2length = util.ucs2length;
var equal = require('fast-deep-equal');
@@ -70,9 +69,11 @@ function compile(schema, root, localRefs, baseId) {
endCompiling.call(this, schema, root, baseId);
}
+ /* @this {*} - custom context, see passContext option */
function callValidate() {
+ /* jshint validthis: true */
var validate = compilation.validate;
- var result = validate.apply(null, arguments);
+ var result = validate.apply(this, arguments);
callValidate.errors = validate.errors;
return result;
}
@@ -124,7 +125,6 @@ function compile(schema, root, localRefs, baseId) {
'refVal',
'defaults',
'customRules',
- 'co',
'equal',
'ucs2length',
'ValidationError',
@@ -139,7 +139,6 @@ function compile(schema, root, localRefs, baseId) {
refVal,
defaults,
customRules,
- co,
equal,
ucs2length,
ValidationError
@@ -224,7 +223,7 @@ function compile(schema, root, localRefs, baseId) {
function resolvedRef(refVal, code) {
return typeof refVal == 'object' || typeof refVal == 'boolean'
? { code: code, schema: refVal, inline: true }
- : { code: code, $async: refVal && refVal.$async };
+ : { code: code, $async: refVal && !!refVal.$async };
}
function usePattern(regexStr) {