OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 function listener(event, exec_state, event_data, data) { | 73 function listener(event, exec_state, event_data, data) { |
74 try { | 74 try { |
75 if (event == Debug.DebugEvent.Break) | 75 if (event == Debug.DebugEvent.Break) |
76 { | 76 { |
77 if (!testConstructor) { | 77 if (!testConstructor) { |
78 // The expected backtrace is | 78 // The expected backtrace is |
79 // 0: Call distance on Point where distance is a property on the prototype | 79 // 0: Call distance on Point where distance is a property on the prototype |
80 // 1: Call distance on Point where distance is a direct property | 80 // 1: Call distance on Point where distance is a direct property |
81 // 2: Call on function an array element 2 | 81 // 2: Call on function an array element 2 |
82 // 3: [anonymous] | 82 // 3: [anonymous] |
83 assertEquals("#<a Point>.distanceTo(p=#<a Point>)", exec_state.frame(0).in
vocationText()); | 83 assertEquals("#<Point>.distanceTo(p=#<Point>)", exec_state.frame(0).invoca
tionText()); |
84 assertEquals("#<a Point>.distanceTo(p=#<a Point>)", exec_state.frame(1).in
vocationText()); | 84 assertEquals("#<Point>.distanceTo(p=#<Point>)", exec_state.frame(1).invoca
tionText()); |
85 assertEquals("#<an Array>[2](aka distance)(p=#<a Point>, q=#<a Point>)", e
xec_state.frame(2).invocationText()); | 85 assertEquals("#<Array>[2](aka distance)(p=#<Point>, q=#<Point>)", exec_sta
te.frame(2).invocationText()); |
86 assertEquals("[anonymous]()", exec_state.frame(3).invocationText()); | 86 assertEquals("[anonymous]()", exec_state.frame(3).invocationText()); |
87 listenerCalled = true; | 87 listenerCalled = true; |
88 } else { | 88 } else { |
89 // The expected backtrace is | 89 // The expected backtrace is |
90 // 0: Call Point constructor | 90 // 0: Call Point constructor |
91 // 1: Call on global function createPoint | 91 // 1: Call on global function createPoint |
92 // 2: [anonymous] | 92 // 2: [anonymous] |
93 assertEquals("new Point(x=0, y=0)", exec_state.frame(0).invocationText()); | 93 assertEquals("new Point(x=0, y=0)", exec_state.frame(0).invocationText()); |
94 assertEquals("createPoint(x=0, y=0)", exec_state.frame(1).invocationText()
); | 94 assertEquals("createPoint(x=0, y=0)", exec_state.frame(1).invocationText()
); |
95 assertEquals("[anonymous]()", exec_state.frame(2).invocationText()); | 95 assertEquals("[anonymous]()", exec_state.frame(2).invocationText()); |
(...skipping 17 matching lines...) Expand all Loading... |
113 | 113 |
114 // Set a break point and call to invoke the debug event listener. | 114 // Set a break point and call to invoke the debug event listener. |
115 listenerCalled = false; | 115 listenerCalled = false; |
116 testConstructor = true; | 116 testConstructor = true; |
117 Debug.setBreakPoint(Point, 0, 0); | 117 Debug.setBreakPoint(Point, 0, 0); |
118 createPoint(0, 0); | 118 createPoint(0, 0); |
119 | 119 |
120 // Make sure that the debug event listener vas invoked (again). | 120 // Make sure that the debug event listener vas invoked (again). |
121 assertTrue(listenerCalled); | 121 assertTrue(listenerCalled); |
122 assertFalse(exception, "exception in listener") | 122 assertFalse(exception, "exception in listener") |
OLD | NEW |