Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using 'const' keyword with certain global variables causes mathjax to throw exceptions on render #1806

Closed
applmak opened this issue Jul 12, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@applmak
Copy link

commented Jul 12, 2017

Here's a simple repro case:

<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_CHTML"></script>
<script>
const scale = 1.0;
</script>
\(x = 1\)

I would expect this to render x = 1, but instead, I see [Math Processing Error].

@dpvc

This comment has been minimized.

Copy link
Member

commented Jul 12, 2017

Thanks! Looks like a non-localized variable used in a function. Argh! I thought we had tested for that, but apparently not. I'll fix the reference, and look into why this was missed...

@dpvc

This comment has been minimized.

Copy link
Member

commented Jul 14, 2017

The issue1806 branch includes the fix for this. I found one other variable that was also global that should not have been. The compressor usually reports these, but for these cases it doesn't. Not sure why.

dpvc pushed a commit to mathjax/MathJax-test that referenced this issue Jul 14, 2017

@dpvc

This comment has been minimized.

Copy link
Member

commented Jul 14, 2017

==> In testsuite

UI/issue1806.html

@dpvc dpvc added Test Available and removed Test Needed labels Jul 14, 2017

@dpvc dpvc closed this Jul 14, 2017

dpvc added a commit that referenced this issue Jul 21, 2017

Merge pull request #1809 from dpvc/issue1806
Localize some variables that where accidentally global.  #1806
@dpvc

This comment has been minimized.

Copy link
Member

commented Jul 21, 2017

==> Merged

@dpvc dpvc added Merged and removed Ready for Review labels Jul 21, 2017

@dpvc dpvc added Fixed v2.7 and removed Merged labels Jul 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.