-
Notifications
You must be signed in to change notification settings - Fork 21
fix: add Jest 30 support and fix time limit in loop-runner #1318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
04a87cf
4c61d08
a3764f1
4157534
017bde1
71b38d5
7273f27
b83e516
0592d92
b4d0b0f
3b56d24
9cd5d5a
0a8d120
6febd69
6c74adc
202bdc4
bab3bd4
535c640
d0b859a
c151b6c
ae31ca7
9bb05f6
8fcb8cc
67ea0c9
a6b9364
f800ae3
b65711d
4545b8c
183d800
6c23255
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ | |
| * @param {number} n - The index of the Fibonacci number to calculate | ||
| * @returns {number} The nth Fibonacci number | ||
| */ | ||
| function fibonacci(n) { | ||
| export function fibonacci(n) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This file is in a CommonJS project (no Either:
Same issue affects: |
||
| if (n <= 1) { | ||
| return n; | ||
| } | ||
|
|
@@ -21,7 +21,7 @@ function fibonacci(n) { | |
| * @param {number} num - The number to check | ||
| * @returns {boolean} True if num is a Fibonacci number | ||
| */ | ||
| function isFibonacci(num) { | ||
| export function isFibonacci(num) { | ||
| // A number is Fibonacci if one of (5*n*n + 4) or (5*n*n - 4) is a perfect square | ||
| const check1 = 5 * num * num + 4; | ||
| const check2 = 5 * num * num - 4; | ||
|
|
@@ -33,7 +33,7 @@ function isFibonacci(num) { | |
| * @param {number} n - The number to check | ||
| * @returns {boolean} True if n is a perfect square | ||
| */ | ||
| function isPerfectSquare(n) { | ||
| export function isPerfectSquare(n) { | ||
| const sqrt = Math.sqrt(n); | ||
| return sqrt === Math.floor(sqrt); | ||
| } | ||
|
|
@@ -43,7 +43,7 @@ function isPerfectSquare(n) { | |
| * @param {number} n - The number of Fibonacci numbers to generate | ||
| * @returns {number[]} Array of Fibonacci numbers | ||
| */ | ||
| function fibonacciSequence(n) { | ||
| export function fibonacciSequence(n) { | ||
| const result = []; | ||
| for (let i = 0; i < n; i++) { | ||
| result.push(fibonacci(i)); | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,10 +26,10 @@ class PrComment: | |
|
|
||
| def to_json(self) -> dict[str, Union[str, int, dict[str, dict[str, int]], list[BenchmarkDetail], None]]: | ||
| report_table: dict[str, dict[str, int]] = {} | ||
| for test_type, result in self.winning_behavior_test_results.get_test_pass_fail_report_by_type().items(): | ||
| for test_type, test_result in self.winning_behavior_test_results.get_test_pass_fail_report_by_type().items(): | ||
| name = test_type.to_name() | ||
| if name: | ||
| report_table[name] = result | ||
| report_table[name] = test_result | ||
|
|
||
| result: dict[str, Union[str, int, dict[str, dict[str, int]], list[BenchmarkDetail], None]] = { | ||
| "optimization_explanation": self.optimization_explanation, | ||
|
|
@@ -45,8 +45,8 @@ def to_json(self) -> dict[str, Union[str, int, dict[str, dict[str, int]], list[B | |
| } | ||
|
|
||
| if self.original_async_throughput is not None and self.best_async_throughput is not None: | ||
| result["original_async_throughput"] = str(self.original_async_throughput) | ||
| result["best_async_throughput"] = str(self.best_async_throughput) | ||
| result["original_async_throughput"] = self.original_async_throughput | ||
| result["best_async_throughput"] = self.best_async_throughput | ||
|
Comment on lines
+48
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential breaking API change: throughput fields changed from Previously these were serialized as Verify the server-side API accepts |
||
|
|
||
| return result | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug:
exportkeyword in CommonJS module causes syntax errorThis file is a CommonJS module (uses
module.exportsat the bottom, and the parent package.json lacks"type": "module"). Adding theexportkeyword creates invalid JavaScript — Node.js will throwSyntaxError: Unexpected token 'export'.The same issue exists in:
code_to_optimize/js/code_to_optimize_js_cjs/fibonacci_class.jstests/test_languages/fixtures/js_cjs/math_utils.jstests/test_languages/fixtures/js_cjs/calculator.jstests/test_languages/fixtures/js_cjs/helpers/format.jsThe CommonJS export detection added in
treesitter_utils.py(_is_name_in_commonjs_exports) should handle discovering these functions without needing theexportkeyword. Removeexportfrom all CJS files.