Bug 154531 - Refactor DOM Iterator next signature
Summary: Refactor DOM Iterator next signature
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-22 02:28 PST by youenn fablet
Modified: 2016-02-23 01:39 PST (History)
3 users (show)

See Also:


Attachments
Patch (6.80 KB, patch)
2016-02-22 02:36 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (8.41 KB, patch)
2016-02-23 00:38 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2016-02-22 02:28:32 PST
As suggested in bug 154413, Iterator::next could be simplified to Optional<...> next() instead of bool next(...)
Comment 1 youenn fablet 2016-02-22 02:36:27 PST
Created attachment 271913 [details]
Patch
Comment 2 Myles C. Maxfield 2016-02-22 09:26:32 PST
Comment on attachment 271913 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=271913&action=review

> Source/WebCore/bindings/js/JSKeyValueIterator.h:152
> +    auto iteratorValue = m_iterator.next();

Maybe it is worth taking the same approach in the return of this function.
Comment 3 youenn fablet 2016-02-22 09:56:47 PST
(In reply to comment #2)
> Comment on attachment 271913 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=271913&action=review
> 
> > Source/WebCore/bindings/js/JSKeyValueIterator.h:152
> > +    auto iteratorValue = m_iterator.next();
> 
> Maybe it is worth taking the same approach in the return of this function.

Let's JSKeyValueIterator<JSWrapper>::next return the iterator object directly.
This way, no need for boolean/JSValue or Optional for that method.
Comment 4 youenn fablet 2016-02-23 00:38:34 PST
Created attachment 271993 [details]
Patch for landing
Comment 5 WebKit Commit Bot 2016-02-23 01:39:28 PST
Comment on attachment 271993 [details]
Patch for landing

Clearing flags on attachment: 271993

Committed r196973: <http://trac.webkit.org/changeset/196973>
Comment 6 WebKit Commit Bot 2016-02-23 01:39:31 PST
All reviewed patches have been landed.  Closing bug.