<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>145190</bug_id>
          
          <creation_ts>2015-05-19 15:50:23 -0700</creation_ts>
          <short_desc>Web Inspector: Improve TypedArray view in console - show non-index properties (buffer)</short_desc>
          <delta_ts>2026-01-12 09:01:29 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>graouts</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>jonowells</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1096075</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-05-19 15:50:23 -0700</bug_when>
    <thetext>* SUMMARY
Improve TypedArray view in console - show non-index properties (buffer, byteLength, byteOffset).

* TEST
var buffer = new ArrayBuffer(12);
var dataView = new DataView(buffer);
var int8View = new Int8Array(buffer);
console.log(buffer);
console.log(dataView);
console.log(int8View); // &lt;---

We treat the TypedArrays, like Int8Array here, as arrays.

In previews we may ignore non-index properties. But even when expanding (console.dir(int8View)) we only show the indices and don&apos;t show the buffer/byteLength/byteOffset value properties which may be useful.


* NOTES
- InjectedScriptSource.js possible changes to mark as non-lossy.

    // For arrays, only allow indexes. Mark as lossy if there are non-obvious value properties.
    if (this.subtype === &quot;array&quot; &amp;&amp; !isUInt32(name)) {
        if (name !== &quot;length&quot; &amp;&amp; name !== &quot;constructor&quot; &amp;&amp; descriptor.isOwn &amp;&amp; !descriptor.symbol &amp;&amp; &quot;value&quot; in descriptor &amp;&amp; typeof descriptor.value !== &quot;function&quot;)
            preview.lossless = false;
        continue;
    }

- Would still require frontend changes for an ObjectTree for &quot;array&quot; subtype to also show non-index properties. Perhaps in a new section beneath the #s, but before the Prototype.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1096076</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-05-19 15:51:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/21028103&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1096080</commentid>
    <comment_count>2</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-05-19 15:55:53 -0700</bug_when>
    <thetext>Another more basic example:

    var arr = [1, 2, 3];
    arr.myProperty = &quot;test&quot;;
    console.dir(arr); // resulting object tree never shows the &quot;myProperty&quot;

Technically this is a regression. The old object trees would show this property.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>