diff --git a/lib/javascript-static.js b/lib/javascript-static.js index 8fa85e906ed..066b625ba62 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -718,7 +718,9 @@ M.util.js_watch_io(); * @return boolean - True if there is any pending js. */ M.util.js_complete = function(uniqid) { - var index = M.util.pending_js.indexOf(uniqid); + // Use the Y.Array.indexOf instead of the native because some older browsers do not support + // the native function. Y.Array polyfills the native function if it does not exist. + var index = Y.Array.indexOf(M.util.pending_js, uniqid); if (index >= 0) { M.util.complete_js.push(M.util.pending_js.splice(index, 1)); }