Author: ygrego Date: 2015-04-09 15:31:26 +0000 (Thu, 09 Apr 2015) New Revision: 1132 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1132 Log: Verification on parameters is necessary for method "createQuery". Modified: oipf/js/impl/model/MetadataSearch.js Modified: oipf/js/impl/model/MetadataSearch.js =================================================================== --- oipf/js/impl/model/MetadataSearch.js 2015-04-09 15:28:25 UTC (rev 1131) +++ oipf/js/impl/model/MetadataSearch.js 2015-04-09 15:31:26 UTC (rev 1132) @@ -271,6 +271,15 @@ * into their string representation, if necessary. */ createQuery: function(field, comparison, value) { + + if (!(typeof field === "string") || + !Number.isInteger(comparison) || + (!Number.isInteger(value) && !(typeof value === "string"))) { + + throw new TypeError + ("This function cannot be called with these arguments."); + + } return new Query(field, comparison, value); }
participants (1)
-
ygregoï¼ users.nuiton.org