summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Iterator/proto.js
blob: 642e48d171323e1ec06e1ebd230a339285ba1608 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// |reftest| skip-if(!this.hasOwnProperty('Iterator')) -- Iterator is not enabled unconditionally
/*---
  The prototype of the Iterator constructor is the intrinsic object %FunctionPrototype%.
---*/

assertEq(Object.getPrototypeOf(Iterator), Function.prototype);

const propDesc = Reflect.getOwnPropertyDescriptor(Iterator, 'prototype');
assertEq(propDesc.writable, false);
assertEq(propDesc.enumerable, false);
assertEq(propDesc.configurable, false);

// Make sure @@toStringTag has been set.
const toStringTagDesc = Reflect.getOwnPropertyDescriptor(Iterator.prototype, Symbol.toStringTag);
assertDeepEq(toStringTagDesc, {
  value: "Iterator",
  writable: true,
  enumerable: false,
  configurable: true,
});

if (typeof reportCompare === 'function')
  reportCompare(0, 0);