Added polyfill for String.endsWith