katiekuwata / shellinabox

Automatically exported from code.google.com/p/shellinabox
Other
0 stars 0 forks source link

A couple of bugs in vt100.js, Missing "this" in some places, unused variables, etc. #195

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I noticed that in a few places, there is an assignment to an undeclared 
variable called "needWrap" that probably should actually be "this.needWrap".  
There is something similar with "bottom" and "cursorY" in an equation.  You can 
find all of these by prefixing them with a space.

"offset" is assigned false, but is undeclared, unused, and only appears once.

"normalKey" is declared, assigned, but unused in Keyup.

A lot of for-loops could effectively be while-loops with fewer lint parser 
issues.

A number of ternary statements where a simpler logic statement would work 
(this.par[0] ? this.par[0] :1) -> (this.par[0] || 1)

If you consider your code to be mostly complete, consider utilizing the chrome 
extension script-cover for javascript code coverage testing, it will help you 
find subtle logic bugs that make segments of your code obsolete or unreachable.

See attached for changes that you might like to merge in.

I haven't tested this code.

Original issue reported on code.google.com by plngp0ng...@gmail.com on 14 Jun 2012 at 5:27

Attachments: