Patching for issue #989

Fixing inappropriate looping technique that throws error when attributing default parameters.
This commit is contained in:
Etienne Gaudrain 2020-08-19 18:52:15 +02:00 committed by GitHub
parent 2cbd571a18
commit 934f183b96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -922,7 +922,7 @@ window.jsPsych = (function() {
if(jsPsych.plugins[trial.type].info.parameters[param].type == jsPsych.plugins.parameterType.COMPLEX){
if(jsPsych.plugins[trial.type].info.parameters[param].array == true){
// iterate over each entry in the array
for(var i in trial[param]){
trial[param].forEach(function(ip, i){
// check each parameter in the plugin description
for(var p in jsPsych.plugins[trial.type].info.parameters[param].nested){
if(typeof trial[param][i][p] == 'undefined' || trial[param][i][p] === null){
@ -933,7 +933,7 @@ window.jsPsych = (function() {
}
}
}
}
});
}
}
// if it's not nested, checking is much easier and do that here: