public JSValue GetBindingValue(string key) { for (JSEnvRec lex = this.LexicalEnv; lex != null; lex = lex.Parent) { JSValue r; if (lex.TryGetBindingValue(key, out r)) { return(r); } } throw new JSRuntimeException("ReferenceError", key + " is not defined"); }
internal virtual JSValue GetFunctionWithThis(string key, out JSValue lThisObj) { for (JSEnvRec lex = this.LexicalEnv; lex != null; lex = lex.Parent) { JSValue r; if (lex.TryGetBindingValue(key, out r)) { if (lex is JSObjectScope) { lThisObj = ((JSObjectScope)lex).ScopeObject; return(r); } lThisObj = JSUndefined.Instance; return(r); } } throw new JSRuntimeException("ReferenceError", key + " is not defined"); }