@tarojs/runtime 4.0.0-alpha.37 → 4.0.0-alpha.39

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.
@@ -991,12 +991,12 @@ let now;
991
991
  let lastTime = 0;
992
992
  // https://gist.github.com/paulirish/1579671
993
993
  // https://gist.github.com/jalbam/5fe05443270fa6d8136238ec72accbc0
994
- const _raf = typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame !== null ? requestAnimationFrame : function (callback) {
994
+ const _raf = process.env.TARO_PLATFORM === 'web' ? requestAnimationFrame : function (callback) {
995
995
  const _now = now();
996
996
  const nextTime = Math.max(lastTime + 16, _now); // First time will execute it immediately but barely noticeable and performance is gained.
997
997
  return setTimeout(function () { callback(lastTime = nextTime); }, nextTime - _now);
998
998
  };
999
- const _caf = typeof cancelAnimationFrame !== 'undefined' && cancelAnimationFrame !== null
999
+ const _caf = process.env.TARO_PLATFORM === 'web'
1000
1000
  ? cancelAnimationFrame
1001
1001
  : function (seed) {
1002
1002
  // fix https://github.com/NervJS/taro/issues/7749
@@ -3317,9 +3317,7 @@ function contains(node) {
3317
3317
  return isContains;
3318
3318
  }
3319
3319
 
3320
- const isWeb = process.env.TARO_PLATFORM === 'web';
3321
- const isHarmony = process.env.TARO_PLATFORM === 'harmony' || process.env.TARO_ENV === 'harmony';
3322
- if (!isWeb && !isHarmony) {
3320
+ if (process.env.TARO_PLATFORM !== 'web' && !(process.env.TARO_PLATFORM === 'harmony' || process.env.TARO_ENV === 'harmony')) {
3323
3321
  if (ENABLE_INNER_HTML) {
3324
3322
  TaroNode.extend('innerHTML', {
3325
3323
  set(html) {