File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -238,10 +238,21 @@ exports.isDataView = isDataView;
238238function isSharedArrayBufferToString ( value ) {
239239 return ObjectToString ( value ) === '[object SharedArrayBuffer]' ;
240240}
241- isSharedArrayBufferToString . working = (
242- typeof SharedArrayBuffer !== 'undefined' &&
243- isSharedArrayBufferToString ( new SharedArrayBuffer ( ) )
244- ) ;
241+ // Avoid invoking SharedArrayBuffer constructor until required, then memoize
242+ Object . defineProperty ( isSharedArrayBufferToString , 'working' , {
243+ get : ( function ( ) {
244+ var isWorking ;
245+ return function ( ) {
246+ if ( isWorking === undefined ) {
247+ isWorking = (
248+ typeof SharedArrayBuffer !== 'undefined' &&
249+ isSharedArrayBufferToString ( new SharedArrayBuffer ( ) )
250+ )
251+ }
252+ return isWorking ;
253+ }
254+ } ) ( )
255+ } ) ;
245256function isSharedArrayBuffer ( value ) {
246257 if ( typeof SharedArrayBuffer === 'undefined' ) {
247258 return false ;
You can’t perform that action at this time.
0 commit comments