fix(40901): skip checking custom arguments name in a constructor (#40912)
This commit is contained in:
parent
373b352333
commit
f646ec87fc
|
@ -11709,7 +11709,7 @@ namespace ts {
|
|||
if (!node) return false;
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.Identifier:
|
||||
return (<Identifier>node).escapedText === "arguments" && isExpressionNode(node);
|
||||
return (<Identifier>node).escapedText === argumentsSymbol.escapedName && getResolvedSymbol(<Identifier>node) === argumentsSymbol;
|
||||
|
||||
case SyntaxKind.PropertyDeclaration:
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
|
@ -11718,6 +11718,10 @@ namespace ts {
|
|||
return (<NamedDeclaration>node).name!.kind === SyntaxKind.ComputedPropertyName
|
||||
&& traverse((<NamedDeclaration>node).name!);
|
||||
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
case SyntaxKind.ElementAccessExpression:
|
||||
return traverse((<PropertyAccessExpression | ElementAccessExpression>node).expression);
|
||||
|
||||
default:
|
||||
return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && !!forEachChild(node, traverse);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
//// [a.js]
|
||||
class A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.arguments = foo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare class A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo?: object);
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
arguments: object;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
>foo : Symbol(foo, Decl(a.js, 6, 13))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.arguments = foo;
|
||||
>this.arguments : Symbol(A.arguments, Decl(a.js, 6, 24))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>arguments : Symbol(A.arguments, Decl(a.js, 6, 24))
|
||||
>foo : Symbol(foo, Decl(a.js, 6, 13))
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
>foo : any
|
||||
>{} : {}
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.arguments = foo;
|
||||
>this.arguments = foo : any
|
||||
>this.arguments : any
|
||||
>this : this
|
||||
>arguments : any
|
||||
>foo : any
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
//// [a.js]
|
||||
class A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this["arguments"] = foo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare class A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo?: object);
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
arguments: object;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
>foo : Symbol(foo, Decl(a.js, 6, 13))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this["arguments"] = foo;
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>"arguments" : Symbol(A["arguments"], Decl(a.js, 6, 24))
|
||||
>foo : Symbol(foo, Decl(a.js, 6, 13))
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
>foo : any
|
||||
>{} : {}
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this["arguments"] = foo;
|
||||
>this["arguments"] = foo : any
|
||||
>this["arguments"] : any
|
||||
>this : this
|
||||
>"arguments" : "arguments"
|
||||
>foo : any
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
//// [a.js]
|
||||
class A {
|
||||
get arguments() {
|
||||
return { bar: {} };
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
super();
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = super.arguments.foo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare class A {
|
||||
get arguments(): {
|
||||
bar: {};
|
||||
};
|
||||
}
|
||||
declare class B extends A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo?: object);
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
foo: object;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
bar: object;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
get arguments() {
|
||||
>arguments : Symbol(A.arguments, Decl(a.js, 0, 9))
|
||||
|
||||
return { bar: {} };
|
||||
>bar : Symbol(bar, Decl(a.js, 2, 10))
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
>B : Symbol(B, Decl(a.js, 4, 1))
|
||||
>A : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
>foo : Symbol(foo, Decl(a.js, 12, 13))
|
||||
|
||||
super();
|
||||
>super : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
>this.foo : Symbol(B.foo, Decl(a.js, 13, 10))
|
||||
>this : Symbol(B, Decl(a.js, 4, 1))
|
||||
>foo : Symbol(B.foo, Decl(a.js, 13, 10))
|
||||
>foo : Symbol(foo, Decl(a.js, 12, 13))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = super.arguments.foo;
|
||||
>this.bar : Symbol(B.bar, Decl(a.js, 18, 17))
|
||||
>this : Symbol(B, Decl(a.js, 4, 1))
|
||||
>bar : Symbol(B.bar, Decl(a.js, 18, 17))
|
||||
>super.arguments : Symbol(A.arguments, Decl(a.js, 0, 9))
|
||||
>super : Symbol(A, Decl(a.js, 0, 0))
|
||||
>arguments : Symbol(A.arguments, Decl(a.js, 0, 9))
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
get arguments() {
|
||||
>arguments : { bar: {}; }
|
||||
|
||||
return { bar: {} };
|
||||
>{ bar: {} } : { bar: {}; }
|
||||
>bar : {}
|
||||
>{} : {}
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
>B : B
|
||||
>A : A
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
>foo : any
|
||||
>{} : {}
|
||||
|
||||
super();
|
||||
>super() : void
|
||||
>super : typeof A
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
>this.foo = foo : any
|
||||
>this.foo : any
|
||||
>this : this
|
||||
>foo : any
|
||||
>foo : any
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = super.arguments.foo;
|
||||
>this.bar = super.arguments.foo : any
|
||||
>this.bar : any
|
||||
>this : this
|
||||
>bar : any
|
||||
>super.arguments.foo : any
|
||||
>super.arguments : { bar: {}; }
|
||||
>super : A
|
||||
>arguments : { bar: {}; }
|
||||
>foo : any
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
//// [a.js]
|
||||
class A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
const key = "bar";
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
const arguments = this.arguments;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = arguments.bar;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.baz = arguments[key];
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.options = arguments;
|
||||
}
|
||||
|
||||
get arguments() {
|
||||
return { bar: {} };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare class A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo?: object);
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
foo: object;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
bar: object;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
baz: object;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
options: object;
|
||||
get arguments(): {
|
||||
bar: {};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
>foo : Symbol(foo, Decl(a.js, 6, 13))
|
||||
|
||||
const key = "bar";
|
||||
>key : Symbol(key, Decl(a.js, 7, 7))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
>this.foo : Symbol(A.foo, Decl(a.js, 7, 20))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>foo : Symbol(A.foo, Decl(a.js, 7, 20))
|
||||
>foo : Symbol(foo, Decl(a.js, 6, 13))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
const arguments = this.arguments;
|
||||
>arguments : Symbol(arguments, Decl(a.js, 17, 7))
|
||||
>this.arguments : Symbol(A.arguments, Decl(a.js, 33, 2))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>arguments : Symbol(A.arguments, Decl(a.js, 33, 2))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = arguments.bar;
|
||||
>this.bar : Symbol(A.bar, Decl(a.js, 17, 35))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>bar : Symbol(A.bar, Decl(a.js, 17, 35))
|
||||
>arguments : Symbol(arguments, Decl(a.js, 17, 7))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.baz = arguments[key];
|
||||
>this.baz : Symbol(A.baz, Decl(a.js, 22, 27))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>baz : Symbol(A.baz, Decl(a.js, 22, 27))
|
||||
>arguments : Symbol(arguments, Decl(a.js, 17, 7))
|
||||
>key : Symbol(key, Decl(a.js, 7, 7))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.options = arguments;
|
||||
>this.options : Symbol(A.options, Decl(a.js, 27, 28))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>options : Symbol(A.options, Decl(a.js, 27, 28))
|
||||
>arguments : Symbol(arguments, Decl(a.js, 17, 7))
|
||||
}
|
||||
|
||||
get arguments() {
|
||||
>arguments : Symbol(A.arguments, Decl(a.js, 33, 2))
|
||||
|
||||
return { bar: {} };
|
||||
>bar : Symbol(bar, Decl(a.js, 36, 10))
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
>foo : any
|
||||
>{} : {}
|
||||
|
||||
const key = "bar";
|
||||
>key : "bar"
|
||||
>"bar" : "bar"
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
>this.foo = foo : any
|
||||
>this.foo : any
|
||||
>this : this
|
||||
>foo : any
|
||||
>foo : any
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
const arguments = this.arguments;
|
||||
>arguments : any
|
||||
>this.arguments : { bar: {}; }
|
||||
>this : this
|
||||
>arguments : { bar: {}; }
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = arguments.bar;
|
||||
>this.bar = arguments.bar : any
|
||||
>this.bar : any
|
||||
>this : this
|
||||
>bar : any
|
||||
>arguments.bar : any
|
||||
>arguments : any
|
||||
>bar : any
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.baz = arguments[key];
|
||||
>this.baz = arguments[key] : any
|
||||
>this.baz : any
|
||||
>this : this
|
||||
>baz : any
|
||||
>arguments[key] : any
|
||||
>arguments : any
|
||||
>key : "bar"
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.options = arguments;
|
||||
>this.options = arguments : any
|
||||
>this.options : any
|
||||
>this : this
|
||||
>options : any
|
||||
>arguments : any
|
||||
}
|
||||
|
||||
get arguments() {
|
||||
>arguments : { bar: {}; }
|
||||
|
||||
return { bar: {} };
|
||||
>{ bar: {} } : { bar: {}; }
|
||||
>bar : {}
|
||||
>{} : {}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
//// [a.js]
|
||||
const bar = {
|
||||
arguments: {}
|
||||
}
|
||||
|
||||
class A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = bar.arguments;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare namespace bar {
|
||||
const arguments: {};
|
||||
}
|
||||
declare class A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo?: object);
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
foo: object;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
bar: object;
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
=== /a.js ===
|
||||
const bar = {
|
||||
>bar : Symbol(bar, Decl(a.js, 0, 5))
|
||||
|
||||
arguments: {}
|
||||
>arguments : Symbol(arguments, Decl(a.js, 0, 13))
|
||||
}
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(a.js, 2, 1))
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
>foo : Symbol(foo, Decl(a.js, 10, 13))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
>this.foo : Symbol(A.foo, Decl(a.js, 10, 24))
|
||||
>this : Symbol(A, Decl(a.js, 2, 1))
|
||||
>foo : Symbol(A.foo, Decl(a.js, 10, 24))
|
||||
>foo : Symbol(foo, Decl(a.js, 10, 13))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = bar.arguments;
|
||||
>this.bar : Symbol(A.bar, Decl(a.js, 14, 17))
|
||||
>this : Symbol(A, Decl(a.js, 2, 1))
|
||||
>bar : Symbol(A.bar, Decl(a.js, 14, 17))
|
||||
>bar.arguments : Symbol(arguments, Decl(a.js, 0, 13))
|
||||
>bar : Symbol(bar, Decl(a.js, 0, 5))
|
||||
>arguments : Symbol(arguments, Decl(a.js, 0, 13))
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
=== /a.js ===
|
||||
const bar = {
|
||||
>bar : { arguments: {}; }
|
||||
>{ arguments: {}} : { arguments: {}; }
|
||||
|
||||
arguments: {}
|
||||
>arguments : {}
|
||||
>{} : {}
|
||||
}
|
||||
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
>foo : any
|
||||
>{} : {}
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
>this.foo = foo : any
|
||||
>this.foo : any
|
||||
>this : this
|
||||
>foo : any
|
||||
>foo : any
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = bar.arguments;
|
||||
>this.bar = bar.arguments : {}
|
||||
>this.bar : any
|
||||
>this : this
|
||||
>bar : any
|
||||
>bar.arguments : {}
|
||||
>bar : { arguments: {}; }
|
||||
>arguments : {}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
//// [a.js]
|
||||
class A {
|
||||
constructor() {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = arguments;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare class A {
|
||||
constructor(...args: any[]);
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
foo: object;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
constructor() {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = arguments;
|
||||
>this.foo : Symbol(A.foo, Decl(a.js, 1, 16))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>foo : Symbol(A.foo, Decl(a.js, 1, 16))
|
||||
>arguments : Symbol(arguments)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
constructor() {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = arguments;
|
||||
>this.foo = arguments : IArguments
|
||||
>this.foo : any
|
||||
>this : this
|
||||
>foo : any
|
||||
>arguments : IArguments
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
//// [a.js]
|
||||
class A {
|
||||
constructor() {
|
||||
/**
|
||||
* @type Function
|
||||
*/
|
||||
this.callee = arguments.callee;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare class A {
|
||||
constructor(...args: any[]);
|
||||
/**
|
||||
* @type Function
|
||||
*/
|
||||
callee: Function;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
constructor() {
|
||||
/**
|
||||
* @type Function
|
||||
*/
|
||||
this.callee = arguments.callee;
|
||||
>this.callee : Symbol(A.callee, Decl(a.js, 1, 16))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>callee : Symbol(A.callee, Decl(a.js, 1, 16))
|
||||
>arguments.callee : Symbol(IArguments.callee, Decl(lib.es5.d.ts, --, --))
|
||||
>arguments : Symbol(arguments)
|
||||
>callee : Symbol(IArguments.callee, Decl(lib.es5.d.ts, --, --))
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
constructor() {
|
||||
/**
|
||||
* @type Function
|
||||
*/
|
||||
this.callee = arguments.callee;
|
||||
>this.callee = arguments.callee : Function
|
||||
>this.callee : Function
|
||||
>this : this
|
||||
>callee : Function
|
||||
>arguments.callee : Function
|
||||
>arguments : IArguments
|
||||
>callee : Function
|
||||
}
|
||||
}
|
||||
|
27
tests/baselines/reference/argumentsReferenceInMethod1_Js.js
Normal file
27
tests/baselines/reference/argumentsReferenceInMethod1_Js.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
//// [a.js]
|
||||
class A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.arguments = foo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare class A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo?: object): void;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
arguments: object;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
>m : Symbol(A.m, Decl(a.js, 0, 9))
|
||||
>foo : Symbol(foo, Decl(a.js, 4, 3))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.arguments = foo;
|
||||
>this.arguments : Symbol(A.arguments, Decl(a.js, 4, 14))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>arguments : Symbol(A.arguments, Decl(a.js, 4, 14))
|
||||
>foo : Symbol(foo, Decl(a.js, 4, 3))
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
>m : (foo?: object) => void
|
||||
>foo : any
|
||||
>{} : {}
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.arguments = foo;
|
||||
>this.arguments = foo : any
|
||||
>this.arguments : any
|
||||
>this : this
|
||||
>arguments : any
|
||||
>foo : any
|
||||
}
|
||||
}
|
||||
|
27
tests/baselines/reference/argumentsReferenceInMethod2_Js.js
Normal file
27
tests/baselines/reference/argumentsReferenceInMethod2_Js.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
//// [a.js]
|
||||
class A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this["arguments"] = foo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare class A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo?: object): void;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
arguments: object;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
>m : Symbol(A.m, Decl(a.js, 0, 9))
|
||||
>foo : Symbol(foo, Decl(a.js, 4, 3))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this["arguments"] = foo;
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>"arguments" : Symbol(A["arguments"], Decl(a.js, 4, 14))
|
||||
>foo : Symbol(foo, Decl(a.js, 4, 3))
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
>m : (foo?: object) => void
|
||||
>foo : any
|
||||
>{} : {}
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this["arguments"] = foo;
|
||||
>this["arguments"] = foo : any
|
||||
>this["arguments"] : any
|
||||
>this : this
|
||||
>"arguments" : "arguments"
|
||||
>foo : any
|
||||
}
|
||||
}
|
||||
|
47
tests/baselines/reference/argumentsReferenceInMethod3_Js.js
Normal file
47
tests/baselines/reference/argumentsReferenceInMethod3_Js.js
Normal file
|
@ -0,0 +1,47 @@
|
|||
//// [a.js]
|
||||
class A {
|
||||
get arguments() {
|
||||
return { bar: {} };
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.x = foo;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.y = super.arguments.bar;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare class A {
|
||||
get arguments(): {
|
||||
bar: {};
|
||||
};
|
||||
}
|
||||
declare class B extends A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo?: object): void;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
x: object;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
y: object;
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
get arguments() {
|
||||
>arguments : Symbol(A.arguments, Decl(a.js, 0, 9))
|
||||
|
||||
return { bar: {} };
|
||||
>bar : Symbol(bar, Decl(a.js, 2, 10))
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
>B : Symbol(B, Decl(a.js, 4, 1))
|
||||
>A : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
>m : Symbol(B.m, Decl(a.js, 6, 19))
|
||||
>foo : Symbol(foo, Decl(a.js, 10, 3))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.x = foo;
|
||||
>this.x : Symbol(B.x, Decl(a.js, 10, 14))
|
||||
>this : Symbol(B, Decl(a.js, 4, 1))
|
||||
>x : Symbol(B.x, Decl(a.js, 10, 14))
|
||||
>foo : Symbol(foo, Decl(a.js, 10, 3))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.y = super.arguments.bar;
|
||||
>this.y : Symbol(B.y, Decl(a.js, 14, 15))
|
||||
>this : Symbol(B, Decl(a.js, 4, 1))
|
||||
>y : Symbol(B.y, Decl(a.js, 14, 15))
|
||||
>super.arguments.bar : Symbol(bar, Decl(a.js, 2, 10))
|
||||
>super.arguments : Symbol(A.arguments, Decl(a.js, 0, 9))
|
||||
>super : Symbol(A, Decl(a.js, 0, 0))
|
||||
>arguments : Symbol(A.arguments, Decl(a.js, 0, 9))
|
||||
>bar : Symbol(bar, Decl(a.js, 2, 10))
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
get arguments() {
|
||||
>arguments : { bar: {}; }
|
||||
|
||||
return { bar: {} };
|
||||
>{ bar: {} } : { bar: {}; }
|
||||
>bar : {}
|
||||
>{} : {}
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
>B : B
|
||||
>A : A
|
||||
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
>m : (foo?: object) => void
|
||||
>foo : any
|
||||
>{} : {}
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.x = foo;
|
||||
>this.x = foo : any
|
||||
>this.x : any
|
||||
>this : this
|
||||
>x : any
|
||||
>foo : any
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.y = super.arguments.bar;
|
||||
>this.y = super.arguments.bar : {}
|
||||
>this.y : any
|
||||
>this : this
|
||||
>y : any
|
||||
>super.arguments.bar : {}
|
||||
>super.arguments : { bar: {}; }
|
||||
>super : A
|
||||
>arguments : { bar: {}; }
|
||||
>bar : {}
|
||||
}
|
||||
}
|
||||
|
68
tests/baselines/reference/argumentsReferenceInMethod4_Js.js
Normal file
68
tests/baselines/reference/argumentsReferenceInMethod4_Js.js
Normal file
|
@ -0,0 +1,68 @@
|
|||
//// [a.js]
|
||||
class A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
const key = "bar";
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
const arguments = this.arguments;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = arguments.bar;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.baz = arguments[key];
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.options = arguments;
|
||||
}
|
||||
|
||||
get arguments() {
|
||||
return { bar: {} };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare class A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo?: object): void;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
foo: object;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
bar: object;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
baz: object;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
options: object;
|
||||
get arguments(): {
|
||||
bar: {};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
>m : Symbol(A.m, Decl(a.js, 0, 9))
|
||||
>foo : Symbol(foo, Decl(a.js, 4, 3))
|
||||
|
||||
const key = "bar";
|
||||
>key : Symbol(key, Decl(a.js, 5, 7))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
>this.foo : Symbol(A.foo, Decl(a.js, 5, 20))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>foo : Symbol(A.foo, Decl(a.js, 5, 20))
|
||||
>foo : Symbol(foo, Decl(a.js, 4, 3))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
const arguments = this.arguments;
|
||||
>arguments : Symbol(arguments, Decl(a.js, 15, 7))
|
||||
>this.arguments : Symbol(A.arguments, Decl(a.js, 31, 2))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>arguments : Symbol(A.arguments, Decl(a.js, 31, 2))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = arguments.bar;
|
||||
>this.bar : Symbol(A.bar, Decl(a.js, 15, 35))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>bar : Symbol(A.bar, Decl(a.js, 15, 35))
|
||||
>arguments : Symbol(arguments, Decl(a.js, 15, 7))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.baz = arguments[key];
|
||||
>this.baz : Symbol(A.baz, Decl(a.js, 20, 27))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>baz : Symbol(A.baz, Decl(a.js, 20, 27))
|
||||
>arguments : Symbol(arguments, Decl(a.js, 15, 7))
|
||||
>key : Symbol(key, Decl(a.js, 5, 7))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.options = arguments;
|
||||
>this.options : Symbol(A.options, Decl(a.js, 25, 28))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>options : Symbol(A.options, Decl(a.js, 25, 28))
|
||||
>arguments : Symbol(arguments, Decl(a.js, 15, 7))
|
||||
}
|
||||
|
||||
get arguments() {
|
||||
>arguments : Symbol(A.arguments, Decl(a.js, 31, 2))
|
||||
|
||||
return { bar: {} };
|
||||
>bar : Symbol(bar, Decl(a.js, 34, 10))
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
>m : (foo?: object) => void
|
||||
>foo : any
|
||||
>{} : {}
|
||||
|
||||
const key = "bar";
|
||||
>key : "bar"
|
||||
>"bar" : "bar"
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
>this.foo = foo : any
|
||||
>this.foo : any
|
||||
>this : this
|
||||
>foo : any
|
||||
>foo : any
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
const arguments = this.arguments;
|
||||
>arguments : any
|
||||
>this.arguments : { bar: {}; }
|
||||
>this : this
|
||||
>arguments : { bar: {}; }
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = arguments.bar;
|
||||
>this.bar = arguments.bar : any
|
||||
>this.bar : any
|
||||
>this : this
|
||||
>bar : any
|
||||
>arguments.bar : any
|
||||
>arguments : any
|
||||
>bar : any
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.baz = arguments[key];
|
||||
>this.baz = arguments[key] : any
|
||||
>this.baz : any
|
||||
>this : this
|
||||
>baz : any
|
||||
>arguments[key] : any
|
||||
>arguments : any
|
||||
>key : "bar"
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.options = arguments;
|
||||
>this.options = arguments : any
|
||||
>this.options : any
|
||||
>this : this
|
||||
>options : any
|
||||
>arguments : any
|
||||
}
|
||||
|
||||
get arguments() {
|
||||
>arguments : { bar: {}; }
|
||||
|
||||
return { bar: {} };
|
||||
>{ bar: {} } : { bar: {}; }
|
||||
>bar : {}
|
||||
>{} : {}
|
||||
}
|
||||
}
|
||||
|
43
tests/baselines/reference/argumentsReferenceInMethod5_Js.js
Normal file
43
tests/baselines/reference/argumentsReferenceInMethod5_Js.js
Normal file
|
@ -0,0 +1,43 @@
|
|||
//// [a.js]
|
||||
const bar = {
|
||||
arguments: {}
|
||||
}
|
||||
|
||||
class A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = bar.arguments;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare namespace bar {
|
||||
const arguments: {};
|
||||
}
|
||||
declare class A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo?: object): void;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
foo: object;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
bar: object;
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
=== /a.js ===
|
||||
const bar = {
|
||||
>bar : Symbol(bar, Decl(a.js, 0, 5))
|
||||
|
||||
arguments: {}
|
||||
>arguments : Symbol(arguments, Decl(a.js, 0, 13))
|
||||
}
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(a.js, 2, 1))
|
||||
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
>m : Symbol(A.m, Decl(a.js, 4, 9))
|
||||
>foo : Symbol(foo, Decl(a.js, 8, 3))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
>this.foo : Symbol(A.foo, Decl(a.js, 8, 14))
|
||||
>this : Symbol(A, Decl(a.js, 2, 1))
|
||||
>foo : Symbol(A.foo, Decl(a.js, 8, 14))
|
||||
>foo : Symbol(foo, Decl(a.js, 8, 3))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = bar.arguments;
|
||||
>this.bar : Symbol(A.bar, Decl(a.js, 12, 17))
|
||||
>this : Symbol(A, Decl(a.js, 2, 1))
|
||||
>bar : Symbol(A.bar, Decl(a.js, 12, 17))
|
||||
>bar.arguments : Symbol(arguments, Decl(a.js, 0, 13))
|
||||
>bar : Symbol(bar, Decl(a.js, 0, 5))
|
||||
>arguments : Symbol(arguments, Decl(a.js, 0, 13))
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
=== /a.js ===
|
||||
const bar = {
|
||||
>bar : { arguments: {}; }
|
||||
>{ arguments: {}} : { arguments: {}; }
|
||||
|
||||
arguments: {}
|
||||
>arguments : {}
|
||||
>{} : {}
|
||||
}
|
||||
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
>m : (foo?: object) => void
|
||||
>foo : any
|
||||
>{} : {}
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
>this.foo = foo : any
|
||||
>this.foo : any
|
||||
>this : this
|
||||
>foo : any
|
||||
>foo : any
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = bar.arguments;
|
||||
>this.bar = bar.arguments : {}
|
||||
>this.bar : any
|
||||
>this : this
|
||||
>bar : any
|
||||
>bar.arguments : {}
|
||||
>bar : { arguments: {}; }
|
||||
>arguments : {}
|
||||
}
|
||||
}
|
||||
|
21
tests/baselines/reference/argumentsReferenceInMethod6_Js.js
Normal file
21
tests/baselines/reference/argumentsReferenceInMethod6_Js.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
//// [a.js]
|
||||
class A {
|
||||
m() {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = arguments;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare class A {
|
||||
m(...args: any[]): void;
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
foo: object;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
m() {
|
||||
>m : Symbol(A.m, Decl(a.js, 0, 9))
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = arguments;
|
||||
>this.foo : Symbol(A.foo, Decl(a.js, 1, 6))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>foo : Symbol(A.foo, Decl(a.js, 1, 6))
|
||||
>arguments : Symbol(arguments)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
m() {
|
||||
>m : (...args: any[]) => void
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = arguments;
|
||||
>this.foo = arguments : IArguments
|
||||
>this.foo : any
|
||||
>this : this
|
||||
>foo : any
|
||||
>arguments : IArguments
|
||||
}
|
||||
}
|
||||
|
21
tests/baselines/reference/argumentsReferenceInMethod7_Js.js
Normal file
21
tests/baselines/reference/argumentsReferenceInMethod7_Js.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
//// [a.js]
|
||||
class A {
|
||||
m() {
|
||||
/**
|
||||
* @type Function
|
||||
*/
|
||||
this.callee = arguments.callee;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare class A {
|
||||
m(...args: any[]): void;
|
||||
/**
|
||||
* @type Function
|
||||
*/
|
||||
callee: Function;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(a.js, 0, 0))
|
||||
|
||||
m() {
|
||||
>m : Symbol(A.m, Decl(a.js, 0, 9))
|
||||
|
||||
/**
|
||||
* @type Function
|
||||
*/
|
||||
this.callee = arguments.callee;
|
||||
>this.callee : Symbol(A.callee, Decl(a.js, 1, 6))
|
||||
>this : Symbol(A, Decl(a.js, 0, 0))
|
||||
>callee : Symbol(A.callee, Decl(a.js, 1, 6))
|
||||
>arguments.callee : Symbol(IArguments.callee, Decl(lib.es5.d.ts, --, --))
|
||||
>arguments : Symbol(arguments)
|
||||
>callee : Symbol(IArguments.callee, Decl(lib.es5.d.ts, --, --))
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
=== /a.js ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
m() {
|
||||
>m : (...args: any[]) => void
|
||||
|
||||
/**
|
||||
* @type Function
|
||||
*/
|
||||
this.callee = arguments.callee;
|
||||
>this.callee = arguments.callee : Function
|
||||
>this.callee : Function
|
||||
>this : this
|
||||
>callee : Function
|
||||
>arguments.callee : Function
|
||||
>arguments : IArguments
|
||||
>callee : Function
|
||||
}
|
||||
}
|
||||
|
18
tests/cases/compiler/argumentsReferenceInConstructor1_Js.ts
Normal file
18
tests/cases/compiler/argumentsReferenceInConstructor1_Js.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @emitDeclarationOnly: true
|
||||
|
||||
// @filename: /a.js
|
||||
class A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.arguments = foo;
|
||||
}
|
||||
}
|
18
tests/cases/compiler/argumentsReferenceInConstructor2_Js.ts
Normal file
18
tests/cases/compiler/argumentsReferenceInConstructor2_Js.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @emitDeclarationOnly: true
|
||||
|
||||
// @filename: /a.js
|
||||
class A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this["arguments"] = foo;
|
||||
}
|
||||
}
|
31
tests/cases/compiler/argumentsReferenceInConstructor3_Js.ts
Normal file
31
tests/cases/compiler/argumentsReferenceInConstructor3_Js.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @emitDeclarationOnly: true
|
||||
|
||||
// @filename: /a.js
|
||||
class A {
|
||||
get arguments() {
|
||||
return { bar: {} };
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
super();
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = super.arguments.foo;
|
||||
}
|
||||
}
|
44
tests/cases/compiler/argumentsReferenceInConstructor4_Js.ts
Normal file
44
tests/cases/compiler/argumentsReferenceInConstructor4_Js.ts
Normal file
|
@ -0,0 +1,44 @@
|
|||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @emitDeclarationOnly: true
|
||||
|
||||
// @filename: /a.js
|
||||
class A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
const key = "bar";
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
const arguments = this.arguments;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = arguments.bar;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.baz = arguments[key];
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.options = arguments;
|
||||
}
|
||||
|
||||
get arguments() {
|
||||
return { bar: {} };
|
||||
}
|
||||
}
|
27
tests/cases/compiler/argumentsReferenceInConstructor5_Js.ts
Normal file
27
tests/cases/compiler/argumentsReferenceInConstructor5_Js.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @emitDeclarationOnly: true
|
||||
|
||||
// @filename: /a.js
|
||||
const bar = {
|
||||
arguments: {}
|
||||
}
|
||||
|
||||
class A {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
constructor(foo = {}) {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = bar.arguments;
|
||||
}
|
||||
}
|
13
tests/cases/compiler/argumentsReferenceInConstructor6_Js.ts
Normal file
13
tests/cases/compiler/argumentsReferenceInConstructor6_Js.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @emitDeclarationOnly: true
|
||||
|
||||
// @filename: /a.js
|
||||
class A {
|
||||
constructor() {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = arguments;
|
||||
}
|
||||
}
|
13
tests/cases/compiler/argumentsReferenceInConstructor7_Js.ts
Normal file
13
tests/cases/compiler/argumentsReferenceInConstructor7_Js.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @emitDeclarationOnly: true
|
||||
|
||||
// @filename: /a.js
|
||||
class A {
|
||||
constructor() {
|
||||
/**
|
||||
* @type Function
|
||||
*/
|
||||
this.callee = arguments.callee;
|
||||
}
|
||||
}
|
16
tests/cases/compiler/argumentsReferenceInMethod1_Js.ts
Normal file
16
tests/cases/compiler/argumentsReferenceInMethod1_Js.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @emitDeclarationOnly: true
|
||||
|
||||
// @filename: /a.js
|
||||
class A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.arguments = foo;
|
||||
}
|
||||
}
|
16
tests/cases/compiler/argumentsReferenceInMethod2_Js.ts
Normal file
16
tests/cases/compiler/argumentsReferenceInMethod2_Js.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @emitDeclarationOnly: true
|
||||
|
||||
// @filename: /a.js
|
||||
class A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this["arguments"] = foo;
|
||||
}
|
||||
}
|
27
tests/cases/compiler/argumentsReferenceInMethod3_Js.ts
Normal file
27
tests/cases/compiler/argumentsReferenceInMethod3_Js.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @emitDeclarationOnly: true
|
||||
|
||||
// @filename: /a.js
|
||||
class A {
|
||||
get arguments() {
|
||||
return { bar: {} };
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.x = foo;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.y = super.arguments.bar;
|
||||
}
|
||||
}
|
42
tests/cases/compiler/argumentsReferenceInMethod4_Js.ts
Normal file
42
tests/cases/compiler/argumentsReferenceInMethod4_Js.ts
Normal file
|
@ -0,0 +1,42 @@
|
|||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @emitDeclarationOnly: true
|
||||
|
||||
// @filename: /a.js
|
||||
class A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
const key = "bar";
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
const arguments = this.arguments;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = arguments.bar;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.baz = arguments[key];
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.options = arguments;
|
||||
}
|
||||
|
||||
get arguments() {
|
||||
return { bar: {} };
|
||||
}
|
||||
}
|
25
tests/cases/compiler/argumentsReferenceInMethod5_Js.ts
Normal file
25
tests/cases/compiler/argumentsReferenceInMethod5_Js.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @emitDeclarationOnly: true
|
||||
|
||||
// @filename: /a.js
|
||||
const bar = {
|
||||
arguments: {}
|
||||
}
|
||||
|
||||
class A {
|
||||
/**
|
||||
* @param {object} [foo={}]
|
||||
*/
|
||||
m(foo = {}) {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = foo;
|
||||
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.bar = bar.arguments;
|
||||
}
|
||||
}
|
13
tests/cases/compiler/argumentsReferenceInMethod6_Js.ts
Normal file
13
tests/cases/compiler/argumentsReferenceInMethod6_Js.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @emitDeclarationOnly: true
|
||||
|
||||
// @filename: /a.js
|
||||
class A {
|
||||
m() {
|
||||
/**
|
||||
* @type object
|
||||
*/
|
||||
this.foo = arguments;
|
||||
}
|
||||
}
|
13
tests/cases/compiler/argumentsReferenceInMethod7_Js.ts
Normal file
13
tests/cases/compiler/argumentsReferenceInMethod7_Js.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @emitDeclarationOnly: true
|
||||
|
||||
// @filename: /a.js
|
||||
class A {
|
||||
m() {
|
||||
/**
|
||||
* @type Function
|
||||
*/
|
||||
this.callee = arguments.callee;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue