Compare commits
4 commits
main
...
emit-names
Author | SHA1 | Date | |
---|---|---|---|
0df7d2c74a | |||
f59c1bca5f | |||
499a7adb12 | |||
8d23772b25 |
|
@ -2777,9 +2777,17 @@ namespace ts {
|
|||
: createStrictEquality(createTypeOf(value), createLiteral(tag));
|
||||
}
|
||||
|
||||
export function createMemberAccessForPropertyName(target: Expression, memberName: PropertyName, location?: TextRange): MemberExpression {
|
||||
export function createMemberAccessForPropertyName(target: Expression, memberName: PropertyName, location?: TextRange, storePropertyName?: Push<Identifier | StringLiteral | NumericLiteral>, context?: TransformationContext): MemberExpression {
|
||||
if (isComputedPropertyName(memberName)) {
|
||||
return setTextRange(createElementAccess(target, memberName.expression), location);
|
||||
// Assign the name to an identifier so that later we can set it's `.name` property without reinvoking the expression
|
||||
if (storePropertyName) {
|
||||
const id = createTempVariable(context.hoistVariableDeclaration);
|
||||
storePropertyName.push(id);
|
||||
return setTextRange(createElementAccess(target, createAssignment(id, memberName.expression)), location);
|
||||
}
|
||||
else {
|
||||
return setTextRange(createElementAccess(target, memberName.expression), location);
|
||||
}
|
||||
}
|
||||
else {
|
||||
const expression = setTextRange(
|
||||
|
@ -2789,6 +2797,9 @@ namespace ts {
|
|||
memberName
|
||||
);
|
||||
getOrCreateEmitNode(expression).flags |= EmitFlags.NoNestedSourceMaps;
|
||||
if (storePropertyName) {
|
||||
storePropertyName.push(isIdentifier(memberName) ? createLiteral(unescapeLeadingUnderscores(memberName.escapedText)) : memberName);
|
||||
}
|
||||
return expression;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -862,7 +862,9 @@ namespace ts {
|
|||
startLexicalEnvironment();
|
||||
addExtendsHelperIfNeeded(statements, node, extendsClauseElement);
|
||||
addConstructor(statements, node, extendsClauseElement);
|
||||
addClassMembers(statements, node);
|
||||
const memberNames: MemberName[] = [];
|
||||
addClassMembers(statements, node, memberNames);
|
||||
addNamesHelperIfNeeded(statements, node, memberNames);
|
||||
|
||||
// Create a synthetic text range for the return statement.
|
||||
const closingBraceLocation = createTokenRange(skipTrivia(currentText, node.members.end), SyntaxKind.CloseBraceToken);
|
||||
|
@ -906,6 +908,12 @@ namespace ts {
|
|||
}
|
||||
}
|
||||
|
||||
function addNamesHelperIfNeeded(statements: Statement[], node: ClassExpression | ClassDeclaration, memberNames: MemberName[]) {
|
||||
if (memberNames && memberNames.length) {
|
||||
statements.push(createStatement(createNamesHelper(context, createPropertyAccess(getInternalName(node), "prototype"), memberNames)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the constructor of the class to a class body function.
|
||||
*
|
||||
|
@ -1570,6 +1578,8 @@ namespace ts {
|
|||
return statements;
|
||||
}
|
||||
|
||||
type MemberName = Identifier | StringLiteral | NumericLiteral;
|
||||
|
||||
/**
|
||||
* Adds statements to the class body function for a class to define the members of the
|
||||
* class.
|
||||
|
@ -1577,17 +1587,17 @@ namespace ts {
|
|||
* @param statements The statements for the class body function.
|
||||
* @param node The ClassExpression or ClassDeclaration node.
|
||||
*/
|
||||
function addClassMembers(statements: Statement[], node: ClassExpression | ClassDeclaration): void {
|
||||
function addClassMembers(statements: Statement[], node: ClassExpression | ClassDeclaration, memberNames: Push<MemberName>): void {
|
||||
for (const member of node.members) {
|
||||
switch (member.kind) {
|
||||
case SyntaxKind.SemicolonClassElement:
|
||||
statements.push(transformSemicolonClassElementToStatement(<SemicolonClassElement>member));
|
||||
break;
|
||||
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), <MethodDeclaration>member, node));
|
||||
case SyntaxKind.MethodDeclaration: {
|
||||
statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), <MethodDeclaration>member, node, memberNames));
|
||||
break;
|
||||
|
||||
}
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
const accessors = getAllAccessorDeclarations(node.members, <AccessorDeclaration>member);
|
||||
|
@ -1623,11 +1633,11 @@ namespace ts {
|
|||
* @param receiver The receiver for the member.
|
||||
* @param member The MethodDeclaration node.
|
||||
*/
|
||||
function transformClassMethodDeclarationToStatement(receiver: LeftHandSideExpression, member: MethodDeclaration, container: Node) {
|
||||
function transformClassMethodDeclarationToStatement(receiver: LeftHandSideExpression, member: MethodDeclaration, container: Node, memberNames: Push<MemberName>) {
|
||||
const ancestorFacts = enterSubtree(HierarchyFacts.None, HierarchyFacts.None);
|
||||
const commentRange = getCommentRange(member);
|
||||
const sourceMapRange = getSourceMapRange(member);
|
||||
const memberName = createMemberAccessForPropertyName(receiver, visitNode(member.name, visitor, isPropertyName), /*location*/ member.name);
|
||||
const memberName = createMemberAccessForPropertyName(receiver, visitNode(member.name, visitor, isPropertyName), /*location*/ member.name, hasModifier(member, ModifierFlags.Static) ? undefined : memberNames, context);
|
||||
const memberFunction = transformFunctionLikeToExpression(member, /*location*/ member, /*name*/ undefined, container);
|
||||
setEmitFlags(memberFunction, EmitFlags.NoComments);
|
||||
setSourceMapRange(memberFunction, sourceMapRange);
|
||||
|
@ -2643,7 +2653,11 @@ namespace ts {
|
|||
|
||||
expressions.push(assignment);
|
||||
|
||||
addObjectLiteralMembers(expressions, node, temp, numInitialProperties);
|
||||
const memberNames: MemberName[] = [];
|
||||
addObjectLiteralMembers(expressions, node, temp, numInitialProperties, memberNames);
|
||||
if (memberNames && memberNames.length) {
|
||||
expressions.push(createNamesHelper(context, temp, memberNames));
|
||||
}
|
||||
|
||||
// We need to clone the temporary identifier so that we can write it on a
|
||||
// new line
|
||||
|
@ -3068,7 +3082,7 @@ namespace ts {
|
|||
* @param numInitialNonComputedProperties The number of initial properties without
|
||||
* computed property names.
|
||||
*/
|
||||
function addObjectLiteralMembers(expressions: Expression[], node: ObjectLiteralExpression, receiver: Identifier, start: number) {
|
||||
function addObjectLiteralMembers(expressions: Expression[], node: ObjectLiteralExpression, receiver: Identifier, start: number, memberNames: Push<MemberName>) {
|
||||
const properties = node.properties;
|
||||
const numProperties = properties.length;
|
||||
for (let i = start; i < numProperties; i++) {
|
||||
|
@ -3084,7 +3098,7 @@ namespace ts {
|
|||
break;
|
||||
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
expressions.push(transformObjectLiteralMethodDeclarationToExpression(<MethodDeclaration>property, receiver, node, node.multiLine));
|
||||
expressions.push(transformObjectLiteralMethodDeclarationToExpression(<MethodDeclaration>property, receiver, node, node.multiLine, memberNames));
|
||||
break;
|
||||
|
||||
case SyntaxKind.PropertyAssignment:
|
||||
|
@ -3153,12 +3167,15 @@ namespace ts {
|
|||
* @param method The MethodDeclaration node.
|
||||
* @param receiver The receiver for the assignment.
|
||||
*/
|
||||
function transformObjectLiteralMethodDeclarationToExpression(method: MethodDeclaration, receiver: Expression, container: Node, startsOnNewLine: boolean) {
|
||||
function transformObjectLiteralMethodDeclarationToExpression(method: MethodDeclaration, receiver: Expression, container: Node, startsOnNewLine: boolean, memberNames: Push<MemberName>) {
|
||||
const ancestorFacts = enterSubtree(HierarchyFacts.None, HierarchyFacts.None);
|
||||
const expression = createAssignment(
|
||||
createMemberAccessForPropertyName(
|
||||
receiver,
|
||||
visitNode(method.name, visitor, isPropertyName)
|
||||
visitNode(method.name, visitor, isPropertyName),
|
||||
/* location */ undefined,
|
||||
memberNames,
|
||||
context
|
||||
),
|
||||
transformFunctionLikeToExpression(method, /*location*/ method, /*name*/ undefined, container)
|
||||
);
|
||||
|
@ -4099,4 +4116,37 @@ namespace ts {
|
|||
};
|
||||
})();`
|
||||
};
|
||||
|
||||
function createNamesHelper(context: TransformationContext, proto: PropertyAccessExpression | Identifier, names: (Identifier | StringLiteral | NumericLiteral)[]) {
|
||||
context.requestEmitHelper(nameHelper);
|
||||
return createCall(
|
||||
getHelperName("__names"),
|
||||
/* typeArguments */ undefined,
|
||||
[
|
||||
proto,
|
||||
createArrayLiteral(names)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
const nameHelper: EmitHelper = {
|
||||
name: "typescript:name",
|
||||
scoped: false,
|
||||
priority: 0,
|
||||
text: `
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();`
|
||||
};
|
||||
}
|
||||
|
|
|
@ -16,6 +16,20 @@ class Board {
|
|||
}
|
||||
|
||||
//// [2dArrays.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Cell = (function () {
|
||||
function Cell() {
|
||||
}
|
||||
|
@ -32,5 +46,6 @@ var Board = (function () {
|
|||
Board.prototype.allShipsSunk = function () {
|
||||
return this.ships.every(function (val) { return val.isSunk; });
|
||||
};
|
||||
__names(Board.prototype, ["allShipsSunk"]);
|
||||
return Board;
|
||||
}());
|
||||
|
|
|
@ -5,9 +5,24 @@ class C {
|
|||
}
|
||||
|
||||
//// [ClassDeclaration11.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.foo = function () { };
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
|
|
|
@ -5,9 +5,24 @@ class C {
|
|||
}
|
||||
|
||||
//// [ClassDeclaration13.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.bar = function () { };
|
||||
__names(C.prototype, ["bar"]);
|
||||
return C;
|
||||
}());
|
||||
|
|
|
@ -5,9 +5,24 @@ class C {
|
|||
}
|
||||
|
||||
//// [ClassDeclaration21.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype[1] = function () { };
|
||||
__names(C.prototype, [1]);
|
||||
return C;
|
||||
}());
|
||||
|
|
|
@ -5,9 +5,24 @@ class C {
|
|||
}
|
||||
|
||||
//// [ClassDeclaration22.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype["bar"] = function () { };
|
||||
__names(C.prototype, ["bar"]);
|
||||
return C;
|
||||
}());
|
||||
|
|
|
@ -15,6 +15,20 @@ class StringIterator {
|
|||
for (var v of new StringIterator) { }
|
||||
|
||||
//// [ES5For-ofTypeCheck10.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
// In ES3/5, you cannot for...of over an arbitrary iterable.
|
||||
var StringIterator = (function () {
|
||||
function StringIterator() {
|
||||
|
@ -25,10 +39,12 @@ var StringIterator = (function () {
|
|||
value: ""
|
||||
};
|
||||
};
|
||||
StringIterator.prototype[Symbol.iterator] = function () {
|
||||
StringIterator.prototype[_a = Symbol.iterator] = function () {
|
||||
return this;
|
||||
};
|
||||
__names(StringIterator.prototype, ["next", _a]);
|
||||
return StringIterator;
|
||||
var _a;
|
||||
}());
|
||||
for (var _i = 0, _a = new StringIterator; _i < _a.length; _i++) {
|
||||
var v = _a[_i];
|
||||
|
|
|
@ -11,14 +11,30 @@ module M {
|
|||
(new M.C)[Symbol.iterator];
|
||||
|
||||
//// [ES5SymbolProperty2.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
var Symbol;
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype[Symbol.iterator] = function () { };
|
||||
C.prototype[_a = Symbol.iterator] = function () { };
|
||||
__names(C.prototype, [_a]);
|
||||
return C;
|
||||
var _a;
|
||||
}());
|
||||
M.C = C;
|
||||
(new C)[Symbol.iterator];
|
||||
|
|
|
@ -8,11 +8,27 @@ class C {
|
|||
(new C)[Symbol.iterator]
|
||||
|
||||
//// [ES5SymbolProperty3.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Symbol;
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype[Symbol.iterator] = function () { };
|
||||
C.prototype[_a = Symbol.iterator] = function () { };
|
||||
__names(C.prototype, [_a]);
|
||||
return C;
|
||||
var _a;
|
||||
}());
|
||||
(new C)[Symbol.iterator];
|
||||
|
|
|
@ -8,11 +8,27 @@ class C {
|
|||
(new C)[Symbol.iterator]
|
||||
|
||||
//// [ES5SymbolProperty4.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Symbol;
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype[Symbol.iterator] = function () { };
|
||||
C.prototype[_a = Symbol.iterator] = function () { };
|
||||
__names(C.prototype, [_a]);
|
||||
return C;
|
||||
var _a;
|
||||
}());
|
||||
(new C)[Symbol.iterator];
|
||||
|
|
|
@ -8,11 +8,27 @@ class C {
|
|||
(new C)[Symbol.iterator](0) // Should error
|
||||
|
||||
//// [ES5SymbolProperty5.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Symbol;
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype[Symbol.iterator] = function () { };
|
||||
C.prototype[_a = Symbol.iterator] = function () { };
|
||||
__names(C.prototype, [_a]);
|
||||
return C;
|
||||
var _a;
|
||||
}());
|
||||
(new C)[Symbol.iterator](0); // Should error
|
||||
|
|
|
@ -6,10 +6,26 @@ class C {
|
|||
(new C)[Symbol.iterator]
|
||||
|
||||
//// [ES5SymbolProperty6.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype[Symbol.iterator] = function () { };
|
||||
C.prototype[_a = Symbol.iterator] = function () { };
|
||||
__names(C.prototype, [_a]);
|
||||
return C;
|
||||
var _a;
|
||||
}());
|
||||
(new C)[Symbol.iterator];
|
||||
|
|
|
@ -8,11 +8,27 @@ class C {
|
|||
(new C)[Symbol.iterator]
|
||||
|
||||
//// [ES5SymbolProperty7.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Symbol;
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype[Symbol.iterator] = function () { };
|
||||
C.prototype[_a = Symbol.iterator] = function () { };
|
||||
__names(C.prototype, [_a]);
|
||||
return C;
|
||||
var _a;
|
||||
}());
|
||||
(new C)[Symbol.iterator];
|
||||
|
|
|
@ -20,6 +20,20 @@ module A {
|
|||
|
||||
|
||||
//// [ExportClassWhichExtendsInterfaceWithInaccessibleType.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var A;
|
||||
(function (A) {
|
||||
var Point2d = (function () {
|
||||
|
@ -30,6 +44,7 @@ var A;
|
|||
Point2d.prototype.fromOrigin = function (p) {
|
||||
return 1;
|
||||
};
|
||||
__names(Point2d.prototype, ["fromOrigin"]);
|
||||
return Point2d;
|
||||
}());
|
||||
A.Point2d = Point2d;
|
||||
|
|
|
@ -4,9 +4,24 @@ class C {
|
|||
}
|
||||
|
||||
//// [Protected4.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.m = function () { };
|
||||
__names(C.prototype, ["m"]);
|
||||
return C;
|
||||
}());
|
||||
|
|
|
@ -4,9 +4,24 @@ class C {
|
|||
}
|
||||
|
||||
//// [Protected7.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.m = function () { };
|
||||
__names(C.prototype, ["m"]);
|
||||
return C;
|
||||
}());
|
||||
|
|
|
@ -41,6 +41,20 @@ var l: X.Y.Z.Line;
|
|||
|
||||
|
||||
//// [TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var A;
|
||||
(function (A) {
|
||||
var Point = (function () {
|
||||
|
@ -57,6 +71,7 @@ var A;
|
|||
Point.prototype.fromCarthesian = function (p) {
|
||||
return { x: p.x, y: p.y };
|
||||
};
|
||||
__names(Point.prototype, ["fromCarthesian"]);
|
||||
return Point;
|
||||
}());
|
||||
})(A || (A = {}));
|
||||
|
|
|
@ -32,6 +32,20 @@ var __extends = (this && this.__extends) || (function () {
|
|||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var B = (function () {
|
||||
function B() {
|
||||
}
|
||||
|
@ -52,5 +66,6 @@ var C = (function (_super) {
|
|||
configurable: true
|
||||
});
|
||||
C.prototype.m = function () { };
|
||||
__names(C.prototype, ["m"]);
|
||||
return C;
|
||||
}(B));
|
||||
|
|
|
@ -8,11 +8,26 @@ class C {
|
|||
}
|
||||
|
||||
//// [accessInstanceMemberFromStaticMethod01.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.bar = function () {
|
||||
var k = foo;
|
||||
};
|
||||
__names(C.prototype, ["bar"]);
|
||||
return C;
|
||||
}());
|
||||
|
|
|
@ -16,6 +16,20 @@ class ColoredPoint extends Point {
|
|||
|
||||
|
||||
//// [accessOverriddenBaseClassMember1.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
|
@ -34,6 +48,7 @@ var Point = (function () {
|
|||
Point.prototype.toString = function () {
|
||||
return "x=" + this.x + " y=" + this.y;
|
||||
};
|
||||
__names(Point.prototype, ["toString"]);
|
||||
return Point;
|
||||
}());
|
||||
var ColoredPoint = (function (_super) {
|
||||
|
@ -46,5 +61,6 @@ var ColoredPoint = (function (_super) {
|
|||
ColoredPoint.prototype.toString = function () {
|
||||
return _super.prototype.toString.call(this) + " color=" + this.color;
|
||||
};
|
||||
__names(ColoredPoint.prototype, ["toString"]);
|
||||
return ColoredPoint;
|
||||
}(Point));
|
||||
|
|
|
@ -45,6 +45,20 @@ class E {
|
|||
|
||||
|
||||
//// [accessibilityModifiers.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
// No errors
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
@ -138,5 +152,6 @@ var E = (function () {
|
|||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
__names(E.prototype, ["method"]);
|
||||
return E;
|
||||
}());
|
||||
|
|
|
@ -29,6 +29,20 @@ class TestClass2 {
|
|||
|
||||
|
||||
//// [ambiguousCallsWhereReturnTypesAgree.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var TestClass = (function () {
|
||||
function TestClass() {
|
||||
}
|
||||
|
@ -37,6 +51,7 @@ var TestClass = (function () {
|
|||
TestClass.prototype.foo = function (x) {
|
||||
this.bar(x); // should not error
|
||||
};
|
||||
__names(TestClass.prototype, ["bar", "foo"]);
|
||||
return TestClass;
|
||||
}());
|
||||
var TestClass2 = (function () {
|
||||
|
@ -48,5 +63,6 @@ var TestClass2 = (function () {
|
|||
TestClass2.prototype.foo = function (x) {
|
||||
return this.bar(x); // should not error
|
||||
};
|
||||
__names(TestClass2.prototype, ["bar", "foo"]);
|
||||
return TestClass2;
|
||||
}());
|
||||
|
|
|
@ -15,6 +15,20 @@ c.m(function(n) { return "hello: "+n; },18);
|
|||
|
||||
|
||||
//// [anonterface.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
var C = (function () {
|
||||
|
@ -23,6 +37,7 @@ var M;
|
|||
C.prototype.m = function (fn, n2) {
|
||||
return fn(n2);
|
||||
};
|
||||
__names(C.prototype, ["m"]);
|
||||
return C;
|
||||
}());
|
||||
M.C = C;
|
||||
|
|
|
@ -19,6 +19,20 @@ while (0) {
|
|||
|
||||
|
||||
//// [anonymousClassExpression2.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
// Fixes #14860
|
||||
// note: repros with `while (0);` too
|
||||
// but it's less inscrutable and more obvious to put it *inside* the loop
|
||||
|
@ -29,6 +43,7 @@ while (0) {
|
|||
A.prototype.methodA = function () {
|
||||
this; //note: a this reference of some kind is required to trigger the bug
|
||||
};
|
||||
__names(A.prototype, ["methodA"]);
|
||||
return A;
|
||||
}());
|
||||
var B = (function () {
|
||||
|
@ -38,6 +53,7 @@ while (0) {
|
|||
this.methodA; // error
|
||||
this.methodB; // ok
|
||||
};
|
||||
__names(B.prototype, ["methodB"]);
|
||||
return B;
|
||||
}());
|
||||
}
|
||||
|
|
|
@ -12,6 +12,20 @@ c.P(1,2,3);
|
|||
|
||||
|
||||
//// [argsInScope.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
|
@ -20,6 +34,7 @@ var C = (function () {
|
|||
// WScript.Echo("param: " + arguments[i]);
|
||||
}
|
||||
};
|
||||
__names(C.prototype, ["P"]);
|
||||
return C;
|
||||
}());
|
||||
var c = new C();
|
||||
|
|
|
@ -86,6 +86,20 @@ arr_any = c3; // should be an error - is
|
|||
arr_any = i1; // should be an error - is
|
||||
|
||||
//// [arrayAssignmentTest1.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
|
@ -101,6 +115,7 @@ var C1 = (function () {
|
|||
}
|
||||
C1.prototype.IM1 = function () { return null; };
|
||||
C1.prototype.C1M1 = function () { return null; };
|
||||
__names(C1.prototype, ["IM1", "C1M1"]);
|
||||
return C1;
|
||||
}());
|
||||
var C2 = (function (_super) {
|
||||
|
@ -109,12 +124,14 @@ var C2 = (function (_super) {
|
|||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
C2.prototype.C2M1 = function () { return null; };
|
||||
__names(C2.prototype, ["C2M1"]);
|
||||
return C2;
|
||||
}(C1));
|
||||
var C3 = (function () {
|
||||
function C3() {
|
||||
}
|
||||
C3.prototype.CM3M1 = function () { return 3; };
|
||||
__names(C3.prototype, ["CM3M1"]);
|
||||
return C3;
|
||||
}());
|
||||
/*
|
||||
|
|
|
@ -60,6 +60,20 @@ arr_any = i1; // should be an error - is
|
|||
|
||||
|
||||
//// [arrayAssignmentTest2.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
|
@ -75,6 +89,7 @@ var C1 = (function () {
|
|||
}
|
||||
C1.prototype.IM1 = function () { return null; };
|
||||
C1.prototype.C1M1 = function () { return null; };
|
||||
__names(C1.prototype, ["IM1", "C1M1"]);
|
||||
return C1;
|
||||
}());
|
||||
var C2 = (function (_super) {
|
||||
|
@ -83,12 +98,14 @@ var C2 = (function (_super) {
|
|||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
C2.prototype.C2M1 = function () { return null; };
|
||||
__names(C2.prototype, ["C2M1"]);
|
||||
return C2;
|
||||
}(C1));
|
||||
var C3 = (function () {
|
||||
function C3() {
|
||||
}
|
||||
C3.prototype.CM3M1 = function () { return 3; };
|
||||
__names(C3.prototype, ["CM3M1"]);
|
||||
return C3;
|
||||
}());
|
||||
/*
|
||||
|
|
|
@ -25,10 +25,25 @@ arr_any = c3; // should be an error - is
|
|||
|
||||
|
||||
//// [arrayAssignmentTest4.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var C3 = (function () {
|
||||
function C3() {
|
||||
}
|
||||
C3.prototype.CM3M1 = function () { return 3; };
|
||||
__names(C3.prototype, ["CM3M1"]);
|
||||
return C3;
|
||||
}());
|
||||
/*
|
||||
|
|
|
@ -34,6 +34,20 @@ module Test {
|
|||
|
||||
|
||||
//// [arrayAssignmentTest5.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Test;
|
||||
(function (Test) {
|
||||
var Bug = (function () {
|
||||
|
@ -49,6 +63,7 @@ var Test;
|
|||
Bug.prototype.tokenize = function (line, state, includeStates) {
|
||||
return null;
|
||||
};
|
||||
__names(Bug.prototype, ["onEnter", "tokenize"]);
|
||||
return Bug;
|
||||
}());
|
||||
Test.Bug = Bug;
|
||||
|
|
|
@ -21,6 +21,20 @@ module Test {
|
|||
|
||||
|
||||
//// [arrayAssignmentTest6.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Test;
|
||||
(function (Test) {
|
||||
var Bug = (function () {
|
||||
|
@ -29,6 +43,7 @@ var Test;
|
|||
Bug.prototype.tokenize = function (line, tokens, includeStates) {
|
||||
return null;
|
||||
};
|
||||
__names(Bug.prototype, ["tokenize"]);
|
||||
return Bug;
|
||||
}());
|
||||
Test.Bug = Bug;
|
||||
|
|
|
@ -118,6 +118,20 @@ var __extends = (this && this.__extends) || (function () {
|
|||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var EmptyTypes;
|
||||
(function (EmptyTypes) {
|
||||
var base = (function () {
|
||||
|
@ -174,6 +188,7 @@ var EmptyTypes;
|
|||
var b3 = [baseObj, ifaceObj, base2Obj];
|
||||
var b4 = [ifaceObj, baseObj, base2Obj];
|
||||
};
|
||||
__names(f.prototype, ["voidIfAny", "x"]);
|
||||
return f;
|
||||
}());
|
||||
})(EmptyTypes || (EmptyTypes = {}));
|
||||
|
@ -233,6 +248,7 @@ var NonEmptyTypes;
|
|||
var b3 = [baseObj, ifaceObj, base2Obj];
|
||||
var b4 = [ifaceObj, baseObj, base2Obj];
|
||||
};
|
||||
__names(f.prototype, ["voidIfAny", "x"]);
|
||||
return f;
|
||||
}());
|
||||
})(NonEmptyTypes || (NonEmptyTypes = {}));
|
||||
|
|
|
@ -34,12 +34,27 @@ var Car = (function () {
|
|||
module.exports = Car;
|
||||
//// [arrayOfExportedClass_1.js]
|
||||
"use strict";
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Road = (function () {
|
||||
function Road() {
|
||||
}
|
||||
Road.prototype.AddCars = function (cars) {
|
||||
this.cars = cars;
|
||||
};
|
||||
__names(Road.prototype, ["AddCars"]);
|
||||
return Road;
|
||||
}());
|
||||
module.exports = Road;
|
||||
|
|
|
@ -4,9 +4,24 @@ class X {
|
|||
}
|
||||
|
||||
//// [arrayReferenceWithoutTypeArgs.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var X = (function () {
|
||||
function X() {
|
||||
}
|
||||
X.prototype.f = function (a) { };
|
||||
__names(X.prototype, ["f"]);
|
||||
return X;
|
||||
}());
|
||||
|
|
|
@ -29,6 +29,20 @@ class parser {
|
|||
}
|
||||
|
||||
//// [arrayconcat.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var parser = (function () {
|
||||
function parser() {
|
||||
}
|
||||
|
@ -47,5 +61,6 @@ var parser = (function () {
|
|||
}
|
||||
});
|
||||
};
|
||||
__names(parser.prototype, ["m"]);
|
||||
return parser;
|
||||
}());
|
||||
|
|
|
@ -100,6 +100,20 @@ function tryCatchFn() {
|
|||
|
||||
|
||||
//// [arrowFunctionExpressions.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
// ArrowFormalParameters => AssignmentExpression is equivalent to ArrowFormalParameters => { return AssignmentExpression; }
|
||||
var a = function (p) { return p.length; };
|
||||
var a = function (p) { return p.length; };
|
||||
|
@ -155,6 +169,7 @@ var MyClass = (function () {
|
|||
var m = function (n) { return n + 1; };
|
||||
var p = function (n) { return n && _this; };
|
||||
};
|
||||
__names(MyClass.prototype, ["fn"]);
|
||||
return MyClass;
|
||||
}());
|
||||
// Arrow function used in arrow function
|
||||
|
|
|
@ -16,6 +16,20 @@ class C3 {
|
|||
|
||||
|
||||
//// [asiAbstract.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
abstract;
|
||||
var NonAbstractClass = (function () {
|
||||
function NonAbstractClass() {
|
||||
|
@ -27,6 +41,7 @@ var C2 = (function () {
|
|||
}
|
||||
C2.prototype.nonAbstractFunction = function () {
|
||||
};
|
||||
__names(C2.prototype, ["nonAbstractFunction"]);
|
||||
return C2;
|
||||
}());
|
||||
var C3 = (function () {
|
||||
|
|
|
@ -23,6 +23,20 @@ class Foo {
|
|||
|
||||
|
||||
//// [asiInES6Classes.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
this.defaults = {
|
||||
|
@ -32,5 +46,6 @@ var Foo = (function () {
|
|||
Foo.prototype.bar = function () {
|
||||
return 3;
|
||||
};
|
||||
__names(Foo.prototype, ["bar"]);
|
||||
return Foo;
|
||||
}());
|
||||
|
|
|
@ -41,12 +41,27 @@ class ClassWithThreeMembers {
|
|||
|
||||
|
||||
//// [asiPublicPrivateProtected.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
public;
|
||||
var NonPublicClass = (function () {
|
||||
function NonPublicClass() {
|
||||
}
|
||||
NonPublicClass.prototype.s = function () {
|
||||
};
|
||||
__names(NonPublicClass.prototype, ["s"]);
|
||||
return NonPublicClass;
|
||||
}());
|
||||
var NonPublicClass2 = (function () {
|
||||
|
@ -54,6 +69,7 @@ var NonPublicClass2 = (function () {
|
|||
}
|
||||
NonPublicClass2.prototype.nonPublicFunction = function () {
|
||||
};
|
||||
__names(NonPublicClass2.prototype, ["nonPublicFunction"]);
|
||||
return NonPublicClass2;
|
||||
}());
|
||||
private;
|
||||
|
@ -62,6 +78,7 @@ var NonPrivateClass = (function () {
|
|||
}
|
||||
NonPrivateClass.prototype.s = function () {
|
||||
};
|
||||
__names(NonPrivateClass.prototype, ["s"]);
|
||||
return NonPrivateClass;
|
||||
}());
|
||||
var NonPrivateClass2 = (function () {
|
||||
|
@ -69,6 +86,7 @@ var NonPrivateClass2 = (function () {
|
|||
}
|
||||
NonPrivateClass2.prototype.nonPrivateFunction = function () {
|
||||
};
|
||||
__names(NonPrivateClass2.prototype, ["nonPrivateFunction"]);
|
||||
return NonPrivateClass2;
|
||||
}());
|
||||
protected;
|
||||
|
@ -77,6 +95,7 @@ var NonProtectedClass = (function () {
|
|||
}
|
||||
NonProtectedClass.prototype.s = function () {
|
||||
};
|
||||
__names(NonProtectedClass.prototype, ["s"]);
|
||||
return NonProtectedClass;
|
||||
}());
|
||||
var NonProtectedClass2 = (function () {
|
||||
|
@ -84,6 +103,7 @@ var NonProtectedClass2 = (function () {
|
|||
}
|
||||
NonProtectedClass2.prototype.nonProtectedFunction = function () {
|
||||
};
|
||||
__names(NonProtectedClass2.prototype, ["nonProtectedFunction"]);
|
||||
return NonProtectedClass2;
|
||||
}());
|
||||
var ClassWithThreeMembers = (function () {
|
||||
|
|
|
@ -6,11 +6,26 @@ class C<T extends C<T>> {
|
|||
}
|
||||
|
||||
//// [assertInWrapSomeTypeParameter.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.foo = function (x) {
|
||||
return null;
|
||||
};
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
|
|
|
@ -16,6 +16,20 @@ module Test {
|
|||
|
||||
|
||||
//// [assignToExistingClass.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Test;
|
||||
(function (Test) {
|
||||
var Mocked = (function () {
|
||||
|
@ -31,6 +45,7 @@ var Test;
|
|||
return { myProp: "test" };
|
||||
};
|
||||
};
|
||||
__names(Tester.prototype, ["willThrowError"]);
|
||||
return Tester;
|
||||
}());
|
||||
})(Test || (Test = {}));
|
||||
|
|
|
@ -17,10 +17,25 @@ Biz(new Foo());
|
|||
|
||||
|
||||
//// [assignmentCompatInterfaceWithStringIndexSignature.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
Foo.prototype.Boz = function () { };
|
||||
__names(Foo.prototype, ["Boz"]);
|
||||
return Foo;
|
||||
}());
|
||||
function Biz(map) { }
|
||||
|
|
|
@ -71,6 +71,20 @@ foo() = value;
|
|||
(foo()) = value;
|
||||
|
||||
//// [assignmentLHSIsValue.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
|
@ -90,6 +104,7 @@ var C = (function () {
|
|||
}
|
||||
C.prototype.foo = function () { this = value; };
|
||||
C.sfoo = function () { this = value; };
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
function foo() { this = value; }
|
||||
|
@ -129,6 +144,7 @@ var Derived = (function (_super) {
|
|||
}
|
||||
Derived.prototype.foo = function () { _super.prototype. = value; };
|
||||
Derived.sfoo = function () { _super. = value; };
|
||||
__names(Derived.prototype, ["foo"]);
|
||||
return Derived;
|
||||
}(C));
|
||||
// function expression
|
||||
|
|
|
@ -21,5 +21,6 @@ var C = (function () {
|
|||
}
|
||||
}); }); };
|
||||
};
|
||||
__names(C.prototype, ["method"]);
|
||||
return C;
|
||||
}());
|
||||
|
|
|
@ -19,5 +19,6 @@ var C = (function () {
|
|||
}
|
||||
}); }); };
|
||||
};
|
||||
__names(C.prototype, ["method"]);
|
||||
return C;
|
||||
}());
|
||||
|
|
|
@ -41,6 +41,20 @@ module M {
|
|||
|
||||
//// [asyncAwaitIsolatedModules_es5.js]
|
||||
"use strict";
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
|
@ -180,6 +194,7 @@ var C = (function () {
|
|||
return [2 /*return*/];
|
||||
}); });
|
||||
};
|
||||
__names(C.prototype, ["m1", "m2", "m3"]);
|
||||
return C;
|
||||
}());
|
||||
var M;
|
||||
|
|
|
@ -40,6 +40,20 @@ module M {
|
|||
}
|
||||
|
||||
//// [asyncAwait_es5.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
|
@ -177,6 +191,7 @@ var C = (function () {
|
|||
return [2 /*return*/];
|
||||
}); });
|
||||
};
|
||||
__names(C.prototype, ["m1", "m2", "m3"]);
|
||||
return C;
|
||||
}());
|
||||
var M;
|
||||
|
|
|
@ -28,5 +28,6 @@ var C = (function () {
|
|||
});
|
||||
}
|
||||
};
|
||||
__names(C.prototype, ["method"]);
|
||||
return C;
|
||||
}());
|
||||
|
|
|
@ -32,6 +32,20 @@ var Task = (function (_super) {
|
|||
exports.Task = Task;
|
||||
//// [test.js]
|
||||
"use strict";
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
|
@ -77,5 +91,6 @@ var Test = (function () {
|
|||
return [2 /*return*/];
|
||||
}); });
|
||||
};
|
||||
__names(Test.prototype, ["example"]);
|
||||
return Test;
|
||||
}());
|
||||
|
|
|
@ -56,6 +56,7 @@ var A = (function () {
|
|||
}
|
||||
A.prototype.x = function () {
|
||||
};
|
||||
__names(A.prototype, ["x"]);
|
||||
return A;
|
||||
}());
|
||||
var B = (function (_super) {
|
||||
|
@ -102,5 +103,6 @@ var B = (function (_super) {
|
|||
});
|
||||
});
|
||||
};
|
||||
__names(B.prototype, ["simple", "advanced"]);
|
||||
return B;
|
||||
}(A));
|
||||
|
|
|
@ -8,11 +8,26 @@ class c4 { public foo() { } }
|
|||
enum c4 { One } // error
|
||||
|
||||
//// [augmentedTypesClass.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
//// class then var
|
||||
var c1 = (function () {
|
||||
function c1() {
|
||||
}
|
||||
c1.prototype.foo = function () { };
|
||||
__names(c1.prototype, ["foo"]);
|
||||
return c1;
|
||||
}());
|
||||
var c1 = 1; // error
|
||||
|
@ -21,6 +36,7 @@ var c4 = (function () {
|
|||
function c4() {
|
||||
}
|
||||
c4.prototype.foo = function () { };
|
||||
__names(c4.prototype, ["foo"]);
|
||||
return c4;
|
||||
}());
|
||||
(function (c4) {
|
||||
|
|
|
@ -32,6 +32,20 @@ class c44 {
|
|||
|
||||
//// [augmentedTypesClass2.js]
|
||||
// Checking class with other things in type space not value space
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
// class then interface
|
||||
var c11 = (function () {
|
||||
function c11() {
|
||||
|
@ -39,6 +53,7 @@ var c11 = (function () {
|
|||
c11.prototype.foo = function () {
|
||||
return 1;
|
||||
};
|
||||
__names(c11.prototype, ["foo"]);
|
||||
return c11;
|
||||
}());
|
||||
// class then class - covered
|
||||
|
@ -49,6 +64,7 @@ var c33 = (function () {
|
|||
c33.prototype.foo = function () {
|
||||
return 1;
|
||||
};
|
||||
__names(c33.prototype, ["foo"]);
|
||||
return c33;
|
||||
}());
|
||||
(function (c33) {
|
||||
|
@ -62,5 +78,6 @@ var c44 = (function () {
|
|||
c44.prototype.foo = function () {
|
||||
return 1;
|
||||
};
|
||||
__names(c44.prototype, ["foo"]);
|
||||
return c44;
|
||||
}());
|
||||
|
|
|
@ -5,11 +5,26 @@ function c2() { } // error
|
|||
var c2 = () => { }
|
||||
|
||||
//// [augmentedTypesClass2a.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
//// class then function
|
||||
var c2 = (function () {
|
||||
function c2() {
|
||||
}
|
||||
c2.prototype.foo = function () { };
|
||||
__names(c2.prototype, ["foo"]);
|
||||
return c2;
|
||||
}()); // error
|
||||
function c2() { } // error
|
||||
|
|
|
@ -14,17 +14,33 @@ class c5c { public foo() { } }
|
|||
//import c5c = require('');
|
||||
|
||||
//// [augmentedTypesClass3.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
// class then module
|
||||
var c5 = (function () {
|
||||
function c5() {
|
||||
}
|
||||
c5.prototype.foo = function () { };
|
||||
__names(c5.prototype, ["foo"]);
|
||||
return c5;
|
||||
}());
|
||||
var c5a = (function () {
|
||||
function c5a() {
|
||||
}
|
||||
c5a.prototype.foo = function () { };
|
||||
__names(c5a.prototype, ["foo"]);
|
||||
return c5a;
|
||||
}());
|
||||
(function (c5a) {
|
||||
|
@ -34,6 +50,7 @@ var c5b = (function () {
|
|||
function c5b() {
|
||||
}
|
||||
c5b.prototype.foo = function () { };
|
||||
__names(c5b.prototype, ["foo"]);
|
||||
return c5b;
|
||||
}());
|
||||
(function (c5b) {
|
||||
|
@ -44,6 +61,7 @@ var c5c = (function () {
|
|||
function c5c() {
|
||||
}
|
||||
c5c.prototype.foo = function () { };
|
||||
__names(c5c.prototype, ["foo"]);
|
||||
return c5c;
|
||||
}());
|
||||
//import c5c = require('');
|
||||
|
|
|
@ -5,16 +5,32 @@ class c3 { public bar() { } } // error
|
|||
|
||||
|
||||
//// [augmentedTypesClass4.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
//// class then class
|
||||
var c3 = (function () {
|
||||
function c3() {
|
||||
}
|
||||
c3.prototype.foo = function () { };
|
||||
__names(c3.prototype, ["foo"]);
|
||||
return c3;
|
||||
}()); // error
|
||||
var c3 = (function () {
|
||||
function c3() {
|
||||
}
|
||||
c3.prototype.bar = function () { };
|
||||
__names(c3.prototype, ["bar"]);
|
||||
return c3;
|
||||
}()); // error
|
||||
|
|
|
@ -36,6 +36,20 @@ module e6b { export var y = 2; } // should be error
|
|||
//import e7 = require(''); // should be error
|
||||
|
||||
//// [augmentedTypesEnum.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
// enum then var
|
||||
var e1111;
|
||||
(function (e1111) {
|
||||
|
@ -62,6 +76,7 @@ var e4 = (function () {
|
|||
function e4() {
|
||||
}
|
||||
e4.prototype.foo = function () { };
|
||||
__names(e4.prototype, ["foo"]);
|
||||
return e4;
|
||||
}()); // error
|
||||
// enum then enum
|
||||
|
|
|
@ -20,6 +20,20 @@ class e2 { // error
|
|||
//enum then import - covered
|
||||
|
||||
//// [augmentedTypesEnum2.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
// enum then interface
|
||||
var e1;
|
||||
(function (e1) {
|
||||
|
@ -38,6 +52,7 @@ var e2 = (function () {
|
|||
e2.prototype.foo = function () {
|
||||
return 1;
|
||||
};
|
||||
__names(e2.prototype, ["foo"]);
|
||||
return e2;
|
||||
}());
|
||||
//enum then enum - covered
|
||||
|
|
|
@ -4,6 +4,20 @@ class c5 { public foo() { } }
|
|||
module c5 { } // should be ok everywhere
|
||||
|
||||
//// [augmentedTypesExternalModule1.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
@ -12,6 +26,7 @@ define(["require", "exports"], function (require, exports) {
|
|||
function c5() {
|
||||
}
|
||||
c5.prototype.foo = function () { };
|
||||
__names(c5.prototype, ["foo"]);
|
||||
return c5;
|
||||
}());
|
||||
});
|
||||
|
|
|
@ -39,6 +39,20 @@ module y5c { export interface I { foo(): void } } // should be an error
|
|||
//import y6 = require('');
|
||||
|
||||
//// [augmentedTypesFunction.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
// function then var
|
||||
function y1() { } // error
|
||||
var y1 = 1; // error
|
||||
|
@ -59,6 +73,7 @@ var y3a = (function () {
|
|||
function y3a() {
|
||||
}
|
||||
y3a.prototype.foo = function () { };
|
||||
__names(y3a.prototype, ["foo"]);
|
||||
return y3a;
|
||||
}()); // error
|
||||
// function then enum
|
||||
|
|
|
@ -35,12 +35,27 @@ interface i4 {
|
|||
|
||||
//// [augmentedTypesInterface.js]
|
||||
// interface then interface
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var i2 = (function () {
|
||||
function i2() {
|
||||
}
|
||||
i2.prototype.bar = function () {
|
||||
return 1;
|
||||
};
|
||||
__names(i2.prototype, ["bar"]);
|
||||
return i2;
|
||||
}());
|
||||
var i3;
|
||||
|
|
|
@ -98,6 +98,20 @@ module m6 { export var y = 2; }
|
|||
|
||||
|
||||
//// [augmentedTypesModules.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var m1 = 1; // Should be allowed
|
||||
var m1a;
|
||||
(function (m1a) {
|
||||
|
@ -116,6 +130,7 @@ var m1d;
|
|||
function I() {
|
||||
}
|
||||
I.prototype.foo = function () { };
|
||||
__names(I.prototype, ["foo"]);
|
||||
return I;
|
||||
}());
|
||||
m1d.I = I;
|
||||
|
@ -150,6 +165,7 @@ function m2g() { }
|
|||
function C() {
|
||||
}
|
||||
C.prototype.foo = function () { };
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
m2g.C = C;
|
||||
|
@ -167,12 +183,14 @@ var m3a = (function () {
|
|||
function m3a() {
|
||||
}
|
||||
m3a.prototype.foo = function () { };
|
||||
__names(m3a.prototype, ["foo"]);
|
||||
return m3a;
|
||||
}()); // error, class isn't ambient or declared before the module
|
||||
var m3b = (function () {
|
||||
function m3b() {
|
||||
}
|
||||
m3b.prototype.foo = function () { };
|
||||
__names(m3b.prototype, ["foo"]);
|
||||
return m3b;
|
||||
}());
|
||||
(function (m3b) {
|
||||
|
@ -182,6 +200,7 @@ var m3c = (function () {
|
|||
function m3c() {
|
||||
}
|
||||
m3c.prototype.foo = function () { };
|
||||
__names(m3c.prototype, ["foo"]);
|
||||
return m3c;
|
||||
}());
|
||||
(function (m3c) {
|
||||
|
@ -201,6 +220,7 @@ var m3g;
|
|||
function C() {
|
||||
}
|
||||
C.prototype.foo = function () { };
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
m3g.C = C;
|
||||
|
@ -232,6 +252,7 @@ var m4d;
|
|||
function C() {
|
||||
}
|
||||
C.prototype.foo = function () { };
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
})(m4d || (m4d = {}));
|
||||
|
|
|
@ -29,6 +29,20 @@ module m2g { export class C { foo() { } } }
|
|||
|
||||
|
||||
//// [augmentedTypesModules2.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
function m2() { }
|
||||
; // ok since the module is not instantiated
|
||||
var m2a;
|
||||
|
@ -63,6 +77,7 @@ function m2g() { }
|
|||
function C() {
|
||||
}
|
||||
C.prototype.foo = function () { };
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
m2g.C = C;
|
||||
|
|
|
@ -7,6 +7,20 @@ module m3a { var y = 2; }
|
|||
class m3a { foo() { } } // error, class isn't ambient or declared before the module
|
||||
|
||||
//// [augmentedTypesModules3.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var m3 = (function () {
|
||||
function m3() {
|
||||
}
|
||||
|
@ -20,5 +34,6 @@ var m3a = (function () {
|
|||
function m3a() {
|
||||
}
|
||||
m3a.prototype.foo = function () { };
|
||||
__names(m3a.prototype, ["foo"]);
|
||||
return m3a;
|
||||
}()); // error, class isn't ambient or declared before the module
|
||||
|
|
|
@ -19,10 +19,25 @@ module m3g { export class C { foo() { } } }
|
|||
|
||||
|
||||
//// [augmentedTypesModules3b.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var m3b = (function () {
|
||||
function m3b() {
|
||||
}
|
||||
m3b.prototype.foo = function () { };
|
||||
__names(m3b.prototype, ["foo"]);
|
||||
return m3b;
|
||||
}());
|
||||
(function (m3b) {
|
||||
|
@ -32,6 +47,7 @@ var m3c = (function () {
|
|||
function m3c() {
|
||||
}
|
||||
m3c.prototype.foo = function () { };
|
||||
__names(m3c.prototype, ["foo"]);
|
||||
return m3c;
|
||||
}());
|
||||
(function (m3c) {
|
||||
|
@ -51,6 +67,7 @@ var m3g;
|
|||
function C() {
|
||||
}
|
||||
C.prototype.foo = function () { };
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
m3g.C = C;
|
||||
|
|
|
@ -23,6 +23,20 @@ module m5 { export interface I { foo(): void } } // should already be reasonably
|
|||
|
||||
|
||||
//// [augmentedTypesModules4.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var m4;
|
||||
(function (m4) {
|
||||
})(m4 || (m4 = {}));
|
||||
|
@ -50,6 +64,7 @@ var m4d;
|
|||
function C() {
|
||||
}
|
||||
C.prototype.foo = function () { };
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
})(m4d || (m4d = {}));
|
||||
|
|
|
@ -37,6 +37,20 @@ module x6b { export var y = 2; } // error
|
|||
|
||||
|
||||
//// [augmentedTypesVar.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
// var then var
|
||||
var x1 = 1;
|
||||
var x1 = 2;
|
||||
|
@ -57,6 +71,7 @@ var x4a = (function () {
|
|||
function x4a() {
|
||||
}
|
||||
x4a.prototype.foo = function () { };
|
||||
__names(x4a.prototype, ["foo"]);
|
||||
return x4a;
|
||||
}()); // error
|
||||
// var then enum
|
||||
|
|
|
@ -32,6 +32,20 @@ a.baz();
|
|||
|
||||
|
||||
//// [autoLift2.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var A = (function () {
|
||||
function A() {
|
||||
this.foo;
|
||||
|
@ -46,6 +60,7 @@ var A = (function () {
|
|||
[1, 2].forEach(function (p) { return _this.foo; });
|
||||
[1, 2].forEach(function (p) { return _this.bar; });
|
||||
};
|
||||
__names(A.prototype, ["baz"]);
|
||||
return A;
|
||||
}());
|
||||
var a = new A();
|
||||
|
|
|
@ -24,6 +24,20 @@ class Point3D extends Point {
|
|||
|
||||
|
||||
//// [autolift4.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
|
@ -42,6 +56,7 @@ var Point = (function () {
|
|||
Point.prototype.getDist = function () {
|
||||
return Math.sqrt(this.x * this.x + this.y * this.y);
|
||||
};
|
||||
__names(Point.prototype, ["getDist"]);
|
||||
Point.origin = new Point(0, 0);
|
||||
return Point;
|
||||
}());
|
||||
|
@ -55,5 +70,6 @@ var Point3D = (function (_super) {
|
|||
Point3D.prototype.getDist = function () {
|
||||
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.m);
|
||||
};
|
||||
__names(Point3D.prototype, ["getDist"]);
|
||||
return Point3D;
|
||||
}(Point));
|
||||
|
|
|
@ -20,6 +20,20 @@ var N=new f(); // ok with void fn
|
|||
|
||||
|
||||
//// [avoid.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
function f() {
|
||||
var x = 1;
|
||||
}
|
||||
|
@ -32,6 +46,7 @@ var C = (function () {
|
|||
}
|
||||
C.prototype.g = function () {
|
||||
};
|
||||
__names(C.prototype, ["g"]);
|
||||
return C;
|
||||
}());
|
||||
var z = new C().g(); // error void fn
|
||||
|
|
|
@ -40,6 +40,20 @@ var __extends = (this && this.__extends) || (function () {
|
|||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var C = (function () {
|
||||
function C(x, y) {
|
||||
}
|
||||
|
@ -60,6 +74,7 @@ var ELocVar = (function (_super) {
|
|||
ELocVar.prototype.m = function () {
|
||||
var loc = 10;
|
||||
};
|
||||
__names(ELocVar.prototype, ["m"]);
|
||||
return ELocVar;
|
||||
}(C));
|
||||
var D = (function (_super) {
|
||||
|
|
|
@ -17,6 +17,20 @@ interface Base2 {
|
|||
|
||||
|
||||
//// [baseTypeAfterDerivedType.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Derived2 = (function () {
|
||||
function Derived2() {
|
||||
}
|
||||
|
@ -26,5 +40,6 @@ var Derived2 = (function () {
|
|||
args[_i] = arguments[_i];
|
||||
}
|
||||
};
|
||||
__names(Derived2.prototype, ["method"]);
|
||||
return Derived2;
|
||||
}());
|
||||
|
|
|
@ -38,6 +38,20 @@ var __extends = (this && this.__extends) || (function () {
|
|||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var CBaseBase = (function () {
|
||||
function CBaseBase(x) {
|
||||
}
|
||||
|
@ -54,6 +68,7 @@ var Parameter = (function () {
|
|||
function Parameter() {
|
||||
}
|
||||
Parameter.prototype.method = function (t) { };
|
||||
__names(Parameter.prototype, ["method"]);
|
||||
return Parameter;
|
||||
}());
|
||||
var Wrapper = (function () {
|
||||
|
@ -73,5 +88,6 @@ var C = (function (_super) {
|
|||
new CBase(this); // Should not error, parameter is of type Parameter<Wrapper<T1>>
|
||||
};
|
||||
C.prototype.method = function (t) { };
|
||||
__names(C.prototype, ["works", "alsoWorks", "method"]);
|
||||
return C;
|
||||
}(CBase));
|
||||
|
|
|
@ -20,6 +20,20 @@ module Test {
|
|||
|
||||
|
||||
//// [binopAssignmentShouldHaveType.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
"use strict";
|
||||
var Test;
|
||||
(function (Test) {
|
||||
|
@ -35,6 +49,7 @@ var Test;
|
|||
console.log(name);
|
||||
}
|
||||
};
|
||||
__names(Bug.prototype, ["getName", "bug"]);
|
||||
return Bug;
|
||||
}());
|
||||
Test.Bug = Bug;
|
||||
|
|
|
@ -10,6 +10,20 @@ class c {
|
|||
}
|
||||
|
||||
//// [blockScopedFunctionDeclarationInStrictClass.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var c = (function () {
|
||||
function c() {
|
||||
}
|
||||
|
@ -20,5 +34,6 @@ var c = (function () {
|
|||
}
|
||||
foo(); // not ok
|
||||
};
|
||||
__names(c.prototype, ["method"]);
|
||||
return c;
|
||||
}());
|
||||
|
|
|
@ -104,6 +104,20 @@ function foo14() {
|
|||
}
|
||||
|
||||
//// [blockScopedVariablesUseBeforeDef.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
function foo0() {
|
||||
var a = x;
|
||||
var x;
|
||||
|
@ -121,6 +135,7 @@ function foo3() {
|
|||
function X() {
|
||||
}
|
||||
X.prototype.m = function () { return x; };
|
||||
__names(X.prototype, ["m"]);
|
||||
return X;
|
||||
}());
|
||||
var x;
|
||||
|
@ -130,6 +145,7 @@ function foo4() {
|
|||
function class_1() {
|
||||
}
|
||||
class_1.prototype.m = function () { return x; };
|
||||
__names(class_1.prototype, ["m"]);
|
||||
return class_1;
|
||||
}());
|
||||
var x;
|
||||
|
|
|
@ -47,6 +47,20 @@ var r7b = i2.f<number, string, number>(1, '');
|
|||
//// [callGenericFunctionWithIncorrectNumberOfTypeArguments.js]
|
||||
// type parameter lists must exactly match type argument lists
|
||||
// all of these invocations are errors
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
function f(x, y) { return null; }
|
||||
var r1 = f(1, '');
|
||||
var r1b = f(1, '');
|
||||
|
@ -62,6 +76,7 @@ var C = (function () {
|
|||
C.prototype.f = function (x, y) {
|
||||
return null;
|
||||
};
|
||||
__names(C.prototype, ["f"]);
|
||||
return C;
|
||||
}());
|
||||
var r4 = (new C()).f(1, '');
|
||||
|
@ -75,6 +90,7 @@ var C2 = (function () {
|
|||
C2.prototype.f = function (x, y) {
|
||||
return null;
|
||||
};
|
||||
__names(C2.prototype, ["f"]);
|
||||
return C2;
|
||||
}());
|
||||
var r6 = (new C2()).f(1, '');
|
||||
|
|
|
@ -38,6 +38,20 @@ var r7 = i2.f(1);
|
|||
|
||||
//// [callGenericFunctionWithZeroTypeArguments.js]
|
||||
// valid invocations of generic functions with no explicit type arguments provided
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
function f(x) { return null; }
|
||||
var r = f(1);
|
||||
var f2 = function (x) { return null; };
|
||||
|
@ -50,6 +64,7 @@ var C = (function () {
|
|||
C.prototype.f = function (x) {
|
||||
return null;
|
||||
};
|
||||
__names(C.prototype, ["f"]);
|
||||
return C;
|
||||
}());
|
||||
var r4 = (new C()).f(1);
|
||||
|
@ -61,6 +76,7 @@ var C2 = (function () {
|
|||
C2.prototype.f = function (x) {
|
||||
return null;
|
||||
};
|
||||
__names(C2.prototype, ["f"]);
|
||||
return C2;
|
||||
}());
|
||||
var r6 = (new C2()).f(1);
|
||||
|
|
|
@ -46,6 +46,20 @@ var r8 = a2<number>();
|
|||
//// [callNonGenericFunctionWithTypeArguments.js]
|
||||
// it is always illegal to provide type arguments to a non-generic function
|
||||
// all invocations here are illegal
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
function f(x) { return null; }
|
||||
var r = f(1);
|
||||
var f2 = function (x) { return null; };
|
||||
|
@ -58,6 +72,7 @@ var C = (function () {
|
|||
C.prototype.f = function (x) {
|
||||
return null;
|
||||
};
|
||||
__names(C.prototype, ["f"]);
|
||||
return C;
|
||||
}());
|
||||
var r4 = (new C()).f(1);
|
||||
|
@ -69,6 +84,7 @@ var C2 = (function () {
|
|||
C2.prototype.f = function (x) {
|
||||
return null;
|
||||
};
|
||||
__names(C2.prototype, ["f"]);
|
||||
return C2;
|
||||
}());
|
||||
var r6 = (new C2()).f(1);
|
||||
|
|
|
@ -12,12 +12,27 @@ var r: string = c['foo'](1);
|
|||
var r2: number = c['foo']('');
|
||||
|
||||
//// [callOverloadViaElementAccessExpression.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.foo = function (x) {
|
||||
return null;
|
||||
};
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
var c = new C();
|
||||
|
|
|
@ -18,11 +18,26 @@ f1.bar1();
|
|||
Foo();
|
||||
|
||||
//// [callOverloads1.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Foo = (function () {
|
||||
function Foo(x) {
|
||||
// WScript.Echo("Constructor function has executed");
|
||||
}
|
||||
Foo.prototype.bar1 = function () { };
|
||||
__names(Foo.prototype, ["bar1"]);
|
||||
return Foo;
|
||||
}());
|
||||
function F1(a) { return a; }
|
||||
|
|
|
@ -24,11 +24,26 @@ Foo();
|
|||
|
||||
|
||||
//// [callOverloads2.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Foo = (function () {
|
||||
function Foo(x) {
|
||||
// WScript.Echo("Constructor function has executed");
|
||||
}
|
||||
Foo.prototype.bar1 = function () { };
|
||||
__names(Foo.prototype, ["bar1"]);
|
||||
return Foo;
|
||||
}());
|
||||
function F1(s) { return s; } // error
|
||||
|
|
|
@ -18,11 +18,26 @@ Foo("s");
|
|||
|
||||
|
||||
//// [callOverloads3.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Foo = (function () {
|
||||
function Foo(x) {
|
||||
// WScript.Echo("Constructor function has executed");
|
||||
}
|
||||
Foo.prototype.bar1 = function () { };
|
||||
__names(Foo.prototype, ["bar1"]);
|
||||
return Foo;
|
||||
}());
|
||||
//class Foo(s: String);
|
||||
|
|
|
@ -18,11 +18,26 @@ Foo("s");
|
|||
|
||||
|
||||
//// [callOverloads4.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Foo = (function () {
|
||||
function Foo(x) {
|
||||
// WScript.Echo("Constructor function has executed");
|
||||
}
|
||||
Foo.prototype.bar1 = function () { };
|
||||
__names(Foo.prototype, ["bar1"]);
|
||||
return Foo;
|
||||
}());
|
||||
var f1 = new Foo("hey");
|
||||
|
|
|
@ -20,11 +20,26 @@ Foo("s");
|
|||
|
||||
|
||||
//// [callOverloads5.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Foo = (function () {
|
||||
function Foo(x) {
|
||||
// WScript.Echo("Constructor function has executed");
|
||||
}
|
||||
Foo.prototype.bar1 = function (a) { };
|
||||
__names(Foo.prototype, ["bar1"]);
|
||||
return Foo;
|
||||
}());
|
||||
//class Foo(s: String);
|
||||
|
|
|
@ -57,6 +57,20 @@ b.b(1);
|
|||
|
||||
//// [callSignatureWithOptionalParameterAndInitializer.js]
|
||||
// Optional parameters cannot also have initializer expressions, these are all errors
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
function foo(x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
}
|
||||
|
@ -78,6 +92,7 @@ var C = (function () {
|
|||
C.prototype.foo = function (x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
};
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
var c;
|
||||
|
|
|
@ -40,6 +40,20 @@ var b = {
|
|||
|
||||
//// [callSignaturesWithAccessibilityModifiersOnParameters.js]
|
||||
// Call signature parameters do not allow accessibility modifiers
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
function foo(x, y) { }
|
||||
var f = function foo(x, y) { };
|
||||
var f2 = function (x, y) { };
|
||||
|
@ -56,6 +70,7 @@ var C = (function () {
|
|||
C.prototype.foo = function (x, y) { };
|
||||
C.prototype.foo2 = function (x, y) { };
|
||||
C.prototype.foo3 = function (x, y) { };
|
||||
__names(C.prototype, ["foo", "foo2", "foo3"]);
|
||||
return C;
|
||||
}());
|
||||
var a;
|
||||
|
|
|
@ -40,6 +40,20 @@ var b = {
|
|||
|
||||
//// [callSignaturesWithDuplicateParameters.js]
|
||||
// Duplicate parameter names are always an error
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
function foo(x, x) { }
|
||||
var f = function foo(x, x) { };
|
||||
var f2 = function (x, x) { };
|
||||
|
@ -56,6 +70,7 @@ var C = (function () {
|
|||
C.prototype.foo = function (x, x) { };
|
||||
C.prototype.foo2 = function (x, x) { };
|
||||
C.prototype.foo3 = function (x, x) { };
|
||||
__names(C.prototype, ["foo", "foo2", "foo3"]);
|
||||
return C;
|
||||
}());
|
||||
var a;
|
||||
|
|
|
@ -57,6 +57,20 @@ b.b(1);
|
|||
|
||||
//// [callSignaturesWithOptionalParameters.js]
|
||||
// Optional parameters should be valid in all the below casts
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
function foo(x) { }
|
||||
var f = function foo(x) { };
|
||||
var f2 = function (x, y) { };
|
||||
|
@ -70,6 +84,7 @@ var C = (function () {
|
|||
function C() {
|
||||
}
|
||||
C.prototype.foo = function (x) { };
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
var c;
|
||||
|
|
|
@ -61,6 +61,20 @@ a.foo(1, 2, 3);
|
|||
|
||||
//// [callSignaturesWithOptionalParameters2.js]
|
||||
// Optional parameters should be valid in all the below casts
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
function foo(x) { }
|
||||
foo(1);
|
||||
foo();
|
||||
|
@ -72,6 +86,7 @@ var C = (function () {
|
|||
}
|
||||
C.prototype.foo = function (x) { };
|
||||
C.prototype.foo2 = function (x, y) { };
|
||||
__names(C.prototype, ["foo", "foo2"]);
|
||||
return C;
|
||||
}());
|
||||
var c;
|
||||
|
|
|
@ -59,6 +59,20 @@ b.b(1);
|
|||
|
||||
//// [callSignaturesWithParameterInitializers.js]
|
||||
// Optional parameters allow initializers only in implementation signatures
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
function foo(x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
}
|
||||
|
@ -80,6 +94,7 @@ var C = (function () {
|
|||
C.prototype.foo = function (x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
};
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
var c;
|
||||
|
|
|
@ -28,6 +28,20 @@ b.foo(1);
|
|||
//// [callSignaturesWithParameterInitializers2.js]
|
||||
// Optional parameters allow initializers only in implementation signatures
|
||||
// All the below declarations are errors
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
function foo(x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
}
|
||||
|
@ -39,6 +53,7 @@ var C = (function () {
|
|||
C.prototype.foo = function (x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
};
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
var c;
|
||||
|
|
|
@ -59,6 +59,20 @@ class D extends C {
|
|||
|
||||
|
||||
//// [callWithSpread.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
|
@ -113,6 +127,7 @@ var C = (function () {
|
|||
z[_i - 2] = arguments[_i];
|
||||
}
|
||||
};
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
var D = (function (_super) {
|
||||
|
@ -126,6 +141,7 @@ var D = (function (_super) {
|
|||
_super.prototype.foo.call(this, 1, 2);
|
||||
_super.prototype.foo.apply(this, [1, 2].concat(a));
|
||||
};
|
||||
__names(D.prototype, ["foo"]);
|
||||
return D;
|
||||
}(C));
|
||||
var _a, _b, _c, _d, _e, _f, _g;
|
||||
|
|
|
@ -12,6 +12,20 @@ class B extends A {
|
|||
}
|
||||
|
||||
//// [captureSuperPropertyAccessInSuperCall01.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
|
@ -26,6 +40,7 @@ var A = (function () {
|
|||
function A(f) {
|
||||
}
|
||||
A.prototype.blah = function () { return ""; };
|
||||
__names(A.prototype, ["blah"]);
|
||||
return A;
|
||||
}());
|
||||
var B = (function (_super) {
|
||||
|
|
|
@ -19,6 +19,20 @@ var __extends = (this && this.__extends) || (function () {
|
|||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var A = (function () {
|
||||
function A(p) {
|
||||
}
|
||||
|
@ -31,5 +45,6 @@ var B = (function (_super) {
|
|||
return _this;
|
||||
}
|
||||
B.prototype.someMethod = function () { };
|
||||
__names(B.prototype, ["someMethod"]);
|
||||
return B;
|
||||
}(A));
|
||||
|
|
|
@ -46,6 +46,20 @@ class B {
|
|||
}
|
||||
|
||||
//// [capturedLetConstInLoop10.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
|
@ -100,6 +114,7 @@ var A = (function () {
|
|||
_loop_4(x);
|
||||
}
|
||||
};
|
||||
__names(A.prototype, ["foo", "bar", "baz", "baz2"]);
|
||||
return A;
|
||||
}());
|
||||
var B = (function () {
|
||||
|
@ -120,5 +135,6 @@ var B = (function () {
|
|||
};
|
||||
B.prototype.bar = function (a) {
|
||||
};
|
||||
__names(B.prototype, ["foo", "bar"]);
|
||||
return B;
|
||||
}());
|
||||
|
|
|
@ -23,6 +23,20 @@ class Main {
|
|||
new Main();
|
||||
|
||||
//// [capturedLetConstInLoop13.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Main = (function () {
|
||||
function Main() {
|
||||
this.register("a", "b", "c");
|
||||
|
@ -47,6 +61,7 @@ var Main = (function () {
|
|||
};
|
||||
Main.prototype.bar = function (a) { };
|
||||
Main.prototype.foo = function (name) { };
|
||||
__names(Main.prototype, ["register", "bar", "foo"]);
|
||||
return Main;
|
||||
}());
|
||||
new Main();
|
||||
|
|
|
@ -139,6 +139,20 @@ function foo3 () {
|
|||
}
|
||||
|
||||
//// [capturedLetConstInLoop9.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var _loop_1 = function (x) {
|
||||
var x_1;
|
||||
(function () { return x_1; });
|
||||
|
@ -170,6 +184,7 @@ var _loop_1 = function (x) {
|
|||
A.prototype.m = function () {
|
||||
return x_1 + 1;
|
||||
};
|
||||
__names(A.prototype, ["m"]);
|
||||
return A;
|
||||
}());
|
||||
};
|
||||
|
@ -284,6 +299,7 @@ var C = (function () {
|
|||
_loop_5(i);
|
||||
}
|
||||
};
|
||||
__names(C.prototype, ["foo"]);
|
||||
return C;
|
||||
}());
|
||||
function foo3() {
|
||||
|
|
|
@ -20,6 +20,20 @@ class C extends B {
|
|||
(new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A);
|
||||
|
||||
//// [chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
|
@ -37,6 +51,7 @@ var Chain = (function () {
|
|||
Chain.prototype.then = function (cb) {
|
||||
return null;
|
||||
};
|
||||
__names(Chain.prototype, ["then"]);
|
||||
return Chain;
|
||||
}());
|
||||
var A = (function () {
|
||||
|
|
|
@ -42,6 +42,20 @@ class Chain2<T extends I> {
|
|||
}
|
||||
|
||||
//// [chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Chain = (function () {
|
||||
function Chain(value) {
|
||||
this.value = value;
|
||||
|
@ -58,6 +72,7 @@ var Chain = (function () {
|
|||
(new Chain(s)).then(function (ss) { return s; }).then(function (ss) { return s; }).then(function (ss) { return s; });
|
||||
return null;
|
||||
};
|
||||
__names(Chain.prototype, ["then"]);
|
||||
return Chain;
|
||||
}());
|
||||
var Chain2 = (function () {
|
||||
|
@ -77,5 +92,6 @@ var Chain2 = (function () {
|
|||
(new Chain2(i)).then(function (ii) { return s; }).then(function (ss) { return s; }).then(function (ss) { return s; }).then(function (ss) { return s; }).value.x = "";
|
||||
return null;
|
||||
};
|
||||
__names(Chain2.prototype, ["then"]);
|
||||
return Chain2;
|
||||
}());
|
||||
|
|
|
@ -23,12 +23,27 @@ let k3 = <div> {1} {"That is a number"} </div>;
|
|||
let k4 = <Button> <h2> Hello </h2> </Button>;
|
||||
|
||||
//// [file.jsx]
|
||||
var __names = (this && this.__names) || (function() {
|
||||
var name = Object.defineProperty ? (function(proto, name) {
|
||||
Object.defineProperty(proto[name], 'name', {
|
||||
value: name, configurable: true
|
||||
});
|
||||
}) : (function(proto, name) {
|
||||
proto[name].name = name;
|
||||
});
|
||||
return function (proto, keys) {
|
||||
for (var i = keys.length - 1; i >= 0; i--) {
|
||||
name(proto, keys[i])
|
||||
}
|
||||
};
|
||||
})();
|
||||
var Button = (function () {
|
||||
function Button() {
|
||||
}
|
||||
Button.prototype.render = function () {
|
||||
return (<div>My Button</div>);
|
||||
};
|
||||
__names(Button.prototype, ["render"]);
|
||||
return Button;
|
||||
}());
|
||||
// OK
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue