You would think it works just like JavaScript:
'pushState' in window.history
But this actually compiles to:
var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
__indexOf.call(window.history, 'pushState') >= 0;
What you want to do is use of
instead of in
:
'pushState' of window.history
which compiles as intended:
'pushState' in window.history;