| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // Test step into function apply from a function with some local variables. | 128 // Test step into function apply from a function with some local variables. |
| 129 function apply4() { | 129 function apply4() { |
| 130 var alias = g; | 130 var alias = g; |
| 131 debugger; | 131 debugger; |
| 132 alias.apply(null, [3]); | 132 alias.apply(null, [3]); |
| 133 var aLocalVar = 'test'; | 133 var aLocalVar = 'test'; |
| 134 var anotherLocalVar = g(aLocalVar) + 's'; | 134 var anotherLocalVar = g(aLocalVar) + 's'; |
| 135 var yetAnotherLocal = 10; | 135 var yetAnotherLocal = 10; |
| 136 } | 136 } |
| 137 | 137 |
| 138 // Test step into bound function. |
| 139 function bind1() { |
| 140 var bound = g.bind(null, 3); |
| 141 debugger; |
| 142 bound(); |
| 143 } |
| 144 |
| 138 var testFunctions = | 145 var testFunctions = |
| 139 [call1, call2, call3, call4, apply1, apply2, apply3, apply4]; | 146 [call1, call2, call3, call4, apply1, apply2, apply3, apply4, bind1]; |
| 140 | 147 |
| 141 for (var i = 0; i < testFunctions.length; i++) { | 148 for (var i = 0; i < testFunctions.length; i++) { |
| 142 state = 0; | 149 state = 0; |
| 143 testFunctions[i](); | 150 testFunctions[i](); |
| 144 assertNull(exception); | 151 assertNull(exception); |
| 145 assertEquals(3, state); | 152 assertEquals(3, state); |
| 146 } | 153 } |
| 147 | 154 |
| 155 // Test global bound function. |
| 156 state = 0; |
| 157 var globalBound = g.bind(null, 3); |
| 158 debugger; |
| 159 globalBound(); |
| 160 assertNull(exception); |
| 161 assertEquals(3, state); |
| 162 |
| 148 // Get rid of the debug event listener. | 163 // Get rid of the debug event listener. |
| 149 Debug.setListener(null); | 164 Debug.setListener(null); |
| OLD | NEW |