Example #1
0
  assign(context, value) {
    var obj = this.obj.eval(context);
    var key = this.key.eval(context);

    if (obj instanceof Map) {
      MapWrapper.set(obj, key, value);
    } else if (obj instanceof List) {
      ListWrapper.set(obj, key, value);
    } else {
      obj[key] = value;
    }
    return value;
  }
Example #2
0
      it('should test string by value rather than by reference (Dart)', () => {
        l = ['a', 'boo'];
        changes.check(l);

        var b = 'b';
        var oo = 'oo';
        ListWrapper.set(l, 1, b + oo);
        changes.check(l);
        expect(changes.toString()).toEqual(arrayChangesAsString({
          collection: ['a', 'boo'],
          previous: ['a', 'boo']
        }));
      });
Example #3
0
 _setInstance(key:Key, obj) {
   ListWrapper.set(this._instances, key.id, obj);
 }