@@ -221,7 +221,7 @@ inline MaybeLocal<Promise> FileHandle::ClosePromise() { |
221 | 221 | closing_ = true; |
222 | 222 | CloseReq* req = new CloseReq(env(), promise, object()); |
223 | 223 | auto AfterClose = uv_fs_callback_t{[](uv_fs_t* req) { |
224 | | - CloseReq* close = static_cast<CloseReq*>(req->data); |
| 224 | + CloseReq* close = CloseReq::from_req(req); |
225 | 225 | CHECK_NOT_NULL(close); |
226 | 226 | close->file_handle()->AfterClose(); |
227 | 227 | Isolate* isolate = close->env()->isolate(); |
@@ -475,15 +475,15 @@ bool FSReqAfterScope::Proceed() { |
475 | 475 | } |
476 | 476 |
|
477 | 477 | void AfterNoArgs(uv_fs_t* req) { |
478 | | - FSReqBase* req_wrap = static_cast<FSReqBase*>(req->data); |
| 478 | + FSReqBase* req_wrap = FSReqBase::from_req(req); |
479 | 479 | FSReqAfterScope after(req_wrap, req); |
480 | 480 |
|
481 | 481 | if (after.Proceed()) |
482 | 482 | req_wrap->Resolve(Undefined(req_wrap->env()->isolate())); |
483 | 483 | } |
484 | 484 |
|
485 | 485 | void AfterStat(uv_fs_t* req) { |
486 | | - FSReqBase* req_wrap = static_cast<FSReqBase*>(req->data); |
| 486 | + FSReqBase* req_wrap = FSReqBase::from_req(req); |
487 | 487 | FSReqAfterScope after(req_wrap, req); |
488 | 488 |
|
489 | 489 | if (after.Proceed()) { |
@@ -492,15 +492,15 @@ void AfterStat(uv_fs_t* req) { |
492 | 492 | } |
493 | 493 |
|
494 | 494 | void AfterInteger(uv_fs_t* req) { |
495 | | - FSReqBase* req_wrap = static_cast<FSReqBase*>(req->data); |
| 495 | + FSReqBase* req_wrap = FSReqBase::from_req(req); |
496 | 496 | FSReqAfterScope after(req_wrap, req); |
497 | 497 |
|
498 | 498 | if (after.Proceed()) |
499 | 499 | req_wrap->Resolve(Integer::New(req_wrap->env()->isolate(), req->result)); |
500 | 500 | } |
501 | 501 |
|
502 | 502 | void AfterOpenFileHandle(uv_fs_t* req) { |
503 | | - FSReqWrap* req_wrap = static_cast<FSReqWrap*>(req->data); |
| 503 | + FSReqBase* req_wrap = FSReqBase::from_req(req); |
504 | 504 | FSReqAfterScope after(req_wrap, req); |
505 | 505 |
|
506 | 506 | if (after.Proceed()) { |
@@ -510,7 +510,7 @@ void AfterOpenFileHandle(uv_fs_t* req) { |
510 | 510 | } |
511 | 511 |
|
512 | 512 | void AfterStringPath(uv_fs_t* req) { |
513 | | - FSReqBase* req_wrap = static_cast<FSReqBase*>(req->data); |
| 513 | + FSReqBase* req_wrap = FSReqBase::from_req(req); |
514 | 514 | FSReqAfterScope after(req_wrap, req); |
515 | 515 |
|
516 | 516 | MaybeLocal<Value> link; |
@@ -529,7 +529,7 @@ void AfterStringPath(uv_fs_t* req) { |
529 | 529 | } |
530 | 530 |
|
531 | 531 | void AfterStringPtr(uv_fs_t* req) { |
532 | | - FSReqBase* req_wrap = static_cast<FSReqBase*>(req->data); |
| 532 | + FSReqBase* req_wrap = FSReqBase::from_req(req); |
533 | 533 | FSReqAfterScope after(req_wrap, req); |
534 | 534 |
|
535 | 535 | MaybeLocal<Value> link; |
@@ -548,7 +548,7 @@ void AfterStringPtr(uv_fs_t* req) { |
548 | 548 | } |
549 | 549 |
|
550 | 550 | void AfterScanDir(uv_fs_t* req) { |
551 | | - FSReqBase* req_wrap = static_cast<FSReqBase*>(req->data); |
| 551 | + FSReqBase* req_wrap = FSReqBase::from_req(req); |
552 | 552 | FSReqAfterScope after(req_wrap, req); |
553 | 553 |
|
554 | 554 | if (after.Proceed()) { |
|