Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 052BE36C3 for ; Fri, 6 May 2011 17:06:44 +0000 (UTC) Received: (qmail 81383 invoked by uid 500); 6 May 2011 17:06:43 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 81346 invoked by uid 500); 6 May 2011 17:06:43 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 81338 invoked by uid 99); 6 May 2011 17:06:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 May 2011 17:06:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 May 2011 17:06:42 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 8A2FFC4F99 for ; Fri, 6 May 2011 17:06:03 +0000 (UTC) Date: Fri, 6 May 2011 17:06:03 +0000 (UTC) From: "Caolan McMahon (JIRA)" To: dev@couchdb.apache.org Message-ID: <136507909.28553.1304701563562.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <375643094.27951.1304682485036.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (COUCHDB-1151) Require function doesnt fullfil specification MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-1151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030025#comment-13030025 ] Caolan McMahon commented on COUCHDB-1151: ----------------------------------------- When I apply your patches to trunk (the tests and changes to resolveModule) I get failures when running the design_doc test suite... am I missing something? > Require function doesnt fullfil specification > --------------------------------------------- > > Key: COUCHDB-1151 > URL: https://issues.apache.org/jira/browse/COUCHDB-1151 > Project: CouchDB > Issue Type: Bug > Components: JavaScript View Server > Affects Versions: 0.11.2, 1.0.2, 1.1 > Reporter: Alexander Shorin > Priority: Critical > Labels: commonjs, javascript, require > Attachments: design.require.txt, design_docs.js.patch, utils.js.patch > > Original Estimate: 1h > Remaining Estimate: 1h > > 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(mod.id) 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` function. > 3. Multiple relative imports from same level(as via '.') breaks require function. See `_show/maze` function. > 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?(: > [1] http://wiki.commonjs.org/wiki/Modules/1.1.1 > [2] https://issues.apache.org/jira/browse/COUCHDB-1075 -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira