CyrusOfEden / CSV.js

A simple, blazing-fast CSV parser and encoder. Full RFC 4180 compliance.
MIT License
1.54k stars 95 forks source link

Internet Explorer: "Invalid calling object" #24

Closed NathanSmutz closed 10 years ago

NathanSmutz commented 10 years ago

In Interned Explorer 11, I get an Invalid Calling Object error when executing the following code:

var op_val_objects      = new CSV(op_val_string, {lineDelimiter: "\n", header: true}).parse();

Where op_val_string is the following string:

"option,value
Cap,1
Trim,2
Post Caps,4
Top Trim,8
Overlap,16
Good Neighbor,32"

Here's the error: SCRIPT65535: Invalid calling object File: csv.js, Line: 13, Column: 5

Here's the referenced line in context:

 function isArray(object) {
    return toString.call(object) == '[object Array]';  // This is line 13
  }

I suspect that this might come from Internet Explorer not supporting "call" on many types of object that the other browsers commonly do. It seems I've seen reports of this kind of trouble with DOM objects; but I'm not sure if the same conditions apply here.

CyrusOfEden commented 10 years ago

I've updated csv.js and csv.min.js on the repo to work in IE by using Array.isArray. Bower/npm update incoming.