Skip to content

Commit

Permalink
doc: fix issue with worker_threads docs
Browse files Browse the repository at this point in the history
This example function returns a promise directly
rather than implicitly via async/await.

PR-URL: #25712
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
leebyron authored and targos committed Jan 29, 2019
1 parent c82f244 commit edc9ceb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/worker_threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const {
} = require('worker_threads');

if (isMainThread) {
module.exports = async function parseJSAsync(script) {
module.exports = function parseJSAsync(script) {
return new Promise((resolve, reject) => {
const worker = new Worker(__filename, {
workerData: script
Expand Down

0 comments on commit edc9ceb

Please sign in to comment.