Skip to content

[Master] Fix 16201: fix cannot find "object" #17082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6892,6 +6892,7 @@ namespace ts {
case "Null":
return nullType;
case "Object":
case "object":
return anyType;
case "Function":
case "function":
Expand Down
20 changes: 19 additions & 1 deletion tests/baselines/reference/checkJsdocTypeTag1.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = {};
12 changes: 12 additions & 0 deletions tests/baselines/reference/checkJsdocTypeTag1.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -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))

14 changes: 14 additions & 0 deletions tests/baselines/reference/checkJsdocTypeTag1.types
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,17 @@ x2(0);
>x2 : (arg0: number) => number
>0 : 0

/**
* @type {object}
*/
var props = {};
>props : any
>{} : {}

/**
* @type {Object}
*/
var props = {};
>props : any
>{} : {}

7 changes: 7 additions & 0 deletions tests/baselines/reference/jsdocTypeTag.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ var nullable;
/** @type {Object} */
var Obj;

/** @type {object} */
var obj;

/** @type {Function} */
var Func;

Expand All @@ -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;


Expand Down Expand Up @@ -117,6 +121,8 @@ var p;
var nullable;
/** @type {Object} */
var Obj;
/** @type {object} */
var obj;
/** @type {Function} */
var Func;
//// [b.js]
Expand All @@ -138,4 +144,5 @@ var P;
var p;
var nullable;
var Obj;
var obj;
var Func;
11 changes: 9 additions & 2 deletions tests/baselines/reference/jsdocTypeTag.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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, --, --))

7 changes: 7 additions & 0 deletions tests/baselines/reference/jsdocTypeTag.types
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ var nullable;
var Obj;
>Obj : any

/** @type {object} */
var obj;
>obj : any

/** @type {Function} */
var Func;
>Func : Function
Expand Down Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion tests/cases/conformance/jsdoc/checkJsdocTypeTag1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
4 changes: 4 additions & 0 deletions tests/cases/conformance/jsdoc/jsdocTypeTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ var nullable;
/** @type {Object} */
var Obj;

/** @type {object} */
var obj;

/** @type {Function} */
var Func;

Expand All @@ -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;