mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Fix regression (#164)
Second lookup of an object rule without fully qualified path, resulted in returning the object instead of the requested field. Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
committed by
GitHub
parent
595f9d34d5
commit
fbfed6b49c
@@ -2561,7 +2561,8 @@ impl Interpreter {
|
||||
path.push(name.text());
|
||||
|
||||
if self.is_processed(&path)? {
|
||||
return Ok(Self::get_value_chained(self.data.clone(), &path));
|
||||
let value = Self::get_value_chained(self.data.clone(), &path);
|
||||
return Ok(Self::get_value_chained(value, fields));
|
||||
}
|
||||
|
||||
// Ensure that all the rules having common prefix (name) are evaluated.
|
||||
|
||||
@@ -36,7 +36,7 @@ cases:
|
||||
true: false,
|
||||
[1, 3] : {"hello", "world"}
|
||||
}
|
||||
|
||||
|
||||
query: data.test
|
||||
want_result:
|
||||
array: [1, 2, 3]
|
||||
@@ -71,5 +71,19 @@ cases:
|
||||
set!:
|
||||
- "hello"
|
||||
- "world"
|
||||
|
||||
|
||||
|
||||
|
||||
- note: value chain (unqualified)
|
||||
data: {}
|
||||
modules:
|
||||
- |
|
||||
package test
|
||||
|
||||
a = {
|
||||
"b" : 5
|
||||
}
|
||||
x = a.b
|
||||
# The second look up must also produce the same value.
|
||||
y = a.b
|
||||
query: data.test.y
|
||||
want_result: 5
|
||||
|
||||
Reference in New Issue
Block a user