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.
28 lines
484 B
28 lines
484 B
2 years ago
|
var getBuiltIn = require('../internals/get-built-in');
|
||
|
|
||
|
var createEmptySetLike = function () {
|
||
|
return {
|
||
|
size: 0,
|
||
|
has: function () {
|
||
|
return false;
|
||
|
},
|
||
|
keys: function () {
|
||
|
return {
|
||
|
next: function () {
|
||
|
return { done: true };
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
};
|
||
|
};
|
||
|
|
||
|
module.exports = function (name) {
|
||
|
try {
|
||
|
var Set = getBuiltIn('Set');
|
||
|
new Set()[name](createEmptySetLike());
|
||
|
return true;
|
||
|
} catch (error) {
|
||
|
return false;
|
||
|
}
|
||
|
};
|