couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Shorin (Commented) (JIRA)" <>
Subject [jira] [Commented] (COUCHDB-1397) Function expressions, evals in SpiderMonkey
Date Sat, 04 Feb 2012 19:57:53 GMT


Alexander Shorin commented on COUCHDB-1397:

Sorry for offtopic, but


Why not to use black box testing instead of trying to mock every internal query server global
function? Using QS directly as black box you will have warranty that your functions are tested
well, because box is real, but you don't have to know how it works. In your way you testing
for your own, may miss some details and output result could be different. This is not only
about views that are not so complex as show or list functions. By the way, applying your idea
to other functions I'll something weird for list function:

function(head, req, provides, registerType, getRow, send, start, whatEverWillBeAddedInFuture){

Looks not much relaxing(: Certainly, Javascript allows to skip some function arguments definition,
but it still requires(?) them in right order. 

And what about other query servers in this case? Currently, they are doing same work as Javascript
one or just trying to do, but not all of them could skip arguments definition, has arguments
vectors etc. This could create additional problems with migration from one QS to another.

About subject, I couldn't say anything important about function(...){} vs function name(...){}
vs ... because I don't use Javascript query server, but in Python I have to write real functions
with their names - it works as nice marker to find their crush in debug logs if it happens,
so for me this is just nice feature(:

P.S. Just a moment, what will happens with CoffeeScript in case of proposed changes?
> Function expressions, evals in SpiderMonkey
> -------------------------------------------
>                 Key: COUCHDB-1397
>                 URL:
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 1.2.1
>         Environment: All
>            Reporter: Jason Smith
> New SpiderMonkey releases do not eval() a sole anonymous function expression. That is
not a valid JavaScript statement, and so it is not a valid JavaScript script.
> COUCHDB-1302 addressed this for 1.1 and the 1.1.x branch. This ticket is for 1.2. (Sorry
to spam COUCHDB-1302. I saw "Unassigned" and read "Unresolved.")

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message