You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered: