From 940a8f32500a58a0ef4f914bf5ccfff4d35218a5 Mon Sep 17 00:00:00 2001 From: Andrew Mao Date: Tue, 30 Jul 2013 18:34:35 -0400 Subject: [PATCH] added some checks for the where argument --- tools/packages.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/packages.js b/tools/packages.js index 374841c722..381e856f9e 100644 --- a/tools/packages.js +++ b/tools/packages.js @@ -1422,10 +1422,19 @@ _.extend(Package.prototype, { return x; return x ? [x] : []; }; + + var places = ['client', 'server']; var toWhereArray = function (where) { - if (where instanceof Array) + if (where instanceof Array) { + if (_.difference(where, places).length > 0) + buildmessage.error(where + " is not a valid argument.", + { useMyCaller: true }); return where; - return where ? [where] : ['client', 'server']; + } + if (_.indexOf(places, where) === -1 ) + buildmessage.error(where + " is not a valid argument.", + { useMyCaller: true }); + return where ? [where] : places; }; var api = {