{"record":{"id":"b76f27ccf6c82efc","repo":"emberjs/ember.js","slug":"eq-expects-exactly-two-arguments-but-received","errorCode":null,"errorMessage":"`eq` expects exactly two arguments, but received ${arguments.length}.","messagePattern":"`eq` expects exactly two arguments, but received (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@glimmer/runtime/lib/helpers/eq.ts","lineNumber":10,"sourceCode":"import { DEBUG } from '@glimmer/env';\n\n/**\n * Performs a strict equality comparison.\n *\n * left === right\n */\nexport function eq(left: unknown, right: unknown) {\n  if (DEBUG && arguments.length !== 2) {\n    throw new Error(`\\`eq\\` expects exactly two arguments, but received ${arguments.length}.`);\n  }\n\n  return left === right;\n}\n","sourceCodeStart":1,"sourceCodeEnd":15,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/runtime/lib/helpers/eq.ts#L1-L15","documentation":"The `eq` helper performs a strict equality comparison (left === right) in Glimmer templates. This debug-only guard throws when the helper receives an argument count other than exactly two, which normally only happens when the helper is misused from JavaScript (e.g. called directly instead of through the template helper machinery) rather than from a template.","triggerScenarios":"Calling `eq()` directly from JS with 1 or 3+ arguments; a custom helper/curry pipeline invoking eq with a malformed positional args array; helper invoked programmatically without the two positional arguments the template syntax `{{eq a b}}` guarantees.","commonSituations":"Refactoring a template helper call into a direct JS call; wrapping eq in a custom helper and forgetting to forward both positional args; test code importing the internal helper and calling it with partial arguments.","solutions":["Call the helper from templates as `{{eq a b}}` with exactly two arguments","If calling from JS, wrap arguments so exactly two are passed: `eq(a, b)`","Ensure any wrapper forwards `positional.length === 2` before invoking eq"],"exampleFix":"// before\nimport { eq } from '@glimmer/runtime';\neq(a);\n// after\neq(a, b);","handlingStrategy":"validation","validationCode":"function safeEq(...args) { if (args.length !== 2) throw new TypeError('eq requires exactly two arguments'); return eq(args[0], args[1]); }","typeGuard":"function hasTwoArgs<T extends unknown[]>(args: T): args is T & { length: 2 } { return args.length === 2; }","tryCatchPattern":"try { result = eq(a, b); } catch (e) { console.error('eq arity error:', e.message); result = false; }","preventionTips":["Always call eq from templates with exactly two arguments","When invoking from JS, count arguments before calling","Wrap internal helpers with arity-asserting utilities"],"tags":["glimmer","template-helper","arity","debug"],"backgroundTag":"helper-arity-mismatch","analyzedSha":"26f97246a8bf2e28edf26ac3093da2e86c04ffc5","analyzedAt":"2026-09-01T05:01:28.182Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}