Khronos Public Bugzilla
Bug 859 - WebCL callbacks do not need userdata argument
Summary: WebCL callbacks do not need userdata argument
Status: RESOLVED FIXED
Alias: None
Product: WebCL
Classification: Unclassified
Component: Specification (show other bugs)
Version: 1.0
Hardware: PC Linux
: P3 normal
Target Milestone: ---
Assignee: WebCL Mailing List
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-26 11:20 PDT by Igor Oliveira
Modified: 2013-06-06 08:57 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Oliveira 2013-04-26 11:20:57 PDT
In javascript is not common to have callbacks with userdata parameter, since in JS the user can access the data outside the callback. All Web API's does not have an user data parameter e.g:

var soundArray;
var context = new webkitAudioContext();
function loadSound(soundName) {
    var request = new XMLHttpRequest();
    request.open('GET',soundName);
    request.responseType = 'arraybuffer';
    request.onload = function() {
            context.decodeAudioData(this.response, function(buf) {
                sounds[soundName] = buf;
            },function(err) { console.log("err(decodeAudioData): "+err); });
    }
    request.send();
}
Comment 1 Tomi Aarnio 2013-04-26 13:07:51 PDT
> In javascript is not common to have callbacks with userdata parameter, since
> in JS the user can access the data outside the callback.

You're absolutely right (it's called "lexical scoping"). 

I support Igor's proposal to remove the userdata parameters, and will do so unless someone comes up with a compelling counter-argument.
Comment 2 Tomi Aarnio 2013-06-06 08:57:39 PDT
(In reply to comment #1)

> I support Igor's proposal to remove the userdata parameters, and will do so
> unless someone comes up with a compelling counter-argument.

Fixed as proposed.