| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 96c095f commit 21fbcb6
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ | |||
| 36 | 36 | ||
| 37 | 37 | # Reset this number to 0 on major V8 upgrades. | |
| 38 | 38 | # Increment by one for each non-official patch applied to deps/v8. | |
| 39 | - 'v8_embedder_string': '-node.22', | ||
| 39 | + 'v8_embedder_string': '-node.23', | ||
| 40 | 40 | ||
| 41 | 41 | ##### V8 defaults for Node.js ##### | |
| 42 | 42 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10390,9 +10390,12 @@ class V8_EXPORT Context { | |||
| 10390 | 10390 | */ | |
| 10391 | 10391 | void Exit(); | |
| 10392 | 10392 | ||
| 10393 | - /** Returns an isolate associated with a current context. */ | ||
| 10393 | + /** Returns the isolate associated with a current context. */ | ||
| 10394 | 10394 | Isolate* GetIsolate(); | |
| 10395 | 10395 | ||
| 10396 | + /** Returns the microtask queue associated with a current context. */ | ||
| 10397 | + MicrotaskQueue* GetMicrotaskQueue(); | ||
| 10398 | + | ||
| 10396 | 10399 | /** | |
| 10397 | 10400 | * The field at kDebugIdIndex used to be reserved for the inspector. | |
| 10398 | 10401 | * It now serves no purpose. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6075,6 +6075,12 @@ v8::Isolate* Context::GetIsolate() { | |||
| 6075 | 6075 | return reinterpret_cast<Isolate*>(env->GetIsolate()); | |
| 6076 | 6076 | } | |
| 6077 | 6077 | ||
| 6078 | + v8::MicrotaskQueue* Context::GetMicrotaskQueue() { | ||
| 6079 | + i::Handle<i::Context> env = Utils::OpenHandle(this); | ||
| 6080 | + CHECK(env->IsNativeContext()); | ||
| 6081 | + return i::Handle<i::NativeContext>::cast(env)->microtask_queue(); | ||
| 6082 | + } | ||
| 6083 | + | ||
| 6078 | 6084 | v8::Local<v8::Object> Context::Global() { | |
| 6079 | 6085 | i::Handle<i::Context> context = Utils::OpenHandle(this); | |
| 6080 | 6086 | i::Isolate* isolate = context->GetIsolate(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28312,3 +28312,13 @@ TEST(TriggerThreadSafeMetricsEvent) { | |||
| 28312 | 28312 | CHECK_EQ(recorder->count_, 1); // Increased. | |
| 28313 | 28313 | CHECK_EQ(recorder->module_count_, 42); | |
| 28314 | 28314 | } | |
| 28315 | + | ||
| 28316 | + THREADED_TEST(MicrotaskQueueOfContext) { | ||
| 28317 | + auto microtask_queue = v8::MicrotaskQueue::New(CcTest::isolate()); | ||
| 28318 | + v8::HandleScope scope(CcTest::isolate()); | ||
| 28319 | + v8::Local<Context> context = Context::New( | ||
| 28320 | + CcTest::isolate(), nullptr, v8::MaybeLocal<ObjectTemplate>(), | ||
| 28321 | + v8::MaybeLocal<Value>(), v8::DeserializeInternalFieldsCallback(), | ||
| 28322 | + microtask_queue.get()); | ||
| 28323 | + CHECK_EQ(context->GetMicrotaskQueue(), microtask_queue.get()); | ||
| 28324 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments