Merge pull request #2124 from Microsoft/unrewrite
Revert ES3/ES5 downlevel computed property emit logic to not use tree rewriting
This commit is contained in:
commit
927231bdcf
50 changed files with 419 additions and 327 deletions
|
@ -1381,211 +1381,163 @@ var __param = this.__param || function(index, decorator) { return function (targ
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function emitDownlevelObjectLiteralWithComputedProperties(node: ObjectLiteralExpression, firstComputedPropertyIndex: number): void {
|
function emitObjectLiteralBody(node: ObjectLiteralExpression, numElements: number): void {
|
||||||
let parenthesizedObjectLiteral = createDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex);
|
if (numElements === 0) {
|
||||||
return emit(parenthesizedObjectLiteral);
|
write("{}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
write("{");
|
||||||
|
|
||||||
|
if (numElements > 0) {
|
||||||
|
var properties = node.properties;
|
||||||
|
|
||||||
|
// If we are not doing a downlevel transformation for object literals,
|
||||||
|
// then try to preserve the original shape of the object literal.
|
||||||
|
// Otherwise just try to preserve the formatting.
|
||||||
|
if (numElements === properties.length) {
|
||||||
|
emitLinePreservingList(node, properties, /* allowTrailingComma */ languageVersion >= ScriptTarget.ES5, /* spacesBetweenBraces */ true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let multiLine = (node.flags & NodeFlags.MultiLine) !== 0;
|
||||||
|
if (!multiLine) {
|
||||||
|
write(" ");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
increaseIndent();
|
||||||
|
}
|
||||||
|
|
||||||
|
emitList(properties, 0, numElements, /*multiLine*/ multiLine, /*trailingComma*/ false);
|
||||||
|
|
||||||
|
if (!multiLine) {
|
||||||
|
write(" ");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
decreaseIndent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
write("}");
|
||||||
}
|
}
|
||||||
|
|
||||||
function createDownlevelObjectLiteralWithComputedProperties(originalObjectLiteral: ObjectLiteralExpression, firstComputedPropertyIndex: number): ParenthesizedExpression {
|
function emitDownlevelObjectLiteralWithComputedProperties(node: ObjectLiteralExpression, firstComputedPropertyIndex: number) {
|
||||||
|
let multiLine = (node.flags & NodeFlags.MultiLine) !== 0;
|
||||||
|
let properties = node.properties;
|
||||||
|
|
||||||
|
write("(");
|
||||||
|
|
||||||
|
if (multiLine) {
|
||||||
|
increaseIndent();
|
||||||
|
}
|
||||||
|
|
||||||
// For computed properties, we need to create a unique handle to the object
|
// For computed properties, we need to create a unique handle to the object
|
||||||
// literal so we can modify it without risking internal assignments tainting the object.
|
// literal so we can modify it without risking internal assignments tainting the object.
|
||||||
let tempVar = createAndRecordTempVariable(TempFlags.Auto);
|
let tempVar = createAndRecordTempVariable(TempFlags.Auto);
|
||||||
|
|
||||||
// Hold onto the initial non-computed properties in a new object literal,
|
// Write out the first non-computed properties
|
||||||
// then create the rest through property accesses on the temp variable.
|
// (or all properties if none of them are computed),
|
||||||
let initialObjectLiteral = <ObjectLiteralExpression>createSynthesizedNode(SyntaxKind.ObjectLiteralExpression);
|
// then emit the rest through indexing on the temp variable.
|
||||||
initialObjectLiteral.properties = <NodeArray<ObjectLiteralElement>>originalObjectLiteral.properties.slice(0, firstComputedPropertyIndex);
|
emit(tempVar)
|
||||||
initialObjectLiteral.flags |= NodeFlags.MultiLine;
|
write(" = ");
|
||||||
|
emitObjectLiteralBody(node, firstComputedPropertyIndex);
|
||||||
|
|
||||||
// The comma expressions that will patch the object literal.
|
for (let i = firstComputedPropertyIndex, n = properties.length; i < n; i++) {
|
||||||
// This will end up being something like '_a = { ... }, _a.x = 10, _a.y = 20, _a'.
|
writeComma();
|
||||||
let propertyPatches = createBinaryExpression(tempVar, SyntaxKind.EqualsToken, initialObjectLiteral);
|
|
||||||
|
|
||||||
ts.forEach(originalObjectLiteral.properties, property => {
|
let property = properties[i];
|
||||||
let patchedProperty = tryCreatePatchingPropertyAssignment(originalObjectLiteral, tempVar, property);
|
|
||||||
if (patchedProperty) {
|
|
||||||
// TODO(drosen): Preserve comments
|
|
||||||
//let leadingComments = getLeadingCommentRanges(currentSourceFile.text, property.pos);
|
|
||||||
//let trailingComments = getTrailingCommentRanges(currentSourceFile.text, property.end);
|
|
||||||
//addCommentsToSynthesizedNode(patchedProperty, leadingComments, trailingComments);
|
|
||||||
|
|
||||||
propertyPatches = createBinaryExpression(propertyPatches, SyntaxKind.CommaToken, patchedProperty);
|
emitStart(property)
|
||||||
|
if (property.kind === SyntaxKind.GetAccessor || property.kind === SyntaxKind.SetAccessor) {
|
||||||
|
// TODO (drosen): Reconcile with 'emitMemberFunctions'.
|
||||||
|
let accessors = getAllAccessorDeclarations(node.properties, <AccessorDeclaration>property);
|
||||||
|
if (property !== accessors.firstAccessor) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
write("Object.defineProperty(");
|
||||||
|
emit(tempVar);
|
||||||
|
write(", ");
|
||||||
|
emitStart(node.name);
|
||||||
|
emitExpressionForPropertyName(property.name);
|
||||||
|
emitEnd(property.name);
|
||||||
|
write(", {");
|
||||||
|
increaseIndent();
|
||||||
|
if (accessors.getAccessor) {
|
||||||
|
writeLine()
|
||||||
|
emitLeadingComments(accessors.getAccessor);
|
||||||
|
write("get: ");
|
||||||
|
emitStart(accessors.getAccessor);
|
||||||
|
write("function ");
|
||||||
|
emitSignatureAndBody(accessors.getAccessor);
|
||||||
|
emitEnd(accessors.getAccessor);
|
||||||
|
emitTrailingComments(accessors.getAccessor);
|
||||||
|
write(",");
|
||||||
|
}
|
||||||
|
if (accessors.setAccessor) {
|
||||||
|
writeLine();
|
||||||
|
emitLeadingComments(accessors.setAccessor);
|
||||||
|
write("set: ");
|
||||||
|
emitStart(accessors.setAccessor);
|
||||||
|
write("function ");
|
||||||
|
emitSignatureAndBody(accessors.setAccessor);
|
||||||
|
emitEnd(accessors.setAccessor);
|
||||||
|
emitTrailingComments(accessors.setAccessor);
|
||||||
|
write(",");
|
||||||
|
}
|
||||||
|
writeLine();
|
||||||
|
write("enumerable: true,");
|
||||||
|
writeLine();
|
||||||
|
write("configurable: true");
|
||||||
|
decreaseIndent();
|
||||||
|
writeLine();
|
||||||
|
write("})");
|
||||||
|
emitEnd(property);
|
||||||
}
|
}
|
||||||
});
|
else {
|
||||||
|
emitLeadingComments(property);
|
||||||
|
emitStart(property.name);
|
||||||
|
emit(tempVar);
|
||||||
|
emitMemberAccessForPropertyName(property.name);
|
||||||
|
emitEnd(property.name);
|
||||||
|
|
||||||
// Finally, return the temp variable.
|
write(" = ");
|
||||||
propertyPatches = createBinaryExpression(propertyPatches, SyntaxKind.CommaToken, createIdentifier(tempVar.text, /*startsOnNewLine:*/ true));
|
|
||||||
|
|
||||||
let result = createParenthesizedExpression(propertyPatches);
|
if (property.kind === SyntaxKind.PropertyAssignment) {
|
||||||
|
emit((<PropertyAssignment>property).initializer);
|
||||||
// TODO(drosen): Preserve comments
|
|
||||||
// let leadingComments = getLeadingCommentRanges(currentSourceFile.text, originalObjectLiteral.pos);
|
|
||||||
// let trailingComments = getTrailingCommentRanges(currentSourceFile.text, originalObjectLiteral.end);
|
|
||||||
//addCommentsToSynthesizedNode(result, leadingComments, trailingComments);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function addCommentsToSynthesizedNode(node: SynthesizedNode, leadingCommentRanges: CommentRange[], trailingCommentRanges: CommentRange[]): void {
|
|
||||||
node.leadingCommentRanges = leadingCommentRanges;
|
|
||||||
node.trailingCommentRanges = trailingCommentRanges;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns 'undefined' if a property has already been accounted for
|
|
||||||
// (e.g. a 'get' accessor which has already been emitted along with its 'set' accessor).
|
|
||||||
function tryCreatePatchingPropertyAssignment(objectLiteral: ObjectLiteralExpression, tempVar: Identifier, property: ObjectLiteralElement): Expression {
|
|
||||||
let leftHandSide = createMemberAccessForPropertyName(tempVar, property.name);
|
|
||||||
let maybeRightHandSide = tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property);
|
|
||||||
|
|
||||||
return maybeRightHandSide && createBinaryExpression(leftHandSide, SyntaxKind.EqualsToken, maybeRightHandSide, /*startsOnNewLine:*/ true);
|
|
||||||
}
|
|
||||||
|
|
||||||
function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral: ObjectLiteralExpression, property: ObjectLiteralElement) {
|
|
||||||
switch (property.kind) {
|
|
||||||
case SyntaxKind.PropertyAssignment:
|
|
||||||
return (<PropertyAssignment>property).initializer;
|
|
||||||
|
|
||||||
case SyntaxKind.ShorthandPropertyAssignment:
|
|
||||||
// TODO: (andersh) Technically it isn't correct to make an identifier here since getExpressionNamePrefix returns
|
|
||||||
// a string containing a dotted name. In general I'm not a fan of mini tree rewriters as this one, elsewhere we
|
|
||||||
// manage by just emitting strings (which is a lot more performant).
|
|
||||||
//let prefix = createIdentifier(resolver.getExpressionNamePrefix((<ShorthandPropertyAssignment>property).name));
|
|
||||||
//return createPropertyAccessExpression(prefix, (<ShorthandPropertyAssignment>property).name);
|
|
||||||
return createIdentifier(resolver.getExpressionNameSubstitution((<ShorthandPropertyAssignment>property).name, getGeneratedNameForNode));
|
|
||||||
|
|
||||||
case SyntaxKind.MethodDeclaration:
|
|
||||||
return createFunctionExpression((<MethodDeclaration>property).parameters, (<MethodDeclaration>property).body);
|
|
||||||
|
|
||||||
case SyntaxKind.GetAccessor:
|
|
||||||
case SyntaxKind.SetAccessor:
|
|
||||||
let { firstAccessor, getAccessor, setAccessor } = getAllAccessorDeclarations(objectLiteral.properties, <AccessorDeclaration>property);
|
|
||||||
|
|
||||||
// Only emit the first accessor.
|
|
||||||
if (firstAccessor !== property) {
|
|
||||||
return undefined;
|
|
||||||
}
|
}
|
||||||
|
else if (property.kind === SyntaxKind.ShorthandPropertyAssignment) {
|
||||||
let propertyDescriptor = <ObjectLiteralExpression>createSynthesizedNode(SyntaxKind.ObjectLiteralExpression);
|
emitExpressionIdentifier((<ShorthandPropertyAssignment>property).name);
|
||||||
|
|
||||||
let descriptorProperties = <NodeArray<ObjectLiteralElement>>[];
|
|
||||||
if (getAccessor) {
|
|
||||||
let getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body));
|
|
||||||
descriptorProperties.push(getProperty);
|
|
||||||
}
|
}
|
||||||
if (setAccessor) {
|
else if (property.kind === SyntaxKind.MethodDeclaration) {
|
||||||
let setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body));
|
emitFunctionDeclaration(<MethodDeclaration>property);
|
||||||
descriptorProperties.push(setProperty);
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
Debug.fail("ObjectLiteralElement type not accounted for: " + property.kind);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let trueExpr = <PrimaryExpression>createSynthesizedNode(SyntaxKind.TrueKeyword);
|
emitEnd(property);
|
||||||
|
|
||||||
let enumerableTrue = createPropertyAssignment(createIdentifier("enumerable"), trueExpr);
|
|
||||||
descriptorProperties.push(enumerableTrue);
|
|
||||||
|
|
||||||
let configurableTrue = createPropertyAssignment(createIdentifier("configurable"), trueExpr);
|
|
||||||
descriptorProperties.push(configurableTrue);
|
|
||||||
|
|
||||||
propertyDescriptor.properties = descriptorProperties;
|
|
||||||
|
|
||||||
let objectDotDefineProperty = createPropertyAccessExpression(createIdentifier("Object"), createIdentifier("defineProperty"));
|
|
||||||
return createCallExpression(objectDotDefineProperty, createNodeArray(propertyDescriptor));
|
|
||||||
|
|
||||||
default:
|
|
||||||
Debug.fail(`ObjectLiteralElement kind ${property.kind} not accounted for.`);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function createParenthesizedExpression(expression: Expression) {
|
writeComma();
|
||||||
let result = <ParenthesizedExpression>createSynthesizedNode(SyntaxKind.ParenthesizedExpression);
|
emit(tempVar);
|
||||||
result.expression = expression;
|
|
||||||
|
|
||||||
return result;
|
if (multiLine) {
|
||||||
}
|
decreaseIndent();
|
||||||
|
writeLine();
|
||||||
function createNodeArray<T extends Node>(...elements: T[]): NodeArray<T> {
|
|
||||||
let result = <NodeArray<T>>elements;
|
|
||||||
result.pos = -1;
|
|
||||||
result.end = -1;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function createBinaryExpression(left: Expression, operator: SyntaxKind, right: Expression, startsOnNewLine?: boolean): BinaryExpression {
|
|
||||||
let result = <BinaryExpression>createSynthesizedNode(SyntaxKind.BinaryExpression, startsOnNewLine);
|
|
||||||
result.operatorToken = createSynthesizedNode(operator);
|
|
||||||
result.left = left;
|
|
||||||
result.right = right;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function createExpressionStatement(expression: Expression): ExpressionStatement {
|
|
||||||
let result = <ExpressionStatement>createSynthesizedNode(SyntaxKind.ExpressionStatement);
|
|
||||||
result.expression = expression;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function createMemberAccessForPropertyName(expression: LeftHandSideExpression, memberName: DeclarationName): PropertyAccessExpression | ElementAccessExpression {
|
|
||||||
if (memberName.kind === SyntaxKind.Identifier) {
|
|
||||||
return createPropertyAccessExpression(expression, <Identifier>memberName);
|
|
||||||
}
|
}
|
||||||
else if (memberName.kind === SyntaxKind.StringLiteral || memberName.kind === SyntaxKind.NumericLiteral) {
|
|
||||||
return createElementAccessExpression(expression, <LiteralExpression>memberName);
|
write(")");
|
||||||
|
|
||||||
|
function writeComma() {
|
||||||
|
if (multiLine) {
|
||||||
|
write(",");
|
||||||
|
writeLine();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
write(", ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (memberName.kind === SyntaxKind.ComputedPropertyName) {
|
|
||||||
return createElementAccessExpression(expression, (<ComputedPropertyName>memberName).expression);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Debug.fail(`Kind '${memberName.kind}' not accounted for.`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function createPropertyAssignment(name: LiteralExpression | Identifier, initializer: Expression) {
|
|
||||||
let result = <PropertyAssignment>createSynthesizedNode(SyntaxKind.PropertyAssignment);
|
|
||||||
result.name = name;
|
|
||||||
result.initializer = initializer;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function createFunctionExpression(parameters: NodeArray<ParameterDeclaration>, body: Block): FunctionExpression {
|
|
||||||
let result = <FunctionExpression>createSynthesizedNode(SyntaxKind.FunctionExpression);
|
|
||||||
result.parameters = parameters;
|
|
||||||
result.body = body;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function createPropertyAccessExpression(expression: LeftHandSideExpression, name: Identifier): PropertyAccessExpression {
|
|
||||||
let result = <PropertyAccessExpression>createSynthesizedNode(SyntaxKind.PropertyAccessExpression);
|
|
||||||
result.expression = expression;
|
|
||||||
result.dotToken = createSynthesizedNode(SyntaxKind.DotToken);
|
|
||||||
result.name = name;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElementAccessExpression(expression: LeftHandSideExpression, argumentExpression: Expression): ElementAccessExpression {
|
|
||||||
let result = <ElementAccessExpression>createSynthesizedNode(SyntaxKind.ElementAccessExpression);
|
|
||||||
result.expression = expression;
|
|
||||||
result.argumentExpression = argumentExpression;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function createIdentifier(name: string, startsOnNewLine?: boolean) {
|
|
||||||
let result = <Identifier>createSynthesizedNode(SyntaxKind.Identifier, startsOnNewLine);
|
|
||||||
result.text = name;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function createCallExpression(invokedExpression: MemberExpression, arguments: NodeArray<Expression>) {
|
|
||||||
let result = <CallExpression>createSynthesizedNode(SyntaxKind.CallExpression);
|
|
||||||
result.expression = invokedExpression;
|
|
||||||
result.arguments = arguments;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function emitObjectLiteral(node: ObjectLiteralExpression): void {
|
function emitObjectLiteral(node: ObjectLiteralExpression): void {
|
||||||
|
@ -1613,13 +1565,33 @@ var __param = this.__param || function(index, decorator) { return function (targ
|
||||||
|
|
||||||
// Ordinary case: either the object has no computed properties
|
// Ordinary case: either the object has no computed properties
|
||||||
// or we're compiling with an ES6+ target.
|
// or we're compiling with an ES6+ target.
|
||||||
write("{");
|
emitObjectLiteralBody(node, properties.length);
|
||||||
|
}
|
||||||
|
|
||||||
if (properties.length) {
|
function createBinaryExpression(left: Expression, operator: SyntaxKind, right: Expression, startsOnNewLine?: boolean): BinaryExpression {
|
||||||
emitLinePreservingList(node, properties, /*allowTrailingComma:*/ languageVersion >= ScriptTarget.ES5, /*spacesBetweenBraces:*/ true)
|
let result = <BinaryExpression>createSynthesizedNode(SyntaxKind.BinaryExpression, startsOnNewLine);
|
||||||
}
|
result.operatorToken = createSynthesizedNode(operator);
|
||||||
|
result.left = left;
|
||||||
|
result.right = right;
|
||||||
|
|
||||||
write("}");
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createPropertyAccessExpression(expression: LeftHandSideExpression, name: Identifier): PropertyAccessExpression {
|
||||||
|
let result = <PropertyAccessExpression>createSynthesizedNode(SyntaxKind.PropertyAccessExpression);
|
||||||
|
result.expression = expression;
|
||||||
|
result.dotToken = createSynthesizedNode(SyntaxKind.DotToken);
|
||||||
|
result.name = name;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createElementAccessExpression(expression: LeftHandSideExpression, argumentExpression: Expression): ElementAccessExpression {
|
||||||
|
let result = <ElementAccessExpression>createSynthesizedNode(SyntaxKind.ElementAccessExpression);
|
||||||
|
result.expression = expression;
|
||||||
|
result.argumentExpression = argumentExpression;
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function emitComputedPropertyName(node: ComputedPropertyName) {
|
function emitComputedPropertyName(node: ComputedPropertyName) {
|
||||||
|
|
|
@ -14,6 +14,7 @@ obj[Symbol.foo];
|
||||||
var Symbol;
|
var Symbol;
|
||||||
var obj = (_a = {},
|
var obj = (_a = {},
|
||||||
_a[Symbol.foo] = 0,
|
_a[Symbol.foo] = 0,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
obj[Symbol.foo];
|
obj[Symbol.foo];
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -2,7 +2,5 @@
|
||||||
var v = { [yield]: foo }
|
var v = { [yield]: foo }
|
||||||
|
|
||||||
//// [FunctionDeclaration8_es6.js]
|
//// [FunctionDeclaration8_es6.js]
|
||||||
var v = (_a = {},
|
var v = (_a = {}, _a[yield] = foo, _a);
|
||||||
_a[yield] = foo,
|
|
||||||
_a);
|
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -5,8 +5,6 @@ function * foo() {
|
||||||
|
|
||||||
//// [FunctionDeclaration9_es6.js]
|
//// [FunctionDeclaration9_es6.js]
|
||||||
function foo() {
|
function foo() {
|
||||||
var v = (_a = {},
|
var v = (_a = {}, _a[] = foo, _a);
|
||||||
_a[] = foo,
|
|
||||||
_a);
|
|
||||||
var _a;
|
var _a;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,5 @@
|
||||||
var v = { *[foo()]() { } }
|
var v = { *[foo()]() { } }
|
||||||
|
|
||||||
//// [FunctionPropertyAssignments5_es6.js]
|
//// [FunctionPropertyAssignments5_es6.js]
|
||||||
var v = (_a = {},
|
var v = (_a = {}, _a[foo()] = function () { }, _a);
|
||||||
_a[foo()] = function () { },
|
|
||||||
_a);
|
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -32,5 +32,6 @@ var v = (_a = {},
|
||||||
_a[true] = function () { },
|
_a[true] = function () { },
|
||||||
_a["hello bye"] = function () { },
|
_a["hello bye"] = function () { },
|
||||||
_a["hello " + a + " bye"] = function () { },
|
_a["hello " + a + " bye"] = function () { },
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -21,16 +21,61 @@ var s;
|
||||||
var n;
|
var n;
|
||||||
var a;
|
var a;
|
||||||
var v = (_a = {},
|
var v = (_a = {},
|
||||||
_a[s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
|
Object.defineProperty(_a, s, {
|
||||||
_a[n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }),
|
get: function () { return 0; },
|
||||||
_a[s + s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
|
enumerable: true,
|
||||||
_a[s + n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: 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 }),
|
Object.defineProperty(_a, n, {
|
||||||
_a[0] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
|
set: function (v) { },
|
||||||
_a[a] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }),
|
enumerable: true,
|
||||||
_a[true] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: 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 }),
|
Object.defineProperty(_a, s + s, {
|
||||||
_a);
|
get: function () { return 0; },
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, s + n, {
|
||||||
|
set: function (v) { },
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, +s, {
|
||||||
|
get: function () { return 0; },
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, "", {
|
||||||
|
set: function (v) { },
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, 0, {
|
||||||
|
get: function () { return 0; },
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, a, {
|
||||||
|
set: function (v) { },
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, true, {
|
||||||
|
get: function () { return 0; },
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, "hello bye", {
|
||||||
|
set: function (v) { },
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, "hello " + a + " bye", {
|
||||||
|
get: function () { return 0; },
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -9,6 +9,7 @@ function foo() {
|
||||||
function foo() {
|
function foo() {
|
||||||
var obj = (_a = {},
|
var obj = (_a = {},
|
||||||
_a[this.bar] = 0,
|
_a[this.bar] = 0,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ var M;
|
||||||
(function (M) {
|
(function (M) {
|
||||||
var obj = (_a = {},
|
var obj = (_a = {},
|
||||||
_a[this.bar] = 0,
|
_a[this.bar] = 0,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
})(M || (M = {}));
|
})(M || (M = {}));
|
||||||
|
|
|
@ -6,7 +6,17 @@ var v = {
|
||||||
|
|
||||||
//// [computedPropertyNames1_ES5.js]
|
//// [computedPropertyNames1_ES5.js]
|
||||||
var v = (_a = {},
|
var v = (_a = {},
|
||||||
_a[0 + 1] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
|
Object.defineProperty(_a, 0 + 1, {
|
||||||
_a[0 + 1] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }),
|
get: function () { return 0; },
|
||||||
_a);
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, 0 + 1, {
|
||||||
|
set: function (v) { } //No error
|
||||||
|
,
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -6,5 +6,6 @@ var obj = {
|
||||||
//// [computedPropertyNames20_ES5.js]
|
//// [computedPropertyNames20_ES5.js]
|
||||||
var obj = (_a = {},
|
var obj = (_a = {},
|
||||||
_a[this.bar] = 0,
|
_a[this.bar] = 0,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -15,7 +15,8 @@ var C = (function () {
|
||||||
C.prototype.bar = function () {
|
C.prototype.bar = function () {
|
||||||
var obj = (_a = {},
|
var obj = (_a = {},
|
||||||
_a[this.bar()] = function () { },
|
_a[this.bar()] = function () { },
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
return 0;
|
return 0;
|
||||||
var _a;
|
var _a;
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,9 +15,7 @@ var C = (function () {
|
||||||
C.prototype.bar = function () {
|
C.prototype.bar = function () {
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
C.prototype[(_a = {},
|
C.prototype[(_a = {}, _a[this.bar()] = 1, _a)[0]] = function () { };
|
||||||
_a[this.bar()] = 1,
|
|
||||||
_a)[0]] = function () { };
|
|
||||||
return C;
|
return C;
|
||||||
var _a;
|
var _a;
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -36,7 +36,8 @@ var C = (function (_super) {
|
||||||
C.prototype.foo = function () {
|
C.prototype.foo = function () {
|
||||||
var obj = (_a = {},
|
var obj = (_a = {},
|
||||||
_a[_super.prototype.bar.call(this)] = function () { },
|
_a[_super.prototype.bar.call(this)] = function () { },
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
return 0;
|
return 0;
|
||||||
var _a;
|
var _a;
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,9 +30,7 @@ var C = (function (_super) {
|
||||||
function C() {
|
function C() {
|
||||||
_super.apply(this, arguments);
|
_super.apply(this, arguments);
|
||||||
}
|
}
|
||||||
C.prototype[(_a = {},
|
C.prototype[(_a = {}, _a[_super.bar.call(this)] = 1, _a)[0]] = function () { };
|
||||||
_a[_super.bar.call(this)] = 1,
|
|
||||||
_a)[0]] = function () { };
|
|
||||||
return C;
|
return C;
|
||||||
var _a;
|
var _a;
|
||||||
})(Base);
|
})(Base);
|
||||||
|
|
|
@ -28,7 +28,8 @@ var C = (function (_super) {
|
||||||
_super.call(this);
|
_super.call(this);
|
||||||
var obj = (_a = {},
|
var obj = (_a = {},
|
||||||
_a[(_super.call(this), "prop")] = function () { },
|
_a[(_super.call(this), "prop")] = function () { },
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
}
|
}
|
||||||
return C;
|
return C;
|
||||||
|
|
|
@ -19,7 +19,8 @@ var C = (function () {
|
||||||
(function () {
|
(function () {
|
||||||
var obj = (_a = {},
|
var obj = (_a = {},
|
||||||
_a[_this.bar()] = function () { },
|
_a[_this.bar()] = function () { },
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
});
|
});
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -33,8 +33,12 @@ var C = (function (_super) {
|
||||||
_super.call(this);
|
_super.call(this);
|
||||||
(function () {
|
(function () {
|
||||||
var obj = (_a = {},
|
var obj = (_a = {},
|
||||||
|
// Ideally, we would capture this. But the reference is
|
||||||
|
// illegal, and not capturing this is consistent with
|
||||||
|
//treatment of other similar violations.
|
||||||
_a[(_super.call(this), "prop")] = function () { },
|
_a[(_super.call(this), "prop")] = function () { },
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,8 @@ var C = (function (_super) {
|
||||||
(function () {
|
(function () {
|
||||||
var obj = (_a = {},
|
var obj = (_a = {},
|
||||||
_a[_super.prototype.bar.call(_this)] = function () { },
|
_a[_super.prototype.bar.call(_this)] = function () { },
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
});
|
});
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -17,7 +17,8 @@ var C = (function () {
|
||||||
C.prototype.bar = function () {
|
C.prototype.bar = function () {
|
||||||
var obj = (_a = {},
|
var obj = (_a = {},
|
||||||
_a[foo()] = function () { },
|
_a[foo()] = function () { },
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
return 0;
|
return 0;
|
||||||
var _a;
|
var _a;
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,7 +17,8 @@ var C = (function () {
|
||||||
C.bar = function () {
|
C.bar = function () {
|
||||||
var obj = (_a = {},
|
var obj = (_a = {},
|
||||||
_a[foo()] = function () { },
|
_a[foo()] = function () { },
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
return 0;
|
return 0;
|
||||||
var _a;
|
var _a;
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,5 +6,6 @@ var o = {
|
||||||
//// [computedPropertyNames46_ES5.js]
|
//// [computedPropertyNames46_ES5.js]
|
||||||
var o = (_a = {},
|
var o = (_a = {},
|
||||||
_a["" || 0] = 0,
|
_a["" || 0] = 0,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -16,5 +16,6 @@ var E2;
|
||||||
})(E2 || (E2 = {}));
|
})(E2 || (E2 = {}));
|
||||||
var o = (_a = {},
|
var o = (_a = {},
|
||||||
_a[E1.x || E2.x] = 0,
|
_a[E1.x || E2.x] = 0,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -25,11 +25,14 @@ var E;
|
||||||
var a;
|
var a;
|
||||||
extractIndexer((_a = {},
|
extractIndexer((_a = {},
|
||||||
_a[a] = "",
|
_a[a] = "",
|
||||||
_a)); // Should return string
|
_a
|
||||||
|
)); // Should return string
|
||||||
extractIndexer((_b = {},
|
extractIndexer((_b = {},
|
||||||
_b[E.x] = "",
|
_b[E.x] = "",
|
||||||
_b)); // Should return string
|
_b
|
||||||
|
)); // Should return string
|
||||||
extractIndexer((_c = {},
|
extractIndexer((_c = {},
|
||||||
_c["" || 0] = "",
|
_c["" || 0] = "",
|
||||||
_c)); // Should return any (widened form of undefined)
|
_c
|
||||||
|
)); // Should return any (widened form of undefined)
|
||||||
var _a, _b, _c;
|
var _a, _b, _c;
|
||||||
|
|
|
@ -27,24 +27,41 @@ var x = {
|
||||||
|
|
||||||
//// [computedPropertyNames49_ES5.js]
|
//// [computedPropertyNames49_ES5.js]
|
||||||
var x = (_a = {
|
var x = (_a = {
|
||||||
p1: 10
|
p1: 10
|
||||||
},
|
},
|
||||||
_a.p1 = 10,
|
Object.defineProperty(_a, 1 + 1, {
|
||||||
_a[1 + 1] = Object.defineProperty({ get: function () {
|
get: function () {
|
||||||
throw 10;
|
throw 10;
|
||||||
}, enumerable: true, configurable: true }),
|
},
|
||||||
_a[1 + 1] = Object.defineProperty({ get: function () {
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, 1 + 1, {
|
||||||
|
get: function () {
|
||||||
return 10;
|
return 10;
|
||||||
}, enumerable: true, configurable: true }),
|
},
|
||||||
_a[1 + 1] = Object.defineProperty({ set: function () {
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, 1 + 1, {
|
||||||
|
set: function () {
|
||||||
// just throw
|
// just throw
|
||||||
throw 10;
|
throw 10;
|
||||||
}, enumerable: true, configurable: true }),
|
},
|
||||||
_a.foo = Object.defineProperty({ get: function () {
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, "foo", {
|
||||||
|
get: function () {
|
||||||
if (1 == 1) {
|
if (1 == 1) {
|
||||||
return 10;
|
return 10;
|
||||||
}
|
}
|
||||||
}, enumerable: true, configurable: true }),
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
,
|
||||||
_a.p2 = 20,
|
_a.p2 = 20,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -32,5 +32,6 @@ var v = (_a = {},
|
||||||
_a[true] = 0,
|
_a[true] = 0,
|
||||||
_a["hello bye"] = 0,
|
_a["hello bye"] = 0,
|
||||||
_a["hello " + a + " bye"] = 0,
|
_a["hello " + a + " bye"] = 0,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -27,29 +27,37 @@ var x = {
|
||||||
|
|
||||||
//// [computedPropertyNames50_ES5.js]
|
//// [computedPropertyNames50_ES5.js]
|
||||||
var x = (_a = {
|
var x = (_a = {
|
||||||
p1: 10,
|
p1: 10,
|
||||||
get foo() {
|
get foo() {
|
||||||
if (1 == 1) {
|
|
||||||
return 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
_a.p1 = 10,
|
|
||||||
_a.foo = Object.defineProperty({ get: function () {
|
|
||||||
if (1 == 1) {
|
if (1 == 1) {
|
||||||
return 10;
|
return 10;
|
||||||
}
|
}
|
||||||
}, enumerable: true, configurable: true }),
|
}
|
||||||
_a[1 + 1] = Object.defineProperty({ get: function () {
|
},
|
||||||
|
Object.defineProperty(_a, 1 + 1, {
|
||||||
|
get: function () {
|
||||||
throw 10;
|
throw 10;
|
||||||
}, enumerable: true, configurable: true }),
|
},
|
||||||
_a[1 + 1] = Object.defineProperty({ set: function () {
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, 1 + 1, {
|
||||||
|
set: function () {
|
||||||
// just throw
|
// just throw
|
||||||
throw 10;
|
throw 10;
|
||||||
}, enumerable: true, configurable: true }),
|
},
|
||||||
_a[1 + 1] = Object.defineProperty({ get: function () {
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, 1 + 1, {
|
||||||
|
get: function () {
|
||||||
return 10;
|
return 10;
|
||||||
}, enumerable: true, configurable: true }),
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
,
|
||||||
_a.p2 = 20,
|
_a.p2 = 20,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -18,5 +18,6 @@ var v = (_a = {},
|
||||||
_a[{}] = 0,
|
_a[{}] = 0,
|
||||||
_a[undefined] = undefined,
|
_a[undefined] = undefined,
|
||||||
_a[null] = null,
|
_a[null] = null,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -16,5 +16,6 @@ var v = (_a = {},
|
||||||
_a[p1] = 0,
|
_a[p1] = 0,
|
||||||
_a[p2] = 1,
|
_a[p2] = 1,
|
||||||
_a[p3] = 2,
|
_a[p3] = 2,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -13,5 +13,6 @@ var E;
|
||||||
})(E || (E = {}));
|
})(E || (E = {}));
|
||||||
var v = (_a = {},
|
var v = (_a = {},
|
||||||
_a[E.member] = 0,
|
_a[E.member] = 0,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -15,6 +15,7 @@ function f() {
|
||||||
var v = (_a = {},
|
var v = (_a = {},
|
||||||
_a[t] = 0,
|
_a[t] = 0,
|
||||||
_a[u] = 1,
|
_a[u] = 1,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,5 +16,6 @@ var v = (_a = {},
|
||||||
_a[f("")] = 0,
|
_a[f("")] = 0,
|
||||||
_a[f(0)] = 0,
|
_a[f(0)] = 0,
|
||||||
_a[f(true)] = 0,
|
_a[f(true)] = 0,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -12,5 +12,6 @@ var o: I = {
|
||||||
var o = (_a = {},
|
var o = (_a = {},
|
||||||
_a[+"foo"] = "",
|
_a[+"foo"] = "",
|
||||||
_a[+"bar"] = 0,
|
_a[+"bar"] = 0,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -13,5 +13,6 @@ var o: I = {
|
||||||
var o = (_a = {},
|
var o = (_a = {},
|
||||||
_a["" + 0] = function (y) { return y.length; },
|
_a["" + 0] = function (y) { return y.length; },
|
||||||
_a["" + 1] = function (y) { return y.length; },
|
_a["" + 1] = function (y) { return y.length; },
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -13,5 +13,6 @@ var o: I = {
|
||||||
var o = (_a = {},
|
var o = (_a = {},
|
||||||
_a[+"foo"] = function (y) { return y.length; },
|
_a[+"foo"] = function (y) { return y.length; },
|
||||||
_a[+"bar"] = function (y) { return y.length; },
|
_a[+"bar"] = function (y) { return y.length; },
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -12,5 +12,6 @@ var o: I = {
|
||||||
var o = (_a = {},
|
var o = (_a = {},
|
||||||
_a[+"foo"] = function (y) { return y.length; },
|
_a[+"foo"] = function (y) { return y.length; },
|
||||||
_a[+"bar"] = function (y) { return y.length; },
|
_a[+"bar"] = function (y) { return y.length; },
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -13,5 +13,6 @@ var o: I = {
|
||||||
var o = (_a = {},
|
var o = (_a = {},
|
||||||
_a["" + "foo"] = "",
|
_a["" + "foo"] = "",
|
||||||
_a["" + "bar"] = 0,
|
_a["" + "bar"] = 0,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -13,5 +13,6 @@ var o: I = {
|
||||||
var o = (_a = {},
|
var o = (_a = {},
|
||||||
_a[+"foo"] = "",
|
_a[+"foo"] = "",
|
||||||
_a[+"bar"] = 0,
|
_a[+"bar"] = 0,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -15,13 +15,12 @@ foo({
|
||||||
|
|
||||||
//// [computedPropertyNamesContextualType6_ES5.js]
|
//// [computedPropertyNamesContextualType6_ES5.js]
|
||||||
foo((_a = {
|
foo((_a = {
|
||||||
p: "",
|
p: "",
|
||||||
0: function () { }
|
0: function () { }
|
||||||
},
|
},
|
||||||
_a.p = "",
|
|
||||||
_a[0] = function () { },
|
|
||||||
_a["hi" + "bye"] = true,
|
_a["hi" + "bye"] = true,
|
||||||
_a[0 + 1] = 0,
|
_a[0 + 1] = 0,
|
||||||
_a[+"hi"] = [0],
|
_a[+"hi"] = [0],
|
||||||
_a));
|
_a
|
||||||
|
));
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -15,13 +15,12 @@ foo({
|
||||||
|
|
||||||
//// [computedPropertyNamesContextualType7_ES5.js]
|
//// [computedPropertyNamesContextualType7_ES5.js]
|
||||||
foo((_a = {
|
foo((_a = {
|
||||||
p: "",
|
p: "",
|
||||||
0: function () { }
|
0: function () { }
|
||||||
},
|
},
|
||||||
_a.p = "",
|
|
||||||
_a[0] = function () { },
|
|
||||||
_a["hi" + "bye"] = true,
|
_a["hi" + "bye"] = true,
|
||||||
_a[0 + 1] = 0,
|
_a[0 + 1] = 0,
|
||||||
_a[+"hi"] = [0],
|
_a[+"hi"] = [0],
|
||||||
_a));
|
_a
|
||||||
|
));
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -13,5 +13,6 @@ var o: I = {
|
||||||
var o = (_a = {},
|
var o = (_a = {},
|
||||||
_a["" + "foo"] = "",
|
_a["" + "foo"] = "",
|
||||||
_a["" + "bar"] = 0,
|
_a["" + "bar"] = 0,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -13,5 +13,6 @@ var o: I = {
|
||||||
var o = (_a = {},
|
var o = (_a = {},
|
||||||
_a[+"foo"] = "",
|
_a[+"foo"] = "",
|
||||||
_a[+"bar"] = 0,
|
_a[+"bar"] = 0,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -10,9 +10,18 @@ var v = {
|
||||||
var v = (_a = {},
|
var v = (_a = {},
|
||||||
_a["" + ""] = 0,
|
_a["" + ""] = 0,
|
||||||
_a["" + ""] = function () { },
|
_a["" + ""] = function () { },
|
||||||
_a["" + ""] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
|
Object.defineProperty(_a, "" + "", {
|
||||||
_a["" + ""] = Object.defineProperty({ set: function (x) { }, enumerable: true, configurable: true }),
|
get: function () { return 0; },
|
||||||
_a);
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
Object.defineProperty(_a, "" + "", {
|
||||||
|
set: function (x) { },
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}),
|
||||||
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ var v = (_a = {},
|
||||||
_a["hello"] = function () {
|
_a["hello"] = function () {
|
||||||
debugger;
|
debugger;
|
||||||
},
|
},
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var _a;
|
var _a;
|
||||||
//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map
|
//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map
|
|
@ -1,2 +1,2 @@
|
||||||
//// [computedPropertyNamesSourceMap2_ES5.js.map]
|
//// [computedPropertyNamesSourceMap2_ES5.js.map]
|
||||||
{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;OACH,OAAO;QACJ,QAAQ,CAAC;IACb,CAAC;OACJ,CAAA"}
|
{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":["[\"hello\"]"],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,GAAC,OAAO,CAAC;QACLA,QAAQA,CAACA;IACbA,CAACA;;CACJ,CAAA"}
|
|
@ -24,45 +24,53 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts
|
||||||
4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0)
|
4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0)
|
||||||
---
|
---
|
||||||
>>> _a["hello"] = function () {
|
>>> _a["hello"] = function () {
|
||||||
1->^^^^^^^
|
1->^^^^
|
||||||
2 > ^^^^^^^
|
2 > ^^^
|
||||||
3 > ^^^^->
|
3 > ^^^^^^^
|
||||||
|
4 > ^
|
||||||
|
5 > ^^^->
|
||||||
1->{
|
1->{
|
||||||
> [
|
>
|
||||||
2 > "hello"
|
2 > [
|
||||||
1->Emitted(2, 8) Source(2, 6) + SourceIndex(0)
|
3 > "hello"
|
||||||
2 >Emitted(2, 15) Source(2, 13) + SourceIndex(0)
|
4 > ]
|
||||||
|
1->Emitted(2, 5) Source(2, 5) + SourceIndex(0)
|
||||||
|
2 >Emitted(2, 8) Source(2, 6) + SourceIndex(0)
|
||||||
|
3 >Emitted(2, 15) Source(2, 13) + SourceIndex(0)
|
||||||
|
4 >Emitted(2, 16) Source(2, 14) + SourceIndex(0)
|
||||||
---
|
---
|
||||||
>>> debugger;
|
>>> debugger;
|
||||||
1->^^^^^^^^
|
1->^^^^^^^^
|
||||||
2 > ^^^^^^^^
|
2 > ^^^^^^^^
|
||||||
3 > ^
|
3 > ^
|
||||||
1->]() {
|
1->() {
|
||||||
>
|
>
|
||||||
2 > debugger
|
2 > debugger
|
||||||
3 > ;
|
3 > ;
|
||||||
1->Emitted(3, 9) Source(3, 9) + SourceIndex(0)
|
1->Emitted(3, 9) Source(3, 9) + SourceIndex(0) name (["hello"])
|
||||||
2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0)
|
2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) name (["hello"])
|
||||||
3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0)
|
3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0) name (["hello"])
|
||||||
---
|
---
|
||||||
>>> },
|
>>> },
|
||||||
1 >^^^^
|
1 >^^^^
|
||||||
2 > ^
|
2 > ^
|
||||||
3 > ^^^^->
|
3 > ^^->
|
||||||
1 >
|
1 >
|
||||||
>
|
>
|
||||||
2 > }
|
2 > }
|
||||||
1 >Emitted(4, 5) Source(4, 5) + SourceIndex(0)
|
1 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) name (["hello"])
|
||||||
2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0)
|
2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) name (["hello"])
|
||||||
---
|
---
|
||||||
>>> _a);
|
>>> _a
|
||||||
1->^^^^^^^
|
>>>);
|
||||||
2 > ^
|
1->^
|
||||||
|
2 > ^
|
||||||
|
3 > ^^^^^^->
|
||||||
1->
|
1->
|
||||||
>}
|
>}
|
||||||
2 >
|
2 >
|
||||||
1->Emitted(5, 8) Source(5, 2) + SourceIndex(0)
|
1->Emitted(6, 2) Source(5, 2) + SourceIndex(0)
|
||||||
2 >Emitted(5, 9) Source(5, 2) + SourceIndex(0)
|
2 >Emitted(6, 3) Source(5, 2) + SourceIndex(0)
|
||||||
---
|
---
|
||||||
>>>var _a;
|
>>>var _a;
|
||||||
>>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map
|
>>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map
|
|
@ -2,7 +2,5 @@
|
||||||
var v = { [e]: 1 };
|
var v = { [e]: 1 };
|
||||||
|
|
||||||
//// [parserES5ComputedPropertyName2.js]
|
//// [parserES5ComputedPropertyName2.js]
|
||||||
var v = (_a = {},
|
var v = (_a = {}, _a[e] = 1, _a);
|
||||||
_a[e] = 1,
|
|
||||||
_a);
|
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -2,7 +2,5 @@
|
||||||
var v = { [e]() { } };
|
var v = { [e]() { } };
|
||||||
|
|
||||||
//// [parserES5ComputedPropertyName3.js]
|
//// [parserES5ComputedPropertyName3.js]
|
||||||
var v = (_a = {},
|
var v = (_a = {}, _a[e] = function () { }, _a);
|
||||||
_a[e] = function () { },
|
|
||||||
_a);
|
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
var v = { get [e]() { } };
|
var v = { get [e]() { } };
|
||||||
|
|
||||||
//// [parserES5ComputedPropertyName4.js]
|
//// [parserES5ComputedPropertyName4.js]
|
||||||
var v = (_a = {},
|
var v = (_a = {}, Object.defineProperty(_a, e, {
|
||||||
_a[e] = Object.defineProperty({ get: function () { }, enumerable: true, configurable: true }),
|
get: function () { },
|
||||||
_a);
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
}), _a);
|
||||||
var _a;
|
var _a;
|
||||||
|
|
|
@ -14,6 +14,7 @@ var y: {
|
||||||
var x = (_a = {},
|
var x = (_a = {},
|
||||||
_a[x] = string,
|
_a[x] = string,
|
||||||
_a.string = ,
|
_a.string = ,
|
||||||
_a);
|
_a
|
||||||
|
);
|
||||||
var y;
|
var y;
|
||||||
var _a;
|
var _a;
|
||||||
|
|
Loading…
Reference in a new issue