~statik/ubuntu/karmic/couchdb/fix-bug427036

« back to all changes in this revision

Viewing changes to share/server/validate.js

  • Committer: Bazaar Package Importer
  • Author(s): Ken VanDine, Elliot Murphy
  • Date: 2009-08-24 15:44:14 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090824154414-c9fytg3azvyuc8z3
Tags: 0.10.0~svn806985-0ubuntu1
* First snapshot of couchdb 0.10pre, from
  http://build.couchdb.org/0.10.x-UNOFFICIAL (LP: #418288)
* debian/postinst
  - Make /etc/couchdb/local.ini world readable (LP: #403575)

[Elliot Murphy]
* Added debian/patches/oauth_ini_users.patch from
  http://issues.apache.org/jira/browse/COUCHDB-478

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
 
2
// use this file except in compliance with the License. You may obtain a copy of
 
3
// the License at
 
4
//
 
5
//   http://www.apache.org/licenses/LICENSE-2.0
 
6
//
 
7
// Unless required by applicable law or agreed to in writing, software
 
8
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
9
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
10
// License for the specific language governing permissions and limitations under
 
11
// the License.
 
12
 
 
13
var Validate = {
 
14
  validate : function(funSrc, newDoc, oldDoc, userCtx) {
 
15
    var validateFun = compileFunction(funSrc);
 
16
    try {
 
17
      validateFun(newDoc, oldDoc, userCtx);
 
18
      print("1");
 
19
    } catch (error) {
 
20
      respond(error);
 
21
    }
 
22
  }
 
23
};