Skip to content

Commit

Permalink
test: Add fixture for defineProperty call with recursive property access
Browse files Browse the repository at this point in the history
This currently causes a Maximum call stack size exceeded exception
within TypeScript's checker#typeToString method.
  • Loading branch information
RandomByte committed Apr 17, 2024
1 parent 508d81d commit 8473db4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/fixtures/linter/general/RecursiveDefineProperty.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// See https://github.com/SAP/ui5-linter/issues/75
Object.defineProperty(globalThis, "myProp", {
value: true || window.foo
});
22 changes: 22 additions & 0 deletions test/lib/linter/snapshots/linter.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,28 @@ Generated by [AVA](https://avajs.dev).
},
]

## General: RecursiveDefineProperty.js

> Snapshot 1
[
{
coverageInfo: [],
errorCount: 1,
fatalErrorCount: 1,
filePath: 'RecursiveDefineProperty.js',
messages: [
{
fatal: true,
message: 'Maximum call stack size exceeded',
ruleId: 'ui5-linter-parsing-error',
severity: 2,
},
],
warningCount: 0,
},
]

## General: TSLike.js

> Snapshot 1
Expand Down
Binary file modified test/lib/linter/snapshots/linter.ts.snap
Binary file not shown.

0 comments on commit 8473db4

Please sign in to comment.