@tarojs/runtime 3.6.32 → 3.6.34

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.
@@ -2496,14 +2496,15 @@ class TaroEvent {
2496
2496
  this.defaultPrevented = true;
2497
2497
  }
2498
2498
  get target() {
2499
- var _a, _b, _c, _d;
2499
+ var _a, _b, _c, _d, _e;
2500
2500
  const cacheTarget = this.cacheTarget;
2501
2501
  if (!cacheTarget) {
2502
2502
  const target = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.target) || null);
2503
+ const currentEle = env.document.getElementById(((_b = target.dataset) === null || _b === void 0 ? void 0 : _b.sid) || target.id || null);
2503
2504
  // Note:优先判断冒泡场景alipay的targetDataset的sid, 不然冒泡场景target属性吐出不对,其余拿取当前绑定id
2504
- const element = env.document.getElementById(((_b = target.targetDataset) === null || _b === void 0 ? void 0 : _b.sid) || ((_c = target.dataset) === null || _c === void 0 ? void 0 : _c.sid) || target.id || null);
2505
- target.dataset = element !== null ? element.dataset : EMPTY_OBJ;
2506
- for (const key in (_d = this.mpEvent) === null || _d === void 0 ? void 0 : _d.detail) {
2505
+ const element = env.document.getElementById(((_c = target.targetDataset) === null || _c === void 0 ? void 0 : _c.sid) || ((_d = target.dataset) === null || _d === void 0 ? void 0 : _d.sid) || target.id || null);
2506
+ target.dataset = Object.assign(Object.assign({}, (currentEle !== null ? currentEle.dataset : EMPTY_OBJ)), (element !== null ? element.dataset : EMPTY_OBJ));
2507
+ for (const key in (_e = this.mpEvent) === null || _e === void 0 ? void 0 : _e.detail) {
2507
2508
  target[key] = this.mpEvent.detail[key];
2508
2509
  }
2509
2510
  this.cacheTarget = target;
@@ -2910,11 +2911,19 @@ const URLSearchParams = process.env.TARO_PLATFORM === 'web' ? env.window.URLSear
2910
2911
  for (let pairs = query.split('&'), i = 0, length = pairs.length; i < length; i++) {
2911
2912
  const value = pairs[i];
2912
2913
  const index = value.indexOf('=');
2913
- if (index > -1) {
2914
- appendTo(dict, decode(value.slice(0, index)), decode(value.slice(index + 1)));
2914
+ // 针对不规范的 url 参数做容错处理,如:word=你%好
2915
+ try {
2916
+ if (index > -1) {
2917
+ appendTo(dict, decode(value.slice(0, index)), decode(value.slice(index + 1)));
2918
+ }
2919
+ else if (value.length) {
2920
+ appendTo(dict, decode(value), '');
2921
+ }
2915
2922
  }
2916
- else if (value.length) {
2917
- appendTo(dict, decode(value), '');
2923
+ catch (err) {
2924
+ if (process.env.NODE_ENV !== 'production') {
2925
+ console.warn(`[Taro warn] URL 参数 ${value} decode 异常`);
2926
+ }
2918
2927
  }
2919
2928
  }
2920
2929
  }