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

src: reorganize process object creation, property implementation and events in C++ land #25397

Closed
wants to merge 7 commits into from

Conversation

@joyeecheung
Copy link
Member

commented Jan 8, 2019

src: move process object creation into node_process_object.cc

Changes SetupProcessObject to CreateProessObject which creates
the process object from scratch and return it to Environment::Start
to be stored in the Environment object.

src: declare process-related C++ methods in node_process.h

Instead of in node_internals.h. Also move process property
accessors that are not reused into node_process_object.cc
and make them static.

process: move C++ process events into node_process_events.cc

Move the C++ process.emit and process.emitWarning methods
from node.cc into into node_process_events.cc, and
reuse the implementation in other places that need to do
process.emit in C++.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
@joyeecheung

This comment has been minimized.

@joyeecheung joyeecheung force-pushed the joyeecheung:move-process branch from 112f3cc to 653543d Jan 8, 2019

@jasnell
jasnell approved these changes Jan 8, 2019
Copy link
Member

left a comment

Very happy to see the ongoing cleanup and reorganization here.

src/node.cc Outdated Show resolved Hide resolved
};
MakeCallback(env->isolate(), process_object, emit_fn.As<Function>(),
arraysize(argv), argv, {0, 0});
ProcessEmit(env, "internalMessage", message);

This comment has been minimized.

Copy link
@addaleax

addaleax Jan 8, 2019

Member

This sounds like something we might want to migrate off process.emit(), right?

This comment has been minimized.

Copy link
@joyeecheung

joyeecheung Jan 9, 2019

Author Member

@addaleax yeah, this looks like the only place where internalMessage is emitted, maybe the C++ side can call a method passed from JS side somehow instead ..

@joyeecheung

This comment has been minimized.

Copy link
Member Author

commented Jan 9, 2019

joyeecheung added 7 commits Dec 31, 2018
process: move C++ process events into node_process_events.cc
Move the C++ `process.emit` and `process.emitWarning` methods
from `node.cc` into into `node_process_events.cc`, and
reuse the implementation in other places that need to do
`process.emit` in C++.
src: declare process-related C++ methods in node_process.h
Instead of in node_internals.h. Also move process property
accessors that are not reused into node_process_object.cc
and make them static.
src: move process object creation into node_process_object.cc
Changes `SetupProcessObject` to `CreateProessObject` which creates
the process object from scratch and return it to `Environment::Start`
to be stored in the Environment object.

@joyeecheung joyeecheung force-pushed the joyeecheung:move-process branch from 5d98be1 to b05ae4e Jan 9, 2019

@joyeecheung

This comment has been minimized.

Copy link
Member Author

commented Jan 9, 2019

Need a rebase to resolve the linter failure. CI: https://ci.nodejs.org/job/node-test-pull-request/20026/

@joyeecheung

This comment has been minimized.

Copy link
Member Author

commented Jan 11, 2019

Landed in 4c9ea8f...84f0581

joyeecheung added a commit that referenced this pull request Jan 11, 2019
src: move process object creation into node_process_object.cc
Changes `SetupProcessObject` to `CreateProessObject` which creates
the process object from scratch and return it to `Environment::Start`
to be stored in the Environment object.

PR-URL: #25397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
joyeecheung added a commit that referenced this pull request Jan 11, 2019
src: declare process-related C++ methods in node_process.h
Instead of in node_internals.h. Also move process property
accessors that are not reused into node_process_object.cc
and make them static.

PR-URL: #25397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
joyeecheung added a commit that referenced this pull request Jan 11, 2019
process: move C++ process events into node_process_events.cc
Move the C++ `process.emit` and `process.emitWarning` methods
from `node.cc` into into `node_process_events.cc`, and
reuse the implementation in other places that need to do
`process.emit` in C++.

PR-URL: #25397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
addaleax added a commit that referenced this pull request Jan 15, 2019
src: move process object creation into node_process_object.cc
Changes `SetupProcessObject` to `CreateProessObject` which creates
the process object from scratch and return it to `Environment::Start`
to be stored in the Environment object.

PR-URL: #25397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
addaleax added a commit that referenced this pull request Jan 15, 2019
src: declare process-related C++ methods in node_process.h
Instead of in node_internals.h. Also move process property
accessors that are not reused into node_process_object.cc
and make them static.

PR-URL: #25397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
addaleax added a commit that referenced this pull request Jan 15, 2019
process: move C++ process events into node_process_events.cc
Move the C++ `process.emit` and `process.emitWarning` methods
from `node.cc` into into `node_process_events.cc`, and
reuse the implementation in other places that need to do
`process.emit` in C++.

PR-URL: #25397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@BridgeAR BridgeAR referenced this pull request Jan 16, 2019
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
src: move process object creation into node_process_object.cc
Changes `SetupProcessObject` to `CreateProessObject` which creates
the process object from scratch and return it to `Environment::Start`
to be stored in the Environment object.

PR-URL: nodejs#25397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
src: declare process-related C++ methods in node_process.h
Instead of in node_internals.h. Also move process property
accessors that are not reused into node_process_object.cc
and make them static.

PR-URL: nodejs#25397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
process: move C++ process events into node_process_events.cc
Move the C++ `process.emit` and `process.emitWarning` methods
from `node.cc` into into `node_process_events.cc`, and
reuse the implementation in other places that need to do
`process.emit` in C++.

PR-URL: nodejs#25397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 17, 2019
src: move process object creation into node_process_object.cc
Changes `SetupProcessObject` to `CreateProessObject` which creates
the process object from scratch and return it to `Environment::Start`
to be stored in the Environment object.

PR-URL: nodejs#25397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 17, 2019
src: declare process-related C++ methods in node_process.h
Instead of in node_internals.h. Also move process property
accessors that are not reused into node_process_object.cc
and make them static.

PR-URL: nodejs#25397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 17, 2019
process: move C++ process events into node_process_events.cc
Move the C++ `process.emit` and `process.emitWarning` methods
from `node.cc` into into `node_process_events.cc`, and
reuse the implementation in other places that need to do
`process.emit` in C++.

PR-URL: nodejs#25397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@MylesBorins MylesBorins referenced this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.