constructor (dimensions, dotNotation) {
      super()
      this.dimensions = dimensions
      this.dotNotation = dotNotation || false

      // validate input
      if (!Array.isArray(dimensions) || !dimensions.every(isNode)) {
        throw new TypeError(
          'Array containing Nodes expected for parameter "dimensions"')
      }
      if (this.dotNotation && !this.isObjectProperty()) {
        throw new Error('dotNotation only applicable for object properties')
      }
    }
@constructor IndexNode
@extends Node

Describes a subset of a matrix or an object property.
Cannot be used on its own, needs to be used within an AccessorNode or
AssignmentNode.

@param {Node[]} dimensions
@param {boolean} [dotNotation=false]
    Optional property describing whether this index was written using dot
    notation like `a.b`, or using bracket notation like `a["b"]`
    (which is the default). This property is used for string conversion.