annotate Jint.Runtime/JsObject.cs @ 0:e113095f1de0

initial commit, proof of concept
author cin
date Wed, 23 Oct 2013 13:24:57 +0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
1 using System;
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
2 using System.Collections.Generic;
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
3
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
4
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
5 namespace Jint.Runtime
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
6 {
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
7 public class JsObject
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
8 {
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
9 ClassDescriptor m_classDescriptor;
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
10 List<object> m_data;
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
11
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
12 public JsObject ()
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
13 {
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
14 }
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
15
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
16 public object Get (string name)
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
17 {
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
18 PropertyDescriptor descriptor;
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
19 if (m_classDescriptor.TryGet (name, out descriptor))
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
20 return m_data.Count <= descriptor.index ? null : m_data [descriptor.index];
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
21 else
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
22 return null;
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
23 }
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
24 }
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
25 }
e113095f1de0 initial commit, proof of concept
cin
parents:
diff changeset
26