Skip to content
This repository has been archived by the owner on Aug 31, 2018. It is now read-only.

worker: apply some preparations to Ayo’s internals #82

Merged
merged 6 commits into from
Sep 27, 2017

Conversation

addaleax
Copy link
Contributor

This simply picks a few commits from #58 for easier review.

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

addaleax added a commit to addaleax/ayo that referenced this pull request Sep 26, 2017
This makes some of the internal `AsyncWrap::MakeCallback()`
utility wrappers throw rather than crash the process when
the requested method is not present on the `this` object.

Doing so makes it easier for future code to expose C++
objects directly to userland, where JS code can overwrite
or delete such methods.

PR-URL: ayojs#82
addaleax added a commit to addaleax/ayo that referenced this pull request Sep 26, 2017
Previously, the `Environment` destructor did not release its
`fs_stats_field_array` memory. The memory is allocated when the
`fs` module is initialized and calls `GetStatValues()`.

PR-URL: ayojs#82
addaleax added a commit to addaleax/ayo that referenced this pull request Sep 26, 2017
addaleax added a commit to addaleax/ayo that referenced this pull request Sep 26, 2017
This adds pairs of methods to the `Environment` class and to public APIs
which can add and remove cleanup handlers.

Unlike `AtExit`, this API targets addon developers rather than
embedders, giving them (and Node’s internals) the ability to register
per-`Environment` cleanup work.

PR-URL: ayojs#82
addaleax added a commit to addaleax/ayo that referenced this pull request Sep 26, 2017
addaleax added a commit to addaleax/ayo that referenced this pull request Sep 26, 2017
This makes some of the internal `AsyncWrap::MakeCallback()`
utility wrappers throw rather than crash the process when
the requested method is not present on the `this` object.

Doing so makes it easier for future code to expose C++
objects directly to userland, where JS code can overwrite
or delete such methods.

PR-URL: ayojs#82
Reviewed-By: Stephen Belanger <[email protected]>
Previously, the `Environment` destructor did not release its
`fs_stats_field_array` memory. The memory is allocated when the
`fs` module is initialized and calls `GetStatValues()`.

PR-URL: ayojs#82
Reviewed-By: Stephen Belanger <[email protected]>
PR-URL: ayojs#82
Reviewed-By: Stephen Belanger <[email protected]>
This adds pairs of methods to the `Environment` class and to public APIs
which can add and remove cleanup handlers.

Unlike `AtExit`, this API targets addon developers rather than
embedders, giving them (and Node’s internals) the ability to register
per-`Environment` cleanup work.

PR-URL: ayojs#82
Reviewed-By: Stephen Belanger <[email protected]>
PR-URL: ayojs#82
Reviewed-By: Stephen Belanger <[email protected]>
@addaleax addaleax merged commit 55e7e61 into ayojs:latest Sep 27, 2017
@addaleax addaleax deleted the workers-impl-precommit branch September 27, 2017 20:39
jasnell pushed a commit to jasnell/node that referenced this pull request Oct 1, 2017
Original PR: ayojs/ayo#82

> This makes some of the internal `AsyncWrap::MakeCallback()`
> utility wrappers throw rather than crash the process when
> the requested method is not present on the `this` object.

> Doing so makes it easier for future code to expose C++
> objects directly to userland, where JS code can overwrite
> or delete such methods.

> PR-URL: ayojs/ayo#82
> Reviewed-By: Stephen Belanger <[email protected]>
jasnell pushed a commit to jasnell/node that referenced this pull request Oct 1, 2017
Original PR: ayojs/ayo#82

> Previously, the `Environment` destructor did not release its
> `fs_stats_field_array` memory. The memory is allocated when the
> `fs` module is initialized and calls `GetStatValues()`.

> PR-URL: ayojs/ayo#82
> Reviewed-By: Stephen Belanger <[email protected]>
jasnell pushed a commit to jasnell/node that referenced this pull request Oct 1, 2017
Original PR: ayojs/ayo#82
> PR-URL: ayojs/ayo#82
> Reviewed-By: Stephen Belanger <[email protected]>
jasnell pushed a commit to jasnell/node that referenced this pull request Oct 1, 2017
Original PR: ayojs/ayo#82

> This adds pairs of methods to the `Environment` class and to public APIs
> which can add and remove cleanup handlers.

> Unlike `AtExit`, this API targets addon developers rather than
> embedders, giving them (and Node’s internals) the ability to register
> per-`Environment` cleanup work.

> PR-URL: ayojs/ayo#82
> Reviewed-By: Stephen Belanger <[email protected]>
jasnell pushed a commit to jasnell/node that referenced this pull request Oct 1, 2017
Original PR: ayojs/ayo#82

> PR-URL: ayojs/ayo#82
> Reviewed-By: Stephen Belanger <[email protected]>
jasnell pushed a commit to jasnell/node that referenced this pull request Oct 1, 2017
Original PR: ayojs/ayo#82

> PR-URL: ayojs/ayo#82
> Reviewed-By: Stephen Belanger <[email protected]>
@addaleax addaleax added the worker label Oct 8, 2017
gabrielschulhof pushed a commit to gabrielschulhof/node that referenced this pull request Aug 21, 2018
This adds pairs of methods to the `Environment` class and to public APIs
which can add and remove cleanup handlers.

Unlike `AtExit`, this API targets addon developers rather than
embedders, giving them (and Node\u2019s internals) the ability to register
per-`Environment` cleanup work.

We may want to replace `AtExit` with this API at some point.

Many thanks for Stephen Belanger for reviewing the original version of
this commit in the Ayo.js project.

Refs: ayojs/ayo#82
PR-URL: nodejs#19377
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants