diff --git a/test/built-ins/Symbol/prototype/description/descriptor.js b/test/built-ins/Symbol/prototype/description/descriptor.js index 0b3d2db3c32b4a7702c92ea3e4a5c0feb189cc1d..bc66519624de53d70e03b1cdc5875dcad3e5fc4d 100644 --- a/test/built-ins/Symbol/prototype/description/descriptor.js +++ b/test/built-ins/Symbol/prototype/description/descriptor.js @@ -8,12 +8,18 @@ description: > info: | `Symbol.prototype.description` is an accessor property whose set accessor function is undefined. +includes: [propertyHelper.js] features: [Symbol.prototype.description] ---*/ -const desc = Object.getOwnPropertyDescriptor(Symbol.prototype, 'description'); -assert.sameValue(typeof desc.get, 'function'); + +var desc = Object.getOwnPropertyDescriptor(Symbol.prototype, 'description'); + assert.sameValue(desc.set, undefined); assert.sameValue(desc.writable, undefined); -assert.sameValue(desc.enumerable, false); -assert.sameValue(desc.configurable, true); +assert.sameValue(typeof desc.get, 'function'); + +verifyProperty(Symbol.prototype, 'description', { + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/Symbol/prototype/description/get.js b/test/built-ins/Symbol/prototype/description/get.js index 64c18dced0f3838f1958e670729b46589a08b9bf..54c0fb06b240c8bf6168b05b01f39de43912646a 100644 --- a/test/built-ins/Symbol/prototype/description/get.js +++ b/test/built-ins/Symbol/prototype/description/get.js @@ -19,3 +19,11 @@ assert.sameValue(symbol.hasOwnProperty('description'), false); const empty = Symbol(); assert.sameValue(empty.description, undefined); assert.sameValue(empty.hasOwnProperty('description'), false); + +const undef = Symbol(undefined); +assert.sameValue(undef.description, undefined); +assert.sameValue(undef.hasOwnProperty('description'), false); + +const emptyStr = Symbol(''); +assert.sameValue(emptyStr.description, ''); +assert.sameValue(emptyStr.hasOwnProperty('description'), false); diff --git a/test/built-ins/Symbol/prototype/description/this-val-non-symbol.js b/test/built-ins/Symbol/prototype/description/this-val-non-symbol.js index 89e222d444d052bb23c917b79d2988702bff7326..0d2fc40b1830c9e1bbfc9519d7e950b55e220bcb 100644 --- a/test/built-ins/Symbol/prototype/description/this-val-non-symbol.js +++ b/test/built-ins/Symbol/prototype/description/this-val-non-symbol.js @@ -13,30 +13,34 @@ info: | features: [Symbol.prototype.description] ---*/ +const getter = Object.getOwnPropertyDescriptor( + Symbol.prototype, 'description' +).get; + assert.throws(TypeError, function() { - Symbol.prototype.description.call(null); + getter.call(null); }); assert.throws(TypeError, function() { - Symbol.prototype.description.call(123); + getter.call(123); }); assert.throws(TypeError, function() { - Symbol.prototype.description.call('test'); + getter.call('test'); }); assert.throws(TypeError, function() { - Symbol.prototype.description.call(true); + getter.call(true); }); assert.throws(TypeError, function() { - Symbol.prototype.description.call(undefined); + getter.call(undefined); }); assert.throws(TypeError, function() { - Symbol.prototype.description.call(new Proxy({}, {})); + getter.call(new Proxy({}, {})); }); assert.throws(TypeError, function() { - Symbol.prototype.description.call({}); + getter.call({}); }); diff --git a/test/built-ins/Symbol/prototype/description/wrapper.js b/test/built-ins/Symbol/prototype/description/wrapper.js index 4acb78fe6abc7c2b6177459415dca1d4035efda7..c117f1b73c660f3a771a5bed3902f58f90dbc9d2 100644 --- a/test/built-ins/Symbol/prototype/description/wrapper.js +++ b/test/built-ins/Symbol/prototype/description/wrapper.js @@ -19,3 +19,11 @@ assert.sameValue(symbol.hasOwnProperty('description'), false); const empty = Object(Symbol()); assert.sameValue(empty.description, undefined); assert.sameValue(empty.hasOwnProperty('description'), false); + +const undef = Object(Symbol(undefined)); +assert.sameValue(undef.description, undefined); +assert.sameValue(undef.hasOwnProperty('description'), false); + +const emptyStr = Object(Symbol('')); +assert.sameValue(emptyStr.description, ''); +assert.sameValue(emptyStr.hasOwnProperty('description'), false);