visual-studio - VS 中异步函数关键字下的 extjs 警告/错误
问题描述
在 Visual Studio 版本 14.0.25431.01 Update 3 中,我转到 FILE,NEW SENCHA PROJECT。在 MainController.js 中,我添加了一个简单的异步函数。我收到了来自我的 IDE 的警告,在 function 一词下有一条红线,表示“expected ';'”。代码仍然正常运行,但我试图摆脱这个错误/警告。有谁知道我该如何解决这个问题?
/**
* This class is the controller for the main view for the application. It is
specified as
* the "controller" of the Main view class.
*/
Ext.define('ExtApplication1.view.main.MainController', {
extend: 'Ext.app.ViewController',
alias: 'controller.main',
onItemSelected: function(sender, record) {
Ext.Msg.confirm('Confirm', 'Are you sure?', 'onConfirm', this);
},
onConfirm: function(choice) {
if (choice === 'yes') {
//
foo();
}
}
});
async function foo() {
try {
console.log(`Got the final result:`);
} catch (error) {
//failureCallback(error);
}
};
红色错误行位于功能词下方,靠近 async foo
解决方案
推荐阅读
- android - 缺少将调试器附加到 Android 进程选项
- python - Tensorflow load_weights() 在 Google Colab 中工作,但在本地失败
- composer-php - Zend Framework 3 应用程序的 composer.json 文件位于何处?
- python - 在函数内运行代码时出现 PicklingError
- javascript - LitElement 不会为原生 Web 组件设置 textContent
- sql - 找到第一场比赛
- python - 如何解决 Azure ADFS 设置中的 Power BI API 令牌问题?
- eclipse - 未在 SVN 中提交更改的最佳方法
- angular - Angular - 如何使用 mixin 为我自己的组件设置主题?
- javascript - 转换 javascript 警报框以在 html 文本框上显示它