Abstract map no longer passed to method_override() - it's only used in that method
parent
e39cfea741
commit
2789e5fcf9
23
lib/util.js
23
lib/util.js
|
@ -212,15 +212,7 @@ exports.propCopy = function( props, dest, result_data, actions )
|
|||
var abstract_methods =
|
||||
result_data.abstractMethods = result_data.abstractMethods || [];
|
||||
|
||||
// it's much faster to lookup a hash than it is to iterate through an entire
|
||||
// array each time we need to find an existing abstract method
|
||||
var abstract_map = {},
|
||||
abstract_regen = false;
|
||||
for ( var i = 0, len = abstract_methods.length; i < len; i++ )
|
||||
{
|
||||
var method = abstract_methods[ i ];
|
||||
abstract_map[ method ] = i;
|
||||
}
|
||||
var abstract_regen = false;
|
||||
|
||||
var use_or = function( use, or )
|
||||
{
|
||||
|
@ -277,7 +269,6 @@ exports.propCopy = function( props, dest, result_data, actions )
|
|||
pre,
|
||||
func,
|
||||
name,
|
||||
abstract_map,
|
||||
abstract_methods,
|
||||
data
|
||||
);
|
||||
|
@ -371,16 +362,24 @@ exports.isAbstractMethod = function( func )
|
|||
* @param {Function} super_method method to override
|
||||
* @param {Function} new_method method to override with
|
||||
* @param {string} name method name
|
||||
* @param {Object} abstract_map lookup table for abstract methods
|
||||
* @param {Array} abstract_methods list of abstract methods
|
||||
* @param {Object} data object in which to store result data
|
||||
*
|
||||
* @return {Function} overridden method
|
||||
*/
|
||||
function method_override(
|
||||
super_method, new_method, name, abstract_map, abstract_methods, data
|
||||
super_method, new_method, name, abstract_methods, data
|
||||
)
|
||||
{
|
||||
// it's much faster to lookup a hash than it is to iterate through an entire
|
||||
// array each time we need to find an existing abstract method
|
||||
var abstract_map = {};
|
||||
for ( var i = 0, len = abstract_methods.length; i < len; i++ )
|
||||
{
|
||||
var method = abstract_methods[ i ];
|
||||
abstract_map[ method ] = i;
|
||||
}
|
||||
|
||||
if ( abstract_map[ name ] !== undefined )
|
||||
{
|
||||
var is_abstract = exports.isAbstractMethod( new_method );
|
||||
|
|
Loading…
Reference in New Issue