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 19580 - Callbacks need to be called asynchronously
Summary: Callbacks need to be called asynchronously
Status: RESOLVED FIXED
Alias: None
Product: WebRTC Working Group
Classification: Unclassified
Component: WebRTC API (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Web RTC Working Group
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-17 16:38 UTC by ekr
Modified: 2014-10-31 15:51 UTC (History)
4 users (show)

See Also:


Attachments

Description ekr 2012-10-17 16:38:32 UTC
Consider the following code:

console.log("1");
pc.createOffer(function(x) {
  console.log("2");
});
console.log("3");


I believe this should print out: 1 3 2

I.e., all API calls which take a callback should return prior to firing the
callback. The spec isn't really clear on this point for all of these calls, IMO, so if people agree we should update it to be clear ("queue a task...")
Comment 1 Cullen Jennings 2012-10-24 19:20:38 UTC
has this been fixed?
Comment 2 Adam Bergkvist 2012-10-26 11:33:31 UTC
I pushed a proposed fix for this.

https://github.com/fluffy/webrtc-w3c/commit/d92edbd3ade315608d46ab734fecc27632c0b786
Comment 3 Adam Bergkvist 2012-11-07 13:46:52 UTC
Based on Ekr's feedback I've updated the spec text.

https://github.com/fluffy/webrtc-w3c/commit/1198dd8784e905d88f3b29023c0d54dce10e8c11