Closed Bug 1770540 Opened 2 years ago Closed 2 years ago

JavaScript error: resource:///modules/calendar/Ical.jsm, line 5595: InternalError: too much recursion logged to console during browser_alarmDialog.js

Categories

(Calendar :: General, defect)

defect

Tracking

(Not tracked)

RESOLVED FIXED
102 Branch

People

(Reporter: lasana, Assigned: lasana)

Details

Attachments

(1 file)

The ical.js backend contains a circular reference and throws an exception if you try to JSON.stringify() it. It would be better to provide the toString() value instead.

JavaScript error: resource:///modules/calendar/Ical.jsm, line 5595: InternalError: too much recursion                                  
 0:14.10 PASS [object XULElement] == true -           
 0:14.14 INFO Console message: [JavaScript Error: "InternalError: too much recursion" {file: "resource:///modules/calendar/Ical.jsm" line: 5595}]
icaltime_adjust@resource:///modules/calendar/Ical.jsm:5595:37
setTimeAttr@resource:///modules/calendar/Ical.jsm:5792:18                     
fromData@resource:///modules/calendar/Ical.jsm:5015:13
icaltime@resource:///modules/calendar/Ical.jsm:4877:10
clone@resource:///modules/calendar/Ical.jsm:4927:14                           
startOfWeek@resource:///modules/calendar/Ical.jsm:5103:25
get startOfWeek@resource:///components/calDateTime.js:164:45
getMessage@resource://testing-common/Assert.jsm:77:19                                                                                                         
Assert.AssertionError@resource://testing-common/Assert.jsm:122:18                                                                                             
proto.report@resource://testing-common/Assert.jsm:215:13       
proto.ok@resource://testing-common/Assert.jsm:254:10

I think what's happening here is that get startOfWeek returns a datetime instance which has no toJSON() method built in so it will go through structured cloning which will result in get startOfWeek being called again and again until we hit too much recursion. These getters really are a gentle path to chaos.

Attachment #9277611 - Attachment description: WIP: Bug 1770540 - Add toJSON() to calDateTime api for better stringifying. r=#thunderbird-reviewers → Bug 1770540 - Add toJSON() to calDateTime api for better stringifying. r=#thunderbird-reviewers
Status: NEW → ASSIGNED
Target Milestone: --- → 102 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/5d041abce5e6
Add toJSON() to calDateTime api for better stringifying. r=thunderbird-reviewers,darktrojan

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: