From e130d29b7c5c81f0d554ffe571a9b1054f00e0a6 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Mon, 11 Nov 2013 17:09:53 -0800 Subject: [PATCH] Fix exception when indexing arguments When calling "fill(255, 255, 255)" with no alpha argument, running on recent versions of the Javascriptcore engine (e.g. in the Epiphany browser with WebKit 2.2.1), Processing tries to access arguments[3] which throws an exception. Apparently earlier versions of Javascriptcore allowed this. --- src/Processing.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Processing.js b/src/Processing.js index 6105650bd..d3b983fd6 100755 --- a/src/Processing.js +++ b/src/Processing.js @@ -6311,7 +6311,7 @@ * @see #colorMode() */ DrawingShared.prototype.fill = function() { - var color = p.color(arguments[0], arguments[1], arguments[2], arguments[3]); + var color = p.color.apply(this, arguments); if(color === currentFillColor && doFill) { return; } @@ -6381,7 +6381,7 @@ * @see #colorMode() */ DrawingShared.prototype.stroke = function() { - var color = p.color(arguments[0], arguments[1], arguments[2], arguments[3]); + var color = p.color.apply(this, arguments); if(color === currentStrokeColor && doStroke) { return; }