From: SourceForge.net <no...@so...> - 2006-11-28 17:02:02
|
Bugs item #1604495, was opened at 2006-11-28 15:02 Message generated for change (Settings changed) made by phmajerus You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=1604495&group_id=119701 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Interpreter Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Philippe Majerus (phmajerus) Assigned to: Mark Miesfeld (miesfeld) >Summary: orxscrpt.dll loses state between ParseScriptText calls Initial Comment: Using ooRexx version 3.1.1 MT (Nov 17 2006) through the IActiveScript interface on Windows XP Tablet PC Edition EN-US (NT 5.1.2600 SP2) platform. When the host adds several script blocks, it seems the engine doesn't keep its state between blocks. I believe this goes down to multiple successive calls to IActiveScriptParse::ParseScriptText. It seems each block is executed as a separate script instead of continuation of the existing script. It can be tested in Windows Internet Explorer using several script blocks. The attached ooRexx.hta sample can be run run with MSHTA.exe, and the script can be viewed by opening it in Notepad. Both "Object Rexx" and JScript code is included in the same file to show the expected behavior. When the 2nd Object Rexx block is executed, the i variable is lost. Active Script engines should be able to keep their state between script blocks, and so the second document~write(i) call should have the same effect as the first one. With the current version of ooRexx, it resets the variable. This makes it impossible to parse scripts in multiple blocks. ---------------------------------------------------------------------- Comment By: Philippe Majerus (phmajerus) Date: 2006-11-28 17:58 Message: Logged In: YES user_id=1655860 Originator: YES I didn't notice bug#1567599 when I checked if this error was already tracked. It definitely seems like a symptom of the same bug. ActiveScript engines are state machines, the host can change the engine state. Typically the host will init the engine using IActiveScriptParse::InitNew (or through IPersist*), make it parse text with one or several calls to ParseScriptText and other methods of the ActiveScriptParse interface for some more complex hosts (like inline script in Internet Explorer HTML's <a href=... />). There is a very good explanation of the state machine at http://blogs.msdn.com/ericlippert/archive/2004/04/10/111028.aspx The official ActiveScript interface and behavior documentation is included along with the documentation for ScrRun (Script Runtime objects), WSH (Windows Script Host), WSC (Windows Script Components) and Microsoft's script engines (JScript and VBScript). You can download it in CHM at http://www.microsoft.com/downloads/details.aspx?FamilyID=01592c48-207d-4be1-8a76-1c4099d7bbb9 You can also browse it online at http://msdn.microsoft.com/library/en-us/script56/html/4c750627-6797-4857-9f5e-e5f54371f83c.asp The engine should not lose its state until the host calls IActiveScript::Close(), which moves the engine into the SCRIPTSTATE_CLOSED state. I spent time on the other side of the IActiveScript* interfaces, creating host applications that can be scripted. I noticed this problem with both ooRexx and PHPScript (which exposes the same bug) while trying to get one of my personal projects work with as many script engines as possible, it could be usefull for testing purpose while testing this bug: http://www.phm.lu/products/MAS/ Each line gets executed using a separate call to IActiveScriptParse::ParseScriptText. Don't hesistate to contact me for any help you think I could provide for orxscrpt.dll. ---------------------------------------------------------------------- Comment By: Mark Miesfeld (miesfeld) Date: 2006-11-28 16:37 Message: Logged In: YES user_id=191588 Originator: NO Hi Philippe, I am going to take a look at this bug and bug # 1567599, which looks like a similar problem. Would you go ahead and assign this to me, miesfeld. Plus, you seem knowledgable in this area, maybe you can help fix this. You state: "Active Script engines should be able to keep their state between script blocks" Is this documented as a requirement? I can't seem to find a lot of documentation on the details of how a script engine is required to behave, do you know of any good documentation? ---------------------------------------------------------------------- Comment By: Mark Miesfeld (miesfeld) Date: 2006-11-28 16:31 Message: Logged In: YES user_id=191588 Originator: NO Hi Philippe, I am going to take a look at this bug and bug # 1567599, which looks like a similar problem. Would you go ahead and assign this to me, miesfeld. Plus, you seem knowledgable in this area, maybe you can help fix this. You state: "Active Script engines should be able to keep their state between script blocks" Is this documented as a requirement? I can't seem to find a lot of documentation on the details of how a script engine is required to behave, do you know of any good documentation? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=1604495&group_id=119701 |