1
0
Fork 0

Removed forEach from tests to support engines that have not yet implemented that method (new in ES5)

closure/master
Mike Gerwitz 2010-12-28 09:14:35 -05:00
parent ac6fb40c21
commit 665b11e116
2 changed files with 28 additions and 14 deletions

View File

@ -100,7 +100,10 @@ propCopy( props, dest2, {
},
} );
var check = [ each, prop, method, override ];
var check = [ each, prop, method, override ],
check_i = check.length,
item = null
;
if ( get_set )
{
@ -108,20 +111,22 @@ if ( get_set )
check.push( setter );
}
check.forEach( function( item, i )
while ( check_i-- )
{
item = check[ check_i ];
assert.notEqual(
item,
false,
"Can override propCopy() parser functions [" + i + "]"
"Can override propCopy() parser functions [" + check_i + "]"
);
assert.ok(
( item instanceof Function ),
"propCopy() parser function overrides can invoke default functionality " +
"[" + i + "]"
"[" + check_i + "]"
);
});
}
assert.ok(
( override_data[ 0 ] === 'method' ),

View File

@ -105,15 +105,24 @@ util.propParse( data, {
// ensure properties were properly recognized
[ 'propStr', 'propBool', 'propInt', 'propFloat', 'propArray', 'propObj' ]
.forEach( function( item )
{
assert.equal(
props[ item ],
data[ item ],
"Property parser properly detects class properties"
);
});
var chk = [
'propStr', 'propBool', 'propInt', 'propFloat', 'propArray', 'propObj'
],
chk_i = chk.length,
item = null
;
while ( chk_i-- )
{
item = chk[ chk_i ];
assert.equal(
props[ item ],
data[ item ],
"Property parser properly detects class properties"
);
};
assert.equal(
methods.method,