diff Lib/IMPL/DOM/Navigator.pm @ 368:010ceafd0c5a

form metadata + tests
author cin
date Wed, 04 Dec 2013 17:31:53 +0400
parents 4ddb27ff4a0b
children
line wrap: on
line diff
--- a/Lib/IMPL/DOM/Navigator.pm	Tue Dec 03 17:55:36 2013 +0400
+++ b/Lib/IMPL/DOM/Navigator.pm	Wed Dec 04 17:31:53 2013 +0400
@@ -129,12 +129,11 @@
 
 sub Back {
     my ($this,$steps) = @_;
+    
     if ($this->{$_path} and @{$this->{$_path}}) {
-        if ( (not $steps) || $steps == 1) {
+        if ( (not defined $steps) || $steps == 1) {
             $this->{$_state} = pop @{$this->{$_path}};
-        } else {
-            $steps ||= 1;
-            
+        } elsif ($steps > 0) {
             $steps = @{$this->{$_path}} - 1 if $steps >= @{$this->{$_path}};
             
             $this->{$_state} = (splice @{$this->{$_path}},-$steps)[0];