Skip to content

Commit 7b3e222

Browse files
committed
util: remove unused functions
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #63612 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 563db50 commit 7b3e222

2 files changed

Lines changed: 0 additions & 78 deletions

File tree

‎lib/internal/util.js‎

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const {
1717
ObjectGetOwnPropertyDescriptors,
1818
ObjectGetPrototypeOf,
1919
ObjectKeys,
20-
ObjectPrototypeHasOwnProperty,
2120
ObjectSetPrototypeOf,
2221
ObjectValues,
2322
Promise,
@@ -354,26 +353,6 @@ function cachedResult(fn) {
354353
};
355354
}
356355

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-
functioncreateClassWrapper(type){
364-
functionfn(...args){
365-
returnReflectConstruct(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-
returnfn;
375-
}
376-
377356
letsignalsToNamesMapping;
378357
functiongetSignalsToNamesMapping(){
379358
if(signalsToNamesMapping!==undefined)
@@ -649,16 +628,6 @@ function exposeNamespace(target, name, namespaceObject) {
649628
});
650629
}
651630

652-
functionexposeGetterAndSetter(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-
662631
functiondefineReplaceableLazyAttribute(target,id,keys,writable=true,check){
663632
letmod;
664633
for(leti=0;i<keys.length;i++){
@@ -733,18 +702,6 @@ const kEnumerableProperty = ObjectFreeze({
733702

734703
constkEmptyObject=ObjectFreeze({__proto__: null});
735704

736-
functionfilterOwnProperties(source,keys){
737-
constfiltered={__proto__: null};
738-
for(leti=0;i<keys.length;i++){
739-
constkey=keys[i];
740-
if(ObjectPrototypeHasOwnProperty(source,key)){
741-
filtered[key]=source[key];
742-
}
743-
}
744-
745-
returnfiltered;
746-
}
747-
748705
/**
749706
* Mimics `obj[key] = value` but ignoring potential prototype inheritance.
750707
* @param {any} obj
@@ -977,7 +934,6 @@ module.exports = {
977934
constructSharedArrayBuffer,
978935
convertProcessSignalToExitCode,
979936
convertToValidSignal,
980-
createClassWrapper,
981937
decorateErrorStack,
982938
defineOperation,
983939
defineLazyProperties,
@@ -990,13 +946,10 @@ module.exports = {
990946
exposeInterface,
991947
exposeLazyInterfaces,
992948
exposeNamespace,
993-
exposeGetterAndSetter,
994949
filterDuplicateStrings,
995-
filterOwnProperties,
996950
getConstructorOf,
997951
getCIDR,
998952
getCWDURL,
999-
getInternalGlobal,
1000953
getStructuredStack,
1001954
getSystemErrorMap,
1002955
getSystemErrorName,

‎test/parallel/test-internal-util-classwrapper.js‎

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

0 commit comments

Comments
 (0)