Skip to content

Commit

Permalink
hopefully this resolves #1558 for good
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrthomas committed Jun 18, 2021
1 parent c78620b commit 391e4c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1930,10 +1930,12 @@ public Variable call(Variable called, Variable arg, boolean sharedScope) {
case JAVA_FUNCTION:
return arg == null ? executeFunction(called) : executeFunction(called, new Object[]{arg.getValue()});
case FEATURE:
// will be always a map or a list of maps (loop call result)
// will be always a map or a list of maps (loop call result)
Object callResult = callFeature(called.getValue(), arg, -1, sharedScope);
recurseAndAttach(callResult);
return new Variable(callResult);
synchronized (runtime.featureRuntime.suite) { // make sure any artifacts from a callonce / callsingle are handled
recurseAndAttach(callResult);
return new Variable(callResult);
}
default:
throw new RuntimeException("not a callable feature or js function: " + called);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Background:
* def data = [ { name: 'value1' }, { name: 'value2' }, { name: 'value3' }, { name: 'value4' } ]
# java object that comes from a callSingle in the config
* def helloClass = HelloConfigSingle
* callonce read('call-once-from-feature.feature')
* callonce read('call-once-from-feature.feature')

Scenario Outline:
# * call read('called.feature')
* call read('called.feature')
* match functionFromKarateBase() == 'fromKarateBase'
* path 'fromfeature'
* method get
Expand Down

0 comments on commit 391e4c7

Please sign in to comment.