Skip to content

Commit

Permalink
simplify handling [[IsHTMLDDA]], is-object case already covered i…
Browse files Browse the repository at this point in the history
…n `is-callable`
  • Loading branch information
zloirock committed Dec 27, 2023
1 parent cb0c76e commit 63b7e18
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- Fixed handling some cases of non-enumerable symbol keys from `Symbol` polyfill
- Removed unneeded NodeJS domains-related logic from `queueMicrotask` polyfill
- Fixed subclassing of wrapped `ArrayBuffer`
- Refactoring, some optimizations
- Refactoring, many different minor optimizations
- Compat data improvements:
- [`Array.fromAsync`](https://github.com/tc39/proposal-array-from-async) marked as [supported from V8 ~ Chrome 121](https://bugs.chromium.org/p/v8/issues/detail?id=13321#c13)
- It seems that the ancient [`Array.prototype.push` bug](https://bugs.chromium.org/p/v8/issues/detail?id=12681) is fixed in V8 ~ Chrome 122 (Hallelujah!)
Expand Down
11 changes: 0 additions & 11 deletions packages/core-js/internals/document-all.js

This file was deleted.

8 changes: 4 additions & 4 deletions packages/core-js/internals/is-callable.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';
var $documentAll = require('../internals/document-all');

var documentAll = $documentAll.all;
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
var documentAll = typeof document == 'object' && document.all;

// `IsCallable` abstract operation
// https://tc39.es/ecma262/#sec-iscallable
module.exports = $documentAll.IS_HTMLDDA ? function (argument) {
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
return typeof argument == 'function' || argument === documentAll;
} : function (argument) {
return typeof argument == 'function';
Expand Down
7 changes: 1 addition & 6 deletions packages/core-js/internals/is-object.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
'use strict';
var isCallable = require('../internals/is-callable');
var $documentAll = require('../internals/document-all');

var documentAll = $documentAll.all;

module.exports = $documentAll.IS_HTMLDDA ? function (it) {
return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;
} : function (it) {
module.exports = function (it) {
return typeof it == 'object' ? it !== null : isCallable(it);
};

0 comments on commit 63b7e18

Please sign in to comment.