mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
Add tests
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// @allowJS: true
|
||||
// @suppressOutputPathCheck: true
|
||||
// @strictNullChecks: true
|
||||
|
||||
// @filename: 0.js
|
||||
// @ts-check
|
||||
var lol = "hello Lol"
|
||||
const obj = {
|
||||
/** @type {string|undefined} */
|
||||
foo: undefined,
|
||||
/** @type {string|undefined} */
|
||||
bar: 42,
|
||||
/** @type {function(number): number} */
|
||||
method1(n1) {
|
||||
return n1 + 42;
|
||||
},
|
||||
/** @type {string} */
|
||||
lol
|
||||
}
|
||||
obj.foo = 'string'
|
||||
obj.foo;
|
||||
obj.lol
|
||||
obj.bar = undefined;
|
||||
var k = obj.method1(0);
|
||||
@@ -0,0 +1,20 @@
|
||||
// @allowJS: true
|
||||
// @suppressOutputPathCheck: true
|
||||
// @strictNullChecks: true
|
||||
|
||||
// @filename: 0.js
|
||||
// @ts-check
|
||||
const obj = {
|
||||
/** @type {string|undefined} */
|
||||
foo: undefined,
|
||||
/** @type {string|undefined} */
|
||||
bar: 42,
|
||||
/** @type {function(number): number} */
|
||||
method1(n1) {
|
||||
return (n1 + 42).toString()
|
||||
},
|
||||
/** @type {string} */
|
||||
lol
|
||||
}
|
||||
var lol = "string"
|
||||
obj.foo = 5
|
||||
Reference in New Issue
Block a user