OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 // Add the debug event listener. | 60 // Add the debug event listener. |
61 Debug.setListener(listener); | 61 Debug.setListener(listener); |
62 result = -1; | 62 result = -1; |
63 f(); | 63 f(); |
64 assertEquals(1, result); | 64 assertEquals(1, result); |
65 | 65 |
66 // Clear breakpoint. | 66 // Clear breakpoint. |
67 Debug.clearBreakPoint(bp); | 67 Debug.clearBreakPoint(bp); |
68 // Get rid of the debug event listener. | 68 // Get rid of the debug event listener. |
69 Debug.setListener(null); | 69 Debug.setListener(null); |
70 | |
71 | |
72 function f1() { | |
73 { | |
74 let i = 1; | |
rossberg
2014/11/14 12:35:24
Considering stack allocated block variables being
Dmitry Lomov (no reviews)
2014/11/14 13:38:26
Done.
| |
75 debugger; | |
76 assertEquals(2, i); | |
77 } | |
78 } | |
79 | |
80 var exception; | |
81 Debug.setListener(function (event, exec_state, event_data, data) { | |
82 try { | |
83 if (event == Debug.DebugEvent.Break) { | |
84 var frame = exec_state.frame(); | |
85 assertEquals(1, frame.evaluate("i").value()); | |
86 var allScopes = frame.allScopes(); | |
87 assertEquals(1, allScopes[0].scopeObject().value().i); | |
88 allScopes[0].setVariableValue('i', 2); | |
aandrey
2014/11/14 12:39:58
nit: ' or " (see 3 lines above)
Dmitry Lomov (no reviews)
2014/11/14 13:38:27
Done.
| |
89 } | |
90 } catch (e) { | |
91 exception = e; | |
92 } | |
93 }); | |
94 | |
95 exception = null; | |
96 f1(); | |
97 assertEquals(null, exception, exception); | |
OLD | NEW |