Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bunch of random improvements #58

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Windows10CE
Copy link
Contributor

No description provided.

@@ -115,12 +117,13 @@ await GetPackageDependencies(

foreach (var path in libraries)
{
var assembly = Assembly.LoadFrom(path);
if (context.TryAddReferenceAssembly(assembly))
var asm = Assembly.LoadFile(path);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var asm = Assembly.LoadFile(path);
var assembly = Assembly.LoadFile(path);

Comment on lines -13 to -21
public void ResetButton()
{
System.Environment.Exit(0);
}

public void PowerButton()
{
System.Environment.Exit(1);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's mileage in getting rid of this. If there are other consumers of the REPL, it's likely that they may want this API to remain for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any other users? In any case after removal of BasicEnvironment you can call the method that these wrapped anyway, but I have no strong opinion either way

public static ConsoleLikeStringWriter Console { get; internal set; }
public static BasicEnvironment Environment { get; internal set; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the motivation behind removing the environment facade?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's kinda just dead code? I believe it originates from where there was an idea that the repl should be "secure", and if you remove the analyzer that blacklisted the real System.Environment like I also did here, you get almost the same behavior. The one big exception is that it doesn't stop you from reading/writing environment variables anymore, but that was easily bypassed with reflection or Cmd("env"); anyway.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should be split into separate files at this point.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that, was just leaving it as I found it originally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants