It uses the excellent Jint library (https://github.com/sebastienros/jint) which is a .NET JavaScript interpreter that provides a sandboxed runtime for arbitrary JavaScript.
Using Jint also allows for extensibility by allowing JS modules to be loaded as well as providing interop with .NET object instances.