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

Allow Antlr Javascript runtime to be loaded into Kindle Touch #3183

Closed
milanaleksic opened this issue May 15, 2021 · 3 comments
Closed

Allow Antlr Javascript runtime to be loaded into Kindle Touch #3183

milanaleksic opened this issue May 15, 2021 · 3 comments

Comments

@milanaleksic
Copy link
Contributor

Currently if I want to load the antlr4 JS runtime into a constrained environment everything works flalwesly, but there is a small change that I have to monkey-patch on my side each time: the this.readInt.bind(this) call fails because bind doesn't exist.

Since this issue only happens on 2 lines (and all others just work without issue) I thought maybe an alternative solution might help remove this last problem by using a very easy straight-forward replacement of those 2 lines?

Thank you for the great work on this library, it really helps a lot and I am a great fan!

@ericvergnaud
Copy link
Contributor

Hi,
how can 'bind' not exist ? It is crucial to JavaScript...
https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
Have you looked for a polyfill ?

@milanaleksic
Copy link
Contributor Author

Hi,

how can 'bind' not exist ? It is crucial to JavaScript...

https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Function/bind

I don't know. I have verified independently with a very small JS snippet and it indeed it fails in that case as well. But, Kindle Touch loads many other libraries (vue is fully loaded, bootstrap, jQuery... all work except antlr4 in my web app for the mentioned reason).

Have you looked for a polyfill ?

If you are saying that you wouldn't consider accepting the issue or PR that would be my fallback, yes

@milanaleksic
Copy link
Contributor Author

I will retract my issue and pull request because, after further research, the advised approach is recommended on Internet (instead of fixing the upstream) and writing the polyfill from scratch seems to cut it.

Thanks for pointing me to the correct @ericvergnaud !

@parrt parrt added this to the 4.9.3 milestone Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants