| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ce01372 commit 947d07b
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -645,12 +645,17 @@ Local<Object> SyncProcessRunner::BuildResultObject() { | |||
| 645 | 645 | Integer::New(env()->isolate(), GetError())); | |
| 646 | 646 | } | |
| 647 | 647 | ||
| 648 | - if (exit_status_ >= 0) | ||
| 649 | - js_result->Set(env()->status_string(), | ||
| 650 | - Number::New(env()->isolate(), static_cast<double>(exit_status_))); | ||
| 651 | - else | ||
| 648 | + if (exit_status_ >= 0) { | ||
| 649 | + if (term_signal_ > 0) { | ||
| 650 | + js_result->Set(env()->status_string(), Null(env()->isolate())); | ||
| 651 | + } else { | ||
| 652 | + js_result->Set(env()->status_string(), | ||
| 653 | + Number::New(env()->isolate(), static_cast<double>(exit_status_))); | ||
| 654 | + } | ||
| 655 | + } else { | ||
| 652 | 656 | // If exit_status_ < 0 the process was never started because of some error. | |
| 653 | 657 | js_result->Set(env()->status_string(), Null(env()->isolate())); | |
| 658 | + } | ||
| 654 | 659 | ||
| 655 | 660 | if (term_signal_ > 0) | |
| 656 | 661 | js_result->Set(env()->signal_string(), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,20 +1,19 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - const common = require('../common'); | ||
| 2 | + require('../common'); | ||
| 3 | 3 | const assert = require('assert'); | |
| 4 | 4 | const cp = require('child_process'); | |
| 5 | 5 | ||
| 6 | 6 | if (process.argv[2] === 'child') { | |
| 7 | 7 | setInterval(() => {}, 1000); | |
| 8 | 8 | } else { | |
| 9 | - const exitCode = common.isWindows ? 1 : 0; | ||
| 10 | 9 | const { SIGKILL } = process.binding('constants').os.signals; | |
| 11 | 10 | ||
| 12 | 11 | function spawn(killSignal) { | |
| 13 | 12 | const child = cp.spawnSync(process.execPath, | |
| 14 | 13 | [__filename, 'child'], | |
| 15 | 14 | {killSignal, timeout: 100}); | |
| 16 | 15 | ||
| 17 | - assert.strictEqual(child.status, exitCode); | ||
| 16 | + assert.strictEqual(child.status, null); | ||
| 18 | 17 | assert.strictEqual(child.error.code, 'ETIMEDOUT'); | |
| 19 | 18 | return child; | |
| 20 | 19 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments