Open Bug 638040 Opened 14 years ago Updated 2 years ago

Operation callback functions should take a closure pointer

Categories

(Core :: JavaScript Engine, defect)

defect

Tracking

()

People

(Reporter: jimb, Unassigned)

References

(Blocks 1 open bug)

Details

When setting an operation callback, it should be possible to provide a pointer to be passed through to the function, so that operation callback functions wouldn't necessarily need to rely on global variables or JSContext-specific data to do their job. If we wanted to be typesafe in high C++ fashion, we could replace the operation callback function with an instance of a class derived from something like: class OperationCallback { virtual Invoke(JSContext *cx); }; Then the 'this' argument would do the job of the proposed closure argument.
Assignee: general → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.