private void RegisterSymbolScope(IRuntimeContextInstance provider, bool asDynamicScope) { var scope = new SymbolScope(); scope.IsDynamicScope = asDynamicScope; _symbolScopes.PushScope(scope); foreach (var item in provider.GetProperties()) { _symbolScopes.DefineVariable(item.Identifier); } foreach (var item in provider.GetMethods()) { _symbolScopes.DefineMethod(item); } }
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); } }