[Sencha ExtJS] async 成员函数中不能使用 me.callParent()
上面的 ES7 代码,在 sencha app build 后变成下面的 ES5 代码
[Sencha ExtJS] async 成员函数中不能使用 me.callParent()
可以看到 me.callParent 被包在了一个 function($jscomp$generator$context) {} 里面。

callParent 方法的逻辑如下图。
[Sencha ExtJS] async 成员函数中不能使用 me.callParent()
非 async 成员函数,method = this.callParent.caller 指向的是当前类callParent 方法。method.$owner 就是当前类

而 async 成员函数 转换的 ES5 代码,method = this.callParent.caller 却变成了 function($jscomp$generator$context) {} 方法method.$ownerundefined,所以执行会出错。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-20
  • 2021-12-31
  • 2021-06-05
  • 2021-04-27
猜你喜欢
  • 2022-01-11
  • 2021-06-14
  • 2021-09-21
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2021-06-09
相关资源
相似解决方案