You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
469 B
21 lines
469 B
'use strict';
|
|
|
|
var callBound = require('call-bind/callBound');
|
|
|
|
var $register = callBound('FinalizationRegistry.prototype.register', true);
|
|
|
|
module.exports = $register
|
|
? function isFinalizationRegistry(value) {
|
|
if (!value || typeof value !== 'object') {
|
|
return false;
|
|
}
|
|
try {
|
|
$register(value, {});
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
: function isFinalizationRegistry(value) { // eslint-disable-line no-unused-vars
|
|
return false;
|
|
};
|
|
|