envjs / env-js

A pure-JavaScript browser environment.
http://www.envjs.com/
87 stars 19 forks source link

insertCell throws "TypeError: Cannot read property 'nodeName' of null" #10

Open orslumen opened 13 years ago

orslumen commented 13 years ago

First of all, thank you for the great work on envjs!

While upgrading our integration tests from envjs 0.3.7 to 1.3.pre1 I noticed that when insertCell (html.js) is called with idx === numCells an error is thrown, because node is null when passed to insertBefore.

To fix this, the line this.insertBefore(cell, node); needs to be placed 2 lines higher within the else block. So the new cell is either appended at the end of the row, or inserted before an existing cell.

Kind regards, Orslumen

PS. If you prefer a pull request, pls let me know.

thatcher commented 13 years ago

this is perfect, thank you for adding tickets!