On 2014/08/20 18:07:07, arv wrote:
https://codereview.chromium.org/486763002/diff/20001/src/string-iterator.js
File src/string-iterator.js (right):


https://codereview.chromium.org/486763002/diff/20001/src/string-iterator.js#newcode49
src/string-iterator.js:49: if (s === stringEndOfIterationMarker) {
On 2014/08/20 17:01:37, Dmitry Lomov (chromium) wrote:
> On 2014/08/20 15:39:26, arv wrote:
> > On 2014/08/20 15:32:53, wingo wrote:
> > > Wouldn't stringEndOfIterationMarker be per-realm?  I always get this
stuff
> > > wrong.
> >
> > You are right. This is not going to work.
>
> Thanks, good catch, I haven't thought of that.
> >
> > I don't see why we cannot continue to use undefined here?
>
> It's because I have changed the HAS_PRIVATE above to essentially
>   iterator[stringIteratorIteratedStringSymbol] === undefined
> There are two things I could do:
> 1) Either keep using %HasOwnProperty above (runtime call)
> 2) Or use a different symbol for branding (string iterators bigger by 1
field)
>
> Opinions?
>

In this case and for the ArrayIterator we can check
stringIteratorNextIndexSymbol instead. We set this to 0 in
CreateStringIterator
so the "brand" check can be changed to !IS_UNDEFINED(GET_PRIVATE(iterator,
stringIteratorNextIndexSymbol)), which I goes is what HAS_DEFINED_PRIVATE
does.

Right, thanks, will do.

https://codereview.chromium.org/486763002/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to