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
{{ message }}
Repository navigation
Commit 291adbd
Browse filesBrowse the repository at this point in the historyBrowse files
fix(spec): a refusal code or reason is literal at save only when its quote closes the value
The four save-time readers (code and reason, property and assignment) stopped
at the closing quote, so a value built from a literal such as 'OVER' + suffix
was read as the literal OVER and refused at save. A property value is literal
now only when `,` or `}` follows; an assigned one only when `;`, `,`, `}`,
`)`, the source end, or a line end that does not continue the expression
follows. Every literal refused before is still refused in the same words.
Claude-Session: https://claude.ai/code/session_01L9qibykc1XS5J4B4J16dLb
Co-Authored-By: Claude <noreply@anthropic.com>
fix(spec): a hook's or action's refusal code and reason are read as literal at save only when the quoted value closes the value
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
The save doors of `HookSchema` and `ActionSchema` read the refusal codes and reasons a body throws literally (`hookRefusalCodesThrownIn`, `hookRefusalReasonsThrownIn`) and refuse one that `refusals` does not declare. The four readers stopped at the closing quote, so a value built from a literal — `throw { code: 'OVER' + suffix }`, `e.code = 'OVER' + suffix`, `reason: 'too' + suffix`, `e.reason = 'too' + suffix`, or a member access such as `'OVER'.concat(suffix)` — was read as the literal `OVER` or `too` and refused at save, though the body would run correctly once the built value is declared. The published reading already left a computed value to the run-time refusal; the save now agrees with it.
11
+
12
+
A property value is literal now only when its closing quote is followed by `,` or `}`, after optional whitespace. An assigned value is literal only when its closing quote is followed by `;`, `,`, `}` or `)`, by the end of the source, or by a line end whose next line does not continue the expression (a next line opening with an operator, a member access, a bracket or a template continues it). Every literal code or reason the save refused before is still refused, in the same words: `throw { code: 'X' }`, `throw Object.assign(new Error(), { code: 'X' })`, `e.code = 'X';`, `e.code = 'X'` at a line end, and the same for a reason, a listed reason included. A value built from a literal is refused when the hook or action runs, naming the code or reason, as any other computed value is. No author action is needed.
0 commit comments