formic
formic copied to clipboard
Clarification in steps to set a JSON encoding value
In "steps to set a JSON encoding value", bullet 8.3.2.3:
Otherwise, set the context's property named by the step's key to object.
What it the word Otherwise referring to? I think it's unclear and as far as I can understand there isn't any condition on wether to set the context's property named by the step's key to object. I think that it should always be done.
Context:
Else if current value is an Array, then rub the following subsubsteps:
- If step's next type is "array", return current value.
- Otherwise, run the following
- Let object be a new empty Object.
- For each item and zero-based index i in current value, if item is not undefined then set a property of object named i to item.
- Otherwise, set the context's property named by the step's key to object.
- Return object.