Tighten types in the expression AST.

This commit is contained in:
Cyrus Najmabadi
2014-11-30 19:51:42 -08:00
parent f057d4efd8
commit 3c028f03e1
2 changed files with 11 additions and 11 deletions
+6 -6
View File
@@ -457,7 +457,7 @@ module ts {
export interface PrefixUnaryExpression extends UnaryExpression {
operator: SyntaxKind;
operand: Expression;
operand: UnaryExpression;
}
export interface PostfixUnaryExpression extends PostfixExpression {
@@ -482,15 +482,15 @@ module ts {
}
export interface DeleteExpression extends UnaryExpression {
expression: Expression;
expression: UnaryExpression;
}
export interface TypeOfExpression extends UnaryExpression {
expression: Expression;
expression: UnaryExpression;
}
export interface VoidExpression extends UnaryExpression {
expression: Expression;
expression: UnaryExpression;
}
export interface YieldExpression extends Expression {
@@ -557,7 +557,7 @@ module ts {
}
export interface CallExpression extends LeftHandSideExpression {
expression: Expression;
expression: LeftHandSideExpression;
typeArguments?: NodeArray<TypeNode>;
arguments: NodeArray<Expression>;
}
@@ -573,7 +573,7 @@ module ts {
export interface TypeAssertion extends UnaryExpression {
type: TypeNode;
expression: Expression;
expression: UnaryExpression;
}
export interface Statement extends Node, ModuleElement {
+5 -5
View File
@@ -999,18 +999,18 @@ module TypeScript.Parser {
// Technically a keyword is valid here as all keywords are identifier names.
// However, often we'll encounter this in error situations when the keyword
// is actually starting another valid construct.
//
// So, we check for the following specific case:
//
// name.
// keyword identifierNameOrKeyword
//
// Note: the newlines are important here. For example, if that above code
// were rewritten into:
//
// name.keyword
// identifierNameOrKeyword
//
// Then we would consider it valid. That's because ASI would take effect and
// the code would be implicitly: "name.keyword; identifierNameOrKeyword".
// In the first case though, ASI will not take effect because there is not a