~ubuntu-branches/ubuntu/oneiric/haxe/oneiric

« back to all changes in this revision

Viewing changes to haxe/std/js/Lib.hx

  • Committer: Bazaar Package Importer
  • Author(s): Jens Peter Secher
  • Date: 2009-03-18 23:09:50 UTC
  • mfrom: (3.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090318230950-pgfuxg2ucolps74t
Tags: 1:2.2-2
* Use ocamlfind to locate and use the libraries xml-light and extlib
  which already exist in Debian as separate packages.
  (Closes: #519630)
* Fixed compile error with camlp4 3.11, thanks to Stéphane Glondu.
  (Closes: #519627)
* Use quilt instead of dpatch for patches, and describe how to use
  quilt in Debian.source (thanks to Russ Allbery).
* Added a Vcs-Hg control filed to indicate the location of the public
  repository.
* Bumped Standards-Version to 3.8.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
        public static var isIE : Bool;
32
32
        public static var isOpera : Bool;
33
 
        public static var document : Document = untyped __js__("document");
34
 
        public static var window : Window = untyped __js__("window");
 
33
        public static var document : Document;
 
34
        public static var window : Window;
35
35
        static var onerror : String -> Array<String> -> Bool = null;
36
36
 
37
37
        public static function alert( v : Dynamic ) {
47
47
        }
48
48
 
49
49
        static function __init__() untyped {
 
50
                document = untyped __js__("document");
 
51
                window = untyped __js__("window");
50
52
                #if debug
51
 
                __js__('
52
 
                        onerror = function(msg,url,line) {
53
 
                                var stack = $s.copy();
54
 
                                var f = js.Lib.onerror;
55
 
                                $s.splice(0,$s.length);
56
 
                                if( f == null ) {
57
 
                                        var i = stack.length;
58
 
                                        var s = "";
59
 
                                        while( --i >= 0 )
60
 
                                                s += "Called from "+stack[i]+"\\n";
61
 
                                        alert(msg+"\\n\\n"+s);
62
 
                                        return false;
63
 
                                }
64
 
                                return f(msg,stack);
65
 
                        }
66
 
                ');
67
 
                #else true
68
 
                __js__('
69
 
                        onerror = function(msg,url,line) {
70
 
                                var f = js.Lib.onerror;
71
 
                                if( f == null )
72
 
                                        return false;
73
 
                                return f(msg,[url+":"+line]);
74
 
                        }
75
 
                ');
 
53
__js__('onerror = function(msg,url,line) {
 
54
                var stack = $s.copy();
 
55
                var f = js.Lib.onerror;
 
56
                $s.splice(0,$s.length);
 
57
                if( f == null ) {
 
58
                        var i = stack.length;
 
59
                        var s = "";
 
60
                        while( --i >= 0 )
 
61
                                s += "Called from "+stack[i]+"\\n";
 
62
                        alert(msg+"\\n\\n"+s);
 
63
                        return false;
 
64
                }
 
65
                return f(msg,stack);
 
66
        }');
 
67
                #else
 
68
__js__('onerror = function(msg,url,line) {
 
69
                var f = js.Lib.onerror;
 
70
                if( f == null )
 
71
                        return false;
 
72
                return f(msg,[url+":"+line]);
 
73
        }');
76
74
                #end
77
75
        }
78
76