main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
389 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var KeyForSymbol = require('./KeyForSymbol');
|
---|
4 | var Type = require('./Type');
|
---|
5 |
|
---|
6 | // https://262.ecma-international.org/14.0/#sec-canbeheldweakly
|
---|
7 |
|
---|
8 | module.exports = function CanBeHeldWeakly(v) {
|
---|
9 | if (Type(v) === 'Object') {
|
---|
10 | return true; // step 1
|
---|
11 | }
|
---|
12 | if (typeof v === 'symbol' && typeof KeyForSymbol(v) === 'undefined') {
|
---|
13 | return true; // step 2
|
---|
14 | }
|
---|
15 | return false; // step 3
|
---|
16 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.