summaryrefslogtreecommitdiff
path: root/share/server
Commit message (Collapse)AuthorAgeFilesLines
* Add Javascript to support Spidermonkey 60sm60-davispjiangph2019-12-207-6/+6795
| | | | Co-Authored-By: Paul J. Davis <paul.joseph.davis@gmail.com>
* Ensure Dreyfus JS code is included in buildAdam Kocoloski2019-05-251-0/+2
|
* Add dreyfus.js from cloudant/couchdb@c323f1943Adam Kocoloski2019-05-251-0/+62
|
* Improve reduce function overlow handlingNick Vatamaniuc2017-03-281-6/+17
| | | | | | | | | | | | | | | Add `log` as another option for `query_config.reduce_limit` instead of `true` or `false` only. This warns user without crashing the view. Account for reduce functions code size when checking for overlflow. Code size was previously implicitly included in input size, skewing the result of overflow check. Increase threshold for overflow check. Before it was only 200. This should prevent false positives in case users have a large accumulator object to collect various stats. Jira: COUCHDB-3046
* use fresh sandbox for every compileRandall Leeds2016-09-094-64/+45
|
* seal exposed globalsRandall Leeds2016-09-092-17/+36
|
* Rewrite via query serverAlexander Shorin2015-12-222-3/+26
| | | | COUCHDB-2874
* Upgrade Coffeescript to version 1.10CliffS2015-10-011-2/+6
| | | | Signed-off-by: Alexander Shorin <kxepal@apache.org>
* Merge branch '1843-feature-bigcouch'Robert Newson2014-07-103-13/+10
|\
| * Even faster looping over map functions.Stefano J. Attardi2013-03-201-2/+2
| |
| * Use native JSON everywhere. Also, no eval for parsing JSON, thanks.Stefano J. Attardi2013-03-203-8/+5
| | | | | | | | | | | | | | | | Conflicts: couchjs/js/SConscript share/server/json2.js share/server/render.js share/server/util.js
| * Faster maps by delaying JSON serialization, skipping string concatenation, ↵Stefano J. Attardi2013-03-201-4/+4
| | | | | | | | and better looping.
* | share/server: use toString instead of toSourceFedor Indutny2013-08-025-12/+24
|/ | | | | | | | Object.toSource is [non-standard][0] and missing in v8 and probably other javascript VMs. Its better to chop it off now that feel pain later if we'll decide to move to different javascript engine. [0]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toSource
* COUCHDB-430,514,764 Fix list HTTP header handling.Caleb Case2012-11-281-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Currently calls to getRow() cause the HTTP headers to be sent immediately back to the client. This happens even if an error is thrown after the getRow(), but before any send(...) or start(...). Worse, if a list throws an exception an extra, invalid header is sent to the client (resulting in various bad behavior). Erlang list handling will now wait until data has been sent BEFORE sending the HTTP headers to the client. If an error is reported it will result in an HTTP error code as expected. This does not change the behavior of errors thrown AFTER data has been sent: They will still result in an HTTP 200 even if an error is reported. The line protocol between Erlang and os processes has been extended to support an optional Header field on "chunks" and "end". The javascript list handling has been updated to use this if a new header is set via start(...). This makes it possible to begin processing with getRow(), but later reset the headers via start(...). Again, if data has been sent(...) the new headers will NOT take effect. COUCHDB-430 COUCHDB-514 COUCHDB-764
* Merged pull request #19 from @maghoff with thanksMagnus Hoff2012-04-301-1/+1
| | | | Fix failed loading of CommonJS modules that end in a line comment.
* Update CoffeeScript to 1.2.0Jan Lehnardt2012-02-161-2/+2
|
* COUCHDB-111 CommonJS module names in tracebacksRandall Leeds2012-01-262-5/+5
| | | | | | | Adds an optional third argument to the `evalcx` function in the JS view server to pass a filename for display in stacktraces for `Error` objects. Updates the CommonJS support to use this when `require`ing modules.
* COUCHDB-111 and COUCHDB-1389 JS Error TracebacksRandall Leeds2012-01-262-1/+6
| | | | | | | | | | | | | | | | | | | | | | | couchjs: - report stacktraces on exceptions using JS_ReportError - responds with a trace and message on errors when possible - propogate Error-like objects from validate_doc_update to the loop - make Error-like object play nicely with couch_os_process couch.js: - transform HTTP error response bodies into an Error instance to capture stack information cli tests: - print a stacktrace for individual test failures when running the suite Fix COUCHDB-111 Fix COUCHDB-1389
* Revert "Fix function evaluation by newer SpiderMonkey's."Robert Newson2011-10-071-5/+1
| | | | This reverts commit 293ae2236859629a6dabc3727d0ccca977b8a8f8.
* Allow CommonJS modules to be an empty string.Paul Joseph Davis2011-09-281-1/+1
| | | | | | | | | | | We were making a typical JavaScript mistake testing a module for truthiness instead of checking that it was undefined. Fixes COUCHDB-1223 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1176677 13f79535-47bb-0310-9956-ffa450edef68
* Fix function evaluation by newer SpiderMonkey's.Paul Joseph Davis2011-09-271-1/+5
| | | | | | | | | | | | | | | Found this error using the Debian package for SM 1.8.5 and have since had reports of users seeing it as well. The basic error is that some versions of SpiderMonkey appear to dislike this call to eval: eval("function(){}"); The fix is simply to wrap the function source in parenthesis so that SM is convinced that it knows how to evaluate a function. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1176666 13f79535-47bb-0310-9956-ffa450edef68
* Fix list-style send() API in show functions when using provides()Jan Lehnardt2011-09-081-3/+7
| | | | | | | | | | Also fix ignoring the return value when the send() API isnused. Patch by Alexander Shorin. Closes COUCHDB-1272 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1166623 13f79535-47bb-0310-9956-ffa450edef68
* Fix CouchJS compatibility with older Spidermonkey.Paul Joseph Davis2011-09-023-3/+3
| | | | | | | | | | | | | | | | | | | | | | The recent patch to enable support for SM 1.8.5 broke support for 1.7.0. This patch updates couchjs to work with all of the major variants of Spidermonkey. Versions tested: 1.7.0 1.8.0rc1 1.8.5 1.9.2.something (XULRunner) Various combinations have been tested on OS X, Ubuntu, FreeBSD and Windows. Fixes COUCHDB-1260 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1164346 13f79535-47bb-0310-9956-ffa450edef68
* Add CoffeeScript (http://coffeescript.org/) support to the JS view server.Jan Lehnardt2011-05-312-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | This allows you to write all query server functions in CoffeeScript. The implementation re-uses the JS query server and adds an additional, optional compilation step. To make the implementation easier for now, a new main-coffee.js file is generated that includes the CoffeeScript compiler, but I think we can do away with that in a future optimisation and just use a single main.js that can handle both. The patch includes basic tests for the JS test suite that I tested in Firefox and Chrome. I'm no expert in CoffeeScript, so I don't know if more complex script will break the implementation. `make distcheck` passes. Futon picks up the "coffeescript" design document lanugage as expected and view definition interaction works as usual. List functions don't deal well with the implicit return generated by CoffeeScript, but J Chris says, this will be easy to fix. The patch adds CoffeeScript 1.1.1 which is MIT licensed and updates the NOTICE, LICENSE, license.skip and .gitignore files as well as the build system accordingly. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1129600 13f79535-47bb-0310-9956-ffa450edef68
* Fix handling of circular imports in CommonJS modules.Paul Joseph Davis2011-05-111-14/+23
| | | | | | | | | | Thanks to Caolan McMahon for the patch. Closes COUCHDB-1075 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1102006 13f79535-47bb-0310-9956-ffa450edef68
* Make this reference ddoc in provides() functionsJan Lehnardt2011-04-171-4/+4
| | | | | | | | | | | | In show and list functions in the Javascript query server, the this member is a reference to the design doc object. The same should be true in the functions registered by Mime.provides(), for consistency. Closes COUCHDB-959 Patch by Tim Smith. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1094137 13f79535-47bb-0310-9956-ffa450edef68
* Better error messages when a function is missing in a design documentFilipe David Borba Manana2011-03-291-0/+5
| | | | | | | | | Closes COUCHDB-1109. Patch by Thomas Vander Stichele, thanks. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1086598 13f79535-47bb-0310-9956-ffa450edef68
* Add the ability to use map view function to filter changes instead ofBenoit Chesneau2010-12-272-11/+51
| | | | | | | | | | | | | | duplicating the effort in writing a filter function that does the same, which is apparently done a lot. Each time a value could be emitted, a change is returned. The url is : http://127.0.0.1:5984/testdb/_changes?filter=_view&view=dname/viewname git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1053132 13f79535-47bb-0310-9956-ffa450edef68
* Use safer JSON.parse()Filipe David Borba Manana2010-12-182-3/+2
| | | | | | | Thanks Jason Smith for bringing this into attention. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1050621 13f79535-47bb-0310-9956-ffa450edef68
* Even if sealing of an array is not allowed in the installed SpiderMonkey ↵Filipe David Borba Manana2010-11-251-1/+0
| | | | | | version, seal its members. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1039118 13f79535-47bb-0310-9956-ffa450edef68
* Seal documents before passing them to map functions (JavaScript view server ↵Filipe David Borba Manana2010-11-232-13/+8
| | | | | | | | | | | | | only). This prevents one map function from modifying a document before it's passed to another map function. Has no effect on array fields for some Spidermonkey versions (see https://bugzilla.mozilla.org/show_bug.cgi?id=449657). Closes COUCHDB-925. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1038193 13f79535-47bb-0310-9956-ffa450edef68
* Proper verification of the roles property of a user document.Filipe David Borba Manana2010-11-212-0/+5
| | | | | | | | Closes COUCHDB-790. Thanks Gabriel Farrell. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1037448 13f79535-47bb-0310-9956-ffa450edef68
* Add missing var statements and trailing semicolons.Filipe David Borba Manana2010-11-201-3/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1037266 13f79535-47bb-0310-9956-ffa450edef68
* Fix recursive call: recursivelySeal is not defined within the body of the ↵Filipe David Borba Manana2010-11-201-1/+1
| | | | | | anonymous function declaration. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1037245 13f79535-47bb-0310-9956-ffa450edef68
* Bug fix: using undeclared identifier (doc). The function argument is named ↵Filipe David Borba Manana2010-11-201-2/+2
| | | | | | obj, not doc. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1037213 13f79535-47bb-0310-9956-ffa450edef68
* Fixing some jslint warnings.Filipe David Borba Manana2010-11-206-15/+19
| | | | git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1037206 13f79535-47bb-0310-9956-ffa450edef68
* Avoid lengthy stack traces for log(undefined);Jan Lehnardt2010-11-151-2/+4
| | | | | | | | | | Improve log(<xml/>); Patch by Benjamin Young. Closes COUCHDB-895. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035104 13f79535-47bb-0310-9956-ffa450edef68
* CommonJS support in map functionsJohn Christopher Anderson2010-09-272-1/+7
| | | | git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1001895 13f79535-47bb-0310-9956-ffa450edef68
* commonjs require no longer creates circular referencesJohn Christopher Anderson2010-09-121-26/+38
| | | | git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@996266 13f79535-47bb-0310-9956-ffa450edef68
* update json2.js to latest versionJohn Christopher Anderson2010-07-231-1/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@966971 13f79535-47bb-0310-9956-ffa450edef68
* fix erlang filter funs and normalize filter fun api. thanks fdmanana. closes ↵John Christopher Anderson2010-04-221-2/+1
| | | | | | COUCHDB-740 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@936889 13f79535-47bb-0310-9956-ffa450edef68
* upgrade CommonJS modules support to 1.1.1 - thanks Mikeal. closes COUCHDB-739John Christopher Anderson2010-04-161-14/+16
| | | | git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@934652 13f79535-47bb-0310-9956-ffa450edef68
* commonjs require for show list etc via Mikeal Rogers. closes COUCHDB-658John Christopher Anderson2010-02-253-4/+60
| | | | git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@916076 13f79535-47bb-0310-9956-ffa450edef68
* add JSON to the sandbox for older spidermonkey without native JSONJohn Christopher Anderson2010-02-181-0/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@911602 13f79535-47bb-0310-9956-ffa450edef68
* add list()-API cmompatible API to _show. Symmetry FTW.Jan Lehnardt2010-02-051-1/+13
| | | | git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@906755 13f79535-47bb-0310-9956-ffa450edef68
* re-enable 404 handling in show functions while retaining user-friendly error ↵Jan Lehnardt2010-02-041-1/+5
| | | | | | behaviour git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@906721 13f79535-47bb-0310-9956-ffa450edef68
* Replace the old JavaScript query server JSON library with json2.jsJohn Christopher Anderson2010-01-262-61/+484
| | | | | | | | | | This change makes us interoperate better with other JSON implementations. It also means we can use the native JSON handlers in JavaScript runtimes that support them. Should be faster right away on new Spidermonkeys. There are some potential breaking changes for apps that depend on Couch blowing up on 'undefined'. json2.js serialized undefined as 'null' instead of crashing. This change will also affect people using E4X, as you can't just return an XML object and have it serialized to a string for you. Calling .toXMLString() on these is all you need to do. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@903023 13f79535-47bb-0310-9956-ffa450edef68
* Follow RFC 2616 closer and use "verb" instead of "method"Jan Lehnardt2009-12-231-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@893364 13f79535-47bb-0310-9956-ffa450edef68
* move query server to a design-doc based protocol, closes COUCHDB-589John Christopher Anderson2009-12-227-439/+519
| | | | git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@893249 13f79535-47bb-0310-9956-ffa450edef68
* Create a new sandbox for each reset.Paul Joseph Davis2009-12-122-13/+19
| | | | git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@890008 13f79535-47bb-0310-9956-ffa450edef68