Nils Adermann
added a comment - 04/May/10 18:35 Rather than trimming the value, this patch throws an error message explaining that the builtin function of that name does not exist. This also helps people who put other kinds of typos in there.

Nils Adermann
added a comment - 04/May/10 19:02 - edited Updated the patch to include a test. It's also in github if that is of any use: http://github.com/naderman/couchdb/commit/cb1ae200d81d5eaad301ad71fb85d50ccb072904

Adam Kocoloski
added a comment - 29/May/13 22:17 Current status is that master ignores trailing characters (whitespace or otherwise) when looking for builtins. It still doesn't do anything polite when a user sets "reduce": "_randomthing".

We reject bad JS code in design documents, but one thing we haven't done is reject design documents that specify unknown builtin reduce functions. This PR addresses that, and adds a few tests to confirm that we do throw exceptions on these conditions.

There's a separate issue – we're returning an HTTP 500 when it should be a 400 Bad Request. The error tuple is getting munged somewhere outside of couch_mrview. I think that warrants a separate ticket as it affects all design doc validation failures, not just the one described in this ticket.

Adam Kocoloski
added a comment - 01/Jul/15 02:33 - edited There's a separate issue – we're returning an HTTP 500 when it should be a 400 Bad Request. The error tuple is getting munged somewhere outside of couch_mrview. I think that warrants a separate ticket as it affects all design doc validation failures, not just the one described in this ticket.