| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@jasnell I've pushed updates to your branch to use mjs instead of js esm. |
Sorry, something went wrong.
Thank you! :-) |
Sorry, something went wrong.
Signed-off-by: James M Snell <jasnell@gmail.com>
There was a problem hiding this comment.
I think the examples should use the lexical import keyword.
Sorry, something went wrong.
Likely not but I'd rather that folks look at this and ask why it's different than be surprised later when it doesn't work. And, to be fair, I'd like to use this as a good reason to revisit how we do this -- I'd much rather the crypto module not throw on load, and would instead just throw if any of the APIs are actually called. |
Sorry, something went wrong.
There was a problem hiding this comment.
I went over most of these examples, I only tried running a few. It would be really cool if our examples ran
Sorry, something went wrong.
|
@panva ... Would you mind if we went ahead with this PR as is (using the import() function instead of lexical import) then made the switch over to lexical once the code is changed to not throw on load? |
Sorry, something went wrong.
👍 |
Sorry, something went wrong.
The original example used 'return' to terminate the current control flow, which is valid in CommonJS. When the example was copied and modified to use MJS syntax, the 'return' statement was left in but is not allowed. Refs: nodejs#37594
The original example used 'return' to terminate the current control flow, which is valid in CommonJS. When the example was copied and modified to use MJS syntax, the 'return' statement was left in but is not allowed. Refs: #37594 PR-URL: #39949 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
The original example used 'return' to terminate the current control flow, which is valid in CommonJS. When the example was copied and modified to use MJS syntax, the 'return' statement was left in but is not allowed. Refs: #37594 PR-URL: #39949 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
The original example used 'return' to terminate the current control flow, which is valid in CommonJS. When the example was copied and modified to use MJS syntax, the 'return' statement was left in but is not allowed. Refs: #37594 PR-URL: #39949 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
| Back | FazBrowse Home | New Git URL |
Add ESM examples to crypto docs in preparation for #37162 landing.
Blocked for now until nodejs/remark-preset-lint-node#176 lands.
Refs: #37162
/cc @aduh95
Signed-off-by: James M Snell jasnell@gmail.com