3.0 source code

This commit is contained in:
agolybev
2015-04-28 17:59:00 +03:00
parent c69fd34bdd
commit 7b3b2248e5
16311 changed files with 1445974 additions and 3108429 deletions

View File

@@ -0,0 +1,56 @@
var globals = {};
define('plug',{
load: function () {
throw new Error('Cannot dynamically load');
}
});
define('app/test',[], function() {
return { name: 'test' };
});
define('app/test2',[], function() {
return { name: 'test2' };
});
define('plug!app/main',["!app/test", "!app/test2"], function(test, test2) {
return {
name: 'main',
test: test,
test2: test2
};
});
require(["plug!app/main"],
function(main) {
globals.main = main;
}
);
define("app/run", function(){});
require({
baseUrl: "./"
},
["app/run"],
function() {
require(["plug!app/main"], function () {
doh.register(
"requirePluginLoad",
[
function requirePluginLoad(t){
var main = globals.main;
t.is("main", main.name);
t.is("test", main.test.name);
t.is("test2", main.test2.name);
}
]
);
doh.run();
});
}
);

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>require.js: Require Plugin Load Test</title>
<script type="text/javascript" src="../../require.js"></script>
<script type="text/javascript" src="../doh/runner.js"></script>
<script type="text/javascript" src="../doh/_browserRunner.js"></script>
<script type="text/javascript" src="requirePluginLoad-tests.js"></script>
</head>
<body>
<h1>require.js: Require Plugin Load Test</h1>
<p>Make sure two requires in a built file that has inlined plugin
resources do not call the plugin's load method. See
<a href="https://github.com/jrburke/requirejs/issues/256">ticket 256</a>
for more information.</p>
<p>Check console for messages</p>
</body>
</html>