HomePhorge

(PUP-3718) Make defined function handle qualified variable names
554f692a4677Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-3718) Make defined function handle qualified variable names

The defined function can answer if a variable is defined. There
were however no tests for qualified variable names. The implementation,
when given a qualified name simply tried to lookup the complete name
in its own scope which naturally failed.

This commit adds logic to check if a variable is qualified in the
Scope#exist? method, and then mimics the behavior of a variable
lookup by splitting the name, then looking up the class and its scope
and finally delegating the exist? call to that scope.

This is made somewhat complicated when testing due to the fact how
scopes are wired (to find other names scopes). The test that checks for
the existence of a top scope variable now sets this up as if the main
class (called '') had been evaluated.

Details

Provenance
Henrik Lindberg <henrik.lindberg@cloudsmith.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU18edec0dc581: Merge pull request #3033 from i-maravic/upstart-status-fix
Branches
Unknown
Tags
Unknown

Event Timeline

Henrik Lindberg <henrik.lindberg@cloudsmith.com> committed rPU554f692a4677: (PUP-3718) Make defined function handle qualified variable names (authored by Henrik Lindberg <henrik.lindberg@cloudsmith.com>).Nov 28 2014, 1:45 AM