Mercurial > pub > Jint1
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e113095f1de0 |
---|---|
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 |