From kde-commits Thu Oct 02 23:42:34 2008 From: Maks Orlovich Date: Thu, 02 Oct 2008 23:42:34 +0000 To: kde-commits Subject: branches/KDE/4.1/kdelibs/kjs Message-Id: <1222990954.113104.23935.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=122299096432564 SVN commit 867166 by orlovich: Fix eval-injection of functions into local scope. Fixes the widely used s_code.js statistics(?) script, and potentially tons of other eye-gouging JS. BUG:160466 M +4 -0 nodes.cpp --- branches/KDE/4.1/kdelibs/kjs/nodes.cpp #867165:867166 @@ -975,6 +975,10 @@ // eval-injected symbols can be deleted... flags &= ~DontDelete; + // eval injected a new local into scope! Better mark that down, + // so that NonLocalResolver stops skipping the local scope + exec->variableObject()->setLocalInjected(); + // fallthrough intentional case GlobalCode: exec->variableObject()->put(exec, ident, makeFunctionObject(exec), flags);