diff options
| author | Parsa Ghadimi <me@qti3e.com> | 2018-05-23 23:23:41 +0430 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2018-05-23 17:07:20 -0400 |
| commit | cb222ceb227f5a7f5307085bcbebfa3cdb049598 (patch) | |
| tree | 312f3a1c46af2c668d68881ea62f56ac27d99b9d /testdata | |
| parent | 3171ba4c3ff4046aaca0d70321f1dfec4c0728bb (diff) | |
Adds setInterval, clearInterval, clearTimeout.
Diffstat (limited to 'testdata')
| -rw-r--r-- | testdata/004_set_timeout.ts | 6 | ||||
| -rw-r--r-- | testdata/010_set_interval.ts | 7 | ||||
| -rw-r--r-- | testdata/010_set_interval.ts.out | 2 |
3 files changed, 15 insertions, 0 deletions
diff --git a/testdata/004_set_timeout.ts b/testdata/004_set_timeout.ts index fe55e31ba..cc55bf76f 100644 --- a/testdata/004_set_timeout.ts +++ b/testdata/004_set_timeout.ts @@ -3,3 +3,9 @@ setTimeout(function() { }, 10); console.log("Hello"); + +const id = setTimeout(function() { + console.log("Not printed"); +}, 10000); + +clearTimeout(id); diff --git a/testdata/010_set_interval.ts b/testdata/010_set_interval.ts new file mode 100644 index 000000000..e013d00bc --- /dev/null +++ b/testdata/010_set_interval.ts @@ -0,0 +1,7 @@ +const id = setInterval(function() { + console.log("test") +}, 200); + +setTimeout(function() { + clearInterval(id) +}, 500) diff --git a/testdata/010_set_interval.ts.out b/testdata/010_set_interval.ts.out new file mode 100644 index 000000000..dec2cbe1f --- /dev/null +++ b/testdata/010_set_interval.ts.out @@ -0,0 +1,2 @@ +test +test |
