|
20 | 20 | // |
21 | 21 |
|
22 | 22 | (function(window, document, undefined) { |
| 23 | + //region setup |
23 | 24 | var pst = printStackTrace.implementation.prototype; |
24 | 25 |
|
25 | 26 | var impl = function() { |
|
58 | 59 | } |
59 | 60 | } |
60 | 61 | }; |
| 62 | + //endregion |
61 | 63 |
|
| 64 | + //region invocation |
62 | 65 | module("invocation"); |
63 | 66 |
|
64 | 67 | test("printStackTrace", function() { |
|
78 | 81 | guess: true |
79 | 82 | }); |
80 | 83 | }); |
| 84 | + //endregion |
81 | 85 |
|
| 86 | + //region mode |
82 | 87 | module("mode"); |
83 | 88 |
|
84 | 89 | test("mode", function() { |
|
547 | 552 | } |
548 | 553 | } |
549 | 554 | }], 'FUNCTION f1 (a,b,c)', frame_f2); |
| 555 | + |
550 | 556 | expect(mode == 'other' ? 4 : 2); |
551 | 557 | var message = pst.other(frame_f1); |
552 | | - var message_string = message.join("\n"); |
553 | 558 | equals(message[0].indexOf('f1(1,"abc",#function,#object)') >= 0, true, 'f1'); |
554 | 559 | equals(message[1].indexOf('{anonymous}()') >= 0, true, 'f2 anonymous'); |
| 560 | + |
555 | 561 | if (mode == 'other') { |
556 | 562 | function f1(arg1, arg2) { |
557 | | - var message = pst.other(arguments.callee), message_string = message.join("\n"); |
558 | | - //equals(message_string, '', 'debug'); |
| 563 | + var message = pst.other(arguments.callee); |
| 564 | + //equals(message.join("\n"), '', 'debug'); |
559 | 565 | equals(message[0].indexOf('f1(1,"abc",#function,#object)') >= 0, true, 'f1'); |
560 | 566 | equals(message[1].indexOf('{anonymous}()') >= 0, true, 'f2 anonymous'); |
561 | 567 | } |
|
572 | 578 | f2(); |
573 | 579 | } |
574 | 580 | }); |
| 581 | + //endregion |
575 | 582 |
|
| 583 | + //region util |
576 | 584 | module("util"); |
577 | 585 |
|
578 | 586 | test("stringify", function() { |
|
807 | 815 | this.undef(); |
808 | 816 | } catch (e) { |
809 | 817 | if (p.mode(e) == 'opera11') { |
810 | | - results.push(p.run()); |
| 818 | + results.push(p.run(e)); |
811 | 819 | } |
812 | 820 | } |
813 | 821 | }; |
|
845 | 853 | equals(p.guessAnonymousFunctions(results[i])[0].indexOf('{anonymous}'), 0, 'no file and line number in "other" mode'); |
846 | 854 | } |
847 | 855 | }); |
| 856 | + //endregion |
848 | 857 | })(window, document); |
0 commit comments