Nashorn supports -strict flag as well as "use strict" directive as defined by ES 5 specification - the later to support turning on strict mode locally (per script file, per script function). Nashorn's callsite tracing, profiling, AST and other debug/profile/trace options could be supported per script, per function level as well. We could do so by parsing nashorn specific user directives.