Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-146197: Include a bit more information in sys._emscripten_info.runtime#146346

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 1 commit intopython:mainfromhoodmane:emscripten-info-runtime
Mar 23, 2026
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletionsPython/sysmodule.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3878,20 +3878,38 @@ static PyStructSequence_Desc emscripten_info_desc = {

EM_JS(char *, _Py_emscripten_runtime, (void), {
var info;
if (typeof navigator == 'object') {
if (typeof process === "object") {
if (process.versions?.bun) {
info = `bun v${process.versions.bun}`;
} else if (process.versions?.deno) {
info = `deno v${process.versions.deno}`;
} else {
// As far as I can tell, every JavaScript runtime puts "node" in
// process.release.name. Pyodide once checked for
//
// process.release.name === "node"
//
// and this is apparently part of the reason other runtimes started
// lying about it. Similar to the situation with userAgent.
//
// But just in case some other JS runtime decides to tell us what it
// is, we'll pick it up.
const name = process.release?.name ?? "node";
info = `${name} ${process.version}`;
}
// Include v8 version if we know it
if (process.versions?.v8) {
info += ` (v8 ${process.versions.v8})`;
}
} else if (typeof navigator === "object") {
info = navigator.userAgent;
} else if (typeof process == 'object') {
info = "Node.js ".concat(process.version);
} else {
info = "UNKNOWN";
}
var len = lengthBytesUTF8(info) + 1;
var res = _malloc(len);
if (res) stringToUTF8(info, res, len);
#if __wasm64__
return BigInt(res);
return BigInt(stringToNewUTF8(info));
#else
returnres;
returnstringToNewUTF8(info);
#endif
});

Expand Down
Loading

[8]ページ先頭

©2009-2026 Movatter.jp