CSS Method loops over each character if type of proberty is a string AND Android TypeError"Cannot convert object to primitive" #603

Closed
wants to merge 2 commits into
from

Projects

None yet

3 participants

@AndyOGo

Fixed those two bugs

@madrobby
Owner

Thanks for the pull request. This needs tests.

@mislav
Collaborator

More specifically, the commit that claims to have fixed a bug needs tests. The first commit is an optimization and therefore doesn't need tests (but I'll cover the functionality in my speed tests)

@madrobby
Owner

(It would be better to have this in separate pull requests!)

@mislav
Collaborator

Because both changes are to the same method, I don't mind that this is in a single PR. But, I need evidence that a bug exists—evidence in form of failing test.

@AndyOGo

I understand.

I just created a simple test case @ jsperf:
http://jsperf.com/zepto-css-method

The first thing can be tested very easily:
just ably $('#foo').css('display', 'block'), open your JS debugger and set a breakpoint to the css-Method.
you will observe, that the method firstly iterates over each chareckter of "display" and then will do the correct job.

For the second one you will need a Samsung Galaxy or any other Android driven device.
Then it happen that you get a Type-Error "Cannot Convert Object to Primitive Value" if you pass an object literall.

best,
Andreas

@madrobby
Owner

The css method has changed quite a bit since this PR. If it's still a problem, please add tests and a proposed solution in a new pull request.

@madrobby madrobby closed this Sep 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment