All interface members must now be public
parent
5af833ab05
commit
4d2852627e
|
@ -236,6 +236,14 @@ var extend = ( function( extending )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// all members must be public
|
||||||
|
if ( keywords[ 'protected' ] || keywords[ 'private' ] )
|
||||||
|
{
|
||||||
|
throw TypeError(
|
||||||
|
iname + " member " + name + " must be public"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
member_builder.buildMethod(
|
member_builder.buildMethod(
|
||||||
members, null, name, value, keywords
|
members, null, name, value, keywords
|
||||||
);
|
);
|
||||||
|
|
|
@ -205,3 +205,29 @@ for ( var i = 0; i < base_types.length; i++ )
|
||||||
}
|
}
|
||||||
} )();
|
} )();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interfaces represent a public API that must be implemented. It does not make
|
||||||
|
* sense to have members be anything but public.
|
||||||
|
*/
|
||||||
|
( function testInterfaceMembersMustBePublic()
|
||||||
|
{
|
||||||
|
// protected
|
||||||
|
assert.throws( function()
|
||||||
|
{
|
||||||
|
Interface(
|
||||||
|
{
|
||||||
|
'abstract protected foo': [],
|
||||||
|
} );
|
||||||
|
}, Error, "Interface members must be public (1)" );
|
||||||
|
|
||||||
|
// private
|
||||||
|
assert.throws( function()
|
||||||
|
{
|
||||||
|
Interface(
|
||||||
|
{
|
||||||
|
'abstract private foo': [],
|
||||||
|
} );
|
||||||
|
}, Error, "Interface members must be public (2)" );
|
||||||
|
} )();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue