Update std.js

This commit is contained in:
Namhyeon Go 2024-08-06 20:59:29 +09:00 committed by GitHub
parent 3e86686613
commit 4a2fd7943a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,15 +1,9 @@
//////////////////////////////////////////////////////////////////////////////////
//
// std.js
//
// Common routines. Defines LIB object which contains the API, as well as
// a global DBG function.
//
/////////////////////////////////////////////////////////////////////////////////
// std.js
// Common routines. Defines LIB object which contains the API.
// Namhyeon Go <abuse@catswords.net>
// https://github.com/gnh1201/welsonjs
/////////////////////////////////////////////////////////////////////////////////
// Polyfills
/////////////////////////////////////////////////////////////////////////////////
if (!Function.prototype.GetResource) {
Function.prototype.GetResource = function(ResourceName) {
if (!this.Resources) {
@ -65,10 +59,7 @@ if (typeof Enumerator !== "undefined") {
};
}
/////////////////////////////////////////////////////////////////////////////////
// Global APIs
/////////////////////////////////////////////////////////////////////////////////
function GetResource(ResourceName) {
return arguments.callee.caller.GetResource(ResourceName);
}
@ -260,14 +251,9 @@ function addslashes(s) {
replace(/"/g, '\\"');
};
/////////////////////////////////////////////////////////////////////////////////
// Private APIs / Utility functions
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
// Emulate Server.CreateObject
/////////////////////////////////////////////////////////////////////////////////
function CreateObject(progId, serverName, callback) {
var progIds = [];
var _CreateObject = function(p, s) {
@ -562,12 +548,6 @@ function StdStorage() {
};
}
/*
var a = new StdStorage();
a.setItem("a", "1");
console.log(a.getItem("a"));
*/
global.GetResource = GetResource;
global.sleep = sleep;
global.repeat = repeat;
@ -585,7 +565,7 @@ exports.Storage = StdStorage;
exports.alert = alert;
exports.confirm = confirm;
exports.VERSIONINFO = "Standard Library (std.js) version 0.8.4";
exports.VERSIONINFO = "WelsonJS Standard Library (std.js) version 0.8.5";
exports.AUTHOR = "abuse@catswords.net";
exports.global = global;
exports.require = global.require;