| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 31a3b72 commit 058a8d5
12 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -105,7 +105,7 @@ void InternalCallbackScope::Close() { | |||
| 105 | 105 | ||
| 106 | 106 | if (!env_->can_call_into_js()) return; | |
| 107 | 107 | ||
| 108 | - OnScopeLeave weakref_cleanup([&]() { env_->RunWeakRefCleanup(); }); | ||
| 108 | + auto weakref_cleanup = OnScopeLeave([&]() { env_->RunWeakRefCleanup(); }); | ||
| 109 | 109 | ||
| 110 | 110 | if (!tick_info->has_tick_scheduled()) { | |
| 111 | 111 | MicrotasksScope::PerformCheckpoint(env_->isolate()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -333,7 +333,7 @@ MoveTextRegionToLargePages(const text_region& r) { | |||
| 333 | 333 | PrintSystemError(errno); | |
| 334 | 334 | return -1; | |
| 335 | 335 | } | |
| 336 | - OnScopeLeave munmap_on_return([nmem, size]() { | ||
| 336 | + auto munmap_on_return = OnScopeLeave([nmem, size]() { | ||
| 337 | 337 | if (-1 == munmap(nmem, size)) PrintSystemError(errno); | |
| 338 | 338 | }); | |
| 339 | 339 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -152,7 +152,7 @@ void* wrapped_dlopen(const char* filename, int flags) { | |||
| 152 | 152 | Mutex::ScopedLock lock(dlhandles_mutex); | |
| 153 | 153 | ||
| 154 | 154 | uv_fs_t req; | |
| 155 | - OnScopeLeave cleanup([&]() { uv_fs_req_cleanup(&req); }); | ||
| 155 | + auto cleanup = OnScopeLeave([&]() { uv_fs_req_cleanup(&req); }); | ||
| 156 | 156 | int rc = uv_fs_stat(nullptr, &req, filename, nullptr); | |
| 157 | 157 | ||
| 158 | 158 | if (rc != 0) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -149,7 +149,7 @@ Local<Array> RealEnvStore::Enumerate(Isolate* isolate) const { | |||
| 149 | 149 | uv_env_item_t* items; | |
| 150 | 150 | int count; | |
| 151 | 151 | ||
| 152 | - OnScopeLeave cleanup([&]() { uv_os_free_environ(items, count); }); | ||
| 152 | + auto cleanup = OnScopeLeave([&]() { uv_os_free_environ(items, count); }); | ||
| 153 | 153 | CHECK_EQ(uv_os_environ(&items, &count), 0); | |
| 154 | 154 | ||
| 155 | 155 | MaybeStackBuffer<Local<Value>, 256> env_v(count); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -586,7 +586,7 @@ class Parser : public AsyncWrap, public StreamListener { | |||
| 586 | 586 | // Once we’re done here, either indicate that the HTTP parser buffer | |
| 587 | 587 | // is free for re-use, or free() the data if it didn’t come from there | |
| 588 | 588 | // in the first place. | |
| 589 | - OnScopeLeave on_scope_leave([&]() { | ||
| 589 | + auto on_scope_leave = OnScopeLeave([&]() { | ||
| 590 | 590 | if (buf.base == env()->http_parser_buffer()) | |
| 591 | 591 | env()->set_http_parser_buffer_in_use(false); | |
| 592 | 592 | else | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -217,7 +217,7 @@ class ConverterObject : public BaseObject, Converter { | |||
| 217 | 217 | result.AllocateSufficientStorage(limit); | |
| 218 | 218 | ||
| 219 | 219 | UBool flush = (flags & CONVERTER_FLAGS_FLUSH) == CONVERTER_FLAGS_FLUSH; | |
| 220 | - OnScopeLeave cleanup([&]() { | ||
| 220 | + auto cleanup = OnScopeLeave([&]() { | ||
| 221 | 221 | if (flush) { | |
| 222 | 222 | // Reset the converter state. | |
| 223 | 223 | converter->bomSeen_ = false; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -809,7 +809,7 @@ void GetOptions(const FunctionCallbackInfo<Value>& args) { | |||
| 809 | 809 | per_process::cli_options->per_isolate = env->isolate_data()->options(); | |
| 810 | 810 | auto original_per_env = per_process::cli_options->per_isolate->per_env; | |
| 811 | 811 | per_process::cli_options->per_isolate->per_env = env->options(); | |
| 812 | - OnScopeLeave on_scope_leave([&]() { | ||
| 812 | + auto on_scope_leave = OnScopeLeave([&]() { | ||
| 813 | 813 | per_process::cli_options->per_isolate->per_env = original_per_env; | |
| 814 | 814 | per_process::cli_options->per_isolate = original_per_isolate; | |
| 815 | 815 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -302,7 +302,7 @@ static void GetUserInfo(const FunctionCallbackInfo<Value>& args) { | |||
| 302 | 302 | return args.GetReturnValue().SetUndefined(); | |
| 303 | 303 | } | |
| 304 | 304 | ||
| 305 | - OnScopeLeave free_passwd([&]() { uv_os_free_passwd(&pwd); }); | ||
| 305 | + auto free_passwd = OnScopeLeave([&]() { uv_os_free_passwd(&pwd); }); | ||
| 306 | 306 | ||
| 307 | 307 | Local<Value> error; | |
| 308 | 308 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -362,7 +362,7 @@ static void DebugProcess(const FunctionCallbackInfo<Value>& args) { | |||
| 362 | 362 | LPTHREAD_START_ROUTINE* handler = nullptr; | |
| 363 | 363 | DWORD pid = 0; | |
| 364 | 364 | ||
| 365 | - OnScopeLeave cleanup([&]() { | ||
| 365 | + auto cleanup = OnScopeLeave([&]() { | ||
| 366 | 366 | if (process != nullptr) CloseHandle(process); | |
| 367 | 367 | if (thread != nullptr) CloseHandle(thread); | |
| 368 | 368 | if (handler != nullptr) UnmapViewOfFile(handler); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -242,7 +242,7 @@ void Worker::Run() { | |||
| 242 | 242 | SealHandleScope outer_seal(isolate_); | |
| 243 | 243 | ||
| 244 | 244 | DeleteFnPtr<Environment, FreeEnvironment> env_; | |
| 245 | - OnScopeLeave cleanup_env([&]() { | ||
| 245 | + auto cleanup_env = OnScopeLeave([&]() { | ||
| 246 | 246 | if (!env_) return; | |
| 247 | 247 | env_->set_can_call_into_js(false); | |
| 248 | 248 | Isolate::DisallowJavascriptExecutionScope disallow_js(isolate_, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments