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

Uncaught SyntaxError: Unexpected number #2392

Closed
PomegranateApps opened this issue May 31, 2014 · 3 comments
Closed

Uncaught SyntaxError: Unexpected number #2392

PomegranateApps opened this issue May 31, 2014 · 3 comments

Comments

@PomegranateApps
Copy link

If I have a number like this in my C++ file.
1.12345678901234567890123e21

It gets truncated to this in the compiled Javascript and causes a syntax error because of the ".0" after "e+21".
1.1234567890123457e+21.0

It seems to be only to certain exponential digits. For instance the same number with "e24" doesn't cause an issue.

@juj
Copy link
Collaborator

juj commented Jun 1, 2014

Can you write a small test application that exposes this and show the command line you used to build? That helps adding it to the unit test suite to catch any regressions.

@PomegranateApps
Copy link
Author

I'm using -O3 and ALLOW_MEMORY_GROWTH=1 in the command line.

It doesn't have any relation to any code. Emscripten is just truncating that value incorrectly wherever it appears in a file.

kripken added a commit that referenced this issue Jun 2, 2014
@kripken
Copy link
Member

kripken commented Jun 2, 2014

Thanks for reporting, I reproduced this and fixed it on incoming.

In the future, it's best to include a small complete testcase with bug reports, just so there isn't a risk of the testcase that I create missing something important.

@kripken kripken closed this as completed Jun 2, 2014
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

No branches or pull requests

3 participants