From a0ba2feb3325e87ad53e93230b25d7b1c046eb55 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Sun, 30 Oct 2011 14:22:17 -0400 Subject: [PATCH] [#25] Removed transfered tests from test-class_builder-const --- test/test-class_builder-const.js | 57 -------------------------------- 1 file changed, 57 deletions(-) diff --git a/test/test-class_builder-const.js b/test/test-class_builder-const.js index c95d2c6..306ca41 100644 --- a/test/test-class_builder-const.js +++ b/test/test-class_builder-const.js @@ -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 * is that, if a value is constant, then instances do not make sense.