From 2c74b5ee50e9130a356564538ee12703952cbe77 Mon Sep 17 00:00:00 2001 From: Sid Shankar Date: Wed, 11 Sep 2024 00:22:17 +0000 Subject: [PATCH 1/6] Updates TS extractor dependency to 5.6.2 --- javascript/extractor/lib/typescript/package-lock.json | 8 ++++---- javascript/extractor/lib/typescript/package.json | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/javascript/extractor/lib/typescript/package-lock.json b/javascript/extractor/lib/typescript/package-lock.json index 66e41baecab6..50a9e0a66caa 100644 --- a/javascript/extractor/lib/typescript/package-lock.json +++ b/javascript/extractor/lib/typescript/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "typescript-parser-wrapper", "dependencies": { - "typescript": "5.5.2" + "typescript": "^5.6.2" }, "devDependencies": { "@types/node": "18.15.3" @@ -20,9 +20,9 @@ "license": "MIT" }, "node_modules/typescript": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", - "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", diff --git a/javascript/extractor/lib/typescript/package.json b/javascript/extractor/lib/typescript/package.json index 961a8526a942..bf650ec457a4 100644 --- a/javascript/extractor/lib/typescript/package.json +++ b/javascript/extractor/lib/typescript/package.json @@ -2,7 +2,7 @@ "name": "typescript-parser-wrapper", "private": true, "dependencies": { - "typescript": "5.5.2" + "typescript": "5.6.2" }, "scripts": { "build": "tsc --project tsconfig.json", @@ -14,4 +14,4 @@ "devDependencies": { "@types/node": "18.15.3" } -} \ No newline at end of file +} From aa787a9cb1a208ade2f8fb22f978eb150deba793 Mon Sep 17 00:00:00 2001 From: Sid Shankar Date: Wed, 11 Sep 2024 00:27:42 +0000 Subject: [PATCH 2/6] Handles arbitrary module identifiers This commit enables support for arbitrary names for identifier and namespace imports and exports --- .../ts/extractor/TypeScriptASTConverter.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java b/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java index 2fc9474d2989..d42b06762463 100644 --- a/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java +++ b/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java @@ -1203,11 +1203,13 @@ private Node convertExportDeclaration(JsonObject node, SourceLocation loc) throw Literal source = tryConvertChild(node, "moduleSpecifier", Literal.class); Expression attributes = convertChild(node, "attributes"); if (hasChild(node, "exportClause")) { + JsonElement exportClauseNode = node.get("exportClause"); boolean hasTypeKeyword = node.get("isTypeOnly").getAsBoolean(); + boolean isNamespaceExportNode = hasKind(exportClauseNode, "NamespaceExport"); List specifiers = - hasKind(node.get("exportClause"), "NamespaceExport") + isNamespaceExportNode ? Collections.singletonList(convertChild(node, "exportClause")) - : convertChildren(node.get("exportClause").getAsJsonObject(), "elements"); + : convertChildren(exportClauseNode.getAsJsonObject(), "elements"); return new ExportNamedDeclaration(loc, null, specifiers, source, attributes, hasTypeKeyword); } else { return new ExportAllDeclaration(loc, source, attributes); @@ -1215,15 +1217,21 @@ private Node convertExportDeclaration(JsonObject node, SourceLocation loc) throw } private Node convertExportSpecifier(JsonObject node, SourceLocation loc) throws ParseError { + Identifier local = convertChild(node, hasChild(node, "propertyName") ? "propertyName" : "name"); + JsonObject exportedToken = node.get("name").getAsJsonObject(); + Identifier exported = convertNodeAsIdentifier(exportedToken); + return new ExportSpecifier( loc, - convertChild(node, hasChild(node, "propertyName") ? "propertyName" : "name"), - convertChild(node, "name")); + local, + exported); } private Node convertNamespaceExport(JsonObject node, SourceLocation loc) throws ParseError { // Convert the "* as ns" from an export declaration. - return new ExportNamespaceSpecifier(loc, convertChild(node, "name")); + JsonObject exportedNamespaceToken = node.get("name").getAsJsonObject(); + Identifier exportedNamespaceIdentifier = convertNodeAsIdentifier(exportedNamespaceToken); + return new ExportNamespaceSpecifier(loc, exportedNamespaceIdentifier); } private Node convertExpressionStatement(JsonObject node, SourceLocation loc) throws ParseError { @@ -1431,7 +1439,8 @@ private Node convertImportKeyword(SourceLocation loc) { private Node convertImportSpecifier(JsonObject node, SourceLocation loc) throws ParseError { boolean hasImported = hasChild(node, "propertyName"); - Identifier imported = convertChild(node, hasImported ? "propertyName" : "name"); + JsonObject importedToken = node.get(hasImported? "propertyName" : "name").getAsJsonObject(); + Identifier imported = convertNodeAsIdentifier(importedToken); Identifier local = convertChild(node, "name"); boolean isTypeOnly = node.get("isTypeOnly").getAsBoolean() == true; return new ImportSpecifier(loc, imported, local, isTypeOnly); From 785af12f1ca40affbf08eb399d0de41d3ff5a0cd Mon Sep 17 00:00:00 2001 From: Sid Shankar Date: Wed, 11 Sep 2024 00:28:44 +0000 Subject: [PATCH 3/6] Renames test file --- .../Modules/{arbitarySpecifier.js => jsArbitrarySpecifier.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename javascript/ql/test/library-tests/Modules/{arbitarySpecifier.js => jsArbitrarySpecifier.js} (100%) diff --git a/javascript/ql/test/library-tests/Modules/arbitarySpecifier.js b/javascript/ql/test/library-tests/Modules/jsArbitrarySpecifier.js similarity index 100% rename from javascript/ql/test/library-tests/Modules/arbitarySpecifier.js rename to javascript/ql/test/library-tests/Modules/jsArbitrarySpecifier.js From 3516117215028a171756cd1c52cad2e0e375cd9b Mon Sep 17 00:00:00 2001 From: Sid Shankar Date: Wed, 11 Sep 2024 00:37:49 +0000 Subject: [PATCH 4/6] Adds test for arbitrary specifiers in TS files Adds test for arbitrary identifiers used in imports and exports --- .../Modules/arbitrarySpecifier.ts | 6 ++++ .../test/library-tests/Modules/tests.expected | 35 +++++++++++++------ .../TypeScript/EmbeddedInScript/Test.expected | 1 - .../RegressionTests/ImportSelf/test.expected | 1 - .../TraceResolution/test.expected | 1 - .../TypeScript/Types/tests.expected | 1 - 6 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 javascript/ql/test/library-tests/Modules/arbitrarySpecifier.ts diff --git a/javascript/ql/test/library-tests/Modules/arbitrarySpecifier.ts b/javascript/ql/test/library-tests/Modules/arbitrarySpecifier.ts new file mode 100644 index 000000000000..8ed0bd8e804b --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/arbitrarySpecifier.ts @@ -0,0 +1,6 @@ +import { "Foo::new" as Foo_new } from "./foo.wasm" + +const foo = Foo_new() + +export { Foo_new as "Foo::new" } +export type * as "Foo_types" from './mod' \ No newline at end of file diff --git a/javascript/ql/test/library-tests/Modules/tests.expected b/javascript/ql/test/library-tests/Modules/tests.expected index a742e604218f..cec0b96049e8 100644 --- a/javascript/ql/test/library-tests/Modules/tests.expected +++ b/javascript/ql/test/library-tests/Modules/tests.expected @@ -3,7 +3,8 @@ test_BulkReExportDeclarations test_ExportDeclarations | a.js:1:1:3:1 | export ... n 23;\\n} | | a.js:5:1:5:32 | export ... } = o; | -| arbitarySpecifier.js:5:1:5:32 | export ... :new" } | +| arbitrarySpecifier.ts:5:1:5:32 | export ... :new" } | +| arbitrarySpecifier.ts:6:1:6:41 | export ... './mod' | | b.js:5:1:5:18 | export { f as g }; | | b.js:7:1:7:21 | export ... './a'; | | d.js:4:1:4:20 | export * from 'm/c'; | @@ -12,6 +13,7 @@ test_ExportDeclarations | es2015_require.js:3:1:3:25 | export ... ss C {} | | export-in-mjs.mjs:1:1:1:34 | export ... s = 42; | | f.ts:5:1:5:24 | export ... oo() {} | +| jsArbitrarySpecifier.js:5:1:5:32 | export ... :new" } | | m/c.js:5:1:5:30 | export ... '../b'; | | reExportNamespace.js:1:1:1:26 | export ... "./a"; | | tst.html:7:3:7:22 | export const y = 42; | @@ -19,11 +21,12 @@ test_ExportDefaultDeclarations | a.js:1:1:3:1 | export ... n 23;\\n} | | es2015_require.js:3:1:3:25 | export ... ss C {} | test_ExportSpecifiers -| arbitarySpecifier.js:5:10:5:30 | Foo_new ... o::new" | arbitarySpecifier.js:5:10:5:16 | Foo_new | arbitarySpecifier.js:5:10:5:30 | Foo_new ... o::new" | +| arbitrarySpecifier.ts:5:10:5:30 | Foo_new ... o::new" | arbitrarySpecifier.ts:5:10:5:16 | Foo_new | arbitrarySpecifier.ts:5:21:5:30 | "Foo::new" | | b.js:5:10:5:15 | f as g | b.js:5:10:5:10 | f | b.js:5:15:5:15 | g | | e.js:2:10:2:10 | x | e.js:2:10:2:10 | x | e.js:2:10:2:10 | x | | e.js:2:13:2:13 | y | e.js:2:13:2:13 | y | e.js:2:13:2:13 | y | | e.js:3:10:3:21 | default as g | e.js:3:10:3:16 | default | e.js:3:21:3:21 | g | +| jsArbitrarySpecifier.js:5:10:5:30 | Foo_new ... o::new" | jsArbitrarySpecifier.js:5:10:5:16 | Foo_new | jsArbitrarySpecifier.js:5:10:5:30 | Foo_new ... o::new" | | m/c.js:5:10:5:15 | g as h | m/c.js:5:10:5:10 | g | m/c.js:5:15:5:15 | h | test_GlobalVariableRef | a.js:5:31:5:31 | o | @@ -43,7 +46,7 @@ test_ImportNamespaceSpecifier | exports.js:1:8:1:17 | * as dummy | | m/c.js:1:8:1:13 | * as b | test_ImportSpecifiers -| arbitarySpecifier.js:1:10:1:30 | "Foo::n ... Foo_new | arbitarySpecifier.js:1:24:1:30 | Foo_new | +| arbitrarySpecifier.ts:1:10:1:30 | "Foo::n ... Foo_new | arbitrarySpecifier.ts:1:24:1:30 | Foo_new | | b.js:1:8:1:8 | f | b.js:1:8:1:8 | f | | d.js:1:10:1:21 | default as g | d.js:1:21:1:21 | g | | d.js:1:24:1:29 | x as y | d.js:1:29:1:29 | y | @@ -53,12 +56,13 @@ test_ImportSpecifiers | import-in-mjs.mjs:1:8:1:24 | exported_from_mjs | import-in-mjs.mjs:1:8:1:24 | exported_from_mjs | | import-ts-with-js-extension.ts:1:10:1:12 | foo | import-ts-with-js-extension.ts:1:10:1:12 | foo | | importcss.js:1:8:1:8 | A | importcss.js:1:8:1:8 | A | +| jsArbitrarySpecifier.js:1:10:1:30 | "Foo::n ... Foo_new | jsArbitrarySpecifier.js:1:24:1:30 | Foo_new | | m/c.js:1:8:1:13 | * as b | m/c.js:1:13:1:13 | b | | reExportNamespaceClient.js:1:10:1:11 | ns | reExportNamespaceClient.js:1:10:1:11 | ns | | tst.html:5:10:5:10 | f | tst.html:5:10:5:10 | f | | unresolved.js:1:8:1:8 | f | unresolved.js:1:8:1:8 | f | test_Imports -| arbitarySpecifier.js:1:1:1:50 | import ... o.wasm" | arbitarySpecifier.js:1:39:1:50 | "./foo.wasm" | 1 | +| arbitrarySpecifier.ts:1:1:1:50 | import ... o.wasm" | arbitrarySpecifier.ts:1:39:1:50 | "./foo.wasm" | 1 | | b.js:1:1:1:20 | import f from './a'; | b.js:1:15:1:19 | './a' | 1 | | d.js:1:1:1:43 | import ... './a'; | d.js:1:38:1:42 | './a' | 2 | | d.js:2:1:2:13 | import './b'; | d.js:2:8:2:12 | './b' | 0 | @@ -68,6 +72,7 @@ test_Imports | import-in-mjs.mjs:1:1:1:46 | import ... n-mjs'; | import-in-mjs.mjs:1:31:1:45 | 'export-in-mjs' | 1 | | import-ts-with-js-extension.ts:1:1:1:29 | import ... /f.js"; | import-ts-with-js-extension.ts:1:21:1:28 | "./f.js" | 1 | | importcss.js:1:1:1:24 | import ... a.css"; | importcss.js:1:15:1:23 | "./a.css" | 1 | +| jsArbitrarySpecifier.js:1:1:1:50 | import ... o.wasm" | jsArbitrarySpecifier.js:1:39:1:50 | "./foo.wasm" | 1 | | m/c.js:1:1:1:26 | import ... '../b'; | m/c.js:1:20:1:25 | '../b' | 1 | | reExportNamespaceClient.js:1:1:1:41 | import ... space"; | reExportNamespaceClient.js:1:20:1:40 | "./reEx ... espace" | 1 | | tst.html:5:3:5:20 | import f from 'a'; | tst.html:5:17:5:19 | 'a' | 1 | @@ -76,7 +81,8 @@ test_Module_exports | a.js:1:1:5:32 | | default | a.js:1:16:3:1 | functio ... n 23;\\n} | | a.js:1:1:5:32 | | x | a.js:5:18:5:20 | f() | | a.js:1:1:5:32 | | y | a.js:5:25:5:25 | y | -| arbitarySpecifier.js:1:1:5:32 | | Foo::new | arbitarySpecifier.js:5:10:5:16 | Foo_new | +| arbitrarySpecifier.ts:1:1:6:41 | | Foo::new | arbitrarySpecifier.ts:5:10:5:16 | Foo_new | +| arbitrarySpecifier.ts:1:1:6:41 | | Foo_types | arbitrarySpecifier.ts:6:13:6:28 | * as "Foo_types" | | b.js:1:1:8:0 | | f2 | a.js:1:16:3:1 | functio ... n 23;\\n} | | b.js:1:1:8:0 | | g | b.js:5:10:5:10 | f | | e.js:1:1:4:0 | | g | a.js:1:16:3:1 | functio ... n 23;\\n} | @@ -85,21 +91,24 @@ test_Module_exports | es2015_require.js:1:1:3:25 | | default | es2015_require.js:3:16:3:25 | class C {} | | export-in-mjs.mjs:1:1:1:34 | | exported_from_mjs | export-in-mjs.mjs:1:32:1:33 | 42 | | f.ts:1:1:6:0 | | foo | f.ts:5:8:5:24 | function foo() {} | +| jsArbitrarySpecifier.js:1:1:5:32 | | Foo::new | jsArbitrarySpecifier.js:5:10:5:16 | Foo_new | | m/c.js:1:1:6:0 | | h | b.js:5:10:5:10 | f | | reExportNamespace.js:1:1:2:0 | | ns | reExportNamespace.js:1:8:1:14 | * as ns | | tst.html:4:23:8:0 | | y | tst.html:7:20:7:21 | 42 | test_NamedImportSpecifier -| arbitarySpecifier.js:1:10:1:30 | "Foo::n ... Foo_new | +| arbitrarySpecifier.ts:1:10:1:30 | "Foo::n ... Foo_new | | d.js:1:10:1:21 | default as g | | d.js:1:24:1:29 | x as y | | g.ts:1:9:1:11 | foo | | import-ts-with-js-extension.ts:1:10:1:12 | foo | +| jsArbitrarySpecifier.js:1:10:1:30 | "Foo::n ... Foo_new | | reExportNamespaceClient.js:1:10:1:11 | ns | test_OtherImports | es2015_require.js:1:11:1:24 | require('./d') | d.js:1:1:5:0 | | | import-indirect-path.js:1:1:1:25 | require ... + '/a') | a.js:1:1:5:32 | | | import-indirect-path.js:5:1:5:14 | require(x + y) | a.js:1:1:5:32 | | test_ReExportDeclarations +| arbitrarySpecifier.ts:6:1:6:41 | export ... './mod' | arbitrarySpecifier.ts:6:35:6:41 | './mod' | | b.js:7:1:7:21 | export ... './a'; | b.js:7:16:7:20 | './a' | | d.js:4:1:4:20 | export * from 'm/c'; | d.js:4:15:4:19 | 'm/c' | | e.js:3:1:3:35 | export ... './a'; | e.js:3:30:3:34 | './a' | @@ -117,16 +126,18 @@ test_getAnImportedModule | library-tests/Modules/m/c.js | library-tests/Modules/b.js | | library-tests/Modules/reExportNamespaceClient.js | library-tests/Modules/reExportNamespace.js | test_getExportedName -| arbitarySpecifier.js:5:10:5:30 | Foo_new ... o::new" | Foo::new | +| arbitrarySpecifier.ts:5:10:5:30 | Foo_new ... o::new" | Foo::new | +| arbitrarySpecifier.ts:6:13:6:28 | * as "Foo_types" | Foo_types | | b.js:5:10:5:15 | f as g | g | | b.js:7:8:7:9 | f2 | f2 | | e.js:2:10:2:10 | x | x | | e.js:2:13:2:13 | y | y | | e.js:3:10:3:21 | default as g | g | +| jsArbitrarySpecifier.js:5:10:5:30 | Foo_new ... o::new" | Foo::new | | m/c.js:5:10:5:15 | g as h | h | | reExportNamespace.js:1:8:1:14 | * as ns | ns | test_getImportedName -| arbitarySpecifier.js:1:10:1:30 | "Foo::n ... Foo_new | Foo::new | +| arbitrarySpecifier.ts:1:10:1:30 | "Foo::n ... Foo_new | Foo::new | | b.js:1:8:1:8 | f | default | | d.js:1:10:1:21 | default as g | default | | d.js:1:24:1:29 | x as y | x | @@ -135,22 +146,25 @@ test_getImportedName | import-in-mjs.mjs:1:8:1:24 | exported_from_mjs | default | | import-ts-with-js-extension.ts:1:10:1:12 | foo | foo | | importcss.js:1:8:1:8 | A | default | +| jsArbitrarySpecifier.js:1:10:1:30 | "Foo::n ... Foo_new | Foo::new | | reExportNamespaceClient.js:1:10:1:11 | ns | ns | | tst.html:5:10:5:10 | f | default | | unresolved.js:1:8:1:8 | f | default | test_getLocalName -| arbitarySpecifier.js:5:10:5:30 | Foo_new ... o::new" | Foo_new | +| arbitrarySpecifier.ts:5:10:5:30 | Foo_new ... o::new" | Foo_new | | b.js:5:10:5:15 | f as g | f | | b.js:7:8:7:9 | f2 | default | | e.js:2:10:2:10 | x | x | | e.js:2:13:2:13 | y | y | | e.js:3:10:3:21 | default as g | default | +| jsArbitrarySpecifier.js:5:10:5:30 | Foo_new ... o::new" | Foo_new | | m/c.js:5:10:5:15 | g as h | g | test_getSourceNode | a.js:1:1:3:1 | export ... n 23;\\n} | default | a.js:1:16:3:1 | functio ... n 23;\\n} | | a.js:5:1:5:32 | export ... } = o; | x | a.js:5:18:5:20 | f() | | a.js:5:1:5:32 | export ... } = o; | y | a.js:5:25:5:25 | y | -| arbitarySpecifier.js:5:1:5:32 | export ... :new" } | Foo::new | arbitarySpecifier.js:5:10:5:16 | Foo_new | +| arbitrarySpecifier.ts:5:1:5:32 | export ... :new" } | Foo::new | arbitrarySpecifier.ts:5:10:5:16 | Foo_new | +| arbitrarySpecifier.ts:6:1:6:41 | export ... './mod' | Foo_types | arbitrarySpecifier.ts:6:13:6:28 | * as "Foo_types" | | b.js:5:1:5:18 | export { f as g }; | g | b.js:5:10:5:10 | f | | b.js:7:1:7:21 | export ... './a'; | f2 | a.js:1:16:3:1 | functio ... n 23;\\n} | | e.js:2:1:2:16 | export { x, y }; | x | e.js:2:10:2:10 | x | @@ -159,6 +173,7 @@ test_getSourceNode | es2015_require.js:3:1:3:25 | export ... ss C {} | default | es2015_require.js:3:16:3:25 | class C {} | | export-in-mjs.mjs:1:1:1:34 | export ... s = 42; | exported_from_mjs | export-in-mjs.mjs:1:32:1:33 | 42 | | f.ts:5:1:5:24 | export ... oo() {} | foo | f.ts:5:8:5:24 | function foo() {} | +| jsArbitrarySpecifier.js:5:1:5:32 | export ... :new" } | Foo::new | jsArbitrarySpecifier.js:5:10:5:16 | Foo_new | | m/c.js:5:1:5:30 | export ... '../b'; | h | b.js:5:10:5:10 | f | | reExportNamespace.js:1:1:1:26 | export ... "./a"; | ns | reExportNamespace.js:1:8:1:14 | * as ns | | tst.html:7:3:7:22 | export const y = 42; | y | tst.html:7:20:7:21 | 42 | diff --git a/javascript/ql/test/library-tests/TypeScript/EmbeddedInScript/Test.expected b/javascript/ql/test/library-tests/TypeScript/EmbeddedInScript/Test.expected index 9f9b7fc24ec2..711e94cfdaa1 100644 --- a/javascript/ql/test/library-tests/TypeScript/EmbeddedInScript/Test.expected +++ b/javascript/ql/test/library-tests/TypeScript/EmbeddedInScript/Test.expected @@ -3,7 +3,6 @@ classDeclaration | test_tsx.vue:3:18:5:3 | class M ... er;\\n } | exprType | htmlfile.html:4:22:4:24 | foo | () => void | -| htmlfile.html:4:22:4:24 | foo | () => void | | htmlfile.html:4:33:4:41 | "./other" | any | | htmlfile.html:5:17:5:22 | result | number[] | | htmlfile.html:5:26:5:28 | foo | () => void | diff --git a/javascript/ql/test/library-tests/TypeScript/RegressionTests/ImportSelf/test.expected b/javascript/ql/test/library-tests/TypeScript/RegressionTests/ImportSelf/test.expected index 3da6ee7443dc..756178b48073 100644 --- a/javascript/ql/test/library-tests/TypeScript/RegressionTests/ImportSelf/test.expected +++ b/javascript/ql/test/library-tests/TypeScript/RegressionTests/ImportSelf/test.expected @@ -1,4 +1,3 @@ | bar.ts:1:10:1:10 | A | any | -| bar.ts:1:10:1:10 | A | any | | bar.ts:1:19:1:29 | "@blah/foo" | any | | bar.ts:3:5:3:5 | x | A | diff --git a/javascript/ql/test/library-tests/TypeScript/RegressionTests/TraceResolution/test.expected b/javascript/ql/test/library-tests/TypeScript/RegressionTests/TraceResolution/test.expected index dc21f343569a..bab38be1e231 100644 --- a/javascript/ql/test/library-tests/TypeScript/RegressionTests/TraceResolution/test.expected +++ b/javascript/ql/test/library-tests/TypeScript/RegressionTests/TraceResolution/test.expected @@ -1,5 +1,4 @@ | test.ts:1:10:1:12 | foo | () => any | -| test.ts:1:10:1:12 | foo | () => any | | test.ts:1:21:1:25 | "foo" | any | | test.ts:3:1:3:3 | foo | () => any | | test.ts:3:1:3:5 | foo() | any | diff --git a/javascript/ql/test/library-tests/TypeScript/Types/tests.expected b/javascript/ql/test/library-tests/TypeScript/Types/tests.expected index b3170fd21333..1cf1ca607ae3 100644 --- a/javascript/ql/test/library-tests/TypeScript/Types/tests.expected +++ b/javascript/ql/test/library-tests/TypeScript/Types/tests.expected @@ -474,7 +474,6 @@ getExprType | tst.ts:358:13:358:23 | tstModuleES | () => "a" \| "b" | | tst.ts:358:13:358:25 | tstModuleES() | "a" \| "b" | | tst.ts:360:10:360:21 | tstModuleCJS | () => "a" \| "b" | -| tst.ts:360:10:360:21 | tstModuleCJS | () => "a" \| "b" | | tst.ts:360:30:360:49 | './tstModuleCJS.cjs' | any | | tst.ts:362:1:362:7 | console | Console | | tst.ts:362:1:362:11 | console.log | (...data: any[]) => void | From 3436fc617725d4f0c954ec2ceb5359d14915d748 Mon Sep 17 00:00:00 2001 From: Sid Shankar Date: Wed, 11 Sep 2024 00:46:09 +0000 Subject: [PATCH 5/6] Updates supported compiler docs --- docs/codeql/reusables/supported-versions-compilers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/codeql/reusables/supported-versions-compilers.rst b/docs/codeql/reusables/supported-versions-compilers.rst index b78fb9013050..5d3a71067d44 100644 --- a/docs/codeql/reusables/supported-versions-compilers.rst +++ b/docs/codeql/reusables/supported-versions-compilers.rst @@ -25,7 +25,7 @@ Python [8]_,"2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12",Not applicable,``.py`` Ruby [9]_,"up to 3.3",Not applicable,"``.rb``, ``.erb``, ``.gemspec``, ``Gemfile``" Swift [10]_,"Swift 5.4-5.10","Swift compiler","``.swift``" - TypeScript [11]_,"2.6-5.5",Standard TypeScript compiler,"``.ts``, ``.tsx``, ``.mts``, ``.cts``" + TypeScript [11]_,"2.6-5.6",Standard TypeScript compiler,"``.ts``, ``.tsx``, ``.mts``, ``.cts``" .. container:: footnote-group From bc70d5ceb1750f8601d7edf2326c4ffa74c54c31 Mon Sep 17 00:00:00 2001 From: Sid Shankar Date: Wed, 11 Sep 2024 00:52:21 +0000 Subject: [PATCH 6/6] Adds change note --- .../ql/lib/change-notes/2024-09-10-support-typescript-5.6.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 javascript/ql/lib/change-notes/2024-09-10-support-typescript-5.6.md diff --git a/javascript/ql/lib/change-notes/2024-09-10-support-typescript-5.6.md b/javascript/ql/lib/change-notes/2024-09-10-support-typescript-5.6.md new file mode 100644 index 000000000000..fe5dd07562d3 --- /dev/null +++ b/javascript/ql/lib/change-notes/2024-09-10-support-typescript-5.6.md @@ -0,0 +1,4 @@ +--- +category: majorAnalysis +--- +* Added support for TypeScript 5.6.