{"record":{"id":"67588dccae9637a0","repo":"emberjs/ember.js","slug":"gte-expects-exactly-two-arguments-but-received","errorCode":null,"errorMessage":"`gte` expects exactly two arguments, but received ${arguments.length}.","messagePattern":"`gte` expects exactly two arguments, but received (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@glimmer/runtime/lib/helpers/gte.ts","lineNumber":10,"sourceCode":"import { DEBUG } from '@glimmer/env';\n\n/**\n * Performs a greater than or equal comparison.\n *\n * left >= right\n */\nexport function gte<T>(left: T, right: T) {\n  if (DEBUG && arguments.length !== 2) {\n    throw new Error(`\\`gte\\` expects exactly two arguments, but received ${arguments.length}.`);\n  }\n\n  return (left as number) >= (right as number);\n}\n","sourceCodeStart":1,"sourceCodeEnd":15,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/runtime/lib/helpers/gte.ts#L1-L15","documentation":"The `gte` helper performs a greater-than-or-equal comparison (left >= right) in templates. A debug-only arity guard throws when the helper does not receive exactly two arguments, which only occurs when it is invoked outside the normal template path with a malformed argument list.","triggerScenarios":"Direct JS call to `gte()` with 1 or 3+ arguments; custom helper/wrapper forwarding wrong positional count; programmatic invocation omitting required positional arguments.","commonSituations":"Unit tests importing internal helpers; refactoring template logic into JS utilities; generic argument-forwarding helpers miscounting positional params.","solutions":["Use `{{gte a b}}` in templates with exactly two arguments","When calling from JS, pass exactly two arguments: `gte(a, b)`","Add an arity assertion in any wrapper before delegating to gte"],"exampleFix":"// before\ngte(total);\n// after\ngte(total, 100);","handlingStrategy":"validation","validationCode":"function safeGte(...args) { if (args.length !== 2) throw new TypeError('gte requires exactly two arguments'); return gte(args[0], args[1]); }","typeGuard":"function hasTwoArgs<T extends unknown[]>(args: T): args is T & { length: 2 } { return args.length === 2; }","tryCatchPattern":"try { result = gte(a, b); } catch (e) { console.error('gte arity error:', e.message); result = false; }","preventionTips":["Always call gte from templates with exactly two arguments","Count arguments before calling from JS","Centralize internal helper calls in one arity-checked utility"],"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"}