Closed Bug 601474 Opened 14 years ago Closed 14 years ago

"Reference to undefined property" although property is defined causes errors in calling code.

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME
Tracking Status
blocking2.0 --- -

People

(Reporter: Fallen, Unassigned)

Details

I'm not quite sure if this is an xpconnect or javascript bug and am having trouble finding a reduced testcase, but here we go anyway: STR: ---- * Get Thunderbird Trunk <ftp://ftp.mozilla.org/pub/thunderbird/nightly/latest-comm-central-trunk/> * Install Lightning Trunk <ftp://ftp.mozilla.org/pub/calendar/lightning/nightly/latest-comm-central/> * Start Thunderbird, open the error console. RESULTS: -------- * See lots of messages like: Warning: reference to undefined property getTimezoneService().defaultTimezone Source File: chrome://calendar/content/calUtils.js Line: 220 The lines affected are: function calendarDefaultTimezone() { return getTimezoneService().defaultTimezone; } WORKAROUND: ----------- * For some reason, changing the above lines as follows doesn't cause a strict warning: function calendarDefaultTimezone() { let tzs = getTimezoneService(); return tzs.defaultTimezone; } Expected, obviously, would be no strict warning.
Version: 1.9.2 Branch → Trunk
I'm surprised Firefox doesn't seem to have this, or maybe I just can't find the duplicate. While the workaround is easy at least in this case, this does seem to be a regression from something and I think it should be fixed for 2.0 since its not really obvious to extension developers why their code causes warnings.
blocking2.0: --- → ?
blocking2.0: ? → -
Please reconsider the blocking status. I admit the title wasn't quite clear: While whats directly visible from this bug is merely a warning, the effect it causes is really an error: since the property said not to be defined (although it is, see workaround!), other code fails hard. This can be quite confusing for extension developers, so I'd suggest to reconsider.
Summary: Strict warning (reference to undefined property) when accessing property of xpcom component → "Reference to undefined property" although property is defined causes errors in calling code.
Philipp, with the fixes to trunk on bug 621136 / bug 621138 (which don't touch this code), all is working fine for me. Do you still see an issue with this code? I wonder if one of the recent tracemonkey merges fixed it.
Not getting this at the moment, closing until it re-appears.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.