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

Unified Diff: lib/compat.js

Issue 29363560: Issue 4552 - Drop jshydra dependency (adblockpluschrome) (Closed)
Patch Set: Created Nov. 18, 2016, 5:20 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
Index: lib/compat.js
diff --git a/lib/compat.js b/lib/compat.js
index 9a78e434dfd2c46071d5b920501034d1d9054e80..9b52aeca23227d2eb2e6a941bbcd7328df7d89a0 100644
--- a/lib/compat.js
+++ b/lib/compat.js
@@ -21,15 +21,15 @@
function require(module)
{
- var result = require.scopes[module];
- if (typeof result == "function" && !(module in require.loaded))
+ if (!(module in require.scopes))
{
- result = require.scopes[module] = result();
- require.loaded[module] = true;
+ let scope = {exports: {}};
+ require.scopes[module] = require.modules[module](scope, scope.exports,
+ require);
}
- return result;
+ return require.scopes[module];
}
-require.loaded = Object.create(null);
+require.modules = Object.create(null);
require.scopes = Object.create(null);
function importAll(module, globalObj)
@@ -79,6 +79,9 @@ var Components =
},
results: {},
utils: {
+ import: function()
kzar 2016/11/18 17:22:41 For some reason I needed to add this, I have no id
+ {
+ },
reportError: function(e)
{
console.error(e);

Powered by Google App Engine
This is Rietveld