summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/WeakMap-set-returns-this.js
blob: f62c75fa1aad4340b08cd903251fd71ed0e99430 (plain)
1
2
3
4
5
6
7
8
9
// Bug 1031632 - Map.prototype.set, WeakMap.prototype.set and
// Set.prototype.add should be chainable

var wm = new WeakMap();
var bar = {};
assertEq(wm.set(bar, 'BAR'), wm);
var foo = {};
var a = wm.set(foo, 'FOO').get(foo);
assertEq(a, 'FOO');