Closed Bug 92929 Opened 23 years ago Closed 22 years ago

global variable cannot be used before it is declared

Categories

(Core :: XSLT, defect)

defect
Not set
minor

Tracking

()

VERIFIED FIXED
mozilla1.2alpha

People

(Reporter: ost, Assigned: sicking)

References

Details

(Whiteboard: TX_BRIDGE_1_1_FIXED)

Attachments

(2 files)

Hi guys !

It's me again, excuse me, but I've found something wrong about global variables - 
they cannot be used before they are declared. Now I'll try to attach simple demo
stylesheet.
Attached file Stylesheet
yes, we are severly broken when it comes to global variables (and rather broken 
for other variables as well). We should probobly evaluate global variables 
lazily. That way we can also support import precedence correctly aswell.

We also have to watch out for infinite recursions like:

 <xsl:variable name="var1" select="$var2 + 2"/>
 <xsl:variable name="var2" select="$var1 + 2"/>

Nice testcases btw ;)
Status: UNCONFIRMED → NEW
Ever confirmed: true
This is import precedence, too. Adding a dependency. Not sure which direction,
though ;-).
I guess we should have a step evalutateGlobalVariables between 
processTopLevel and process.

Axel
Depends on: 83651
OS: Windows NT → All
Hardware: PC → All
either that (there are a couple of other things we could do there too), or we 
evaluate global variables lazily.

I.e. we don't do anything when finding a variable in processTopLevel other then 
add it in the appropriate importContainer. Then when we resolve a variable, 
after we've walked up the varaible-bindings stack, we look for a global 
variable, if one exists we set it's "evaluating" flag (to prevent infinite 
recursion) and then evaluate the variable.
taking, this is fixed by my patch in bug 117658
Assignee: keith → sicking
Target Milestone: --- → mozilla1.1alpha
...
Target Milestone: mozilla1.1alpha → mozilla1.1beta
Status: NEW → ASSIGNED
Target Milestone: mozilla1.1beta → mozilla1.2alpha
fixed with the checkin from bug 117658
Whiteboard: TX_BRIDGE_1_1_FIXED
fixed with the branchlanding
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
we didn't verify for a long time.
I really checked, so VERIFIED.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: