toJSON () {
      throw new Error(
        'Cannot serialize object: toJSON not implemented by ' + this.type)
    }
Get a JSON representation of the node
Both .toJSON() and the static .fromJSON(json) should be implemented by all
implementations of Node
@returns {Object}