Uncaught TypeError: (intermediate value)(…) is not a function

前端 未结 7 1931
不思量自难忘°
不思量自难忘° 2020-12-02 10:42

Everything works fine when I wrote the js logic in a closure as a single js file, as:

(function(win){
   //main logic here
   win.expose1 = ....
   win.expos         


        
7条回答
  •  感动是毒
    2020-12-02 11:32

    For me it was much more simple but it took me a while to figure it out. We basically had in our .jslib

    some_array.forEach(item => {
        do_stuff(item);
    });
    

    Turns out Unity (emscripten?) just doesn't like that syntax. We replaced it with a good old for-loop and it stoped complaining right away. I really hate it that it doesn't show the line it is complaining about, but anyway, fool me twice shame on me.

提交回复
热议问题