Skip to content

Commit

Permalink
[[CHORE]] Fix bug in test script
Browse files Browse the repository at this point in the history
Avoid using `process.exit` in order to ensure that all output is written
prior to process termination. From the Node.js documentation:

> Rather than calling process.exit() directly, the code should set the
> process.exitCode and allow the process to exit naturally by avoiding
> scheduling any additional work for the event loop:
>
>     // How to properly set the exit code while letting
>     // the process exit gracefully.
>     if (someConditionNotMet()) {
>       printUsageToStdout();
>       process.exitCode = 1;
>     }
>
> If it is necessary to terminate the Node.js process due to an error
> condition, throwing an uncaught error and allowing the process to
> terminate accordingly is safer than calling process.exit().

Source: https://nodejs.org/api/process.html#process_process_exit_code
  • Loading branch information
jugglinmike committed May 6, 2017
1 parent 5b957f6 commit e6c89f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test262/index.js
Expand Up @@ -124,7 +124,7 @@ findTests(paths.test262, function(err, testNames) {
console.log(output);
} else {
console.error(output);
process.exit(1);
process.exitCode = 1;
}
});
});
Expand Down

0 comments on commit e6c89f0

Please sign in to comment.