<?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>29438</bug_id>
          
          <creation_ts>2016-02-08 22:23:37 +0000</creation_ts>
          <short_desc>JSON.stringify as invoked by wrapKey can have side-effects depending on what you pass it</short_desc>
          <delta_ts>2016-05-24 00:44:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Web Cryptography</product>
          <component>Web Cryptography API Document</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</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="Boris Zbarsky">bzbarsky</reporter>
          <assigned_to name="Mark Watson">watsonm</assigned_to>
          <cc>hhalpin</cc>
    
    <cc>public-webcrypto</cc>
    
    <cc>virginie.galindo</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>124917</commentid>
    <comment_count>0</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2016-02-08 22:23:37 +0000</bug_when>
    <thetext>The spec says:

  Let json be the result of representing key as a UTF-16 string conforming to the
  JSON grammar; for example, by executing the JSON.stringify algorithm specified
  in ECMA262.

This needs to clearly define where the objects passed to JSON.stringify are coming from, because JSON.stringify will do things like get .toJSON properties and call them, so if the objects come from the page global and someone defines a .toJSON on Object.prototype in the page, that will get invoked during this process.  Maybe the intent is that there be no observable side-effects; in that case the behavior needs to be clearly specified so as to avoid them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124918</commentid>
    <comment_count>1</comment_count>
    <who name="Ryan Sleevi">sleevi</who>
    <bug_when>2016-02-08 23:11:15 +0000</bug_when>
    <thetext>Assigning to Mark; Adding Harry and Virginie on a process point if Bugzilla or GitHub should be used and what should be done to the old links (in the TR directory)

Yes, the intent is no observable effects, and I agree, this is a defect. Do you have suggestions on how to make that unambiguous?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124922</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2016-02-09 01:38:56 +0000</bug_when>
    <thetext>What Gecko does in practice right now is that it converts the dictionary to a JS object in a new clean global, then does JSON.stringify on the result.  Since the global has clean prototypes and none of the dictionary members in this case have names that have any special meaning to the JSON.stringify algorithm this works out to no observable effects, I believe...

Another option would be a modified version of JSON.stringify with http://www.ecma-international.org/ecma-262/6.0/#sec-serializejsonproperty step 3 skipped.  I _think_ that this is sufficient to make things non-observable as well, and equivalent to the clean-global approach.  Would need careful checking.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124940</commentid>
    <comment_count>3</comment_count>
    <who name="Harry Halpin">hhalpin</who>
    <bug_when>2016-02-09 20:16:34 +0000</bug_when>
    <thetext>(In reply to Ryan Sleevi from comment #1)
&gt; Assigning to Mark; Adding Harry and Virginie on a process point if Bugzilla
&gt; or GitHub should be used and what should be done to the old links (in the TR
&gt; directory)

My guess is that we should just migrate everything to Github. We could use this as a good exercise in checking to make sure all the bugs that are still open have a closed state or at least are re-activated as we are going to make a another push on the spec. 

If someone (hint hint) wants to do that, that, this would be grand. Otherwise, I can do it over the weekend.


&gt; 
&gt; Yes, the intent is no observable effects, and I agree, this is a defect. Do
&gt; you have suggestions on how to make that unambiguous?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126548</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Watson">watsonm</who>
    <bug_when>2016-05-24 00:44:16 +0000</bug_when>
    <thetext>Moved to https://github.com/w3c/webcrypto/issues/88</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>