OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 var received = 0; |
| 6 |
| 7 function receive(message) { |
| 8 var message_obj = JSON.parse(message); |
| 9 assertEquals(3, message_obj.result.result.value); |
| 10 received++; |
| 11 } |
| 12 |
| 13 var message = JSON.stringify({ |
| 14 id : 1, |
| 15 method : "Runtime.evaluate", |
| 16 params : { |
| 17 expression: "function f() { return 2 }; 3" |
| 18 } |
| 19 }); |
| 20 |
| 21 send(message); |
| 22 |
| 23 assertEquals(1, received); |
| 24 assertEquals(2, f()); |
OLD | NEW |