Added filter, fix [] as type

This commit is contained in:
Anatoliy Chakkaev 2013-03-18 23:45:34 +04:00
parent 8c0df49e36
commit ccffd10a58
2 changed files with 2 additions and 2 deletions

View File

@ -115,7 +115,7 @@ if (_) {
});
}
['slice', 'forEach'].forEach(function (method) {
['slice', 'forEach', 'filter'].forEach(function (method) {
var slice = [].slice;
List.prototype[method] = function () {
return Array.prototype[method].apply(this.items, slice.call(arguments));

View File

@ -194,7 +194,7 @@ function prepareContext(models, railway, app, defSchema, done) {
*/
ctx.property = function (name, type, params) {
if (!params) params = {};
if (typeof type !== 'function' && typeof type === 'object') {
if (typeof type !== 'function' && typeof type === 'object' && !(type instanceof Array)) {
params = type;
type = String;
}