3.0 source code
This commit is contained in:
30
OfficeWeb/vendor/requirejs/tests/plugins/onerror/onerror-tests.js
vendored
Normal file
30
OfficeWeb/vendor/requirejs/tests/plugins/onerror/onerror-tests.js
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
var master = new doh.Deferred();
|
||||
|
||||
doh.register(
|
||||
"pluginsOnError",
|
||||
[
|
||||
{
|
||||
name: "pluginsOnError",
|
||||
timeout: 5000,
|
||||
runTest: function () {
|
||||
return master;
|
||||
}
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
|
||||
require({
|
||||
baseUrl: requirejs.isBrowser ? "./" : "./plugins/onerror",
|
||||
enforceDefine: true
|
||||
}, ['thrower!'],
|
||||
function (thrower) {
|
||||
master.callback(false);
|
||||
},
|
||||
function (err) {
|
||||
master.callback(true);
|
||||
});
|
||||
|
||||
//Since enforceDefine is used below, define somthing here.
|
||||
define({});
|
||||
16
OfficeWeb/vendor/requirejs/tests/plugins/onerror/onerror.html
vendored
Normal file
16
OfficeWeb/vendor/requirejs/tests/plugins/onerror/onerror.html
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Plugin onerror Test</title>
|
||||
<script type="text/javascript" src="../../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" data-main="onerror-tests.js" src="../../../require.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Plugin onerror Test</h1>
|
||||
|
||||
<a href="https://github.com/jrburke/requirejs/pull/377">More info</a>.</body>
|
||||
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
6
OfficeWeb/vendor/requirejs/tests/plugins/onerror/thrower.js
vendored
Normal file
6
OfficeWeb/vendor/requirejs/tests/plugins/onerror/thrower.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
define({
|
||||
load: function (name, req, load, config) {
|
||||
req(['fake'], load, load.error);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user