This call here is trying to ensure that the code is valid, right?

It might then make more sense to wrap this call into try{}catch(err){} block so that if it is not valid you can let the user know what the problem is somehow.