@tarojs/runtime 4.0.0-alpha.43 → 4.0.0-alpha.44

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.
@@ -427,19 +427,11 @@ const URLSearchParams = process.env.TARO_PLATFORM === 'web' ? env.window.URLSear
427
427
  for (let pairs = query.split('&'), i = 0, length = pairs.length; i < length; i++) {
428
428
  const value = pairs[i];
429
429
  const index = value.indexOf('=');
430
- // 针对不规范的 url 参数做容错处理,如:word=你%好
431
- try {
432
- if (index > -1) {
433
- appendTo(dict, decode(value.slice(0, index)), decode(value.slice(index + 1)));
434
- }
435
- else if (value.length) {
436
- appendTo(dict, decode(value), '');
437
- }
430
+ if (index > -1) {
431
+ appendTo(dict, decode(value.slice(0, index)), decode(value.slice(index + 1)));
438
432
  }
439
- catch (err) {
440
- if (process.env.NODE_ENV !== 'production') {
441
- console.warn(`[Taro warn] URL 参数 ${value} decode 异常`);
442
- }
433
+ else if (value.length) {
434
+ appendTo(dict, decode(value), '');
443
435
  }
444
436
  }
445
437
  }
@@ -991,12 +983,12 @@ let now;
991
983
  let lastTime = 0;
992
984
  // https://gist.github.com/paulirish/1579671
993
985
  // https://gist.github.com/jalbam/5fe05443270fa6d8136238ec72accbc0
994
- const _raf = process.env.TARO_PLATFORM === 'web' ? requestAnimationFrame : function (callback) {
986
+ const _raf = typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame !== null ? requestAnimationFrame : function (callback) {
995
987
  const _now = now();
996
988
  const nextTime = Math.max(lastTime + 16, _now); // First time will execute it immediately but barely noticeable and performance is gained.
997
989
  return setTimeout(function () { callback(lastTime = nextTime); }, nextTime - _now);
998
990
  };
999
- const _caf = process.env.TARO_PLATFORM === 'web'
991
+ const _caf = typeof cancelAnimationFrame !== 'undefined' && cancelAnimationFrame !== null
1000
992
  ? cancelAnimationFrame
1001
993
  : function (seed) {
1002
994
  // fix https://github.com/NervJS/taro/issues/7749
@@ -3317,7 +3309,9 @@ function contains(node) {
3317
3309
  return isContains;
3318
3310
  }
3319
3311
 
3320
- if (process.env.TARO_PLATFORM !== 'web' && !(process.env.TARO_PLATFORM === 'harmony' || process.env.TARO_ENV === 'harmony')) {
3312
+ const isWeb = process.env.TARO_PLATFORM === 'web';
3313
+ const isHarmony = process.env.TARO_PLATFORM === 'harmony' || process.env.TARO_ENV === 'harmony';
3314
+ if (!isWeb && !isHarmony) {
3321
3315
  if (ENABLE_INNER_HTML) {
3322
3316
  TaroNode.extend('innerHTML', {
3323
3317
  set(html) {
@@ -3375,15 +3369,14 @@ class TaroEvent {
3375
3369
  this.defaultPrevented = true;
3376
3370
  }
3377
3371
  get target() {
3378
- var _a, _b, _c, _d, _e;
3372
+ var _a, _b, _c, _d;
3379
3373
  const cacheTarget = this.cacheTarget;
3380
3374
  if (!cacheTarget) {
3381
3375
  const target = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.target) || null);
3382
- const currentEle = env.document.getElementById(((_b = target.dataset) === null || _b === void 0 ? void 0 : _b.sid) || target.id || null);
3383
3376
  // Note:优先判断冒泡场景alipay的targetDataset的sid, 不然冒泡场景target属性吐出不对,其余拿取当前绑定id
3384
- 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);
3385
- target.dataset = Object.assign(Object.assign({}, (currentEle !== null ? currentEle.dataset : EMPTY_OBJ)), (element !== null ? element.dataset : EMPTY_OBJ));
3386
- for (const key in (_e = this.mpEvent) === null || _e === void 0 ? void 0 : _e.detail) {
3377
+ 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);
3378
+ target.dataset = element !== null ? element.dataset : EMPTY_OBJ;
3379
+ for (const key in (_d = this.mpEvent) === null || _d === void 0 ? void 0 : _d.detail) {
3387
3380
  target[key] = this.mpEvent.detail[key];
3388
3381
  }
3389
3382
  this.cacheTarget = target;