<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Web Inspector: Show upcoming values of non-native iterators"
   href="https://bugs.webkit.org/show_bug.cgi?id=152682#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Web Inspector: Show upcoming values of non-native iterators"
   href="https://bugs.webkit.org/show_bug.cgi?id=152682">bug 152682</a>
              from <span class="vcard"><a class="email" href="mailto:joepeck&#64;webkit.org" title="Joseph Pecoraro &lt;joepeck&#64;webkit.org&gt;"> <span class="fn">Joseph Pecoraro</span></a>
</span></b>
        <pre><span class="quote">&gt; If they use iterators, why are they going to have any less trouble
&gt; duplicating the iterator state than we are?</span >

Our native iterators have a wrapper and an internal object. When we peek, we create a new wrapper, with the same data as the original wrapper, advance the new wrapper, then drop it on the floor. See JSMapIterator::clone, JSSetIterator::clone, etc.

I don't think we can make the same assumptions about any user script's object. And I'm not sure we can call execute _anything_ on the user object in a way that will guarantee no side-effects, as anything can be a getter.

The cop-out, which is what I'm suggesting, is a public function with a contract of &quot;don't do side-effects, if you do it is your fault&quot;. The inspector can then call these. Problem is it requires libraries to author those functions.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>