Mercurial > pub > Jint1
annotate Jint.Runtime/VM/RuntimeContext.cs @ 1:033ebe7432d5
vm v2
| author | cin |
|---|---|
| date | Thu, 24 Oct 2013 19:45:57 +0400 |
| parents | e113095f1de0 |
| children | aced2ae9957f |
| rev | line source |
|---|---|
| 0 | 1 using System; |
| 2 using System.Collections.Generic; | |
| 3 | |
| 4 namespace Jint.Runtime.VM | |
| 5 { | |
| 6 public class RuntimeContext | |
| 7 { | |
| 8 Dictionary<Type,object> m_binders; | |
| 9 | |
| 10 public RuntimeContext () | |
| 11 { | |
| 12 m_binders = new Dictionary<Type,object> (); | |
| 13 m_binders.Add (typeof(int), new IntegerBinder ()); | |
| 14 } | |
| 15 | |
| 16 public Box<T> BoxValue<T>(T value) { | |
| 17 return new Box<T> (value, GetBinder<T> ()); | |
| 18 } | |
| 19 | |
| 20 public IBinder<T> GetBinder<T>() { | |
| 21 return (IBinder<T>) m_binders [typeof(T)]; | |
| 22 } | |
| 23 } | |
| 24 } | |
| 25 |
