[Webkit-unassigned] [Bug 69427] HTML canvas strokes with dash and dashOffset for V8.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 18 10:57:47 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=69427


Adam Barth <abarth at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #109794|review?, commit-queue?      |review-
               Flag|                            |




--- Comment #3 from Adam Barth <abarth at webkit.org>  2011-10-18 10:57:46 PST ---
(From update of attachment 109794)
View in context: https://bugs.webkit.org/attachment.cgi?id=109794&action=review

> Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:116
> +    v8::Local<v8::Array> result = v8::Array::New(dash->size());
> +    DashArray::const_iterator end = dash->end();
> +    int index = 0;
> +    for (DashArray::const_iterator it = dash->begin(); it != end; ++it, ++index)
> +        result->Set(v8::Integer::New(index), v8::Number::New(*it));
> +
> +    return result;
> +}

I think we already have a function that does this.  If we don't have one, you should add it.  It's a very general operation.

Also, per the recent webkit-dev thread, we should be using indicies rather than iterators to walk arrays.  That will also help you avoid the nuttiness of incrementing the iterator and the index at the same time.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list