couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Shorin (JIRA)" <>
Subject [jira] [Commented] (COUCHDB-1075) Circular require's in CommonJS modules
Date Thu, 05 May 2011 16:33:03 GMT


Alexander Shorin commented on COUCHDB-1075:

1. The question is actual because design doc function are cached in same way, so I just couldn't
see any differences for modules. In fact of caching and dynamic language nature you could
easily modify module nor any other function in same way and original code would be never executed
once again to clean up this modifications. But this is on developers own conscience to use
this feature or not(:

2. Actually for Python, circular imports at top module would failed because requested objects
wouldn't be defined yet. Placing imports down below of module could solves this, but discouraged
by PEP-8. However, you are right, because there is specification of this function:
and p.3 is the answer(: But I suppose that current realization of require function doesn't
accords to this specs in questions of top level modules and relative one, because currently
all imports are relative no matter how their have defined. 

> Circular require's in CommonJS modules
> --------------------------------------
>                 Key: COUCHDB-1075
>                 URL:
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>            Reporter: Caolan McMahon
>              Labels: javascript
>         Attachments: module_cache.diff
> Having a CommonJS module A which requires B, when B also requires A causes the stack
to fill up with require calls. A prerequisite for this fix is the caching of modules, even
if it is only on a per-request basis.
> Patch incoming.

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message