You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #62549 from microsoft/TypeScript has already been successfully ported to the Go codebase.
7
+
8
+
## Details
9
+
10
+
### Original Change
11
+
The PR "Consistently resolve to the `errorType` on `arguments` with error" changed the TypeScript checker to pass `ignoreArrowFunctions: true` when checking if `arguments` is used in a property initializer or class static block.
12
+
13
+
**TypeScript change (src/compiler/checker.ts):**
14
+
```diff
15
+
- if (isInPropertyInitializerOrClassStaticBlock(node)) {
16
+
+ if (isInPropertyInitializerOrClassStaticBlock(node, /*ignoreArrowFunctions*/ true)) {
17
+
```
18
+
19
+
### Go Implementation
20
+
The equivalent change is already present in the Go codebase:
21
+
22
+
**File:**`internal/checker/checker.go`, line 10599
23
+
```go
24
+
if c.isInPropertyInitializerOrClassStaticBlock(node, true/*ignoreArrowFunctions*/) {
- ✅ The specific test `argumentsUsedInClassFieldInitializerOrStaticInitializationBlock` passes
33
+
- ✅ The testdata baseline shows the correct behavior (returning `any` type instead of `IArguments` for `arguments` in arrow functions within property initializers)
34
+
35
+
### Baseline Differences
36
+
The testdata contains `.diff` files showing differences between the Go implementation and the TypeScript submodule baselines. This is expected because:
37
+
1. The Go implementation has the change
38
+
2. The TypeScript submodule baselines haven't been regenerated yet (shallow clone)
39
+
3. The test framework correctly handles these differences
40
+
41
+
## Conclusion
42
+
No action needed. The change has been correctly ported and is functioning as expected.
0 commit comments