Skip to content

Commit dfb5c85

Browse files
author
Vaughan Woodzell
committed
Check for array in a way that is safe cross-frame
instanceof doesn't work in cross-frame environments. Use toString check for array instead.
1 parent 67310a9 commit dfb5c85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jspdf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ var jsPDF = (function(global) {
12111211

12121212
if (typeof text === 'string') {
12131213
text = ESC(text);
1214-
} else if (text instanceof Array) {
1214+
} else if (Object.prototype.toString.call(text) === '[object Array]') {
12151215
// we don't want to destroy original text array, so cloning it
12161216
var sa = text.concat(), da = [], len = sa.length;
12171217
// we do array.join('text that must not be PDFescaped")

0 commit comments

Comments
 (0)