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

Prevent closure compiler from mangling WebGL 2 API calls #3478

Merged
merged 2 commits into from
May 28, 2015
Merged

Prevent closure compiler from mangling WebGL 2 API calls #3478

merged 2 commits into from
May 28, 2015

Conversation

mosra
Copy link
Contributor

@mosra mosra commented May 27, 2015

Fix for #3473 . I just went through all GLctx.something(...) calls in the WebGL 2 section, replaced them with GLctx['something'](...), tested some of these with --closure 1 and they now work. The only places where I left the original code are in makeSetValue() calls like this one:

{{{ makeSetValue('params', '0', 'GLctx.getSamplerParameter(sampler, pname)', 'float') }}}

I don't know how the closure compiler handles these (if at all) so they are left untouched. Should I change them too?

@juj juj added the GL label May 27, 2015
@juj
Copy link
Collaborator

juj commented May 27, 2015

Closure compiler will not see the makeSetValue commands, themselves but those are expanded to the expression in the third parameter before the output is passed to closure. Therefore it is possible that the GLctx.getSamplerParameter() call from inside that expression would get closure transformed to something like `GLctx.eA'. Replacing those as well makes sense.

@mosra
Copy link
Contributor Author

mosra commented May 27, 2015

Done.

@juj
Copy link
Collaborator

juj commented May 28, 2015

Thanks!

juj added a commit that referenced this pull request May 28, 2015
Prevent closure compiler from mangling WebGL 2 API calls
@juj juj merged commit 55de8d6 into emscripten-core:incoming May 28, 2015
@mosra mosra deleted the webgl2-closure-fixes branch May 28, 2015 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants