couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Shorin (JIRA)" <>
Subject [jira] [Created] (COUCHDB-1151) Require function doesnt fullfil specification
Date Fri, 06 May 2011 11:48:05 GMT
Require function doesnt fullfil specification

                 Key: COUCHDB-1151
             Project: CouchDB
          Issue Type: Bug
          Components: JavaScript View Server
    Affects Versions: 1.0.2, 0.11.2, 1.1
            Reporter: Alexander Shorin
            Priority: Critical

According CommonJS Modules specification [1]:

> 4.  Module identifiers may be "relative" or "top-level". A module identifier is "relative"
if the first term is "." or "..".
> 5.  Top-level identifiers are resolved off the conceptual module name space root.

This specification is broken in current realization at those terms. See design test case.

Actually problems:
1. Module id is broken if module imports from same level (as via '.') or from parent level
(as via '..'). AFAIK, module id should be valid to make require( call successful. See`_show/relative-id`,
`_show/require-relative-id` and `_show/relative-parent-id` function.
2. Absolute module import is broken from relative imported module. See`_show/absolute-require`
3. Multiple relative imports from same level(as via '.') breaks require function. See `_show/maze`

Those problems makes require function works unexpectedly and obstructs solving at least one
more issue #1075 [2]

I know that all relative imports are discouraged, but if they are supported, why they shouldn't
work properly?(:


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

View raw message