Made necessary changes to tests to prevent Closure Compiler from optimizing them away, causing test failures
parent
a18dedbddb
commit
58f2e3afc4
|
@ -230,7 +230,9 @@ require( 'common' ).testCase(
|
||||||
name,
|
name,
|
||||||
function() {},
|
function() {},
|
||||||
{ 'override': true },
|
{ 'override': true },
|
||||||
{ member: function( a, b, c ) {} },
|
// this function returns each of its arguments, otherwise
|
||||||
|
// they'll be optimized away by Closure Compiler.
|
||||||
|
{ member: function( a, b, c ) { return [a,b,c]; } },
|
||||||
{ 'virtual': true }
|
{ 'virtual': true }
|
||||||
);
|
);
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -192,6 +192,9 @@ var ConcreteFoo = Class.extend( AbstractFoo,
|
||||||
{
|
{
|
||||||
method: function( one, two, three )
|
method: function( one, two, three )
|
||||||
{
|
{
|
||||||
|
// prevent Closure Compiler from optimizing the arguments away, causing
|
||||||
|
// a definition failure
|
||||||
|
return [ one, two, three ];
|
||||||
},
|
},
|
||||||
|
|
||||||
second: function()
|
second: function()
|
||||||
|
@ -391,8 +394,9 @@ var ConcreteFoo = Class.extend( AbstractFoo,
|
||||||
{
|
{
|
||||||
Class.extend( SubAbstractFoo,
|
Class.extend( SubAbstractFoo,
|
||||||
{
|
{
|
||||||
// concrete, so the result would otherwise not be abstract
|
// concrete, so the result would otherwise not be abstract (return
|
||||||
'method': function( one, two, three ) {},
|
// args so they're not optimized away during compile)
|
||||||
|
'method': function( _, __, ___ ) { return [ _, __, ___ ]; },
|
||||||
|
|
||||||
// the problem
|
// the problem
|
||||||
'toString': function() {},
|
'toString': function() {},
|
||||||
|
|
|
@ -79,6 +79,10 @@ var common = require( './common' ),
|
||||||
assert.equal( warning.message, err.message,
|
assert.equal( warning.message, err.message,
|
||||||
"Warning message should be taken from wrapped exception"
|
"Warning message should be taken from wrapped exception"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// this little trick prevents the compiler from optimizing away the
|
||||||
|
// assignment, which would break the test in certain versions of FF.
|
||||||
|
return _;
|
||||||
} )();
|
} )();
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue