From 3a4bd7d05031452ea45780077b091a3e0b207c95 Mon Sep 17 00:00:00 2001 From: Alexey Shvayka Date: Thu, 28 May 2020 15:34:51 +0300 Subject: [PATCH] Add symbol primitive test --- .../primitive-symbol.js | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/built-ins/Object/getOwnPropertyDescriptor/primitive-symbol.js diff --git a/test/built-ins/Object/getOwnPropertyDescriptor/primitive-symbol.js b/test/built-ins/Object/getOwnPropertyDescriptor/primitive-symbol.js new file mode 100644 index 0000000000..12f67f667a --- /dev/null +++ b/test/built-ins/Object/getOwnPropertyDescriptor/primitive-symbol.js @@ -0,0 +1,25 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-object.getownpropertydescriptor +description: > + Symbol primitive as first argument is coerced to object. +info: | + Object.getOwnPropertyDescriptor ( O, P ) + + 1. Let obj be ? ToObject(O). + [...] + 3. Let desc be ? obj.[[GetOwnProperty]](key). + 4. Return FromPropertyDescriptor(desc). + + 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] +---*/ + +assert.sameValue(Object.getOwnPropertyDescriptor(Symbol(), 'foo'), undefined); +assert.sameValue(Object.getOwnPropertyDescriptor(Symbol('foo'), 'description'), undefined);