在Visual Studio版本14.0.25431.01更新3中,我转到FILE,NEW SENCHA PROJECT。在MainController.js中,我添加了一个简单的异步函数。我从我的IDE中收到警告,单词功能下的红线显示为“ 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);
}
};
红色错误行位于功能词下方,异步foo旁边