Skip to content
Permalink
Browse files
CB-13163: fix using relative paths in calls to require.
  • Loading branch information
filmaj committed Aug 10, 2017
1 parent d46dc72 commit 65fd0f61cca4d979e653ab5cf2dbc32b50416ba9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
@@ -31,7 +31,7 @@ var require,
requireStack = [],
// Map of module ID -> index into requireStack of modules currently being built.
inProgressModules = {},
SEPARATOR = ".";
SEPARATOR = "/";



@@ -145,5 +145,15 @@ describe("require + define", function () {
define("a", factory);
require("a");
});

it("can handle multiple defined modules that use relative require paths", function () {
define("plugin/ios/foo", function (require, exports, module) {
module.exports = require("./bar") * 2;
});
define("plugin/ios/bar", function (require, exports, module) {
module.exports = 2;
});
expect(require("plugin/ios/foo")).toEqual(4);
});
});
});

0 comments on commit 65fd0f6

Please sign in to comment.