清空
This commit is contained in:
1 parent
7c2ab0b7ad
commit
cff33ad7d1
6370 files changed
+378844
-82245
No files matched your search
+35
@@ -0,0 +1,35 @@
|
||||
'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;
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user