mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
TS: fix extraction of binding pattern with default
This commit is contained in:
@@ -1612,7 +1612,7 @@ public class TypeScriptASTConverter {
|
||||
if (hasChild(element, "dotDotDotToken")) {
|
||||
propVal = new RestElement(eltLoc, propKey);
|
||||
} else if (hasChild(element, "initializer")) {
|
||||
propVal = new AssignmentPattern(eltLoc, "=", propKey, convertChild(element, "initializer"));
|
||||
propVal = new AssignmentPattern(eltLoc, "=", convertChild(element, "name"), convertChild(element, "initializer"));
|
||||
} else {
|
||||
propVal = convertChild(element, "name");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
| tst.tsx:1:10:1:10 | f |
|
||||
| tst.tsx:1:12:1:12 | o |
|
||||
| tst.tsx:2:14:2:14 | v |
|
||||
@@ -0,0 +1,4 @@
|
||||
import javascript
|
||||
|
||||
from VarDecl decl
|
||||
select decl
|
||||
@@ -0,0 +1,4 @@
|
||||
function f(o) {
|
||||
const { p: v = [] } = o;
|
||||
return v;
|
||||
}
|
||||
Reference in New Issue
Block a user