Version: (using KDE Devel) Installed from: Compiled sources OS: Linux The following script should display "3" rather than "[object window]": var top; top = 3; alert(top);
Created attachment 10735 [details] Testcase
Uhm, Stephan, did you notice who filed the bug? I think he can tell KJS core vs. bindings :-)
SVN commit 419021 by porten: fixed override of properties on variable declarations. Not sure if this is the complete story, yet, but it is a beginning. BUGS:104181 M +5 -0 ChangeLog M +4 -1 nodes.cpp --- trunk/KDE/kdelibs/kjs/ChangeLog #419020:419021 @@ -1,3 +1,8 @@ +2005-05-28 Harri Porten <porten@kde.org> + + * nodes.cpp: fixed override of properties on variable + declarations. See bug report #104181. + 2005-05-16 Harri Porten <porten@kde.org> * removed remaining use of deprecated Value::isNull(). --- trunk/KDE/kdelibs/kjs/nodes.cpp #419020:419021 @@ -1763,7 +1763,8 @@ val = init->evaluate(exec); KJS_CHECKEXCEPTIONVALUE } else { - if ( variable.hasProperty(exec, ident ) ) // already declared ? + // ### check attributes? reuse check done in processVarDecls()? + if (variable.imp()->getDirect(ident)) // already declared ? return Value(); val = Undefined(); } @@ -1789,6 +1790,8 @@ void VarDeclNode::processVarDecls(ExecState *exec) { Object variable = exec->context().variableObject(); + // ### use getDirect()? Check attributes? + // ### avoid duplication with actions performed in evaluate()? if ( !variable.hasProperty( exec, ident ) ) { // already declared ? int flags = None; if (exec->_context->type() != EvalCode)