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

Compressing Javascript #9

Closed
18thstreetmike opened this issue Aug 13, 2013 · 1 comment
Closed

Compressing Javascript #9

18thstreetmike opened this issue Aug 13, 2013 · 1 comment

Comments

@18thstreetmike
Copy link

Hey there,

I've run into bug when using the library to compress javascript source code. It's extremely intermittent and doesn't happen with every file; looking at the instances it wasn't even obvious what was causing it.

It seems that the context_dictionary can store a key called 'hasOwnProperty' (which exists in the uncompressed file) which overrides the object's own hasOwnProperty() method, which then errors out on subsequent runs through the loop.

I've worked around it by using the strategy outlined here:
http://www.devthought.com/2012/01/18/an-object-is-not-a-hash/

Basically, calling the hasOwnProperty method on the prototype rather than the object itself.

-m

@pieroxy
Copy link
Owner

pieroxy commented Aug 13, 2013

Fixed in versions 1.0.2 & 1.3.1

@pieroxy pieroxy closed this as completed Aug 13, 2013
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

2 participants