Update build for #542 #549
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
I noticed that the changes from #542 only affected
src/, but notlib/. As such, the latest 4.6.0 release doesn't actually fix #541, since it still has the bigint literal fyntax inlib/ours/errors.js.I wanted to fix this by rerunning
node build/build.mjslocally. However, that surfaced a couple of more issues, which this PR aims to fix as well:"use strict"only on the very first line. However, most source files start with a copyright comment, so the"use strict"directive only appears a few lines further. I fixed it by turning on the multiline flag on the regex.src/util.jswas usingERR_INVALID_ARG_TYPEwithoutrequireing it fromsrc/errors.js. I added the missingrequire().require()created a cyclic dependency betweenerrors.jsandutil.js, so I had to moveformat,inspectandAggregateErrorout ofutil.jsto break the cycle. (Node does something similar, seelib/internal/util/inspect.js).I think we should have a test on our CI to verify that
lib/has been correctly built using our build script. It's not always obvious to new contributors thatlib/is generated code (see review comment), and it should (hopefully) prevent mistakes like #542 in the future. I'll make a follow-up PR for that.