Update std.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run

This commit is contained in:
Namhyeon Go 2024-11-19 17:01:56 +09:00
parent 2f74ceb013
commit 0f57fba805

View File

@ -255,16 +255,49 @@ function alert(message) {
if (typeof window !== "undefined") {
window.alert(message);
} else {
CreateObject("WScript.Shell").Popup(message);
try {
CreateObject("WScript.Shell").Popup(message, 0, "WelsonJS", 0);
} catch (e) {
console.error(e.message);
}
}
}
function confirm(message) {
var result;
if (typeof window !== "undefined") {
return window.confirm(message);
result = window.confirm(message);
} else {
CreateObject("WScript.Shell").Popup(message);
try {
result = (CreateObject("WScript.Shell").Popup(message, 0, "WelsonJS", 4) == 6);
} catch (e) {
console.error(e.message);
result = false;
}
}
return result;
}
function prompt(message, _default) {
var result;
if (typeof window !== "undefined") {
result = window.prompt(message);
} else {
try {
result = CreateObject("WelsonJS.Toolkit").Prompt(message);
} catch (e) {
console.error(e.message);
if (typeof _default !== "undefined") {
result = _default;
console.warn("Use default value:", _default);
}
}
}
return result;
}
function parseEnv(s) {
@ -551,8 +584,9 @@ exports.Storage = StdStorage;
exports.alert = alert;
exports.confirm = confirm;
exports.prompt = prompt;
exports.VERSIONINFO = "WelsonJS Standard Library (std.js) version 0.8.12";
exports.VERSIONINFO = "WelsonJS Standard Library (std.js) version 0.8.13";
exports.AUTHOR = "abuse@catswords.net";
exports.global = global;
exports.require = global.require;