Skip to content

Reset JSContext exception after processing#42

Merged
colinc86 merged 1 commit intocolinc86:mainfrom
raycast:fix-jscontext-exception
Apr 3, 2026
Merged

Reset JSContext exception after processing#42
colinc86 merged 1 commit intocolinc86:mainfrom
raycast:fix-jscontext-exception

Conversation

@nhojb
Copy link
Copy Markdown
Contributor

@nhojb nhojb commented Mar 31, 2025

The current implementation never resets the JSContext exception property. This means that a single exception will pollute all subsequent calls to MathJaxSwift e.g.

  1. try tex2svg(input1) throws
  2. MathJax.context.exception is now non-nil
  3. try tex2svg(input2) should succeed, but still throws because of input1 exception

The naive fix is to reset the context.exception after checking for the current exception.

@colinc86 colinc86 merged commit 2b686bb into colinc86:main Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants