Add some edge cases

Note the last two new cases are fail now.

There are also some cases which I am not sure which is the "right" solution, pls see the comments.
Same reason as above: semi assumes your code is logically correct - it doesn't help you fix valid JavaScript code that contains bugs.