[prev in list] [next in list] [prev in thread] [next in thread]
List: kfm-devel
Subject: Re: I'm back.
From: Michael Bedy <mjbedy () mediaone ! net>
Date: 2001-01-23 2:50:14
[Download RAW message or body]
Hmm.. I just found the ecma spec online....
/me begins reading
-Mike
On Tue, 23 Jan 2001, Harri Porten wrote:
> Michael Bedy wrote:
> >
> > Hi, I'm back...
> >
> > Can someone (Harri?) tell me if the right way to fix the
> > "this.form" problem is to physically tack "this." before bare
> > "form" occurences in the script? Or is there a different way? I'm trying
> > to understand the JS stuff better.
>
> Oh. Now understand. You wanted to scan the code for "form" and prepend
> "this." ?
>
> > I have already written code to tack "this." on, and it works, but I
> > just don't know if this hack is indeed the right way to do it..
>
> Here is a possible fix for this problem (the form has to be in the scope
> chain). It works with a pure JS example I constructed. Could you give it
> a test inside Konqueror ?
>
> --- internal.cpp 2001/01/21 16:43:07 1.40
> +++ internal.cpp 2001/01/23 02:16:45
> @@ -584,8 +575,10 @@ bool KJScriptImp::evaluate(const UChar *
> Context *context = Context::current();
> context->clearError();
>
> - if (thisV)
> - Context::current()->setThisValue(thisV);
> + if (thisV) {
> + context->setThisValue(thisV);
> + context->pushScope(thisV);
> + }
>
> recursion++;
> assert(progNode);
> @@ -612,6 +605,9 @@ bool KJScriptImp::evaluate(const UChar *
> retVal = com->value().imp();
> }
> }
> +
> + if (thisV)
> + context->popScope();
>
> if (progNode)
> progNode->deleteStatements();
>
> The real fix will be to create&enter another excecution context like the
> one used for function calls instead of global code (current situation).
> Will do that tomorrow.
>
> Harri.
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic