mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-03-12 00:45:14 +00:00
Update std.js
This commit is contained in:
parent
ce10ac7f7b
commit
b880e7a13d
21
lib/std.js
21
lib/std.js
|
@ -2,7 +2,7 @@
|
|||
// Common routines
|
||||
// Namhyeon Go <abuse@catswords.net>
|
||||
// https://github.com/gnh1201/welsonjs
|
||||
|
||||
//
|
||||
// Polyfills
|
||||
if (!Function.prototype.GetResource) {
|
||||
Function.prototype.GetResource = function(ResourceName) {
|
||||
|
@ -24,14 +24,17 @@ 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.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
|
||||
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
|
||||
|
@ -598,7 +601,7 @@ exports.alert = alert;
|
|||
exports.confirm = confirm;
|
||||
exports.prompt = prompt;
|
||||
|
||||
exports.VERSIONINFO = "WelsonJS Standard Library (std.js) version 0.8.14";
|
||||
exports.VERSIONINFO = "WelsonJS Standard Library (std.js) version 0.8.15";
|
||||
exports.AUTHOR = "abuse@catswords.net";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
Loading…
Reference in New Issue
Block a user