summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/WeakMap/prototype/has/returns-true-when-object-key-present.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/WeakMap/prototype/has/returns-true-when-object-key-present.js')
-rw-r--r--js/src/tests/test262/built-ins/WeakMap/prototype/has/returns-true-when-object-key-present.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/has/returns-true-when-object-key-present.js b/js/src/tests/test262/built-ins/WeakMap/prototype/has/returns-true-when-object-key-present.js
new file mode 100644
index 0000000000..910a816609
--- /dev/null
+++ b/js/src/tests/test262/built-ins/WeakMap/prototype/has/returns-true-when-object-key-present.js
@@ -0,0 +1,21 @@
+// 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.has
+description: >
+ Returns true when an Object key is present in the WeakMap entries list.
+info: |
+ WeakMap.prototype.has ( _key_ )
+ 5. For each Record {[[Key]], [[Value]]} _p_ of _entries_, do
+ a. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is
+ *true*, return *true*.
+features: [WeakMap]
+---*/
+
+var foo = {};
+var map = new WeakMap();
+
+map.set(foo, 1);
+assert.sameValue(map.has(foo), true);
+
+reportCompare(0, 0);