1234567891011121314151617181920212223242526272829303132333435 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Jint.Native;
- using Jint.Native.Json;
- using Jint.Runtime;
- namespace Jint.Repl
- {
- class Program
- {
- static void Main(string[] args)
- {
- var engine = new Engine();
-
- while (true)
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write(" > ");
- var input = Console.ReadLine();
- if (input == "exit")
- {
- return;
- }
- var result = engine.GetValue(engine.Execute(input));
- var str = engine.JSON.Stringify(engine.JSON, Arguments.From(result, Undefined.Instance, "\t"));
- Console.ForegroundColor = ConsoleColor.Magenta;
- Console.WriteLine("=> {0}", str);
- }
- }
- }
- }
|