From c202303a29639aeb5ce05fa647ba934268848d5c Mon Sep 17 00:00:00 2001 From: David Schnur Date: Sun, 29 Jul 2012 14:20:42 -0400 Subject: [PATCH] Use a slightly better-performing string cast. --- jquery.flot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.flot.js b/jquery.flot.js index 66c5aed..6931a8b 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -943,7 +943,7 @@ // accept various kinds of newlines, including HTML ones // (you can actually split directly on regexps in Javascript, // but IE is unfortunately broken) - var lines = String(t.label).replace(/
|\r\n|\r/g, "\n").split("\n"); + var lines = (t.label + "").replace(/
|\r\n|\r/g, "\n").split("\n"); for (var j = 0; j < lines.length; ++j) { var line = { text: lines[j] }, m = ctx.measureText(line.text);