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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 function f() { | 57 function f() { |
58 var i; // Line 1. | 58 var i; // Line 1. |
59 for (i = 0; i < 1000; i++) { // Line 2. | 59 for (i = 0; i < 1000; i++) { // Line 2. |
60 x = 1; // Line 3. | 60 x = 1; // Line 3. |
61 } | 61 } |
62 }; | 62 }; |
63 | 63 |
64 // Set a breakpoint on the for statement (line 1). | 64 // Set a breakpoint on the for statement (line 1). |
65 bp1 = Debug.setBreakPoint(f, 1); | 65 bp1 = Debug.setBreakPoint(f, 1); |
66 | 66 |
67 // Check that performing 1000 steps will make i 499. | 67 // Check that performing 1000 steps will make i 333. |
68 var step_count = 1000; | 68 var step_count = 1000; |
69 result = -1; | 69 result = -1; |
70 f(); | 70 f(); |
71 assertEquals(332, result); | 71 assertEquals(333, result); |
72 Debug.setListener(null); | 72 Debug.setListener(null); |
OLD | NEW |