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
|