Fix syntax error in JS def check