File tree Expand file tree Collapse file tree
symbol/async-iterator/lib
utils/constructor-name/examples Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020
2121// MODULES //
2222
23- var hasAsyncIteratorSymbolSupport = require ( '@stdlib/assert/has-async-iterator-symbol-support' ) ; // eslint-disable-line id-length
23+ var hasSupport = require ( '@stdlib/assert/has-async-iterator-symbol-support' ) ;
24+ var Sym = require ( '@stdlib/symbol/ctor' ) ;
2425
2526
2627// MAIN //
@@ -39,7 +40,9 @@ var hasAsyncIteratorSymbolSupport = require( '@stdlib/assert/has-async-iterator-
3940* console.log( 'Environment does support Symbol.asyncIterator.' );
4041* }
4142*/
42- var AsyncIteratorSymbol = ( hasAsyncIteratorSymbolSupport ( ) ) ? Symbol . asyncIterator : null ; // eslint-disable-line max-len
43+ var AsyncIteratorSymbol = ( hasSupport ( ) ) ?
44+ Object . getOwnPropertyDescriptor ( Sym , 'asyncIterator' ) . value :
45+ null ;
4346
4447
4548// EXPORTS //
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ function noop() {
4242}
4343
4444console . log ( constructorName ( 'a' ) ) ;
45- // => 'String'
45+ // => undefined
4646
4747console . log ( constructorName ( 5 ) ) ;
4848// => 'Number'
@@ -148,7 +148,7 @@ console.log( constructorName( new Float64Array() ) );
148148console . log ( constructorName ( new ArrayBuffer ( ) ) ) ;
149149// => 'ArrayBuffer'
150150
151- console . log ( constructorName ( new Buffer ( 'beep' ) ) ) ; // eslint-disable-line no-buffer-constructor
151+ console . log ( constructorName ( new Buffer ( 'beep' ) ) ) ;
152152// => 'Buffer'
153153
154154console . log ( constructorName ( Math ) ) ;
You can’t perform that action at this time.
0 commit comments