@@ -39,18 +39,20 @@ extern "C" {
3939
4040ext2_filsys get_filesystem (NAN_METHOD_ARGS_TYPE info) {
4141 return static_cast <ext2_filsys>(
42- info[0 ]-> ToObject ().As <v8::External>()->Value ()
42+ Nan::To<v8::Object>( info[0 ]). ToLocalChecked ().As <v8::External>()->Value ()
4343 );
4444}
4545
4646ext2_file_t get_file (NAN_METHOD_ARGS_TYPE info) {
4747 return static_cast <ext2_file_t >(
48- info[0 ]-> ToObject ().As <v8::External>()->Value ()
48+ Nan::To<v8::Object>( info[0 ]). ToLocalChecked ().As <v8::External>()->Value ()
4949 );
5050}
5151
5252unsigned int get_flags (NAN_METHOD_ARGS_TYPE info) {
53- return static_cast <unsigned int >(info[1 ]->IntegerValue ());
53+ return static_cast <unsigned int >(
54+ Nan::To<int64_t >(info[1 ]).FromJust ()
55+ );
5456}
5557
5658std::string get_path (NAN_METHOD_ARGS_TYPE info) {
@@ -306,8 +308,8 @@ class OpenWorker : public AsyncWorker {
306308 : AsyncWorker(callback) {
307309 fs = get_filesystem (info);
308310 path = get_path (info);
309- flags = static_cast <unsigned int >(info[2 ]-> IntegerValue ());
310- mode = static_cast <unsigned int >(info[3 ]-> IntegerValue ());
311+ flags = static_cast <unsigned int >(Nan::To< int64_t >( info[2 ]). FromJust ());
312+ mode = static_cast <unsigned int >(Nan::To< int64_t >( info[3 ]). FromJust ());
311313 }
312314
313315 void Execute () {
@@ -440,9 +442,9 @@ class ReadWorker : public AsyncWorker {
440442 file = get_file (info);
441443 flags = get_flags (info);
442444 buffer = (char *) node::Buffer::Data (info[2 ]);
443- offset = static_cast <unsigned long long >(info[3 ]-> IntegerValue ()); // buffer offset
444- length = static_cast <unsigned int >(info[4 ]-> IntegerValue ());
445- position = static_cast <unsigned long long >(info[5 ]-> IntegerValue ()); // file offset
445+ offset = static_cast <unsigned long long >(Nan::To< int64_t >( info[3 ]). FromJust ()); // buffer offset
446+ length = static_cast <unsigned int >(Nan::To< int64_t >( info[4 ]). FromJust ());
447+ position = static_cast <unsigned long long >(Nan::To< int64_t >( info[5 ]). FromJust ()); // file offset
446448 }
447449
448450 void Execute () {
@@ -491,9 +493,9 @@ class WriteWorker : public AsyncWorker {
491493 file = get_file (info);
492494 flags = get_flags (info);
493495 buffer = static_cast <char *>(node::Buffer::Data (info[2 ]));
494- offset = static_cast <unsigned long long >(info[3 ]-> IntegerValue ()); // buffer offset
495- length = static_cast <unsigned int >(info[4 ]-> IntegerValue ());
496- position = static_cast <unsigned long long >(info[5 ]-> IntegerValue ()); // file offset
496+ offset = static_cast <unsigned long long >(Nan::To< int64_t >( info[3 ]). FromJust ()); // buffer offset
497+ length = static_cast <unsigned int >(Nan::To< int64_t >( info[4 ]). FromJust ());
498+ position = static_cast <unsigned long long >(Nan::To< int64_t >( info[5 ]). FromJust ()); // file offset
497499 }
498500
499501 void Execute () {
@@ -544,7 +546,7 @@ class ChModWorker : public AsyncWorker {
544546 : AsyncWorker(callback) {
545547 file = get_file (info);
546548 flags = get_flags (info);
547- mode = static_cast <unsigned int >(info[2 ]-> IntegerValue ());
549+ mode = static_cast <unsigned int >(Nan::To< int64_t >( info[2 ]). FromJust ());
548550 }
549551
550552 void Execute () {
@@ -582,8 +584,8 @@ class ChOwnWorker : public AsyncWorker {
582584 : AsyncWorker(callback) {
583585 file = get_file (info);
584586 flags = get_flags (info);
585- uid = static_cast <unsigned int >(info[2 ]-> IntegerValue ());
586- gid = static_cast <unsigned int >(info[3 ]-> IntegerValue ());
587+ uid = static_cast <unsigned int >(Nan::To< int64_t >( info[2 ]). FromJust ());
588+ gid = static_cast <unsigned int >(Nan::To< int64_t >( info[3 ]). FromJust ());
587589 }
588590
589591 void Execute () {
@@ -772,7 +774,7 @@ class MkDirWorker : public AsyncWorker {
772774 : AsyncWorker(callback) {
773775 fs = get_filesystem (info);
774776 path = get_path (info);
775- mode = static_cast <unsigned int >(info[2 ]-> IntegerValue ());
777+ mode = static_cast <unsigned int >(Nan::To< int64_t >( info[2 ]). FromJust ());
776778 }
777779
778780 void Execute () {
0 commit comments