couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Joseph Davis (JIRA)" <>
Subject [jira] Updated: (COUCHDB-925) altering 'doc' variable in map function affects other map functions
Date Tue, 26 Oct 2010 14:08:22 GMT


Paul Joseph Davis updated COUCHDB-925:

    Skill Level: Regular Contributors Level (Easy to Medium)

This is because the object sealing was broken in Spidermonkey 1.7 for Array objects. To fix
this we need to do the research on whether that bug has been fixed in newer versions and if
so add it back to couchjs.

Also, JS tests should be added to test for this behaviour so that when people run the Futon
tests they know whether their JS engine is properly sealing objects.

> altering 'doc' variable in map function affects other map functions
> -------------------------------------------------------------------
>                 Key: COUCHDB-925
>                 URL:
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>         Environment: Erlang R13B03, Spidermonkey 1.7, Ubuntu 10.04
>            Reporter: afters
> I have the following two map functions (v1.0.1):
> function (doc) {
>   emit(doc.path[0], null);
> }
> function (doc) {
>  doc.path = [ 'an intruder from another view' ];
> }
> When the views are built, the first map function sees a 'doc' variable that
> was changed by the second map function, and thus emits the key 'an intruder
> from another view'.
> The real documents remain untouched.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message