summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/WeakMap/prototype/set/adds-object-element.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/WeakMap/prototype/set/adds-object-element.js')
-rw-r--r--js/src/tests/test262/built-ins/WeakMap/prototype/set/adds-object-element.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/set/adds-object-element.js b/js/src/tests/test262/built-ins/WeakMap/prototype/set/adds-object-element.js
new file mode 100644
index 0000000000..897b047e80
--- /dev/null
+++ b/js/src/tests/test262/built-ins/WeakMap/prototype/set/adds-object-element.js
@@ -0,0 +1,27 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-weakmap.prototype.set
+description: >
+ Adds a value with an Object key.
+info: |
+ WeakMap.prototype.set ( _key_, _value_ )
+ 6. Let _p_ be the Record {[[Key]]: _key_, [[Value]]: _value_}.
+ 7. Append _p_ as the last element of _entries_.
+features: [WeakMap]
+---*/
+
+var map = new WeakMap();
+var foo = {};
+var bar = {};
+var baz = {};
+
+map.set(foo, 1);
+map.set(bar, 2);
+map.set(baz, 3);
+
+assert(map.has(foo));
+assert(map.has(bar));
+assert(map.has(baz));
+
+reportCompare(0, 0);