Fix up for 'async'

This commit is contained in:
Ryan Cavanaugh
2015-12-08 10:57:33 -08:00
parent 92d7d1c953
commit 964fbea9c1
5 changed files with 28 additions and 14 deletions

View File

@@ -15970,9 +15970,14 @@ namespace ts {
}
// Modifiers cannot appear in property assignments
if (prop.modifiers && prop.modifiers.length > 0) {
grammarErrorOnNode(prop.modifiers[0], Diagnostics.Modifiers_cannot_appear_here);
}
forEach(prop.modifiers, mod => {
if (mod.kind !== SyntaxKind.AsyncKeyword) {
grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod));
}
else if (prop.kind !== SyntaxKind.MethodDeclaration) {
grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod));
}
});
// ECMA-262 11.1.5 Object Initialiser
// If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true