[Bug 11172] wouldn't it be better to return the context handler instead of void, making "context.moveTo(x1,y1).lineTo(x2,y2).lineTo..." possible and easier?

http://www.w3.org/Bugs/Public/show_bug.cgi?id=11172

--- Comment #3 from Aryeh Gregor <Simetrical+w3cbug@gmail.com> 2010-11-01 20:00:30 UTC ---
This is nice in jQuery because it sometimes lets you avoid naming extra
variables, e.g. (actual code sample I was just looking at)

  $("body").append("<script></script>").attr("src", foo);

rather than

  var script = document.createElement("script");
  script.src = foo;
  document.body.appendChild(script);

which is necessary when using DOM methods because "script.src = foo" and the
equivalent setAttribute() call don't return the element they're operating on,
so you need an explicit temporary variable.  But almost any real-world canvas
use is going to want to keep around a context handler anyway, so it doesn't
look like there's any gain here.  (Although I don't see the harm either.)

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 1 November 2010 20:00:33 UTC