@@ -169,7 +169,6 @@ using v8::SealHandleScope;
169
169
using v8::String;
170
170
using v8::TryCatch;
171
171
using v8::Uint32Array;
172
- using v8::Uint8Array;
173
172
using v8::Undefined;
174
173
using v8::V8;
175
174
using v8::Value;
@@ -1152,13 +1151,6 @@ void SetupNextTick(const FunctionCallbackInfo<Value>& args) {
1152
1151
env->context (),
1153
1152
FIXED_ONE_BYTE_STRING (env->isolate (), " _setupNextTick" )).FromJust ();
1154
1153
1155
- // Values use to cross communicate with processNextTick.
1156
- uint8_t * const fields = env->tick_info ()->fields ();
1157
- uint8_t const fields_count = env->tick_info ()->fields_count ();
1158
-
1159
- Local<ArrayBuffer> array_buffer =
1160
- ArrayBuffer::New (env->isolate (), fields, sizeof (*fields) * fields_count);
1161
-
1162
1154
v8::Local<v8::Function> run_microtasks_fn =
1163
1155
env->NewFunctionTemplate (RunMicrotasks)->GetFunction (env->context ())
1164
1156
.ToLocalChecked ();
@@ -1167,7 +1159,7 @@ void SetupNextTick(const FunctionCallbackInfo<Value>& args) {
1167
1159
1168
1160
Local<Array> ret = Array::New (env->isolate (), 2 );
1169
1161
ret->Set (env->context (), 0 ,
1170
- Uint8Array::New (array_buffer, 0 , fields_count )).FromJust ();
1162
+ env-> tick_info ()-> fields (). GetJSArray ( )).FromJust ();
1171
1163
ret->Set (env->context (), 1 , run_microtasks_fn).FromJust ();
1172
1164
1173
1165
args.GetReturnValue ().Set (ret);
@@ -1286,7 +1278,7 @@ void InternalCallbackScope::Close() {
1286
1278
1287
1279
Environment::TickInfo* tick_info = env_->tick_info ();
1288
1280
1289
- if (tick_info->scheduled () == 0 ) {
1281
+ if (! tick_info->has_scheduled () ) {
1290
1282
env_->isolate ()->RunMicrotasks ();
1291
1283
}
1292
1284
@@ -1297,7 +1289,7 @@ void InternalCallbackScope::Close() {
1297
1289
CHECK_EQ (env_->trigger_async_id (), 0 );
1298
1290
}
1299
1291
1300
- if (tick_info->scheduled () == 0 ) {
1292
+ if (! tick_info->has_scheduled () ) {
1301
1293
return ;
1302
1294
}
1303
1295
0 commit comments