Skip to content

src: refactor `Environment::GetCurrent(isolate)` usage

src: refactor Environment::GetCurrent(isolate) usage

Do not require an explicit HandleScope, or the ability to create one, when using Environment::GetCurrent().

isolate->InContext() is used as an indicator that it is probably okay to create a HandleScope, see also the short discussion in https://github.com/nodejs/node/pull/25775#pullrequestreview-197371049.

src: prefer to get Environment from Context

We explicitly store the context anyway, and can skip the extra steps introduced in Environment::GetCurrent().

src: allow running tasks without Environment

There is no real reason to assume that V8 tasks would have to run in a Node.js Context.

src: forbid handle allocations from Platform tasks

Platform tasks should have their own handle scopes, rather than leak into outer ones.

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

Merge request reports

Loading