Add tests

This commit is contained in:
Yui T
2017-05-31 12:15:50 -07:00
parent 8a28e15146
commit 558cb2e2fa
2 changed files with 44 additions and 0 deletions

View File

@@ -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);

View File

@@ -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