derbyjs / racer

Realtime model synchronization engine for Node.js
1.19k stars 118 forks source link

Table editor page of 'sink' example - doesn't property add column #47

Closed Ziink closed 11 years ago

Ziink commented 12 years ago

The bug seems to be in racer/lib/mutators/mutators.Model.js (version 0.3.13)

push: {
  type: ARRAY_MUTATOR,
  insertArgs: 1,
  fn: function() {
    var args, at, callback, current, path;
    args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
    if (at = this._at) {
      //          if (typeof (path = args[0]) === 'string' && (current = this.get()) && !Array.isArray(current)) {
      if (typeof (path = args[0]) === 'string' && (current = this.get(path)) && Array.isArray(current)) {
        args[0] = at + '.' + path;
      } else {
        args.unshift(at);
      }
    }
    if (typeof args[args.length - 1] === 'function') {
      callback = args.pop();
    }
    return this._sendToMiddleware('push', args, callback);
  }
},

The original line is commented with the fixed line following it.

nateps commented 11 years ago

No longer relevant in 0.5