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 ) if ( get_set )
{ {
@ -108,20 +111,22 @@ if ( get_set )
check.push( setter ); check.push( setter );
} }
check.forEach( function( item, i ) while ( check_i-- )
{ {
item = check[ check_i ];
assert.notEqual( assert.notEqual(
item, item,
false, false,
"Can override propCopy() parser functions [" + i + "]" "Can override propCopy() parser functions [" + check_i + "]"
); );
assert.ok( assert.ok(
( item instanceof Function ), ( item instanceof Function ),
"propCopy() parser function overrides can invoke default functionality " + "propCopy() parser function overrides can invoke default functionality " +
"[" + i + "]" "[" + check_i + "]"
); );
}); }
assert.ok( assert.ok(
( override_data[ 0 ] === 'method' ), ( override_data[ 0 ] === 'method' ),

View File

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