CrossCode was written in JS/HTML5 and was ported over to consoles just fine, though.
They mention stuff like "an interpreter which translates the [JavaScript] code but locks it up in a cage"¹, their presentation² mention JS interpreters and a JS AoT compiler, so I'm not really sure how they did it