| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 print("Check that while Runtime.getProperties call on proxy object no user defin
ed trap will be executed."); | 5 print("Check that while Runtime.getProperties call on proxy object no user defin
ed trap will be executed."); |
| 6 | 6 |
| 7 InspectorTest.evaluateInPage(` | 7 InspectorTest.addScript(` |
| 8 var self = this; | 8 var self = this; |
| 9 function testFunction() | 9 function testFunction() |
| 10 { | 10 { |
| 11 self.counter = 0; | 11 self.counter = 0; |
| 12 var handler = { | 12 var handler = { |
| 13 get: function(target, name){ | 13 get: function(target, name){ |
| 14 self.counter++; | 14 self.counter++; |
| 15 return Reflect.get.apply(this, arguments); | 15 return Reflect.get.apply(this, arguments); |
| 16 }, | 16 }, |
| 17 set: function(target, name){ | 17 set: function(target, name){ |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 return Reflect.apply.apply(this, arguments); | 75 return Reflect.apply.apply(this, arguments); |
| 76 }, | 76 }, |
| 77 construct: function() { | 77 construct: function() { |
| 78 self.counter++; | 78 self.counter++; |
| 79 return Reflect.construct.apply(this, arguments); | 79 return Reflect.construct.apply(this, arguments); |
| 80 } | 80 } |
| 81 }; | 81 }; |
| 82 return new Proxy({ a : 1}, handler); | 82 return new Proxy({ a : 1}, handler); |
| 83 }`); | 83 }`); |
| 84 | 84 |
| 85 InspectorTest.sendCommandOrDie("Runtime.evaluate", { expression: "testFunction()
"}, requestProperties); | 85 Protocol.Runtime.evaluate({ expression: "testFunction()"}).then(requestPropertie
s); |
| 86 | 86 |
| 87 function requestProperties(result) | 87 function requestProperties(result) |
| 88 { | 88 { |
| 89 InspectorTest.sendCommandOrDie("Runtime.getProperties", { objectId: result.res
ult.objectId, generatePreview: true }, checkCounter); | 89 Protocol.Runtime.getProperties({ objectId: result.result.objectId, generatePre
view: true }).then(checkCounter); |
| 90 } | 90 } |
| 91 | 91 |
| 92 function checkCounter(result) | 92 function checkCounter(result) |
| 93 { | 93 { |
| 94 InspectorTest.sendCommandOrDie("Runtime.evaluate", { expression: "self.counter
" }, dumpCounter); | 94 Protocol.Runtime.evaluate({ expression: "self.counter" }).then(dumpCounter); |
| 95 } | 95 } |
| 96 | 96 |
| 97 function dumpCounter(result) | 97 function dumpCounter(result) |
| 98 { | 98 { |
| 99 InspectorTest.logObject(result); | 99 InspectorTest.logMessage(result); |
| 100 InspectorTest.completeTest(); | 100 InspectorTest.completeTest(); |
| 101 } | 101 } |
| OLD | NEW |