If I treat the code as ordinary JavaScript, sticking the snippet in a function context gets rid of the error.
function match (plant, mode, grid1, grid2, src_mode,src_grid1,src_grid2) {
if ( plant!=="1010") {
return false;
} else if ( mode == src_mode && grid1 == src_grid1 && grid2 == src_grid2){
return true;
} else {
return defaultMatcher.Matches();
}
But the documentation for Match Scripts has examples with no functions defined, and I tried to follow the example. So I feel I am still missing something fundamental.
I welcome any and all clues. :-)