Skip to content

Commit 4d1f5f9

Browse files
committed
Add test: array referencing this in object referencing this should not collide
1 parent a1c35c2 commit 4d1f5f9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export default ({ expect }: typeof import('vitest')) => {
2+
const test = {
3+
[0]: 'test[0]',
4+
foo: [
5+
function () {
6+
// @ts-ignore
7+
return this[0]
8+
}
9+
],
10+
bar() {
11+
return this
12+
}
13+
};
14+
15+
expect(test.foo[0]!()).toBe(test.foo[0])
16+
expect(test.bar()).toBe(test)
17+
}

0 commit comments

Comments
 (0)