This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 16386 - Issue in example provided for es-sequence in WebIDL.
Summary: Issue in example provided for es-sequence in WebIDL.
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
URL: http://dev.w3.org/2006/webapi/WebIDL/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-15 09:30 UTC by Vineet Chaudhary
Modified: 2012-03-19 08:32 UTC (History)
2 users (show)

See Also:


Attachments

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