Bug 16386 - Issue in example provided for es-sequence in WebIDL.
Issue in example provided for es-sequence in WebIDL.
Status: RESOLVED FIXED
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL
unspecified
PC Linux
: P2 normal
: ---
Assigned To: Cameron McCormack
public-webapps-bugzilla
http://dev.w3.org/2006/webapi/WebIDL/...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-15 09:30 UTC by Vineet Chaudhary
Modified: 2012-03-19 08:32 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vineet Chaudhary 2012-03-15 09:30:20 UTC
In the example given on link http://dev.w3.org/2006/webapi/WebIDL/#es-sequence there the example illustrates the ECMAScript implementation.
Here

// This evaluates to false.
canvas.getSupportedImageCodecs() == canvas.getSupportedImageCodecs();

Should be 
// This evaluates to true.
canvas.getSupportedImageCodecs()[0] == canvas.getSupportedImageCodecs();

Else
// This evaluates to false.
supportedImageCodecs[0] == canvas.getSupportedImageCodecs();
Comment 1 Cameron McCormack 2012-03-19 08:32:16 UTC
Hi Vineet, thanks for the comment, but the example is correct.  Operations that return a sequence<T> type will create a new JS Array object each time the Function is called.  I've mentioned this now in the comment:

http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.xml.diff?r1=1.482;r2=1.483;f=h