@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.
package/dist/index.esm.js CHANGED
@@ -283,11 +283,15 @@ class DOMUtilsEvent {
283
283
  let $closestMatches = eventTarget.closest(selectorItem);
284
284
  if ($closestMatches && totalParent.contains($closestMatches)) {
285
285
  /* event的target值不能直接修改 */
286
- OriginPrototype.Object.defineProperty(event, "target", {
287
- get() {
288
- return $closestMatches;
289
- },
290
- });
286
+ // 这里尝试使用defineProperty修改eventtarget
287
+ try {
288
+ OriginPrototype.Object.defineProperty(event, "target", {
289
+ get() {
290
+ return $closestMatches;
291
+ },
292
+ });
293
+ }
294
+ catch (error) { }
291
295
  listenerCallBack.call($closestMatches, event);
292
296
  checkOptionOnceToRemoveEventListener();
293
297
  break;
@@ -1028,7 +1032,7 @@ class DOMUtils extends DOMUtilsEvent {
1028
1032
  super(option);
1029
1033
  }
1030
1034
  /** 版本号 */
1031
- version = "2024.12.3";
1035
+ version = "2024.12.4";
1032
1036
  attr(element, attrName, attrValue) {
1033
1037
  let DOMUtilsContext = this;
1034
1038
  if (typeof element === "string") {