summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Iterator/prototype/map/clobber-symbol.js
blob: 8d5b2721e1d8917f9fc02ffca1c17ecab01b945c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// |reftest| skip-if(!this.hasOwnProperty('Iterator')) -- Iterator is not enabled unconditionally
//
//

/*---
esid: pending
description: %Iterator.prototype%.map works even if the global Symbol has been clobbered..
info: 
features: [iterator-helpers, Symbol, Symbol.iterator]
---*/

Symbol = undefined;
assertThrowsInstanceOf(() => Symbol.iterator, TypeError);

const iterator = [0].values();
assertEq(
  iterator.map(x => x + 1).next().value, 1,
  '`%Iterator.prototype%.map` still works after Symbol has been clobbered'
);

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