Ryex / ic10emu

A Stationeers IC10 code editor and emulator
https://ic10emu.dev/
Apache License 2.0
4 stars 2 forks source link

`aliases.keys().forEach is not a function` on live site in firefox #1

Closed ComputerDruid closed 3 months ago

ComputerDruid commented 3 months ago

On https://ryex.github.io/ic10emu/ , in the javascript console:

Uncaught TypeError: aliases.keys().forEach is not a function
    update webpack://ic10emu/./src/js/virtual_machine/index.js?:243
    update webpack://ic10emu/./src/js/virtual_machine/index.js?:127
    update webpack://ic10emu/./src/js/virtual_machine/index.js?:89
    updateCode webpack://ic10emu/./src/js/virtual_machine/index.js?:51
    VirtualMachine webpack://ic10emu/./src/js/virtual_machine/index.js?:27
    <anonymous> webpack://ic10emu/./src/js/index.js?:32
    setTimeout handler*docReady webpack://ic10emu/./src/js/index.js?:24
    <anonymous> webpack://ic10emu/./src/js/index.js?:30
    a https://ryex.github.io/ic10emu/main.js:696
    <anonymous> webpack://ic10emu/./src/js/index.js?:1
    js https://ryex.github.io/ic10emu/src_js_index_js.main.js:68
    __webpack_require__ https://ryex.github.io/ic10emu/main.js:633
    promise callback* webpack://ic10emu/./src/js/main.js?:12
    js https://ryex.github.io/ic10emu/main.js:609
    __webpack_require__ https://ryex.github.io/ic10emu/main.js:633
    <anonymous> https://ryex.github.io/ic10emu/main.js:1043
    <anonymous> https://ryex.github.io/ic10emu/main.js:1045

And (presumably relatedly), the editor isn't showing up at all

ComputerDruid commented 3 months ago

Ah, looks like it's because I'm using firefox: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/forEach#browser_compatibility

Sorry for not mentioning that in the initial report

Ryex commented 3 months ago

Thanks for pointing that out, I was using the map iterator completely wrong and should have tested Firefox too. I went for the solution of using forEach directly on the Map instead of on the keys iter