~caneypuggies/reformedchurcheslocator/couchapp-backbone

« back to all changes in this revision

Viewing changes to _attachments/js/vendor/requirejs/tests/error/globalOnError.html

  • Committer: Tim Black
  • Date: 2013-09-16 22:50:16 UTC
  • Revision ID: tim@alwaysreformed.com-20130916225016-zk8jiba25z33ew7h
Versioned Bower vendor directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html>
 
2
<html>
 
3
<head>
 
4
    <title>require.js: Global onError Test</title>
 
5
    <script type="text/javascript" src="../../require.js"></script>
 
6
    <script type="text/javascript" src="../doh/runner.js"></script>
 
7
    <script type="text/javascript" src="../doh/_browserRunner.js"></script>
 
8
    <script type="text/javascript">
 
9
        var master = new doh.Deferred(),
 
10
            failed = false;
 
11
 
 
12
        requirejs.onError = function (err) {
 
13
            if (!failed) {
 
14
                master.callback(true);
 
15
            }
 
16
        };
 
17
 
 
18
        define('a', {name: 'a'});
 
19
 
 
20
        require(['a'], function (a) {
 
21
            a.whatever.fail = 'fail';
 
22
        }, function (err) {
 
23
            failed = true;
 
24
        });
 
25
 
 
26
        doh.register(
 
27
            "globalOnError",
 
28
            [
 
29
                {
 
30
                    name: "globalOnError",
 
31
                    timeout: 1000,
 
32
                    runTest: function () {
 
33
                        return master;
 
34
                    }
 
35
                }
 
36
            ]
 
37
        );
 
38
        doh.run();
 
39
    </script>
 
40
</head>
 
41
<body>
 
42
    <h1>require.js: Global onError Test</h1>
 
43
    <p>If global onError function set up, favor using it even for require
 
44
        callback errors.
 
45
        <a href="https://github.com/jrburke/requirejs/issues/721">More info</a>.</p>
 
46
    <p>Check console for messages</p>
 
47
</body>
 
48
</html>