From 048b6b54ffe444e4a52708ce319a08a01e8d2d1b Mon Sep 17 00:00:00 2001 From: Alexey Shvayka Date: Tue, 14 Apr 2020 22:00:01 +0300 Subject: [PATCH] Assert that Symbol is a constructor --- test/built-ins/Symbol/is-constructor.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/built-ins/Symbol/is-constructor.js diff --git a/test/built-ins/Symbol/is-constructor.js b/test/built-ins/Symbol/is-constructor.js new file mode 100644 index 0000000000..9bcc3b435f --- /dev/null +++ b/test/built-ins/Symbol/is-constructor.js @@ -0,0 +1,19 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-symbol-constructor +description: > + Symbol is a constructor and has [[Construct]] internal method. +info: | + The Symbol constructor: + [...] + * may be used as the value of an extends clause of a class definition + but a super call to it will cause an exception. + [...] + * has a [[Prototype]] internal slot whose value is %Function.prototype%. +includes: [isConstructor.js] +features: [Symbol, Reflect.construct] +---*/ + +assert(isConstructor(Symbol)); +assert.sameValue(Object.getPrototypeOf(Symbol), Function.prototype);