From 52b1ef657f70275454270be06ba606c6110aa967 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Tue, 7 Dec 2010 00:41:30 -0500 Subject: [PATCH] Resolved failing test (methods may only be overridden with methods) with propParse() 'each' --- lib/util.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/util.js b/lib/util.js index 6bbd593..eb6b3b2 100644 --- a/lib/util.js +++ b/lib/util.js @@ -206,6 +206,17 @@ exports.propCopy = function( props, dest, result_data ) // default functionality 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 ) { dest[ name ] = value; @@ -338,12 +349,6 @@ function method_override( 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 ) { var is_abstract = exports.isAbstractMethod( new_method );