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>
This commit is contained in:
Lee Byron authored and Vse Mozhet Byt committed 2019-01-29 02:10:20 +02:00
1 parent 46c5c3388d
commit a0419dd8ca
1 file changed
+1 -1
+1 -1
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