| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3ec20f2 commit 9ac1fe0
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -518,7 +518,7 @@ function close(fd, callback = defaultCloseCallback) { | |||
| 518 | 518 | ||
| 519 | 519 | const req = new FSReqCallback(); | |
| 520 | 520 | req.oncomplete = callback; | |
| 521 | - binding.close(getValidatedFd(fd), req); | ||
| 521 | + binding.close(fd, req); | ||
| 522 | 522 | } | |
| 523 | 523 | ||
| 524 | 524 | /** | |
@@ -527,7 +527,7 @@ function close(fd, callback = defaultCloseCallback) { | |||
| 527 | 527 | * @returns {void} | |
| 528 | 528 | */ | |
| 529 | 529 | function closeSync(fd) { | |
| 530 | - binding.close(getValidatedFd(fd)); | ||
| 530 | + binding.close(fd); | ||
| 531 | 531 | } | |
| 532 | 532 | ||
| 533 | 533 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -984,8 +984,10 @@ void Close(const FunctionCallbackInfo<Value>& args) { | |||
| 984 | 984 | const int argc = args.Length(); | |
| 985 | 985 | CHECK_GE(argc, 1); | |
| 986 | 986 | ||
| 987 | - CHECK(args[0]->IsInt32()); | ||
| 988 | - int fd = args[0].As<Int32>()->Value(); | ||
| 987 | + int fd; | ||
| 988 | + if (!GetValidatedFd(env, args[0]).To(&fd)) { | ||
| 989 | + return; | ||
| 990 | + } | ||
| 989 | 991 | env->RemoveUnmanagedFd(fd); | |
| 990 | 992 | ||
| 991 | 993 | if (argc > 1) { // close(fd, req) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments