1
0
Fork 0

Began adding basic method builder (currently operates the same as property builder)

- They are essentially the same, but the method builder will have additional logic (e.g. method overriding) and support different keywords
closure/master
Mike Gerwitz 2011-01-21 20:54:55 -05:00
parent 906e468cdf
commit dea6972416
2 changed files with 54 additions and 0 deletions

View File

@ -45,6 +45,26 @@ exports.initMembers = function( mpublic, mprotected, mprivate )
}; };
/**
* Copies a method to the appropriate member prototype, depending on
* visibility, and assigns necessary metadata from keywords
*
* @param {{public: Object, protected: Object, private: Object}} members
*
* @param {Object} meta metadata container
* @param {string} name property name
* @param {*} value property value
*
* @param {Object.<string,boolean>} keywords parsed keywords
*
* @return {undefined}
*/
exports.buildMethod = function( members, meta, name, value, keywords )
{
getMemberVisibility( members, keywords )[ name ] = value;
};
/** /**
* Copies a property to the appropriate member prototype, depending on * Copies a property to the appropriate member prototype, depending on
* visibility, and assigns necessary metadata from keywords * visibility, and assigns necessary metadata from keywords

View File

@ -0,0 +1,34 @@
/**
* Tests method builder
*
* Copyright (C) 2010 Mike Gerwitz
*
* This file is part of ease.js.
*
* ease.js is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author Mike Gerwitz
* @package test
*/
var common = require( './common' ),
mb_common = require( './inc-member_builder-common' )
;
mb_common.value = function() {};
mb_common.buildMember = common.require( 'member_builder' ).buildMethod;
// do assertions common to all member builders
mb_common.assertCommon();