mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
lib: simplify primordials.uncurryThis
PR-URL: https://github.com/nodejs/node/pull/36866 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
This commit is contained in:
1 parent
2e909c4fcc
commit
1a0c5d57aa
1 file changed
+3
-3
@@ -13,10 +13,10 @@
|
||||
// by the native module compiler.
|
||||
|
||||
// `uncurryThis` is equivalent to `func => Function.prototype.call.bind(func)`.
|
||||
// It is using `call.bind(bind, call)` to avoid using `Function.prototype.bind`
|
||||
// after it may have been mutated by users.
|
||||
// It is using `bind.bind(call)` to avoid using `Function.prototype.bind`
|
||||
// and `Function.prototype.call` after it may have been mutated by users.
|
||||
const { bind, call } = Function.prototype;
|
||||
const uncurryThis = call.bind(bind, call);
|
||||
const uncurryThis = bind.bind(call);
|
||||
primordials.uncurryThis = uncurryThis;
|
||||
|
||||
function copyProps(src, dest) {
|
||||
|
||||
Reference in new issue
Block a user