This repository has been archived on 2024-09-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
front/node_modules/es-abstract/2024/CanBeHeldWeakly.js
2024-09-18 13:34:19 -03:00

17 lines
389 B
JavaScript

'use strict';
var KeyForSymbol = require('./KeyForSymbol');
var Type = require('./Type');
// https://262.ecma-international.org/14.0/#sec-canbeheldweakly
module.exports = function CanBeHeldWeakly(v) {
if (Type(v) === 'Object') {
return true; // step 1
}
if (typeof v === 'symbol' && typeof KeyForSymbol(v) === 'undefined') {
return true; // step 2
}
return false; // step 3
};