diff Jint.Runtime/VM/RuntimeContext.cs @ 0:e113095f1de0

initial commit, proof of concept
author cin
date Wed, 23 Oct 2013 13:24:57 +0400
parents
children aced2ae9957f
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Jint.Runtime/VM/RuntimeContext.cs	Wed Oct 23 13:24:57 2013 +0400
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace Jint.Runtime.VM
+{
+	public class RuntimeContext
+	{
+		Dictionary<Type,object> m_binders;
+
+		public RuntimeContext ()
+		{
+			m_binders = new Dictionary<Type,object> ();
+			m_binders.Add (typeof(int), new IntegerBinder ());
+		}
+
+		public Box<T> BoxValue<T>(T value) {
+			return new Box<T> (value, GetBinder<T> ());
+		}
+
+		public IBinder<T> GetBinder<T>() {
+			return (IBinder<T>) m_binders [typeof(T)];
+		}
+	}
+}
+