Skip to content

Commit 5a05d10

Browse files
committed
fix
1 parent 49c3b76 commit 5a05d10

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/node_wasi.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ inline void Debug(WASI* wasi, Args&&... args) {
7272
} \
7373
} while (0)
7474

75-
7675
using v8::Array;
7776
using v8::BackingStore;
7877
using v8::BigInt;
@@ -1641,18 +1640,18 @@ void WASI::SockShutdown(const FunctionCallbackInfo<Value>& args) {
16411640

16421641
void WASI::_SetMemory(const FunctionCallbackInfo<Value>& args) {
16431642
WASI* wasi;
1643+
ASSIGN_OR_RETURN_UNWRAP(&wasi, args.This());
16441644
CHECK_EQ(args.Length(), 1);
16451645
if (!args[0]->IsWasmMemoryObject()) {
16461646
return node::THROW_ERR_INVALID_ARG_TYPE(
1647-
env, "instance.exports.memory must be a WebAssembly.Memory object");
1647+
wasi->env(),
1648+
"instance.exports.memory must be a WebAssembly.Memory object");
16481649
}
1649-
ASSIGN_OR_RETURN_UNWRAP(&wasi, args.This());
16501650
wasi->memory_.Reset(wasi->env()->isolate(), args[0].As<WasmMemoryObject>());
16511651
}
16521652

16531653

16541654
uvwasi_errno_t WASI::backingStore(char** store, size_t* byte_length) {
1655-
Environment* env = this->env();
16561655
Local<WasmMemoryObject> memory = PersistentToLocal::Strong(this->memory_);
16571656
std::shared_ptr<BackingStore> backing_store =
16581657
memory->Buffer()->GetBackingStore();

0 commit comments

Comments
 (0)