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