summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Set/prototype/has
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Set/prototype/has')
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/browser.js0
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-array.js23
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-map.js23
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-object.js23
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-set-prototype.js23
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-weakset.js23
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/has.js23
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/length.js19
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/name.js19
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/not-a-constructor.js31
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-undefined-added-deleted-not-present-undefined.js23
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-boolean.js17
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-nan.js17
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-null.js17
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-number.js17
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-string.js17
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-symbol.js18
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-undefined.js17
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-boolean.js21
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-nan.js21
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-null.js21
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-number.js21
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-string.js21
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-symbol.js23
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-undefined.js21
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/shell.js0
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-boolean.js22
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-null.js22
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-number.js22
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-string.js22
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-symbol.js23
-rw-r--r--js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-undefined.js22
32 files changed, 632 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/browser.js b/js/src/tests/test262/built-ins/Set/prototype/has/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/browser.js
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-array.js b/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-array.js
new file mode 100644
index 0000000000..3ae1b82da5
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-array.js
@@ -0,0 +1,23 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
+ ...
+
+---*/
+
+assert.throws(TypeError, function() {
+ Set.prototype.has.call([], 1);
+});
+
+assert.throws(TypeError, function() {
+ var s = new Set();
+ s.has.call([], 1);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-map.js b/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-map.js
new file mode 100644
index 0000000000..1730d3589f
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-map.js
@@ -0,0 +1,23 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
+ ...
+
+---*/
+
+assert.throws(TypeError, function() {
+ Set.prototype.has.call(new Map(), 1);
+});
+
+assert.throws(TypeError, function() {
+ var s = new Set();
+ s.has.call(new Map(), 1);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-object.js b/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-object.js
new file mode 100644
index 0000000000..ec257eb554
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-object.js
@@ -0,0 +1,23 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
+ ...
+
+---*/
+
+assert.throws(TypeError, function() {
+ Set.prototype.has.call({}, 1);
+});
+
+assert.throws(TypeError, function() {
+ var s = new Set();
+ s.has.call({}, 1);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-set-prototype.js b/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-set-prototype.js
new file mode 100644
index 0000000000..aa82cb1ade
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-set-prototype.js
@@ -0,0 +1,23 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
+ ...
+
+---*/
+
+assert.throws(TypeError, function() {
+ Set.prototype.has.call(Set.prototype, 1);
+});
+
+assert.throws(TypeError, function() {
+ var s = new Set();
+ s.has.call(Set.prototype, 1);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-weakset.js b/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-weakset.js
new file mode 100644
index 0000000000..e2137cc903
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-weakset.js
@@ -0,0 +1,23 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.
+ ...
+features: [WeakSet]
+---*/
+
+assert.throws(TypeError, function() {
+ Set.prototype.has.call(new WeakSet(), 1);
+});
+
+assert.throws(TypeError, function() {
+ var s = new Set();
+ s.has.call(new WeakSet(), 1);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/has.js b/js/src/tests/test262/built-ins/Set/prototype/has/has.js
new file mode 100644
index 0000000000..c8f3c054ae
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/has.js
@@ -0,0 +1,23 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ 17 ECMAScript Standard Built-in Objects
+
+includes: [propertyHelper.js]
+---*/
+
+assert.sameValue(
+ typeof Set.prototype.has,
+ "function",
+ "`typeof Set.prototype.has` is `'function'`"
+);
+
+verifyNotEnumerable(Set.prototype, "has");
+verifyWritable(Set.prototype, "has");
+verifyConfigurable(Set.prototype, "has");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/length.js b/js/src/tests/test262/built-ins/Set/prototype/has/length.js
new file mode 100644
index 0000000000..93326a3565
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/length.js
@@ -0,0 +1,19 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ 17 ECMAScript Standard Built-in Objects
+
+includes: [propertyHelper.js]
+---*/
+
+assert.sameValue(Set.prototype.has.length, 1, "The value of `Set.prototype.has.length` is `1`");
+
+verifyNotEnumerable(Set.prototype.has, "length");
+verifyNotWritable(Set.prototype.has, "length");
+verifyConfigurable(Set.prototype.has, "length");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/name.js b/js/src/tests/test262/built-ins/Set/prototype/has/name.js
new file mode 100644
index 0000000000..c95b4ff0b5
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/name.js
@@ -0,0 +1,19 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ 17 ECMAScript Standard Built-in Objects
+
+includes: [propertyHelper.js]
+---*/
+
+assert.sameValue(Set.prototype.has.name, "has", "The value of `Set.prototype.has.name` is `'has'`");
+
+verifyNotEnumerable(Set.prototype.has, "name");
+verifyNotWritable(Set.prototype.has, "name");
+verifyConfigurable(Set.prototype.has, "name");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/has/not-a-constructor.js
new file mode 100644
index 0000000000..8f41ff0c1f
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/not-a-constructor.js
@@ -0,0 +1,31 @@
+// Copyright (C) 2020 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-ecmascript-standard-built-in-objects
+description: >
+ Set.prototype.has does not implement [[Construct]], is not new-able
+info: |
+ ECMAScript Function Objects
+
+ Built-in function objects that are not identified as constructors do not
+ implement the [[Construct]] internal method unless otherwise specified in
+ the description of a particular function.
+
+ sec-evaluatenew
+
+ ...
+ 7. If IsConstructor(constructor) is false, throw a TypeError exception.
+ ...
+includes: [isConstructor.js]
+features: [Reflect.construct, Set, arrow-function]
+---*/
+
+assert.sameValue(isConstructor(Set.prototype.has), false, 'isConstructor(Set.prototype.has) must return false');
+
+assert.throws(TypeError, () => {
+ let s = new Set([]); new s.has();
+}, '`let s = new Set([]); new s.has()` throws TypeError');
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-undefined-added-deleted-not-present-undefined.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-undefined-added-deleted-not-present-undefined.js
new file mode 100644
index 0000000000..4391df70be
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-undefined-added-deleted-not-present-undefined.js
@@ -0,0 +1,23 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 6. Return false.
+
+---*/
+
+var s = new Set();
+
+s.add(undefined);
+assert.sameValue(s.has(undefined), true, "`s.has(undefined)` returns `true`");
+
+var result = s.delete(undefined);
+
+assert.sameValue(s.has(undefined), false, "`s.has(undefined)` returns `false`");
+assert.sameValue(result, true, "The result of `s.delete(undefined)` is `true`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-boolean.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-boolean.js
new file mode 100644
index 0000000000..366a694050
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-boolean.js
@@ -0,0 +1,17 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 6. Return false.
+
+---*/
+
+var s = new Set();
+
+assert.sameValue(s.has(false), false, "`s.has(false)` returns `false`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-nan.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-nan.js
new file mode 100644
index 0000000000..7ce69a5c8b
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-nan.js
@@ -0,0 +1,17 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 6. Return false.
+
+---*/
+
+var s = new Set();
+
+assert.sameValue(s.has(NaN), false, "`s.has(NaN)` returns `false`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-null.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-null.js
new file mode 100644
index 0000000000..ddfada5bf3
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-null.js
@@ -0,0 +1,17 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 6. Return false.
+
+---*/
+
+var s = new Set();
+
+assert.sameValue(s.has(null), false, "`s.has(null)` returns `false`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-number.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-number.js
new file mode 100644
index 0000000000..9075d36884
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-number.js
@@ -0,0 +1,17 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 6. Return false.
+
+---*/
+
+var s = new Set();
+
+assert.sameValue(s.has(0), false, "`s.has(0)` returns `false`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-string.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-string.js
new file mode 100644
index 0000000000..f244b2ee87
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-string.js
@@ -0,0 +1,17 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 6. Return false.
+
+---*/
+
+var s = new Set();
+
+assert.sameValue(s.has(""), false, "`s.has('')` returns `false`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-symbol.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-symbol.js
new file mode 100644
index 0000000000..8f974f799c
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-symbol.js
@@ -0,0 +1,18 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 6. Return false.
+
+features: [Symbol]
+---*/
+
+var s = new Set();
+
+assert.sameValue(s.has(Symbol()), false, "`s.has(Symbol())` returns `false`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-undefined.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-undefined.js
new file mode 100644
index 0000000000..6863c7a53f
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-false-when-value-not-present-undefined.js
@@ -0,0 +1,17 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 6. Return false.
+
+---*/
+
+var s = new Set();
+
+assert.sameValue(s.has(undefined), false, "`s.has(undefined)` returns `false`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-boolean.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-boolean.js
new file mode 100644
index 0000000000..4809af3dc6
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-boolean.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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 5. Repeat for each e that is an element of entries,
+ a. If e is not empty and SameValueZero(e, value) is true, return true.
+ ...
+
+---*/
+
+var s = new Set();
+
+s.add(false)
+
+assert.sameValue(s.has(false), true, "`s.has(false)` returns `true`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-nan.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-nan.js
new file mode 100644
index 0000000000..dcc51d54e5
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-nan.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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 5. Repeat for each e that is an element of entries,
+ a. If e is not empty and SameValueZero(e, value) is true, return true.
+ ...
+
+---*/
+
+var s = new Set();
+
+s.add(NaN)
+
+assert.sameValue(s.has(NaN), true, "`s.has(NaN)` returns `true`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-null.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-null.js
new file mode 100644
index 0000000000..7c90fcd66f
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-null.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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 5. Repeat for each e that is an element of entries,
+ a. If e is not empty and SameValueZero(e, value) is true, return true.
+ ...
+
+---*/
+
+var s = new Set();
+
+s.add(null)
+
+assert.sameValue(s.has(null), true, "`s.has(null)` returns `true`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-number.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-number.js
new file mode 100644
index 0000000000..1831aaa35f
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-number.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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 5. Repeat for each e that is an element of entries,
+ a. If e is not empty and SameValueZero(e, value) is true, return true.
+ ...
+
+---*/
+
+var s = new Set();
+
+s.add(0)
+
+assert.sameValue(s.has(0), true, "`s.has(0)` returns `true`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-string.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-string.js
new file mode 100644
index 0000000000..938bcae841
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-string.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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 5. Repeat for each e that is an element of entries,
+ a. If e is not empty and SameValueZero(e, value) is true, return true.
+ ...
+
+---*/
+
+var s = new Set();
+
+s.add("")
+
+assert.sameValue(s.has(""), true, "`s.has('')` returns `true`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-symbol.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-symbol.js
new file mode 100644
index 0000000000..f8c5b80400
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-symbol.js
@@ -0,0 +1,23 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 5. Repeat for each e that is an element of entries,
+ a. If e is not empty and SameValueZero(e, value) is true, return true.
+ ...
+
+features: [Symbol]
+---*/
+
+var s = new Set();
+var a = Symbol();
+
+s.add(a)
+
+assert.sameValue(s.has(a), true, "`s.has(a)` returns `true`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-undefined.js b/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-undefined.js
new file mode 100644
index 0000000000..0f14f5c490
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/returns-true-when-value-present-undefined.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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ ...
+ 5. Repeat for each e that is an element of entries,
+ a. If e is not empty and SameValueZero(e, value) is true, return true.
+ ...
+
+---*/
+
+var s = new Set();
+
+s.add(undefined)
+
+assert.sameValue(s.has(undefined), true, "`s.has(undefined)` returns `true`");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/shell.js b/js/src/tests/test262/built-ins/Set/prototype/has/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/shell.js
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-boolean.js b/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-boolean.js
new file mode 100644
index 0000000000..c954fa9572
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-boolean.js
@@ -0,0 +1,22 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ 1. Let S be the this value.
+ 2. If Type(S) is not Object, throw a TypeError exception.
+
+---*/
+
+assert.throws(TypeError, function() {
+ Set.prototype.has.call(false, 1);
+});
+
+assert.throws(TypeError, function() {
+ var s = new Set();
+ s.has.call(false, 1);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-null.js b/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-null.js
new file mode 100644
index 0000000000..150cb8fb83
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-null.js
@@ -0,0 +1,22 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ 1. Let S be the this value.
+ 2. If Type(S) is not Object, throw a TypeError exception.
+
+---*/
+
+assert.throws(TypeError, function() {
+ Set.prototype.has.call(null, 1);
+});
+
+assert.throws(TypeError, function() {
+ var s = new Set();
+ s.has.call(null, 1);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-number.js b/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-number.js
new file mode 100644
index 0000000000..067c2918bd
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-number.js
@@ -0,0 +1,22 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ 1. Let S be the this value.
+ 2. If Type(S) is not Object, throw a TypeError exception.
+
+---*/
+
+assert.throws(TypeError, function() {
+ Set.prototype.has.call(0, 1);
+});
+
+assert.throws(TypeError, function() {
+ var s = new Set();
+ s.has.call(0, 1);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-string.js b/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-string.js
new file mode 100644
index 0000000000..e8f4b2ec5b
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-string.js
@@ -0,0 +1,22 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ 1. Let S be the this value.
+ 2. If Type(S) is not Object, throw a TypeError exception.
+
+---*/
+
+assert.throws(TypeError, function() {
+ Set.prototype.has.call("", 1);
+});
+
+assert.throws(TypeError, function() {
+ var s = new Set();
+ s.has.call("", 1);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-symbol.js b/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-symbol.js
new file mode 100644
index 0000000000..8254cab357
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-symbol.js
@@ -0,0 +1,23 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ 1. Let S be the this value.
+ 2. If Type(S) is not Object, throw a TypeError exception.
+
+features: [Symbol]
+---*/
+
+assert.throws(TypeError, function() {
+ Set.prototype.has.call(Symbol(), 1);
+});
+
+assert.throws(TypeError, function() {
+ var s = new Set();
+ s.has.call(Symbol(), 1);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-undefined.js b/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-undefined.js
new file mode 100644
index 0000000000..bee6d27e3e
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Set/prototype/has/this-not-object-throw-undefined.js
@@ -0,0 +1,22 @@
+// 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-set.prototype.has
+description: >
+ Set.prototype.has ( value )
+
+ 1. Let S be the this value.
+ 2. If Type(S) is not Object, throw a TypeError exception.
+
+---*/
+
+assert.throws(TypeError, function() {
+ Set.prototype.has.call(undefined, 1);
+});
+
+assert.throws(TypeError, function() {
+ var s = new Set();
+ s.has.call(undefined, 1);
+});
+
+reportCompare(0, 0);