Skip to content

Commit 7a67db7

Browse files
committed
Remove aribtrary depth limit for dot traversal. Close #165
1 parent e04c7dd commit 7a67db7

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

lib/scope.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,6 @@ define(function(require) {
452452
function resolveDeepName(name, scope) {
453453
var parts = name.split('.');
454454

455-
if(parts.length > 2) {
456-
return when.reject(new Error('Only 1 "." is allowed in refs: ' + name));
457-
}
458-
459455
return when.reduce(parts, function(scope, segment) {
460456
return segment in scope
461457
? scope[segment]

test/node/refs-test.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,26 +156,16 @@ buster.testCase('refs', {
156156
);
157157
},
158158

159-
'should allow 1 level of dot traversal for nested references': function() {
159+
'should allow dot traversal for nested references': function() {
160160
return wire({
161-
a: { b: true },
162-
success: { $ref: 'a.b' }
161+
a: { b: { c: true } },
162+
success: { $ref: 'a.b.c' }
163163
}).then(
164164
function(context) {
165165
assert(context.success);
166166
},
167167
fail
168168
);
169-
},
170-
171-
'should not allow > 1 level of dot traversal': function() {
172-
return wire({
173-
a: { b: { c: true } },
174-
success: { $ref: 'a.b.c' }
175-
}).then(
176-
fail,
177-
function() { assert(true); }
178-
);
179169
}
180170

181171
});

0 commit comments

Comments
 (0)