1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| 'use strict';
|
| var callBound = require('call-bind/callBound');
|
| var $deref = callBound('WeakRef.prototype.deref', true);
|
| module.exports = typeof WeakRef === 'undefined'
| ? function isWeakRef(value) { // eslint-disable-line no-unused-vars
| return false;
| }
| : function isWeakRef(value) {
| if (!value || typeof value !== 'object') {
| return false;
| }
| try {
| $deref(value);
| return true;
| } catch (e) {
| return false;
| }
| };
|
|