Closed
Bug 1424634
Opened 8 years ago
Closed 8 years ago
IIFE Rejected
Categories
(Web Compatibility :: Site Reports, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: omaclay, Unassigned)
References
Details
Attachments
(1 file)
|
3.09 KB,
application/x-javascript
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20171128222554
Steps to reproduce:
included this script in page, then called it to create a message box
this is the calling code:
do_message("Do you want to update the recorder playlist?",
{"text":"Update Playlist","bgcolor":"#00ff00","color":"#000000","func":go_to_update_playlist},
{"text":"No","bgcolor":"#000080","color":"#ffffff","func":go_to_admin});
Actual results:
it ignores the IIFE on line 101 - in the debugger, it skips it to the end of the script without showing any error in the console.
the 'onclick' remains undefined.
Expected results:
should have opened the dialog box (message_div) with buttons generated by the objects passed in the arguments.
this works in chrome,safari and edge. only FF rejects it.
I am stumped.
Comment 1•8 years ago
|
||
please provide a full testcase, instead of just single function.
at least the following variables are not defined in the code:
* event
* go_to_update_playlist
* go_to_admin
also there's no "onclick" that you mentioned in "Actual results"
I suspect it's from "event" variable, but I'm not sure without actual working testcase.
Flags: needinfo?(omaclay)
| Reporter | ||
Comment 2•8 years ago
|
||
hi,
you are so right!
the variable 'event' seems to be pre-declared as an event in Edge, Safari and Chrome.
if i add
e = new MouseEvent('click') before the IIFE, it works in FF (as well as the others).
i have to admit to sloppy code, but FF (and your help) corrected me.
Thanks,
O.
Flags: needinfo?(omaclay)
Comment 3•8 years ago
|
||
bug 218415 tracks adding the "event" property to the global scope. Also moving this bug to "Tech Evangelism" because other bugs depending on 218415 were also moved into that component.
Component: JavaScript Engine → Desktop
Depends on: 218415
Product: Core → Tech Evangelism
Version: 57 Branch → Firefox 57
Updated•8 years ago
|
Priority: -- → P3
Updated•8 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•7 years ago
|
Product: Tech Evangelism → Web Compatibility
You need to log in
before you can comment on or make changes to this bug.
Description
•