0

I have this code that I'm putting through the GCC in advanced compilation mode:

window.addEventListener('popstate', function (event) { .... }

I get this message:

 JSC_WRONG_ARGUMENT_COUNT: Function Window.prototype.addEventListener: called 
 with 2 argument(s). Function requires at least 3 argument(s) and no more than
 3 argument(s). at line 3601 character 0
 window.addEventListener('popstate', function (event) {

What do I need to change in my code to make it pass without warning?

Thanks

frenchie
  • 46,331
  • 96
  • 283
  • 483

1 Answers1

1

You have to set the useCapture variable of addEventListener.

This is probably what you want:

window.addEventListener('popstate', function(event) {...}, false);
Charles Ma
  • 41,485
  • 21
  • 80
  • 98