预期标识符-非ES6版本的脚本在IE11中给出了错误

我正在尝试弄清为什么脚本在IE 11中给了我错误。我将其精简为:

python evaluate.py --checkpoint ./rain-princess.ckpt --in-path <path_to_input_file> --out-path ./output_image.jpg

错误代码显示第14行第25列-即:

/*
 * enter-view.js is library
 */

(function (factory) {
  if (typeof define === 'function' && define.amd) {
    define(factory);
  } else if (typeof module !== 'undefined' && module.exports) {
    module.exports = factory();
  } else {
    window.enterView = factory.call(this);
  }
})(function () {
  const lib = function ({
    selector,enter = function () {},exit = function () {},progress = function () {},offset = 0,once = false
  }) {
     // other code here - but trimmed down
  };

  return lib;
});

我无法弄清楚为什么它给了我这个错误。有什么建议吗?

顺便说一句,输出的代码来自Babel,具有以下配置:

  const lib = function ({
gr364212028 回答:预期标识符-非ES6版本的脚本在IE11中给出了错误

似乎在const lib = function ({selector,这一行中,您尝试使用IE中不支持的destructuring_assignment。尝试使用babel编译器

本文链接:https://www.f2er.com/3153743.html

大家都在问