diff --git a/lib/MemberBuilderValidator.js b/lib/MemberBuilderValidator.js index a8cc668..1932b50 100644 --- a/lib/MemberBuilderValidator.js +++ b/lib/MemberBuilderValidator.js @@ -22,9 +22,6 @@ * @package core */ -// XXX: remove dependency -var Warning = require( __dirname + '/warn' ).Warning; - module.exports = exports = function MemberBuilderValidator() { @@ -150,7 +147,7 @@ exports.prototype.validateMethod = function( // supertype, unless otherwise specified // // IMPORTANT: do this last, to ensure we throw errors before warnings - if ( !( keywords[ 'new' ] || keywords[ 'override' ] ) ) + if ( !( keywords[ 'override' ] ) { if ( !( prev_keywords[ 'abstract' ] ) ) { diff --git a/test/test-class-visibility.js b/test/test-class-visibility.js index 795cda7..e26ef5c 100644 --- a/test/test-class-visibility.js +++ b/test/test-class-visibility.js @@ -524,6 +524,8 @@ var common = require( './common' ), }, Error, "Can escalate visibility of subtype members" ); // same level of visibility + assert.doesNotThrow( function() + { Class( { 'protected foo': 'bar', @@ -532,6 +534,7 @@ var common = require( './common' ), 'protected foo': 'bar', 'override protected baz': function() {}, } ); + }, Error, "Can retain level of visibility for subtype members" ); } )();