js-quantities
js-quantities copied to clipboard
format: stop relying on array properties
There are numerous libraries out there (sugarjs, prototypejs) that extend the Array prototype. The simplify function in js-quantities relies on setting/checking properties on an array instance, which means that it's incompatible with such libraries. This PR fixes #130, adding compatibility by using a separate object for keeping track of the counters instead of using properties on array instances.
Note: It was unclear whether I should be including changes to generated files. Please let me know if I should only be changing the src/spec files and I can update this PR.