@@ -120,7 +120,7 @@ Load as ES6 script (default=autodetect).
120120
121121@item -- bignum
122122Enable the bignum extensions: BigDecimal object, BigFloat object and
123- the @code {"use bigint" } and @code { "use math" } directives .
123+ the @code {"use math" } directive .
124124
125125@item -I file
126126@item -- include file
@@ -167,6 +167,12 @@ Set the C name of the generated data.
167167@item -m
168168Compile as Javascript module (default=autodetect).
169169
170+ @item -D module_name
171+ Compile a dynamically loaded module and its dependencies. This option
172+ is needed when your code uses the @code {import } keyword or the
173+ @code {os.Worker } constructor because the compiler cannot statically
174+ find the name of the dynamically loaded modules.
175+
170176@item -M module_name[,cname]
171177Add initialization code for an external C module. See the
172178@code {c_module } example.
@@ -184,7 +190,7 @@ Disable selected language features to produce a smaller executable file.
184190
185191@item -fbignum
186192Enable the bignum extensions: BigDecimal object, BigFloat object and
187- the @code {"use bigint" } and @code { "use math" } directives .
193+ the @code {"use math" } directive .
188194
189195@end table
190196
@@ -764,13 +770,14 @@ Cancel a timer.
764770Return a string representing the platform: @code {"linux" }, @code {"darwin" },
765771@code {"win32" } or @code {"js" }.
766772
767- @item Worker(source )
773+ @item Worker(module_filename )
768774Constructor to create a new thread (worker) with an API close to the
769- @code {WebWorkers }. @code {source } is a string containing the module
770- source which is executed in the newly created thread. Threads normally
771- don't share any data and communicate between each other with
772- messages. Nested workers are not supported. An example is available in
773- @file {tests/test_worker.js }.
775+ @code {WebWorkers }. @code {module_filename } is a string specifying the
776+ module filename which is executed in the newly created thread. As for
777+ dynamically imported module, it is relative to the current script or
778+ module path. Threads normally don't share any data and communicate
779+ between each other with messages. Nested workers are not supported. An
780+ example is available in @file {tests/test_worker.js }.
774781
775782The worker class has the following static properties:
776783
0 commit comments