- Complete React app with 7 developer tools - JSON Tool with visual structured editor - Serialize Tool with visual structured editor - URL, Base64, CSV/JSON, Beautifier, Diff tools - Responsive navigation with dropdown menu - Dark/light mode toggle - Mobile-responsive design with sticky header - All tools working with copy/paste functionality
24 lines
564 B
JavaScript
24 lines
564 B
JavaScript
'use strict';
|
|
|
|
var callBound = require('call-bound');
|
|
|
|
var $TypeError = require('es-errors/type');
|
|
var $deref = callBound('WeakRef.prototype.deref', true);
|
|
|
|
var isWeakRef = require('is-weakref');
|
|
|
|
var AddToKeptObjects = require('./AddToKeptObjects');
|
|
|
|
// https://262.ecma-international.org/12.0/#sec-weakrefderef
|
|
|
|
module.exports = function WeakRefDeref(weakRef) {
|
|
if (!isWeakRef(weakRef)) {
|
|
throw new $TypeError('Assertion failed: `weakRef` must be a WeakRef');
|
|
}
|
|
var target = $deref(weakRef);
|
|
if (target) {
|
|
AddToKeptObjects(target);
|
|
}
|
|
return target;
|
|
};
|