Maximum call stack size exceeded

Dec 18, 2012 at 5:47 AM
Edited Dec 18, 2012 at 6:08 AM
hi , i try to convert highcharts.com charts to persian with this good library. this chart has many normal and unixtimestamp dates . in some of function of highcharts when i try to convert dates in google chrome i get this error : 
Uncaught RangeError: Maximum call stack size exceeded IntlDate.js:407

and in firefox browser crashed
A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.

Script: resource://firebug/firebug-service.js:3214
and in some function when i send unixtimestamp to intlDate it say sec in not defined . 

 

 

 

  1. Uncaught RangeError: Maximum call stack size exceeded
    1. IntlDateBaseEnsureFlat
    2. IntlDateBaseReset
    3. IntlDateBaseEnsureFlat
    4. IntlDateBaseReset
    5. IntlDateBaseEnsureFlat
    6. IntlDateBaseReset
    7. IntlDateBaseEnsureFlat
    8. IntlDateBaseReset
    9. IntlDateBaseEnsureFlat
    10. IntlDateBaseReset
    11. IntlDateBaseEnsureFlat
    12. IntlDateBaseReset
    13. IntlDateBaseEnsureFlat
    14. IntlDateBaseReset
    15. IntlDateBaseEnsureFlat
    16. IntlDateBaseReset
    17. IntlDateBaseEnsureFlat
    18. IntlDateBaseReset
    19. IntlDateBaseEnsureFlat
    20. IntlDateBaseReset
    21. IntlDateBaseEnsureFlat
    22. IntlDateBaseReset
    23. IntlDateBaseEnsureFlat
    24. IntlDateBaseReset
    25. IntlDateBaseEnsureFlat
    26. IntlDateBaseReset
    27. IntlDateBaseEnsureFlat
    28. IntlDateBaseReset
    29. IntlDateBaseEnsureFlat
    30. IntlDateBaseReset
    31. IntlDateBaseEnsureFlat
    32. IntlDateBaseReset
    33. IntlDateBaseEnsureFlat
    34. IntlDateBaseReset
    35. IntlDateBaseEnsureFlat
    36. IntlDateBaseReset
    37. IntlDateBaseEnsureFlat
    38. IntlDateBaseReset
    39. IntlDateBaseEnsureFlat
    40. IntlDateBaseReset
    41. IntlDateBaseEnsureFlat
    42. IntlDateBaseReset
    43. IntlDateBaseEnsureFlat
    44. IntlDateBaseReset
    45. IntlDateBaseEnsureFlat
    46. IntlDateBaseReset
    47. IntlDateBaseEnsureFlat
    48. IntlDateBaseReset
    49. IntlDateBaseEnsureFlat
    50. IntlDateBaseReset
    51. IntlDateBaseEnsureFlat
    52. IntlDateBaseReset
    53. IntlDateBaseEnsureFlat
    54. IntlDateBaseReset
    55. IntlDateBaseEnsureFlat
    56. IntlDateBaseReset
    57. IntlDateBaseEnsureFlat
    58. IntlDateBaseReset
    59. IntlDateBaseEnsureFlat
    60. IntlDateBaseReset
    61. IntlDateBaseEnsureFlat
    62. IntlDateBaseReset
    63. IntlDateBaseEnsureFlat
    64. IntlDateBaseReset
    65. IntlDateBaseEnsureFlat
    66. IntlDateBaseReset
    67. IntlDateBaseEnsureFlat
    68. IntlDateBaseReset
    69. IntlDateBaseEnsureFlat
    70. IntlDateBaseReset
    71. IntlDateBaseEnsureFlat
    72. IntlDateBaseReset
    73. IntlDateBaseEnsureFlat
    74. IntlDateBaseReset
    75. IntlDateBaseEnsureFlat
    76. IntlDateBaseReset
    77. IntlDateBaseEnsureFlat
    78. IntlDateBaseReset
    79. IntlDateBaseEnsureFlat
    80. IntlDateBaseReset
    81. IntlDateBaseEnsureFlat
    82. IntlDateBaseReset
    83. IntlDateBaseEnsureFlat
    84. IntlDateBaseReset
    85. IntlDateBaseEnsureFlat
    86. IntlDateBaseReset
    87. IntlDateBaseEnsureFlat
    88. IntlDateBaseReset
    89. IntlDateBaseEnsureFlat
    90. IntlDateBaseReset
    91. IntlDateBaseEnsureFlat
    92. IntlDateBaseReset
    93. IntlDateBaseEnsureFlat
    94. IntlDateBaseReset
    95. IntlDateBaseEnsureFlat
    96. IntlDateBaseReset
    97. IntlDateBaseEnsureFlat
    98. IntlDateBaseReset
    99. IntlDateBaseEnsureFlat
    100. IntlDateBaseReset
    101. IntlDateBaseEnsureFlat
    102. IntlDateBaseReset
    103. IntlDateBaseEnsureFlat
    104. IntlDateBaseReset
    105. IntlDateBaseEnsureFlat
    106. IntlDateBaseReset
    107. IntlDateBaseEnsureFlat
    108. IntlDateBaseReset
    109. IntlDateBaseEnsureFlat
    110. IntlDateBaseReset
    111. IntlDateBaseEnsureFlat
    112. IntlDateBaseReset
    113. IntlDateBaseEnsureFlat
    114. IntlDateBaseReset
    115. IntlDateBaseEnsureFlat
    116. IntlDateBaseReset
    117. IntlDateBaseEnsureFlat
    118. IntlDateBaseReset
    119. IntlDateBaseEnsureFlat
    120. IntlDateBaseReset
    121. IntlDateBaseEnsureFlat
    122. IntlDateBaseReset
    123. IntlDateBaseEnsureFlat
    124. IntlDateBaseReset
    125. IntlDateBaseEnsureFlat
    126. IntlDateBaseReset
    127. IntlDateBaseEnsureFlat
    128. IntlDateBaseReset
    129. IntlDateBaseEnsureFlat
    130. IntlDateBaseReset
    131. IntlDateBaseEnsureFlat
    132. IntlDateBaseReset
    133. IntlDateBaseEnsureFlat
    134. IntlDateBaseReset
    135. IntlDateBaseEnsureFlat
    136. IntlDateBaseReset
    137. IntlDateBaseEnsureFlat
    138. IntlDateBaseReset
    139. IntlDateBaseEnsureFlat
    140. IntlDateBaseReset
    141. IntlDateBaseEnsureFlat
    142. IntlDateBaseReset
    143. IntlDateBaseEnsureFlat
    144. IntlDateBaseReset
    145. IntlDateBaseEnsureFlat
    146. IntlDateBaseReset
    147. IntlDateBaseEnsureFlat
    148. IntlDateBaseReset
    149. IntlDateBaseEnsureFlat
    150. IntlDateBaseReset
    151. IntlDateBaseEnsureFlat
    152. IntlDateBaseReset
    153. IntlDateBaseEnsureFlat
    154. IntlDateBaseReset
    155. IntlDateBaseEnsureFlat
    156. IntlDateBaseReset
    157. IntlDateBaseEnsureFlat
    158. IntlDateBaseReset
    159. IntlDateBaseEnsureFlat
    160. IntlDateBaseReset
    161. IntlDateBaseEnsureFlat
    162. IntlDateBaseReset
    163. IntlDateBaseEnsureFlat
    164. IntlDateBaseReset
    165. IntlDateBaseEnsureFlat
    166. IntlDateBaseReset
    167. IntlDateBaseEnsureFlat
    168. IntlDateBaseReset
    169. IntlDateBaseEnsureFlat
    170. IntlDateBaseReset
    171. IntlDateBaseEnsureFlat
    172. IntlDateBaseReset
    173. IntlDateBaseEnsureFlat
    174. IntlDateBaseReset
    175. IntlDateBaseEnsureFlat
    176. IntlDateBaseReset
    177. IntlDateBaseEnsureFlat
    178. IntlDateBaseReset
    179. IntlDateBaseEnsureFlat
    180. IntlDateBaseReset
    181. IntlDateBaseEnsureFlat
    182. IntlDateBaseReset
    183. IntlDateBaseEnsureFlat
    184. IntlDateBaseReset
    185. IntlDateBaseEnsureFlat
    186. IntlDateBaseReset
    187. IntlDateBaseEnsureFlat
    188. IntlDateBaseReset
    189. IntlDateBaseEnsureFlat
    190. IntlDateBaseReset
    191. IntlDateBaseEnsureFlat
    192. IntlDateBaseReset
    193. IntlDateBaseEnsureFlat
    194. IntlDateBaseReset
    195. IntlDateBaseEnsureFlat
    196. IntlDateBaseReset
    197. IntlDateBaseEnsureFlat
    198. IntlDateBaseReset
    199. IntlDateBaseEnsureFlat
    200. IntlDateBaseReset
Dec 18, 2012 at 5:51 AM

and this is where sec is not Defined.

Uncaught ReferenceError: sec is not defined IntlDate.js:613

Coordinator
Dec 18, 2012 at 6:01 PM
Edited Dec 18, 2012 at 6:22 PM

Hi, can you post the code that is giving the error?

I think the 'Maximum call stack size exceeded' error happens when you use a year in the constructor which is not in the range of supported years in PersianDateValidRange(). This is not an intended behavior and I'm still trying to find a good way to workaround it. Try removing the yrMin yrMax check in PersianDate.

In PersianDateValidRange() function in Calendars\PersianDate.js change:

	yrMin = 1178;
	yrMax = 1468;
	if ((year < yrMin || year > yrMax) ||
		(month < 1 || month > 12) ||
		(day < 1 || day > this.getDaysInMonth(year, month)))
		return false;

to:

	if ((month < 1 || month > 12) ||
		(day < 1 || day > this.getDaysInMonth(year, month)))
		return false;

And see if it goes away.

 

Thanks,

Omid

Dec 19, 2012 at 4:11 AM

in this file  when i try to converting line 17231 or 616 this error come , after using your idea i think it work becuase no error come , but  in line 616 it say sec is not defined . 

 

Uncaught ReferenceError: sec is not defined IntlDate.js:613
IntlDateBaseSetMilliseconds IntlDate.js:613
getTimeTicks highstock.src.js:623
xAxis.getNonLinearTimeTicks highstock.src.js:18260
Axis.setTickPositions highstock.src.js:7180
Axis.setScale highstock.src.js:7314
(anonymous function) highstock.src.js:10797
each.Array.forEach.i highstock.src.js:1088
Chart.render highstock.src.js:10796
Chart.firstRender highstock.src.js:11005
Chart.init highstock.src.js:11089
Chart highstock.src.js:9656
Highcharts.StockChart highstock.src.js:17773
(anonymous function) index.htm:13
l jquery-1.8.3.min.js:2
c.fireWith jquery-1.8.3.min.js:2
T jquery-1.8.3.min.js:2
n.onload.n.onreadystatechange jquery-1.8.3.min.js:2
127

Coordinator
Dec 19, 2012 at 4:57 AM

Thanks for spotting that. There was a bug in IntlDateBaseSetMilliseconds that I just fixed in the code.

For converting components generally what you can do is track all the places that a new Date object is created. Search for "new Date" in the code and replace all occurrences with "new PersianDate", or use .localize() immediately after the object is constructed, depending on what the code is doing. Let the PersianDate object live in the code flow until the component expects a native date object. There you use the .toDate() or .delocalize() function to convert it back to native date and so on.

Omid

Dec 22, 2012 at 7:34 AM

ok, i wating for fixing this bug. thanks.

Coordinator
Dec 22, 2012 at 4:48 PM

Hi, it's already fixed. Did you try it?