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