Closed Bug 1424634 Opened 8 years ago Closed 8 years ago

IIFE Rejected

Categories

(Web Compatibility :: Site Reports, defect, P3)

Firefox 57
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: omaclay, Unassigned)

References

Details

Attachments

(1 file)

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.
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)
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)
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
Priority: -- → P3
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: