Skip to content

Commit 5f9e09c

Browse files
committed
Fix naming of portOptions
1 parent 734a2a1 commit 5f9e09c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/src/node.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Future<RenderResult> _renderAsync(RenderOptions options) async {
8181
var file = options.file == null ? null : p.absolute(options.file);
8282
CompileResult result;
8383
if (isMainThread == true) {
84-
print("Creating worker thread");
84+
print(p.current);
8585
final worker = Worker(p.current, WorkerOptions(workerData: {options}));
8686
worker.on('message', (CompileResult msg) => result = msg);
8787
worker.on('error', (JSError error) {
@@ -112,9 +112,7 @@ Future<RenderResult> _renderAsync(RenderOptions options) async {
112112
} else {
113113
throw ArgumentError("Either options.data or options.file must be set.");
114114
}
115-
parentPort?.postMessage(result);
116-
} else {
117-
throw UnsupportedError("Failed to create worker thread.");
115+
parentPort.postMessage(result, PortOptions());
118116
}
119117

120118
return _newRenderResult(options, result, start);

0 commit comments

Comments
 (0)