<?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>25986</bug_id>
          
          <creation_ts>2014-06-05 07:41:06 +0000</creation_ts>
          <short_desc>Signify JSON as a return value</short_desc>
          <delta_ts>2014-06-05 14:10:18 +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>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne">annevk</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>jackalmage</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
    
    <cc>robin</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>107321</commentid>
    <comment_count>0</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-06-05 07:41:06 +0000</bug_when>
    <thetext>Since IDL also helps (and I realize that it does not do this for everyone and that can improve upon it) with making object behavior more clear, it would be nice if there was a way to identify JSON other than using object or any.

Both XMLHttpRequest and fetch() will be able to return JSON objects. XMLHttpRequest uses any for response. fetch() will have to do the same for its Promise&lt;&gt; returned from bodyAs().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107345</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-06-05 13:02:24 +0000</bug_when>
    <thetext>Will there be processing model differences of some sort from &quot;object&quot;?  If so, what will they be?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107346</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-06-05 13:08:18 +0000</bug_when>
    <thetext>I don&apos;t think so. I thought it would be nice to indicate that something returns either JSON, a Blob, or a string. `(Blob or JSON or DOMString)` seems more clear than `any`.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107347</commentid>
    <comment_count>3</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2014-06-05 13:13:27 +0000</bug_when>
    <thetext>Agreed - having a typedef for &quot;JSON&quot; seems like it would make the signatures much easier to understand.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107348</commentid>
    <comment_count>4</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-06-05 13:14:06 +0000</bug_when>
    <thetext>If there&apos;s no particular processing model difference, why not just do &quot;typedef object JSON&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107350</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-06-05 13:31:47 +0000</bug_when>
    <thetext>Fair.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107358</commentid>
    <comment_count>6</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2014-06-05 14:10:18 +0000</bug_when>
    <thetext>(In reply to Tab Atkins Jr. from comment #3)
&gt; Agreed - having a typedef for &quot;JSON&quot; seems like it would make the signatures
&gt; much easier to understand.

It wouldn&apos;t hurt if specs that manipulate JSON in memory (i.e. not as serialised JSON) had some common terminology in order to do so. Right now it&apos;s a bit all over the place.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>