Skip to content

Commit ae478f2

Browse files
RandomBytematz3
authored andcommitted
test: Add fixture for defineProperty call with recursive property access
This currently causes a Maximum call stack size exceeded exception within TypeScript's checker#typeToString method.
1 parent 407b799 commit ae478f2

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// See https://github.com/SAP/ui5-linter/issues/75
2+
Object.defineProperty(globalThis, "myProp", {
3+
value: true || window.foo
4+
});

test/lib/linter/snapshots/linter.ts.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,38 @@ Generated by [AVA](https://avajs.dev).
317317
},
318318
]
319319

320+
## General: RecursiveDefineProperty.js
321+
322+
> Parsing Errors: RecursiveDefineProperty.js
323+
324+
[
325+
'Maximum call stack size exceeded',
326+
]
327+
328+
> LintResult: RecursiveDefineProperty.js
329+
330+
[
331+
{
332+
coverageInfo: [],
333+
errorCount: 1,
334+
fatalErrorCount: 1,
335+
filePath: 'RecursiveDefineProperty.js',
336+
messages: [
337+
{
338+
column: undefined,
339+
fatal: true,
340+
line: undefined,
341+
message: 'Maximum call stack size exceeded',
342+
messageDetails: 'Check the source file for syntax errors',
343+
ruleId: 'parsing-error',
344+
severity: 2,
345+
ui5TypeInfo: undefined,
346+
},
347+
],
348+
warningCount: 0,
349+
},
350+
]
351+
320352
## General: TSLike.js
321353

322354
> LintResult: TSLike.js
241 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)