| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1aa2080 commit 1efae01
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -62,10 +62,8 @@ async_id AsyncResource::get_trigger_async_id() const { | |||
| 62 | 62 | return async_context_.trigger_async_id; | |
| 63 | 63 | } | |
| 64 | 64 | ||
| 65 | - // TODO(addaleax): We shouldn’t need to use env_->isolate() if we’re just going | ||
| 66 | - // to end up using the Isolate* to figure out the Environment* again. | ||
| 67 | 65 | AsyncResource::CallbackScope::CallbackScope(AsyncResource* res) | |
| 68 | - : node::CallbackScope(res->env_->isolate(), | ||
| 66 | + : node::CallbackScope(res->env_, | ||
| 69 | 67 | res->resource_.Get(res->env_->isolate()), | |
| 70 | 68 | res->async_context_) {} | |
| 71 | 69 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,6 +27,16 @@ CallbackScope::CallbackScope(Isolate* isolate, | |||
| 27 | 27 | try_catch_.SetVerbose(true); | |
| 28 | 28 | } | |
| 29 | 29 | ||
| 30 | + CallbackScope::CallbackScope(Environment* env, | ||
| 31 | + Local<Object> object, | ||
| 32 | + async_context asyncContext) | ||
| 33 | + : private_(new InternalCallbackScope(env, | ||
| 34 | + object, | ||
| 35 | + asyncContext)), | ||
| 36 | + try_catch_(env->isolate()) { | ||
| 37 | + try_catch_.SetVerbose(true); | ||
| 38 | + } | ||
| 39 | + | ||
| 30 | 40 | CallbackScope::~CallbackScope() { | |
| 31 | 41 | if (try_catch_.HasCaught()) | |
| 32 | 42 | private_->MarkAsFailed(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -983,6 +983,9 @@ class NODE_EXTERN CallbackScope { | |||
| 983 | 983 | CallbackScope(v8::Isolate* isolate, | |
| 984 | 984 | v8::Local<v8::Object> resource, | |
| 985 | 985 | async_context asyncContext); | |
| 986 | + CallbackScope(Environment* env, | ||
| 987 | + v8::Local<v8::Object> resource, | ||
| 988 | + async_context asyncContext); | ||
| 986 | 989 | ~CallbackScope(); | |
| 987 | 990 | ||
| 988 | 991 | void operator=(const CallbackScope&) = delete; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -553,7 +553,7 @@ class AsyncContext { | |||
| 553 | 553 | class CallbackScope : public node::CallbackScope { | |
| 554 | 554 | public: | |
| 555 | 555 | explicit CallbackScope(AsyncContext* async_context) | |
| 556 | - : node::CallbackScope(async_context->node_env()->isolate(), | ||
| 556 | + : node::CallbackScope(async_context->node_env(), | ||
| 557 | 557 | async_context->resource_.Get( | |
| 558 | 558 | async_context->node_env()->isolate()), | |
| 559 | 559 | async_context->async_context()) {} | |
| Back | FazBrowse Home | New Git URL |
0 commit comments