Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: rework logic of stripping BOM+Shebang from commonjs #27768

Merged
merged 1 commit into from
May 26, 2019

Conversation

devsnek
Copy link
Member

@devsnek devsnek commented May 19, 2019

Fixes #27767

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot
Copy link
Collaborator

@mscdex
Copy link
Contributor

mscdex commented May 19, 2019

Test?

@guybedford
Copy link
Contributor

Does this mean BOM + shebang will now fail? Isn't that a breaking change?

@silverwind
Copy link
Contributor

silverwind commented May 19, 2019

Imo it should strip both, possibly even more than once (e.g. when a file for some reason has 2 BOMs or 2 shebangs).

@devsnek
Copy link
Member Author

devsnek commented May 19, 2019

@silverwind a bom/shebang that doesn't occur as the first bytes of a file isn't a bom/shebang. it's just a collection of bytes that happens to look like a bom/shebang.

@silverwind
Copy link
Contributor

silverwind commented May 19, 2019

I remember having trouble running a script once with two shebangs, like

#!/usr/bin/env node
#!/usr/bin/env node

You could probably write it off as a unsupported edge case.

Double BOM, I have no example, but I could see it happen from sloppily written software.

@BridgeAR
Copy link
Member

A test case would be good and there's an ongoing discussion in tc39/proposal-hashbang#14. It seems like we are relatively flexible in this case since Node.js could handle these similar to how browsers do but we could also decide to be strict about them as suggested here.

@BridgeAR
Copy link
Member

@silverwind having multiple shebangs always seems to be a bug and I don't think we should handle this gracefully.

@Trott
Copy link
Member

Trott commented May 20, 2019

/ping @bakkot

@bakkot
Copy link

bakkot commented May 20, 2019

Approach seems fine to me. It is a breaking change, technically, as noted above.

Putting the logic to strip a BOM in _compile means it will get run for other consumers of that method, but what appears to be the only other consumer is prepending stuff anyway, which makes it irrelevant.

@devsnek devsnek added module Issues and PRs related to the module subsystem. semver-major PRs that contain breaking changes and should be released in the next major version. labels May 20, 2019
@devsnek
Copy link
Member Author

devsnek commented May 20, 2019

fun sidenote: github doesn't recognize a shebang after a bom as a shebang:

@devsnek devsnek requested a review from BridgeAR May 20, 2019 21:26
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM while I would also be fine to accept the BOM before a shebang (for similar reasons as discussed in the TC39 issue).

@devsnek devsnek added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 20, 2019
@devsnek devsnek requested a review from a team May 20, 2019 22:08
@Trott
Copy link
Member

Trott commented May 20, 2019

CITGM on a few platforms (figure this doesn't need to be run on everything under the sun?): https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1853/

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if CITGM doesn't reveal actual dependence on this behavior...

@joyeecheung
Copy link
Member

joyeecheung commented May 21, 2019

I don't think the issue comes from how we strip the BOM - with hashbang shipping in V8, whether the hashbang is ignored is up to the JS parser.

The behavior difference comes from the fact that in -c we still manually wrap the source code and then use new vm.Script to compile the script, so we are the one who strips it. For V8 it always sees the wrapper to be at the beginning of the source. Whereas when the file is loaded as a normal module, we use CompileFunctionInContext and pass the arguments from the API instead of through a wrapper. Even if we do not strip it ourselves, and just strip the BOM before passing it to V8, V8 is now going to ignore the shebang for us.

I think the correct fix should be to use CompileFunctionInContext in check_syntax.js instead, and just strip the BOM before passing the source to V8.

@devsnek
Copy link
Member Author

devsnek commented May 21, 2019

@joyeecheung i agree at a high level, this pr is more about making our handling of stripping consistent between run and check. i'd like to possibly revisit bom stripping in general, as it seems more like something that would happen at file read time than at module compilation time, and we'll need to look at the behaviour of shebang stripping again when v8 enables it by default.

@devsnek devsnek force-pushed the fix/bom-shebang-things branch 4 times, most recently from 11807f4 to 0f42dc8 Compare May 21, 2019 20:56
@BridgeAR
Copy link
Member

@devsnek looking at the code it seems to me this could be partially backported to v12.x. Would you be so kind and open a backport for this where you cherry-pick this commit and add a compatibility patch on top that removes the actual breaking change?

@devsnek
Copy link
Member Author

devsnek commented Jun 17, 2019

@BridgeAR like backport the stripShebangOrBOM function but don't actually use it?

@BridgeAR
Copy link
Member

@devsnek yes. It's pretty much about keeping as many changed code lines as they are while removing the actual breaking change.

@targos
Copy link
Member

targos commented Jun 17, 2019

Note that the V8 7.5 update (#27375), which has already been backported to 12.x-staging partially reverted this PR

BethGriggs added a commit that referenced this pull request Oct 21, 2019
Notable changes:

- **assert**:
    - do not repeat .throws() code (Ruben Bridgewater)
        [#28263](#28263)
    - wrap validation function errors (Ruben Bridgewater)
        [#28263](#28263)
    - fix generatedMessage property (Ruben Bridgewater)
        [#28263](#28263)
    - improve class instance errors (Ruben Bridgewater)
        [#28263](#28263)
- **benchmark**:
    - use test/common/tmpdir consistently (João Reis)
        [#28858](#28858)
- **build**:
    - make full-icu the default for releases (Richard Lau)
        [#29887](#29887)
    - update minimum Xcode version for macOS (Michael Dawson)
        [#29622](#29622)
- **child_process**:
    - runtime deprecate \_channel (cjihrig)
        [#27949](#27949)
    - simplify spawn argument parsing (cjihrig)
        [#27854](#27854)
- **console**:
    - display timeEnd with suitable time unit (Xavier Stouder)
        [#29251](#29251)
- **deps**:
    - patch V8 to 7.8.279.14 (Myles Borins)
        [#29694](#29694)
    - patch V8 to 7.8.279.12 (Myles Borins)
        [#29694](#29694)
    - patch V8 to 7.8.279.10 (Myles Borins)
        [#29694](#29694)
    - update V8's postmortem script (cjihrig)
        [#29694](#29694)
    - V8: cherry-pick 716875d (Myles Borins)
        [#29694](#29694)
    - update V8 to 7.8.279.9 (Myles Borins)
        [#29694](#29694)
    - V8: cherry-pick b33af60 (Michaël Zasso)
        [#28016](#28016)
    - update V8 to 7.6.303.28 (Michaël Zasso)
        [#28016](#28016)
- **domain**:
    - error handler runs outside of its domain (Julien Gilli)
        [#26211](#26211)
- **fs**:
    - make FSWatcher.start private (Lucas Holmquist)
        [#29905](#29905)
    - add runtime deprecate for file stream open() (Robert Nagy)
    [#29061](#29061)
    - allow int64 offset in fs.write/writeSync/fd.write (Zach Bjornson)
    [#26572](#26572)
    - use IsSafeJsInt instead of IsNumber for ftruncate (Zach Bjornson)
    [#26572](#26572)
    - allow int64 offset in fs.read/readSync/fd.read (Zach Bjornson)
    [#26572](#26572)
    - close file descriptor of promisified truncate (João Reis)
    [#28858](#28858)
- **http**:
    - do not emit end after aborted (Robert Nagy)
        [#27984](#27984)
    - don't emit 'data' after 'error' (Robert Nagy)
        [#28711](#28711)
    - remove legacy parser (Anna Henningsen)
        [#29589](#29589)
    - throw if 'host' agent header is not a string value
        (Giorgos Ntemiris)
        [#29568](#29568)
    - replace superfluous connection property with getter/setter
        (Robert Nagy)
        [#29015](#29015)
    - fix test where aborted should not be emitted (Robert Nagy)
        [#20077](#20077)
    - remove default 'timeout' listener on upgrade (Luigi Pinca)
        [#26030](#26030)
- **http, http2**:
    - remove default server timeout (Ali Ijaz Sheikh)
        [#27558](#27558)
- **http2**:
    - remove security revert flags (Anna Henningsen)
        [#29141](#29141)
    - remove callback-based padding (Anna Henningsen)
        [#29144](#29144)
- **lib**:
    - rename validateInteger to validateSafeInteger (Zach Bjornson)
        [#26572](#26572)
    - correct error.errno to always be numeric (Joyee Cheung)
        [#28140](#28140)
    - no need to strip BOM or shebang for scripts (Refael Ackermann)
        [#27375](#27375)
    - rework logic of stripping BOM+Shebang from commonjs (Gus Caplan)
        [#27768](#27768)
- **module**:
    - runtime deprecate createRequireFromPath() (cjihrig)
        [#27951](#27951)
- **readline**:
    - error on falsy values for callback (Sam Roberts)
        [#28109](#28109)
- **repl**:
    - close file descriptor of history file (João Reis)
        [#28858](#28858)
- **src**:
    - bring 425 status code name into accordance with RFC 8470
        (Sergei Osipov)
        [#29880](#29880)
    - update NODE\_MODULE\_VERSION to 79 (Myles Borins)
        [#29694](#29694)
    - update NODE\_MODULE\_VERSION to 78 (Michaël Zasso)
        [#28918](#28918)
    - add error codes to errors thrown in C++ (Yaniv Friedensohn)
        [#27700](#27700)
    - use non-deprecated overload of V8::SetFlagsFromString
        (Michaël Zasso)
        [#28016](#28016)
    - update NODE\_MODULE\_VERSION to 77 (Michaël Zasso)
        [#28016](#28016)
    - update NODE\_MODULE\_VERSION to 74 (Refael Ackermann)
        [#27375](#27375)
    - make process.env.TZ setter clear tz cache (Ben Noordhuis)
        [#20026](#20026)
    - enable V8's WASM trap handlers (Gus Caplan)
        [#27246](#27246)
- **stream**:
    - throw unhandled error for readable with autoDestroy (Robert Nagy)
        [#29806](#29806)
    - always invoke callback before emitting error (Robert Nagy)
        [#29293](#29293)
    - invoke callback before emitting error always (Robert Nagy)
        [#29293](#29293)
    - do not flush destroyed writable (Robert Nagy)
        [#29028](#29028)
    - don't emit finish on error (Robert Nagy)
        [#28979](#28979)
    - disallow stream methods on finished stream (Robert Nagy)
        [#28687](#28687)
    - do not emit after 'error' (Robert Nagy)
        [#28708](#28708)
    - fix destroy() behavior (Robert Nagy)
        [#29058](#29058)
    - simplify `.pipe()` and `.unpipe()` in Readable (Weijia Wang)
        [#28583](#28583)
- **tools**:
    - patch V8 to run on older XCode versions (Ujjwal Sharma)
        [#29694](#29694)
    - update V8 gypfiles (Michaël Zasso)
        [#29694](#29694)
    - support full-icu by default (Steven R. Loomis)
        [#29522](#29522)
- **util**: validate formatWithOptions inspectOptions
    (Ruben Bridgewater)
    [#29824](#29824)

PR-URL: #29504
BethGriggs added a commit that referenced this pull request Oct 21, 2019
Notable changes:

- **assert**:
    - do not repeat .throws() code (Ruben Bridgewater)
        [#28263](#28263)
    - wrap validation function errors (Ruben Bridgewater)
        [#28263](#28263)
    - fix generatedMessage property (Ruben Bridgewater)
        [#28263](#28263)
    - improve class instance errors (Ruben Bridgewater)
        [#28263](#28263)
- **benchmark**:
    - use test/common/tmpdir consistently (João Reis)
        [#28858](#28858)
- **build**:
    - make full-icu the default for releases (Richard Lau)
        [#29887](#29887)
    - update minimum Xcode version for macOS (Michael Dawson)
        [#29622](#29622)
- **child_process**:
    - runtime deprecate \_channel (cjihrig)
        [#27949](#27949)
    - simplify spawn argument parsing (cjihrig)
        [#27854](#27854)
- **console**:
    - display timeEnd with suitable time unit (Xavier Stouder)
        [#29251](#29251)
- **deps**:
    - patch V8 to 7.8.279.14 (Myles Borins)
        [#29694](#29694)
    - patch V8 to 7.8.279.12 (Myles Borins)
        [#29694](#29694)
    - patch V8 to 7.8.279.10 (Myles Borins)
        [#29694](#29694)
    - update V8's postmortem script (cjihrig)
        [#29694](#29694)
    - V8: cherry-pick 716875d (Myles Borins)
        [#29694](#29694)
    - update V8 to 7.8.279.9 (Myles Borins)
        [#29694](#29694)
    - V8: cherry-pick b33af60 (Michaël Zasso)
        [#28016](#28016)
    - update V8 to 7.6.303.28 (Michaël Zasso)
        [#28016](#28016)
- **domain**:
    - error handler runs outside of its domain (Julien Gilli)
        [#26211](#26211)
- **fs**:
    - make FSWatcher.start private (Lucas Holmquist)
        [#29905](#29905)
    - add runtime deprecate for file stream open() (Robert Nagy)
    [#29061](#29061)
    - allow int64 offset in fs.write/writeSync/fd.write (Zach Bjornson)
    [#26572](#26572)
    - use IsSafeJsInt instead of IsNumber for ftruncate (Zach Bjornson)
    [#26572](#26572)
    - allow int64 offset in fs.read/readSync/fd.read (Zach Bjornson)
    [#26572](#26572)
    - close file descriptor of promisified truncate (João Reis)
    [#28858](#28858)
- **http**:
    - do not emit end after aborted (Robert Nagy)
        [#27984](#27984)
    - don't emit 'data' after 'error' (Robert Nagy)
        [#28711](#28711)
    - remove legacy parser (Anna Henningsen)
        [#29589](#29589)
    - throw if 'host' agent header is not a string value
        (Giorgos Ntemiris)
        [#29568](#29568)
    - replace superfluous connection property with getter/setter
        (Robert Nagy)
        [#29015](#29015)
    - fix test where aborted should not be emitted (Robert Nagy)
        [#20077](#20077)
    - remove default 'timeout' listener on upgrade (Luigi Pinca)
        [#26030](#26030)
- **http, http2**:
    - remove default server timeout (Ali Ijaz Sheikh)
        [#27558](#27558)
- **http2**:
    - remove security revert flags (Anna Henningsen)
        [#29141](#29141)
    - remove callback-based padding (Anna Henningsen)
        [#29144](#29144)
- **lib**:
    - rename validateInteger to validateSafeInteger (Zach Bjornson)
        [#26572](#26572)
    - correct error.errno to always be numeric (Joyee Cheung)
        [#28140](#28140)
    - no need to strip BOM or shebang for scripts (Refael Ackermann)
        [#27375](#27375)
    - rework logic of stripping BOM+Shebang from commonjs (Gus Caplan)
        [#27768](#27768)
- **module**:
    - runtime deprecate createRequireFromPath() (cjihrig)
        [#27951](#27951)
- **readline**:
    - error on falsy values for callback (Sam Roberts)
        [#28109](#28109)
- **repl**:
    - close file descriptor of history file (João Reis)
        [#28858](#28858)
- **src**:
    - bring 425 status code name into accordance with RFC 8470
        (Sergei Osipov)
        [#29880](#29880)
    - update NODE\_MODULE\_VERSION to 79 (Myles Borins)
        [#29694](#29694)
    - update NODE\_MODULE\_VERSION to 78 (Michaël Zasso)
        [#28918](#28918)
    - add error codes to errors thrown in C++ (Yaniv Friedensohn)
        [#27700](#27700)
    - use non-deprecated overload of V8::SetFlagsFromString
        (Michaël Zasso)
        [#28016](#28016)
    - update NODE\_MODULE\_VERSION to 77 (Michaël Zasso)
        [#28016](#28016)
    - update NODE\_MODULE\_VERSION to 74 (Refael Ackermann)
        [#27375](#27375)
    - make process.env.TZ setter clear tz cache (Ben Noordhuis)
        [#20026](#20026)
    - enable V8's WASM trap handlers (Gus Caplan)
        [#27246](#27246)
- **stream**:
    - throw unhandled error for readable with autoDestroy (Robert Nagy)
        [#29806](#29806)
    - always invoke callback before emitting error (Robert Nagy)
        [#29293](#29293)
    - invoke callback before emitting error always (Robert Nagy)
        [#29293](#29293)
    - do not flush destroyed writable (Robert Nagy)
        [#29028](#29028)
    - don't emit finish on error (Robert Nagy)
        [#28979](#28979)
    - disallow stream methods on finished stream (Robert Nagy)
        [#28687](#28687)
    - do not emit after 'error' (Robert Nagy)
        [#28708](#28708)
    - fix destroy() behavior (Robert Nagy)
        [#29058](#29058)
    - simplify `.pipe()` and `.unpipe()` in Readable (Weijia Wang)
        [#28583](#28583)
- **tools**:
    - patch V8 to run on older XCode versions (Ujjwal Sharma)
        [#29694](#29694)
    - update V8 gypfiles (Michaël Zasso)
        [#29694](#29694)
    - support full-icu by default (Steven R. Loomis)
        [#29522](#29522)
- **util**: validate formatWithOptions inspectOptions
    (Ruben Bridgewater)
    [#29824](#29824)

PR-URL: #29504
BethGriggs added a commit that referenced this pull request Oct 21, 2019
Notable changes:

- **assert**:
    - do not repeat .throws() code (Ruben Bridgewater)
        [#28263](#28263)
    - wrap validation function errors (Ruben Bridgewater)
        [#28263](#28263)
    - fix generatedMessage property (Ruben Bridgewater)
        [#28263](#28263)
    - improve class instance errors (Ruben Bridgewater)
        [#28263](#28263)
- **benchmark**:
    - use test/common/tmpdir consistently (João Reis)
        [#28858](#28858)
- **build**:
    - make full-icu the default for releases (Richard Lau)
        [#29887](#29887)
    - update minimum Xcode version for macOS (Michael Dawson)
        [#29622](#29622)
- **child_process**:
    - runtime deprecate \_channel (cjihrig)
        [#27949](#27949)
    - simplify spawn argument parsing (cjihrig)
        [#27854](#27854)
- **console**:
    - display timeEnd with suitable time unit (Xavier Stouder)
        [#29251](#29251)
- **deps**:
    - patch V8 to 7.8.279.14 (Myles Borins)
        [#29694](#29694)
    - patch V8 to 7.8.279.12 (Myles Borins)
        [#29694](#29694)
    - patch V8 to 7.8.279.10 (Myles Borins)
        [#29694](#29694)
    - update V8's postmortem script (cjihrig)
        [#29694](#29694)
    - V8: cherry-pick 716875d (Myles Borins)
        [#29694](#29694)
    - update V8 to 7.8.279.9 (Myles Borins)
        [#29694](#29694)
    - V8: cherry-pick b33af60 (Michaël Zasso)
        [#28016](#28016)
    - update V8 to 7.6.303.28 (Michaël Zasso)
        [#28016](#28016)
- **domain**:
    - error handler runs outside of its domain (Julien Gilli)
        [#26211](#26211)
- **fs**:
    - make FSWatcher.start private (Lucas Holmquist)
        [#29905](#29905)
    - add runtime deprecate for file stream open() (Robert Nagy)
    [#29061](#29061)
    - allow int64 offset in fs.write/writeSync/fd.write (Zach Bjornson)
    [#26572](#26572)
    - use IsSafeJsInt instead of IsNumber for ftruncate (Zach Bjornson)
    [#26572](#26572)
    - allow int64 offset in fs.read/readSync/fd.read (Zach Bjornson)
    [#26572](#26572)
    - close file descriptor of promisified truncate (João Reis)
    [#28858](#28858)
- **http**:
    - do not emit end after aborted (Robert Nagy)
        [#27984](#27984)
    - don't emit 'data' after 'error' (Robert Nagy)
        [#28711](#28711)
    - remove legacy parser (Anna Henningsen)
        [#29589](#29589)
    - throw if 'host' agent header is not a string value
        (Giorgos Ntemiris)
        [#29568](#29568)
    - replace superfluous connection property with getter/setter
        (Robert Nagy)
        [#29015](#29015)
    - fix test where aborted should not be emitted (Robert Nagy)
        [#20077](#20077)
    - remove default 'timeout' listener on upgrade (Luigi Pinca)
        [#26030](#26030)
- **http, http2**:
    - remove default server timeout (Ali Ijaz Sheikh)
        [#27558](#27558)
- **http2**:
    - remove security revert flags (Anna Henningsen)
        [#29141](#29141)
    - remove callback-based padding (Anna Henningsen)
        [#29144](#29144)
- **lib**:
    - rename validateInteger to validateSafeInteger (Zach Bjornson)
        [#26572](#26572)
    - correct error.errno to always be numeric (Joyee Cheung)
        [#28140](#28140)
    - no need to strip BOM or shebang for scripts (Refael Ackermann)
        [#27375](#27375)
    - rework logic of stripping BOM+Shebang from commonjs (Gus Caplan)
        [#27768](#27768)
- **module**:
    - runtime deprecate createRequireFromPath() (cjihrig)
        [#27951](#27951)
- **readline**:
    - error on falsy values for callback (Sam Roberts)
        [#28109](#28109)
- **repl**:
    - close file descriptor of history file (João Reis)
        [#28858](#28858)
- **src**:
    - bring 425 status code name into accordance with RFC 8470
        (Sergei Osipov)
        [#29880](#29880)
    - update NODE\_MODULE\_VERSION to 79 (Myles Borins)
        [#29694](#29694)
    - update NODE\_MODULE\_VERSION to 78 (Michaël Zasso)
        [#28918](#28918)
    - add error codes to errors thrown in C++ (Yaniv Friedensohn)
        [#27700](#27700)
    - use non-deprecated overload of V8::SetFlagsFromString
        (Michaël Zasso)
        [#28016](#28016)
    - update NODE\_MODULE\_VERSION to 77 (Michaël Zasso)
        [#28016](#28016)
    - update NODE\_MODULE\_VERSION to 74 (Refael Ackermann)
        [#27375](#27375)
    - make process.env.TZ setter clear tz cache (Ben Noordhuis)
        [#20026](#20026)
    - enable V8's WASM trap handlers (Gus Caplan)
        [#27246](#27246)
- **stream**:
    - throw unhandled error for readable with autoDestroy (Robert Nagy)
        [#29806](#29806)
    - always invoke callback before emitting error (Robert Nagy)
        [#29293](#29293)
    - invoke callback before emitting error always (Robert Nagy)
        [#29293](#29293)
    - do not flush destroyed writable (Robert Nagy)
        [#29028](#29028)
    - don't emit finish on error (Robert Nagy)
        [#28979](#28979)
    - disallow stream methods on finished stream (Robert Nagy)
        [#28687](#28687)
    - do not emit after 'error' (Robert Nagy)
        [#28708](#28708)
    - fix destroy() behavior (Robert Nagy)
        [#29058](#29058)
    - simplify `.pipe()` and `.unpipe()` in Readable (Weijia Wang)
        [#28583](#28583)
- **tools**:
    - patch V8 to run on older XCode versions (Ujjwal Sharma)
        [#29694](#29694)
    - update V8 gypfiles (Michaël Zasso)
        [#29694](#29694)
    - support full-icu by default (Steven R. Loomis)
        [#29522](#29522)
- **util**: validate formatWithOptions inspectOptions
    (Ruben Bridgewater)
    [#29824](#29824)

PR-URL: #29504
BethGriggs added a commit that referenced this pull request Oct 22, 2019
Notable changes:

- **assert**:
    - do not repeat .throws() code (Ruben Bridgewater)
        [#28263](#28263)
    - wrap validation function errors (Ruben Bridgewater)
        [#28263](#28263)
    - fix generatedMessage property (Ruben Bridgewater)
        [#28263](#28263)
    - improve class instance errors (Ruben Bridgewater)
        [#28263](#28263)
- **benchmark**:
    - use test/common/tmpdir consistently (João Reis)
        [#28858](#28858)
- **build**:
    - make full-icu the default for releases (Richard Lau)
        [#29887](#29887)
    - update minimum Xcode version for macOS (Michael Dawson)
        [#29622](#29622)
- **child_process**:
    - runtime deprecate \_channel (cjihrig)
        [#27949](#27949)
    - simplify spawn argument parsing (cjihrig)
        [#27854](#27854)
- **console**:
    - display timeEnd with suitable time unit (Xavier Stouder)
        [#29251](#29251)
- **deps**:
    - patch V8 to 7.8.279.14 (Myles Borins)
        [#29694](#29694)
    - patch V8 to 7.8.279.12 (Myles Borins)
        [#29694](#29694)
    - patch V8 to 7.8.279.10 (Myles Borins)
        [#29694](#29694)
    - update V8's postmortem script (cjihrig)
        [#29694](#29694)
    - V8: cherry-pick 716875d (Myles Borins)
        [#29694](#29694)
    - update V8 to 7.8.279.9 (Myles Borins)
        [#29694](#29694)
    - V8: cherry-pick b33af60 (Michaël Zasso)
        [#28016](#28016)
    - update V8 to 7.6.303.28 (Michaël Zasso)
        [#28016](#28016)
- **domain**:
    - error handler runs outside of its domain (Julien Gilli)
        [#26211](#26211)
- **fs**:
    - make FSWatcher.start private (Lucas Holmquist)
        [#29905](#29905)
    - add runtime deprecate for file stream open() (Robert Nagy)
    [#29061](#29061)
    - allow int64 offset in fs.write/writeSync/fd.write (Zach Bjornson)
    [#26572](#26572)
    - use IsSafeJsInt instead of IsNumber for ftruncate (Zach Bjornson)
    [#26572](#26572)
    - allow int64 offset in fs.read/readSync/fd.read (Zach Bjornson)
    [#26572](#26572)
    - close file descriptor of promisified truncate (João Reis)
    [#28858](#28858)
- **http**:
    - do not emit end after aborted (Robert Nagy)
        [#27984](#27984)
    - don't emit 'data' after 'error' (Robert Nagy)
        [#28711](#28711)
    - remove legacy parser (Anna Henningsen)
        [#29589](#29589)
    - throw if 'host' agent header is not a string value
        (Giorgos Ntemiris)
        [#29568](#29568)
    - replace superfluous connection property with getter/setter
        (Robert Nagy)
        [#29015](#29015)
    - fix test where aborted should not be emitted (Robert Nagy)
        [#20077](#20077)
    - remove default 'timeout' listener on upgrade (Luigi Pinca)
        [#26030](#26030)
- **http, http2**:
    - remove default server timeout (Ali Ijaz Sheikh)
        [#27558](#27558)
- **http2**:
    - remove security revert flags (Anna Henningsen)
        [#29141](#29141)
    - remove callback-based padding (Anna Henningsen)
        [#29144](#29144)
- **lib**:
    - rename validateInteger to validateSafeInteger (Zach Bjornson)
        [#26572](#26572)
    - correct error.errno to always be numeric (Joyee Cheung)
        [#28140](#28140)
    - no need to strip BOM or shebang for scripts (Refael Ackermann)
        [#27375](#27375)
    - rework logic of stripping BOM+Shebang from commonjs (Gus Caplan)
        [#27768](#27768)
- **module**:
    - runtime deprecate createRequireFromPath() (cjihrig)
        [#27951](#27951)
- **readline**:
    - error on falsy values for callback (Sam Roberts)
        [#28109](#28109)
- **repl**:
    - close file descriptor of history file (João Reis)
        [#28858](#28858)
- **src**:
    - bring 425 status code name into accordance with RFC 8470
        (Sergei Osipov)
        [#29880](#29880)
    - update NODE\_MODULE\_VERSION to 79 (Myles Borins)
        [#29694](#29694)
    - update NODE\_MODULE\_VERSION to 78 (Michaël Zasso)
        [#28918](#28918)
    - add error codes to errors thrown in C++ (Yaniv Friedensohn)
        [#27700](#27700)
    - use non-deprecated overload of V8::SetFlagsFromString
        (Michaël Zasso)
        [#28016](#28016)
    - update NODE\_MODULE\_VERSION to 77 (Michaël Zasso)
        [#28016](#28016)
    - update NODE\_MODULE\_VERSION to 74 (Refael Ackermann)
        [#27375](#27375)
    - make process.env.TZ setter clear tz cache (Ben Noordhuis)
        [#20026](#20026)
    - enable V8's WASM trap handlers (Gus Caplan)
        [#27246](#27246)
- **stream**:
    - throw unhandled error for readable with autoDestroy (Robert Nagy)
        [#29806](#29806)
    - always invoke callback before emitting error (Robert Nagy)
        [#29293](#29293)
    - invoke callback before emitting error always (Robert Nagy)
        [#29293](#29293)
    - do not flush destroyed writable (Robert Nagy)
        [#29028](#29028)
    - don't emit finish on error (Robert Nagy)
        [#28979](#28979)
    - disallow stream methods on finished stream (Robert Nagy)
        [#28687](#28687)
    - do not emit after 'error' (Robert Nagy)
        [#28708](#28708)
    - fix destroy() behavior (Robert Nagy)
        [#29058](#29058)
    - simplify `.pipe()` and `.unpipe()` in Readable (Weijia Wang)
        [#28583](#28583)
- **tools**:
    - patch V8 to run on older XCode versions (Ujjwal Sharma)
        [#29694](#29694)
    - update V8 gypfiles (Michaël Zasso)
        [#29694](#29694)
    - support full-icu by default (Steven R. Loomis)
        [#29522](#29522)
- **util**: validate formatWithOptions inspectOptions
    (Ruben Bridgewater)
    [#29824](#29824)

PR-URL: #29504
aduh95 pushed a commit to aduh95/node that referenced this pull request Jan 6, 2020
Fixes nodejs#27767

PR-URL: nodejs#27768
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@MylesBorins
Copy link
Contributor

the 7.5 backport PR didn't actually include either this change or the partial revert

#31228 has been opened to backport but I would like to confirm that it is not breaking before landing it

targos pushed a commit that referenced this pull request Jan 8, 2020
Fixes #27767

Backport-PR-URL: #31228
PR-URL: #27768
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
targos pushed a commit that referenced this pull request Jan 8, 2020
Fixes #27767

Backport-PR-URL: #31228
PR-URL: #27768
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
BethGriggs pushed a commit that referenced this pull request Feb 6, 2020
Fixes #27767

Backport-PR-URL: #31228
PR-URL: #27768
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module Issues and PRs related to the module subsystem. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

node -c rejects BOM before #!, but node accepts it