Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/_common.js

Issue 29556638: Issue 5762 - Use relative require paths (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Use a path alias for the common modules. Created Jan. 3, 2018, 8:11 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/synchronizer.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/_common.js
===================================================================
--- a/test/_common.js
+++ b/test/_common.js
@@ -108,17 +108,17 @@
function rewriteRequires(source)
{
function escapeString(str)
{
return str.replace(/(["'\\])/g, "\\$1");
}
- return source.replace(/(\brequire\(["'])([^"']+)/g, (match, prefix, request) =>
+ return source.replace(/(\brequire\(["'])(abp-modules\/)?([^"']+)/g, (match, prefix, module, request) =>
{
if (request in knownModules)
return prefix + escapeString(knownModules[request]);
return match;
});
}
exports.createSandbox = function(options)
« no previous file with comments | « lib/synchronizer.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld