1
0
Fork 0

[#29] Re-added interface name to interface errors since abstract requirement change

closure/master
Mike Gerwitz 2011-11-19 22:17:59 -05:00
parent a33df4dcbe
commit 87dd1b8961
1 changed files with 40 additions and 27 deletions

View File

@ -209,36 +209,49 @@ var extend = ( function( extending )
var new_interface = createInterface( iname ); var new_interface = createInterface( iname );
util.propParse( props, { try
assumeAbstract: true, {
util.propParse( props, {
assumeAbstract: true,
property: function() property: function()
{
// should never get to this point because of assumeAbstract
throw TypeError( 'Unexpected internal error' );
},
getset: function()
{
// should never get to this point because of assumeAbstract
throw TypeError( 'Unexpected internal error' );
},
method: function( name, value, is_abstract, keywords )
{
// all members must be public
if ( keywords[ 'protected' ] || keywords[ 'private' ] )
{ {
throw TypeError( // should never get to this point because of assumeAbstract
iname + " member " + name + " must be public" throw TypeError( 'Unexpected internal error' );
); },
}
member_builder.buildMethod( getset: function()
members, null, name, value, keywords {
); // should never get to this point because of assumeAbstract
}, throw TypeError( 'Unexpected internal error' );
} ); },
method: function( name, value, is_abstract, keywords )
{
// all members must be public
if ( keywords[ 'protected' ] || keywords[ 'private' ] )
{
throw TypeError(
iname + " member " + name + " must be public"
);
}
member_builder.buildMethod(
members, null, name, value, keywords
);
},
} );
}
catch ( e )
{
// alter the message to include our name
e.message = "Failed to define interface " +
( ( iname ) ? iname : '(anonymous)' ) + ": " + e.message
;
// re-throw
throw e;
}
attachExtend( new_interface ); attachExtend( new_interface );
attachStringMethod( new_interface, iname ); attachStringMethod( new_interface, iname );