summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast/leaf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/ast/leaf.rb')
-rw-r--r--lib/puppet/parser/ast/leaf.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb
index 07bba1b4c..b583149b3 100644
--- a/lib/puppet/parser/ast/leaf.rb
+++ b/lib/puppet/parser/ast/leaf.rb
@@ -16,6 +16,8 @@ class Puppet::Parser::AST
if ! options[:sensitive] && obj.respond_to?(:downcase)
obj = obj.downcase
end
+ # "" == undef for case/selector/if
+ return true if obj == "" and value == :undef
obj == value
end
@@ -125,7 +127,10 @@ class Puppet::Parser::AST
# not include syntactical constructs, like '$' and '{}').
def evaluate(scope)
parsewrap do
- return scope.lookupvar(@value)
+ if (var = scope.lookupvar(@value, false)) == :undefined
+ var = :undef
+ end
+ var
end
end