JS: add defuse+dataflow tests for destructuring and default values

This commit is contained in:
Esben Sparre Andreasen
2019-02-06 23:28:11 +01:00
parent 4b81ffab96
commit f333419bb4
7 changed files with 61 additions and 0 deletions

View File

@@ -30,3 +30,6 @@
| tst.js:7:4:7:6 | --i | tst.js:7:6:7:6 | i |
| tst.js:12:2:12:7 | x = 42 | tst.js:14:9:14:9 | x |
| tst.js:19:11:19:11 | x | tst.js:18:9:18:9 | x |
| tst.js:23:6:23:23 | {a = b, c = d} = e | tst.js:24:2:24:2 | a |
| tst.js:23:6:23:23 | {a = b, c = d} = e | tst.js:24:6:24:6 | c |
| tst.js:26:11:26:11 | a | tst.js:27:2:27:2 | a |

View File

@@ -29,3 +29,4 @@
| tst.js:11:11:11:11 | g | tst.js:11:2:15:1 | functio ... rn x;\\n} |
| tst.js:12:2:12:7 | x = 42 | tst.js:12:6:12:7 | 42 |
| tst.js:19:11:19:11 | x | tst.js:19:2:19:16 | function x() {} |
| tst.js:23:6:23:23 | {a = b, c = d} = e | tst.js:23:23:23:23 | e |

View File

@@ -18,3 +18,11 @@ function f(o) {
return x;
function x() {}
});
(function(){
var {a = b, c = d} = e;
a + c;
});
(function(a = b) {
a;
});