From ffcfe55fb58b76cc4bd65738573fb74fe917c265 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 9 Jul 2016 17:04:54 -0700 Subject: [PATCH] Don't put regular parameters after default ones, and $.globalEval -> $.global. --- src/General/Polyfill.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/General/Polyfill.coffee b/src/General/Polyfill.coffee index df2f7c030..6bb91c3ad 100644 --- a/src/General/Polyfill.coffee +++ b/src/General/Polyfill.coffee @@ -1,9 +1,11 @@ Polyfill = init: -> @toBlob() + $.global @toBlob + return toBlob: -> return if HTMLCanvasElement::toBlob - HTMLCanvasElement::toBlob = (cb, type='image/png', encoderOptions) -> + HTMLCanvasElement::toBlob = (cb, type='image/png', encoderOptions=null) -> url = @toDataURL type, encoderOptions data = atob url[url.indexOf(',')+1..] # DataUrl to Binary code from Aeosynth's 4chan X repo @@ -12,4 +14,4 @@ Polyfill = for i in [0...l] by 1 ui8a[i] = data.charCodeAt i cb new Blob [ui8a], {type} - $.globalEval "HTMLCanvasElement.prototype.toBlob = (#{HTMLCanvasElement::toBlob});" + return