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.
36 lines
750 B
36 lines
750 B
5 months ago
|
'use strict';
|
||
|
var getBuiltIn = require('../internals/get-built-in');
|
||
|
|
||
|
var createSetLike = function (size) {
|
||
|
return {
|
||
|
size: size,
|
||
|
has: function () {
|
||
|
return false;
|
||
|
},
|
||
|
keys: function () {
|
||
|
return {
|
||
|
next: function () {
|
||
|
return { done: true };
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
};
|
||
|
};
|
||
|
|
||
|
module.exports = function (name) {
|
||
|
var Set = getBuiltIn('Set');
|
||
|
try {
|
||
|
new Set()[name](createSetLike(0));
|
||
|
try {
|
||
|
// late spec change, early WebKit ~ Safari 17.0 beta implementation does not pass it
|
||
|
// https://github.com/tc39/proposal-set-methods/pull/88
|
||
|
new Set()[name](createSetLike(-1));
|
||
|
return false;
|
||
|
} catch (error2) {
|
||
|
return true;
|
||
|
}
|
||
|
} catch (error) {
|
||
|
return false;
|
||
|
}
|
||
|
};
|