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

[9.x backport] 17560, 18471, 18509 #18891

Closed
wants to merge 131 commits into from

Conversation

devsnek
Copy link
Member

@devsnek devsnek commented Feb 21, 2018

cherrypicks in the proper order:
#17560
#18471
#18509

0315dd0 was modified to keep ContextifyContext::RunInDebugContext

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

vsemozhetbyt and others added 30 commits February 20, 2018 17:07
PR-URL: nodejs#18222
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reworked rebase of PR nodejs#17360 with feedback

PR-URL: nodejs#18194
Fixes: nodejs#17340
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#18293
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Guy Bedford <[email protected]>
Ensure `common.tmpDir` exists before trying to chdir into it.  Fixes a
"ENOENT: no such file or directory, uv_chdir" error when the temporary
directory is removed before running the test.

PR-URL: nodejs#17407
Reviewed-By: Richard Lau <[email protected]>
V8's behavior changed in c3bd741efd. Top-level variables
in a module are no longer context-allocated by default.

PR-URL: nodejs#18312
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Long ago, V8 was much faster switching on string lengths than values.
That is no longer the case, so we can simplify a couple of methods.

PR-URL: nodejs#18351
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Kyle Farnung <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Move the majority of C++ domain-related code into JS land by introducing
a top level domain callback which handles entering & exiting the domain.

Move the rest of the domain necessities into their own file that creates
an internal binding, to avoid exposing domain-related code on the
process object.

Modify an existing test slightly to better test domain-related code.

PR-URL: nodejs#18291
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
- remove TODOs: the one about defaults has been
addressed, and the one about testing is a work
item that doesn't belong in a doc.
- add some background information

Fixes: nodejs#7843

PR-URL: nodejs#16939
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
PR-URL: nodejs#18445
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
PR-URL: nodejs#18376
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Fixes: nodejs#18434
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
This is described as being a doc-only deprecation subset.

Refs: nodejs#18417
PR-URL: nodejs#18433
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
It makes more sense to provide instructions on how to update the PR
branch before instructions on pushing the commit.

PR-URL: nodejs#18355
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
PR-URL: nodejs#18460
Fixes: nodejs#18459
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Nikolai Vavilov <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
PR-URL: nodejs#18468
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Welcome Gibson to the TSC!

PR-URL: nodejs#18481
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
PR-URL: nodejs#18414
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Also, alphabetize all types in type-parser.js
and fix some nits in type formats.

PR-URL: nodejs#18444
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Move tmpdir functionality to its own module (common/tmpdir).

PR-URL: nodejs#17856
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Under some conditions, the error received from getaddrinfo might
actually be EAGAIN, meaning the request should be retried. Allowing for
5 retries before erroring out.

Also replace one-off function with common.mustNotCall().

PR-URL: nodejs#16534
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Added tests to clarify the implicit behaviour of array header setting vs
object header setting

PR-URL: nodejs#16568
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
This commit updates node_crypto to use the non-deprecated Set functions
that return a v8::Maybe<bool>.

PR-URL: nodejs#17482
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
It should say `win32` and not `posix`.

PR-URL: nodejs#18320
Reviewed-By: James M Snell <[email protected]>
Due to the destructuring the outer variables were not set anymore.

PR-URL: nodejs#18320
Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#18320
Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#18320
Reviewed-By: James M Snell <[email protected]>
justin0022 and others added 18 commits February 20, 2018 19:49
PR-URL: nodejs#18683
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
In ICU 61.x, icu4c will no longer put its declarations in the global namespace.
Everything will be in the "icu::" namespace (or icu_60:: in the linker).
Prepare for this.
https://ssl.icu-project.org/trac/ticket/13460
Adds the remaining options from tls.createSecureContext() to the
string generated by Agent#getName(). This allows https.request() to
accept the options and generate unique sockets appropriately.

PR-URL: nodejs#16402
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Replace var for let or const.

PR-URL: nodejs#18649
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Julian Duque <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Previously, fs.readdirSync calls the function returned by
env->push_values_to_array_function() in batch and check the returned
Maybe right away in C++, which can lead to assertions if the call stack
already reaches the maximum size. This patch fixes that by returning
early the call fails so the stack overflow error will be properly
thrown into JS land.

PR-URL: nodejs#18647
Fixes: nodejs#18645
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#18685
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Missing the length argument in napi_create_function.

PR-URL: nodejs#18661
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
PR-URL: nodejs#18665
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Ref: nodejs#18643

PR-URL: nodejs#18677
Refs: nodejs#18643
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Previously, the err passed to the callback of fs.open() was not checked.

PR-URL: nodejs#18681
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Don't disconnect the child until all exceptions are thrown.

Fixes: nodejs#18659

PR-URL: nodejs#18692
Fixes: nodejs#18659
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: nodejs#18697
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
PR-URL: nodejs#18700
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Rename the `parentId` property on the PromiseWrap object to a
`isChainedPromise` property. The former wasn't quite useful as it was
always defined to be the same value as the trigger id available in the
init hook. Instead rename the property to be closer to the information
it communicates: whether the promise is a chained promise or not.

PR-URL: nodejs#18633
Fixes: nodejs#18470
Reviewed-By: Andreas Madsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Currently the call can lead to a TypeError with the message:
`Cannot read property 'value' of undefined`.

This fixes it by first checking that the first argument is truthy.

PR-URL: nodejs#18729
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Flattens ContextifyContext allows the context interface to be used in
other parts of the code base.

PR-URL: nodejs#17560
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
PR-URL: nodejs#17560
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Adds vm.Module, which wraps around ModuleWrap to provide an interface
for developers to work with modules in a more reflective manner.

Co-authored-by: Timothy Gu <[email protected]>
PR-URL: nodejs#17560
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. v9.x labels Feb 21, 2018
@devsnek
Copy link
Member Author

devsnek commented Feb 21, 2018

The specifier parameter is deemed to be more essential than
referencingModule. Flipping the parameter order allows developers to
write simple linker functions that only take in a specifier.

PR-URL: nodejs#18471
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
This commit fixes up some issues in nodejs#18394.

* Switch vm.Module internals to use the new link method properly
* Fix bug with ModuleWrap::Link
* Add tests for ModuleWrap::Link

PR-URL: nodejs#18509
Fixes: nodejs#18249
Refs: nodejs#18394
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
@devsnek devsnek changed the title [9.x backport] vm: add module support [9.x backport] 17560, 18471, 18509 Feb 21, 2018
@MylesBorins
Copy link
Contributor

MylesBorins commented Feb 21, 2018

@devsnek would you be able to rebase?

nvm I figured it out

@MylesBorins
Copy link
Contributor

MylesBorins commented Feb 21, 2018

landed in 664a681...0e105ae

@devsnek devsnek deleted the backport-17560-to-9.x branch February 21, 2018 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.