Merge pull request #16122 from Microsoft/master-fix16092

[Master] ts-style @property
This commit is contained in:
Yui
2017-05-30 13:41:27 -07:00
committed by GitHub
19 changed files with 170 additions and 89 deletions

View File

@@ -6,7 +6,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 27,
"end": 28,
"atToken": {
"kind": "AtToken",
"pos": 8,
@@ -34,7 +34,7 @@
"end": 27,
"text": "name1"
},
"parameterName": {
"name": {
"kind": "Identifier",
"pos": 22,
"end": 27,
@@ -44,6 +44,6 @@
},
"length": 1,
"pos": 8,
"end": 27
"end": 28
}
}

View File

@@ -6,7 +6,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 32,
"end": 33,
"atToken": {
"kind": "AtToken",
"pos": 8,
@@ -34,7 +34,7 @@
"end": 32,
"text": "name1"
},
"parameterName": {
"name": {
"kind": "Identifier",
"pos": 27,
"end": 32,
@@ -44,6 +44,6 @@
},
"length": 1,
"pos": 8,
"end": 32
"end": 33
}
}

View File

@@ -6,7 +6,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 29,
"end": 30,
"atToken": {
"kind": "AtToken",
"pos": 8,
@@ -34,7 +34,7 @@
"end": 29,
"text": "name1"
},
"parameterName": {
"name": {
"kind": "Identifier",
"pos": 24,
"end": 29,
@@ -44,6 +44,6 @@
},
"length": 1,
"pos": 8,
"end": 29
"end": 30
}
}

View File

@@ -6,7 +6,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 29,
"end": 30,
"atToken": {
"kind": "AtToken",
"pos": 8,
@@ -34,7 +34,7 @@
"end": 29,
"text": "name1"
},
"parameterName": {
"name": {
"kind": "Identifier",
"pos": 24,
"end": 29,
@@ -44,6 +44,6 @@
},
"length": 1,
"pos": 8,
"end": 29
"end": 30
}
}

View File

@@ -34,7 +34,7 @@
"end": 30,
"text": "name1"
},
"parameterName": {
"name": {
"kind": "Identifier",
"pos": 25,
"end": 30,

View File

@@ -34,7 +34,7 @@
"end": 31,
"text": "name1"
},
"parameterName": {
"name": {
"kind": "Identifier",
"pos": 26,
"end": 31,

View File

@@ -34,7 +34,7 @@
"end": 28
}
},
"parameterName": {
"name": {
"kind": "Identifier",
"pos": 15,
"end": 20,

View File

@@ -34,7 +34,7 @@
"end": 28
}
},
"parameterName": {
"name": {
"kind": "Identifier",
"pos": 15,
"end": 20,

View File

@@ -6,7 +6,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 18,
"end": 19,
"atToken": {
"kind": "AtToken",
"pos": 8,
@@ -24,7 +24,7 @@
"end": 18,
"text": "foo"
},
"parameterName": {
"name": {
"kind": "Identifier",
"pos": 15,
"end": 18,
@@ -34,6 +34,6 @@
},
"length": 1,
"pos": 8,
"end": 18
"end": 19
}
}

View File

@@ -6,7 +6,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 29,
"end": 32,
"atToken": {
"kind": "AtToken",
"pos": 8,
@@ -34,7 +34,7 @@
"end": 29,
"text": "name1"
},
"parameterName": {
"name": {
"kind": "Identifier",
"pos": 24,
"end": 29,
@@ -45,7 +45,7 @@
"1": {
"kind": "JSDocParameterTag",
"pos": 34,
"end": 55,
"end": 56,
"atToken": {
"kind": "AtToken",
"pos": 34,
@@ -73,7 +73,7 @@
"end": 55,
"text": "name2"
},
"parameterName": {
"name": {
"kind": "Identifier",
"pos": 50,
"end": 55,
@@ -83,6 +83,6 @@
},
"length": 2,
"pos": 8,
"end": 55
"end": 56
}
}

View File

@@ -6,7 +6,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 29,
"end": 30,
"atToken": {
"kind": "AtToken",
"pos": 8,
@@ -34,7 +34,7 @@
"end": 29,
"text": "name1"
},
"parameterName": {
"name": {
"kind": "Identifier",
"pos": 24,
"end": 29,
@@ -45,7 +45,7 @@
"1": {
"kind": "JSDocParameterTag",
"pos": 30,
"end": 51,
"end": 52,
"atToken": {
"kind": "AtToken",
"pos": 30,
@@ -73,7 +73,7 @@
"end": 51,
"text": "name2"
},
"parameterName": {
"name": {
"kind": "Identifier",
"pos": 46,
"end": 51,
@@ -83,6 +83,6 @@
},
"length": 2,
"pos": 8,
"end": 51
"end": 52
}
}

View File

@@ -82,12 +82,6 @@
"end": 56,
"text": "property"
},
"name": {
"kind": "Identifier",
"pos": 66,
"end": 69,
"text": "age"
},
"typeExpression": {
"kind": "JSDocTypeExpression",
"pos": 57,
@@ -97,6 +91,18 @@
"pos": 58,
"end": 64
}
},
"postParameterName": {
"kind": "Identifier",
"pos": 66,
"end": 69,
"text": "age"
},
"name": {
"kind": "Identifier",
"pos": 66,
"end": 69,
"text": "age"
}
},
{
@@ -114,12 +120,6 @@
"end": 83,
"text": "property"
},
"name": {
"kind": "Identifier",
"pos": 93,
"end": 97,
"text": "name"
},
"typeExpression": {
"kind": "JSDocTypeExpression",
"pos": 84,
@@ -129,6 +129,18 @@
"pos": 85,
"end": 91
}
},
"postParameterName": {
"kind": "Identifier",
"pos": 93,
"end": 97,
"text": "name"
},
"name": {
"kind": "Identifier",
"pos": 93,
"end": 97,
"text": "name"
}
}
]

View File

@@ -15,6 +15,19 @@ function foo(opts) {
foo({x: 'abc'});
/**
* @typedef {Object} AnotherOpts
* @property anotherX {string}
* @property anotherY {string=}
*
* @param {AnotherOpts} opts
*/
function foo1(opts) {
opts.anotherX;
}
foo1({anotherX: "world"});
/**
* @typedef {object} Opts1
* @property {string} x
@@ -24,10 +37,10 @@ foo({x: 'abc'});
*
* @param {Opts1} opts
*/
function foo1(opts) {
function foo2(opts) {
opts.x;
}
foo1({x: 'abc'});
foo2({x: 'abc'});
//// [0.js]
@@ -45,6 +58,17 @@ function foo(opts) {
opts.x;
}
foo({ x: 'abc' });
/**
* @typedef {Object} AnotherOpts
* @property anotherX {string}
* @property anotherY {string=}
*
* @param {AnotherOpts} opts
*/
function foo1(opts) {
opts.anotherX;
}
foo1({ anotherX: "world" });
/**
* @typedef {object} Opts1
* @property {string} x
@@ -54,7 +78,7 @@ foo({ x: 'abc' });
*
* @param {Opts1} opts
*/
function foo1(opts) {
function foo2(opts) {
opts.x;
}
foo1({ x: 'abc' });
foo2({ x: 'abc' });

View File

@@ -23,6 +23,27 @@ foo({x: 'abc'});
>foo : Symbol(foo, Decl(0.js, 0, 0))
>x : Symbol(x, Decl(0.js, 14, 5))
/**
* @typedef {Object} AnotherOpts
* @property anotherX {string}
* @property anotherY {string=}
*
* @param {AnotherOpts} opts
*/
function foo1(opts) {
>foo1 : Symbol(foo1, Decl(0.js, 14, 16))
>opts : Symbol(opts, Decl(0.js, 23, 14))
opts.anotherX;
>opts.anotherX : Symbol(anotherX, Decl(0.js, 18, 3))
>opts : Symbol(opts, Decl(0.js, 23, 14))
>anotherX : Symbol(anotherX, Decl(0.js, 18, 3))
}
foo1({anotherX: "world"});
>foo1 : Symbol(foo1, Decl(0.js, 14, 16))
>anotherX : Symbol(anotherX, Decl(0.js, 27, 6))
/**
* @typedef {object} Opts1
* @property {string} x
@@ -32,16 +53,16 @@ foo({x: 'abc'});
*
* @param {Opts1} opts
*/
function foo1(opts) {
>foo1 : Symbol(foo1, Decl(0.js, 14, 16))
>opts : Symbol(opts, Decl(0.js, 25, 14))
function foo2(opts) {
>foo2 : Symbol(foo2, Decl(0.js, 27, 26))
>opts : Symbol(opts, Decl(0.js, 38, 14))
opts.x;
>opts.x : Symbol(x, Decl(0.js, 18, 3))
>opts : Symbol(opts, Decl(0.js, 25, 14))
>x : Symbol(x, Decl(0.js, 18, 3))
>opts.x : Symbol(x, Decl(0.js, 31, 3))
>opts : Symbol(opts, Decl(0.js, 38, 14))
>x : Symbol(x, Decl(0.js, 31, 3))
}
foo1({x: 'abc'});
>foo1 : Symbol(foo1, Decl(0.js, 14, 16))
>x : Symbol(x, Decl(0.js, 28, 6))
foo2({x: 'abc'});
>foo2 : Symbol(foo2, Decl(0.js, 27, 26))
>x : Symbol(x, Decl(0.js, 41, 6))

View File

@@ -26,6 +26,30 @@ foo({x: 'abc'});
>x : string
>'abc' : "abc"
/**
* @typedef {Object} AnotherOpts
* @property anotherX {string}
* @property anotherY {string=}
*
* @param {AnotherOpts} opts
*/
function foo1(opts) {
>foo1 : (opts: { anotherX: string; anotherY?: string; }) => void
>opts : { anotherX: string; anotherY?: string; }
opts.anotherX;
>opts.anotherX : string
>opts : { anotherX: string; anotherY?: string; }
>anotherX : string
}
foo1({anotherX: "world"});
>foo1({anotherX: "world"}) : void
>foo1 : (opts: { anotherX: string; anotherY?: string; }) => void
>{anotherX: "world"} : { anotherX: string; }
>anotherX : string
>"world" : "world"
/**
* @typedef {object} Opts1
* @property {string} x
@@ -35,8 +59,8 @@ foo({x: 'abc'});
*
* @param {Opts1} opts
*/
function foo1(opts) {
>foo1 : (opts: { x: string; y?: string; z?: string; w?: string; }) => void
function foo2(opts) {
>foo2 : (opts: { x: string; y?: string; z?: string; w?: string; }) => void
>opts : { x: string; y?: string; z?: string; w?: string; }
opts.x;
@@ -44,9 +68,9 @@ function foo1(opts) {
>opts : { x: string; y?: string; z?: string; w?: string; }
>x : string
}
foo1({x: 'abc'});
>foo1({x: 'abc'}) : void
>foo1 : (opts: { x: string; y?: string; z?: string; w?: string; }) => void
foo2({x: 'abc'});
>foo2({x: 'abc'}) : void
>foo2 : (opts: { x: string; y?: string; z?: string; w?: string; }) => void
>{x: 'abc'} : { x: string; }
>x : string
>'abc' : "abc"

View File

@@ -18,6 +18,19 @@ function foo(opts) {
foo({x: 'abc'});
/**
* @typedef {Object} AnotherOpts
* @property anotherX {string}
* @property anotherY {string=}
*
* @param {AnotherOpts} opts
*/
function foo1(opts) {
opts.anotherX;
}
foo1({anotherX: "world"});
/**
* @typedef {object} Opts1
* @property {string} x
@@ -27,7 +40,7 @@ foo({x: 'abc'});
*
* @param {Opts1} opts
*/
function foo1(opts) {
function foo2(opts) {
opts.x;
}
foo1({x: 'abc'});
foo2({x: 'abc'});