GeezerVison is showing github.com — util: remove unused functions · nodejs/node@c605df9
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: lib/internal/util.js -47Lines changed: 0 additions & 47 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -17,7 +17,6 @@ const { | 17 | 17 | ObjectGetOwnPropertyDescriptors, | 18 | 18 | ObjectGetPrototypeOf, | 19 | 19 | ObjectKeys, | 20 | | - ObjectPrototypeHasOwnProperty, | 21 | 20 | ObjectSetPrototypeOf, | 22 | 21 | ObjectValues, | 23 | 22 | Promise, | @@ -354,26 +353,6 @@ function cachedResult(fn) { | 354 | 353 | }; | 355 | 354 | } | 356 | 355 |
| 357 | | -// Useful for Wrapping an ES6 Class with a constructor Function that | 358 | | -// does not require the new keyword. For instance: | 359 | | -// class A { constructor(x) {this.x = x;}} | 360 | | -// const B = createClassWrapper(A); | 361 | | -// B() instanceof A // true | 362 | | -// B() instanceof B // true | 363 | | -function createClassWrapper(type) { | 364 | | - function fn(...args) { | 365 | | - return ReflectConstruct(type, args, new.target || type); | 366 | | - } | 367 | | - // Mask the wrapper function name and length values | 368 | | - ObjectDefineProperties(fn, { | 369 | | - name: { __proto__: null, value: type.name }, | 370 | | - length: { __proto__: null, value: type.length }, | 371 | | - }); | 372 | | - ObjectSetPrototypeOf(fn, type); | 373 | | - fn.prototype = type.prototype; | 374 | | - return fn; | 375 | | -} | 376 | | - | 377 | 356 | let signalsToNamesMapping; | 378 | 357 | function getSignalsToNamesMapping() { | 379 | 358 | if (signalsToNamesMapping !== undefined) | @@ -649,16 +628,6 @@ function exposeNamespace(target, name, namespaceObject) { | 649 | 628 | }); | 650 | 629 | } | 651 | 630 |
| 652 | | -function exposeGetterAndSetter(target, name, getter, setter = undefined) { | 653 | | - ObjectDefineProperty(target, name, { | 654 | | - __proto__: null, | 655 | | - enumerable: false, | 656 | | - configurable: true, | 657 | | - get: getter, | 658 | | - set: setter, | 659 | | - }); | 660 | | -} | 661 | | - | 662 | 631 | function defineReplaceableLazyAttribute(target, id, keys, writable = true, check) { | 663 | 632 | let mod; | 664 | 633 | for (let i = 0; i < keys.length; i++) { | @@ -733,18 +702,6 @@ const kEnumerableProperty = ObjectFreeze({ | 733 | 702 |
| 734 | 703 | const kEmptyObject = ObjectFreeze({ __proto__: null }); | 735 | 704 |
| 736 | | -function filterOwnProperties(source, keys) { | 737 | | - const filtered = { __proto__: null }; | 738 | | - for (let i = 0; i < keys.length; i++) { | 739 | | - const key = keys[i]; | 740 | | - if (ObjectPrototypeHasOwnProperty(source, key)) { | 741 | | - filtered[key] = source[key]; | 742 | | - } | 743 | | - } | 744 | | - | 745 | | - return filtered; | 746 | | -} | 747 | | - | 748 | 705 | /** | 749 | 706 | * Mimics `obj[key] = value` but ignoring potential prototype inheritance. | 750 | 707 | * @param {any} obj | @@ -977,7 +934,6 @@ module.exports = { | 977 | 934 | constructSharedArrayBuffer, | 978 | 935 | convertProcessSignalToExitCode, | 979 | 936 | convertToValidSignal, | 980 | | - createClassWrapper, | 981 | 937 | decorateErrorStack, | 982 | 938 | defineOperation, | 983 | 939 | defineLazyProperties, | @@ -990,13 +946,10 @@ module.exports = { | 990 | 946 | exposeInterface, | 991 | 947 | exposeLazyInterfaces, | 992 | 948 | exposeNamespace, | 993 | | - exposeGetterAndSetter, | 994 | 949 | filterDuplicateStrings, | 995 | | - filterOwnProperties, | 996 | 950 | getConstructorOf, | 997 | 951 | getCIDR, | 998 | 952 | getCWDURL, | 999 | | - getInternalGlobal, | 1000 | 953 | getStructuredStack, | 1001 | 954 | getSystemErrorMap, | 1002 | 955 | getSystemErrorName, | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-internal-util-classwrapper.js -31Lines changed: 0 additions & 31 deletions
|