Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: sea.getRawAsset(key) always returns an ArrayBuffer #56206

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

ShenHongFei
Copy link
Contributor

sea.getRawAsset(key) always returns ArrayBuffer, not string. The return type in the documentation is wrong.

Local<ArrayBuffer> ab = ArrayBuffer::New(args.GetIsolate(), std::move(store));

node/lib/sea.js

Lines 15 to 35 in bd3c25c

/**
* Look for the asset in the injected SEA blob using the key. If
* no matching asset is found an error is thrown. The returned
* ArrayBuffer should not be mutated or otherwise the process
* can crash due to access violation.
* @param {string} key
* @returns {ArrayBuffer}
*/
function getRawAsset(key) {
validateString(key, 'key');
if (!isSea()) {
throw new ERR_NOT_IN_SINGLE_EXECUTABLE_APPLICATION();
}
const asset = getAssetInternal(key);
if (asset === undefined) {
throw new ERR_SINGLE_EXECUTABLE_APPLICATION_ASSET_NOT_FOUND(key);
}
return asset;
}

cc @nodejs/single-executable

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/single-executable

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Dec 10, 2024
@lpinca lpinca added the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 12, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 12, 2024
@nodejs-github-bot nodejs-github-bot merged commit 33f0f16 into nodejs:main Dec 12, 2024
22 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 33f0f16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants