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 Michaël Zasso committed 2019-01-29 22:19:10 +01:00
1 parent c82f2445e5
commit edc9ceb16e
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