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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 var yetAnotherLocal = 10; | 135 var yetAnotherLocal = 10; |
136 } | 136 } |
137 | 137 |
138 // Test step into bound function. | 138 // Test step into bound function. |
139 function bind1() { | 139 function bind1() { |
140 var bound = g.bind(null, 3); | 140 var bound = g.bind(null, 3); |
141 debugger; | 141 debugger; |
142 bound(); | 142 bound(); |
143 } | 143 } |
144 | 144 |
| 145 // Test step into apply of bound function. |
| 146 function applyAndBind1() { |
| 147 var bound = g.bind(null, 3); |
| 148 debugger; |
| 149 bound.apply(null, [3]); |
| 150 var aLocalVar = 'test'; |
| 151 var anotherLocalVar = g(aLocalVar) + 's'; |
| 152 var yetAnotherLocal = 10; |
| 153 } |
| 154 |
145 var testFunctions = | 155 var testFunctions = |
146 [call1, call2, call3, call4, apply1, apply2, apply3, apply4, bind1]; | 156 [call1, call2, call3, call4, apply1, apply2, apply3, apply4, bind1, |
| 157 applyAndBind1]; |
147 | 158 |
148 for (var i = 0; i < testFunctions.length; i++) { | 159 for (var i = 0; i < testFunctions.length; i++) { |
149 state = 0; | 160 state = 0; |
150 testFunctions[i](); | 161 testFunctions[i](); |
151 assertNull(exception); | 162 assertNull(exception); |
152 assertEquals(3, state); | 163 assertEquals(3, state); |
153 } | 164 } |
154 | 165 |
155 // Test global bound function. | 166 // Test global bound function. |
156 state = 0; | 167 state = 0; |
157 var globalBound = g.bind(null, 3); | 168 var globalBound = g.bind(null, 3); |
158 debugger; | 169 debugger; |
159 globalBound(); | 170 globalBound(); |
160 assertNull(exception); | 171 assertNull(exception); |
161 assertEquals(3, state); | 172 assertEquals(3, state); |
162 | 173 |
163 // Get rid of the debug event listener. | 174 // Get rid of the debug event listener. |
164 Debug.setListener(null); | 175 Debug.setListener(null); |
OLD | NEW |