mirror of
https://github.com/tc39/test262.git
synced 2025-07-28 16:34:27 +02:00
fix broken Iterator.prototype constructor/Symbol.toStringTag tests (#3996)
* fix broken Iterator.prototype constructor/Symbol.toStringTag tests * fix lint: unused includes
This commit is contained in:
parent
fed13c1915
commit
e4f91b6381
@ -6,13 +6,11 @@ description: Property descriptor
|
||||
info: |
|
||||
`Iterator.prototype[@@toStringTag]` is an accessor property with attributes { [[Enumerable]]: *false*, [[Configurable]]: *true* }
|
||||
features: [iterator-helpers]
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
verifyConfigurable(Iterator.prototype, Symbol.toStringTag);
|
||||
verifyNotEnumerable(Iterator.prototype, Symbol.toStringTag);
|
||||
|
||||
let desc = Object.getOwnPropertyDescriptor(Iterator.prototype, Symbol.toStringTag);
|
||||
assert.sameValue(typeof desc.get, 'function');
|
||||
assert.sameValue(typeof desc.set, 'function');
|
||||
assert.sameValue(desc.configurable, true);
|
||||
assert.sameValue(desc.enumerable, false);
|
||||
assert.sameValue(desc.value, undefined);
|
||||
assert.sameValue(desc.writable, undefined);
|
||||
|
@ -24,15 +24,15 @@ assert.sameValue(get.call(), 'Iterator');
|
||||
|
||||
// 1. If _this_ is not an Object, then
|
||||
// 1. Throw a *TypeError* exception.
|
||||
assert.throws(() => set.call(undefined, ''));
|
||||
assert.throws(() => set.call(null, ''));
|
||||
assert.throws(() => set.call(true, ''));
|
||||
assert.throws(TypeError, () => set.call(undefined, ''));
|
||||
assert.throws(TypeError, () => set.call(null, ''));
|
||||
assert.throws(TypeError, () => set.call(true, ''));
|
||||
|
||||
// 1. If _this_ is _home_, then
|
||||
// 1. NOTE: Throwing here emulates assignment to a non-writable data property on the _home_ object in strict mode code.
|
||||
// 1. Throw a *TypeError* exception.
|
||||
assert.throws(() => set.call(IteratorPrototype, ''));
|
||||
assert.throws(() => IteratorPrototype[Symbol.toStringTag] = '');
|
||||
assert.throws(TypeError, () => set.call(IteratorPrototype, ''));
|
||||
assert.throws(TypeError, () => IteratorPrototype[Symbol.toStringTag] = '');
|
||||
|
||||
assert.sameValue(Iterator.prototype[Symbol.toStringTag], 'Iterator');
|
||||
assert.sameValue(get.call(), 'Iterator');
|
||||
|
@ -6,13 +6,11 @@ description: Property descriptor
|
||||
info: |
|
||||
`Iterator.prototype.constructor` is an accessor property with attributes { [[Enumerable]]: *false*, [[Configurable]]: *true* }
|
||||
features: [iterator-helpers]
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
verifyConfigurable(Iterator.prototype, 'constructor');
|
||||
verifyNotEnumerable(Iterator.prototype, 'constructor');
|
||||
|
||||
let desc = Object.getOwnPropertyDescriptor(Iterator.prototype, 'constructor');
|
||||
assert.sameValue(typeof desc.get, 'function');
|
||||
assert.sameValue(typeof desc.set, 'function');
|
||||
assert.sameValue(desc.configurable, true);
|
||||
assert.sameValue(desc.enumerable, false);
|
||||
assert.sameValue(desc.value, undefined);
|
||||
assert.sameValue(desc.writable, undefined);
|
||||
|
@ -24,15 +24,15 @@ assert.sameValue(get.call(), Iterator);
|
||||
|
||||
// 1. If _this_ is not an Object, then
|
||||
// 1. Throw a *TypeError* exception.
|
||||
assert.throws(() => set.call(undefined, ''));
|
||||
assert.throws(() => set.call(null, ''));
|
||||
assert.throws(() => set.call(true, ''));
|
||||
assert.throws(TypeError, () => set.call(undefined, ''));
|
||||
assert.throws(TypeError, () => set.call(null, ''));
|
||||
assert.throws(TypeError, () => set.call(true, ''));
|
||||
|
||||
// 1. If _this_ is _home_, then
|
||||
// 1. NOTE: Throwing here emulates assignment to a non-writable data property on the _home_ object in strict mode code.
|
||||
// 1. Throw a *TypeError* exception.
|
||||
assert.throws(() => set.call(IteratorPrototype, ''));
|
||||
assert.throws(() => IteratorPrototype.constructor = '');
|
||||
assert.throws(TypeError, () => set.call(IteratorPrototype, ''));
|
||||
assert.throws(TypeError, () => IteratorPrototype.constructor = '');
|
||||
|
||||
assert.sameValue(Iterator.prototype.constructor, Iterator);
|
||||
assert.sameValue(get.call(), Iterator);
|
||||
|
Loading…
x
Reference in New Issue
Block a user