public Compiler()
        {
            _engine = new ScriptEngine("jscript");

            Debug.Assert(!string.IsNullOrWhiteSpace(LoadResource("sandbox.js")));
            Debug.Assert(!string.IsNullOrWhiteSpace(LoadResource("compile.js")));
            Debug.Assert(!string.IsNullOrWhiteSpace(LoadResource("Scripts", "ember.js")));
            Debug.Assert(!string.IsNullOrWhiteSpace(LoadResource("Scripts", "handlebars-1.0.rc.2.js")));

            _vm = _engine.Parse(
                LoadResource("sandbox.js")
                + LoadResource("Scripts", "handlebars-1.0.rc.2.js")
                + LoadResource("Scripts", "ember.js")
                + LoadResource("compile.js"));
        }
        /// <summary>
        /// Evaluates an expression using the specified language, with an optional array of named items.
        /// </summary>
        /// <param name="language">The language.</param>
        /// <param name="expression">The expression. May not be null.</param>
        /// <param name="namedItems">The named items array.</param>
        /// <returns>The result of the evaluation.</returns>
        public static object Eval(string language, string expression, params KeyValuePair<string, object>[] namedItems)
        {
            if (language == null)
                throw new ArgumentNullException("language");

            if (expression == null)
                throw new ArgumentNullException("expression");

            using (ScriptEngine engine = new ScriptEngine(language))
            {
                if (namedItems != null)
                {
                    foreach (KeyValuePair<string, object> kvp in namedItems)
                    {
                        engine.SetNamedItem(kvp.Key, kvp.Value);
                    }
                }
                return engine.Eval(expression);
            }
        }
 internal ParsedScript(ScriptEngine engine, IntPtr dispatch)
 {
     _engine = engine;
     _dispatch = Marshal.GetObjectForIUnknown(dispatch);
 }