1. A method, comprising: determining a capability of a virtual machine (VM) configured to execute a host application in a runtime environment; instrumenting a function in user script code with a guard based on the capability of the VM; executing the user script code in the runtime environment; and responsive to detecting an explicit debugging gesture using the guard, transforming the function to generate debuggable script code.