forked from Botanical/BotanJS
Avoid using for..in
This commit is contained in:
parent
9aec0a1d82
commit
7624d2b2fb
@ -48,10 +48,12 @@
|
||||
|
||||
var msg = ":buffers";
|
||||
|
||||
for( var i in Insts )
|
||||
var l = Insts.length;
|
||||
for( var i = 0; i < l; i ++ )
|
||||
{
|
||||
/** @type {Components.Vim.VimArea} */
|
||||
var inst = Insts[ i ];
|
||||
if( !inst ) continue;
|
||||
|
||||
var b = inst.index + " ";
|
||||
var icur = inst.contentFeeder.cursor;
|
||||
|
@ -598,7 +598,8 @@
|
||||
// because phantomSpace is not a valid character
|
||||
// So we calculate along with the phantomSpace here
|
||||
var phantomSpace = X;
|
||||
for( var i in lines )
|
||||
var lc = lines.length;
|
||||
for( var i = 0; i < lc; i ++ )
|
||||
{
|
||||
/** @type {Components.Vim.LineBuffer} */
|
||||
var vline = lines[ i ];
|
||||
|
@ -58,10 +58,10 @@
|
||||
throw new Error( "This element is not compatible for VimArea" );
|
||||
}
|
||||
|
||||
for( var i in Insts )
|
||||
for( var i = 0; i < InstIndex; i ++ )
|
||||
{
|
||||
var inst = Insts[ i ];
|
||||
if( inst.stage.element == element )
|
||||
if( inst && inst.stage.element == element )
|
||||
{
|
||||
debug.Info( "Instance exists" );
|
||||
return inst;
|
||||
@ -387,7 +387,12 @@
|
||||
|
||||
__readOnly( VimArea, "Instances", function() {
|
||||
var clone = [];
|
||||
for( var i in Insts ) clone.push( Insts[ i ] );
|
||||
|
||||
for( var i = 0; i < InstIndex; i ++ )
|
||||
{
|
||||
if( Insts[ i ] ) clone.push( Insts[ i ] );
|
||||
}
|
||||
|
||||
return clone;
|
||||
} );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user