mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Address PR feedback
This commit is contained in:
@@ -618,7 +618,7 @@ namespace ts {
|
||||
JSX_attribute_expected: { code: 17003, category: DiagnosticCategory.Error, key: "JSX attribute expected." },
|
||||
Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: DiagnosticCategory.Error, key: "Cannot use JSX unless the '--jsx' flag is provided." },
|
||||
A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: DiagnosticCategory.Error, key: "A constructor cannot contain a 'super' call when its class extends 'null'" },
|
||||
An_unary_expression_with_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: DiagnosticCategory.Error, key: "An unary expression with '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." },
|
||||
Type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: DiagnosticCategory.Error, key: "Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." },
|
||||
An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: DiagnosticCategory.Error, key: "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." },
|
||||
A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: DiagnosticCategory.Error, key: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." },
|
||||
};
|
||||
}
|
||||
@@ -2467,11 +2467,11 @@
|
||||
"category": "Error",
|
||||
"code": 17005
|
||||
},
|
||||
"An unary expression with '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": {
|
||||
"An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": {
|
||||
"category": "Error",
|
||||
"code": 17006
|
||||
},
|
||||
"Type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": {
|
||||
"A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": {
|
||||
"category": "Error",
|
||||
"code": 17006
|
||||
}
|
||||
|
||||
+13
-13
@@ -836,8 +836,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
}
|
||||
}
|
||||
let node = nodes[start + i];
|
||||
let leadcomment = getLeadingCommentsToEmit(node);
|
||||
let trailcomment = getTrailingCommentRanges(currentSourceFile.text, node.pos);
|
||||
let leadingComments = getLeadingCommentsToEmit(node);
|
||||
let trailingComments = getTrailingCommentRanges(currentSourceFile.text, node.pos);
|
||||
// This emitting is to make sure we emit following comment properly
|
||||
// ...(x, /*comment1*/ y)...
|
||||
// ^ => node.pos
|
||||
@@ -2522,7 +2522,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
// a[0] **= a[0] **= 2
|
||||
// _a = a, _a[0] = Math.pow(_a[0], (_b = a, _b[0] = Math.pow(_b[0], 2)));
|
||||
// ^ -> required extra parenthesis controlled by shouldEmitParenthesis
|
||||
// exponentiation compount in variable declaration
|
||||
// exponentiation compound in variable declaration
|
||||
// var x = a[0] **= a[0] **= 2
|
||||
// var x = (_a = a, _a[0] = Math.pow(_a[0], (_b = a, _b[0] = Math.pow(_b[0], 2))));
|
||||
// ^ -> required extra parenthesis controlled by shouldEmitParenthesis
|
||||
@@ -2537,9 +2537,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
}
|
||||
|
||||
synthesizedLHS = <ElementAccessExpression>createSynthesizedNode(SyntaxKind.ElementAccessExpression, /*startsOnNewLine*/ false);
|
||||
let tempExpression = createAndRecordTempVariable(TempFlags.Auto);
|
||||
emitAssignment(tempExpression, leftHandSideExpression.expression, /*shouldEmitCommaBeforeAssignment*/ false);
|
||||
synthesizedLHS.expression = tempExpression
|
||||
let tempVariable = createAndRecordTempVariable(TempFlags.Auto);
|
||||
emitAssignment(tempVariable, leftHandSideExpression.expression, /*shouldEmitCommaBeforeAssignment*/ false);
|
||||
synthesizedLHS.expression = tempVariable
|
||||
|
||||
if (leftHandSideExpression.argumentExpression.kind !== SyntaxKind.NumericLiteral &&
|
||||
leftHandSideExpression.argumentExpression.kind !== SyntaxKind.StringLiteral) {
|
||||
@@ -2560,9 +2560,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
}
|
||||
|
||||
synthesizedLHS = <PropertyAccessExpression>createSynthesizedNode(SyntaxKind.PropertyAccessExpression, /*startsOnNewLine*/ false);
|
||||
let tempExpression = createAndRecordTempVariable(TempFlags.Auto);
|
||||
synthesizedLHS.expression = tempExpression
|
||||
emitAssignment(tempExpression, leftHandSideExpression.expression, /*shouldEmitCommaBeforeAssignment*/ false);
|
||||
let tempVariable = createAndRecordTempVariable(TempFlags.Auto);
|
||||
synthesizedLHS.expression = tempVariable
|
||||
emitAssignment(tempVariable, leftHandSideExpression.expression, /*shouldEmitCommaBeforeAssignment*/ false);
|
||||
(<PropertyAccessExpression>synthesizedLHS).dotToken = leftHandSideExpression.dotToken;
|
||||
(<PropertyAccessExpression>synthesizedLHS).name = leftHandSideExpression.name;
|
||||
write(", ");
|
||||
@@ -3259,9 +3259,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
write(", ");
|
||||
}
|
||||
|
||||
const isVariableDeclarationOrBindingElement =
|
||||
name.parent && (name.parent.kind === SyntaxKind.VariableDeclaration || name.parent.kind === SyntaxKind.BindingElement);
|
||||
|
||||
let exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(name);
|
||||
|
||||
if (exportChanged) {
|
||||
@@ -3270,6 +3267,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
write(`", `);
|
||||
}
|
||||
|
||||
const isVariableDeclarationOrBindingElement =
|
||||
name.parent && (name.parent.kind === SyntaxKind.VariableDeclaration || name.parent.kind === SyntaxKind.BindingElement);
|
||||
|
||||
if (isVariableDeclarationOrBindingElement) {
|
||||
emitModuleMemberName(<Declaration>name.parent);
|
||||
}
|
||||
@@ -3500,7 +3500,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
}
|
||||
}
|
||||
else {
|
||||
emitAssignment(<Identifier>target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount> 0);
|
||||
emitAssignment(<Identifier>target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0);
|
||||
emitCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3212,10 +3212,10 @@ namespace ts {
|
||||
let diagnostic: Diagnostic;
|
||||
let start = skipTrivia(sourceText, simpleUnaryExpression.pos);
|
||||
if (simpleUnaryExpression.kind === SyntaxKind.TypeAssertionExpression) {
|
||||
parseErrorAtPosition(start, simpleUnaryExpression.end - start, Diagnostics.Type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);
|
||||
parseErrorAtPosition(start, simpleUnaryExpression.end - start, Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);
|
||||
}
|
||||
else {
|
||||
parseErrorAtPosition(start, simpleUnaryExpression.end - start, Diagnostics.An_unary_expression_with_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, tokenToString(unaryOperator));
|
||||
parseErrorAtPosition(start, simpleUnaryExpression.end - start, Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, tokenToString(unaryOperator));
|
||||
}
|
||||
}
|
||||
return simpleUnaryExpression;
|
||||
|
||||
Reference in New Issue
Block a user