mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Tighten types in the expression AST.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user