| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 93237c5 commit d20235b
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,6 @@ const { | |||
| 8 | 8 | ObjectGetPrototypeOf, | |
| 9 | 9 | ObjectSetPrototypeOf, | |
| 10 | 10 | SymbolHasInstance, | |
| 11 | - WeakRefPrototypeGet | ||
| 12 | 11 | } = primordials; | |
| 13 | 12 | ||
| 14 | 13 | const { | |
@@ -107,7 +106,7 @@ function channel(name) { | |||
| 107 | 106 | function hasSubscribers(name) { | |
| 108 | 107 | let channel; | |
| 109 | 108 | const ref = channels[name]; | |
| 110 | - if (ref) channel = WeakRefPrototypeGet(ref); | ||
| 109 | + if (ref) channel = ref.get(); | ||
| 111 | 110 | if (!channel) { | |
| 112 | 111 | return false; | |
| 113 | 112 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,10 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + require('../common'); | ||
| 3 | + const assert = require('assert'); | ||
| 4 | + const { channel, hasSubscribers } = require('diagnostics_channel'); | ||
| 5 | + | ||
| 6 | + const dc = channel('test'); | ||
| 7 | + assert.ok(!hasSubscribers('test')); | ||
| 8 | + | ||
| 9 | + dc.subscribe(() => {}); | ||
| 10 | + assert.ok(hasSubscribers('test')); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments