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

yui-compressor fails to evaluate reserved words in expressions #186

Closed
ajkret opened this issue Jan 6, 2015 · 2 comments
Closed

yui-compressor fails to evaluate reserved words in expressions #186

ajkret opened this issue Jan 6, 2015 · 2 comments
Labels

Comments

@ajkret
Copy link

ajkret commented Jan 6, 2015

When entering expressions like this one:

var span=document.createElement('span');
span.style.float="right";

It generates the following error:

missing name after . operator

I belive the 'float' element is the problem. As a workaround, I use this:

 eval('span.style.float="right"');
@tml
Copy link
Contributor

tml commented Jan 9, 2015

Yes, this is issue #47 all over again - in brief, this is not allowed in ES3 (which is what Rhino supports, and Rhino is what provides the JS engine for YUICompressor).

@tml tml closed this as completed Jan 9, 2015
@tml tml added the es5 label Feb 7, 2015
@ghost
Copy link

ghost commented Apr 21, 2017

@ajkret: no need for eval, replacing dot notation with string-based property accessors works fine:

var span=document.createElement('span');
span.style["float"]="right";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants