Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Class names `eval` and `arguments` are not reported as invalid strict mode bindings

Open Beginner friendly
#64,661 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
compilers

Research direction

Start in the binder at bindClassLikeDeclaration and compare its strict-mode checks with checkStrictModeFunctionName; the issue identifies the missing check and ambient-context condition. Find the binder regression tests and cover class declarations, class expressions, and .js files with checkJs. Done means eval and arguments class names report the expected strict-mode diagnostic without changing valid cases.

Written by the indexing model from the issue text.

Description

Acknowledgement
  • I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.
Comment
🔎 Search Terms

class name eval arguments, class arguments strict mode, TS1210 class name, TS1215 class declaration, checkStrictModeEvalOrArguments class

🕗 Version & Regression Information
  • This is the behavior in every version I tried (4.0.8, 5.0.4, 6.0.2, 7.1.0-dev.20261006.1), and I reviewed the FAQ for entries about strict mode and reserved words
⏯ Playground Link

https://www.typescriptlang.org/play/?ts=6.0.0-dev.20260416#code/MYGwhgzhAEYE4HMCuBbApgOwC4wN4F9ojiiB6U6DAe2jTjirgBpaAPABzWCzQBNoAKgGUAjACYRABgBQoSDDQA3MCGgESGkuUo06DZm07c+g0RJnAqGCFmgBhaAF5ocqLWWqCAbjIVqtekYWNA4uHn5hcSlpXi5wODQXcDclFTVCbX89IMMwk0jzaWltADFGFyoUdngASwgrFhVVKiwACzpoGzga7gBaFCpY6AAjGoxeMYQYeESE9kZwgC5pADMkDG4aq2gVgAoASjVpIlcYABE1aBRd+GR0bAhFylRhukP1DIoC6PxpEPm4LZvNIgA

💻 Code
class arguments {}        // no error, expected TS1210
class eval {}             // no error, expected TS1210
const C = class eval {};  // no error, expected TS1210
declare class eval {} // no error, expected TS1210

// For comparison, all other strict-mode bindings are reported:
function f() {
  class D { m(arguments: number) {} } // TS1210
}
export {};
🙁 Actual behavior

No errors are reported for the class names. The emitted JavaScript is rejected at runtime:

$ node out.js
SyntaxError: Unexpected eval or arguments in strict mode

The same happens in a .js file with checkJs enabled.

🙂 Expected behavior

Each class name eval / arguments should be reported, as other strict mode bindings already are. Per the spec, all parts of a class are strict mode code (ECMA-262 §11.2.2), and it is an early error for a BindingIdentifier in strict mode code to be eval or arguments (§13.1.1). This applies to both class declarations and class expressions.

Additional information about the issue

In the binder, function names (checkStrictModeFunctionName), variable declarations (bindVariableDeclarationOrBindingElement) and parameters (bindParameter) all call checkStrictModeEvalOrArguments. bindClassLikeDeclaration never does, so class names skip this check.

bindWorker already sets inStrictMode = true for ClassDeclaration / ClassExpression before it calls bindClassLikeDeclaration. So a fix could follow checkStrictModeFunctionName: call checkStrictModeEvalOrArguments(node, node.name) in bindClassLikeDeclaration when not in an ambient context.

Found this issue while fixing the same bug in Babel's parser: https://github.com/babel/babel/pull/18315

Dominant language
Go
Stars
111k
Forks
15.5k
Avg merge
1d 21h
Merged PRs (30d)
142

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/TypeScript

All issues in microsoft/TypeScript

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.