Closed Bug 520092 Opened 15 years ago Closed 12 years ago

client.plugins should be an object (dictionary) not an array.

Categories

(Other Applications :: ChatZilla, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Gijs, Assigned: Gijs)

Details

(Whiteboard: [cz-0.9.89])

Attachments

(1 file)

7.12 KB, patch
bugzilla-mozilla-20000923
: review+
Details | Diff | Splinter Review
      No description provided.
Uh, Bugzilla sucks. Otherwise, see the summary.
Severity: normal → enhancement
Status: NEW → ASSIGNED
Summary: client → client.plugins should be an object (dictionary) not an array.
Attached patch PatchSplinter Review
This seems to work.

The only thing I'm not 100% sure about is if plugin prefs are migrated correctly like this. AFAICT they are stored by ID so there shouldn't be issues, but I could be wrong.
Attachment #619368 - Flags: review?(silver)
Comment on attachment 619368 [details] [diff] [review]
Patch

Review of attachment 619368 [details] [diff] [review]:
-----------------------------------------------------------------

::: xul/content/commands.js
@@ +1974,1 @@
>      }

Nit: drop the for's braces.

@@ +2581,5 @@
>          if (typeof rv == "function")
>              rvStr = "function";
>  
> +        if (!plugin.id)
> +            plugin.id = 'plugin' + Date.now() + Math.floor(Math.random() * 100)

plugin.id = 'plugin' + randomString(8);

I guess you could use the time too, but I don't think it'd be necessary with 62^8 values.

::: xul/content/static.js
@@ +809,5 @@
>  function getPluginById(id)
>  {
> +    if (id in client.plugins) {
> +      return client.plugins[id];
> +    }

Nit: drop the if's braces (opening should be on a new line if kept too).

@@ +814,1 @@
>      return null;

Could collapse the entire function to: return client.plugins[id] || null; I think.
Attachment #619368 - Flags: review?(silver) → review+
Fix checked in with nits (and then some): http://hg.mozilla.org/chatzilla/rev/e3c672afa43c
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [cz-0.9.89]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: