You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "afters (Commented) (JIRA)" <ji...@apache.org> on 2011/12/07 16:06:40 UTC

[jira] [Commented] (COUCHDB-1302) Fix couchjs

    [ https://issues.apache.org/jira/browse/COUCHDB-1302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13164443#comment-13164443 ] 

afters commented on COUCHDB-1302:
---------------------------------

Not sure if it's relevant, but here's how I checked if a string is indeed an anonymous function:
(https://github.com/afters/Couch-Incarnate/blob/master/lib/syncer.js#L38)

  var verifyMapStringIsFunction = function () {
    var basicFuncTemplate = new RegExp(
      '^' +
      '\\s*' +
      'function' +
      '\\s*' +
      '\\(([^\\)]*)\\)' +
      '\\s*' +
      '{([\\s\\S]*)}' +
      '\\s*' +
      '$'
    );
    var match = basicFuncTemplate.exec(map.fn);
    if (!match) throw new Error();
    try {
      var argsStr = match[1];
      var bodyStr = match[2];
      new Function(argsStr, bodyStr);
    }
    catch (e) {
      throw new Error();
    }
  }
                
> Fix couchjs
> -----------
>
>                 Key: COUCHDB-1302
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1302
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>    Affects Versions: 1.1.1, 1.2, 1.3
>            Reporter: Paul Joseph Davis
>            Priority: Blocker
>         Attachments: 0001-Prevent-linking-against-too-new-of-a-SpiderMonkey.patch, 0002-Minor-fixes-to-link-agianst-SpiderMonkey-trunk.patch
>
>
> Figure out why some spidermonkeys have an error when doing: eval("function(){}")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira