function IndexNode(dimensions, dotNotation) {
    if (!(this instanceof IndexNode)) {
      throw new SyntaxError('Constructor must be called with the new operator');
    }

    this.dimensions = dimensions;
    this.dotNotation = dotNotation || false; // validate input

    if (!isArray(dimensions) || !dimensions.every(type.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');
    } // TODO: deprecated since v3, remove some day


    var deprecated = function deprecated() {
      throw new Error('Property `IndexNode.object` is deprecated, use `IndexNode.fn` instead');
    };

    Object.defineProperty(this, 'object', {
      get: deprecated,
      set: deprecated
    });
  }
@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"]` (default).
                                      Used to stringify an IndexNode.