Ensured properties cannot be overridden with methods
parent
459335cf62
commit
25dc7e031e
|
@ -228,7 +228,9 @@ exports.propCopy = function( props, dest, result_data )
|
|||
}
|
||||
else
|
||||
{
|
||||
// todo: attempted override of property with method
|
||||
throw new Error(
|
||||
"Cannot override property '" + name + "' with method"
|
||||
);
|
||||
}
|
||||
|
||||
if ( data.abstractModified )
|
||||
|
|
|
@ -126,3 +126,12 @@ assert.notEqual(
|
|||
"Subtype should contain extended members"
|
||||
);
|
||||
|
||||
|
||||
assert.throws( function()
|
||||
{
|
||||
Class.extend( OtherClass,
|
||||
{
|
||||
foo: function() {},
|
||||
});
|
||||
}, Error, "Cannot override property with a method" );
|
||||
|
||||
|
|
Loading…
Reference in New Issue