summaryrefslogtreecommitdiff
path: root/src/env-inl.h
diff options
context:
space:
mode:
authorAndreas Madsen <amwebdk@gmail.com>2017-10-19 14:15:08 +0200
committerAndreas Madsen <amwebdk@gmail.com>2017-10-30 11:27:42 +0100
commit23a3911cb107b0170c0ba803df574007c14ea72c (patch)
tree1b675eefe4443f6288626adf68feeeddd97b5b73 /src/env-inl.h
parent571c04b07a855fc4ba8eeb6d6577662d816cab67 (diff)
downloadnode-new-23a3911cb107b0170c0ba803df574007c14ea72c.tar.gz
async_hooks: enable runtime checks by default
Ref: https://github.com/nodejs/node/pull/15454 PR-URL: https://github.com/nodejs/node/pull/16318 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'src/env-inl.h')
-rw-r--r--src/env-inl.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/env-inl.h b/src/env-inl.h
index e6e189be3d..bd13881cb1 100644
--- a/src/env-inl.h
+++ b/src/env-inl.h
@@ -88,6 +88,13 @@ inline Environment::AsyncHooks::AsyncHooks(v8::Isolate* isolate)
async_id_fields_(isolate, kUidFieldsCount) {
v8::HandleScope handle_scope(isolate_);
+ // Always perform async_hooks checks, not just when async_hooks is enabled.
+ // TODO(AndreasMadsen): Consider removing this for LTS releases.
+ // See discussion in https://github.com/nodejs/node/pull/15454
+ // When removing this, do it by reverting the commit. Otherwise the test
+ // and flag changes won't be included.
+ fields_[kCheck] = 1;
+
// kAsyncIdCounter should start at 1 because that'll be the id the execution
// context during bootstrap (code that runs before entering uv_run()).
async_id_fields_[AsyncHooks::kAsyncIdCounter] = 1;
@@ -129,9 +136,9 @@ inline v8::Local<v8::String> Environment::AsyncHooks::provider_string(int idx) {
return providers_[idx].Get(isolate_);
}
-inline void Environment::AsyncHooks::force_checks() {
- // fields_ does not have the += operator defined
- fields_[kCheck] = fields_[kCheck] + 1;
+inline void Environment::AsyncHooks::no_force_checks() {
+ // fields_ does not have the -= operator defined
+ fields_[kCheck] = fields_[kCheck] - 1;
}
inline void Environment::AsyncHooks::push_async_ids(double async_id,