[Project_owners] Re: JavaScript Error: "redeclaration of const JS_LIB_LOADED"

Philip Chee philip.chee at gmail.com
Mon Oct 24 01:44:14 EDT 2005


On Sun, 23 Oct 2005 08:08:26 -0700, Michael Vincent van Rantwijk wrote:

>>> if (typeof(JS_LIB_LOADED)!='boolean') {
>>> try {
>>> /*************************** GLOBALS ***************************/
>>> const JS_LIB_LOADED     = true;

>> const JS_LIB_LOADED might still be 'undefined' and in that case the 
>> check will fail.

But won't typeof() return 'undefined' and isn't 'undefined' != 'boolean'
Anyway later versions of jslib use:

if (typeof(JS_LIB_LOADED) == 'undefined')

But plugging in a recent version of jslib into Mozimage doesn't make the js
error go away.

> ....because you can't redefined a const var

Well yes, if you can redefine a constant, then it isn't a constant.

Phil
-- 
Philip Chee <philip at aleytys.pc.my>, <philip.chee at gmail.com>
http://flashblock.mozdev.org/
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]Phasers don't kill people...Unless you set them too high
* TagZilla 0.059


More information about the Project_owners mailing list