Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 36.4k
async_hooks: merge resource_symbol with owner_symbol#38468
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -81,7 +81,7 @@ const active_hooks = { | ||
| const { registerDestroyHook } = async_wrap; | ||
| const { enqueueMicrotask } = internalBinding('task_queue'); | ||
| const { resource_symbol, owner_symbol } = internalBinding('symbols'); | ||
| const { owner_symbol } = internalBinding('symbols'); | ||
| // Each constant tracks how many callbacks there are for any given step of | ||
| // async execution. These are tracked so if the user didn't include callbacks | ||
| @@ -178,11 +178,13 @@ function fatalError(e) { | ||
| function lookupPublicResource(resource) { | ||
| if (typeof resource !== 'object' || resource === null) return resource; | ||
| // TODO(addaleax): Merge this with owner_symbol and use it across all | ||
| // AsyncWrap instances. | ||
RaisinTen marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| const publicResource = resource[resource_symbol]; | ||
| if (publicResource !== undefined) | ||
| const publicResource = resource[owner_symbol]; | ||
| if (publicResource != null) { | ||
| return publicResource; | ||
| } | ||
| return resource; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -313,7 +313,7 @@ void AsyncWrap::EmitDestroy(bool from_gc) { | ||
| if (!persistent().IsEmpty() && !from_gc) { | ||
| HandleScope handle_scope(env()->isolate()); | ||
| USE(object()->Set(env()->context(), env()->resource_symbol(), object())); | ||
| USE(object()->Set(env()->context(), env()->owner_symbol(), object())); | ||
| } | ||
RaisinTen marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| @@ -586,7 +586,7 @@ void AsyncWrap::AsyncReset(Local<Object> resource, double execution_async_id, | ||
| Local<Object> obj = object(); | ||
| CHECK(!obj.IsEmpty()); | ||
| if (resource != obj) { | ||
| USE(obj->Set(env()->context(), env()->resource_symbol(), resource)); | ||
| USE(obj->Set(env()->context(), env()->owner_symbol(), resource)); | ||
| } | ||
RaisinTen marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
RaisinTen marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
Uh oh!
There was an error while loading. Please reload this page.