Added @arv's polyfill for v8-based browsers