1
0
Fork 0

Abstract getters/setters are not yet supported

- Perhaps in future versions. The implementation details will not be ironed out before v0.1.0 and we can easily add it in the future without breaking BC. Getters/setters have not had too much attention thusfar in ease.js due to testing with systems that must work across many environments, including pre-ES5.
perfodd
Mike Gerwitz 2011-12-22 22:05:47 -05:00
parent 6295b83ec7
commit 4ada84e3b7
2 changed files with 26 additions and 0 deletions

View File

@ -283,6 +283,14 @@ exports.prototype.validateGetterSetter = function(
) )
; ;
// abstract getters/setters are not yet supported
if ( keywords[ 'abstract' ] )
{
throw TypeError(
"Cannot declare getter/setter '" + name + "' as abstract"
);
}
if ( prev || prev_gs ) if ( prev || prev_gs )
{ {
// perform this check first, as it will make more sense than those that // perform this check first, as it will make more sense than those that

View File

@ -37,6 +37,13 @@ require( 'common' ).testCase(
shared.quickFailureTest.apply( _self, arguments ); shared.quickFailureTest.apply( _self, arguments );
}; };
this.quickKeywordTest = function( keywords, identifier, prev )
{
shared.quickKeywordTest.call( this,
'validateGetterSetter', keywords, identifier, prev
);
};
this.quickVisChangeTest = function( start, override, failtest, failstr ) this.quickVisChangeTest = function( start, override, failtest, failstr )
{ {
shared.quickVisChangeTest.call( _self, start, override, failtest, shared.quickVisChangeTest.call( _self, start, override, failtest,
@ -136,4 +143,15 @@ require( 'common' ).testCase(
_self.quickVisChangeTest( cur[ 0 ], cur[ 1 ], true, 'conflict' ); _self.quickVisChangeTest( cur[ 0 ], cur[ 1 ], true, 'conflict' );
} ); } );
}, },
/**
* Abstract getter/setters are not yet supported. They may be supported in
* the future. Disallowing them now will allow us to determine an
* implementation in the future without breaking BC.
*/
'Cannot declare abstract getters/setters': function()
{
this.quickKeywordTest( [ 'abstract' ], 'abstract' );
},
} ); } );