Skip to content

Commit

Permalink
Fix exception when indexing arguments
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ptomato committed Nov 12, 2013
1 parent 38bf17a commit e130d29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Processing.js
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit e130d29

Please sign in to comment.