Fix completely broken process.nextTick

This commit is contained in:
Alex Hultman 2019-01-14 17:16:00 +01:00
parent d23e83628d
commit 6a96e07c3c

5
dist/uws.js vendored
View File

@ -1,5 +1,6 @@
/* /*
* Copyright 2018 Alex Hultman and contributors. * Authored by Alex Hultman, 2018-2019.
* Intellectual property of third-party.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -18,7 +19,7 @@ module.exports = (() => {
try { try {
const uWS = require(`./uws_${process.platform}_${process.versions.modules}.node`); const uWS = require(`./uws_${process.platform}_${process.versions.modules}.node`);
/* We are not compatible with Node.js domain */ /* We are not compatible with Node.js domain */
process.nextTick = (f, ...args) => uWS.nextTick(f.apply(...args)); process.nextTick = (f, ...args) => uWS.nextTick(() => f(...args));
return uWS; return uWS;
} catch (e) { } catch (e) {
throw new Error('This version of µWS is not compatible with your Node.js build.\n\n' + e.toString()); throw new Error('This version of µWS is not compatible with your Node.js build.\n\n' + e.toString());