Visual studio VS中async function关键字下的extjs警告/错误

Visual studio VS中async function关键字下的extjs警告/错误,visual-studio,function,extjs,async-await,Visual Studio,Function,Extjs,Async Await,在VisualStudioVersion14.0.25431.01 Update 3中,我转到了文件“新SENCHA项目”。在MainController.js中,我添加了一个简单的异步函数。我从IDE收到一条警告,在单词function下面有一条红线,表示“expected';”。代码仍然正确运行,但我正在尝试消除此错误/警告。有人知道我怎么解决这个问题吗 /** * This class is the controller for the main view for the applica

在VisualStudioVersion14.0.25431.01 Update 3中,我转到了文件“新SENCHA项目”。在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

是因为函数的ene处有分号吗?不是。。。仍然不起作用