-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ESM conversion The changes are interesting WRT require, as it should still be in existance in ESM but is CJS specific https://nodejs.org/api/esm.html#require __filename and __dirname are probably broken * Arrow/let transformation * Missing export * Fix process export * Bad process export * Breaking: Remove Node.Globals Some of these bindings are no longer available with es modules, and all of them are dodgy (and probably in the wrong place). * Removed '"use strict";' in FFI files * Update to CI to use 'unstable' purescript * Update Bower dependencies to master or main * Update pulp to 16.0.0-0 * Update psa to 0.8.2 * Update Bower dependencies to master or main * Add changelog entry * Update ci.yml to v2 * Update src/Node/Process.js * Update eslintrc * Readd environment section to eslint Co-authored-by: Nicholas Wolverson <[email protected]> Co-authored-by: Thomas Honeyman <[email protected]>
- Loading branch information
1 parent
e1e807a
commit e636d1d
Showing
8 changed files
with
56 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,70 @@ | ||
"use strict"; | ||
import process from "process"; | ||
export { process }; | ||
|
||
exports.process = process; | ||
|
||
exports.onBeforeExit = function (callback) { | ||
return function () { | ||
export function onBeforeExit(callback) { | ||
return () => { | ||
process.on("beforeExit", callback); | ||
}; | ||
}; | ||
} | ||
|
||
exports.onExit = function (callback) { | ||
return function () { | ||
process.on("exit", function (code) { | ||
export function onExit(callback) { | ||
return () => { | ||
process.on("exit", code => { | ||
callback(code)(); | ||
}); | ||
}; | ||
}; | ||
} | ||
|
||
exports.onUncaughtException = function (callback) { | ||
return function () { | ||
process.on("uncaughtException", function (error) { | ||
export function onUncaughtException(callback) { | ||
return () => { | ||
process.on("uncaughtException", error => { | ||
callback(error)(); | ||
}); | ||
}; | ||
}; | ||
} | ||
|
||
exports.onUnhandledRejection = function (callback) { | ||
return function () { | ||
process.on("unhandledRejection", function (error, promise) { | ||
export function onUnhandledRejection(callback) { | ||
return () => { | ||
process.on("unhandledRejection", (error, promise) => { | ||
callback(error)(promise)(); | ||
}); | ||
}; | ||
}; | ||
} | ||
|
||
exports.onSignalImpl = function (signal) { | ||
return function (callback) { | ||
return function () { | ||
process.on(signal, callback); | ||
}; | ||
export function onSignalImpl(signal) { | ||
return callback => () => { | ||
process.on(signal, callback); | ||
}; | ||
}; | ||
} | ||
|
||
exports.chdir = function (dir) { | ||
return function () { | ||
export function chdir(dir) { | ||
return () => { | ||
process.chdir(dir); | ||
}; | ||
}; | ||
} | ||
|
||
exports.setEnv = function (var_) { | ||
return function (val) { | ||
return function () { | ||
process.env[var_] = val; | ||
}; | ||
export function setEnv(var_) { | ||
return val => () => { | ||
process.env[var_] = val; | ||
}; | ||
}; | ||
} | ||
|
||
exports.unsetEnv = function (var_) { | ||
return function () { | ||
export function unsetEnv(var_) { | ||
return () => { | ||
delete process.env[var_]; | ||
}; | ||
}; | ||
} | ||
|
||
exports.exit = function (code) { | ||
return function () { | ||
export function exit(code) { | ||
return () => { | ||
process.exit(code); | ||
}; | ||
}; | ||
} | ||
|
||
exports.copyArray = function (xs) { | ||
return function () { | ||
return xs.slice(); | ||
}; | ||
}; | ||
export function copyArray(xs) { | ||
return () => xs.slice(); | ||
} | ||
|
||
exports.copyObject = function (o) { | ||
return function () { | ||
return Object.assign({}, o); | ||
}; | ||
}; | ||
export function copyObject(o) { | ||
return () => Object.assign({}, o); | ||
} |