From fc4d74b7ac44a76b607654b30cf9a526c38017ed Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Fri, 27 Dec 2024 14:11:15 +0900 Subject: [PATCH] Update std.js --- lib/std.js | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/lib/std.js b/lib/std.js index 5dc5d5d..9bd27c9 100644 --- a/lib/std.js +++ b/lib/std.js @@ -1,8 +1,8 @@ // std.js -// Common routines +// WelsonJS Standard Library // Namhyeon Go // https://github.com/gnh1201/welsonjs -// +// // Polyfills if (!Function.prototype.GetResource) { Function.prototype.GetResource = function(ResourceName) { @@ -21,21 +21,6 @@ if (!Function.prototype.GetResource) { } } -// https://stackoverflow.com/questions/45552695/why-element-matches-polyfill-doesnt-work -// https://github.com/zloirock/core-js/issues/780 -// https://github.com/joncasey/modern-hta/blob/master/src/element-closest.js -if (Element && Element.prototype) { - if (!Element.prototype.matches) { - Element.prototype.matches = Element.prototype.msMatchesSelector; - } - - if (!Element.prototype.closest) { - for (var p = this; p != null; p = p.parentElement) { - if (p.matches(selector)) return p; - } - } -} - // The provided code snippet has been corrected by ChatGPT. // https://chat.openai.com/share/eaab056c-d265-4ee3-b355-9f29176a9caa // Related issues: #75 #42 #30 @@ -70,6 +55,7 @@ if (typeof Enumerator !== "undefined") { result.push(itemObject); this.moveNext(); } + return result; }; } @@ -601,7 +587,7 @@ exports.alert = alert; exports.confirm = confirm; exports.prompt = prompt; -exports.VERSIONINFO = "WelsonJS Standard Library (std.js) version 0.8.15"; +exports.VERSIONINFO = "WelsonJS Standard Library (std.js) version 0.8.16"; exports.AUTHOR = "abuse@catswords.net"; exports.global = global; exports.require = global.require;