示例#1
0
        private void RegisterSymbolScope(IReflectableContext provider, bool asDynamicScope)
        {
            var scope = new SymbolScope();

            scope.IsDynamicScope = asDynamicScope;

            _symbolScopes.PushScope(scope);
            foreach (var item in provider.GetProperties())
            {
                if (item.Type == SymbolType.Variable)
                {
                    _symbolScopes.DefineVariable(item.Identifier);
                }
                else
                {
                    _symbolScopes.DefineProperty(item.Identifier);
                }
            }

            foreach (var item in provider.GetMethods())
            {
                _symbolScopes.DefineMethod(item);
            }
        }