Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

nitrogen.js "Object expected" error in IE8

#57

In Internet Explorer 8, NitrogenClass.prototype.$make_id() triggers an error:

Object expected nitrogen.js, line 110 character 2

The reason is that the "matches" variable is null when match doesn't match anything, and apply doesn't expect that. We can patch this with:

diff --git a/apps/nitrogen/www/nitrogen.js b/apps/nitrogen/www/nitrogen.js
index 3c9e17d..b9a2c5e 100644
--- a/apps/nitrogen/www/nitrogen.js
+++ b/apps/nitrogen/www/nitrogen.js
@@ -107,7 +107,9 @@ NitrogenClass.prototype.$make_id = function(element) {
     var re = new RegExp("\.wfid_(.[^\\s]*)", "g");
     while(element && element.className) {
        var matches = element.className.match(/wfid_([^\s])+/g);
-       a.unshift.apply(a, matches);
+       if (matches) {
+           a.unshift.apply(a, matches);
+       }
        element = element.parentNode;           
     }

As a matter of code hygiene, we can probably also remove the "var re = ..." line, since it doesn't appear to be used.

Reported by Brian O · April 27th, 2010 @ 12:41 PM

State: resolved
Milestone: 2.0.1
Assigned to: nobody

Activity

  1. Brian O
    Brian O

    This should be fixed with changeset 536bbf669a26d5f97526703525977135d467a550

    May 3rd, 2010 @ 04:57 PM

  2. Rusty Klophaus
    Rusty Klophaus
    • Milestone set to 2.0.1
    • State changed from new to resolved

    June 14th, 2010 @ 06:40 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.