Skip to content
Snippets Groups Projects
Commit a119c860 authored by Jason Mulligan's avatar Jason Mulligan
Browse files

Sending a "SIGHUP" to the ps via `kill()`, removing an unneeded invariant

parent c7ed1445
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,7 @@ var Worker = (function () {
}, {
key: "terminate",
value: function terminate() {
this.child.kill();
this.child.kill("SIGHUP");
}
}]);
......
......@@ -47,8 +47,7 @@ process.once("message", function (obj) {
global.require = require;
global.importScripts = function () {
var script = undefined,
scripts = undefined;
var scripts = undefined;
for (var _len = arguments.length, files = Array(_len), _key = 0; _key < _len; _key++) {
files[_key] = arguments[_key];
......@@ -59,8 +58,7 @@ process.once("message", function (obj) {
return fs.readFileSync(file, "utf8");
}).join("\n");
script = vm.createScript(scripts);
script.runInThisContext();
vm.createScript(scripts).runInThisContext();
}
};
......
{
"name": "tiny-worker",
"version": "1.1.0",
"version": "1.1.1",
"description": "Tiny WebWorker for Server",
"main": "lib/index.js",
"scripts": {
......
......@@ -38,7 +38,7 @@ class Worker {
}
terminate () {
this.child.kill();
this.child.kill("SIGHUP");
}
}
......
......@@ -45,15 +45,14 @@ process.once("message", function (obj) {
global.require = require;
global.importScripts = function (...files) {
let script, scripts;
let scripts;
if (files.length > 0) {
scripts = files.map(function (file) {
return fs.readFileSync(file, "utf8");
}).join("\n");
script = vm.createScript(scripts);
script.runInThisContext();
vm.createScript(scripts).runInThisContext();
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment