Merge pull request #17082 from Microsoft/master-16201

[Master] Fix 16201: fix cannot find "object"
This commit is contained in:
Yui 2017-07-11 17:13:01 -07:00 committed by GitHub
commit 25f4e46638
9 changed files with 84 additions and 4 deletions

View file

@ -6892,6 +6892,7 @@ namespace ts {
case "Null":
return nullType;
case "Object":
case "object":
return anyType;
case "Function":
case "function":

View file

@ -28,7 +28,17 @@ x1(0);
/** @type {function (number): number} */
const x2 = (a) => a + 1;
x2(0);
x2(0);
/**
* @type {object}
*/
var props = {};
/**
* @type {Object}
*/
var props = {};
//// [0.js]
// @ts-check
@ -54,3 +64,11 @@ x1(0);
/** @type {function (number): number} */
var x2 = function (a) { return a + 1; };
x2(0);
/**
* @type {object}
*/
var props = {};
/**
* @type {Object}
*/
var props = {};

View file

@ -58,3 +58,15 @@ const x2 = (a) => a + 1;
x2(0);
>x2 : Symbol(x2, Decl(0.js, 28, 5))
/**
* @type {object}
*/
var props = {};
>props : Symbol(props, Decl(0.js, 34, 3), Decl(0.js, 39, 3))
/**
* @type {Object}
*/
var props = {};
>props : Symbol(props, Decl(0.js, 34, 3), Decl(0.js, 39, 3))

View file

@ -86,3 +86,17 @@ x2(0);
>x2 : (arg0: number) => number
>0 : 0
/**
* @type {object}
*/
var props = {};
>props : any
>{} : {}
/**
* @type {Object}
*/
var props = {};
>props : any
>{} : {}

View file

@ -55,6 +55,9 @@ var nullable;
/** @type {Object} */
var Obj;
/** @type {object} */
var obj;
/** @type {Function} */
var Func;
@ -77,6 +80,7 @@ var P: Promise<any>;
var p: Promise<any>;
var nullable: number | null;
var Obj: any;
var obj: any;
var Func: Function;
@ -117,6 +121,8 @@ var p;
var nullable;
/** @type {Object} */
var Obj;
/** @type {object} */
var obj;
/** @type {Function} */
var Func;
//// [b.js]
@ -138,4 +144,5 @@ var P;
var p;
var nullable;
var Obj;
var obj;
var Func;

View file

@ -71,9 +71,13 @@ var nullable;
var Obj;
>Obj : Symbol(Obj, Decl(a.js, 52, 3), Decl(b.ts, 17, 3))
/** @type {object} */
var obj;
>obj : Symbol(obj, Decl(a.js, 55, 3), Decl(b.ts, 18, 3))
/** @type {Function} */
var Func;
>Func : Symbol(Func, Decl(a.js, 55, 3), Decl(b.ts, 18, 3))
>Func : Symbol(Func, Decl(a.js, 58, 3), Decl(b.ts, 19, 3))
=== tests/cases/conformance/jsdoc/b.ts ===
var S: string;
@ -132,7 +136,10 @@ var nullable: number | null;
var Obj: any;
>Obj : Symbol(Obj, Decl(a.js, 52, 3), Decl(b.ts, 17, 3))
var obj: any;
>obj : Symbol(obj, Decl(a.js, 55, 3), Decl(b.ts, 18, 3))
var Func: Function;
>Func : Symbol(Func, Decl(a.js, 55, 3), Decl(b.ts, 18, 3))
>Func : Symbol(Func, Decl(a.js, 58, 3), Decl(b.ts, 19, 3))
>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))

View file

@ -71,6 +71,10 @@ var nullable;
var Obj;
>Obj : any
/** @type {object} */
var obj;
>obj : any
/** @type {Function} */
var Func;
>Func : Function
@ -135,6 +139,9 @@ var nullable: number | null;
var Obj: any;
>Obj : any
var obj: any;
>obj : any
var Func: Function;
>Func : Function
>Function : Function

View file

@ -31,4 +31,14 @@ x1(0);
/** @type {function (number): number} */
const x2 = (a) => a + 1;
x2(0);
x2(0);
/**
* @type {object}
*/
var props = {};
/**
* @type {Object}
*/
var props = {};

View file

@ -57,6 +57,9 @@ var nullable;
/** @type {Object} */
var Obj;
/** @type {object} */
var obj;
/** @type {Function} */
var Func;
@ -79,4 +82,5 @@ var P: Promise<any>;
var p: Promise<any>;
var nullable: number | null;
var Obj: any;
var obj: any;
var Func: Function;