Skip to content

Commit d7ead7a

Browse files
committed
fix
1 parent 49c3b76 commit d7ead7a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/node_wasi.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1641,18 +1641,18 @@ void WASI::SockShutdown(const FunctionCallbackInfo<Value>& args) {
16411641

16421642
void WASI::_SetMemory(const FunctionCallbackInfo<Value>& args) {
16431643
WASI* wasi;
1644+
ASSIGN_OR_RETURN_UNWRAP(&wasi, args.This());
16441645
CHECK_EQ(args.Length(), 1);
16451646
if (!args[0]->IsWasmMemoryObject()) {
16461647
return node::THROW_ERR_INVALID_ARG_TYPE(
1647-
env, "instance.exports.memory must be a WebAssembly.Memory object");
1648+
wasi->env(),
1649+
"instance.exports.memory must be a WebAssembly.Memory object");
16481650
}
1649-
ASSIGN_OR_RETURN_UNWRAP(&wasi, args.This());
16501651
wasi->memory_.Reset(wasi->env()->isolate(), args[0].As<WasmMemoryObject>());
16511652
}
16521653

16531654

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

0 commit comments

Comments
 (0)