@tarojs/runtime 4.0.0-alpha.36 → 4.0.0-alpha.38
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/bom/URLSearchParams.js +12 -4
- package/dist/bom/URLSearchParams.js.map +1 -1
- package/dist/bom/raf.js +2 -2
- package/dist/bom/raf.js.map +1 -1
- package/dist/dom-external/index.js +1 -3
- package/dist/dom-external/index.js.map +1 -1
- package/dist/index.cjs.js +15 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/runtime.esm.js +15 -9
- package/dist/runtime.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/runtime.esm.js
CHANGED
|
@@ -427,11 +427,19 @@ 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
|
-
|
|
431
|
-
|
|
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
|
+
}
|
|
432
438
|
}
|
|
433
|
-
|
|
434
|
-
|
|
439
|
+
catch (err) {
|
|
440
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
441
|
+
console.warn(`[Taro warn] URL 参数 ${value} decode 异常`);
|
|
442
|
+
}
|
|
435
443
|
}
|
|
436
444
|
}
|
|
437
445
|
}
|
|
@@ -983,12 +991,12 @@ let now;
|
|
|
983
991
|
let lastTime = 0;
|
|
984
992
|
// https://gist.github.com/paulirish/1579671
|
|
985
993
|
// https://gist.github.com/jalbam/5fe05443270fa6d8136238ec72accbc0
|
|
986
|
-
const _raf =
|
|
994
|
+
const _raf = process.env.TARO_PLATFORM === 'web' ? requestAnimationFrame : function (callback) {
|
|
987
995
|
const _now = now();
|
|
988
996
|
const nextTime = Math.max(lastTime + 16, _now); // First time will execute it immediately but barely noticeable and performance is gained.
|
|
989
997
|
return setTimeout(function () { callback(lastTime = nextTime); }, nextTime - _now);
|
|
990
998
|
};
|
|
991
|
-
const _caf =
|
|
999
|
+
const _caf = process.env.TARO_PLATFORM === 'web'
|
|
992
1000
|
? cancelAnimationFrame
|
|
993
1001
|
: function (seed) {
|
|
994
1002
|
// fix https://github.com/NervJS/taro/issues/7749
|
|
@@ -3309,9 +3317,7 @@ function contains(node) {
|
|
|
3309
3317
|
return isContains;
|
|
3310
3318
|
}
|
|
3311
3319
|
|
|
3312
|
-
|
|
3313
|
-
const isHarmony = process.env.TARO_PLATFORM === 'harmony' || process.env.TARO_ENV === 'harmony';
|
|
3314
|
-
if (!isWeb && !isHarmony) {
|
|
3320
|
+
if (process.env.TARO_PLATFORM !== 'web' && !(process.env.TARO_PLATFORM === 'harmony' || process.env.TARO_ENV === 'harmony')) {
|
|
3315
3321
|
if (ENABLE_INNER_HTML) {
|
|
3316
3322
|
TaroNode.extend('innerHTML', {
|
|
3317
3323
|
set(html) {
|