1
0
Fork 0

[#25] Removed transfered tests from test-class_builder-const

closure/master
Mike Gerwitz 2011-10-30 14:22:17 -04:00
parent b063a91e40
commit a0ba2feb33
1 changed files with 0 additions and 57 deletions

View File

@ -41,63 +41,6 @@ var common = require( './common' ),
; ;
/**
* The `const' keyword does not make sense with methods, as they are always
* immutable. Methods of a class cannot be redefined after the class definition.
* They may only be overridden by subtypes.
*/
( function testConstKeywordCannotBeUsedWithMethods()
{
try
{
// attempt to create a constant method (should fail)
builder.build(
{
'const foo': function() {},
} );
}
catch ( e )
{
assert.ok(
e.message.search( 'foo' ) !== -1,
"Const method error message should contain name of method"
);
return;
}
assert.fail( "Should not be able to declare constant methods" );
} )();
/**
* The const keyword implies static. Using static along with it is redundant and
* messy. Disallow it.
*/
( function testConstKeywordCannotBeUsedWithStatic()
{
try
{
// should fail
builder.build(
{
'static const foo': 'val',
} );
}
catch ( e )
{
assert.ok(
e.message.search( 'foo' ) !== -1,
"Static const method error message should contain name of property"
);
return;
}
assert.fail( "Should not be able to use static keyword with const" );
} )();
/** /**
* The const keyword should result in a static property. The rationale for this * The const keyword should result in a static property. The rationale for this
* is that, if a value is constant, then instances do not make sense. * is that, if a value is constant, then instances do not make sense.