Please review an enhancement to detect [JavaScript 
modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) 
when added to `javadoc` with the `--add-script` option, which require a 
different `type` attribute in the HTML `<script>` element. The main method of 
detection is to scan the script content for `import` and `export` statements. 
The `*.mjs` extension is also recognized, although it is rarely used for 
browser modules. 

I have tested the recognition against scripts and modules in projects such as 
[Angular](https://github.com/angular/angular) and 
[Mermaid](https://github.com/mermaid-js/mermaid) and it worked quite well in 
detecting JavaScript modules.

-------------

Commit messages:
 - Rename .mjs module
 - Add test
 - Add support for .mjs and `export async`
 - JDK-8317621: --add-script should support JavaScript modules

Changes: https://git.openjdk.org/jdk/pull/18546/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18546&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8317621
  Stats: 205 lines in 3 files changed: 192 ins; 3 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/18546.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18546/head:pull/18546

PR: https://git.openjdk.org/jdk/pull/18546

Reply via email to