       prev = args[last = args.length - 1]
       if arg not instanceof SplatNode
         if prev and starts(prev, '[') and ends(prev, ']')
-          args[last] = "#{prev.substr(0, prev.length - 1)}, #{code}]"
+          args[last] = "#{prev.slice 0, -1}, #{code}]"
           continue
         else if prev and starts(prev, '.concat([') and ends(prev, '])')
-          args[last] = "#{prev.substr(0, prev.length - 2)}, #{code}])"
+          args[last] = "#{prev.slice 0, -2}, #{code}])"
           continue
         else
           code = "[#{code}]"


  # Compile a simple range comprehension, with integers.
  compileSimple: (o) ->
    [from, to] = [parseInt(@fromNum, 10), parseInt(@toNum, 10)]
    idx        = del o, 'index'
    step       = del o, 'step'
    step       and= "#{idx} += #{step.compile(o)}"

  # by assigning it to a temporary variable.
  compileReference: (o, options) ->
    options or= {}
    pair = unless @isComplex()
      [this, this]
    else if this instanceof ValueNode and options.assignment
      this.cacheIndexes(o)
