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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>22509</bug_id>
          
          <creation_ts>2013-06-28 18:17:03 +0000</creation_ts>
          <short_desc>Some way to express array as readonly and fixed length</short_desc>
          <delta_ts>2016-10-21 21:15:34 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>[v1]</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Marcos Caceres">w3c</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>bruant.d</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>d</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
    
    <cc>waldron.rick</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>90002</commentid>
    <comment_count>0</comment_count>
    <who name="Marcos Caceres">w3c</who>
    <bug_when>2013-06-28 18:17:03 +0000</bug_when>
    <thetext>Would be nice if the spec provided some way in IDL to express that an array is readonly and/or fixed length. 

http://dev.w3.org/2006/webapi/WebIDL/#idl-array

[[
Arrays can also be designated as being read only.
]]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90004</commentid>
    <comment_count>1</comment_count>
    <who name="Rick Waldron">waldron.rick</who>
    <bug_when>2013-06-28 20:54:35 +0000</bug_when>
    <thetext>Is frozen-ness insufficient?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90006</commentid>
    <comment_count>2</comment_count>
    <who name="David Bruant">bruant.d</who>
    <bug_when>2013-06-28 21:39:41 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; Would be nice if the spec provided some way in IDL to express that an array
&gt; is readonly and/or fixed length. 
Are there cases of fixed length in the platform?

(In reply to comment #1)
&gt; Is frozen-ness insufficient?
I don&apos;t think there is a WebIDL way to express that an object is frozen yet (though I agree that could be a solution here)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90015</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-06-29 02:08:42 +0000</bug_when>
    <thetext>frozen-ness is not the right thing.

The point of readonly or fixed-length arrays is to return an arraylike object to a caller with the following properties:

1)  The caller can read things from the arraylike.
2)  The caller cannot write things to the arraylike.
3)  The _callee_ can write things to the arraylike as needed.

Most cases where you&apos;d not want the callee to later modify the object just want pass-by-value semantics and actual JS arrays.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90016</commentid>
    <comment_count>4</comment_count>
    <who name="Rick Waldron">waldron.rick</who>
    <bug_when>2013-06-29 02:39:46 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; frozen-ness is not the right thing.
&gt; 
&gt; The point of readonly or fixed-length arrays is to return an arraylike
&gt; object to a caller with the following properties:
&gt; 
&gt; 1)  The caller can read things from the arraylike.
&gt; 2)  The caller cannot write things to the arraylike.
&gt; 3)  The _callee_ can write things to the arraylike as needed.
&gt; 
&gt; Most cases where you&apos;d not want the callee to later modify the object just
&gt; want pass-by-value semantics and actual JS arrays.

Got it, thanks for the clarification</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127906</commentid>
    <comment_count>5</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2016-10-21 21:15:34 +0000</bug_when>
    <thetext>We used to have this, in T[]. It was removed in favor of FrozenArray and a general movement toward a different pattern of returning a new frozen array object each time. I think we won&apos;t go back to a T[]-like world, unless ES somehow add readonly-but-not-immutable arrays as a first-class concept.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>