Skip to content

Commit 63b7e18

Browse files
committed
simplify handling [[IsHTMLDDA]], is-object case already covered in is-callable
1 parent cb0c76e commit 63b7e18

File tree

4 files changed

+6
-22
lines changed

4 files changed

+6
-22
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- Fixed handling some cases of non-enumerable symbol keys from `Symbol` polyfill
55
- Removed unneeded NodeJS domains-related logic from `queueMicrotask` polyfill
66
- Fixed subclassing of wrapped `ArrayBuffer`
7-
- Refactoring, some optimizations
7+
- Refactoring, many different minor optimizations
88
- Compat data improvements:
99
- [`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)
1010
- 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!)

packages/core-js/internals/document-all.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/core-js/internals/is-callable.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
'use strict';
2-
var $documentAll = require('../internals/document-all');
3-
4-
var documentAll = $documentAll.all;
2+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
3+
var documentAll = typeof document == 'object' && document.all;
54

65
// `IsCallable` abstract operation
76
// https://tc39.es/ecma262/#sec-iscallable
8-
module.exports = $documentAll.IS_HTMLDDA ? function (argument) {
7+
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
8+
module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
99
return typeof argument == 'function' || argument === documentAll;
1010
} : function (argument) {
1111
return typeof argument == 'function';
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
'use strict';
22
var isCallable = require('../internals/is-callable');
3-
var $documentAll = require('../internals/document-all');
43

5-
var documentAll = $documentAll.all;
6-
7-
module.exports = $documentAll.IS_HTMLDDA ? function (it) {
8-
return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;
9-
} : function (it) {
4+
module.exports = function (it) {
105
return typeof it == 'object' ? it !== null : isCallable(it);
116
};

0 commit comments

Comments
 (0)