formic icon indicating copy to clipboard operation
formic copied to clipboard

Clarification in steps to set a JSON encoding value

Open LinusU opened this issue 10 years ago • 0 comments

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:

  1. If step's next type is "array", return current value.
  2. Otherwise, run the following
  3. Let object be a new empty Object.
  4. 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.
  5. Otherwise, set the context's property named by the step's key to object.
  6. Return object.

LinusU avatar May 03 '15 13:05 LinusU