Closed
Bug 473861
Opened 15 years ago
Closed 15 years ago
Workers: Using functions (rather than attributes) for message/error handlers doesn't work
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.9.1
People
(Reporter: bent.mozilla, Assigned: bent.mozilla)
Details
(Keywords: fixed1.9.1)
Attachments
(1 file)
5.63 KB,
patch
|
mrbkap
:
review+
mrbkap
:
superreview+
sicking
:
approval1.9.1+
|
Details | Diff | Splinter Review |
Workers currently must use this syntax for the message/error handlers: onmessage = function(event) { ... } It would be cooler if they could also do this: function onmessage(event) { ... } Patch attached that does this. And it has tests!
Attachment #357271 -
Flags: superreview?(jst)
Attachment #357271 -
Flags: review?(jst)
Attachment #357271 -
Flags: approval1.9.1?
Attachment #357271 -
Flags: approval1.9.1? → approval1.9.1+
Comment 1•15 years ago
|
||
Comment on attachment 357271 [details] [diff] [review] Patch, v1 >diff --git a/dom/src/threads/nsDOMWorker.cpp b/dom/src/threads/nsDOMWorker.cpp >+ JSObject* funObj; >+ if (!(JSVAL_IS_STRING(aId) && >+ JSVAL_IS_OBJECT(*aVp) && >+ (funObj = JSVAL_TO_OBJECT(*aVp)) && >+ JS_ObjectIsFunction(aCx, funObj))) { Nit: This line is under-indented by one space. r+sr=mrbkap with that.
Attachment #357271 -
Flags: superreview?(jst)
Attachment #357271 -
Flags: superreview+
Attachment #357271 -
Flags: review?(jst)
Attachment #357271 -
Flags: review+
Assignee | ||
Comment 2•15 years ago
|
||
(In reply to comment #1) It's correct :)
Assignee | ||
Comment 3•15 years ago
|
||
Pushed revision 3783169ac623 to mozilla-central.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 4•15 years ago
|
||
Pushed revision 0bd3d851a214 to mozilla-1.9.1.
Keywords: fixed1.9.1
Updated•11 years ago
|
Component: DOM: Mozilla Extensions → DOM
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•