| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 lookupRequest(exec_state, '{"handles":["a"]}', false); | 101 lookupRequest(exec_state, '{"handles":["a"]}', false); |
| 102 lookupRequest(exec_state, '{"handles":[-1]}', false); | 102 lookupRequest(exec_state, '{"handles":[-1]}', false); |
| 103 | 103 |
| 104 // Evaluate and get some handles. | 104 // Evaluate and get some handles. |
| 105 var handle_o = evaluateRequest(exec_state, '{"expression":"o"}'); | 105 var handle_o = evaluateRequest(exec_state, '{"expression":"o"}'); |
| 106 var handle_p = evaluateRequest(exec_state, '{"expression":"p"}'); | 106 var handle_p = evaluateRequest(exec_state, '{"expression":"p"}'); |
| 107 var handle_b = evaluateRequest(exec_state, '{"expression":"a"}'); | 107 var handle_b = evaluateRequest(exec_state, '{"expression":"a"}'); |
| 108 var handle_a = evaluateRequest(exec_state, '{"expression":"b","frame":1}'); | 108 var handle_a = evaluateRequest(exec_state, '{"expression":"b","frame":1}'); |
| 109 assertEquals(handle_o, handle_a); | 109 assertEquals(handle_o, handle_a); |
| 110 assertEquals(handle_a, handle_b); | 110 assertEquals(handle_a, handle_b); |
| 111 assertFalse(handle_o == handle_p, "o and p have he same handle"); | 111 assertFalse(handle_o == handle_p, "o and p have the same handle"); |
| 112 | 112 |
| 113 var response; | 113 var response; |
| 114 var count; | 114 var count; |
| 115 response = lookupRequest(exec_state, '{"handles":[' + handle_o + ']}', true)
; | 115 response = lookupRequest(exec_state, '{"handles":[' + handle_o + ']}', true)
; |
| 116 var obj = response.body[handle_o]; | 116 var obj = response.body[handle_o]; |
| 117 assertTrue(!!obj, 'Object not found: ' + handle_o); | 117 assertTrue(!!obj, 'Object not found: ' + handle_o); |
| 118 assertEquals(handle_o, obj.handle); | 118 assertEquals(handle_o, obj.handle); |
| 119 count = 0; | 119 count = 0; |
| 120 for (i in obj.properties) { | 120 for (i in obj.properties) { |
| 121 switch (obj.properties[i].name) { | 121 switch (obj.properties[i].name) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 133 response = lookupRequest(exec_state, '{"handles":[' + handle_p + ']}', true)
; | 133 response = lookupRequest(exec_state, '{"handles":[' + handle_p + ']}', true)
; |
| 134 obj = response.body[handle_p]; | 134 obj = response.body[handle_p]; |
| 135 assertTrue(!!obj, 'Object not found: ' + handle_p); | 135 assertTrue(!!obj, 'Object not found: ' + handle_p); |
| 136 assertEquals(handle_p, obj.handle); | 136 assertEquals(handle_p, obj.handle); |
| 137 | 137 |
| 138 // Check handles for functions on the stack. | 138 // Check handles for functions on the stack. |
| 139 var handle_f = evaluateRequest(exec_state, '{"expression":"f"}'); | 139 var handle_f = evaluateRequest(exec_state, '{"expression":"f"}'); |
| 140 var handle_g = evaluateRequest(exec_state, '{"expression":"g"}'); | 140 var handle_g = evaluateRequest(exec_state, '{"expression":"g"}'); |
| 141 var handle_caller = evaluateRequest(exec_state, '{"expression":"f.caller"}')
; | 141 var handle_caller = evaluateRequest(exec_state, '{"expression":"f.caller"}')
; |
| 142 | 142 |
| 143 assertFalse(handle_f == handle_g, "f and g have he same handle"); | 143 assertFalse(handle_f == handle_g, "f and g have the same handle"); |
| 144 assertEquals(handle_g, handle_caller, "caller for f should be g"); | 144 assertEquals(handle_g, handle_caller, "caller for f should be g"); |
| 145 | 145 |
| 146 response = lookupRequest(exec_state, '{"handles":[' + handle_f + ']}', true)
; | 146 response = lookupRequest(exec_state, '{"handles":[' + handle_f + ']}', true)
; |
| 147 obj = response.body[handle_f]; | 147 obj = response.body[handle_f]; |
| 148 assertEquals(handle_f, obj.handle); | 148 assertEquals(handle_f, obj.handle); |
| 149 | 149 |
| 150 count = 0; | 150 count = 0; |
| 151 for (i in obj.properties) { | 151 for (i in obj.properties) { |
| 152 var ref = obj.properties[i].ref; | 152 var ref = obj.properties[i].ref; |
| 153 var arguments = '{"handles":[' + ref + ']}'; | 153 var arguments = '{"handles":[' + ref + ']}'; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 p = {} | 243 p = {} |
| 244 o.o = o; | 244 o.o = o; |
| 245 o.p = p; | 245 o.p = p; |
| 246 p.o = o; | 246 p.o = o; |
| 247 p.p = p; | 247 p.p = p; |
| 248 g(o); | 248 g(o); |
| 249 | 249 |
| 250 assertFalse(exception, "exception in listener") | 250 assertFalse(exception, "exception in listener") |
| 251 // Make sure that the debug event listener vas invoked. | 251 // Make sure that the debug event listener vas invoked. |
| 252 assertTrue(listenerComplete, "listener did not run to completion: " + exception)
; | 252 assertTrue(listenerComplete, "listener did not run to completion: " + exception)
; |
| OLD | NEW |