davidmarklafleur / ijp

Automatically exported from code.google.com/p/ijp
0 stars 0 forks source link

ijp does not correctly parse file #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. download http://www.burlington.manchester.ac.uk/Burlington.ics
2. write an ijp test harness and try to parse the above file
3. ijp code crashes javascript interpreter

What is the expected output? What do you see instead?

expect a JS object containing the iCal data. Get nothing.

What version of the product are you using? On what operating system?

ijp-0.5 interpreted by either Safari 5.0.2 or Firefox 3.6.12 on MacOSX 10.5.8 
parsing an iCal file created with Apple iCal 3.0.8

Please provide any additional information below.

As far as I can see, you have two problems in the code:

1) "class" is a reserved word with some javascript interpreters -- consider 
using "klass" instead

2) circa line 200, if pair[1] already contains quote marks (") -- which it does 
in the ics file above -- then adding them again on line 204:

code+=pair[0].replace(/-/,'')+' : "'+pair[1]+'", ';

causes the code to crash when it encounters two sets of quotes together in the 
eval statement on line 206.

I have fixed both of these in the version I am now using at 
http://www.burlington.manchester.ac.uk/javascripts/ijp-0.5.js

and attach my patch.

Original issue reported on code.google.com by burli...@googlemail.com on 16 Nov 2010 at 8:46

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by lec...@gmail.com on 9 Dec 2010 at 11:25

GoogleCodeExporter commented 9 years ago
It's weird to write "klass" to avoid non-standard reserved word.

Nevertheless, I think we could avoid the clash by writing the property name 
definition like this:

var journal={
   "class":this.getValue('CLASS',vjournalString),.....

Original comment by laps...@gmail.com on 10 Nov 2013 at 5:33

GoogleCodeExporter commented 9 years ago
ijp-0.7 correctly parse this ical file

Original comment by lec...@gmail.com on 31 Jul 2014 at 1:31

Attachments: