@whitesev/domutils 1.4.4 → 1.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -286,11 +286,15 @@ var DOMUtils = (function () {
286
286
  let $closestMatches = eventTarget.closest(selectorItem);
287
287
  if ($closestMatches && totalParent.contains($closestMatches)) {
288
288
  /* event的target值不能直接修改 */
289
- OriginPrototype.Object.defineProperty(event, "target", {
290
- get() {
291
- return $closestMatches;
292
- },
293
- });
289
+ // 这里尝试使用defineProperty修改eventtarget
290
+ try {
291
+ OriginPrototype.Object.defineProperty(event, "target", {
292
+ get() {
293
+ return $closestMatches;
294
+ },
295
+ });
296
+ }
297
+ catch (error) { }
294
298
  listenerCallBack.call($closestMatches, event);
295
299
  checkOptionOnceToRemoveEventListener();
296
300
  break;
@@ -1031,7 +1035,7 @@ var DOMUtils = (function () {
1031
1035
  super(option);
1032
1036
  }
1033
1037
  /** 版本号 */
1034
- version = "2024.12.3";
1038
+ version = "2024.12.4";
1035
1039
  attr(element, attrName, attrValue) {
1036
1040
  let DOMUtilsContext = this;
1037
1041
  if (typeof element === "string") {