summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/WeakMap/prototype/has/returns-false-when-object-key-not-present.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/WeakMap/prototype/has/returns-false-when-object-key-not-present.js')
-rw-r--r--js/src/tests/test262/built-ins/WeakMap/prototype/has/returns-false-when-object-key-not-present.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/has/returns-false-when-object-key-not-present.js b/js/src/tests/test262/built-ins/WeakMap/prototype/has/returns-false-when-object-key-not-present.js
new file mode 100644
index 0000000000..a1fab07546
--- /dev/null
+++ b/js/src/tests/test262/built-ins/WeakMap/prototype/has/returns-false-when-object-key-not-present.js
@@ -0,0 +1,25 @@
+// 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: >
+ Return false when an Object key is not present in the WeakMap entries.
+info: |
+ WeakMap.prototype.has ( _key_ )
+ 6. Return *false*.
+features: [WeakMap]
+---*/
+
+var foo = {};
+var bar = {};
+var map = new WeakMap();
+
+assert.sameValue(map.has(foo), false);
+
+map.set(foo, 1);
+assert.sameValue(map.has(bar), false);
+
+map.delete(foo);
+assert.sameValue(map.has(foo), false);
+
+reportCompare(0, 0);