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

Unified Diff: test/common.js

Issue 4895499043733504: Issue 510 - [Typed objects] Don`t hardcode script load order in unit tests (Closed)
Patch Set: Created Jan. 10, 2015, 12:13 a.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: test/common.js
===================================================================
--- a/test/common.js
+++ b/test/common.js
@@ -14,22 +14,26 @@
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
function addScript(url)
{
var script = document.createElement("script");
script.src = url;
- if (js17supported)
- script.type = "text/javascript;version=1.7";
- else
+ if (!js17supported)
script.src += "?backcompat";
script.async = false;
document.head.appendChild(script);
return script;
}
function require(module)
{
+ if (require.modules.hasOwnProperty(module))
+ {
+ require.scopes[module] = evalModule(require.modules[module]);
+ delete require.modules[module];
+ }
return require.scopes[module];
}
require.scopes = {};
+require.modules = {};
Felix Dahlke 2015/02/03 06:21:16 Have you considered calling this "sources"? Seems
Wladimir Palant 2015/02/03 16:26:04 Done.

Powered by Google App Engine
This is Rietveld