@@ -395,6 +395,9 @@ function isBroadcastChannel(value) {
395
395
}
396
396
397
397
class BroadcastChannel extends EventTarget {
398
+ /**
399
+ * @param {string } name
400
+ */
398
401
constructor ( name ) {
399
402
if ( arguments . length === 0 )
400
403
throw new ERR_MISSING_ARGS ( 'name' ) ;
@@ -426,12 +429,18 @@ class BroadcastChannel extends EventTarget {
426
429
} , opts ) } `;
427
430
}
428
431
432
+ /**
433
+ * @type {string }
434
+ */
429
435
get name ( ) {
430
436
if ( ! isBroadcastChannel ( this ) )
431
437
throw new ERR_INVALID_THIS ( 'BroadcastChannel' ) ;
432
438
return this [ kName ] ;
433
439
}
434
440
441
+ /**
442
+ * @returns {void }
443
+ */
435
444
close ( ) {
436
445
if ( ! isBroadcastChannel ( this ) )
437
446
throw new ERR_INVALID_THIS ( 'BroadcastChannel' ) ;
@@ -445,6 +454,11 @@ class BroadcastChannel extends EventTarget {
445
454
this [ kHandle ] = undefined ;
446
455
}
447
456
457
+ /**
458
+ *
459
+ * @param {* } message
460
+ * @returns {void }
461
+ */
448
462
postMessage ( message ) {
449
463
if ( ! isBroadcastChannel ( this ) )
450
464
throw new ERR_INVALID_THIS ( 'BroadcastChannel' ) ;
@@ -460,6 +474,9 @@ class BroadcastChannel extends EventTarget {
460
474
// BroadcastChannel API definition. Typically we shouldn't extend Web
461
475
// Platform APIs with Node.js specific methods but ref and unref
462
476
// are a bit special.
477
+ /**
478
+ * @returns {BroadcastChannel }
479
+ */
463
480
ref ( ) {
464
481
if ( ! isBroadcastChannel ( this ) )
465
482
throw new ERR_INVALID_THIS ( 'BroadcastChannel' ) ;
@@ -472,6 +489,9 @@ class BroadcastChannel extends EventTarget {
472
489
// BroadcastChannel API definition. Typically we shouldn't extend Web
473
490
// Platform APIs with Node.js specific methods but ref and unref
474
491
// are a bit special.
492
+ /**
493
+ * @returns {BroadcastChannel }
494
+ */
475
495
unref ( ) {
476
496
if ( ! isBroadcastChannel ( this ) )
477
497
throw new ERR_INVALID_THIS ( 'BroadcastChannel' ) ;
0 commit comments