summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Symbol/not-callable.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Symbol/not-callable.js')
-rw-r--r--js/src/tests/test262/built-ins/Symbol/not-callable.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Symbol/not-callable.js b/js/src/tests/test262/built-ins/Symbol/not-callable.js
new file mode 100644
index 0000000000..56fe2a3749
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Symbol/not-callable.js
@@ -0,0 +1,36 @@
+// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-properties-of-symbol-instances
+description: >
+ Symbol primitives and objects are not callable.
+info: |
+ Properties of Symbol Instances
+
+ Symbol instances are ordinary objects that inherit properties from the
+ Symbol prototype object. Symbol instances have a [[SymbolData]] internal slot.
+ The [[SymbolData]] internal slot is the Symbol value represented by this
+ Symbol object.
+features: [Symbol]
+---*/
+
+var sym = Symbol('desc');
+var symObj = Object(Symbol());
+
+assert.throws(TypeError, function() {
+ sym();
+});
+
+assert.throws(TypeError, function() {
+ new sym();
+});
+
+assert.throws(TypeError, function() {
+ symObj();
+});
+
+assert.throws(TypeError, function() {
+ new symObj();
+});
+
+reportCompare(0, 0);