51 lines
1.4 KiB
HTML
51 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>require.js: requirejs.undef() No Require 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">
|
|
var master = new doh.Deferred();
|
|
|
|
doh.register(
|
|
"undefNoRequire",
|
|
[
|
|
{
|
|
name: "undefNoRequire",
|
|
timeout: 2000,
|
|
runTest: function () {
|
|
return master;
|
|
}
|
|
}
|
|
]
|
|
);
|
|
doh.run();
|
|
|
|
//Start with a bad definition we want to overwrite
|
|
define('abc', function() {
|
|
master.errback(false);
|
|
});
|
|
|
|
//Should remove that waiting 'abc' definition
|
|
requirejs.undef('abc');
|
|
|
|
//Now set the final version.
|
|
define('abc', function() {
|
|
master.callback(true);
|
|
});
|
|
|
|
//And now fully execute the module.
|
|
require(['abc'], function() {});
|
|
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<h1>require.js: requirejs.undef() No Require Test</h1>
|
|
<p>Use requirejs.undef() to reset, but called before the first require()
|
|
for the module.
|
|
<a href="https://github.com/jrburke/requirejs/issues/408">More info</a>.</p>
|
|
<p>Check console for messages</p>
|
|
</body>
|
|
</html>
|