summaryrefslogtreecommitdiff
path: root/lib/internal/util.js
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-12-12 14:32:26 +0100
committerRich Trott <rtrott@gmail.com>2018-12-15 06:43:38 -0800
commitc9a7088bd80dc190dfc140167998bd004911eef5 (patch)
treef56608e70d5767b515b0c9bdcfc65933631c2f06 /lib/internal/util.js
parentba4466e1b18cbcf56ac357974c09e1ccf9248c02 (diff)
downloadandroid-node-v8-c9a7088bd80dc190dfc140167998bd004911eef5.tar.gz
android-node-v8-c9a7088bd80dc190dfc140167998bd004911eef5.tar.bz2
android-node-v8-c9a7088bd80dc190dfc140167998bd004911eef5.zip
stream: re-use existing `once()` implementation
PR-URL: https://github.com/nodejs/node/pull/24991 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'lib/internal/util.js')
-rw-r--r--lib/internal/util.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/util.js b/lib/internal/util.js
index ee550fad2e..7af06351c9 100644
--- a/lib/internal/util.js
+++ b/lib/internal/util.js
@@ -375,7 +375,7 @@ function once(callback) {
return function(...args) {
if (called) return;
called = true;
- callback(...args);
+ callback.apply(this, args);
};
}