File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ var hasSymbols = require('has-symbols');
66
77var asyncIterProto = typeof AsyncIterator === 'function' ? AsyncIterator . prototype : { } ;
88
9- if ( hasSymbols ( ) && ! ( Symbol . iterator in asyncIterProto ) ) {
10- asyncIterProto [ Symbol . iterator ] = function ( ) {
9+ if ( hasSymbols ( ) && Symbol . asyncIterator && ! ( Symbol . asyncIterator in asyncIterProto ) ) {
10+ asyncIterProto [ Symbol . asyncIterator ] = function ( ) {
1111 return this ;
1212 } ;
1313}
Original file line number Diff line number Diff line change @@ -9,16 +9,16 @@ test('AsyncIterator.prototype', function (t) {
99 t . ok ( asyncIterProto , 'is truthy' ) ;
1010 t . equal ( typeof asyncIterProto , 'object' , 'is an object' ) ;
1111
12- t . test ( 'Symbol.iterator ' , { skip : ! hasSymbols } , function ( st ) {
13- var fn = asyncIterProto [ Symbol . iterator ] ;
12+ t . test ( 'Symbol.asyncIterator ' , { skip : ! hasSymbols || ! Symbol . asyncIterator } , function ( st ) {
13+ var fn = asyncIterProto [ Symbol . asyncIterator ] ;
1414
15- st . equal ( typeof fn , 'function' , 'Symbol.iterator is a function' ) ;
15+ st . equal ( typeof fn , 'function' , 'Symbol.asyncIterator is a function' ) ;
1616
1717 var sentinel = { } ;
1818 st . equal (
1919 fn . call ( sentinel ) ,
2020 sentinel ,
21- 'Symbol.iterator returns receiver'
21+ 'Symbol.asyncIterator returns receiver'
2222 ) ;
2323
2424 st . end ( ) ;
You can’t perform that action at this time.
0 commit comments