Merge branch 'master' into withANameLikeUnicodeYoudThinkThereWouldntBeSoManyWaysToDoIt

Conflicts:
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
This commit is contained in:
Daniel Rosenwasser
2015-02-27 15:45:28 -08:00
95 changed files with 603 additions and 423 deletions
+30 -4
View File
@@ -37,12 +37,38 @@ if(!(Test-Path $tsRegKey)){
}
if($tsScript -ne ""){
if(!(Test-Path $tsScript)){
Throw "Could not locate the TypeScript language service script at ${tsScript}"
$tsScriptServices = "${tsScript}\typescriptServices.js"
$tsScriptlib = "${tsScript}\lib.d.ts"
$tsES6Scriptlib = "${tsScript}\lib.es6.d.ts"
if(!(Test-Path $tsScriptServices)){
Throw "Could not locate the TypeScript language service script at ${tsScriptServices}"
}
else {
$path = resolve-path ${tsScriptServices}
Set-ItemProperty -path $tsRegKey -name CustomTypeScriptServicesFileLocation -value "${path}"
Write-Host "Enabled custom TypeScript language service at ${path} for Dev${vsVersion}"
}
if(!(Test-Path $tsScriptlib)){
Throw "Could not locate the TypeScript default library at ${tsScriptlib}"
}
else {
$path = resolve-path ${tsScriptlib}
Set-ItemProperty -path $tsRegKey -name CustomDefaultLibraryLocation -value "${path}"
Write-Host "Enabled custom TypeScript default library at ${path} for Dev${vsVersion}"
}
if(!(Test-Path $tsES6Scriptlib)){
Throw "Could not locate the TypeScript default ES6 library at ${tsES6Scriptlib}"
}
else {
$path = resolve-path ${tsES6Scriptlib}
Set-ItemProperty -path $tsRegKey -name CustomDefaultES6LibraryLocation -value "${path}"
Write-Host "Enabled custom TypeScript default ES6 library at ${path} for Dev${vsVersion}"
}
Set-ItemProperty -path $tsRegKey -name CustomTypeScriptServicesFileLocation -value "${tsScript}"
Write-Host "Enabled custom TypeScript language service at ${tsScript} for Dev${vsVersion}"
}
if($enableDevMode){
Set-ItemProperty -path $tsRegKey -name EnableDevMode -value 1
Write-Host "Enabled developer mode for Dev${vsVersion}"
+2 -9
View File
@@ -342,14 +342,7 @@ module ts {
}
function bindCatchVariableDeclaration(node: CatchClause) {
var symbol = createSymbol(SymbolFlags.FunctionScopedVariable, node.name.text || "__missing");
addDeclarationToSymbol(symbol, node, SymbolFlags.FunctionScopedVariable);
var saveParent = parent;
var savedBlockScopeContainer = blockScopeContainer;
parent = blockScopeContainer = node;
forEachChild(node, bind);
parent = saveParent;
blockScopeContainer = savedBlockScopeContainer;
bindChildren(node, /*symbolKind:*/ 0, /*isBlockScopeContainer:*/ true);
}
function bindBlockScopedVariableDeclaration(node: Declaration) {
@@ -390,7 +383,7 @@ module ts {
if (isBindingPattern((<Declaration>node).name)) {
bindChildren(node, 0, /*isBlockScopeContainer*/ false);
}
else if (getCombinedNodeFlags(node) & NodeFlags.BlockScoped) {
else if (isBlockOrCatchScoped(<Declaration>node)) {
bindBlockScopedVariableDeclaration(<Declaration>node);
}
else {
+32 -29
View File
@@ -416,13 +416,6 @@ module ts {
break loop;
}
break;
case SyntaxKind.CatchClause:
var id = (<CatchClause>location).name;
if (name === id.text) {
result = location.symbol;
break loop;
}
break;
}
lastLocation = location;
location = location.parent;
@@ -451,7 +444,8 @@ module ts {
}
if (result.flags & SymbolFlags.BlockScopedVariable) {
// Block-scoped variables cannot be used before their definition
var declaration = forEach(result.declarations, d => getCombinedNodeFlags(d) & NodeFlags.BlockScoped ? d : undefined);
var declaration = forEach(result.declarations, d => isBlockOrCatchScoped(d) ? d : undefined);
Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined");
if (!isDefinedBefore(declaration, errorLocation)) {
error(errorLocation, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, declarationNameToString(declaration.name));
@@ -1994,7 +1988,7 @@ module ts {
}
// Handle catch clause variables
var declaration = symbol.valueDeclaration;
if (declaration.kind === SyntaxKind.CatchClause) {
if (declaration.parent.kind === SyntaxKind.CatchClause) {
return links.type = anyType;
}
// Handle variable, parameter or property
@@ -8926,18 +8920,29 @@ module ts {
var catchClause = node.catchClause;
if (catchClause) {
// Grammar checking
if (catchClause.type) {
var sourceFile = getSourceFileOfNode(node);
var colonStart = skipTrivia(sourceFile.text, catchClause.name.end);
grammarErrorAtPos(sourceFile, colonStart, ":".length, Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation);
if (catchClause.variableDeclaration) {
if (catchClause.variableDeclaration.name.kind !== SyntaxKind.Identifier) {
grammarErrorOnFirstToken(catchClause.variableDeclaration.name, Diagnostics.Catch_clause_variable_name_must_be_an_identifier);
}
else if (catchClause.variableDeclaration.type) {
grammarErrorOnFirstToken(catchClause.variableDeclaration.type, Diagnostics.Catch_clause_variable_cannot_have_a_type_annotation);
}
else if (catchClause.variableDeclaration.initializer) {
grammarErrorOnFirstToken(catchClause.variableDeclaration.initializer, Diagnostics.Catch_clause_variable_cannot_have_an_initializer);
}
else {
// It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the
// Catch production is eval or arguments
checkGrammarEvalOrArgumentsInStrictMode(node, <Identifier>catchClause.variableDeclaration.name);
}
}
// It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the
// Catch production is eval or arguments
checkGrammarEvalOrArgumentsInStrictMode(node, catchClause.name);
checkBlock(catchClause.block);
}
if (node.finallyBlock) checkBlock(node.finallyBlock);
if (node.finallyBlock) {
checkBlock(node.finallyBlock);
}
}
function checkIndexConstraints(type: Type) {
@@ -10049,11 +10054,6 @@ module ts {
copySymbol(location.symbol, meaning);
}
break;
case SyntaxKind.CatchClause:
if ((<CatchClause>location).name.text) {
copySymbol(location.symbol, meaning);
}
break;
}
memberFlags = location.flags;
location = location.parent;
@@ -10190,7 +10190,7 @@ module ts {
}
function getSymbolOfEntityNameOrPropertyAccessExpression(entityName: EntityName | PropertyAccessExpression): Symbol {
if (isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) {
if (isDeclarationName(entityName)) {
return getSymbolOfNode(entityName.parent);
}
@@ -10255,7 +10255,7 @@ module ts {
return undefined;
}
if (isDeclarationOrFunctionExpressionOrCatchVariableName(node)) {
if (isDeclarationName(node)) {
// This is a declaration, call getSymbolOfNode
return getSymbolOfNode(node.parent);
}
@@ -10351,7 +10351,7 @@ module ts {
return getTypeOfSymbol(symbol);
}
if (isDeclarationOrFunctionExpressionOrCatchVariableName(node)) {
if (isDeclarationName(node)) {
var symbol = getSymbolInfo(node);
return symbol && getTypeOfSymbol(symbol);
}
@@ -11616,10 +11616,13 @@ module ts {
}
}
function checkGrammarEvalOrArgumentsInStrictMode(contextNode: Node, identifier: Identifier): boolean {
if (contextNode && (contextNode.parserContextFlags & ParserContextFlags.StrictMode) && isEvalOrArgumentsIdentifier(identifier)) {
var name = declarationNameToString(identifier);
return grammarErrorOnNode(identifier, Diagnostics.Invalid_use_of_0_in_strict_mode, name);
function checkGrammarEvalOrArgumentsInStrictMode(contextNode: Node, name: Node): boolean {
if (name && name.kind === SyntaxKind.Identifier) {
var identifier = <Identifier>name;
if (contextNode && (contextNode.parserContextFlags & ParserContextFlags.StrictMode) && isEvalOrArgumentsIdentifier(identifier)) {
var nameText = declarationNameToString(identifier);
return grammarErrorOnNode(identifier, Diagnostics.Invalid_use_of_0_in_strict_mode, nameText);
}
}
}
@@ -9,7 +9,6 @@ module ts {
Trailing_comma_not_allowed: { code: 1009, category: DiagnosticCategory.Error, key: "Trailing comma not allowed." },
Asterisk_Slash_expected: { code: 1010, category: DiagnosticCategory.Error, key: "'*/' expected." },
Unexpected_token: { code: 1012, category: DiagnosticCategory.Error, key: "Unexpected token." },
Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: DiagnosticCategory.Error, key: "Catch clause parameter cannot have a type annotation." },
A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: DiagnosticCategory.Error, key: "A rest parameter must be last in a parameter list." },
Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: DiagnosticCategory.Error, key: "Parameter cannot have question mark and initializer." },
A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: DiagnosticCategory.Error, key: "A required parameter cannot follow an optional parameter." },
@@ -153,8 +152,11 @@ module ts {
External_module_0_has_no_default_export_or_export_assignment: { code: 1192, category: DiagnosticCategory.Error, key: "External module '{0}' has no default export or export assignment." },
An_export_declaration_cannot_have_modifiers: { code: 1193, category: DiagnosticCategory.Error, key: "An export declaration cannot have modifiers." },
Export_declarations_are_not_permitted_in_an_internal_module: { code: 1194, category: DiagnosticCategory.Error, key: "Export declarations are not permitted in an internal module." },
An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1195, category: DiagnosticCategory.Error, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." },
expected: { code: 1196, category: DiagnosticCategory.Error, key: "'}' expected." },
Catch_clause_variable_name_must_be_an_identifier: { code: 1195, category: DiagnosticCategory.Error, key: "Catch clause variable name must be an identifier." },
Catch_clause_variable_cannot_have_a_type_annotation: { code: 1196, category: DiagnosticCategory.Error, key: "Catch clause variable cannot have a type annotation." },
Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: DiagnosticCategory.Error, key: "Catch clause variable cannot have an initializer." },
An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: DiagnosticCategory.Error, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." },
expected: { code: 1199, category: DiagnosticCategory.Error, key: "'}' expected." },
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
+14 -6
View File
@@ -27,10 +27,6 @@
"category": "Error",
"code": 1012
},
"Catch clause parameter cannot have a type annotation.": {
"category": "Error",
"code": 1013
},
"A rest parameter must be last in a parameter list.": {
"category": "Error",
"code": 1014
@@ -603,13 +599,25 @@
"category": "Error",
"code": 1194
},
"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.": {
"Catch clause variable name must be an identifier.": {
"category": "Error",
"code": 1195
},
"Catch clause variable cannot have a type annotation.": {
"category": "Error",
"code": 1196
},
"Catch clause variable cannot have an initializer.": {
"category": "Error",
"code": 1197
},
"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.": {
"category": "Error",
"code": 1198
},
"'}' expected.": {
"category": "Error",
"code": 1196
"code": 1199
},
"Duplicate identifier '{0}'.": {
"category": "Error",
+26 -13
View File
@@ -1523,6 +1523,10 @@ module ts {
return diagnostics;
}
interface SynthesizedNode extends Node {
startsOnNewLine: boolean;
}
// @internal
// targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature
export function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile): EmitResult {
@@ -2467,8 +2471,6 @@ module ts {
return false;
case SyntaxKind.LabeledStatement:
return (<LabeledStatement>node.parent).label === node;
case SyntaxKind.CatchClause:
return (<CatchClause>node.parent).name === node;
}
}
@@ -2628,14 +2630,19 @@ module ts {
}
}
function createSynthesizedNode(kind: SyntaxKind): Node {
var node = createNode(kind);
function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node {
var node = <SynthesizedNode>createNode(kind);
node.pos = -1;
node.end = -1;
node.startsOnNewLine = startsOnNewLine;
return node;
}
function isSynthesized(node: Node) {
return node.pos === -1 && node.end === -1;
}
function emitDownlevelObjectLiteralWithComputedProperties(node: ObjectLiteralExpression, firstComputedPropertyIndex: number): void {
var parenthesizedObjectLiteral = createDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex);
return emit(parenthesizedObjectLiteral);
@@ -2669,7 +2676,7 @@ module ts {
});
// Finally, return the temp variable.
propertyPatches = createBinaryExpression(propertyPatches, SyntaxKind.CommaToken, tempVar);
propertyPatches = createBinaryExpression(propertyPatches, SyntaxKind.CommaToken, createIdentifier(tempVar.text, /*startsOnNewLine:*/ true));
var result = createParenthesizedExpression(propertyPatches);
@@ -2692,7 +2699,7 @@ module ts {
var leftHandSide = createMemberAccessForPropertyName(tempVar, property.name);
var maybeRightHandSide = tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property);
return maybeRightHandSide && createBinaryExpression(leftHandSide, SyntaxKind.EqualsToken, maybeRightHandSide);
return maybeRightHandSide && createBinaryExpression(leftHandSide, SyntaxKind.EqualsToken, maybeRightHandSide, /*startsOnNewLine:*/ true);
}
function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral: ObjectLiteralExpression, property: ObjectLiteralElement) {
@@ -2765,8 +2772,8 @@ module ts {
return result;
}
function createBinaryExpression(left: Expression, operator: SyntaxKind, right: Expression): BinaryExpression {
var result = <BinaryExpression>createSynthesizedNode(SyntaxKind.BinaryExpression);
function createBinaryExpression(left: Expression, operator: SyntaxKind, right: Expression, startsOnNewLine?: boolean): BinaryExpression {
var result = <BinaryExpression>createSynthesizedNode(SyntaxKind.BinaryExpression, startsOnNewLine);
result.operatorToken = createSynthesizedNode(operator);
result.left = left;
result.right = right;
@@ -2821,8 +2828,8 @@ module ts {
return result;
}
function createIdentifier(name: string) {
var result = <Identifier>createSynthesizedNode(SyntaxKind.Identifier);
function createIdentifier(name: string, startsOnNewLine?: boolean) {
var result = <Identifier>createSynthesizedNode(SyntaxKind.Identifier, startsOnNewLine);
result.text = name;
return result;
@@ -3166,9 +3173,11 @@ module ts {
write(tokenToString(node.operatorToken.kind));
var shouldPlaceOnNewLine = !isSynthesized(node) && !nodeEndIsOnSameLineAsNodeStart(node.operatorToken, node.right);
// Check if the right expression is on a different line versus the operator itself. If so,
// we'll emit newline.
if (!nodeEndIsOnSameLineAsNodeStart(node.operatorToken, node.right)) {
if (shouldPlaceOnNewLine || synthesizedNodeStartsOnNewLine(node.right)) {
increaseIndent();
writeLine();
emit(node.right);
@@ -3181,6 +3190,10 @@ module ts {
}
}
function synthesizedNodeStartsOnNewLine(node: Node) {
return isSynthesized(node) && (<SynthesizedNode>node).startsOnNewLine;
}
function emitConditionalExpression(node: ConditionalExpression) {
emit(node.condition);
write(" ? ");
@@ -3434,8 +3447,8 @@ module ts {
var endPos = emitToken(SyntaxKind.CatchKeyword, node.pos);
write(" ");
emitToken(SyntaxKind.OpenParenToken, endPos);
emit(node.name);
emitToken(SyntaxKind.CloseParenToken, node.name.end);
emit(node.variableDeclaration);
emitToken(SyntaxKind.CloseParenToken, node.variableDeclaration ? node.variableDeclaration.end : endPos);
write(" ");
emitBlock(node.block);
}
+5 -5
View File
@@ -222,8 +222,7 @@ module ts {
visitNode(cbNode, (<TryStatement>node).catchClause) ||
visitNode(cbNode, (<TryStatement>node).finallyBlock);
case SyntaxKind.CatchClause:
return visitNode(cbNode, (<CatchClause>node).name) ||
visitNode(cbNode, (<CatchClause>node).type) ||
return visitNode(cbNode, (<CatchClause>node).variableDeclaration) ||
visitNode(cbNode, (<CatchClause>node).block);
case SyntaxKind.ClassDeclaration:
return visitNodes(cbNodes, node.modifiers) ||
@@ -3977,9 +3976,10 @@ module ts {
function parseCatchClause(): CatchClause {
var result = <CatchClause>createNode(SyntaxKind.CatchClause);
parseExpected(SyntaxKind.CatchKeyword);
parseExpected(SyntaxKind.OpenParenToken);
result.name = parseIdentifier();
result.type = parseTypeAnnotation();
if (parseExpected(SyntaxKind.OpenParenToken)) {
result.variableDeclaration = parseVariableDeclaration();
}
parseExpected(SyntaxKind.CloseParenToken);
result.block = parseBlock(/*ignoreMissingOpenBrace:*/ false, /*checkForStrictMode:*/ false);
return finishNode(result);
+3
View File
@@ -3,6 +3,7 @@
module ts {
/* @internal */ export var emitTime = 0;
/* @internal */ export var ioReadTime = 0;
export function createCompilerHost(options: CompilerOptions): CompilerHost {
var currentDirectory: string;
@@ -19,7 +20,9 @@ module ts {
function getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile {
try {
var start = new Date().getTime();
var text = sys.readFile(fileName, options.charset);
ioReadTime += new Date().getTime() - start;
}
catch (e) {
if (onError) {
+14 -1
View File
@@ -322,6 +322,7 @@ module ts {
}
function compile(fileNames: string[], compilerOptions: CompilerOptions, compilerHost: CompilerHost) {
ts.ioReadTime = 0;
ts.parseTime = 0;
ts.bindTime = 0;
ts.checkTime = 0;
@@ -330,9 +331,12 @@ module ts {
var start = new Date().getTime();
var program = createProgram(fileNames, compilerOptions, compilerHost);
var programTime = new Date().getTime() - start;
var exitStatus = compileProgram();
var end = new Date().getTime() - start;
var compileTime = end - programTime;
if (compilerOptions.listFiles) {
forEach(program.getSourceFiles(), file => {
@@ -353,10 +357,19 @@ module ts {
reportStatisticalValue("Memory used", Math.round(memoryUsed / 1000) + "K");
}
reportTimeStatistic("Parse time", ts.parseTime);
// Individual component times.
// Note: we output 'programTime' as parseTime to match the tsc 1.3 behavior. tsc 1.3
// measured parse time along with read IO as a single counter. We preserve that
// behavior so we can accurately compare times. For actual parse times (in isolation)
// is reported below.
reportTimeStatistic("Parse time", programTime);
reportTimeStatistic("Bind time", ts.bindTime);
reportTimeStatistic("Check time", ts.checkTime);
reportTimeStatistic("Emit time", ts.emitTime);
reportTimeStatistic("Parse time w/o IO", ts.parseTime);
reportTimeStatistic("IO read", ts.ioReadTime);
reportTimeStatistic("Compile time", compileTime);
reportTimeStatistic("Total time", end);
}
+2 -3
View File
@@ -815,9 +815,8 @@ module ts {
finallyBlock?: Block;
}
export interface CatchClause extends Declaration {
name: Identifier;
type?: TypeNode;
export interface CatchClause extends Node {
variableDeclaration: VariableDeclaration;
block: Block;
}
+35 -25
View File
@@ -192,6 +192,18 @@ module ts {
return getBaseFileName(moduleName).replace(/\W/g, "_");
}
export function isBlockOrCatchScoped(declaration: Declaration) {
return (getCombinedNodeFlags(declaration) & NodeFlags.BlockScoped) !== 0 ||
isCatchClauseVariableDeclaration(declaration);
}
export function isCatchClauseVariableDeclaration(declaration: Declaration) {
return declaration &&
declaration.kind === SyntaxKind.VariableDeclaration &&
declaration.parent &&
declaration.parent.kind === SyntaxKind.CatchClause;
}
// Return display name of an identifier
// Computed property names will just be emitted as "[<expr>]", where <expr> is the source
// text of the expression in the computed property.
@@ -681,31 +693,33 @@ module ts {
export function isDeclaration(node: Node): boolean {
switch (node.kind) {
case SyntaxKind.TypeParameter:
case SyntaxKind.Parameter:
case SyntaxKind.VariableDeclaration:
case SyntaxKind.ArrowFunction:
case SyntaxKind.BindingElement:
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.PropertySignature:
case SyntaxKind.PropertyAssignment:
case SyntaxKind.ShorthandPropertyAssignment:
case SyntaxKind.ClassDeclaration:
case SyntaxKind.Constructor:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.EnumMember:
case SyntaxKind.ExportSpecifier:
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.FunctionExpression:
case SyntaxKind.GetAccessor:
case SyntaxKind.ImportClause:
case SyntaxKind.ImportEqualsDeclaration:
case SyntaxKind.ImportSpecifier:
case SyntaxKind.InterfaceDeclaration:
case SyntaxKind.MethodDeclaration:
case SyntaxKind.MethodSignature:
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
case SyntaxKind.Constructor:
case SyntaxKind.ClassDeclaration:
case SyntaxKind.InterfaceDeclaration:
case SyntaxKind.TypeAliasDeclaration:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.ModuleDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
case SyntaxKind.ImportClause:
case SyntaxKind.ImportSpecifier:
case SyntaxKind.NamespaceImport:
case SyntaxKind.ExportSpecifier:
case SyntaxKind.Parameter:
case SyntaxKind.PropertyAssignment:
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.PropertySignature:
case SyntaxKind.SetAccessor:
case SyntaxKind.ShorthandPropertyAssignment:
case SyntaxKind.TypeAliasDeclaration:
case SyntaxKind.TypeParameter:
case SyntaxKind.VariableDeclaration:
return true;
}
return false;
@@ -739,7 +753,7 @@ module ts {
}
// True if the given identifier, string literal, or number literal is the name of a declaration node
export function isDeclarationOrFunctionExpressionOrCatchVariableName(name: Node): boolean {
export function isDeclarationName(name: Node): boolean {
if (name.kind !== SyntaxKind.Identifier && name.kind !== SyntaxKind.StringLiteral && name.kind !== SyntaxKind.NumericLiteral) {
return false;
}
@@ -751,14 +765,10 @@ module ts {
}
}
if (isDeclaration(parent) || parent.kind === SyntaxKind.FunctionExpression) {
if (isDeclaration(parent)) {
return (<Declaration>parent).name === name;
}
if (parent.kind === SyntaxKind.CatchClause) {
return (<CatchClause>parent).name === name;
}
return false;
}
+2 -2
View File
@@ -4756,7 +4756,7 @@ module ts {
/** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */
function isWriteAccess(node: Node): boolean {
if (node.kind === SyntaxKind.Identifier && isDeclarationOrFunctionExpressionOrCatchVariableName(node)) {
if (node.kind === SyntaxKind.Identifier && isDeclarationName(node)) {
return true;
}
@@ -4918,7 +4918,7 @@ module ts {
else if (isInRightSideOfImport(node)) {
return getMeaningFromRightHandSideOfImportEquals(node);
}
else if (isDeclarationOrFunctionExpressionOrCatchVariableName(node)) {
else if (isDeclarationName(node)) {
return getMeaningFromDeclaration(node.parent);
}
else if (isTypeReference(node)) {
@@ -674,9 +674,8 @@ declare module "typescript" {
catchClause?: CatchClause;
finallyBlock?: Block;
}
interface CatchClause extends Declaration {
name: Identifier;
type?: TypeNode;
interface CatchClause extends Node {
variableDeclaration: VariableDeclaration;
block: Block;
}
interface ModuleElement extends Node {
@@ -2033,17 +2033,13 @@ declare module "typescript" {
>finallyBlock : Block
>Block : Block
}
interface CatchClause extends Declaration {
interface CatchClause extends Node {
>CatchClause : CatchClause
>Declaration : Declaration
>Node : Node
name: Identifier;
>name : Identifier
>Identifier : Identifier
type?: TypeNode;
>type : TypeNode
>TypeNode : TypeNode
variableDeclaration: VariableDeclaration;
>variableDeclaration : VariableDeclaration
>VariableDeclaration : VariableDeclaration
block: Block;
>block : Block
@@ -705,9 +705,8 @@ declare module "typescript" {
catchClause?: CatchClause;
finallyBlock?: Block;
}
interface CatchClause extends Declaration {
name: Identifier;
type?: TypeNode;
interface CatchClause extends Node {
variableDeclaration: VariableDeclaration;
block: Block;
}
interface ModuleElement extends Node {
@@ -2179,17 +2179,13 @@ declare module "typescript" {
>finallyBlock : Block
>Block : Block
}
interface CatchClause extends Declaration {
interface CatchClause extends Node {
>CatchClause : CatchClause
>Declaration : Declaration
>Node : Node
name: Identifier;
>name : Identifier
>Identifier : Identifier
type?: TypeNode;
>type : TypeNode
>TypeNode : TypeNode
variableDeclaration: VariableDeclaration;
>variableDeclaration : VariableDeclaration
>VariableDeclaration : VariableDeclaration
block: Block;
>block : Block
@@ -706,9 +706,8 @@ declare module "typescript" {
catchClause?: CatchClause;
finallyBlock?: Block;
}
interface CatchClause extends Declaration {
name: Identifier;
type?: TypeNode;
interface CatchClause extends Node {
variableDeclaration: VariableDeclaration;
block: Block;
}
interface ModuleElement extends Node {
@@ -2129,17 +2129,13 @@ declare module "typescript" {
>finallyBlock : Block
>Block : Block
}
interface CatchClause extends Declaration {
interface CatchClause extends Node {
>CatchClause : CatchClause
>Declaration : Declaration
>Node : Node
name: Identifier;
>name : Identifier
>Identifier : Identifier
type?: TypeNode;
>type : TypeNode
>TypeNode : TypeNode
variableDeclaration: VariableDeclaration;
>variableDeclaration : VariableDeclaration
>VariableDeclaration : VariableDeclaration
block: Block;
>block : Block
@@ -743,9 +743,8 @@ declare module "typescript" {
catchClause?: CatchClause;
finallyBlock?: Block;
}
interface CatchClause extends Declaration {
name: Identifier;
type?: TypeNode;
interface CatchClause extends Node {
variableDeclaration: VariableDeclaration;
block: Block;
}
interface ModuleElement extends Node {
@@ -2302,17 +2302,13 @@ declare module "typescript" {
>finallyBlock : Block
>Block : Block
}
interface CatchClause extends Declaration {
interface CatchClause extends Node {
>CatchClause : CatchClause
>Declaration : Declaration
>Node : Node
name: Identifier;
>name : Identifier
>Identifier : Identifier
type?: TypeNode;
>type : TypeNode
>TypeNode : TypeNode
variableDeclaration: VariableDeclaration;
>variableDeclaration : VariableDeclaration
>VariableDeclaration : VariableDeclaration
block: Block;
>block : Block
@@ -12,8 +12,8 @@ obj[Symbol.foo];
//// [ES5SymbolProperty1.js]
var Symbol;
var obj = (_a = {}, _a[Symbol.foo] =
0,
var obj = (_a = {},
_a[Symbol.foo] = 0,
_a);
obj[Symbol.foo];
var _a;
@@ -2,7 +2,7 @@
var v = { [yield]: foo }
//// [FunctionDeclaration8_es6.js]
var v = (_a = {}, _a[yield] =
foo,
var v = (_a = {},
_a[yield] = foo,
_a);
var _a;
@@ -5,8 +5,8 @@ function * foo() {
//// [FunctionDeclaration9_es6.js]
function foo() {
var v = (_a = {}, _a[] =
foo,
var v = (_a = {},
_a[] = foo,
_a);
var _a;
}
@@ -2,6 +2,7 @@
var v = { *[foo()]() { } }
//// [FunctionPropertyAssignments5_es6.js]
var v = (_a = {}, _a[foo()] = function () { },
var v = (_a = {},
_a[foo()] = function () { },
_a);
var _a;
@@ -217,7 +217,15 @@
>:=> (line 28, col 8) to (line 28, col 22)
29 > } catch (e) {
~~~~~~~~~~~~~ => Pos: (416 to 428) SpanInfo: {"start":437,"length":15}
~~~~~~~~ => Pos: (416 to 423) SpanInfo: {"start":437,"length":15}
>if (obj.z < 10)
>:=> (line 30, col 8) to (line 30, col 23)
29 > } catch (e) {
~ => Pos: (424 to 424) SpanInfo: undefined
29 > } catch (e) {
~~~~ => Pos: (425 to 428) SpanInfo: {"start":437,"length":15}
>if (obj.z < 10)
>:=> (line 30, col 8) to (line 30, col 23)
--------------------------------
@@ -286,7 +294,15 @@
>:=> (line 37, col 8) to (line 37, col 25)
38 > } catch (e1) {
~~~~~~~~~~~~~~ => Pos: (581 to 594) SpanInfo: {"start":603,"length":10}
~~~~~~~~ => Pos: (581 to 588) SpanInfo: {"start":603,"length":10}
>var b = e1
>:=> (line 39, col 8) to (line 39, col 18)
38 > } catch (e1) {
~~ => Pos: (589 to 590) SpanInfo: undefined
38 > } catch (e1) {
~~~~ => Pos: (591 to 594) SpanInfo: {"start":603,"length":10}
>var b = e1
>:=> (line 39, col 8) to (line 39, col 18)
--------------------------------
@@ -24,7 +24,15 @@
>:=> (line 3, col 4) to (line 3, col 13)
4 >} catch (e) {
~~~~~~~~~~~~~ => Pos: (34 to 46) SpanInfo: {"start":51,"length":9}
~~~~~~~~ => Pos: (34 to 41) SpanInfo: {"start":51,"length":9}
>x = x - 1
>:=> (line 5, col 4) to (line 5, col 13)
4 >} catch (e) {
~ => Pos: (42 to 42) SpanInfo: undefined
4 >} catch (e) {
~~~~ => Pos: (43 to 46) SpanInfo: {"start":51,"length":9}
>x = x - 1
>:=> (line 5, col 4) to (line 5, col 13)
--------------------------------
@@ -94,7 +102,15 @@
--------------------------------
14 >catch (e)
~~~~~~~~~~ => Pos: (138 to 147) SpanInfo: {"start":154,"length":9}
~~~~~~~ => Pos: (138 to 144) SpanInfo: {"start":154,"length":9}
>x = x - 1
>:=> (line 16, col 4) to (line 16, col 13)
14 >catch (e)
~ => Pos: (145 to 145) SpanInfo: undefined
14 >catch (e)
~~ => Pos: (146 to 147) SpanInfo: {"start":154,"length":9}
>x = x - 1
>:=> (line 16, col 4) to (line 16, col 13)
--------------------------------
@@ -0,0 +1,10 @@
tests/cases/compiler/catchClauseWithBindingPattern1.ts(3,8): error TS1195: Catch clause variable name must be an identifier.
==== tests/cases/compiler/catchClauseWithBindingPattern1.ts (1 errors) ====
try {
}
catch ({a}) {
~
!!! error TS1195: Catch clause variable name must be an identifier.
}
@@ -0,0 +1,11 @@
//// [catchClauseWithBindingPattern1.ts]
try {
}
catch ({a}) {
}
//// [catchClauseWithBindingPattern1.js]
try {
}
catch (a = (void 0).a) {
}
@@ -0,0 +1,10 @@
tests/cases/compiler/catchClauseWithInitializer1.ts(3,12): error TS1197: Catch clause variable cannot have an initializer.
==== tests/cases/compiler/catchClauseWithInitializer1.ts (1 errors) ====
try {
}
catch (e = 1) {
~
!!! error TS1197: Catch clause variable cannot have an initializer.
}
@@ -0,0 +1,11 @@
//// [catchClauseWithInitializer1.ts]
try {
}
catch (e = 1) {
}
//// [catchClauseWithInitializer1.js]
try {
}
catch (e = 1) {
}
@@ -1,9 +1,9 @@
tests/cases/compiler/catchClauseWithTypeAnnotation.ts(2,11): error TS1013: Catch clause parameter cannot have a type annotation.
tests/cases/compiler/catchClauseWithTypeAnnotation.ts(2,13): error TS1196: Catch clause variable cannot have a type annotation.
==== tests/cases/compiler/catchClauseWithTypeAnnotation.ts (1 errors) ====
try {
} catch (e: any) {
~
!!! error TS1013: Catch clause parameter cannot have a type annotation.
~~~
!!! error TS1196: Catch clause variable cannot have a type annotation.
}
@@ -20,6 +20,17 @@ var v = {
var s;
var n;
var a;
var v = (_a = {}, _a[s] = function () { }, _a[n] = function () { }, _a[s + s] = function () { }, _a[s + n] = function () { }, _a[+s] = function () { }, _a[""] = function () { }, _a[0] = function () { }, _a[a] = function () { }, _a[true] = function () { }, _a["hello bye"] = function () { }, _a["hello " + a + " bye"] = function () { },
var v = (_a = {},
_a[s] = function () { },
_a[n] = function () { },
_a[s + s] = function () { },
_a[s + n] = function () { },
_a[+s] = function () { },
_a[""] = function () { },
_a[0] = function () { },
_a[a] = function () { },
_a[true] = function () { },
_a["hello bye"] = function () { },
_a["hello " + a + " bye"] = function () { },
_a);
var _a;
@@ -20,6 +20,17 @@ var v = {
var s;
var n;
var a;
var v = (_a = {}, _a[s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[s + s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[s + n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[+s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[""] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[0] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[a] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[true] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a["hello bye"] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a["hello " + a + " bye"] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
var v = (_a = {},
_a[s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
_a[n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }),
_a[s + s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
_a[s + n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }),
_a[+s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
_a[""] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }),
_a[0] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
_a[a] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }),
_a[true] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
_a["hello bye"] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }),
_a["hello " + a + " bye"] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
_a);
var _a;
@@ -7,8 +7,8 @@ function foo() {
//// [computedPropertyNames18_ES5.js]
function foo() {
var obj = (_a = {}, _a[this.bar] =
0,
var obj = (_a = {},
_a[this.bar] = 0,
_a);
var _a;
}
@@ -8,8 +8,8 @@ module M {
//// [computedPropertyNames19_ES5.js]
var M;
(function (M) {
var obj = (_a = {}, _a[this.bar] =
0,
var obj = (_a = {},
_a[this.bar] = 0,
_a);
var _a;
})(M || (M = {}));
@@ -5,6 +5,8 @@ var v = {
}
//// [computedPropertyNames1_ES5.js]
var v = (_a = {}, _a[0 + 1] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[0 + 1] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }),
var v = (_a = {},
_a[0 + 1] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
_a[0 + 1] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }),
_a);
var _a;
@@ -4,7 +4,7 @@ var obj = {
}
//// [computedPropertyNames20_ES5.js]
var obj = (_a = {}, _a[this.bar] =
0,
var obj = (_a = {},
_a[this.bar] = 0,
_a);
var _a;
@@ -13,7 +13,8 @@ var C = (function () {
function C() {
}
C.prototype.bar = function () {
var obj = (_a = {}, _a[this.bar()] = function () { },
var obj = (_a = {},
_a[this.bar()] = function () { },
_a);
return 0;
var _a;
@@ -15,8 +15,8 @@ var C = (function () {
C.prototype.bar = function () {
return 0;
};
C.prototype[(_a = {}, _a[this.bar()] =
1,
C.prototype[(_a = {},
_a[this.bar()] = 1,
_a)[0]] = function () { };
return C;
})();
@@ -34,7 +34,8 @@ var C = (function (_super) {
_super.apply(this, arguments);
}
C.prototype.foo = function () {
var obj = (_a = {}, _a[_super.prototype.bar.call(this)] = function () { },
var obj = (_a = {},
_a[_super.prototype.bar.call(this)] = function () { },
_a);
return 0;
var _a;
@@ -34,8 +34,8 @@ var C = (function (_super) {
}
// Gets emitted as super, not _super, which is consistent with
// use of super in static properties initializers.
C.prototype[(_a = {}, _a[super.bar.call(this)] =
1,
C.prototype[(_a = {},
_a[super.bar.call(this)] = 1,
_a)[0]] = function () { };
return C;
})(Base);
@@ -26,7 +26,8 @@ var C = (function (_super) {
__extends(C, _super);
function C() {
_super.call(this);
var obj = (_a = {}, _a[(_super.call(this), "prop")] = function () { },
var obj = (_a = {},
_a[(_super.call(this), "prop")] = function () { },
_a);
var _a;
}
@@ -17,7 +17,8 @@ var C = (function () {
C.prototype.bar = function () {
var _this = this;
(function () {
var obj = (_a = {}, _a[_this.bar()] = function () { },
var obj = (_a = {},
_a[_this.bar()] = function () { },
_a);
var _a;
});
@@ -32,7 +32,8 @@ var C = (function (_super) {
function C() {
_super.call(this);
(function () {
var obj = (_a = {}, _a[(_super.call(this), "prop")] = function () { },
var obj = (_a = {},
_a[(_super.call(this), "prop")] = function () { },
_a);
var _a;
});
@@ -38,7 +38,8 @@ var C = (function (_super) {
C.prototype.foo = function () {
var _this = this;
(function () {
var obj = (_a = {}, _a[_super.prototype.bar.call(_this)] = function () { },
var obj = (_a = {},
_a[_super.prototype.bar.call(_this)] = function () { },
_a);
var _a;
});
@@ -15,7 +15,8 @@ var C = (function () {
function C() {
}
C.prototype.bar = function () {
var obj = (_a = {}, _a[foo()] = function () { },
var obj = (_a = {},
_a[foo()] = function () { },
_a);
return 0;
var _a;
@@ -15,7 +15,8 @@ var C = (function () {
function C() {
}
C.bar = function () {
var obj = (_a = {}, _a[foo()] = function () { },
var obj = (_a = {},
_a[foo()] = function () { },
_a);
return 0;
var _a;
@@ -4,7 +4,7 @@ var o = {
};
//// [computedPropertyNames46_ES5.js]
var o = (_a = {}, _a["" || 0] =
0,
var o = (_a = {},
_a["" || 0] = 0,
_a);
var _a;
@@ -14,7 +14,7 @@ var E2;
(function (E2) {
E2[E2["x"] = 0] = "x";
})(E2 || (E2 = {}));
var o = (_a = {}, _a[0 /* x */ || 0 /* x */] =
0,
var o = (_a = {},
_a[0 /* x */ || 0 /* x */] = 0,
_a);
var _a;
@@ -23,13 +23,13 @@ var E;
E[E["x"] = 0] = "x";
})(E || (E = {}));
var a;
extractIndexer((_a = {}, _a[a] =
"",
extractIndexer((_a = {},
_a[a] = "",
_a)); // Should return string
extractIndexer((_b = {}, _b[0 /* x */] =
"",
extractIndexer((_b = {},
_b[0 /* x */] = "",
_b)); // Should return string
extractIndexer((_c = {}, _c["" || 0] =
"",
extractIndexer((_c = {},
_c["" || 0] = "",
_c)); // Should return any (widened form of undefined)
var _a, _b, _c;
@@ -28,19 +28,23 @@ var x = {
//// [computedPropertyNames49_ES5.js]
var x = (_a = {
p1: 10
}, _a.p1 =
10, _a[1 + 1] = Object.defineProperty({ get: function () {
throw 10;
}, enumerable: true, configurable: true }), _a[1 + 1] = Object.defineProperty({ get: function () {
return 10;
}, enumerable: true, configurable: true }), _a[1 + 1] = Object.defineProperty({ set: function () {
// just throw
throw 10;
}, enumerable: true, configurable: true }), _a.foo = Object.defineProperty({ get: function () {
if (1 == 1) {
},
_a.p1 = 10,
_a[1 + 1] = Object.defineProperty({ get: function () {
throw 10;
}, enumerable: true, configurable: true }),
_a[1 + 1] = Object.defineProperty({ get: function () {
return 10;
}
}, enumerable: true, configurable: true }), _a.p2 =
20,
}, enumerable: true, configurable: true }),
_a[1 + 1] = Object.defineProperty({ set: function () {
// just throw
throw 10;
}, enumerable: true, configurable: true }),
_a.foo = Object.defineProperty({ get: function () {
if (1 == 1) {
return 10;
}
}, enumerable: true, configurable: true }),
_a.p2 = 20,
_a);
var _a;
@@ -20,17 +20,17 @@ var v = {
var s;
var n;
var a;
var v = (_a = {}, _a[s] =
0, _a[n] =
n, _a[s + s] =
1, _a[s + n] =
2, _a[+s] =
s, _a[""] =
0, _a[0] =
0, _a[a] =
1, _a[true] =
0, _a["hello bye"] =
0, _a["hello " + a + " bye"] =
0,
var v = (_a = {},
_a[s] = 0,
_a[n] = n,
_a[s + s] = 1,
_a[s + n] = 2,
_a[+s] = s,
_a[""] = 0,
_a[0] = 0,
_a[a] = 1,
_a[true] = 0,
_a["hello bye"] = 0,
_a["hello " + a + " bye"] = 0,
_a);
var _a;
@@ -33,19 +33,23 @@ var x = (_a = {
return 10;
}
}
}, _a.p1 =
10, _a.foo = Object.defineProperty({ get: function () {
if (1 == 1) {
},
_a.p1 = 10,
_a.foo = Object.defineProperty({ get: function () {
if (1 == 1) {
return 10;
}
}, enumerable: true, configurable: true }),
_a[1 + 1] = Object.defineProperty({ get: function () {
throw 10;
}, enumerable: true, configurable: true }),
_a[1 + 1] = Object.defineProperty({ set: function () {
// just throw
throw 10;
}, enumerable: true, configurable: true }),
_a[1 + 1] = Object.defineProperty({ get: function () {
return 10;
}
}, enumerable: true, configurable: true }), _a[1 + 1] = Object.defineProperty({ get: function () {
throw 10;
}, enumerable: true, configurable: true }), _a[1 + 1] = Object.defineProperty({ set: function () {
// just throw
throw 10;
}, enumerable: true, configurable: true }), _a[1 + 1] = Object.defineProperty({ get: function () {
return 10;
}, enumerable: true, configurable: true }), _a.p2 =
20,
}, enumerable: true, configurable: true }),
_a.p2 = 20,
_a);
var _a;
@@ -11,12 +11,12 @@ var v = {
//// [computedPropertyNames5_ES5.js]
var b;
var v = (_a = {}, _a[b] =
0, _a[true] =
1, _a[[]] =
0, _a[{}] =
0, _a[undefined] =
undefined, _a[null] =
null,
var v = (_a = {},
_a[b] = 0,
_a[true] = 1,
_a[[]] = 0,
_a[{}] = 0,
_a[undefined] = undefined,
_a[null] = null,
_a);
var _a;
@@ -12,9 +12,9 @@ var v = {
var p1;
var p2;
var p3;
var v = (_a = {}, _a[p1] =
0, _a[p2] =
1, _a[p3] =
2,
var v = (_a = {},
_a[p1] = 0,
_a[p2] = 1,
_a[p3] = 2,
_a);
var _a;
@@ -11,7 +11,7 @@ var E;
(function (E) {
E[E["member"] = 0] = "member";
})(E || (E = {}));
var v = (_a = {}, _a[0 /* member */] =
0,
var v = (_a = {},
_a[0 /* member */] = 0,
_a);
var _a;
@@ -12,9 +12,9 @@ function f<T, U extends string>() {
function f() {
var t;
var u;
var v = (_a = {}, _a[t] =
0, _a[u] =
1,
var v = (_a = {},
_a[t] = 0,
_a[u] = 1,
_a);
var _a;
}
@@ -12,9 +12,9 @@ var v = {
//// [computedPropertyNames9_ES5.js]
function f(x) { }
var v = (_a = {}, _a[f("")] =
0, _a[f(0)] =
0, _a[f(true)] =
0,
var v = (_a = {},
_a[f("")] = 0,
_a[f(0)] = 0,
_a[f(true)] = 0,
_a);
var _a;
@@ -9,8 +9,8 @@ var o: I = {
}
//// [computedPropertyNamesContextualType10_ES5.js]
var o = (_a = {}, _a[+"foo"] =
"", _a[+"bar"] =
0,
var o = (_a = {},
_a[+"foo"] = "",
_a[+"bar"] = 0,
_a);
var _a;
@@ -10,7 +10,8 @@ var o: I = {
}
//// [computedPropertyNamesContextualType1_ES5.js]
var o = (_a = {}, _a["" + 0] = function (y) { return y.length; }, _a["" + 1] =
function (y) { return y.length; },
var o = (_a = {},
_a["" + 0] = function (y) { return y.length; },
_a["" + 1] = function (y) { return y.length; },
_a);
var _a;
@@ -10,7 +10,8 @@ var o: I = {
}
//// [computedPropertyNamesContextualType2_ES5.js]
var o = (_a = {}, _a[+"foo"] = function (y) { return y.length; }, _a[+"bar"] =
function (y) { return y.length; },
var o = (_a = {},
_a[+"foo"] = function (y) { return y.length; },
_a[+"bar"] = function (y) { return y.length; },
_a);
var _a;
@@ -9,7 +9,8 @@ var o: I = {
}
//// [computedPropertyNamesContextualType3_ES5.js]
var o = (_a = {}, _a[+"foo"] = function (y) { return y.length; }, _a[+"bar"] =
function (y) { return y.length; },
var o = (_a = {},
_a[+"foo"] = function (y) { return y.length; },
_a[+"bar"] = function (y) { return y.length; },
_a);
var _a;
@@ -10,8 +10,8 @@ var o: I = {
}
//// [computedPropertyNamesContextualType4_ES5.js]
var o = (_a = {}, _a["" + "foo"] =
"", _a["" + "bar"] =
0,
var o = (_a = {},
_a["" + "foo"] = "",
_a["" + "bar"] = 0,
_a);
var _a;
@@ -10,8 +10,8 @@ var o: I = {
}
//// [computedPropertyNamesContextualType5_ES5.js]
var o = (_a = {}, _a[+"foo"] =
"", _a[+"bar"] =
0,
var o = (_a = {},
_a[+"foo"] = "",
_a[+"bar"] = 0,
_a);
var _a;
@@ -17,11 +17,11 @@ foo({
foo((_a = {
p: "",
0: function () { }
}, _a.p =
"", _a[0] =
function () { }, _a["hi" + "bye"] =
true, _a[0 + 1] =
0, _a[+"hi"] =
[0],
},
_a.p = "",
_a[0] = function () { },
_a["hi" + "bye"] = true,
_a[0 + 1] = 0,
_a[+"hi"] = [0],
_a));
var _a;
@@ -17,11 +17,11 @@ foo({
foo((_a = {
p: "",
0: function () { }
}, _a.p =
"", _a[0] =
function () { }, _a["hi" + "bye"] =
true, _a[0 + 1] =
0, _a[+"hi"] =
[0],
},
_a.p = "",
_a[0] = function () { },
_a["hi" + "bye"] = true,
_a[0 + 1] = 0,
_a[+"hi"] = [0],
_a));
var _a;
@@ -10,8 +10,8 @@ var o: I = {
}
//// [computedPropertyNamesContextualType8_ES5.js]
var o = (_a = {}, _a["" + "foo"] =
"", _a["" + "bar"] =
0,
var o = (_a = {},
_a["" + "foo"] = "",
_a["" + "bar"] = 0,
_a);
var _a;
@@ -10,8 +10,8 @@ var o: I = {
}
//// [computedPropertyNamesContextualType9_ES5.js]
var o = (_a = {}, _a[+"foo"] =
"", _a[+"bar"] =
0,
var o = (_a = {},
_a[+"foo"] = "",
_a[+"bar"] = 0,
_a);
var _a;
@@ -7,8 +7,11 @@ var v = {
}
//// [computedPropertyNamesDeclarationEmit5_ES5.js]
var v = (_a = {}, _a["" + ""] =
0, _a["" + ""] = function () { }, _a["" + ""] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a["" + ""] = Object.defineProperty({ set: function (x) { }, enumerable: true, configurable: true }),
var v = (_a = {},
_a["" + ""] = 0,
_a["" + ""] = function () { },
_a["" + ""] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
_a["" + ""] = Object.defineProperty({ set: function (x) { }, enumerable: true, configurable: true }),
_a);
var _a;
@@ -6,9 +6,10 @@ var v = {
}
//// [computedPropertyNamesSourceMap2_ES5.js]
var v = (_a = {}, _a["hello"] = function () {
debugger;
},
var v = (_a = {},
_a["hello"] = function () {
debugger;
},
_a);
var _a;
//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map
@@ -1,2 +1,2 @@
//// [computedPropertyNamesSourceMap2_ES5.js.map]
{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,AADA,CACA,EAAA,GADA,EAAA,EACA,EAAA,CACK,OAAO,CAFA,GAAA;IAGA,QAAQ,CAAC;AACb,CAAC,AAJA;IACA,EAAA,AADA,CAKA,CAAA;IAJD,EAAA"}
{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,AADA,CACA,EAAA,GADA,EAAA;IACA,EAAA,CACK,OAAO,CAFA,GAAA;QAGA,QAAQ,CAAC;IACb,CAAC,AAJA;IAAA,EAAA,CAKA,CAAA;IAJD,EAAA"}
@@ -8,7 +8,7 @@ sources: computedPropertyNamesSourceMap2_ES5.ts
emittedFile:tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES5.js
sourceFile:computedPropertyNamesSourceMap2_ES5.ts
-------------------------------------------------------------------
>>>var v = (_a = {}, _a["hello"] = function () {
>>>var v = (_a = {},
1 >
2 >^^^^
3 > ^
@@ -18,12 +18,7 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts
7 > ^^
8 > ^^^
9 > ^^
10> ^^
11> ^^
12> ^
13> ^^^^^^^
14> ^
15> ^^^
10> ^^^^^^^^^^^^^^^^->
1 >
2 >var
3 > v
@@ -43,25 +38,6 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts
9 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found
9 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 15) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 17) Source(0, NaN) + SourceIndex(0) nameIndex (-1)
9 >
10> !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column
10> !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 15) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 19) Source(1, 1) + SourceIndex(0) nameIndex (-1)
10>
11> !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found
11> !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 17) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 21) Source(1, 1) + SourceIndex(0) nameIndex (-1)
11>
12> !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column
12> !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 17) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 22) Source(2, 6) + SourceIndex(0) nameIndex (-1)
12> var v = {
> [
13> !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
13> !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 19) Source(1, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 29) Source(2, 13) + SourceIndex(0) nameIndex (-1)
13> "hello"
14> !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
14> !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 21) Source(1, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 30) Source(0, NaN) + SourceIndex(0) nameIndex (-1)
14>
15> !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
15> !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 22) Source(2, 14) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 33) Source(0, NaN) + SourceIndex(0) nameIndex (-1)
15>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0)
3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0)
@@ -71,89 +47,111 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts
7 >Emitted(1, 12) Source(1, 1) + SourceIndex(0)
8 >Emitted(1, 15) Source(0, NaN) + SourceIndex(0)
9 >Emitted(1, 17) Source(0, NaN) + SourceIndex(0)
10>Emitted(1, 19) Source(1, 1) + SourceIndex(0)
11>Emitted(1, 21) Source(1, 1) + SourceIndex(0)
12>Emitted(1, 22) Source(2, 6) + SourceIndex(0)
13>Emitted(1, 29) Source(2, 13) + SourceIndex(0)
14>Emitted(1, 30) Source(0, NaN) + SourceIndex(0)
15>Emitted(1, 33) Source(0, NaN) + SourceIndex(0)
---
>>> debugger;
1 >^^^^
2 > ^^^^^^^^
3 > ^
1 >!!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 29) Source(2, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 5) Source(3, 9) + SourceIndex(0) nameIndex (-1)
1 >
>>> _a["hello"] = function () {
1->^^^^
2 > ^^
3 > ^
4 > ^^^^^^^
5 > ^
6 > ^^^
1->!!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column
1->!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 15) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 5) Source(1, 1) + SourceIndex(0) nameIndex (-1)
1->
2 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found
2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 30) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 13) Source(3, 17) + SourceIndex(0) nameIndex (-1)
2 > debugger
3 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column
3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 30) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 14) Source(3, 18) + SourceIndex(0) nameIndex (-1)
3 > ;
1 >Emitted(2, 5) Source(3, 9) + SourceIndex(0)
2 >Emitted(2, 13) Source(3, 17) + SourceIndex(0)
3 >Emitted(2, 14) Source(3, 18) + SourceIndex(0)
2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 17) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 7) Source(1, 1) + SourceIndex(0) nameIndex (-1)
2 >
3 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column
3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 17) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 8) Source(2, 6) + SourceIndex(0) nameIndex (-1)
3 > var v = {
> [
4 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
4 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 5) Source(1, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 15) Source(2, 13) + SourceIndex(0) nameIndex (-1)
4 > "hello"
5 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
5 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 7) Source(1, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 16) Source(0, NaN) + SourceIndex(0) nameIndex (-1)
5 >
6 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
6 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 8) Source(2, 14) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 19) Source(0, NaN) + SourceIndex(0) nameIndex (-1)
6 >
1->Emitted(2, 5) Source(1, 1) + SourceIndex(0)
2 >Emitted(2, 7) Source(1, 1) + SourceIndex(0)
3 >Emitted(2, 8) Source(2, 6) + SourceIndex(0)
4 >Emitted(2, 15) Source(2, 13) + SourceIndex(0)
5 >Emitted(2, 16) Source(0, NaN) + SourceIndex(0)
6 >Emitted(2, 19) Source(0, NaN) + SourceIndex(0)
---
>>>},
>>> debugger;
1 >^^^^^^^^
2 > ^^^^^^^^
3 > ^
1 >!!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 15) Source(2, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 9) Source(3, 9) + SourceIndex(0) nameIndex (-1)
1 >
2 >^
3 >
4 > ^^^^^^^^->
2 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found
2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 16) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 17) Source(3, 17) + SourceIndex(0) nameIndex (-1)
2 > debugger
3 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column
3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 16) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 18) Source(3, 18) + SourceIndex(0) nameIndex (-1)
3 > ;
1 >Emitted(3, 9) Source(3, 9) + SourceIndex(0)
2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0)
3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0)
---
>>> },
1 >^^^^
2 > ^
3 >
4 > ^^^^->
1 >!!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found
1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 33) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 1) Source(4, 5) + SourceIndex(0) nameIndex (-1)
1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 19) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 5) Source(4, 5) + SourceIndex(0) nameIndex (-1)
1 >
>
2 >!!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column
2 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 33) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 2) Source(4, 6) + SourceIndex(0) nameIndex (-1)
2 >}
3 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 5) Source(3, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 2) Source(0, NaN) + SourceIndex(0) nameIndex (-1)
3 >
1 >Emitted(3, 1) Source(4, 5) + SourceIndex(0)
2 >Emitted(3, 2) Source(4, 6) + SourceIndex(0)
3 >Emitted(3, 2) Source(0, NaN) + SourceIndex(0)
2 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column
2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 19) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 6) Source(4, 6) + SourceIndex(0) nameIndex (-1)
2 > }
3 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 9) Source(3, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 6) Source(0, NaN) + SourceIndex(0) nameIndex (-1)
3 >
1 >Emitted(4, 5) Source(4, 5) + SourceIndex(0)
2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0)
3 >Emitted(4, 6) Source(0, NaN) + SourceIndex(0)
---
>>> _a);
1->^^^^
2 > ^^
3 >
4 > ^
5 > ^
3 > ^
4 > ^
1->!!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
1->!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 13) Source(3, 29) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 5) Source(1, 1) + SourceIndex(0) nameIndex (-1)
1->!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 17) Source(3, 29) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 5) Source(0, NaN) + SourceIndex(0) nameIndex (-1)
1->
2 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 14) Source(3, 30) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 7) Source(1, 1) + SourceIndex(0) nameIndex (-1)
2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 18) Source(3, 30) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 7) Source(0, NaN) + SourceIndex(0) nameIndex (-1)
2 >
3 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 1) Source(4, 17) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 7) Source(0, NaN) + SourceIndex(0) nameIndex (-1)
3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(4, 5) Source(4, 17) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 8) Source(5, 2) + SourceIndex(0) nameIndex (-1)
3 >
4 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
4 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 2) Source(4, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 8) Source(5, 2) + SourceIndex(0) nameIndex (-1)
4 >
5 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found
5 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 2) Source(0, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 9) Source(5, 2) + SourceIndex(0) nameIndex (-1)
5 >
1->Emitted(4, 5) Source(1, 1) + SourceIndex(0)
2 >Emitted(4, 7) Source(1, 1) + SourceIndex(0)
3 >Emitted(4, 7) Source(0, NaN) + SourceIndex(0)
4 >Emitted(4, 8) Source(5, 2) + SourceIndex(0)
5 >Emitted(4, 9) Source(5, 2) + SourceIndex(0)
4 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
4 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(4, 6) Source(4, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 9) Source(5, 2) + SourceIndex(0) nameIndex (-1)
4 >
1->Emitted(5, 5) Source(0, NaN) + SourceIndex(0)
2 >Emitted(5, 7) Source(0, NaN) + SourceIndex(0)
3 >Emitted(5, 8) Source(5, 2) + SourceIndex(0)
4 >Emitted(5, 9) Source(5, 2) + SourceIndex(0)
---
>>>var _a;
1 >^^^^
2 > ^^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >!!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column
1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 2) Source(0, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 5) Source(1, 1) + SourceIndex(0) nameIndex (-1)
1 >!!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found
1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(4, 6) Source(0, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(6, 5) Source(1, 1) + SourceIndex(0) nameIndex (-1)
1 >
2 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(4, 5) Source(1, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 7) Source(1, 1) + SourceIndex(0) nameIndex (-1)
2 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column
2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(4, 6) Source(0, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(6, 7) Source(1, 1) + SourceIndex(0) nameIndex (-1)
2 >
1 >Emitted(5, 5) Source(1, 1) + SourceIndex(0)
2 >Emitted(5, 7) Source(1, 1) + SourceIndex(0)
1 >Emitted(6, 5) Source(1, 1) + SourceIndex(0)
2 >Emitted(6, 7) Source(1, 1) + SourceIndex(0)
---
!!!! **** There are more source map entries in the sourceMap's mapping than what was encoded
!!!! **** Remaining decoded string: ,EAAA,AADA,CAKA,CAAA;IAJD,EAAA
!!!! **** Remaining decoded string: ;IAAA,EAAA,CAKA,CAAA;IAJD,EAAA
>>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map
@@ -1,6 +1,6 @@
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(8,21): error TS1013: Catch clause parameter cannot have a type annotation.
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(9,21): error TS1013: Catch clause parameter cannot have a type annotation.
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(10,21): error TS1013: Catch clause parameter cannot have a type annotation.
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(8,23): error TS1196: Catch clause variable cannot have a type annotation.
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(9,23): error TS1196: Catch clause variable cannot have a type annotation.
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(10,23): error TS1196: Catch clause variable cannot have a type annotation.
==== tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts (3 errors) ====
@@ -12,14 +12,14 @@ tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(10,21):
// no type annotation allowed
try { } catch (z: any) { }
~
!!! error TS1013: Catch clause parameter cannot have a type annotation.
~~~
!!! error TS1196: Catch clause variable cannot have a type annotation.
try { } catch (a: number) { }
~
!!! error TS1013: Catch clause parameter cannot have a type annotation.
~~~~~~
!!! error TS1196: Catch clause variable cannot have a type annotation.
try { } catch (y: string) { }
~
!!! error TS1013: Catch clause parameter cannot have a type annotation.
~~~~~~
!!! error TS1196: Catch clause variable cannot have a type annotation.
}
@@ -1,10 +1,10 @@
tests/cases/conformance/parser/ecmascript5/CatchClauses/parserCatchClauseWithTypeAnnotation1.ts(2,11): error TS1013: Catch clause parameter cannot have a type annotation.
tests/cases/conformance/parser/ecmascript5/CatchClauses/parserCatchClauseWithTypeAnnotation1.ts(2,13): error TS1196: Catch clause variable cannot have a type annotation.
==== tests/cases/conformance/parser/ecmascript5/CatchClauses/parserCatchClauseWithTypeAnnotation1.ts (1 errors) ====
try {
} catch (e: Error) {
~
!!! error TS1013: Catch clause parameter cannot have a type annotation.
~~~~~
!!! error TS1196: Catch clause variable cannot have a type annotation.
}
@@ -2,7 +2,7 @@
var v = { [e]: 1 };
//// [parserES5ComputedPropertyName2.js]
var v = (_a = {}, _a[e] =
1,
var v = (_a = {},
_a[e] = 1,
_a);
var _a;
@@ -2,6 +2,7 @@
var v = { [e]() { } };
//// [parserES5ComputedPropertyName3.js]
var v = (_a = {}, _a[e] = function () { },
var v = (_a = {},
_a[e] = function () { },
_a);
var _a;
@@ -2,6 +2,7 @@
var v = { get [e]() { } };
//// [parserES5ComputedPropertyName4.js]
var v = (_a = {}, _a[e] = Object.defineProperty({ get: function () { }, enumerable: true, configurable: true }),
var v = (_a = {},
_a[e] = Object.defineProperty({ get: function () { }, enumerable: true, configurable: true }),
_a);
var _a;
+3 -3
View File
@@ -11,9 +11,9 @@ var y: {
//// [privateIndexer2.js]
// private indexers not allowed
var x = (_a = {}, _a[x] =
string, _a.string =
,
var x = (_a = {},
_a[x] = string,
_a.string = ,
_a);
var y;
var _a;
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings07_ES5.ts(4,19): error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings07_ES5.ts(4,19): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
==== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings07_ES5.ts (1 errors) ====
@@ -7,5 +7,5 @@ tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrin
// 1. Assert: 0 ≤ cp ≤ 0x10FFFF.
var x = "\u{110000}";
!!! error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings07_ES6.ts(4,19): error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings07_ES6.ts(4,19): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
==== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings07_ES6.ts (1 errors) ====
@@ -7,5 +7,5 @@ tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrin
// 1. Assert: 0 ≤ cp ≤ 0x10FFFF.
var x = "\u{110000}";
!!! error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings12_ES5.ts(2,21): error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings12_ES5.ts(2,21): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
==== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings12_ES5.ts (1 errors) ====
var x = "\u{FFFFFFFF}";
!!! error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings12_ES6.ts(2,21): error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings12_ES6.ts(2,21): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
==== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings12_ES6.ts (1 errors) ====
var x = "\u{FFFFFFFF}";
!!! error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings21_ES5.ts(2,15): error TS1196: '}' expected.
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings21_ES5.ts(2,15): error TS1199: '}' expected.
==== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings21_ES5.ts (1 errors) ====
var x = "\u{67";
!!! error TS1196: '}' expected.
!!! error TS1199: '}' expected.
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings21_ES6.ts(2,15): error TS1196: '}' expected.
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings21_ES6.ts(2,15): error TS1199: '}' expected.
==== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings21_ES6.ts (1 errors) ====
var x = "\u{67";
!!! error TS1196: '}' expected.
!!! error TS1199: '}' expected.
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings22_ES5.ts(2,27): error TS1196: '}' expected.
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings22_ES5.ts(2,27): error TS1199: '}' expected.
==== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings22_ES5.ts (1 errors) ====
var x = "\u{00000000000067";
!!! error TS1196: '}' expected.
!!! error TS1199: '}' expected.
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings22_ES6.ts(2,27): error TS1196: '}' expected.
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings22_ES6.ts(2,27): error TS1199: '}' expected.
==== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings22_ES6.ts (1 errors) ====
var x = "\u{00000000000067";
!!! error TS1196: '}' expected.
!!! error TS1199: '}' expected.
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings24_ES5.ts(2,27): error TS1196: '}' expected.
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings24_ES5.ts(2,27): error TS1199: '}' expected.
==== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings24_ES5.ts (1 errors) ====
var x = "\u{00000000000067
!!! error TS1196: '}' expected.
!!! error TS1199: '}' expected.
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings24_ES6.ts(2,27): error TS1196: '}' expected.
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings24_ES6.ts(2,27): error TS1199: '}' expected.
==== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings24_ES6.ts (1 errors) ====
var x = "\u{00000000000067
!!! error TS1196: '}' expected.
!!! error TS1199: '}' expected.
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates07_ES5.ts(4,19): error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates07_ES5.ts(4,19): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
==== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates07_ES5.ts (1 errors) ====
@@ -7,5 +7,5 @@ tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTempl
// 1. Assert: 0 ≤ cp ≤ 0x10FFFF.
var x = `\u{110000}`;
!!! error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates07_ES6.ts(4,19): error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates07_ES6.ts(4,19): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
==== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates07_ES6.ts (1 errors) ====
@@ -7,5 +7,5 @@ tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTempl
// 1. Assert: 0 ≤ cp ≤ 0x10FFFF.
var x = `\u{110000}`;
!!! error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates12_ES5.ts(2,21): error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates12_ES5.ts(2,21): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
==== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates12_ES5.ts (1 errors) ====
var x = `\u{FFFFFFFF}`;
!!! error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
@@ -1,9 +1,9 @@
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates12_ES6.ts(2,21): error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates12_ES6.ts(2,21): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
==== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates12_ES6.ts (1 errors) ====
var x = `\u{FFFFFFFF}`;
!!! error TS1195: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.
@@ -0,0 +1,4 @@
try {
}
catch ({a}) {
}
@@ -0,0 +1,4 @@
try {
}
catch (e = 1) {
}
@@ -6,4 +6,4 @@
goTo.marker();
verify.quickInfoExists();
verify.quickInfoIs("(var) e: any");
verify.quickInfoIs("(local var) e: any");