prevent possible issues like #13
parent
cbdd00e9c6
commit
4e1f0e54c4
|
@ -19,6 +19,7 @@ function compile(schema, root) {
|
|||
|
||||
var isRoot = !root || (root && root.schema == schema);
|
||||
root = root || { schema: schema, refVal: refVal, refs: refs };
|
||||
var rootRefs = root.refs;
|
||||
var rootRefVal = root.refVal;
|
||||
|
||||
var formats = this._formats;
|
||||
|
@ -68,9 +69,9 @@ function compile(schema, root) {
|
|||
ref = resolve.url(baseId, ref);
|
||||
if (refs[ref]) return 'refVal[' + refs[ref] + ']';
|
||||
if (!isRoot) {
|
||||
var rootRefId = root.refs[ref];
|
||||
var rootRefId = rootRefs[ref];
|
||||
if (rootRefId !== undefined)
|
||||
return addLocalRef(ref, root.refVal[rootRefId]);
|
||||
return addLocalRef(ref, rootRefVal[rootRefId]);
|
||||
}
|
||||
var v = resolve.call(self, compile, root, ref);
|
||||
if (v) return addLocalRef(ref, v);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ajv",
|
||||
"version": "0.5.5",
|
||||
"version": "0.5.6",
|
||||
"description": "Another JSON schema Validator",
|
||||
"main": "lib/ajv.js",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in New Issue