mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Emit comments for function and method declarations
This commit is contained in:
@@ -1166,11 +1166,18 @@ module ts {
|
||||
|
||||
function emitFunctionDeclaration(node: FunctionDeclaration) {
|
||||
if (!node.body) return;
|
||||
if (node.kind !== SyntaxKind.Method) {
|
||||
// Methods will emit the comments as part of emitting method declaration
|
||||
emitLeadingComments(node);
|
||||
}
|
||||
write("function ");
|
||||
if (node.kind === SyntaxKind.FunctionDeclaration || (node.kind === SyntaxKind.FunctionExpression && node.name)) {
|
||||
emit(node.name);
|
||||
}
|
||||
emitSignatureAndBody(node);
|
||||
if (node.kind !== SyntaxKind.Method) {
|
||||
emitTrailingComments(node);
|
||||
}
|
||||
}
|
||||
|
||||
function emitCaptureThisForNodeIfNecessary(node: Node): void {
|
||||
@@ -1322,6 +1329,7 @@ module ts {
|
||||
if (member.kind === SyntaxKind.Method) {
|
||||
if (!(<MethodDeclaration>member).body) return;
|
||||
writeLine();
|
||||
emitLeadingComments(member);
|
||||
emitStart(member);
|
||||
emitStart((<MethodDeclaration>member).name);
|
||||
emitNode(node.name);
|
||||
@@ -1336,6 +1344,7 @@ module ts {
|
||||
emitEnd(member);
|
||||
emitEnd(member);
|
||||
write(";");
|
||||
emitTrailingComments(member);
|
||||
}
|
||||
else if (member.kind === SyntaxKind.GetAccessor || member.kind === SyntaxKind.SetAccessor) {
|
||||
var accessors = getAllAccessorDeclarations(node, <AccessorDeclaration>member);
|
||||
|
||||
+1
@@ -25,6 +25,7 @@ var clodule = (function () {
|
||||
})();
|
||||
var clodule;
|
||||
(function (clodule) {
|
||||
// error: duplicate identifier expected
|
||||
function fn(x, y) {
|
||||
return x;
|
||||
}
|
||||
|
||||
+1
@@ -25,6 +25,7 @@ var clodule = (function () {
|
||||
})();
|
||||
var clodule;
|
||||
(function (clodule) {
|
||||
// error: duplicate identifier expected
|
||||
function fn(x, y) {
|
||||
return x;
|
||||
}
|
||||
|
||||
+1
@@ -26,6 +26,7 @@ var clodule = (function () {
|
||||
})();
|
||||
var clodule;
|
||||
(function (clodule) {
|
||||
// error: duplicate identifier expected
|
||||
function fn(x, y) {
|
||||
return clodule.sfn('a');
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ var A;
|
||||
//// [function.js]
|
||||
var A;
|
||||
(function (A) {
|
||||
// duplicate identifier error
|
||||
function Point() {
|
||||
return { x: 0, y: 0 };
|
||||
}
|
||||
@@ -52,6 +53,7 @@ var B;
|
||||
Point.Origin = { x: 0, y: 0 };
|
||||
})(B.Point || (B.Point = {}));
|
||||
var Point = B.Point;
|
||||
// duplicate identifier error
|
||||
function Point() {
|
||||
return { x: 0, y: 0 };
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ var r10 = null + foo();
|
||||
var r11 = null + (() => { });
|
||||
|
||||
//// [additionOperatorWithNullValueAndInvalidOperator.js]
|
||||
// If one operand is the null or undefined value, it is treated as having the type of the other operand.
|
||||
function foo() {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ var r10 = undefined + foo();
|
||||
var r11 = undefined + (() => { });
|
||||
|
||||
//// [additionOperatorWithUndefinedValueAndInvalidOperands.js]
|
||||
// If one operand is the null or undefined value, it is treated as having the type of the other operand.
|
||||
function foo() {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ function foo<T>(t: T) {
|
||||
}
|
||||
|
||||
//// [arithmeticOperatorWithTypeParameter.js]
|
||||
// type parameter type is not valid for arithmetic operand
|
||||
function foo(t) {
|
||||
var a;
|
||||
var b;
|
||||
|
||||
@@ -123,14 +123,17 @@ var MyClass = (function () {
|
||||
var arrrr = function () { return function (m) { return function () { return function (n) { return m + n; }; }; }; };
|
||||
var e = arrrr()(3)()(4);
|
||||
var e;
|
||||
// Arrow function used in arrow function used in function
|
||||
function someFn() {
|
||||
var arr = function (n) { return function (p) { return p * n; }; };
|
||||
arr(3)(4).toExponential();
|
||||
}
|
||||
// Arrow function used in function
|
||||
function someOtherFn() {
|
||||
var arr = function (n) { return '' + n; };
|
||||
arr(4).charAt(0);
|
||||
}
|
||||
// Arrow function used in nested function in function
|
||||
function outerFn() {
|
||||
function innerFn() {
|
||||
var arrowFn = function () {
|
||||
@@ -148,6 +151,7 @@ var f = function (n) {
|
||||
};
|
||||
var g = f('')();
|
||||
var g;
|
||||
// Arrow function used in nested function in arrow function in nested function
|
||||
function someOuterFn() {
|
||||
var arr = function (n) {
|
||||
function innerFn() {
|
||||
@@ -159,6 +163,7 @@ function someOuterFn() {
|
||||
}
|
||||
var h = someOuterFn()('')()();
|
||||
h.toExponential();
|
||||
// Arrow function used in try/catch/finally in function
|
||||
function tryCatchFn() {
|
||||
var _this = this;
|
||||
try {
|
||||
|
||||
+1
@@ -36,6 +36,7 @@ x = '';
|
||||
x = [''];
|
||||
x = 4;
|
||||
x = {};
|
||||
// Should work
|
||||
function f() {
|
||||
}
|
||||
;
|
||||
|
||||
+1
@@ -36,6 +36,7 @@ x = '';
|
||||
x = [''];
|
||||
x = 4;
|
||||
x = {};
|
||||
// Should work
|
||||
function f() {
|
||||
}
|
||||
;
|
||||
|
||||
@@ -39,9 +39,11 @@ module y5c { export interface I { foo(): void } } // should be an error
|
||||
//import y6 = require('');
|
||||
|
||||
//// [augmentedTypesFunction.js]
|
||||
// function then var
|
||||
function y1() {
|
||||
}
|
||||
var y1 = 1;
|
||||
// function then function
|
||||
function y2() {
|
||||
}
|
||||
function y2() {
|
||||
@@ -50,6 +52,7 @@ function y2a() {
|
||||
}
|
||||
var y2a = function () {
|
||||
};
|
||||
// function then class
|
||||
function y3() {
|
||||
}
|
||||
var y3 = (function () {
|
||||
@@ -66,12 +69,14 @@ var y3a = (function () {
|
||||
};
|
||||
return y3a;
|
||||
})();
|
||||
// function then enum
|
||||
function y4() {
|
||||
}
|
||||
var y4;
|
||||
(function (y4) {
|
||||
y4[y4["One"] = 0] = "One";
|
||||
})(y4 || (y4 = {}));
|
||||
// function then internal module
|
||||
function y5() {
|
||||
}
|
||||
function y5a() {
|
||||
|
||||
@@ -139,6 +139,7 @@ var m2b;
|
||||
function m2b() {
|
||||
}
|
||||
;
|
||||
// should be errors to have function first
|
||||
function m2c() {
|
||||
}
|
||||
;
|
||||
|
||||
@@ -45,6 +45,8 @@ var r7 = i2.f<number>(1, '');
|
||||
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
|
||||
function f(x, y) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ var i2: I2<number>;
|
||||
var r7 = i2.f(1);
|
||||
|
||||
//// [callGenericFunctionWithZeroTypeArguments.js]
|
||||
// valid invocations of generic functions with no explicit type arguments provided
|
||||
function f(x) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,8 @@ var a2: any;
|
||||
var r8 = a2<number>();
|
||||
|
||||
//// [callNonGenericFunctionWithTypeArguments.js]
|
||||
// it is always illegal to provide type arguments to a non-generic function
|
||||
// all invocations here are illegal
|
||||
function f(x) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ var r4 = a();
|
||||
var r5 = a.f();
|
||||
|
||||
//// [callSignatureWithoutAnnotationsOrBody.js]
|
||||
// Call signatures without a return type annotation and function body return 'any'
|
||||
function foo(x) {
|
||||
}
|
||||
var r = foo(1);
|
||||
|
||||
@@ -121,6 +121,8 @@ function foo15() {
|
||||
var r15 = foo15();
|
||||
|
||||
//// [callSignatureWithoutReturnTypeAnnotationInference.js]
|
||||
// Call signatures without a return type should infer one from the function body (if present)
|
||||
// Simple types
|
||||
function foo(x) {
|
||||
return 1;
|
||||
}
|
||||
@@ -161,6 +163,7 @@ function foo7(x) {
|
||||
return typeof x;
|
||||
}
|
||||
var r7 = foo7(1);
|
||||
// object types
|
||||
function foo8(x) {
|
||||
return { x: x };
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ var b = {
|
||||
}
|
||||
|
||||
//// [callSignaturesWithAccessibilityModifiersOnParameters.js]
|
||||
// Call signature parameters do not allow accessibility modifiers
|
||||
function foo(x, y) {
|
||||
}
|
||||
var f = function foo(x, y) {
|
||||
|
||||
@@ -39,6 +39,7 @@ var b = {
|
||||
}
|
||||
|
||||
//// [callSignaturesWithDuplicateParameters.js]
|
||||
// Duplicate parameter names are always an error
|
||||
function foo(x, x) {
|
||||
}
|
||||
var f = function foo(x, x) {
|
||||
|
||||
@@ -56,6 +56,7 @@ b.b(1);
|
||||
|
||||
|
||||
//// [callSignaturesWithOptionalParameters.js]
|
||||
// Optional parameters should be valid in all the below casts
|
||||
function foo(x) {
|
||||
}
|
||||
var f = function foo(x) {
|
||||
|
||||
@@ -58,6 +58,7 @@ b.b(1);
|
||||
|
||||
|
||||
//// [callSignaturesWithParameterInitializers.js]
|
||||
// Optional parameters allow initializers only in implementation signatures
|
||||
function foo(x) {
|
||||
if (x === void 0) { x = 1; }
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ declare function f6(arguments: number); // no codegen no error
|
||||
declare function f6(arguments: string); // no codegen no error
|
||||
|
||||
//// [collisionArgumentsFunction.js]
|
||||
// Functions
|
||||
function f1(arguments) {
|
||||
var restParameters = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
|
||||
@@ -34,6 +34,7 @@ declare function f6(_i: number); // no codegen no error
|
||||
declare function f6(_i: string); // no codegen no error
|
||||
|
||||
//// [collisionRestParameterFunction.js]
|
||||
// Functions
|
||||
function f1(_i) {
|
||||
var restParameters = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
|
||||
@@ -14,10 +14,13 @@ function foo1<T1, T2>() {
|
||||
}
|
||||
|
||||
//// [commaOperatorOtherInvalidOperation.js]
|
||||
//Expect to have compiler errors
|
||||
//Comma operator in fuction arguments and return
|
||||
function foo(x, y) {
|
||||
return x, y;
|
||||
}
|
||||
var resultIsString = foo(1, "123");
|
||||
//TypeParameters
|
||||
function foo1() {
|
||||
var x;
|
||||
var y;
|
||||
|
||||
@@ -24,10 +24,12 @@ function foo1<T1, T2>()
|
||||
//// [commaOperatorOtherValidOperation.js]
|
||||
for (var i = 0, j = 10; i < j; i++, j--) {
|
||||
}
|
||||
//Comma operator in fuction arguments and return
|
||||
function foo(x, y) {
|
||||
return x, y;
|
||||
}
|
||||
var resultIsString = foo(1, "123");
|
||||
//TypeParameters
|
||||
function foo1() {
|
||||
var x;
|
||||
var y;
|
||||
|
||||
@@ -12,6 +12,9 @@ class C {
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
/**
|
||||
* Returns bar
|
||||
*/
|
||||
C.foo = function () {
|
||||
return "bar";
|
||||
};
|
||||
|
||||
@@ -11,6 +11,9 @@ class WebControls {
|
||||
var WebControls = (function () {
|
||||
function WebControls() {
|
||||
}
|
||||
/**
|
||||
* Render a control
|
||||
*/
|
||||
WebControls.prototype.createControl = function () {
|
||||
};
|
||||
return WebControls;
|
||||
|
||||
@@ -9,6 +9,7 @@ class Greeter {
|
||||
var Greeter = (function () {
|
||||
function Greeter() {
|
||||
}
|
||||
//Hello World
|
||||
Greeter.foo = function () {
|
||||
};
|
||||
return Greeter;
|
||||
|
||||
@@ -219,6 +219,7 @@ cProperties_i.nc_p2 = cProperties_i.nc_p1;
|
||||
var c1 = (function () {
|
||||
function c1() {
|
||||
}
|
||||
/** sum with property*/
|
||||
c1.prototype.p2 = function (b) {
|
||||
return this.p1 + b;
|
||||
};
|
||||
@@ -234,6 +235,7 @@ var c1 = (function () {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
/** sum with property*/
|
||||
c1.prototype.pp2 = function (b) {
|
||||
return this.p1 + b;
|
||||
};
|
||||
@@ -249,6 +251,7 @@ var c1 = (function () {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
/** static sum with property*/
|
||||
c1.s2 = function (b) {
|
||||
return c1.s1 + b;
|
||||
};
|
||||
@@ -303,6 +306,7 @@ var c1 = (function () {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
// sum with property
|
||||
c1.prototype.a_p2 = function (b) {
|
||||
return this.a_p1 + b;
|
||||
};
|
||||
@@ -318,6 +322,7 @@ var c1 = (function () {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
// sum with property
|
||||
c1.prototype.a_pp2 = function (b) {
|
||||
return this.a_p1 + b;
|
||||
};
|
||||
@@ -333,6 +338,7 @@ var c1 = (function () {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
// static sum with property
|
||||
c1.a_s2 = function (b) {
|
||||
return c1.a_s1 + b;
|
||||
};
|
||||
@@ -348,6 +354,7 @@ var c1 = (function () {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
/** sum with property */
|
||||
c1.prototype.b_p2 = function (b) {
|
||||
return this.b_p1 + b;
|
||||
};
|
||||
@@ -363,6 +370,7 @@ var c1 = (function () {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
/** sum with property */
|
||||
c1.prototype.b_pp2 = function (b) {
|
||||
return this.b_p1 + b;
|
||||
};
|
||||
@@ -378,6 +386,7 @@ var c1 = (function () {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
/** static sum with property */
|
||||
c1.b_s2 = function (b) {
|
||||
return c1.b_s1 + b;
|
||||
};
|
||||
|
||||
@@ -155,64 +155,131 @@ class NoQuickInfoClass {
|
||||
}
|
||||
|
||||
//// [commentsCommentParsing.js]
|
||||
/// This is simple /// comments
|
||||
function simple() {
|
||||
}
|
||||
simple();
|
||||
/// multiLine /// Comments
|
||||
/// This is example of multiline /// comments
|
||||
/// Another multiLine
|
||||
function multiLine() {
|
||||
}
|
||||
multiLine();
|
||||
/** this is eg of single line jsdoc style comment */
|
||||
function jsDocSingleLine() {
|
||||
}
|
||||
jsDocSingleLine();
|
||||
/** this is multiple line jsdoc stule comment
|
||||
*New line1
|
||||
*New Line2*/
|
||||
function jsDocMultiLine() {
|
||||
}
|
||||
jsDocMultiLine();
|
||||
/** this is multiple line jsdoc stule comment
|
||||
*New line1
|
||||
*New Line2*/
|
||||
/** Shoul mege this line as well
|
||||
* and this too*/ /** Another this one too*/
|
||||
function jsDocMultiLineMerge() {
|
||||
}
|
||||
jsDocMultiLineMerge();
|
||||
/// Triple slash comment
|
||||
/** jsdoc comment */
|
||||
function jsDocMixedComments1() {
|
||||
}
|
||||
jsDocMixedComments1();
|
||||
/// Triple slash comment
|
||||
/** jsdoc comment */ /*** another jsDocComment*/
|
||||
function jsDocMixedComments2() {
|
||||
}
|
||||
jsDocMixedComments2();
|
||||
/** jsdoc comment */ /*** another jsDocComment*/
|
||||
/// Triple slash comment
|
||||
function jsDocMixedComments3() {
|
||||
}
|
||||
jsDocMixedComments3();
|
||||
/** jsdoc comment */ /*** another jsDocComment*/
|
||||
/// Triple slash comment
|
||||
/// Triple slash comment 2
|
||||
function jsDocMixedComments4() {
|
||||
}
|
||||
jsDocMixedComments4();
|
||||
/// Triple slash comment 1
|
||||
/** jsdoc comment */ /*** another jsDocComment*/
|
||||
/// Triple slash comment
|
||||
/// Triple slash comment 2
|
||||
function jsDocMixedComments5() {
|
||||
}
|
||||
jsDocMixedComments5();
|
||||
/*** another jsDocComment*/
|
||||
/// Triple slash comment 1
|
||||
/// Triple slash comment
|
||||
/// Triple slash comment 2
|
||||
/** jsdoc comment */
|
||||
function jsDocMixedComments6() {
|
||||
}
|
||||
jsDocMixedComments6();
|
||||
// This shoulnot be help comment
|
||||
function noHelpComment1() {
|
||||
}
|
||||
noHelpComment1();
|
||||
/* This shoulnot be help comment */
|
||||
function noHelpComment2() {
|
||||
}
|
||||
noHelpComment2();
|
||||
function noHelpComment3() {
|
||||
}
|
||||
noHelpComment3();
|
||||
/** Adds two integers and returns the result
|
||||
* @param {number} a first number
|
||||
* @param b second number
|
||||
*/
|
||||
function sum(a, b) {
|
||||
return a + b;
|
||||
}
|
||||
sum(10, 20);
|
||||
/** This is multiplication function*/
|
||||
/** @param */
|
||||
/** @param a first number*/
|
||||
/** @param b */
|
||||
/** @param c {
|
||||
@param d @anotherTag*/
|
||||
/** @param e LastParam @anotherTag*/
|
||||
function multiply(a, b, c, d, e) {
|
||||
}
|
||||
/**@param opt optional parameter*/
|
||||
function f1(aOrb, opt) {
|
||||
return aOrb;
|
||||
}
|
||||
/** This is subtract function
|
||||
@param { a
|
||||
*@param { number | } b this is about b
|
||||
@param { { () => string; } } c this is optional param c
|
||||
@param { { () => string; } d this is optional param d
|
||||
@param { { () => string; } } e this is optional param e
|
||||
@param { { { () => string; } } f this is optional param f
|
||||
*/
|
||||
function subtract(a, b, c, d, e, f) {
|
||||
}
|
||||
/** this is square function
|
||||
@paramTag { number } a this is input number of paramTag
|
||||
@param { number } a this is input number
|
||||
@returnType { number } it is return type
|
||||
*/
|
||||
function square(a) {
|
||||
return a * a;
|
||||
}
|
||||
/** this is divide function
|
||||
@param { number} a this is a
|
||||
@paramTag { number } g this is optional param g
|
||||
@param { number} b this is b
|
||||
*/
|
||||
function divide(a, b) {
|
||||
}
|
||||
/** this is jsdoc style function with param tag as well as inline parameter help
|
||||
*@param a it is first parameter
|
||||
*@param c it is third parameter
|
||||
*/
|
||||
function jsDocParamTest(a, b, c, d) {
|
||||
return a + b + c + d;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ define(["require", "exports"], function (require, exports) {
|
||||
(function (m1) {
|
||||
/** b's comment*/
|
||||
m1.b;
|
||||
/** foo's comment*/
|
||||
function foo() {
|
||||
return m1.b;
|
||||
}
|
||||
@@ -81,6 +82,7 @@ define(["require", "exports"], function (require, exports) {
|
||||
m2.i = new c();
|
||||
})(m1.m2 || (m1.m2 = {}));
|
||||
var m2 = m1.m2;
|
||||
/** exported function*/
|
||||
function fooExport() {
|
||||
return foo();
|
||||
}
|
||||
@@ -92,6 +94,8 @@ define(["require", "exports"], function (require, exports) {
|
||||
(function (m4) {
|
||||
/** b's comment */
|
||||
m4.b;
|
||||
/** foo's comment
|
||||
*/
|
||||
function foo() {
|
||||
return m4.b;
|
||||
}
|
||||
@@ -107,6 +111,7 @@ define(["require", "exports"], function (require, exports) {
|
||||
m2.i = new c();
|
||||
})(m4.m2 || (m4.m2 = {}));
|
||||
var m2 = m4.m2;
|
||||
/** exported function */
|
||||
function fooExport() {
|
||||
return foo();
|
||||
}
|
||||
|
||||
@@ -25,9 +25,11 @@ lambdaFoo(10, 20);
|
||||
lambddaNoVarComment(10, 20);
|
||||
|
||||
//// [commentsFunction.js]
|
||||
/** This comment should appear for foo*/
|
||||
function foo() {
|
||||
}
|
||||
foo();
|
||||
/** This is comment for function signature*/
|
||||
function fooWithParameters(a, /** this is comment for b*/
|
||||
b) {
|
||||
var d = a;
|
||||
|
||||
@@ -161,12 +161,15 @@ var __extends = this.__extends || function (d, b) {
|
||||
var c1 = (function () {
|
||||
function c1() {
|
||||
}
|
||||
// i1_f1
|
||||
c1.prototype.i1_f1 = function () {
|
||||
};
|
||||
c1.prototype.i1_nc_f1 = function () {
|
||||
};
|
||||
/** c1_f1*/
|
||||
c1.prototype.f1 = function () {
|
||||
};
|
||||
/** c1_nc_f1*/
|
||||
c1.prototype.nc_f1 = function () {
|
||||
};
|
||||
return c1;
|
||||
@@ -178,6 +181,7 @@ var c2 = (function () {
|
||||
function c2(a) {
|
||||
this.c2_p1 = a;
|
||||
}
|
||||
/** c2 c2_f1*/
|
||||
c2.prototype.c2_f1 = function () {
|
||||
};
|
||||
Object.defineProperty(c2.prototype, "c2_prop", {
|
||||
@@ -197,6 +201,7 @@ var c2 = (function () {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
/** c2 f1*/
|
||||
c2.prototype.f1 = function () {
|
||||
};
|
||||
Object.defineProperty(c2.prototype, "prop", {
|
||||
@@ -223,6 +228,7 @@ var c3 = (function (_super) {
|
||||
function c3() {
|
||||
_super.call(this, 10);
|
||||
}
|
||||
/** c3 f1*/
|
||||
c3.prototype.f1 = function () {
|
||||
};
|
||||
Object.defineProperty(c3.prototype, "prop", {
|
||||
|
||||
@@ -102,6 +102,7 @@ var m1;
|
||||
(function (m1) {
|
||||
/** b's comment*/
|
||||
m1.b;
|
||||
/** foo's comment*/
|
||||
function foo() {
|
||||
return m1.b;
|
||||
}
|
||||
@@ -117,16 +118,24 @@ var m1;
|
||||
m2.i = new c();
|
||||
})(m1.m2 || (m1.m2 = {}));
|
||||
var m2 = m1.m2;
|
||||
/** exported function*/
|
||||
function fooExport() {
|
||||
return foo();
|
||||
}
|
||||
m1.fooExport = fooExport;
|
||||
// shouldn't appear
|
||||
function foo2Export(a) {
|
||||
}
|
||||
m1.foo2Export = foo2Export;
|
||||
/** foo3Export
|
||||
* comment
|
||||
*/
|
||||
function foo3Export() {
|
||||
}
|
||||
m1.foo3Export = foo3Export;
|
||||
/** foo4Export
|
||||
* comment
|
||||
*/
|
||||
function foo4Export() {
|
||||
}
|
||||
})(m1 || (m1 = {}));
|
||||
|
||||
@@ -180,6 +180,7 @@ function f1(aOrb) {
|
||||
}
|
||||
f1("hello");
|
||||
f1(10);
|
||||
/** this is f2 var comment*/
|
||||
function f2(aOrb) {
|
||||
return 10;
|
||||
}
|
||||
@@ -213,6 +214,7 @@ var c = (function () {
|
||||
c.prototype.prop4 = function (aorb) {
|
||||
return 10;
|
||||
};
|
||||
/** Prop5 implementaion*/
|
||||
c.prototype.prop5 = function (aorb) {
|
||||
return 10;
|
||||
};
|
||||
|
||||
@@ -91,6 +91,7 @@ declare var x;
|
||||
//// [commentsdoNotEmitComments.js]
|
||||
/** Variable comments*/
|
||||
var myVariable = 10;
|
||||
/** function comments*/
|
||||
function foo(p) {
|
||||
}
|
||||
/** variable with function type comment*/
|
||||
@@ -101,6 +102,7 @@ var c = (function () {
|
||||
function c() {
|
||||
this.b = 10;
|
||||
}
|
||||
/** function comment */
|
||||
c.prototype.myFoo = function () {
|
||||
return this.b;
|
||||
};
|
||||
@@ -116,6 +118,7 @@ var c = (function () {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
/** overload implementation signature*/
|
||||
c.prototype.foo1 = function (aOrb) {
|
||||
return aOrb.toString();
|
||||
};
|
||||
|
||||
@@ -91,6 +91,7 @@ declare var x;
|
||||
//// [commentsemitComments.js]
|
||||
/** Variable comments*/
|
||||
var myVariable = 10;
|
||||
/** function comments*/
|
||||
function foo(p) {
|
||||
}
|
||||
/** variable with function type comment*/
|
||||
@@ -101,6 +102,7 @@ var c = (function () {
|
||||
function c() {
|
||||
this.b = 10;
|
||||
}
|
||||
/** function comment */
|
||||
c.prototype.myFoo = function () {
|
||||
return this.b;
|
||||
};
|
||||
@@ -116,6 +118,7 @@ var c = (function () {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
/** overload implementation signature*/
|
||||
c.prototype.foo1 = function (aOrb) {
|
||||
return aOrb.toString();
|
||||
};
|
||||
|
||||
@@ -81,6 +81,7 @@ condNumber ? exprIsObject1 : exprIsObject2;
|
||||
0.123456789 ? exprNumber1 : exprNumber2;
|
||||
-10000000000000 ? exprString1 : exprString2;
|
||||
1000000000000 ? exprIsObject1 : exprIsObject2;
|
||||
//Cond is a number type expression
|
||||
function foo() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ condString ? exprIsObject1 : exprIsObject2;
|
||||
'c' ? exprNumber1 : exprNumber2;
|
||||
'string' ? exprString1 : exprString2;
|
||||
" " ? exprIsObject1 : exprIsObject2;
|
||||
//Cond is a string type expression
|
||||
function foo() {
|
||||
return "string";
|
||||
}
|
||||
|
||||
@@ -53,12 +53,14 @@ var c8 = new C4<any>(b);
|
||||
|
||||
|
||||
//// [constraintSatisfactionWithAny.js]
|
||||
// any is not a valid type argument unless there is no constraint, or the constraint is any
|
||||
function foo(x) {
|
||||
return null;
|
||||
}
|
||||
function foo2(x) {
|
||||
return null;
|
||||
}
|
||||
//function foo3<T extends T[]>(x: T): T { return null; }
|
||||
function foo4(x) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,8 @@ var i2: I2<{}>;
|
||||
|
||||
|
||||
//// [constraintSatisfactionWithEmptyObject.js]
|
||||
// valid uses of a basic object constraint, no errors expected
|
||||
// Object constraint
|
||||
function foo(x) {
|
||||
}
|
||||
var r = foo({});
|
||||
@@ -51,6 +53,7 @@ var C = (function () {
|
||||
})();
|
||||
var r2 = new C({});
|
||||
var i;
|
||||
// {} constraint
|
||||
function foo2(x) {
|
||||
}
|
||||
var r = foo2({});
|
||||
|
||||
@@ -26,6 +26,9 @@ function EF1(a,b) { return a+b; }
|
||||
|
||||
|
||||
//// [constructorOverloads7.js]
|
||||
// Type provided by extern declaration
|
||||
// Because Point is a constructor function, this is inferred
|
||||
// to be Point and return type is inferred to be void
|
||||
function Point(x, y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
|
||||
@@ -232,4 +232,4 @@ var x: B = { };
|
||||
|
||||
|
||||
//// [contextualTyping.js]
|
||||
var C1T5 = (function () {\n function C1T5() {\n this.foo = function (i) {\n return i;\n };\n }\n return C1T5;\n})();\nvar C2T5;\n(function (C2T5) {\n C2T5.foo = function (i) {\n return i;\n };\n})(C2T5 || (C2T5 = {}));\n// CONTEXT: Variable declaration\nvar c3t1 = (function (s) {\n return s;\n});\nvar c3t2 = ({\n n: 1\n});\nvar c3t3 = [];\nvar c3t4 = function () {\n return ({});\n};\nvar c3t5 = function (n) {\n return ({});\n};\nvar c3t6 = function (n, s) {\n return ({});\n};\nvar c3t7 = function (n) {\n return n;\n};\nvar c3t8 = function (n) {\n return n;\n};\nvar c3t9 = [[], []];\nvar c3t10 = [({}), ({})];\nvar c3t11 = [function (n, s) {\n return s;\n}];\nvar c3t12 = {\n foo: ({})\n};\nvar c3t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nvar c3t14 = ({\n a: []\n});\nvar C4T5 = (function () {\n function C4T5() {\n this.foo = function (i, s) {\n return s;\n };\n }\n return C4T5;\n})();\nvar C5T5;\n(function (C5T5) {\n C5T5.foo;\n C5T5.foo = function (i, s) {\n return s;\n };\n})(C5T5 || (C5T5 = {}));\n// CONTEXT: Variable assignment\nvar c6t5;\nc6t5 = function (n) {\n return ({});\n};\n// CONTEXT: Array index assignment\nvar c7t2;\nc7t2[0] = ({ n: 1 });\nvar objc8 = ({});\nobjc8.t1 = (function (s) {\n return s;\n});\nobjc8.t2 = ({\n n: 1\n});\nobjc8.t3 = [];\nobjc8.t4 = function () {\n return ({});\n};\nobjc8.t5 = function (n) {\n return ({});\n};\nobjc8.t6 = function (n, s) {\n return ({});\n};\nobjc8.t7 = function (n) {\n return n;\n};\nobjc8.t8 = function (n) {\n return n;\n};\nobjc8.t9 = [[], []];\nobjc8.t10 = [({}), ({})];\nobjc8.t11 = [function (n, s) {\n return s;\n}];\nobjc8.t12 = {\n foo: ({})\n};\nobjc8.t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nobjc8.t14 = ({\n a: []\n});\nfunction c9t5(f) {\n}\n;\nc9t5(function (n) {\n return ({});\n});\n// CONTEXT: Return statement\nvar c10t5 = function () {\n return function (n) {\n return ({});\n };\n};\nvar C11t5 = (function () {\n function C11t5(f) {\n }\n return C11t5;\n})();\n;\nvar i = new C11t5(function (n) {\n return ({});\n});\n// CONTEXT: Type annotated expression\nvar c12t1 = (function (s) {\n return s;\n});\nvar c12t2 = ({\n n: 1\n});\nvar c12t3 = [];\nvar c12t4 = function () {\n return ({});\n};\nvar c12t5 = function (n) {\n return ({});\n};\nvar c12t6 = function (n, s) {\n return ({});\n};\nvar c12t7 = function (n) {\n return n;\n};\nvar c12t8 = function (n) {\n return n;\n};\nvar c12t9 = [[], []];\nvar c12t10 = [({}), ({})];\nvar c12t11 = [function (n, s) {\n return s;\n}];\nvar c12t12 = {\n foo: ({})\n};\nvar c12t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nvar c12t14 = ({\n a: []\n});\nfunction EF1(a, b) {\n return a + b;\n}\nvar efv = EF1(1, 2);\nfunction Point(x, y) {\n this.x = x;\n this.y = y;\n return this;\n}\nPoint.origin = new Point(0, 0);\nPoint.prototype.add = function (dx, dy) {\n return new Point(this.x + dx, this.y + dy);\n};\nPoint.prototype = {\n x: 0,\n y: 0,\n add: function (dx, dy) {\n return new Point(this.x + dx, this.y + dy);\n }\n};\nvar x = {};\n//# sourceMappingURL=contextualTyping.js.map
|
||||
var C1T5 = (function () {\n function C1T5() {\n this.foo = function (i) {\n return i;\n };\n }\n return C1T5;\n})();\nvar C2T5;\n(function (C2T5) {\n C2T5.foo = function (i) {\n return i;\n };\n})(C2T5 || (C2T5 = {}));\n// CONTEXT: Variable declaration\nvar c3t1 = (function (s) {\n return s;\n});\nvar c3t2 = ({\n n: 1\n});\nvar c3t3 = [];\nvar c3t4 = function () {\n return ({});\n};\nvar c3t5 = function (n) {\n return ({});\n};\nvar c3t6 = function (n, s) {\n return ({});\n};\nvar c3t7 = function (n) {\n return n;\n};\nvar c3t8 = function (n) {\n return n;\n};\nvar c3t9 = [[], []];\nvar c3t10 = [({}), ({})];\nvar c3t11 = [function (n, s) {\n return s;\n}];\nvar c3t12 = {\n foo: ({})\n};\nvar c3t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nvar c3t14 = ({\n a: []\n});\nvar C4T5 = (function () {\n function C4T5() {\n this.foo = function (i, s) {\n return s;\n };\n }\n return C4T5;\n})();\nvar C5T5;\n(function (C5T5) {\n C5T5.foo;\n C5T5.foo = function (i, s) {\n return s;\n };\n})(C5T5 || (C5T5 = {}));\n// CONTEXT: Variable assignment\nvar c6t5;\nc6t5 = function (n) {\n return ({});\n};\n// CONTEXT: Array index assignment\nvar c7t2;\nc7t2[0] = ({ n: 1 });\nvar objc8 = ({});\nobjc8.t1 = (function (s) {\n return s;\n});\nobjc8.t2 = ({\n n: 1\n});\nobjc8.t3 = [];\nobjc8.t4 = function () {\n return ({});\n};\nobjc8.t5 = function (n) {\n return ({});\n};\nobjc8.t6 = function (n, s) {\n return ({});\n};\nobjc8.t7 = function (n) {\n return n;\n};\nobjc8.t8 = function (n) {\n return n;\n};\nobjc8.t9 = [[], []];\nobjc8.t10 = [({}), ({})];\nobjc8.t11 = [function (n, s) {\n return s;\n}];\nobjc8.t12 = {\n foo: ({})\n};\nobjc8.t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nobjc8.t14 = ({\n a: []\n});\n// CONTEXT: Function call\nfunction c9t5(f) {\n}\n;\nc9t5(function (n) {\n return ({});\n});\n// CONTEXT: Return statement\nvar c10t5 = function () {\n return function (n) {\n return ({});\n };\n};\nvar C11t5 = (function () {\n function C11t5(f) {\n }\n return C11t5;\n})();\n;\nvar i = new C11t5(function (n) {\n return ({});\n});\n// CONTEXT: Type annotated expression\nvar c12t1 = (function (s) {\n return s;\n});\nvar c12t2 = ({\n n: 1\n});\nvar c12t3 = [];\nvar c12t4 = function () {\n return ({});\n};\nvar c12t5 = function (n) {\n return ({});\n};\nvar c12t6 = function (n, s) {\n return ({});\n};\nvar c12t7 = function (n) {\n return n;\n};\nvar c12t8 = function (n) {\n return n;\n};\nvar c12t9 = [[], []];\nvar c12t10 = [({}), ({})];\nvar c12t11 = [function (n, s) {\n return s;\n}];\nvar c12t12 = {\n foo: ({})\n};\nvar c12t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nvar c12t14 = ({\n a: []\n});\nfunction EF1(a, b) {\n return a + b;\n}\nvar efv = EF1(1, 2);\nfunction Point(x, y) {\n this.x = x;\n this.y = y;\n return this;\n}\nPoint.origin = new Point(0, 0);\nPoint.prototype.add = function (dx, dy) {\n return new Point(this.x + dx, this.y + dy);\n};\nPoint.prototype = {\n x: 0,\n y: 0,\n add: function (dx, dy) {\n return new Point(this.x + dx, this.y + dy);\n }\n};\nvar x = {};\n//# sourceMappingURL=contextualTyping.js.map
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -60,9 +60,11 @@ function globalfooWithOverloads(a: any): any {
|
||||
}
|
||||
|
||||
//// [declFileFunctions_0.js]
|
||||
/** This comment should appear for foo*/
|
||||
function foo() {
|
||||
}
|
||||
exports.foo = foo;
|
||||
/** This is comment for function signature*/
|
||||
function fooWithParameters(a, /** this is comment for b*/
|
||||
b) {
|
||||
var d = a;
|
||||
@@ -80,8 +82,10 @@ function fooWithOverloads(a) {
|
||||
return a;
|
||||
}
|
||||
exports.fooWithOverloads = fooWithOverloads;
|
||||
/** This comment should appear for nonExportedFoo*/
|
||||
function nonExportedFoo() {
|
||||
}
|
||||
/** This is comment for function signature*/
|
||||
function nonExportedFooWithParameters(a, /** this is comment for b*/
|
||||
b) {
|
||||
var d = a;
|
||||
@@ -97,8 +101,10 @@ function nonExportedFooWithOverloads(a) {
|
||||
return a;
|
||||
}
|
||||
//// [declFileFunctions_1.js]
|
||||
/** This comment should appear for foo*/
|
||||
function globalfoo() {
|
||||
}
|
||||
/** This is comment for function signature*/
|
||||
function globalfooWithParameters(a, /** this is comment for b*/
|
||||
b) {
|
||||
var d = a;
|
||||
|
||||
@@ -194,8 +194,10 @@ interface I2 {
|
||||
var c1 = (function () {
|
||||
function c1() {
|
||||
}
|
||||
/** This comment should appear for foo*/
|
||||
c1.prototype.foo = function () {
|
||||
};
|
||||
/** This is comment for function signature*/
|
||||
c1.prototype.fooWithParameters = function (a, /** this is comment for b*/
|
||||
b) {
|
||||
var d = a;
|
||||
@@ -210,8 +212,10 @@ var c1 = (function () {
|
||||
c1.prototype.fooWithOverloads = function (a) {
|
||||
return a;
|
||||
};
|
||||
/** This comment should appear for privateFoo*/
|
||||
c1.prototype.privateFoo = function () {
|
||||
};
|
||||
/** This is comment for function signature*/
|
||||
c1.prototype.privateFooWithParameters = function (a, /** this is comment for b*/
|
||||
b) {
|
||||
var d = a;
|
||||
@@ -226,8 +230,10 @@ var c1 = (function () {
|
||||
c1.prototype.privateFooWithOverloads = function (a) {
|
||||
return a;
|
||||
};
|
||||
/** This comment should appear for static foo*/
|
||||
c1.staticFoo = function () {
|
||||
};
|
||||
/** This is comment for function signature*/
|
||||
c1.staticFooWithParameters = function (a, /** this is comment for b*/
|
||||
b) {
|
||||
var d = a;
|
||||
@@ -242,8 +248,10 @@ var c1 = (function () {
|
||||
c1.staticFooWithOverloads = function (a) {
|
||||
return a;
|
||||
};
|
||||
/** This comment should appear for privateStaticFoo*/
|
||||
c1.privateStaticFoo = function () {
|
||||
};
|
||||
/** This is comment for function signature*/
|
||||
c1.privateStaticFooWithParameters = function (a, /** this is comment for b*/
|
||||
b) {
|
||||
var d = a;
|
||||
@@ -265,8 +273,10 @@ exports.c1 = c1;
|
||||
var c2 = (function () {
|
||||
function c2() {
|
||||
}
|
||||
/** This comment should appear for foo*/
|
||||
c2.prototype.foo = function () {
|
||||
};
|
||||
/** This is comment for function signature*/
|
||||
c2.prototype.fooWithParameters = function (a, /** this is comment for b*/
|
||||
b) {
|
||||
var d = a;
|
||||
@@ -281,8 +291,10 @@ var c2 = (function () {
|
||||
c2.prototype.fooWithOverloads = function (a) {
|
||||
return a;
|
||||
};
|
||||
/** This comment should appear for privateFoo*/
|
||||
c2.prototype.privateFoo = function () {
|
||||
};
|
||||
/** This is comment for function signature*/
|
||||
c2.prototype.privateFooWithParameters = function (a, /** this is comment for b*/
|
||||
b) {
|
||||
var d = a;
|
||||
@@ -297,8 +309,10 @@ var c2 = (function () {
|
||||
c2.prototype.privateFooWithOverloads = function (a) {
|
||||
return a;
|
||||
};
|
||||
/** This comment should appear for static foo*/
|
||||
c2.staticFoo = function () {
|
||||
};
|
||||
/** This is comment for function signature*/
|
||||
c2.staticFooWithParameters = function (a, /** this is comment for b*/
|
||||
b) {
|
||||
var d = a;
|
||||
@@ -313,8 +327,10 @@ var c2 = (function () {
|
||||
c2.staticFooWithOverloads = function (a) {
|
||||
return a;
|
||||
};
|
||||
/** This comment should appear for privateStaticFoo*/
|
||||
c2.privateStaticFoo = function () {
|
||||
};
|
||||
/** This is comment for function signature*/
|
||||
c2.privateStaticFooWithParameters = function (a, /** this is comment for b*/
|
||||
b) {
|
||||
var d = a;
|
||||
|
||||
@@ -23,6 +23,7 @@ var Colors;
|
||||
var x = 0 /* Red */;
|
||||
var p = x.Green;
|
||||
x.toFixed();
|
||||
// Now with generics
|
||||
function fill(f) {
|
||||
f.Green;
|
||||
f.toFixed();
|
||||
|
||||
@@ -17,6 +17,7 @@ var __extends = this.__extends || function (d, b) {
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
};
|
||||
// Error forward referencing derived class with forwarding constructor
|
||||
function f() {
|
||||
var d1 = new derived();
|
||||
var d2 = new derived(4);
|
||||
|
||||
@@ -21,6 +21,7 @@ var Bar = (function () {
|
||||
function Bar(store) {
|
||||
this._store = store;
|
||||
}
|
||||
//public bar() { }
|
||||
Bar.prototype.foo = function () {
|
||||
return this._store.length;
|
||||
};
|
||||
|
||||
@@ -40,6 +40,7 @@ for (var x = 2;;) {
|
||||
}
|
||||
for (var x = undefined;;) {
|
||||
}
|
||||
// new declaration space, making redeclaring x as a string valid
|
||||
function declSpace() {
|
||||
for (var x = 'this is a string';;) {
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ function foo2<T extends { (): void }, U extends { (): void }>(x: T, y: U) {
|
||||
//}
|
||||
|
||||
//// [functionConstraintSatisfaction.js]
|
||||
// satisfaction of a constraint to Function, no errors expected
|
||||
function foo(x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ function fff<T extends { (): void }, U extends T>(x: T, y: U) {
|
||||
|
||||
|
||||
//// [functionConstraintSatisfaction2.js]
|
||||
// satisfaction of a constraint to Function, all of these invocations are errors unless otherwise noted
|
||||
function foo(x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ var r12 = foo(i2);
|
||||
var r15 = foo(c2);
|
||||
|
||||
//// [functionConstraintSatisfaction3.js]
|
||||
// satisfaction of a constraint to Function, no errors expected
|
||||
function foo(x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
@@ -67,13 +67,16 @@ var f4 = function () {
|
||||
return [1];
|
||||
}
|
||||
};
|
||||
// Function implemetnation with non -void return type annotation with no return
|
||||
function f5() {
|
||||
}
|
||||
var m;
|
||||
// Function signature with parameter initializer referencing in scope local variable
|
||||
function f6(n) {
|
||||
if (n === void 0) { n = m; }
|
||||
var m = 4;
|
||||
}
|
||||
// Function signature with initializer referencing other parameter to the right
|
||||
function f7(n, m) {
|
||||
if (n === void 0) { n = m; }
|
||||
}
|
||||
|
||||
@@ -146,6 +146,7 @@ var a = function f() {
|
||||
var x = f;
|
||||
return x;
|
||||
};
|
||||
// Two mutually recursive function implementations with no return type annotations
|
||||
function rec1() {
|
||||
return rec2();
|
||||
}
|
||||
@@ -154,6 +155,7 @@ function rec2() {
|
||||
}
|
||||
var a = rec1();
|
||||
var a = rec2();
|
||||
// Two mutually recursive function implementations with return type annotation in one
|
||||
function rec3() {
|
||||
return rec4();
|
||||
}
|
||||
@@ -216,25 +218,32 @@ var a = function f() {
|
||||
undefined === function () {
|
||||
throw undefined;
|
||||
};
|
||||
// Type of 'this' in function implementation is 'any'
|
||||
function thisFunc() {
|
||||
var x = this;
|
||||
var x;
|
||||
}
|
||||
// Function signature with optional parameter, no type annotation and initializer has initializer's type
|
||||
function opt1(n) {
|
||||
if (n === void 0) { n = 4; }
|
||||
var m = n;
|
||||
var m;
|
||||
}
|
||||
// Function signature with optional parameter, no type annotation and initializer has initializer's widened type
|
||||
function opt2(n) {
|
||||
if (n === void 0) { n = { x: null, y: undefined }; }
|
||||
var m = n;
|
||||
var m;
|
||||
}
|
||||
// Function signature with initializer referencing other parameter to the left
|
||||
function opt3(n, m) {
|
||||
if (m === void 0) { m = n; }
|
||||
var y = m;
|
||||
var y;
|
||||
}
|
||||
// Function signature with optional parameter has correct codegen
|
||||
// (tested above)
|
||||
// FunctionExpression with non -void return type annotation return with no expression
|
||||
function f6() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ var f2: () => any = () => { };
|
||||
var f3 = (): any => { };
|
||||
|
||||
//// [functionWithAnyReturnTypeAndNoReturnExpression.js]
|
||||
// All should be allowed
|
||||
function f() {
|
||||
}
|
||||
var f2 = function () {
|
||||
|
||||
@@ -64,6 +64,8 @@ function f8<T extends U, U extends V, V>(x: T, y: U) {
|
||||
|
||||
|
||||
//// [functionWithMultipleReturnStatements.js]
|
||||
// return type of a function with multiple returns is the BCT of each return statement
|
||||
// it is an error if there is no single BCT, these are error cases
|
||||
function f1() {
|
||||
if (true) {
|
||||
return 1;
|
||||
|
||||
@@ -92,6 +92,8 @@ function f12() {
|
||||
}
|
||||
|
||||
//// [functionWithMultipleReturnStatements2.js]
|
||||
// return type of a function with multiple returns is the BCT of each return statement
|
||||
// no errors expected here
|
||||
function f1() {
|
||||
if (true) {
|
||||
return 1;
|
||||
@@ -143,6 +145,7 @@ function f6(x) {
|
||||
//}
|
||||
var a;
|
||||
var b;
|
||||
// returns typeof a
|
||||
function f9() {
|
||||
if (true) {
|
||||
return a;
|
||||
@@ -151,6 +154,7 @@ function f9() {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
// returns typeof b
|
||||
function f10() {
|
||||
if (true) {
|
||||
return b;
|
||||
@@ -159,6 +163,7 @@ function f10() {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
// returns number => void
|
||||
function f11() {
|
||||
if (true) {
|
||||
return function (x) {
|
||||
@@ -169,6 +174,7 @@ function f11() {
|
||||
};
|
||||
}
|
||||
}
|
||||
// returns Object => void
|
||||
function f12() {
|
||||
if (true) {
|
||||
return function (x) {
|
||||
|
||||
@@ -92,6 +92,7 @@ var r10 = i.foo7(''); // {}
|
||||
var r11 = i.foo8(); // {}
|
||||
|
||||
//// [genericCallTypeArgumentInference.js]
|
||||
// Basic type inference with generic calls, no errors expected
|
||||
function foo(t) {
|
||||
return t;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ var r4 = foo<Date, Date>(1); // error
|
||||
var r5 = foo<Date, Date>(new Date()); // no error
|
||||
|
||||
//// [genericCallWithConstraintsTypeArgumentInference2.js]
|
||||
// Generic call with parameters of T and U, U extends T, no parameter of type U
|
||||
function foo(t) {
|
||||
var u;
|
||||
return u;
|
||||
|
||||
@@ -26,6 +26,7 @@ var r7 = foo(arg5); // string
|
||||
|
||||
|
||||
//// [genericCallWithConstructorTypedArguments5.js]
|
||||
// Generic call with parameter of object type with member of function type of n args passed object whose associated member is call signature with n+1 args
|
||||
function foo(arg) {
|
||||
return new arg.cb(null);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,8 @@ function other<T, U>(t: T, u: U) {
|
||||
}
|
||||
|
||||
//// [genericCallWithFunctionTypedArguments.js]
|
||||
// Generic functions used as arguments for function typed parameters are not used to make inferences from
|
||||
// Using function arguments, no errors expected
|
||||
function foo(x) {
|
||||
return x(null);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@ var r8 = foo3(1, i2, 1); // {}
|
||||
var r9 = foo3<string, string>('', i2, ''); // string
|
||||
|
||||
//// [genericCallWithFunctionTypedArguments2.js]
|
||||
// Generic functions used as arguments for function typed parameters are not used to make inferences from
|
||||
// Using construct signature arguments, no errors expected
|
||||
function foo(x) {
|
||||
return new x(null);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ var r7 = foo({ cb: () => '' }); // string
|
||||
|
||||
|
||||
//// [genericCallWithFunctionTypedArguments5.js]
|
||||
// Generic call with parameter of object type with member of function type of n args passed object whose associated member is call signature with n+1 args
|
||||
function foo(arg) {
|
||||
return arg.cb(null);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ function other3<T extends RegExp>(x: T) {
|
||||
}
|
||||
|
||||
//// [genericCallWithGenericSignatureArguments.js]
|
||||
// When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made,
|
||||
// the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them.
|
||||
function foo(a, b) {
|
||||
var r;
|
||||
return r;
|
||||
|
||||
@@ -37,6 +37,8 @@ function foo3<T>(x: T, a: (x: T) => T, b: (x: T) => T) {
|
||||
var r7 = foo3(E.A, (x) => E.A, (x) => F.A); // error
|
||||
|
||||
//// [genericCallWithGenericSignatureArguments2.js]
|
||||
// When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made,
|
||||
// the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them.
|
||||
function foo(a, b) {
|
||||
var r;
|
||||
return r;
|
||||
|
||||
@@ -34,6 +34,8 @@ var r11 = foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: stri
|
||||
var r12 = foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2); // (string => boolean) => {}
|
||||
|
||||
//// [genericCallWithGenericSignatureArguments3.js]
|
||||
// When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made,
|
||||
// the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them.
|
||||
function foo(x, a, b) {
|
||||
var r;
|
||||
return r;
|
||||
|
||||
@@ -32,6 +32,8 @@ var r7 = foo(s1, s2); // (x: Object) => string;
|
||||
var r8 = foo(s2, s1); // (x: string) => string;
|
||||
|
||||
//// [genericCallWithNonSymmetricSubtypes.js]
|
||||
// generic type argument inference where inference leads to two candidates that are both supertypes of all candidates
|
||||
// we choose the first candidate so the result is dependent on the order of the arguments provided
|
||||
function foo(x, y) {
|
||||
var r;
|
||||
return r;
|
||||
|
||||
@@ -58,6 +58,7 @@ var Derived2 = (function (_super) {
|
||||
}
|
||||
return Derived2;
|
||||
})(Base);
|
||||
// returns {}[]
|
||||
function f(a) {
|
||||
return [a.x, a.y];
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ function other<T extends Date>(arg: T) {
|
||||
}
|
||||
|
||||
//// [genericCallWithObjectTypeArgsAndIndexers.js]
|
||||
// Type inference infers from indexers in target type, no errors expected
|
||||
function foo(x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ function other3<T extends U, U extends Date>(arg: T) {
|
||||
}
|
||||
|
||||
//// [genericCallWithObjectTypeArgsAndIndexersErrors.js]
|
||||
// Type inference infers from indexers in target type, error cases
|
||||
function foo(x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ function foo6<T, U extends T, V extends U>(x: T, y: U, z: V = y) { } // error
|
||||
function foo7<T, U extends T, V extends U>(x: V, y: U = x) { } // should be ok
|
||||
|
||||
//// [genericCallWithObjectTypeArgsAndInitializers.js]
|
||||
// Generic typed parameters with initializers
|
||||
function foo(x) {
|
||||
if (x === void 0) { x = null; }
|
||||
return x;
|
||||
|
||||
@@ -35,6 +35,7 @@ function other3<T extends Date, U extends Date>(arg: T) {
|
||||
//}
|
||||
|
||||
//// [genericCallWithObjectTypeArgsAndNumericIndexer.js]
|
||||
// Type inference infers from indexers in target type, no errors expected
|
||||
function foo(x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ function other3<T extends Date, U extends Date>(arg: T) {
|
||||
//}
|
||||
|
||||
//// [genericCallWithObjectTypeArgsAndStringIndexer.js]
|
||||
// Type inference infers from indexers in target type, no errors expected
|
||||
function foo(x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ var TypeScript2;
|
||||
var PullSymbol = (function () {
|
||||
function PullSymbol(name, declKind) {
|
||||
}
|
||||
// link methods
|
||||
PullSymbol.prototype.addOutgoingLink = function (linkTo, kind) {
|
||||
};
|
||||
PullSymbol.prototype.getType = function () {
|
||||
|
||||
@@ -59,16 +59,19 @@ function countWhere_2<A>(pred: (a: A) => boolean): (a: A[]) => number {
|
||||
}
|
||||
|
||||
//// [genericTypeParameterEquivalence2.js]
|
||||
// compose :: (b->c) -> (a->b) -> (a->c)
|
||||
function compose(f, g) {
|
||||
return function (a) {
|
||||
return f(g.apply(null, a));
|
||||
};
|
||||
}
|
||||
// forEach :: [a] -> (a -> ()) -> ()
|
||||
function forEach(list, f) {
|
||||
for (var i = 0; i < list.length; ++i) {
|
||||
f(list[i], i);
|
||||
}
|
||||
}
|
||||
// filter :: (a->bool) -> [a] -> [a]
|
||||
function filter(f, ar) {
|
||||
var ret = [];
|
||||
forEach(ar, function (el) {
|
||||
@@ -78,9 +81,11 @@ function filter(f, ar) {
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
// length :: [a] -> Num
|
||||
function length2(ar) {
|
||||
return ar.length;
|
||||
}
|
||||
// curry1 :: ((a,b)->c) -> (a->(b->c))
|
||||
function curry1(f) {
|
||||
return function (ay) {
|
||||
return function (by) {
|
||||
@@ -89,6 +94,13 @@ function curry1(f) {
|
||||
};
|
||||
}
|
||||
var cfilter = curry1(filter);
|
||||
// compose :: (b->c) -> (a->b) -> (a->c)
|
||||
// length :: [a] -> Num
|
||||
// cfilter :: {} -> {} -> [{}]
|
||||
// pred :: a -> Bool
|
||||
// cfilter(pred) :: {} -> [{}]
|
||||
// length2 :: [a] -> Num
|
||||
// countWhere :: (a -> Bool) -> [a] -> Num
|
||||
function countWhere_1(pred) {
|
||||
return compose(length2, cfilter(pred));
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ function noError2(x: number, y: string) { };
|
||||
|
||||
|
||||
//// [implicitAnyDeclareFunctionWithoutFormalType.js]
|
||||
// these should be errors
|
||||
function foo(x) {
|
||||
}
|
||||
;
|
||||
@@ -33,6 +34,7 @@ function func4(z, w) {
|
||||
if (w === void 0) { w = undefined; }
|
||||
}
|
||||
;
|
||||
// these shouldn't be errors
|
||||
function noError1(x, y) {
|
||||
if (x === void 0) { x = 3; }
|
||||
if (y === void 0) { y = 2; }
|
||||
|
||||
@@ -17,14 +17,17 @@ function fn3() {
|
||||
|
||||
|
||||
//// [implicitAnyDeclareFunctionWithoutFormalType2.js]
|
||||
// generates function fn1(): number;
|
||||
function fn1() {
|
||||
var x;
|
||||
return x;
|
||||
}
|
||||
// generates function fn2(): any;
|
||||
function fn2() {
|
||||
var x;
|
||||
return x;
|
||||
}
|
||||
// generates function fn3();
|
||||
function fn3() {
|
||||
var x;
|
||||
return x;
|
||||
|
||||
@@ -25,6 +25,7 @@ undefinedWidenFunction();
|
||||
|
||||
|
||||
//// [implicitAnyFunctionReturnNullOrUndefined.js]
|
||||
// this should be an error
|
||||
function nullWidenFunction() {
|
||||
return null;
|
||||
}
|
||||
@@ -42,6 +43,7 @@ var C = (function () {
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
// this should not be an error
|
||||
function foo1() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ function f2<T extends Date, U extends Date>() {
|
||||
//}
|
||||
|
||||
//// [innerTypeParameterShadowingOuterOne.js]
|
||||
// inner type parameters shadow outer ones of the same name
|
||||
// no errors expected
|
||||
function f() {
|
||||
function g() {
|
||||
var x;
|
||||
|
||||
@@ -27,6 +27,7 @@ var __extends = this.__extends || function (d, b) {
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
};
|
||||
// all the following should be error
|
||||
function fn1() {
|
||||
}
|
||||
function fn2() {
|
||||
|
||||
@@ -20,6 +20,8 @@ function foo<T, U, V/* extends T*/>(t: T, u: U, v: V) {
|
||||
}
|
||||
|
||||
//// [logicalAndOperatorWithTypeParameters.js]
|
||||
// The && operator permits the operands to be of any type and produces a result of the same
|
||||
// type as the second operand.
|
||||
function foo(t, u, v) {
|
||||
var r1 = t && t;
|
||||
var r2 = u && t;
|
||||
|
||||
@@ -44,6 +44,12 @@ var IceCreamMonster = (function () {
|
||||
this.soundsWhenEating = soundsWhenEating;
|
||||
this.name = name;
|
||||
}
|
||||
/**
|
||||
* Tells the IceCreamMonster to eat their ice cre am!
|
||||
*
|
||||
* @param {number} amount The amount of ice cream to e at.
|
||||
* @return {boolean} True if ice cream remains, false if there is no more ice cream le ft.
|
||||
*/
|
||||
IceCreamMonster.prototype.eatIceCream = function (amount) {
|
||||
this.iceCreamRemaining -= amount;
|
||||
if (this.iceCreamRemaining <= 0) {
|
||||
|
||||
@@ -5,6 +5,7 @@ function Test() { }
|
||||
var test = new Test();
|
||||
|
||||
//// [newFunctionImplicitAny.js]
|
||||
// No implicit any error given when newing a function (up for debate)
|
||||
function Test() {
|
||||
}
|
||||
var test = new Test();
|
||||
|
||||
@@ -93,14 +93,17 @@ var d = new anyCtor;
|
||||
var d;
|
||||
// Construct expression where constructor is of type 'any' with > 1 arg
|
||||
var d = new anyCtor1(undefined);
|
||||
// Construct expression of type where apparent type has a construct signature with 0 arguments
|
||||
function newFn1(s) {
|
||||
var p = new s;
|
||||
var p;
|
||||
}
|
||||
// Construct expression of type where apparent type has a construct signature with 1 arguments
|
||||
function newFn2(s) {
|
||||
var p = new s(32);
|
||||
var p;
|
||||
}
|
||||
// Construct expression of void returning function
|
||||
function fnVoid() {
|
||||
}
|
||||
var t = new fnVoid();
|
||||
|
||||
@@ -45,22 +45,29 @@ var f13 = (...r) => "";
|
||||
var f14 = (x, ...r) => "";
|
||||
|
||||
//// [noImplicitAnyParametersInBareFunctions.js]
|
||||
// No implicit-'any' errors.
|
||||
function f1() {
|
||||
}
|
||||
// Implicit-'any' error for x.
|
||||
function f2(x) {
|
||||
}
|
||||
// No implicit-'any' errors.
|
||||
function f3(x) {
|
||||
}
|
||||
// Implicit-'any' errors for x, y, and z.
|
||||
function f4(x, y, z) {
|
||||
}
|
||||
// Implicit-'any' errors for x, and z.
|
||||
function f5(x, y, z) {
|
||||
}
|
||||
// Implicit-'any[]' error for r.
|
||||
function f6() {
|
||||
var r = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
r[_i - 0] = arguments[_i];
|
||||
}
|
||||
}
|
||||
// Implicit-'any'/'any[]' errors for x, r.
|
||||
function f7(x) {
|
||||
var r = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
|
||||
@@ -132,22 +132,29 @@ var C = (function () {
|
||||
return "";
|
||||
};
|
||||
}
|
||||
// No implicit-'any' errors.
|
||||
C.prototype.pub_f1 = function () {
|
||||
};
|
||||
// Implicit-'any' errors for x.
|
||||
C.prototype.pub_f2 = function (x) {
|
||||
};
|
||||
// No implicit-'any' errors.
|
||||
C.prototype.pub_f3 = function (x) {
|
||||
};
|
||||
// Implicit-'any' errors for x, y, and z.
|
||||
C.prototype.pub_f4 = function (x, y, z) {
|
||||
};
|
||||
// Implicit-'any' errors for x, and z.
|
||||
C.prototype.pub_f5 = function (x, y, z) {
|
||||
};
|
||||
// Implicit-'any[]' errors for r.
|
||||
C.prototype.pub_f6 = function () {
|
||||
var r = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
r[_i - 0] = arguments[_i];
|
||||
}
|
||||
};
|
||||
// Implicit-'any'/'any[]' errors for x, r.
|
||||
C.prototype.pub_f7 = function (x) {
|
||||
var r = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
@@ -156,22 +163,30 @@ var C = (function () {
|
||||
};
|
||||
C.prototype.pub_f8 = function (x3, y3) {
|
||||
};
|
||||
///////////////////////////////////////////
|
||||
// No implicit-'any' errors.
|
||||
C.prototype.priv_f1 = function () {
|
||||
};
|
||||
// Implicit-'any' errors for x.
|
||||
C.prototype.priv_f2 = function (x) {
|
||||
};
|
||||
// No implicit-'any' errors.
|
||||
C.prototype.priv_f3 = function (x) {
|
||||
};
|
||||
// Implicit-'any' errors for x, y, and z.
|
||||
C.prototype.priv_f4 = function (x, y, z) {
|
||||
};
|
||||
// Implicit-'any' errors for x, and z.
|
||||
C.prototype.priv_f5 = function (x, y, z) {
|
||||
};
|
||||
// Implicit-'any[]' errors for r.
|
||||
C.prototype.priv_f6 = function () {
|
||||
var r = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
r[_i - 0] = arguments[_i];
|
||||
}
|
||||
};
|
||||
// Implicit-'any'/'any[]' errors for x, r.
|
||||
C.prototype.priv_f7 = function (x) {
|
||||
var r = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
|
||||
@@ -49,22 +49,29 @@ module M {
|
||||
//// [noImplicitAnyParametersInModule.js]
|
||||
var M;
|
||||
(function (M) {
|
||||
// No implicit-'any' errors.
|
||||
function m_f1() {
|
||||
}
|
||||
// Implicit-'any' error for x.
|
||||
function m_f2(x) {
|
||||
}
|
||||
// No implicit-'any' errors.
|
||||
function m_f3(x) {
|
||||
}
|
||||
// Implicit-'any' errors for x, y, and z.
|
||||
function m_f4(x, y, z) {
|
||||
}
|
||||
// Implicit-'any' errors for x and z.
|
||||
function m_f5(x, y, z) {
|
||||
}
|
||||
// Implicit-'any[]' error for r.
|
||||
function m_f6() {
|
||||
var r = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
r[_i - 0] = arguments[_i];
|
||||
}
|
||||
}
|
||||
// Implicit-'any'/'any[]' errors for x and r.
|
||||
function m_f7(x) {
|
||||
var r = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
|
||||
@@ -20,6 +20,7 @@ class MyClass
|
||||
var MyClass = (function () {
|
||||
function MyClass() {
|
||||
}
|
||||
// my function comments
|
||||
MyClass.prototype.Count = function () {
|
||||
return 42;
|
||||
};
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
//// [out-flag.js.map]
|
||||
{"version":3,"file":"out-flag.js","sourceRoot":"","sources":["out-flag.ts"],"names":["MyClass","MyClass.constructor","MyClass.Count","MyClass.SetCount"],"mappings":"AAGA,IAAM,OAAO;IAAbA,SAAMA,OAAOA;IAYbC,CAACA;IATUD,uBAAKA,GAAZA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IAEMF,0BAAQA,GAAfA,UAAgBA,KAAaA;IAG7BG,CAACA;IACLH,cAACA;AAADA,CAACA,AAZD,IAYC"}
|
||||
{"version":3,"file":"out-flag.js","sourceRoot":"","sources":["out-flag.ts"],"names":["MyClass","MyClass.constructor","MyClass.Count","MyClass.SetCount"],"mappings":"AAGA,IAAM,OAAO;IAAbA,SAAMA,OAAOA;IAYbC,CAACA;IAVGD,uBAAuBA;IAChBA,uBAAKA,GAAZA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IAEMF,0BAAQA,GAAfA,UAAgBA,KAAaA;IAG7BG,CAACA;IACLH,cAACA;AAADA,CAACA,AAZD,IAYC"}
|
||||
@@ -37,7 +37,7 @@ sourceFile:out-flag.ts
|
||||
>>> }
|
||||
1 >^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>{
|
||||
> // my function comments
|
||||
@@ -55,16 +55,26 @@ sourceFile:out-flag.ts
|
||||
1 >Emitted(3, 5) Source(16, 1) + SourceIndex(0) name (MyClass.constructor)
|
||||
2 >Emitted(3, 6) Source(16, 2) + SourceIndex(0) name (MyClass.constructor)
|
||||
---
|
||||
>>> // my function comments
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^->
|
||||
1->
|
||||
2 > // my function comments
|
||||
1->Emitted(4, 5) Source(6, 5) + SourceIndex(0) name (MyClass)
|
||||
2 >Emitted(4, 28) Source(6, 28) + SourceIndex(0) name (MyClass)
|
||||
---
|
||||
>>> MyClass.prototype.Count = function () {
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^
|
||||
1->
|
||||
1->
|
||||
> public
|
||||
2 > Count
|
||||
3 >
|
||||
1->Emitted(4, 5) Source(7, 12) + SourceIndex(0) name (MyClass)
|
||||
2 >Emitted(4, 28) Source(7, 17) + SourceIndex(0) name (MyClass)
|
||||
3 >Emitted(4, 31) Source(7, 5) + SourceIndex(0) name (MyClass)
|
||||
1->Emitted(5, 5) Source(7, 12) + SourceIndex(0) name (MyClass)
|
||||
2 >Emitted(5, 28) Source(7, 17) + SourceIndex(0) name (MyClass)
|
||||
3 >Emitted(5, 31) Source(7, 5) + SourceIndex(0) name (MyClass)
|
||||
---
|
||||
>>> return 42;
|
||||
1 >^^^^^^^^
|
||||
@@ -79,11 +89,11 @@ sourceFile:out-flag.ts
|
||||
3 >
|
||||
4 > 42
|
||||
5 > ;
|
||||
1 >Emitted(5, 9) Source(9, 9) + SourceIndex(0) name (MyClass.Count)
|
||||
2 >Emitted(5, 15) Source(9, 15) + SourceIndex(0) name (MyClass.Count)
|
||||
3 >Emitted(5, 16) Source(9, 16) + SourceIndex(0) name (MyClass.Count)
|
||||
4 >Emitted(5, 18) Source(9, 18) + SourceIndex(0) name (MyClass.Count)
|
||||
5 >Emitted(5, 19) Source(9, 19) + SourceIndex(0) name (MyClass.Count)
|
||||
1 >Emitted(6, 9) Source(9, 9) + SourceIndex(0) name (MyClass.Count)
|
||||
2 >Emitted(6, 15) Source(9, 15) + SourceIndex(0) name (MyClass.Count)
|
||||
3 >Emitted(6, 16) Source(9, 16) + SourceIndex(0) name (MyClass.Count)
|
||||
4 >Emitted(6, 18) Source(9, 18) + SourceIndex(0) name (MyClass.Count)
|
||||
5 >Emitted(6, 19) Source(9, 19) + SourceIndex(0) name (MyClass.Count)
|
||||
---
|
||||
>>> };
|
||||
1 >^^^^
|
||||
@@ -92,8 +102,8 @@ sourceFile:out-flag.ts
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(6, 5) Source(10, 5) + SourceIndex(0) name (MyClass.Count)
|
||||
2 >Emitted(6, 6) Source(10, 6) + SourceIndex(0) name (MyClass.Count)
|
||||
1 >Emitted(7, 5) Source(10, 5) + SourceIndex(0) name (MyClass.Count)
|
||||
2 >Emitted(7, 6) Source(10, 6) + SourceIndex(0) name (MyClass.Count)
|
||||
---
|
||||
>>> MyClass.prototype.SetCount = function (value) {
|
||||
1->^^^^
|
||||
@@ -108,11 +118,11 @@ sourceFile:out-flag.ts
|
||||
3 >
|
||||
4 > public SetCount(
|
||||
5 > value: number
|
||||
1->Emitted(7, 5) Source(12, 12) + SourceIndex(0) name (MyClass)
|
||||
2 >Emitted(7, 31) Source(12, 20) + SourceIndex(0) name (MyClass)
|
||||
3 >Emitted(7, 34) Source(12, 5) + SourceIndex(0) name (MyClass)
|
||||
4 >Emitted(7, 44) Source(12, 21) + SourceIndex(0) name (MyClass)
|
||||
5 >Emitted(7, 49) Source(12, 34) + SourceIndex(0) name (MyClass)
|
||||
1->Emitted(8, 5) Source(12, 12) + SourceIndex(0) name (MyClass)
|
||||
2 >Emitted(8, 31) Source(12, 20) + SourceIndex(0) name (MyClass)
|
||||
3 >Emitted(8, 34) Source(12, 5) + SourceIndex(0) name (MyClass)
|
||||
4 >Emitted(8, 44) Source(12, 21) + SourceIndex(0) name (MyClass)
|
||||
5 >Emitted(8, 49) Source(12, 34) + SourceIndex(0) name (MyClass)
|
||||
---
|
||||
>>> };
|
||||
1 >^^^^
|
||||
@@ -123,8 +133,8 @@ sourceFile:out-flag.ts
|
||||
> //
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(8, 5) Source(15, 5) + SourceIndex(0) name (MyClass.SetCount)
|
||||
2 >Emitted(8, 6) Source(15, 6) + SourceIndex(0) name (MyClass.SetCount)
|
||||
1 >Emitted(9, 5) Source(15, 5) + SourceIndex(0) name (MyClass.SetCount)
|
||||
2 >Emitted(9, 6) Source(15, 6) + SourceIndex(0) name (MyClass.SetCount)
|
||||
---
|
||||
>>> return MyClass;
|
||||
1->^^^^
|
||||
@@ -132,8 +142,8 @@ sourceFile:out-flag.ts
|
||||
1->
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(9, 5) Source(16, 1) + SourceIndex(0) name (MyClass)
|
||||
2 >Emitted(9, 19) Source(16, 2) + SourceIndex(0) name (MyClass)
|
||||
1->Emitted(10, 5) Source(16, 1) + SourceIndex(0) name (MyClass)
|
||||
2 >Emitted(10, 19) Source(16, 2) + SourceIndex(0) name (MyClass)
|
||||
---
|
||||
>>>})();
|
||||
1 >
|
||||
@@ -157,9 +167,9 @@ sourceFile:out-flag.ts
|
||||
> //
|
||||
> }
|
||||
> }
|
||||
1 >Emitted(10, 1) Source(16, 1) + SourceIndex(0) name (MyClass)
|
||||
2 >Emitted(10, 2) Source(16, 2) + SourceIndex(0) name (MyClass)
|
||||
3 >Emitted(10, 2) Source(4, 1) + SourceIndex(0)
|
||||
4 >Emitted(10, 6) Source(16, 2) + SourceIndex(0)
|
||||
1 >Emitted(11, 1) Source(16, 1) + SourceIndex(0) name (MyClass)
|
||||
2 >Emitted(11, 2) Source(16, 2) + SourceIndex(0) name (MyClass)
|
||||
3 >Emitted(11, 2) Source(4, 1) + SourceIndex(0)
|
||||
4 >Emitted(11, 6) Source(16, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=out-flag.js.map
|
||||
@@ -23,6 +23,7 @@ var A;
|
||||
var B;
|
||||
(function (B) {
|
||||
})(B || (B = {}));
|
||||
// should be ok
|
||||
function foo(x) {
|
||||
}
|
||||
var C = (function () {
|
||||
@@ -30,5 +31,6 @@ var C = (function () {
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
// should be ok
|
||||
function foo1(x) {
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ var Bugs;
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
// replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string;
|
||||
function bug2(message) {
|
||||
var args = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
|
||||
@@ -27,6 +27,15 @@ runTestCase(testcase);
|
||||
|
||||
|
||||
//// [parser15.4.4.14-9-2.js]
|
||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
/// Ecma International makes this code available under the terms and conditions set
|
||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||
/**
|
||||
* @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-2.js
|
||||
* @description Array.prototype.indexOf must return correct index (Number)
|
||||
*/
|
||||
function testcase() {
|
||||
var obj = { toString: function () {
|
||||
return 0;
|
||||
|
||||
@@ -147,10 +147,12 @@ exports.publicClass = publicClass;
|
||||
var publicClassWithWithPrivateTypeParameters = (function () {
|
||||
function publicClassWithWithPrivateTypeParameters() {
|
||||
}
|
||||
// TypeParameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1
|
||||
publicClassWithWithPrivateTypeParameters.myPublicStaticMethod = function () {
|
||||
};
|
||||
publicClassWithWithPrivateTypeParameters.myPrivateStaticMethod = function () {
|
||||
};
|
||||
// TypeParameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1
|
||||
publicClassWithWithPrivateTypeParameters.prototype.myPublicMethod = function () {
|
||||
};
|
||||
publicClassWithWithPrivateTypeParameters.prototype.myPrivateMethod = function () {
|
||||
@@ -198,6 +200,7 @@ var privateClassWithWithPublicTypeParameters = (function () {
|
||||
};
|
||||
return privateClassWithWithPublicTypeParameters;
|
||||
})();
|
||||
// TypeParameter_0_of_exported_function_has_or_is_using_private_type_1
|
||||
function publicFunctionWithPrivateTypeParameters() {
|
||||
}
|
||||
exports.publicFunctionWithPrivateTypeParameters = publicFunctionWithPrivateTypeParameters;
|
||||
|
||||
@@ -195,6 +195,7 @@ var Sample;
|
||||
function Mode() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
// scenario 2
|
||||
Mode.prototype.getInitialState = function () {
|
||||
return new State(self);
|
||||
};
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
//// [recursiveClassReferenceTest.js.map]
|
||||
{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":["Sample","Sample.Actions","Sample.Actions.Thing","Sample.Actions.Thing.Find","Sample.Actions.Thing.Find.StartFindAction","Sample.Actions.Thing.Find.StartFindAction.constructor","Sample.Actions.Thing.Find.StartFindAction.getId","Sample.Actions.Thing.Find.StartFindAction.run","Sample.Thing","Sample.Thing.Widgets","Sample.Thing.Widgets.FindWidget","Sample.Thing.Widgets.FindWidget.constructor","Sample.Thing.Widgets.FindWidget.gar","Sample.Thing.Widgets.FindWidget.getDomNode","Sample.Thing.Widgets.FindWidget.destroy","AbstractMode","AbstractMode.constructor","AbstractMode.getInitialState","Sample.Thing.Languages","Sample.Thing.Languages.PlainText","Sample.Thing.Languages.PlainText.State","Sample.Thing.Languages.PlainText.State.constructor","Sample.Thing.Languages.PlainText.State.clone","Sample.Thing.Languages.PlainText.State.equals","Sample.Thing.Languages.PlainText.State.getMode","Sample.Thing.Languages.PlainText.Mode","Sample.Thing.Languages.PlainText.Mode.constructor","Sample.Thing.Languages.PlainText.Mode.getInitialState"],"mappings":"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"}
|
||||
{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":["Sample","Sample.Actions","Sample.Actions.Thing","Sample.Actions.Thing.Find","Sample.Actions.Thing.Find.StartFindAction","Sample.Actions.Thing.Find.StartFindAction.constructor","Sample.Actions.Thing.Find.StartFindAction.getId","Sample.Actions.Thing.Find.StartFindAction.run","Sample.Thing","Sample.Thing.Widgets","Sample.Thing.Widgets.FindWidget","Sample.Thing.Widgets.FindWidget.constructor","Sample.Thing.Widgets.FindWidget.gar","Sample.Thing.Widgets.FindWidget.getDomNode","Sample.Thing.Widgets.FindWidget.destroy","AbstractMode","AbstractMode.constructor","AbstractMode.getInitialState","Sample.Thing.Languages","Sample.Thing.Languages.PlainText","Sample.Thing.Languages.PlainText.State","Sample.Thing.Languages.PlainText.State.constructor","Sample.Thing.Languages.PlainText.State.clone","Sample.Thing.Languages.PlainText.State.equals","Sample.Thing.Languages.PlainText.State.getMode","Sample.Thing.Languages.PlainText.Mode","Sample.Thing.Languages.PlainText.Mode.constructor","Sample.Thing.Languages.PlainText.Mode.getInitialState"],"mappings":"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"}
|
||||
@@ -1685,7 +1685,7 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
>>> }
|
||||
1 >^^^^^^^^^^^^^^^^^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
3 > ^^^^^^^^^^^^^->
|
||||
1 > {
|
||||
>
|
||||
> // scenario 2
|
||||
@@ -1699,16 +1699,26 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
1 >Emitted(92, 21) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor)
|
||||
2 >Emitted(92, 22) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor)
|
||||
---
|
||||
>>> // scenario 2
|
||||
1->^^^^^^^^^^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1->
|
||||
2 > // scenario 2
|
||||
1->Emitted(93, 21) Source(93, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
2 >Emitted(93, 34) Source(93, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
---
|
||||
>>> Mode.prototype.getInitialState = function () {
|
||||
1->^^^^^^^^^^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^
|
||||
1->
|
||||
1->
|
||||
> public
|
||||
2 > getInitialState
|
||||
3 >
|
||||
1->Emitted(93, 21) Source(94, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
2 >Emitted(93, 51) Source(94, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
3 >Emitted(93, 54) Source(94, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
1->Emitted(94, 21) Source(94, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
2 >Emitted(94, 51) Source(94, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
3 >Emitted(94, 54) Source(94, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
---
|
||||
>>> return new State(self);
|
||||
1 >^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -1730,15 +1740,15 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
7 > self
|
||||
8 > )
|
||||
9 > ;
|
||||
1 >Emitted(94, 25) Source(95, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
2 >Emitted(94, 31) Source(95, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
3 >Emitted(94, 32) Source(95, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
4 >Emitted(94, 36) Source(95, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
5 >Emitted(94, 41) Source(95, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
6 >Emitted(94, 42) Source(95, 21) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
7 >Emitted(94, 46) Source(95, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
8 >Emitted(94, 47) Source(95, 26) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
9 >Emitted(94, 48) Source(95, 27) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
1 >Emitted(95, 25) Source(95, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
2 >Emitted(95, 31) Source(95, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
3 >Emitted(95, 32) Source(95, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
4 >Emitted(95, 36) Source(95, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
5 >Emitted(95, 41) Source(95, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
6 >Emitted(95, 42) Source(95, 21) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
7 >Emitted(95, 46) Source(95, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
8 >Emitted(95, 47) Source(95, 26) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
9 >Emitted(95, 48) Source(95, 27) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
---
|
||||
>>> };
|
||||
1 >^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -1747,8 +1757,8 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(95, 21) Source(96, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
2 >Emitted(95, 22) Source(96, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
1 >Emitted(96, 21) Source(96, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
2 >Emitted(96, 22) Source(96, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState)
|
||||
---
|
||||
>>> return Mode;
|
||||
1->^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -1759,8 +1769,8 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
>
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(96, 21) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
2 >Emitted(96, 32) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
1->Emitted(97, 21) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
2 >Emitted(97, 32) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
---
|
||||
>>> })(AbstractMode);
|
||||
1->^^^^^^^^^^^^^^^^
|
||||
@@ -1784,12 +1794,12 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
>
|
||||
>
|
||||
> }
|
||||
1->Emitted(97, 17) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
2 >Emitted(97, 18) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
3 >Emitted(97, 18) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
4 >Emitted(97, 20) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
5 >Emitted(97, 32) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
6 >Emitted(97, 34) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
1->Emitted(98, 17) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
2 >Emitted(98, 18) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode)
|
||||
3 >Emitted(98, 18) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
4 >Emitted(98, 20) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
5 >Emitted(98, 32) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
6 >Emitted(98, 34) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
---
|
||||
>>> PlainText.Mode = Mode;
|
||||
1->^^^^^^^^^^^^^^^^
|
||||
@@ -1811,11 +1821,11 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
>
|
||||
> }
|
||||
5 >
|
||||
1->Emitted(98, 17) Source(91, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
2 >Emitted(98, 31) Source(91, 19) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
3 >Emitted(98, 34) Source(91, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
4 >Emitted(98, 38) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
5 >Emitted(98, 39) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
1->Emitted(99, 17) Source(91, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
2 >Emitted(99, 31) Source(91, 19) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
3 >Emitted(99, 34) Source(91, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
4 >Emitted(99, 38) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
5 >Emitted(99, 39) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
---
|
||||
>>> })(Languages.PlainText || (Languages.PlainText = {}));
|
||||
1->^^^^^^^^^^^^
|
||||
@@ -1857,13 +1867,13 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
>
|
||||
> }
|
||||
> }
|
||||
1->Emitted(99, 13) Source(100, 1) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
2 >Emitted(99, 14) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
3 >Emitted(99, 16) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
4 >Emitted(99, 35) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
5 >Emitted(99, 40) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
6 >Emitted(99, 59) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
7 >Emitted(99, 67) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
1->Emitted(100, 13) Source(100, 1) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
2 >Emitted(100, 14) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText)
|
||||
3 >Emitted(100, 16) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
4 >Emitted(100, 35) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
5 >Emitted(100, 40) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
6 >Emitted(100, 59) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
7 >Emitted(100, 67) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
---
|
||||
>>> var PlainText = Languages.PlainText;
|
||||
1 >^^^^^^^^^^^^
|
||||
@@ -1903,12 +1913,12 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
> }
|
||||
> }
|
||||
6 >
|
||||
1 >Emitted(100, 13) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
2 >Emitted(100, 17) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
3 >Emitted(100, 26) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
4 >Emitted(100, 29) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
5 >Emitted(100, 48) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
6 >Emitted(100, 49) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
1 >Emitted(101, 13) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
2 >Emitted(101, 17) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
3 >Emitted(101, 26) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
4 >Emitted(101, 29) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
5 >Emitted(101, 48) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
6 >Emitted(101, 49) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
---
|
||||
>>> })(Thing.Languages || (Thing.Languages = {}));
|
||||
1->^^^^^^^^
|
||||
@@ -1949,13 +1959,13 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
>
|
||||
> }
|
||||
> }
|
||||
1->Emitted(101, 9) Source(100, 1) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
2 >Emitted(101, 10) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
3 >Emitted(101, 12) Source(76, 21) + SourceIndex(0) name (Sample.Thing)
|
||||
4 >Emitted(101, 27) Source(76, 30) + SourceIndex(0) name (Sample.Thing)
|
||||
5 >Emitted(101, 32) Source(76, 21) + SourceIndex(0) name (Sample.Thing)
|
||||
6 >Emitted(101, 47) Source(76, 30) + SourceIndex(0) name (Sample.Thing)
|
||||
7 >Emitted(101, 55) Source(100, 2) + SourceIndex(0) name (Sample.Thing)
|
||||
1->Emitted(102, 9) Source(100, 1) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
2 >Emitted(102, 10) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages)
|
||||
3 >Emitted(102, 12) Source(76, 21) + SourceIndex(0) name (Sample.Thing)
|
||||
4 >Emitted(102, 27) Source(76, 30) + SourceIndex(0) name (Sample.Thing)
|
||||
5 >Emitted(102, 32) Source(76, 21) + SourceIndex(0) name (Sample.Thing)
|
||||
6 >Emitted(102, 47) Source(76, 30) + SourceIndex(0) name (Sample.Thing)
|
||||
7 >Emitted(102, 55) Source(100, 2) + SourceIndex(0) name (Sample.Thing)
|
||||
---
|
||||
>>> var Languages = Thing.Languages;
|
||||
1 >^^^^^^^^
|
||||
@@ -1995,12 +2005,12 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
> }
|
||||
> }
|
||||
6 >
|
||||
1 >Emitted(102, 9) Source(76, 21) + SourceIndex(0) name (Sample.Thing)
|
||||
2 >Emitted(102, 13) Source(76, 21) + SourceIndex(0) name (Sample.Thing)
|
||||
3 >Emitted(102, 22) Source(76, 30) + SourceIndex(0) name (Sample.Thing)
|
||||
4 >Emitted(102, 25) Source(76, 21) + SourceIndex(0) name (Sample.Thing)
|
||||
5 >Emitted(102, 40) Source(100, 2) + SourceIndex(0) name (Sample.Thing)
|
||||
6 >Emitted(102, 41) Source(100, 2) + SourceIndex(0) name (Sample.Thing)
|
||||
1 >Emitted(103, 9) Source(76, 21) + SourceIndex(0) name (Sample.Thing)
|
||||
2 >Emitted(103, 13) Source(76, 21) + SourceIndex(0) name (Sample.Thing)
|
||||
3 >Emitted(103, 22) Source(76, 30) + SourceIndex(0) name (Sample.Thing)
|
||||
4 >Emitted(103, 25) Source(76, 21) + SourceIndex(0) name (Sample.Thing)
|
||||
5 >Emitted(103, 40) Source(100, 2) + SourceIndex(0) name (Sample.Thing)
|
||||
6 >Emitted(103, 41) Source(100, 2) + SourceIndex(0) name (Sample.Thing)
|
||||
---
|
||||
>>> })(Sample.Thing || (Sample.Thing = {}));
|
||||
1->^^^^
|
||||
@@ -2041,13 +2051,13 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
>
|
||||
> }
|
||||
> }
|
||||
1->Emitted(103, 5) Source(100, 1) + SourceIndex(0) name (Sample.Thing)
|
||||
2 >Emitted(103, 6) Source(100, 2) + SourceIndex(0) name (Sample.Thing)
|
||||
3 >Emitted(103, 8) Source(76, 15) + SourceIndex(0) name (Sample)
|
||||
4 >Emitted(103, 20) Source(76, 20) + SourceIndex(0) name (Sample)
|
||||
5 >Emitted(103, 25) Source(76, 15) + SourceIndex(0) name (Sample)
|
||||
6 >Emitted(103, 37) Source(76, 20) + SourceIndex(0) name (Sample)
|
||||
7 >Emitted(103, 45) Source(100, 2) + SourceIndex(0) name (Sample)
|
||||
1->Emitted(104, 5) Source(100, 1) + SourceIndex(0) name (Sample.Thing)
|
||||
2 >Emitted(104, 6) Source(100, 2) + SourceIndex(0) name (Sample.Thing)
|
||||
3 >Emitted(104, 8) Source(76, 15) + SourceIndex(0) name (Sample)
|
||||
4 >Emitted(104, 20) Source(76, 20) + SourceIndex(0) name (Sample)
|
||||
5 >Emitted(104, 25) Source(76, 15) + SourceIndex(0) name (Sample)
|
||||
6 >Emitted(104, 37) Source(76, 20) + SourceIndex(0) name (Sample)
|
||||
7 >Emitted(104, 45) Source(100, 2) + SourceIndex(0) name (Sample)
|
||||
---
|
||||
>>> var Thing = Sample.Thing;
|
||||
1 >^^^^
|
||||
@@ -2086,12 +2096,12 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
> }
|
||||
> }
|
||||
6 >
|
||||
1 >Emitted(104, 5) Source(76, 15) + SourceIndex(0) name (Sample)
|
||||
2 >Emitted(104, 9) Source(76, 15) + SourceIndex(0) name (Sample)
|
||||
3 >Emitted(104, 14) Source(76, 20) + SourceIndex(0) name (Sample)
|
||||
4 >Emitted(104, 17) Source(76, 15) + SourceIndex(0) name (Sample)
|
||||
5 >Emitted(104, 29) Source(100, 2) + SourceIndex(0) name (Sample)
|
||||
6 >Emitted(104, 30) Source(100, 2) + SourceIndex(0) name (Sample)
|
||||
1 >Emitted(105, 5) Source(76, 15) + SourceIndex(0) name (Sample)
|
||||
2 >Emitted(105, 9) Source(76, 15) + SourceIndex(0) name (Sample)
|
||||
3 >Emitted(105, 14) Source(76, 20) + SourceIndex(0) name (Sample)
|
||||
4 >Emitted(105, 17) Source(76, 15) + SourceIndex(0) name (Sample)
|
||||
5 >Emitted(105, 29) Source(100, 2) + SourceIndex(0) name (Sample)
|
||||
6 >Emitted(105, 30) Source(100, 2) + SourceIndex(0) name (Sample)
|
||||
---
|
||||
>>>})(Sample || (Sample = {}));
|
||||
1 >
|
||||
@@ -2133,12 +2143,12 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
>
|
||||
> }
|
||||
> }
|
||||
1 >Emitted(105, 1) Source(100, 1) + SourceIndex(0) name (Sample)
|
||||
2 >Emitted(105, 2) Source(100, 2) + SourceIndex(0) name (Sample)
|
||||
3 >Emitted(105, 4) Source(76, 8) + SourceIndex(0)
|
||||
4 >Emitted(105, 10) Source(76, 14) + SourceIndex(0)
|
||||
5 >Emitted(105, 15) Source(76, 8) + SourceIndex(0)
|
||||
6 >Emitted(105, 21) Source(76, 14) + SourceIndex(0)
|
||||
7 >Emitted(105, 29) Source(100, 2) + SourceIndex(0)
|
||||
1 >Emitted(106, 1) Source(100, 1) + SourceIndex(0) name (Sample)
|
||||
2 >Emitted(106, 2) Source(100, 2) + SourceIndex(0) name (Sample)
|
||||
3 >Emitted(106, 4) Source(76, 8) + SourceIndex(0)
|
||||
4 >Emitted(106, 10) Source(76, 14) + SourceIndex(0)
|
||||
5 >Emitted(106, 15) Source(76, 8) + SourceIndex(0)
|
||||
6 >Emitted(106, 21) Source(76, 14) + SourceIndex(0)
|
||||
7 >Emitted(106, 29) Source(100, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=recursiveClassReferenceTest.js.map
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user