Commit Graph

938 Commits

Author SHA1 Message Date
Mauro Baluda
45a48f360f Extract SAP XSJS file types as Javascript 2024-06-11 23:51:44 +02:00
Mauro Baluda
0b9bafc9c3 Update AutoBuildTests.java 2024-06-04 21:07:57 +02:00
Mauro Baluda
168cba86c1 Add .xsaccess test data 2024-06-04 20:55:07 +02:00
Mauro Baluda
8791e67789 Add .xsaccess test data 2024-06-04 17:50:08 +02:00
Mauro Baluda
576ee7892d Add .xsaccess test data 2024-06-04 17:36:05 +02:00
Mauro Baluda
7b3e9b4ec1 Extract .xsaccess files as JSON 2024-06-04 16:28:08 +02:00
Mauro Baluda
73b18129d9 Extract .xsaccess files as JSON 2024-06-04 16:23:05 +02:00
Paolo Tranquilli
7b8c11379d Javascript: use codeql_pack for javascript extractor 2024-06-03 23:14:44 +02:00
erik-krogh
61c72361cd move the "isFileTooLarge" earlier in the pipeline, so we're only doing it once 2024-05-21 20:01:24 +02:00
erik-krogh
241f977488 fix that very large TypeScript files would crash the extractor 2024-05-21 19:52:43 +02:00
Asger F
9082972842 Merge pull request #16061 from RasmusWL/js-extractor-fix
JS: More robust CommonJS/ES2015 detection logic for extractor
2024-04-25 13:26:56 +02:00
Paolo Tranquilli
9f5782b67b Bazel: introduce buildifier formatting
This introduces tooling and enforcement for formatting bazel files.

The tooling is provided as a bazel run target from
[keith/buildifier-prebuilt](https://github.com/keith/buildifier-prebuilt).

This is used in a [`pre-commit`](https://pre-commit.com/) hook for those
having that installed. In turn this is used in a CI check. Relying on a
`pre-commit` action gives us easy checking that buildifying did not
change anything in the files and printing the diff, without having to
hand-roll the check ourselves.

This enforcement will make usage of gazelle easier, as gazelle itself
might reformat files, even outside of `go`. Having them properly
formatted will allow gazelle to leave them unchanged, without needing
to configure awkward exclude directives.
2024-04-24 15:49:48 +02:00
Asger F
64321b314f Merge branch 'main' into js-extractor-fix 2024-04-17 20:55:54 +02:00
Asger F
c4eeda1560 JS: Bump EXTRACTOR_VERSION 2024-04-17 08:34:26 +02:00
Rasmus Wriedt Larsen
16e2ac898f JS: Parser: Remove direct this.strict assignment 2024-04-09 14:58:14 +02:00
Rasmus Wriedt Larsen
1985dd629d JS: Parser: Never run in strict mode
This initial change is a bit of a hacky way to achieve our goals (since
it doesn't rewrite all the uses of this.strict), but it is easy to
understand is correct. Let's accept test changes NOW, and ensure that
later changes don't change things further.
2024-04-09 14:37:07 +02:00
Rasmus Wriedt Larsen
df463e51c1 JS: Extractor: Fix experimental flag value for NodeJSDetectorTests 2024-03-26 17:02:47 +01:00
Rasmus Wriedt Larsen
60944a9bcb JS: Accept new trap files
As I see it, these all seem to have invalid code initially anyway, but
this is definitely something a JS expert should review :)
2024-03-26 17:01:57 +01:00
Rasmus Wriedt Larsen
1d51d182ec JS: Extractor: Explain how to make replaceExpectedOutput work now with bazel 2024-03-26 17:01:57 +01:00
Rasmus Wriedt Larsen
04a0740ccb JS: Extractor: More robust ES2015 checking
Created shared AbstractDetector to not duplicate all the tedious logic
;)

I took inspiration from the tests in  `javascript/extractor/tests/esnext/input/dynamic-import.js`
2024-03-26 17:01:57 +01:00
Rasmus Wriedt Larsen
cd84500c56 JS: Extractor: Separate base detector logic into own file
Should hopefully make it easier to review these changes to have it split into its' own commit :)
2024-03-26 17:01:57 +01:00
Rasmus Wriedt Larsen
0515b12305 JS: Add example of bad NodeJS detection
Notice the TRAP lines

```
is_module(#20001)
is_es2015_module(#20001)
```
2024-03-25 11:36:21 +01:00
erik-krogh
6be0ed1dc3 narrow the version specifier used for TypeScript 2024-03-12 13:42:58 +01:00
erik-krogh
9f410eb2d6 Merge branch 'main' into ts-54 2024-03-11 18:07:52 +01:00
Rasmus Lerchedahl Petersen
d73f43477f update ts to released version 54 2024-03-11 16:32:19 +01:00
Cornelius Riemenschneider
e9b5394cd5 JS: Remove empty build target.
The `resources` folder never existed, this was probably introduced
as a copy-paste mistake. Remove the rule.
2024-02-26 15:26:44 +01:00
erik-krogh
0056067a17 Merge branch 'main' into ts-54 2024-02-25 21:20:43 +01:00
erik-krogh
083f56921c update to 5.4.1-rc 2024-02-25 21:20:41 +01:00
Paolo Tranquilli
61bfe7e520 Bazel: rename internal module to semmle_code 2024-02-21 16:51:39 +01:00
Paolo Tranquilli
32d6c5ac3d Javascript: fix project layout for bazel tests
On Windows, the project layout needs to match `codeql~override`, while
on POSIX we must keep on matching `ql`. We work around this by using
`*ql*` in the project layout, which matches both.
2024-02-16 17:10:20 +01:00
Paolo Tranquilli
1626344560 Merge branch 'main' into redsun82/bzlmod 2024-02-16 17:10:02 +01:00
Cornelius Riemenschneider
798a1e250e Move the JS java tests to be a proper java_test target.
Previously, we had a `sh_test` wrapping the `java_test` to do some setup.
This was extremely brittle on Windows, and relied on getting a deploy
jar from `java_test`. This breaks when updating to Bazel 7, where the
ability to get a deploy jar from `java_test` was removed.
Therefore, we now do all the test setup in `AllTests.java` instead.
This is much cleaner, and shouldn't break as easily.
2024-02-15 17:02:28 +01:00
Paolo Tranquilli
53539226a8 Bazel: use internal codeql module 2024-02-12 14:27:55 +01:00
Rasmus Lerchedahl Petersen
f275531542 Add support for TS 5.4-beta 2024-02-02 11:03:44 +01:00
Erik Krogh Kristensen
d782bd9b1f Merge pull request #13624 from jorgectf/seclab/dotjs
JS: Add `dot.js` support
2024-01-11 14:57:19 +01:00
erik-krogh
06c1fff770 address review comments 2024-01-10 13:53:54 +01:00
erik-krogh
d0fcb7d1ed faster TypeScript extraction by not having to compute the "type-string" for a type every time 2024-01-09 15:30:55 +01:00
Jorge
f8cfd698fa Merge branch 'main' into seclab/dotjs 2023-12-19 10:44:52 +01:00
erik-krogh
0db788bb10 use direct string comparison instead, that doesn't crash on invalid values 2023-12-14 14:50:17 +01:00
erik-krogh
5e91b2f5bc fix the parsing of boolean environment variables in the TypeScript extractor 2023-12-14 14:40:10 +01:00
erik-krogh
72e99b5b9d rename extractor environment variable to CODEQL_EXTRACTOR_JAVASCRIPT_OPTION_SKIP_TYPES 2023-12-14 12:52:49 +01:00
erik-krogh
896432b646 add environment variable to skip extraction of types in TypeScript 2023-12-12 12:25:00 +01:00
erik-krogh
cf31ef4960 make sure reset() is called when manually invoking the TS extractor, so environment-variables are read 2023-12-12 10:51:09 +01:00
erik-krogh
c246a9c12c move TypeVarDepth further up, so its declared before it's used 2023-12-12 10:34:42 +01:00
erik-krogh
13a01e1545 fix a this reference
`this` didn't refer to anything specific, and it was in fact `undefined` in the context it was invoked. There was already a  `let typeTable = this;` further up (where `this` refers to the class instance), so I used `typeTable`.
2023-12-12 10:32:31 +01:00
erik-krogh
ca95a6e9cf exclude all the lib.d.ts files when running the TS extractor directly
e.g. the `lib.es5.d.ts` file was not excluded
2023-12-12 10:29:09 +01:00
Jorge
8abd1d9855 Merge branch 'main' into seclab/dotjs 2023-11-30 19:42:18 +01:00
Jorge
91bc043f30 Add .html.dot to Autobuild.java 2023-11-30 19:38:24 +01:00
erik-krogh
5611a3e417 use exact version 2023-11-20 20:48:51 +01:00
erik-krogh
10b3efa667 update to the stable version of TypeScript 5.3 2023-11-20 20:32:24 +01:00