| 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 print("Test that descriptions for arrays, maps, and sets include the correct len
gth or size.") | |
| 6 | |
| 7 Promise.all([ | |
| 8 testExpression("new Set()"), | |
| 9 testExpression("new Set([1,2])"), | |
| 10 testExpression("new Map()"), | |
| 11 testExpression("new Map([[1,2],[3,4]])"), | |
| 12 testExpression("new Array()"), | |
| 13 testExpression("new Array(2)"), | |
| 14 testExpression("new Uint8Array()"), | |
| 15 testExpression("new Uint8Array(2)") | |
| 16 ]).then(() => InspectorTest.completeTest()); | |
| 17 | |
| 18 function testExpression(expression) { | |
| 19 return Protocol.Runtime.evaluate({ expression: expression }) | |
| 20 .then(result => InspectorTest.logMessage(result.result.result.descri
ption)) | |
| 21 .then(() => Protocol.Runtime.evaluate({ expression: "[" + expression
+ "]", generatePreview: true })) | |
| 22 .then(result => InspectorTest.logMessage(result.result.result.previe
w.properties[0].value)) | |
| 23 } | |
| OLD | NEW |