incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmue...@apache.org
Subject git commit: added test cases for require() and friends
Date Tue, 21 Feb 2012 00:01:27 GMT
Updated Branches:
  refs/heads/master 8513d59c1 -> d7341998e


added test cases for require() and friends

   https://issues.apache.org/jira/browse/CB-267

Added the commonjs test suite from:

   https://github.com/commonjs/commonjs

Those tests are now in

   thirdparty/commonjs-tests

Test scaffolding has been added to

   test/commonjs

See the README.txt file in that directory for
instructions on running the tests.

In addition, the LICENSE was modified to include
information on the commonjs tests and existing
jasmine usage.  A NOTICE file was also added,
since it was not available before.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/d7341998
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/d7341998
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/d7341998

Branch: refs/heads/master
Commit: d7341998e657598a8419aa421d84e5bebbb26494
Parents: 8513d59
Author: Patrick Mueller <pmuellr@apache.org>
Authored: Mon Feb 20 18:00:46 2012 -0500
Committer: Patrick Mueller <pmuellr@apache.org>
Committed: Mon Feb 20 18:00:46 2012 -0500

----------------------------------------------------------------------
 LICENSE                                            |   96 +++++++-
 NOTICE                                             |    5 +
 test/commonjs/.gitignore                           |    1 +
 test/commonjs/README.txt                           |   11 +
 test/commonjs/build-tests.py                       |  196 +++++++++++++++
 test/commonjs/launcher-in-iframe.template.html     |   73 ++++++
 test/commonjs/launcher-main.template.html          |   74 ++++++
 test/commonjs/test.css                             |   43 ++++
 thirdparty/commonjs-tests/README.txt               |    9 +
 .../commonjs-tests/modules/1.0/absolute/b.js       |    1 +
 .../commonjs-tests/modules/1.0/absolute/program.js |    5 +
 .../modules/1.0/absolute/submodule/a.js            |    3 +
 .../commonjs-tests/modules/1.0/absolute/test.js    |   15 ++
 thirdparty/commonjs-tests/modules/1.0/cyclic/a.js  |    4 +
 thirdparty/commonjs-tests/modules/1.0/cyclic/b.js  |    4 +
 .../commonjs-tests/modules/1.0/cyclic/program.js   |   10 +
 .../commonjs-tests/modules/1.0/cyclic/test.js      |   15 ++
 .../modules/1.0/determinism/program.js             |    3 +
 .../modules/1.0/determinism/submodule/a.js         |    9 +
 .../modules/1.0/determinism/submodule/b.js         |    2 +
 .../commonjs-tests/modules/1.0/determinism/test.js |   15 ++
 .../commonjs-tests/modules/1.0/exactExports/a.js   |    3 +
 .../modules/1.0/exactExports/program.js            |    4 +
 .../modules/1.0/exactExports/test.js               |   15 ++
 .../modules/1.0/hasOwnProperty/program.js          |    4 +
 .../modules/1.0/hasOwnProperty/test.js             |   15 ++
 thirdparty/commonjs-tests/modules/1.0/method/a.js  |   12 +
 .../commonjs-tests/modules/1.0/method/program.js   |    8 +
 .../commonjs-tests/modules/1.0/method/test.js      |   15 ++
 .../commonjs-tests/modules/1.0/missing/program.js  |    8 +
 .../commonjs-tests/modules/1.0/missing/test.js     |   15 ++
 thirdparty/commonjs-tests/modules/1.0/monkeys/a.js |    1 +
 .../commonjs-tests/modules/1.0/monkeys/program.js  |    4 +
 .../commonjs-tests/modules/1.0/monkeys/test.js     |   15 ++
 .../commonjs-tests/modules/1.0/nested/a/b/c/d.js   |    3 +
 .../commonjs-tests/modules/1.0/nested/program.js   |    3 +
 .../commonjs-tests/modules/1.0/nested/test.js      |   15 ++
 .../commonjs-tests/modules/1.0/relative/program.js |    5 +
 .../modules/1.0/relative/submodule/a.js            |    1 +
 .../modules/1.0/relative/submodule/b.js            |    2 +
 .../commonjs-tests/modules/1.0/relative/test.js    |   15 ++
 .../commonjs-tests/modules/1.0/transitive/a.js     |    1 +
 .../commonjs-tests/modules/1.0/transitive/b.js     |    1 +
 .../commonjs-tests/modules/1.0/transitive/c.js     |    3 +
 .../modules/1.0/transitive/program.js              |    3 +
 .../commonjs-tests/modules/1.0/transitive/test.js  |   15 ++
 46 files changed, 777 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 2607a5b..9c285cb 100644
--- a/LICENSE
+++ b/LICENSE
@@ -187,9 +187,7 @@
       same "printed page" as the copyright notice for easier
       identification within third-party archives.
 
-   Copyright 2011 Adobe
-   Copyright 2011 IBM Corporation
-   Copyright 2011 RIM
+   Copyright [yyyy] [name of copyright owner]
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
@@ -203,3 +201,95 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 
+==============================================================
+This product also include the following software:
+==============================================================
+
+--------------------------------------------------------------
+jasmine from GitHub
+
+   https://github.com/pivotal/jasmine
+
+MIT-style license
+
+license available from:
+
+   https://github.com/pivotal/jasmine/blob/master/MIT.LICENSE
+   
+-----------------------------
+
+Copyright (c) 2008-2011 Pivotal Labs
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+--------------------------------------------------------------
+commonjs tests from the commonjs organization at GitHub
+
+   https://github.com/commonjs/commonjs
+
+MIT-style license
+
+license available from:
+
+   https://github.com/commonjs/commonjs/blob/master/docs/license.html.markdown
+
+contributor list available from:
+
+   https://github.com/commonjs/commonjs/blob/master/docs/contributors.html.markdown
+
+-----------------------------
+
+Copyright 2009 Kevin Dangoor
+Copyright 2009 Ihab Awad
+Copyright 2009 Ash Berlin
+Copyright 2009 Aristid Breitkreuz
+Copyright 2009 Kevin Dangoor
+Copyright 2009 Daniel Friesen
+Copyright 2009 Wes Garland
+Copyright 2009 Kris Kowal
+Copyright 2009 Dean Landolt
+Copyright 2009 Peter Michaux
+Copyright 2009 George Moschovitis
+Copyright 2009 Michael O'Brien
+Copyright 2009 Tom Robinson
+Copyright 2009 Hannes Wallnoefer
+Copyright 2009 Mike Wilson
+Copyright 2009 Ondrej Zara
+Copyright 2009 Chris Zumbrunn
+Copyright 2009 Kris Zyp
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..b01a7cf
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,5 @@
+Apache Cordova weinre
+Copyright 2012 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/test/commonjs/.gitignore
----------------------------------------------------------------------
diff --git a/test/commonjs/.gitignore b/test/commonjs/.gitignore
new file mode 100644
index 0000000..c585e19
--- /dev/null
+++ b/test/commonjs/.gitignore
@@ -0,0 +1 @@
+out
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/test/commonjs/README.txt
----------------------------------------------------------------------
diff --git a/test/commonjs/README.txt b/test/commonjs/README.txt
new file mode 100644
index 0000000..16cb81f
--- /dev/null
+++ b/test/commonjs/README.txt
@@ -0,0 +1,11 @@
+This directory contains tests for the CommonJS functionality in Cordova.
+
+The tests come from the GitHub project https://github.com/commonjs/commonjs
+
+To run the tests, first you need to build them.
+
+Open a shell, cd into this directory, and run `python build-tests.py`.
+
+This will generate a set of HTML files which will run the tests within
+a browser.  More instructions on how to run the tests are printed
+after the tests are built.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/test/commonjs/build-tests.py
----------------------------------------------------------------------
diff --git a/test/commonjs/build-tests.py b/test/commonjs/build-tests.py
new file mode 100755
index 0000000..e94744e
--- /dev/null
+++ b/test/commonjs/build-tests.py
@@ -0,0 +1,196 @@
+#!/usr/bin/env python
+
+# ---
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ---
+
+import os
+import re
+import sys
+import shutil
+import datetime
+import subprocess
+
+PROGRAM = sys.argv[0]
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+def main():
+
+    # all work done in directory of this program
+    baseDir  = os.path.dirname(PROGRAM)
+    os.chdir(baseDir)
+
+    testsDir = os.path.abspath("../../thirdparty/commonjs-tests")
+    outDir   = os.path.abspath("out")
+
+    # validate testsDir
+    if not os.path.exists(testsDir):
+        error("tests dir does not exist: %s" % testsDir)
+    
+    if not os.path.isdir(testsDir):
+        error("tests dir is not a directory: %s" % testsDir)
+
+    # validate and reset outDir
+    if os.path.exists(outDir):
+        if not os.path.isdir(outDir):
+            error("out dir is not a directory: %s" % outDir)
+
+        shutil.rmtree(outDir)
+        
+    os.makedirs(outDir)
+
+    tests = getTests(testsDir)
+    
+    # now all work done in outDir
+    os.chdir("out")
+
+    # build the individual tests
+    iframes = []
+    for test in tests:
+        testName = test.replace('/', '-')
+        htmlFile = buildTest(os.path.join(testsDir, test), testName)
+        iframes.append("<iframe width='100%%' height='30' src='%s'></iframe>"
% htmlFile)
+
+    iframesLines = "\n".join(iframes)
+    
+    # build the browser launcher
+    html = fileContents("../launcher-main.template.html")
+
+    html = html.replace("@iframes@", iframesLines)
+    html = html.replace("@date@", getDate())
+    
+    oFileName = "launcher-all.html"
+    oFile = file(oFileName, "w")
+    oFile.write(html)
+    oFile.close()
+    
+    print
+    print "Generated browser test: %s" % os.path.abspath(oFileName)
+    print 
+    print "You can run the test as a local file under Safari but not Chrome."
+    print "To test under Chrome, access the files via http://"
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+def buildTest(testDir, testName):
+
+    log("generating tests for %s" % (testName))
+
+    html = fileContents("../launcher-in-iframe.template.html")
+    
+    # get the list of modules
+    modules = getModules(testDir)
+    
+    modulesSource = []
+    
+    modulesSource.append("try {")
+    
+    for module in modules:
+        source = fileContents("%s.js" % os.path.join(testDir, module))
+        
+        modulesSource.append("//----------------------------------------------")
+        modulesSource.append("define('%s', function(require,exports,module) {" % module)
+        modulesSource.append(source.strip())
+        modulesSource.append("});")
+        modulesSource.append("")
+
+    modulesSource.append("}")
+    modulesSource.append("catch(e) {")
+    modulesSource.append("   console.log('exception thrown loading modules: ' + e)")
+    modulesSource.append("}")
+        
+    modulesLines = "\n".join(modulesSource)
+    
+    html = html.replace("@modules@", modulesLines)
+    html = html.replace("@title@", testName)
+    html = html.replace("@date@", getDate())
+
+    # build HTML launcher for iframe
+    oFileName = "%s.html" % testName
+    oFile = file(oFileName, "w")
+    oFile.write(html)
+    oFile.close()
+    
+    return oFileName
+    
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+def getModules(testDir):
+    modules = []
+    for root, dirs, files in os.walk(testDir):
+        for file in files:
+            if not file.endswith(".js"): continue
+            
+            moduleSource = os.path.relpath(os.path.join(root, file), testDir)
+            moduleName   = os.path.splitext(moduleSource)[0]
+            modules.append(moduleName)
+
+    return modules
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+def getTests(testDir):
+    tests = []
+    for root, dirs, files in os.walk(testDir):
+        if "program.js" in files:
+            tests.append(os.path.relpath(root, testDir))
+            
+    return tests
+    
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+def run(cmdArgs):
+    result = subprocess.Popen(cmdArgs, stdout=subprocess.PIPE).communicate()[0]
+    if not re.match(r"\s*", result):
+        print result
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+def fileContents(iFileName):
+    iFile = file(iFileName)
+    contents = iFile.read()
+    iFile.close()
+    
+    return contents
+
+def getDate():
+     return datetime.datetime.today().isoformat(" ")
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+def log(message):
+    print "%s: %s" % (PROGRAM, message)
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+def error(message):
+    log(message)
+    exit(1)
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+main()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/test/commonjs/launcher-in-iframe.template.html
----------------------------------------------------------------------
diff --git a/test/commonjs/launcher-in-iframe.template.html b/test/commonjs/launcher-in-iframe.template.html
new file mode 100644
index 0000000..62d5ea8
--- /dev/null
+++ b/test/commonjs/launcher-in-iframe.template.html
@@ -0,0 +1,73 @@
+<!doctype html>
+
+<!--
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+-->
+
+<html>
+<head>
+<title>@title@</title>
+<script src='../../../lib/require.js'></script>
+<script>
+@modules@
+
+//----------------------------------------------------------------------------
+var outputPre
+
+window.addEventListener("load", onLoad, false)
+
+//----------------------------------------------------------------------------
+function onLoad() {
+    outputPre = document.getElementById("output")
+
+    if (window.parent !== window) {
+        window.parent.testsStarting("@title@")
+    }
+    
+    try {
+        require("program")
+    }
+    catch (e) {
+        print ("FAIL exception thrown: " + e)
+    }
+}
+
+//----------------------------------------------------------------------------
+function print(message, status) {
+
+    var className
+    
+    if      (/^PASS/.exec(message)) className = "pass"
+    else if (/^FAIL/.exec(message)) className = "fail"
+    else                            className = "info"
+    
+    var line = "<div class='" + className + "'>" + message + "</div>"
+    outputPre.innerHTML += line
+    
+    if (window.parent !== window) {
+        window.parent.oneTestComplete(className, message)
+    }
+    
+}
+</script>
+</head>
+<body>
+<p>Tests generated on @date@
+<pre id="output"></pre>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/test/commonjs/launcher-main.template.html
----------------------------------------------------------------------
diff --git a/test/commonjs/launcher-main.template.html b/test/commonjs/launcher-main.template.html
new file mode 100644
index 0000000..56014c7
--- /dev/null
+++ b/test/commonjs/launcher-main.template.html
@@ -0,0 +1,74 @@
+<!doctype html>
+
+<!--
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+-->
+
+<html>
+<head>
+<link href="../test.css" rel="stylesheet" type="text/css">
+<script>
+var outputDiv
+var queue = []
+
+window.addEventListener("load", onLoad, false)
+
+//----------------------------------------------------------------------------
+function onLoad() {
+    outputDiv = document.getElementById("output")
+
+    if (queue.length > 0) {
+        outputDiv.innerHTML += queue.join("\n")
+        queue = []
+    }
+    
+}
+
+//----------------------------------------------------------------------------
+function testsStarting(url) {
+    output = "<div class='test'>" + url + "</div>"
+    
+    if (!outputDiv) {
+        queue.push(output)
+    }
+    else {
+        outputDiv.innerHTML += output
+    }
+}
+
+//----------------------------------------------------------------------------
+function oneTestComplete(status, message) {
+    output = "<div class='" + status + "'>" + message + "</div>"
+
+    if (!outputDiv) {
+        queue.push(output)
+    }
+    else {
+        outputDiv.innerHTML += output
+    }
+}
+</script>
+</head>
+<body>
+<p>Tests generated on @date@
+<div id="output"></div>
+<div style="display:none" id="iframes">
+@iframes@
+</div>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/test/commonjs/test.css
----------------------------------------------------------------------
diff --git a/test/commonjs/test.css b/test/commonjs/test.css
new file mode 100644
index 0000000..4b118a1
--- /dev/null
+++ b/test/commonjs/test.css
@@ -0,0 +1,43 @@
+/*
+# ---
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ---
+*/
+
+.pass, .fail, .info {
+    font-family:      monospace;
+    margin-left:      1em;
+}
+
+.pass {
+    background-color: #DFD;
+}
+
+.fail {
+    background-color: #F88;
+}
+
+.info {
+    background-color: #DDF;
+}
+
+.test {
+    margin-top:  1em;
+    font-weight: bold;
+    font-size:   120%;
+}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/README.txt
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/README.txt b/thirdparty/commonjs-tests/README.txt
new file mode 100644
index 0000000..21ce798
--- /dev/null
+++ b/thirdparty/commonjs-tests/README.txt
@@ -0,0 +1,9 @@
+The test cases contained in this directory were obtained from the
+commonjs project at GitHub:
+
+   https://github.com/commonjs/commonjs
+
+Specifically, the directories in the 'tests' subdirectory.
+
+See the file test/commonjs/README.txt off the root directory of this
+project for more information.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/absolute/b.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/absolute/b.js b/thirdparty/commonjs-tests/modules/1.0/absolute/b.js
new file mode 100644
index 0000000..da5bf4f
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/absolute/b.js
@@ -0,0 +1 @@
+exports.foo = function() {};

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/absolute/program.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/absolute/program.js b/thirdparty/commonjs-tests/modules/1.0/absolute/program.js
new file mode 100644
index 0000000..7980ecf
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/absolute/program.js
@@ -0,0 +1,5 @@
+var test = require('test');
+var a = require('submodule/a');
+var b = require('b');
+test.assert(a.foo().foo === b.foo, 'require works with absolute identifiers');
+test.print('DONE', 'info');

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/absolute/submodule/a.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/absolute/submodule/a.js b/thirdparty/commonjs-tests/modules/1.0/absolute/submodule/a.js
new file mode 100644
index 0000000..bc138b8
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/absolute/submodule/a.js
@@ -0,0 +1,3 @@
+exports.foo = function () {
+    return require('b');
+};

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/absolute/test.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/absolute/test.js b/thirdparty/commonjs-tests/modules/1.0/absolute/test.js
new file mode 100644
index 0000000..5d0984e
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/absolute/test.js
@@ -0,0 +1,15 @@
+
+exports.print = typeof print !== "undefined" ? print : function () {
+    var system = require("system");
+    var stdio = system.stdio;
+    stdio.print.apply(stdio, arguments);
+};
+
+exports.assert = function (guard, message) {
+    if (guard) {
+        exports.print('PASS ' + message, 'pass');
+    } else {
+        exports.print('FAIL ' + message, 'fail');
+    }
+};
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/cyclic/a.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/cyclic/a.js b/thirdparty/commonjs-tests/modules/1.0/cyclic/a.js
new file mode 100644
index 0000000..e0188fa
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/cyclic/a.js
@@ -0,0 +1,4 @@
+exports.a = function () {
+    return b;
+};
+var b = require('b');

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/cyclic/b.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/cyclic/b.js b/thirdparty/commonjs-tests/modules/1.0/cyclic/b.js
new file mode 100644
index 0000000..873a305
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/cyclic/b.js
@@ -0,0 +1,4 @@
+var a = require('a');
+exports.b = function () {
+    return a;
+};

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/cyclic/program.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/cyclic/program.js b/thirdparty/commonjs-tests/modules/1.0/cyclic/program.js
new file mode 100644
index 0000000..2ee4758
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/cyclic/program.js
@@ -0,0 +1,10 @@
+var test = require('test');
+var a = require('a');
+var b = require('b');
+
+test.assert(a.a, 'a exists');
+test.assert(b.b, 'b exists')
+test.assert(a.a().b === b.b, 'a gets b');
+test.assert(b.b().a === a.a, 'b gets a');
+
+test.print('DONE', 'info');

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/cyclic/test.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/cyclic/test.js b/thirdparty/commonjs-tests/modules/1.0/cyclic/test.js
new file mode 100644
index 0000000..5d0984e
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/cyclic/test.js
@@ -0,0 +1,15 @@
+
+exports.print = typeof print !== "undefined" ? print : function () {
+    var system = require("system");
+    var stdio = system.stdio;
+    stdio.print.apply(stdio, arguments);
+};
+
+exports.assert = function (guard, message) {
+    if (guard) {
+        exports.print('PASS ' + message, 'pass');
+    } else {
+        exports.print('FAIL ' + message, 'fail');
+    }
+};
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/determinism/program.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/determinism/program.js b/thirdparty/commonjs-tests/modules/1.0/determinism/program.js
new file mode 100644
index 0000000..7c0e50b
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/determinism/program.js
@@ -0,0 +1,3 @@
+var test = require('test');
+require('submodule/a');
+test.print('DONE', 'info');

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/determinism/submodule/a.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/determinism/submodule/a.js b/thirdparty/commonjs-tests/modules/1.0/determinism/submodule/a.js
new file mode 100644
index 0000000..215ea1d
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/determinism/submodule/a.js
@@ -0,0 +1,9 @@
+var test = require('test');
+var pass = false;
+var test = require('test');
+try {
+    require('a');
+} catch (exception) {
+    pass = true;
+}
+test.assert(pass, 'require does not fall back to relative modules when absolutes are not
available.')

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/determinism/submodule/b.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/determinism/submodule/b.js b/thirdparty/commonjs-tests/modules/1.0/determinism/submodule/b.js
new file mode 100644
index 0000000..139597f
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/determinism/submodule/b.js
@@ -0,0 +1,2 @@
+
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/determinism/test.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/determinism/test.js b/thirdparty/commonjs-tests/modules/1.0/determinism/test.js
new file mode 100644
index 0000000..5d0984e
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/determinism/test.js
@@ -0,0 +1,15 @@
+
+exports.print = typeof print !== "undefined" ? print : function () {
+    var system = require("system");
+    var stdio = system.stdio;
+    stdio.print.apply(stdio, arguments);
+};
+
+exports.assert = function (guard, message) {
+    if (guard) {
+        exports.print('PASS ' + message, 'pass');
+    } else {
+        exports.print('FAIL ' + message, 'fail');
+    }
+};
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/exactExports/a.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/exactExports/a.js b/thirdparty/commonjs-tests/modules/1.0/exactExports/a.js
new file mode 100644
index 0000000..99c929e
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/exactExports/a.js
@@ -0,0 +1,3 @@
+exports.program = function () {
+    return require('program');
+};

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/exactExports/program.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/exactExports/program.js b/thirdparty/commonjs-tests/modules/1.0/exactExports/program.js
new file mode 100644
index 0000000..e82bd6d
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/exactExports/program.js
@@ -0,0 +1,4 @@
+var test = require('test');
+var a = require('a');
+test.assert(a.program() === exports, 'exact exports');
+test.print('DONE', 'info');

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/exactExports/test.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/exactExports/test.js b/thirdparty/commonjs-tests/modules/1.0/exactExports/test.js
new file mode 100644
index 0000000..5d0984e
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/exactExports/test.js
@@ -0,0 +1,15 @@
+
+exports.print = typeof print !== "undefined" ? print : function () {
+    var system = require("system");
+    var stdio = system.stdio;
+    stdio.print.apply(stdio, arguments);
+};
+
+exports.assert = function (guard, message) {
+    if (guard) {
+        exports.print('PASS ' + message, 'pass');
+    } else {
+        exports.print('FAIL ' + message, 'fail');
+    }
+};
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/hasOwnProperty/hasOwnProperty.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/hasOwnProperty/hasOwnProperty.js b/thirdparty/commonjs-tests/modules/1.0/hasOwnProperty/hasOwnProperty.js
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/hasOwnProperty/program.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/hasOwnProperty/program.js b/thirdparty/commonjs-tests/modules/1.0/hasOwnProperty/program.js
new file mode 100644
index 0000000..1653f1b
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/hasOwnProperty/program.js
@@ -0,0 +1,4 @@
+var hasOwnProperty = require('hasOwnProperty');
+var toString = require('toString');
+var test = require('test');
+test.print('DONE', 'info');

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/hasOwnProperty/test.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/hasOwnProperty/test.js b/thirdparty/commonjs-tests/modules/1.0/hasOwnProperty/test.js
new file mode 100644
index 0000000..5d0984e
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/hasOwnProperty/test.js
@@ -0,0 +1,15 @@
+
+exports.print = typeof print !== "undefined" ? print : function () {
+    var system = require("system");
+    var stdio = system.stdio;
+    stdio.print.apply(stdio, arguments);
+};
+
+exports.assert = function (guard, message) {
+    if (guard) {
+        exports.print('PASS ' + message, 'pass');
+    } else {
+        exports.print('FAIL ' + message, 'fail');
+    }
+};
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/hasOwnProperty/toString.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/hasOwnProperty/toString.js b/thirdparty/commonjs-tests/modules/1.0/hasOwnProperty/toString.js
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/method/a.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/method/a.js b/thirdparty/commonjs-tests/modules/1.0/method/a.js
new file mode 100644
index 0000000..69c48af
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/method/a.js
@@ -0,0 +1,12 @@
+exports.foo = function () {
+    return this;
+};
+exports.set = function (x) {
+    this.x = x;
+};
+exports.get = function () {
+    return this.x;
+};
+exports.getClosed = function () {
+    return exports.x;
+};

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/method/program.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/method/program.js b/thirdparty/commonjs-tests/modules/1.0/method/program.js
new file mode 100644
index 0000000..192811c
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/method/program.js
@@ -0,0 +1,8 @@
+var test = require('test');
+var a = require('a');
+var foo = a.foo;
+test.assert(a.foo() == a, 'calling a module member');
+test.assert(foo() == (function (){return this})(), 'members not implicitly bound');
+a.set(10);
+test.assert(a.get() == 10, 'get and set')
+test.print('DONE', 'info');

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/method/test.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/method/test.js b/thirdparty/commonjs-tests/modules/1.0/method/test.js
new file mode 100644
index 0000000..5d0984e
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/method/test.js
@@ -0,0 +1,15 @@
+
+exports.print = typeof print !== "undefined" ? print : function () {
+    var system = require("system");
+    var stdio = system.stdio;
+    stdio.print.apply(stdio, arguments);
+};
+
+exports.assert = function (guard, message) {
+    if (guard) {
+        exports.print('PASS ' + message, 'pass');
+    } else {
+        exports.print('FAIL ' + message, 'fail');
+    }
+};
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/missing/program.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/missing/program.js b/thirdparty/commonjs-tests/modules/1.0/missing/program.js
new file mode 100644
index 0000000..c6b03aa
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/missing/program.js
@@ -0,0 +1,8 @@
+var test = require('test');
+try {
+    require('bogus');
+    test.print('FAIL require throws error when module missing', 'fail');
+} catch (exception) {
+    test.print('PASS require throws error when module missing', 'pass');
+}
+test.print('DONE', 'info');

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/missing/test.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/missing/test.js b/thirdparty/commonjs-tests/modules/1.0/missing/test.js
new file mode 100644
index 0000000..5d0984e
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/missing/test.js
@@ -0,0 +1,15 @@
+
+exports.print = typeof print !== "undefined" ? print : function () {
+    var system = require("system");
+    var stdio = system.stdio;
+    stdio.print.apply(stdio, arguments);
+};
+
+exports.assert = function (guard, message) {
+    if (guard) {
+        exports.print('PASS ' + message, 'pass');
+    } else {
+        exports.print('FAIL ' + message, 'fail');
+    }
+};
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/monkeys/a.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/monkeys/a.js b/thirdparty/commonjs-tests/modules/1.0/monkeys/a.js
new file mode 100644
index 0000000..a949e1d
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/monkeys/a.js
@@ -0,0 +1 @@
+require('program').monkey = 10;

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/monkeys/program.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/monkeys/program.js b/thirdparty/commonjs-tests/modules/1.0/monkeys/program.js
new file mode 100644
index 0000000..42d6711
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/monkeys/program.js
@@ -0,0 +1,4 @@
+var a = require('a');
+var test = require('test');
+test.assert(exports.monkey == 10, 'monkeys permitted');
+test.print('DONE', 'info');

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/monkeys/test.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/monkeys/test.js b/thirdparty/commonjs-tests/modules/1.0/monkeys/test.js
new file mode 100644
index 0000000..5d0984e
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/monkeys/test.js
@@ -0,0 +1,15 @@
+
+exports.print = typeof print !== "undefined" ? print : function () {
+    var system = require("system");
+    var stdio = system.stdio;
+    stdio.print.apply(stdio, arguments);
+};
+
+exports.assert = function (guard, message) {
+    if (guard) {
+        exports.print('PASS ' + message, 'pass');
+    } else {
+        exports.print('FAIL ' + message, 'fail');
+    }
+};
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/nested/a/b/c/d.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/nested/a/b/c/d.js b/thirdparty/commonjs-tests/modules/1.0/nested/a/b/c/d.js
new file mode 100644
index 0000000..69fd282
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/nested/a/b/c/d.js
@@ -0,0 +1,3 @@
+exports.foo = function () {
+    return 1;
+};

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/nested/program.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/nested/program.js b/thirdparty/commonjs-tests/modules/1.0/nested/program.js
new file mode 100644
index 0000000..c014b57
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/nested/program.js
@@ -0,0 +1,3 @@
+var test = require('test');
+test.assert(require('a/b/c/d').foo() == 1, 'nested module identifier');
+test.print('DONE', 'info');

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/nested/test.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/nested/test.js b/thirdparty/commonjs-tests/modules/1.0/nested/test.js
new file mode 100644
index 0000000..5d0984e
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/nested/test.js
@@ -0,0 +1,15 @@
+
+exports.print = typeof print !== "undefined" ? print : function () {
+    var system = require("system");
+    var stdio = system.stdio;
+    stdio.print.apply(stdio, arguments);
+};
+
+exports.assert = function (guard, message) {
+    if (guard) {
+        exports.print('PASS ' + message, 'pass');
+    } else {
+        exports.print('FAIL ' + message, 'fail');
+    }
+};
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/relative/program.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/relative/program.js b/thirdparty/commonjs-tests/modules/1.0/relative/program.js
new file mode 100644
index 0000000..b3e4b6e
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/relative/program.js
@@ -0,0 +1,5 @@
+var test = require('test');
+var a = require('submodule/a');
+var b = require('submodule/b');
+test.assert(a.foo == b.foo, 'a and b share foo through a relative require');
+test.print('DONE', 'info');

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/relative/submodule/a.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/relative/submodule/a.js b/thirdparty/commonjs-tests/modules/1.0/relative/submodule/a.js
new file mode 100644
index 0000000..42e4ca0
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/relative/submodule/a.js
@@ -0,0 +1 @@
+exports.foo = require('./b').foo;

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/relative/submodule/b.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/relative/submodule/b.js b/thirdparty/commonjs-tests/modules/1.0/relative/submodule/b.js
new file mode 100644
index 0000000..9042c16
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/relative/submodule/b.js
@@ -0,0 +1,2 @@
+exports.foo = function () {
+};

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/relative/test.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/relative/test.js b/thirdparty/commonjs-tests/modules/1.0/relative/test.js
new file mode 100644
index 0000000..5d0984e
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/relative/test.js
@@ -0,0 +1,15 @@
+
+exports.print = typeof print !== "undefined" ? print : function () {
+    var system = require("system");
+    var stdio = system.stdio;
+    stdio.print.apply(stdio, arguments);
+};
+
+exports.assert = function (guard, message) {
+    if (guard) {
+        exports.print('PASS ' + message, 'pass');
+    } else {
+        exports.print('FAIL ' + message, 'fail');
+    }
+};
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/transitive/a.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/transitive/a.js b/thirdparty/commonjs-tests/modules/1.0/transitive/a.js
new file mode 100644
index 0000000..4df7bb8
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/transitive/a.js
@@ -0,0 +1 @@
+exports.foo = require('b').foo;

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/transitive/b.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/transitive/b.js b/thirdparty/commonjs-tests/modules/1.0/transitive/b.js
new file mode 100644
index 0000000..30ea70d
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/transitive/b.js
@@ -0,0 +1 @@
+exports.foo = require('c').foo;

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/transitive/c.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/transitive/c.js b/thirdparty/commonjs-tests/modules/1.0/transitive/c.js
new file mode 100644
index 0000000..69fd282
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/transitive/c.js
@@ -0,0 +1,3 @@
+exports.foo = function () {
+    return 1;
+};

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/transitive/program.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/transitive/program.js b/thirdparty/commonjs-tests/modules/1.0/transitive/program.js
new file mode 100644
index 0000000..98bb996
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/transitive/program.js
@@ -0,0 +1,3 @@
+var test = require('test');
+test.assert(require('a').foo() == 1, 'transitive');
+test.print('DONE', 'info');

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/d7341998/thirdparty/commonjs-tests/modules/1.0/transitive/test.js
----------------------------------------------------------------------
diff --git a/thirdparty/commonjs-tests/modules/1.0/transitive/test.js b/thirdparty/commonjs-tests/modules/1.0/transitive/test.js
new file mode 100644
index 0000000..5d0984e
--- /dev/null
+++ b/thirdparty/commonjs-tests/modules/1.0/transitive/test.js
@@ -0,0 +1,15 @@
+
+exports.print = typeof print !== "undefined" ? print : function () {
+    var system = require("system");
+    var stdio = system.stdio;
+    stdio.print.apply(stdio, arguments);
+};
+
+exports.assert = function (guard, message) {
+    if (guard) {
+        exports.print('PASS ' + message, 'pass');
+    } else {
+        exports.print('FAIL ' + message, 'fail');
+    }
+};
+


Mime
View raw message