Skip to content

Commit

Permalink
fixup! fixup! Address feedback and refine implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Jan 4, 2023
1 parent 4f20040 commit 8b04de0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/workerd/api/node/async-hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class AsyncLocalStorage final: public jsg::Object {
JSG_METHOD(enterWith);
JSG_METHOD(disable);

if (flags.getNodeJs18CompatExperimental()) {
if (flags.getNodeJsCompat()) {
JSG_TS_OVERRIDE(AsyncLocalStorage<T> {
getStore(): T | undefined;
run<R, TArgs extends any[]>(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R;
Expand Down Expand Up @@ -171,7 +171,7 @@ class AsyncResource final: public jsg::Object {
JSG_METHOD(bind);
JSG_METHOD(runInAsyncScope);

if (flags.getNodeJs18CompatExperimental()) {
if (flags.getNodeJsCompat()) {
JSG_TS_OVERRIDE(interface AsyncResourceOptions {
triggerAsyncId?: number;
});
Expand Down Expand Up @@ -208,7 +208,7 @@ class AsyncHooksModule final: public jsg::Object {
JSG_NESTED_TYPE(AsyncLocalStorage);
JSG_NESTED_TYPE(AsyncResource);

if (flags.getNodeJs18CompatExperimental()) {
if (flags.getNodeJsCompat()) {
JSG_TS_ROOT();
JSG_TS_OVERRIDE(AsyncHooksModule {});
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/workerd/io/worker.c++
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ Worker::Isolate::Isolate(kj::Own<ApiIsolate> apiIsolateParam,
lock->setCaptureThrowsAsRejections(features.getCaptureThrowsAsRejections());
lock->setCommonJsExportDefault(features.getExportCommonJsDefaultNamespace());

if (features.getNodeJs18CompatExperimental()) {
if (features.getNodeJsCompat()) {
// Enabling async context tracking installs a relatively expensive callback on the v8 isolate
// that attaches additional metadata to every promise created. The additional metadata is used
// to implement support for the Node.js AsyncLocalStorage API. Since that is the only current
Expand Down
2 changes: 1 addition & 1 deletion src/workerd/server/workerd-api.c++
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ kj::Own<jsg::ModuleRegistry> WorkerdApiIsolate::compileModules(
}
}

if (getFeatureFlags().getNodeJs18CompatExperimental()) {
if (getFeatureFlags().getNodeJsCompat()) {
api::node::registerNodeJsCompatModules(*modules, getFeatureFlags());
}

Expand Down

0 comments on commit 8b04de0

Please sign in to comment.