JosephMajaseSithole / datejs

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

Stackoverflow in IE7 when _toString is called without any parameters #64

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. In IE7 call date.toString() without any format parameter
2. IE7 will report a stackoverflow
3.

What is the expected output? What do you see instead?
- A formatted date

What version of the product are you using? On what operating system?
- On a trunk version of datejs from 3/5/2009 and IE7 on windows vista

Please provide any additional information below.
- The YUI calendar control is storing a date inside of an object property.
When that is done on IE7, it seems to be calling an implicit .toString() on
the date object.

When this is done the _toString function defined in core.js gets into a
recurive loop and keeps going until a stackoverflow happens.

There should be some sort of default format or a way to not get into a
recursive loop.

Original issue reported on code.google.com by jeff.pen...@gmail.com on 5 Mar 2009 at 7:24

GoogleCodeExporter commented 8 years ago
If you change the function definition of toString to something else (line 73 
and 151) of DateJs.js then it works.

(See attachment)

Original comment by thomas.v...@gmail.com on 5 Apr 2011 at 2:18

Attachments:

GoogleCodeExporter commented 8 years ago
Reads like my Issue 143 which as it turns out is solved by

Change 

Date.prototype._toString=Date.prototype.toString;

to

if(Date.prototype._toString==undefined) 
{Date.prototype._toString=Date.prototype.toString;}

Original comment by philj...@hotmail.com on 26 Jan 2012 at 12:36

GoogleCodeExporter commented 8 years ago
fixed in my fork:
https://github.com/abritinthebay/datejs/

Original comment by darkcr...@gmail.com on 14 Sep 2013 at 8:15