1
0
Fork 0

Corrected errors/warnings as indicated by Google Closure compiler

closure/master
Mike Gerwitz 2011-12-04 19:26:53 -05:00
parent f39fc05ae2
commit 74dd239de0
10 changed files with 29 additions and 29 deletions

View File

@ -322,7 +322,7 @@ function prepareCaseContext()
assertDeepEqual: assert_wrapped.deepEqual, assertDeepEqual: assert_wrapped.deepEqual,
assertStrictEqual: assert_wrapped.strictEqual, assertStrictEqual: assert_wrapped.strictEqual,
assertNotStrictEqual: assert_wrapped.notStrictEqual, assertNotStrictEqual: assert_wrapped.notStrictEqual,
assertThrows: assert_wrapped.throws, assertThrows: assert_wrapped['throws'],
assertDoesNotThrow: assert_wrapped.doesNotThrow, assertDoesNotThrow: assert_wrapped.doesNotThrow,
assertIfError: assert_wrapped.ifError, assertIfError: assert_wrapped.ifError,
incAssertCount: incAssertCount, incAssertCount: incAssertCount,

View File

@ -256,7 +256,7 @@ var ConcreteFoo = Class.extend( AbstractFoo,
( function testAbstractClassesCannotBeInstantiated() ( function testAbstractClassesCannotBeInstantiated()
{ {
assert.throws( function() assert['throws']( function()
{ {
// both should fail // both should fail
AbstractFoo(); AbstractFoo();
@ -289,7 +289,7 @@ var ConcreteFoo = Class.extend( AbstractFoo,
( function testConcreteMethodsMustImplementTheProperNumberOfArguments() ( function testConcreteMethodsMustImplementTheProperNumberOfArguments()
{ {
assert.throws( function() assert['throws']( function()
{ {
AbstractFoo.extend( AbstractFoo.extend(
{ {
@ -304,7 +304,7 @@ var ConcreteFoo = Class.extend( AbstractFoo,
( function testAbstractMethodsOfSubtypesMustImplementProperNumberOfArguments() ( function testAbstractMethodsOfSubtypesMustImplementProperNumberOfArguments()
{ {
assert.throws( assert['throws'](
function() function()
{ {
AbstractFoo.extend( AbstractFoo.extend(
@ -360,7 +360,7 @@ var ConcreteFoo = Class.extend( AbstractFoo,
( function testAbstractMethodsMustBeDeclaredAsArrays() ( function testAbstractMethodsMustBeDeclaredAsArrays()
{ {
assert.throws( function() assert['throws']( function()
{ {
Class.extend( Class.extend(
{ {
@ -424,7 +424,7 @@ var ConcreteFoo = Class.extend( AbstractFoo,
anon_named = AbstractClass.extend( AbstractFoo, {} ); anon_named = AbstractClass.extend( AbstractFoo, {} );
// named // named
assert.throws( assert['throws'](
function() function()
{ {
// should throw an error, since we're not declaring it as abstract // should throw an error, since we're not declaring it as abstract
@ -436,7 +436,7 @@ var ConcreteFoo = Class.extend( AbstractFoo,
); );
// anonymous // anonymous
assert.throws( assert['throws'](
function() function()
{ {
// should throw an error, since we're not declaring it as abstract // should throw an error, since we're not declaring it as abstract

View File

@ -157,12 +157,12 @@ assert.ok(
*/ */
( function testConstructorCannotBeDeclaredAsProtectedOrPrivate() ( function testConstructorCannotBeDeclaredAsProtectedOrPrivate()
{ {
assert.throws( function() assert['throws']( function()
{ {
Class( { 'protected __construct': function() {} } ); Class( { 'protected __construct': function() {} } );
}, TypeError, "Constructor cannot be protected" ); }, TypeError, "Constructor cannot be protected" );
assert.throws( function() assert['throws']( function()
{ {
Class( { 'private __construct': function() {} } ); Class( { 'private __construct': function() {} } );
}, TypeError, "Constructor cannot be private" ); }, TypeError, "Constructor cannot be private" );

View File

@ -166,7 +166,7 @@ for ( var i = 0; i < class_count; i++ )
); );
assert.throws( function() assert['throws']( function()
{ {
Class.extend( OtherClass, Class.extend( OtherClass,
{ {
@ -224,7 +224,7 @@ for ( var i = 0; i < class_count; i++ )
"Subtypes can override parent property values" "Subtypes can override parent property values"
); );
assert.throws( function() assert['throws']( function()
{ {
Class.extend( Class.extend(
{ {
@ -249,7 +249,7 @@ for ( var i = 0; i < class_count; i++ )
( function testInvokingClassModuleRequiresObjectAsArgumentIfCreating() ( function testInvokingClassModuleRequiresObjectAsArgumentIfCreating()
{ {
assert.throws( function() assert['throws']( function()
{ {
Class( 'moo' ); Class( 'moo' );
Class( 5 ); Class( 5 );
@ -321,7 +321,7 @@ for ( var i = 0; i < class_count; i++ )
*/ */
( function testCannotProvideDuplicateMemberDefintions() ( function testCannotProvideDuplicateMemberDefintions()
{ {
assert.throws( function() assert['throws']( function()
{ {
Class( Class(
{ {
@ -334,7 +334,7 @@ for ( var i = 0; i < class_count; i++ )
} ); } );
}, Error, "Cannot redeclare property in same class definition" ); }, Error, "Cannot redeclare property in same class definition" );
assert.throws( function() assert['throws']( function()
{ {
Class( Class(
{ {

View File

@ -104,7 +104,7 @@ assert.equal(
"Arguments should be passed to super method via _super argument list" "Arguments should be passed to super method via _super argument list"
); );
assert.throws( function() assert['throws']( function()
{ {
Foo.extend( Foo.extend(
{ {

View File

@ -81,13 +81,13 @@ var common = require( './common' ),
; ;
// named // named
assert.throws( function() assert['throws']( function()
{ {
FinalNamed.extend( {} ); FinalNamed.extend( {} );
}, Error, "Cannot extend final named subtype" ); }, Error, "Cannot extend final named subtype" );
// anonymous // anonymous
assert.throws( function() assert['throws']( function()
{ {
FinalAnon.extend( {} ); FinalAnon.extend( {} );
}, Error, "Cannot extend final anonymous subtype" ); }, Error, "Cannot extend final anonymous subtype" );

View File

@ -88,7 +88,7 @@ var common = require( './common' ),
for ( name in reserved ) for ( name in reserved )
{ {
// properties // properties
assert.throws( assert['throws'](
function() function()
{ {
var obj = {}; var obj = {};
@ -102,7 +102,7 @@ var common = require( './common' ),
); );
// methods // methods
assert.throws( assert['throws'](
function() function()
{ {
var obj = {}; var obj = {};
@ -179,7 +179,7 @@ var common = require( './common' ),
// test each of the reserved members // test each of the reserved members
for ( name in pub ) for ( name in pub )
{ {
assert.throws( function() assert['throws']( function()
{ {
var obj = {}; var obj = {};
obj[ name ] = function() {}; obj[ name ] = function() {};

View File

@ -38,7 +38,7 @@ assert.ok(
"util.isAbstractMethod" "util.isAbstractMethod"
); );
assert.throws( function() assert['throws']( function()
{ {
util.createAbstractMethod()(); util.createAbstractMethod()();
}, Error, "Abstract methods cannot be called" ); }, Error, "Abstract methods cannot be called" );

View File

@ -121,22 +121,22 @@ var common = require( './common' ),
*/ */
( function testThrowsErrorIfSourceOrDestAreNotGiven() ( function testThrowsErrorIfSourceOrDestAreNotGiven()
{ {
assert.throws( function() assert['throws']( function()
{ {
copyTo(); copyTo();
}, TypeError, "Dest parameter is required" ); }, TypeError, "Dest parameter is required" );
assert.throws( function() assert['throws']( function()
{ {
copyTo( 'bla', {} ); copyTo( 'bla', {} );
}, TypeError, "Dest parameter is required to be an object" ); }, TypeError, "Dest parameter is required to be an object" );
assert.throws( function() assert['throws']( function()
{ {
copyTo( {} ); copyTo( {} );
}, TypeError, "Src parameter is required" ); }, TypeError, "Src parameter is required" );
assert.throws( function() assert['throws']( function()
{ {
copyTo( {}, 'foo' ); copyTo( {}, 'foo' );
}, TypeError, "Src parameter is required to be an object" ); }, TypeError, "Src parameter is required to be an object" );

View File

@ -71,8 +71,8 @@ var common = require( './common' ),
// bug in FF (tested with 8.0) where, without accessing the message property // 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 // in this test before passing it to Warning, err.message === "" within the
// Warning ctor. // Warning ctor. (Assignment is to silence Closure compiler warning.)
err.message; var _ = err.message;
var warning = Warning( err ); var warning = Warning( err );
@ -88,12 +88,12 @@ var common = require( './common' ),
*/ */
( function testThrowsExceptionIfNoExceptionIsWrapped() ( function testThrowsExceptionIfNoExceptionIsWrapped()
{ {
assert.throws( function() assert['throws']( function()
{ {
Warning( /* nothing provided to wrap */ ); Warning( /* nothing provided to wrap */ );
}, TypeError, "Exception should be thrown if no exception is provided" ); }, TypeError, "Exception should be thrown if no exception is provided" );
assert.throws( function() assert['throws']( function()
{ {
Warning( 'not an exception' ); Warning( 'not an exception' );
}, TypeError, "Exception should be thrown if given value is not an Error" ); }, TypeError, "Exception should be thrown if given value is not an Error" );