Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / WeakSet / no-iterable.js
blob6413080507d033dddb86dce608e9d1fe8dfaa792
1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-weakset-iterable
5 description: >
6   If the iterable argument is undefined, return new Weakset object.
7 info: |
8   23.4.1.1 WeakSet ( [ iterable ] )
10   ...
11   5. If iterable is not present, let iterable be undefined.
12   6. If iterable is either undefined or null, let iter be undefined.
13   ...
14   8. If iter is undefined, return set.
15   ...
16 ---*/
18 var a = new WeakSet();
19 var b = new WeakSet(undefined);
20 var c = new WeakSet(null);
22 assert.sameValue(Object.getPrototypeOf(a), WeakSet.prototype);
23 assert.sameValue(Object.getPrototypeOf(b), WeakSet.prototype);
24 assert.sameValue(Object.getPrototypeOf(c), WeakSet.prototype);
26 reportCompare(0, 0);