Skip to content

Commit

Permalink
debugging issue #12
Browse files Browse the repository at this point in the history
  • Loading branch information
samthor committed May 2, 2016
1 parent 5fa68e5 commit 2479dd9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,21 @@ void function() {
slice.push(2);
assert.equal(slice.length, 2);
});

// nb. Trying to resolve issue #12
test('array as property', function() {
var testObj = {arr: [1,2,3]};
var p = new Proxy(testObj, {get: function(obj, prop) {
return obj[prop]; // zero get handler
}});

assert.equal(p.arr.length, 3);
p.arr.push(4);
assert.equal(p.arr.length, 4);

p.arr.splice(0,2);
assert.equal(p.arr.length, 2);
});
});

}();

0 comments on commit 2479dd9

Please sign in to comment.