Corrected errors/warnings as indicated by Google Closure compiler
parent
f39fc05ae2
commit
74dd239de0
|
@ -322,7 +322,7 @@ function prepareCaseContext()
|
|||
assertDeepEqual: assert_wrapped.deepEqual,
|
||||
assertStrictEqual: assert_wrapped.strictEqual,
|
||||
assertNotStrictEqual: assert_wrapped.notStrictEqual,
|
||||
assertThrows: assert_wrapped.throws,
|
||||
assertThrows: assert_wrapped['throws'],
|
||||
assertDoesNotThrow: assert_wrapped.doesNotThrow,
|
||||
assertIfError: assert_wrapped.ifError,
|
||||
incAssertCount: incAssertCount,
|
||||
|
|
|
@ -256,7 +256,7 @@ var ConcreteFoo = Class.extend( AbstractFoo,
|
|||
|
||||
( function testAbstractClassesCannotBeInstantiated()
|
||||
{
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
// both should fail
|
||||
AbstractFoo();
|
||||
|
@ -289,7 +289,7 @@ var ConcreteFoo = Class.extend( AbstractFoo,
|
|||
|
||||
( function testConcreteMethodsMustImplementTheProperNumberOfArguments()
|
||||
{
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
AbstractFoo.extend(
|
||||
{
|
||||
|
@ -304,7 +304,7 @@ var ConcreteFoo = Class.extend( AbstractFoo,
|
|||
|
||||
( function testAbstractMethodsOfSubtypesMustImplementProperNumberOfArguments()
|
||||
{
|
||||
assert.throws(
|
||||
assert['throws'](
|
||||
function()
|
||||
{
|
||||
AbstractFoo.extend(
|
||||
|
@ -360,7 +360,7 @@ var ConcreteFoo = Class.extend( AbstractFoo,
|
|||
|
||||
( function testAbstractMethodsMustBeDeclaredAsArrays()
|
||||
{
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
Class.extend(
|
||||
{
|
||||
|
@ -424,7 +424,7 @@ var ConcreteFoo = Class.extend( AbstractFoo,
|
|||
anon_named = AbstractClass.extend( AbstractFoo, {} );
|
||||
|
||||
// named
|
||||
assert.throws(
|
||||
assert['throws'](
|
||||
function()
|
||||
{
|
||||
// should throw an error, since we're not declaring it as abstract
|
||||
|
@ -436,7 +436,7 @@ var ConcreteFoo = Class.extend( AbstractFoo,
|
|||
);
|
||||
|
||||
// anonymous
|
||||
assert.throws(
|
||||
assert['throws'](
|
||||
function()
|
||||
{
|
||||
// should throw an error, since we're not declaring it as abstract
|
||||
|
|
|
@ -157,12 +157,12 @@ assert.ok(
|
|||
*/
|
||||
( function testConstructorCannotBeDeclaredAsProtectedOrPrivate()
|
||||
{
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
Class( { 'protected __construct': function() {} } );
|
||||
}, TypeError, "Constructor cannot be protected" );
|
||||
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
Class( { 'private __construct': function() {} } );
|
||||
}, TypeError, "Constructor cannot be private" );
|
||||
|
|
|
@ -166,7 +166,7 @@ for ( var i = 0; i < class_count; i++ )
|
|||
);
|
||||
|
||||
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
Class.extend( OtherClass,
|
||||
{
|
||||
|
@ -224,7 +224,7 @@ for ( var i = 0; i < class_count; i++ )
|
|||
"Subtypes can override parent property values"
|
||||
);
|
||||
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
Class.extend(
|
||||
{
|
||||
|
@ -249,7 +249,7 @@ for ( var i = 0; i < class_count; i++ )
|
|||
|
||||
( function testInvokingClassModuleRequiresObjectAsArgumentIfCreating()
|
||||
{
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
Class( 'moo' );
|
||||
Class( 5 );
|
||||
|
@ -321,7 +321,7 @@ for ( var i = 0; i < class_count; i++ )
|
|||
*/
|
||||
( function testCannotProvideDuplicateMemberDefintions()
|
||||
{
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
Class(
|
||||
{
|
||||
|
@ -334,7 +334,7 @@ for ( var i = 0; i < class_count; i++ )
|
|||
} );
|
||||
}, Error, "Cannot redeclare property in same class definition" );
|
||||
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
Class(
|
||||
{
|
||||
|
|
|
@ -104,7 +104,7 @@ assert.equal(
|
|||
"Arguments should be passed to super method via _super argument list"
|
||||
);
|
||||
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
Foo.extend(
|
||||
{
|
||||
|
|
|
@ -81,13 +81,13 @@ var common = require( './common' ),
|
|||
;
|
||||
|
||||
// named
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
FinalNamed.extend( {} );
|
||||
}, Error, "Cannot extend final named subtype" );
|
||||
|
||||
// anonymous
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
FinalAnon.extend( {} );
|
||||
}, Error, "Cannot extend final anonymous subtype" );
|
||||
|
|
|
@ -88,7 +88,7 @@ var common = require( './common' ),
|
|||
for ( name in reserved )
|
||||
{
|
||||
// properties
|
||||
assert.throws(
|
||||
assert['throws'](
|
||||
function()
|
||||
{
|
||||
var obj = {};
|
||||
|
@ -102,7 +102,7 @@ var common = require( './common' ),
|
|||
);
|
||||
|
||||
// methods
|
||||
assert.throws(
|
||||
assert['throws'](
|
||||
function()
|
||||
{
|
||||
var obj = {};
|
||||
|
@ -179,7 +179,7 @@ var common = require( './common' ),
|
|||
// test each of the reserved members
|
||||
for ( name in pub )
|
||||
{
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
var obj = {};
|
||||
obj[ name ] = function() {};
|
||||
|
|
|
@ -38,7 +38,7 @@ assert.ok(
|
|||
"util.isAbstractMethod"
|
||||
);
|
||||
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
util.createAbstractMethod()();
|
||||
}, Error, "Abstract methods cannot be called" );
|
||||
|
|
|
@ -121,22 +121,22 @@ var common = require( './common' ),
|
|||
*/
|
||||
( function testThrowsErrorIfSourceOrDestAreNotGiven()
|
||||
{
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
copyTo();
|
||||
}, TypeError, "Dest parameter is required" );
|
||||
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
copyTo( 'bla', {} );
|
||||
}, TypeError, "Dest parameter is required to be an object" );
|
||||
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
copyTo( {} );
|
||||
}, TypeError, "Src parameter is required" );
|
||||
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
copyTo( {}, 'foo' );
|
||||
}, TypeError, "Src parameter is required to be an object" );
|
||||
|
|
|
@ -71,8 +71,8 @@ var common = require( './common' ),
|
|||
|
||||
// bug in FF (tested with 8.0) where, without accessing the message property
|
||||
// in this test before passing it to Warning, err.message === "" within the
|
||||
// Warning ctor.
|
||||
err.message;
|
||||
// Warning ctor. (Assignment is to silence Closure compiler warning.)
|
||||
var _ = err.message;
|
||||
|
||||
var warning = Warning( err );
|
||||
|
||||
|
@ -88,12 +88,12 @@ var common = require( './common' ),
|
|||
*/
|
||||
( function testThrowsExceptionIfNoExceptionIsWrapped()
|
||||
{
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
Warning( /* nothing provided to wrap */ );
|
||||
}, TypeError, "Exception should be thrown if no exception is provided" );
|
||||
|
||||
assert.throws( function()
|
||||
assert['throws']( function()
|
||||
{
|
||||
Warning( 'not an exception' );
|
||||
}, TypeError, "Exception should be thrown if given value is not an Error" );
|
||||
|
|
Loading…
Reference in New Issue