- Complete React app with 7 developer tools - JSON Tool with visual structured editor - Serialize Tool with visual structured editor - URL, Base64, CSV/JSON, Beautifier, Diff tools - Responsive navigation with dropdown menu - Dark/light mode toggle - Mobile-responsive design with sticky header - All tools working with copy/paste functionality
31 lines
883 B
JavaScript
31 lines
883 B
JavaScript
'use strict';
|
|
// Should get iterator record of a set-like object before cloning this
|
|
// https://bugs.webkit.org/show_bug.cgi?id=289430
|
|
module.exports = function (METHOD_NAME) {
|
|
try {
|
|
// eslint-disable-next-line es/no-set -- needed for test
|
|
var baseSet = new Set();
|
|
var setLike = {
|
|
size: 0,
|
|
has: function () { return true; },
|
|
keys: function () {
|
|
// eslint-disable-next-line es/no-object-defineproperty -- needed for test
|
|
return Object.defineProperty({}, 'next', {
|
|
get: function () {
|
|
baseSet.clear();
|
|
baseSet.add(4);
|
|
return function () {
|
|
return { done: true };
|
|
};
|
|
}
|
|
});
|
|
}
|
|
};
|
|
var result = baseSet[METHOD_NAME](setLike);
|
|
|
|
return result.size === 1 && result.values().next().value === 4;
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
};
|