Skip to content

Commit a02be1a

Browse files
committed
drop Function.{ isCallable, isConstructor} (proposal is dead)
1 parent d682148 commit a02be1a

File tree

17 files changed

+2
-283
lines changed

17 files changed

+2
-283
lines changed

README.md

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
185185
- [`Symbol.matcher` for pattern matching](#symbolmatcher-for-pattern-matching)
186186
- [Stage 0 proposals](#stage-0-proposals)
187187
- [`Function.prototype.demethodize`](#functionprototypedemethodize)
188-
- [`Function.{ isCallable, isConstructor }`](#function-iscallable-isconstructor-)
189188
- [Web standards](#web-standards)
190189
- [`self`](#self)
191190
- [`structuredClone`](#structuredclone)
@@ -3033,35 +3032,6 @@ const slice = Array.prototype.slice.demethodize();
30333032
30343033
slice([1, 2, 3], 1); // => [2, 3]
30353034
```
3036-
##### [`Function.{ isCallable, isConstructor }`](https://github.com/caitp/TC39-Proposals/blob/trunk/tc39-reflect-isconstructor-iscallable.md)[⬆](#index)
3037-
3038-
Modules [`esnext.function.is-callable`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.function.is-callable.js), [`esnext.function.is-constructor`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.function.is-constructor.js)
3039-
```js
3040-
class Function {
3041-
static isCallable(value: any): boolean;
3042-
static isConstructor(value: any): boolean;
3043-
}
3044-
```
3045-
[*CommonJS entry points:*](#commonjs-api)
3046-
```js
3047-
core-js/proposals/function-is-callable-is-constructor
3048-
core-js(-pure)/full/function/is-callable
3049-
core-js(-pure)/full/function/is-constructor
3050-
```
3051-
[*Examples*](https://is.gd/Kof1he):
3052-
```js
3053-
Function.isCallable(null); // => false
3054-
Function.isCallable({}); // => false
3055-
Function.isCallable(function () {}); // => true
3056-
Function.isCallable(() => {}); // => true
3057-
Function.isCallable(class {}); // => false
3058-
3059-
Function.isConstructor(null); // => false
3060-
Function.isConstructor({}); // => false
3061-
Function.isConstructor(function () {}); // => true
3062-
Function.isConstructor(() => {}); // => false
3063-
Function.isConstructor(class {}); // => true
3064-
```
30653035

30663036
### Web standards[⬆](#index)
30673037
#### `self`[⬆](#index)

packages/core-js-compat/src/data.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,10 +1875,6 @@ export const data = {
18751875
},
18761876
'esnext.function.demethodize': {
18771877
},
1878-
'esnext.function.is-callable': {
1879-
},
1880-
'esnext.function.is-constructor': {
1881-
},
18821878
'esnext.function.metadata': {
18831879
},
18841880
'esnext.iterator.constructor': {
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
'use strict';
22
var parent = require('../../actual/function');
33
require('../../modules/esnext.function.demethodize');
4-
require('../../modules/esnext.function.is-callable');
5-
require('../../modules/esnext.function.is-constructor');
64

75
module.exports = parent;

packages/core-js/full/function/is-callable.js

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

packages/core-js/full/function/is-constructor.js

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

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var constructorRegExp = /^\s*(?:class|function)\b/;
1313
var exec = uncurryThis(constructorRegExp.exec);
1414
var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
1515

16-
var isConstructorModern = function isConstructor(argument) {
16+
var isConstructorModern = function (argument) {
1717
if (!isCallable(argument)) return false;
1818
try {
1919
construct(noop, empty, argument);
@@ -23,7 +23,7 @@ var isConstructorModern = function isConstructor(argument) {
2323
}
2424
};
2525

26-
var isConstructorLegacy = function isConstructor(argument) {
26+
var isConstructorLegacy = function (argument) {
2727
if (!isCallable(argument)) return false;
2828
switch (classof(argument)) {
2929
case 'AsyncFunction':
@@ -40,8 +40,6 @@ var isConstructorLegacy = function isConstructor(argument) {
4040
}
4141
};
4242

43-
isConstructorLegacy.sham = true;
44-
4543
// `IsConstructor` abstract operation
4644
// https://tc39.es/ecma262/#sec-isconstructor
4745
module.exports = !construct || fails(function () {

packages/core-js/modules/esnext.function.is-callable.js

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

packages/core-js/modules/esnext.function.is-constructor.js

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

packages/core-js/proposals/function-is-callable-is-constructor.js

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

packages/core-js/stage/0.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
require('./1');
33

44
require('../proposals/function-demethodize');
5-
require('../proposals/function-is-callable-is-constructor');

0 commit comments

Comments
 (0)