drop unused variables
This commit is contained in:
parent
dc3bd6a932
commit
9781c05693
3 changed files with 8 additions and 8 deletions
|
@ -2664,8 +2664,6 @@ module ts {
|
||||||
|
|
||||||
function parseReturnStatement(): ReturnStatement {
|
function parseReturnStatement(): ReturnStatement {
|
||||||
var node = <ReturnStatement>createNode(SyntaxKind.ReturnStatement);
|
var node = <ReturnStatement>createNode(SyntaxKind.ReturnStatement);
|
||||||
var returnTokenStart = scanner.getTokenPos();
|
|
||||||
var returnTokenLength = scanner.getTextPos() - returnTokenStart;
|
|
||||||
|
|
||||||
parseExpected(SyntaxKind.ReturnKeyword);
|
parseExpected(SyntaxKind.ReturnKeyword);
|
||||||
if (!canParseSemicolon()) {
|
if (!canParseSemicolon()) {
|
||||||
|
@ -2935,8 +2933,6 @@ module ts {
|
||||||
node.type = parseTypeAnnotation();
|
node.type = parseTypeAnnotation();
|
||||||
|
|
||||||
// Issue any initializer-related errors on the equals token
|
// Issue any initializer-related errors on the equals token
|
||||||
var initializerStart = scanner.getTokenPos();
|
|
||||||
var initializerFirstTokenLength = scanner.getTextPos() - initializerStart;
|
|
||||||
node.initializer = parseInitializer(/*inParameter*/ false, noIn);
|
node.initializer = parseInitializer(/*inParameter*/ false, noIn);
|
||||||
|
|
||||||
return finishNode(node);
|
return finishNode(node);
|
||||||
|
@ -2998,7 +2994,6 @@ module ts {
|
||||||
function parsePropertyMemberDeclaration(pos: number, modifiers: ModifiersArray): Declaration {
|
function parsePropertyMemberDeclaration(pos: number, modifiers: ModifiersArray): Declaration {
|
||||||
var name = parsePropertyName();
|
var name = parsePropertyName();
|
||||||
var flags = modifiers ? modifiers.flags : 0;
|
var flags = modifiers ? modifiers.flags : 0;
|
||||||
var questionStart = scanner.getTokenPos();
|
|
||||||
if (parseOptional(SyntaxKind.QuestionToken)) {
|
if (parseOptional(SyntaxKind.QuestionToken)) {
|
||||||
// Note: this is not legal as per the grammar. But we allow it in the parser and
|
// Note: this is not legal as per the grammar. But we allow it in the parser and
|
||||||
// report an error in the grammar checker.
|
// report an error in the grammar checker.
|
||||||
|
@ -3031,8 +3026,6 @@ module ts {
|
||||||
property.name = name;
|
property.name = name;
|
||||||
property.type = parseTypeAnnotation();
|
property.type = parseTypeAnnotation();
|
||||||
|
|
||||||
var initializerStart = scanner.getTokenPos();
|
|
||||||
var initializerFirstTokenLength = scanner.getTextPos() - initializerStart;
|
|
||||||
property.initializer = parseInitializer(/*inParameter*/ false);
|
property.initializer = parseInitializer(/*inParameter*/ false);
|
||||||
parseSemicolon();
|
parseSemicolon();
|
||||||
|
|
||||||
|
@ -3324,7 +3317,6 @@ module ts {
|
||||||
var pos = getNodePos();
|
var pos = getNodePos();
|
||||||
var modifiers = parseModifiers(modifierContext);
|
var modifiers = parseModifiers(modifierContext);
|
||||||
if (token === SyntaxKind.ExportKeyword) {
|
if (token === SyntaxKind.ExportKeyword) {
|
||||||
var modifiersEnd = scanner.getStartPos();
|
|
||||||
nextToken();
|
nextToken();
|
||||||
if (parseOptional(SyntaxKind.EqualsToken)) {
|
if (parseOptional(SyntaxKind.EqualsToken)) {
|
||||||
return parseExportAssignmentTail(pos, modifiers);
|
return parseExportAssignmentTail(pos, modifiers);
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
tests/cases/compiler/spaceBeforeQuestionMarkInPropertyAssignment.ts(1,12): error TS1162: An object member cannot be declared optional.
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/compiler/spaceBeforeQuestionMarkInPropertyAssignment.ts (1 errors) ====
|
||||||
|
var x = {x ?: 1} // should not crash
|
||||||
|
~
|
||||||
|
!!! error TS1162: An object member cannot be declared optional.
|
|
@ -0,0 +1 @@
|
||||||
|
var x = {x ?: 1} // should not crash
|
Loading…
Reference in a new issue