Skip to content

Instantly share code, notes, and snippets.

@imaya
Created March 28, 2014 05:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imaya/9825990 to your computer and use it in GitHub Desktop.
Save imaya/9825990 to your computer and use it in GitHub Desktop.
PhantomJS で String.fromCharCode.apply の第二引数に Typed Array を渡すとバグるのを回避
if (window.Uint8Array !== void 0) {
try {
String.fromCharCode.apply(null, new Uint8Array([0]));
} catch(e) {
String.fromCharCode.apply = (function(fromCharCodeApply) {
return function(thisobj, args) {
return fromCharCodeApply.call(String.fromCharCode, thisobj, Array.prototype.slice.call(args));
}
})(String.fromCharCode.apply);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment