doc: fix issue with worker_threads docs

This example function returns a promise directly
rather than implicitly via async/await.

PR-URL: https://github.com/nodejs/node/pull/25712
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
pull/25780/head
Lee Byron 2019-01-25 10:59:31 -08:00 committed by Vse Mozhet Byt
parent 46c5c3388d
commit a0419dd8ca
1 changed files with 1 additions and 1 deletions

View File

@ -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