Commit 5e3e29d9 authored by machenbach's avatar machenbach Committed by Commit bot

Revert of Use parenthesis in descriptions for array/map/set lengths/sizes...

Revert of Use parenthesis in descriptions for array/map/set lengths/sizes (patchset #3 id:40001 of https://codereview.chromium.org/2521853003/ )

Reason for revert:
Breaks layout tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/11595

https://github.com/v8/v8/wiki/Blink-layout-tests

Original issue's description:
> Use parenthesis in descriptions for array/map/set lengths/sizes
>
> Descriptions for (typed)arrays will use parenthesis instead of square brackets
> "Array(10)" instead of "Array[10]". This CL also adds size hints to descriptions
> of maps and sets.
>
> Related CL for DevTools: https://codereview.chromium.org/2524913002/
>
> BUG=405845
>
> Committed: https://crrev.com/92c77a57390e6a9ef726535b255a24359751992d
> Cr-Commit-Position: refs/heads/master@{#41237}

TBR=dgozman@chromium.org,kozyatinskiy@chromium.org,luoe@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=405845

Review-Url: https://codereview.chromium.org/2530803002
Cr-Commit-Position: refs/heads/master@{#41243}
parent 37091088
......@@ -618,13 +618,7 @@ InjectedScript.prototype = {
var className = InjectedScriptHost.internalConstructorName(obj);
if (subtype === "array" || subtype === "typedarray") {
if (typeof obj.length === "number")
return className + "(" + obj.length + ")";
return className;
}
if (subtype === "map" || subtype === "set") {
if (typeof obj.size === "number")
return className + "(" + obj.size + ")";
className += "[" + obj.length + "]";
return className;
}
......
......@@ -164,7 +164,7 @@ expression: (new Map([[1,2]])).entries()
[
[0] : {
value : {
description : Array(2)
description : Array[2]
overflow : false
properties : [
[0] : {
......@@ -204,20 +204,20 @@ expression: (new Set([[1,2]])).entries()
[
[0] : {
value : {
description : Array(2)
description : Array[2]
overflow : false
properties : [
[0] : {
name : 0
subtype : array
type : object
value : Array(2)
value : Array[2]
}
[1] : {
name : 1
subtype : array
type : object
value : Array(2)
value : Array[2]
}
]
subtype : array
......@@ -251,4 +251,3 @@ expression: ({})
Running test: overridenArrayGetter
expression: Promise.resolve(42)
Test that descriptions for arrays, maps, and sets include the correct length or size.
Set(0)
Set(2)
Map(0)
Map(2)
Array(0)
Array(2)
Uint8Array(0)
Uint8Array(2)
Set(0)
Set(2)
Map(0)
Map(2)
Array(0)
Array(2)
Uint8Array(0)
Uint8Array(2)
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
print("Test that descriptions for arrays, maps, and sets include the correct length or size.")
Promise.all([
testExpression("new Set()"),
testExpression("new Set([1,2])"),
testExpression("new Map()"),
testExpression("new Map([[1,2],[3,4]])"),
testExpression("new Array()"),
testExpression("new Array(2)"),
testExpression("new Uint8Array()"),
testExpression("new Uint8Array(2)")
]).then(() => InspectorTest.completeTest());
function testExpression(expression) {
return Protocol.Runtime.evaluate({ expression: expression })
.then(result => InspectorTest.logMessage(result.result.result.description))
.then(() => Protocol.Runtime.evaluate({ expression: "[" + expression + "]", generatePreview: true }))
.then(result => InspectorTest.logMessage(result.result.result.preview.properties[0].value))
}
Test that Runtime.getProperties doesn't truncate set and map entries in internalProperties.
Entries for "createSet(10)"
Array(10)
Array[10]
Entries for "createSet(1000)"
Array(1000)
Array[1000]
Entries for "createMap(10)"
Array(10)
Array[10]
Entries for "createMap(1000)"
Array(1000)
Array[1000]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment