base2-dom slow to load in Firefox - firebug + javascript.options.strict = true are the culprits

Skip to the first unread message

Alex Robinson

26 Aug 2007, 13:56:5626/08/2007
Short version

The current version of Base2 (timestamp: Fri, 10 Aug 2007 20:00:50)
will load extremely slowly in Firefox if you have Firebug enabled and
the preference javascript.options.strict set to true.

Set javascript.options.strict to false

Long version

I just started using the latest version of Base2 in subversion. And
it's taking 35 seconds plus just to load the Dom part of Base2.

In Firefox ( with Firebug (1.05) enabled and the preference
javascript.options.strict set to true, that is. Disable Firebug or
set the strict pref to false and it loads up ok, ( ~600ms vs
~36000ms). (All other browsers obviously are unaffected)

To reproduce the problem, toggle the javascript.options.strict
preference and visit the following pages.

Loading Base2 locally

and externally from Google repository (just to check not a local
glitch on my part)

gives pretty much the same results:

(just to be clear, the slow loading is happening when the profiling is off)

On the other hand, using a previous version of Base2 loads just fine
and snappy, even if strict mode is on.
// timestamp: Tue, 03 Jul 2007 20:32:36

You can see why it takes longer if you compare the console output
from the current and the old versions.

Patching base2.js as suggested below...

< if (object.extend == extend && /^(base|extend)$/.test(key)) {
> if (object.extend && object.extend == extend &&
>/^(base|extend)$/.test(key)) {
< while (fn && fn.ancestor != ancestor) fn = fn.ancestor;
> while (fn && (!fn.ancestor || fn.ancestor != ancestor)) fn =
>fn.ancestor ? fn.ancestor : undefined;

... makes the glacial speed issues go away, but seeing as my
javascript foo is not so great, I assume that breaks stuff left,
right and centre. It certainly opens up a new wave of warnings from
functions not always returning a value and hiding of arguments and

Warning: reference to undefined property Native.prototype[name]
Source File:
Line: 959

--> INative[name] = unbind(Native.prototype[name]);

Not knowing what the project's position is on strictness, and given
my foo, it seems a good point at which to stop my amateur sleuthing,
though I hope it has been of some help.

In the meantime, the trivial solution is just to make sure that
javascript.option.strict is set to false. Or alternatively use
Console2 to filter the error console messages

Alex Robinson

28 Aug 2007, 12:25:0128/08/2007
to base2-js
> Solution:
> Set javascript.options.strict to false

Just to be painstakingly clear, I meant that is the short term
solution so that you can actually keep working until Dean fixes things
up. Not that you should set javascript.option.strict to false forever
and ever.

Dean Edwards

28 Aug 2007, 13:13:4928/08/2007

I am fixing this in the base2 core as Alex mentioned:


Reply all
Reply to author
0 new messages