1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Construct Syntax values correctly.

This commit is contained in:
Rob Rix 2015-10-23 18:23:25 -04:00
parent 155b0a16ef
commit 08927d06b5

View File

@ -224,9 +224,9 @@
}
function Syntax(json, continuation) {
if (json instanceof Array) { this.indexed = json.map(continuation); }
else if (json instanceof Object) { this.keyed = (new Dictionary(json)).map(continuation); }
else this.leaf = json;
if (json.indexed != null) { this.indexed = json.map(continuation); }
if (json.keyed != null) { this.keyed = (new Dictionary(json)).map(continuation); }
if (json.leaf != null) { this.leaf = json; }
return this;
}