Resolved failing test (methods may only be overridden with methods) with propParse() 'each'
parent
994b8e16fa
commit
52b1ef657f
17
lib/util.js
17
lib/util.js
|
@ -206,6 +206,17 @@ exports.propCopy = function( props, dest, result_data )
|
||||||
|
|
||||||
// default functionality
|
// default functionality
|
||||||
var actions = {
|
var actions = {
|
||||||
|
each: function( name, value )
|
||||||
|
{
|
||||||
|
// methods can only be overridden with methods
|
||||||
|
if ( ( dest[ name ] instanceof Function )
|
||||||
|
&& ( !( value instanceof Function ) )
|
||||||
|
)
|
||||||
|
{
|
||||||
|
throw new TypeError( "Cannot override method with non-method" );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
property: function( name, value )
|
property: function( name, value )
|
||||||
{
|
{
|
||||||
dest[ name ] = value;
|
dest[ name ] = value;
|
||||||
|
@ -338,12 +349,6 @@ function method_override(
|
||||||
super_method, new_method, name, abstract_map, abstract_methods, data
|
super_method, new_method, name, abstract_map, abstract_methods, data
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// ensure we're overriding the method with another method
|
|
||||||
if ( !( new_method instanceof Function ) )
|
|
||||||
{
|
|
||||||
throw new TypeError( "Cannot override method with non-method" );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( abstract_map[ name ] !== undefined )
|
if ( abstract_map[ name ] !== undefined )
|
||||||
{
|
{
|
||||||
var is_abstract = exports.isAbstractMethod( new_method );
|
var is_abstract = exports.isAbstractMethod( new_method );
|
||||||
|
|
Loading…
Reference in New Issue