FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

typings: provide internal types for wasi bindings by RulerOfCakes · Pull Request #54119 · nodejs/node · GitHub

/ node Public

typings: provide internal types for wasi bindings - #54119

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
RulerOfCakes:wasi-types
Aug 24, 2024
Merged

typings: provide internal types for wasi bindings#54119
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
RulerOfCakes:wasi-types

Conversation

RulerOfCakes commented Jul 30, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

Added internal types for WASI bindings from node_wasi.h and node_wasi.cpp, according to the present JS/CPP source code and the documentation.

Defined in:

node/src/node_wasi.cc

Lines 117 to 124 in 027710e

void WASI::New(const FunctionCallbackInfo<Value>& args) {
CHECK(args.IsConstructCall());
CHECK_EQ(args.Length(), 4);
CHECK(args[0]->IsArray());
CHECK(args[1]->IsArray());
CHECK(args[2]->IsArray());
CHECK(args[3]->IsArray());
Environment* env = Environment::GetCurrent(args);

node/src/node_wasi.cc

Lines 1254 to 1265 in 027710e

void WASI::_SetMemory(const FunctionCallbackInfo<Value>& args) {
WASI* wasi;
ASSIGN_OR_RETURN_UNWRAP(&wasi, args.This());
CHECK_EQ(args.Length(), 1);
if (!args[0]->IsWasmMemoryObject()) {
return node::THROW_ERR_INVALID_ARG_TYPE(
wasi->env(),
"\"instance.exports.memory\" property must be a WebAssembly.Memory "
"object");
}
wasi->memory_.Reset(wasi->env()->isolate(), args[0].As<WasmMemoryObject>());
}

Exported from:

node/src/node_wasi.cc

Lines 1328 to 1330 in 027710e

SetInstanceMethod(isolate, tmpl, "_setMemory", WASI::_SetMemory);
SetConstructorFunction(context, target, "WASI", tmpl);

Comment thread typings/internalBinding/wasi.d.ts Outdated
RulerOfCakes requested a review from anonrig August 4, 2024 09:46
daeyeon added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Aug 14, 2024
avivkeller added the wasi Issues and PRs related to the WebAssembly System Interface. label Aug 14, 2024
daeyeon added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 24, 2024
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 24, 2024
nodejs-github-bot merged commit c890a96 into nodejs:main Aug 24, 2024

Copy link
Copy Markdown
Collaborator

Landed in c890a96

RafaelGSS pushed a commit that referenced this pull request Aug 25, 2024
PR-URL: #54119
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
RafaelGSS mentioned this pull request Aug 25, 2024
RafaelGSS pushed a commit that referenced this pull request Aug 30, 2024
PR-URL: #54119
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. typings wasi Issues and PRs related to the WebAssembly System Interface.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL