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

Remove most Maximum* capacity variables #2363

Merged
merged 3 commits into from Sep 29, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 1 addition & 32 deletions src/System.Management.Automation/engine/ExecutionContext.cs
Expand Up @@ -802,39 +802,8 @@ internal void AppendDollarError(object obj)
return;
}

// 1045384-2004/12/14-JonN implementing $MaximumErrorCount
object maxcountobj = EngineSessionState.CurrentScope.ErrorCapacity.FastValue;
if (null != maxcountobj)
{
try
{
maxcountobj = LanguagePrimitives.ConvertTo(maxcountobj, typeof(int), CultureInfo.InvariantCulture);
}
catch (PSInvalidCastException)
{
}
catch (System.OverflowException)
{
}
catch (Exception e)
{
Diagnostics.Assert(false,
"Unexpected exception in LanguagePrimitives.ConvertTo: "
+ e.GetType().FullName);
throw;
}
}
int maxErrorCount = (maxcountobj is int) ? (int)maxcountobj : 256;
if (0 > maxErrorCount)
maxErrorCount = 0;
else if (32768 < maxErrorCount)
maxErrorCount = 32768;
const int maxErrorCount = 256;

if (0 >= maxErrorCount)
{
arraylist.Clear();
return;
}
int numToErase = arraylist.Count - (maxErrorCount - 1);
if (0 < numToErase)
{
Expand Down
Expand Up @@ -1058,8 +1058,7 @@ private static void AddModuleToList(PSModuleInfo module, List<PSModuleInfo> modu
}

internal static string[] _builtinVariables = new string[] { "_", "this", "input", "args", "true", "false", "null",
"MaximumErrorCount", "MaximumVariableCount", "MaximumFunctionCount","MaximumAliasCount", "PSDefaultParameterValues",
"MaximumDriveCount", "Error", "PSScriptRoot", "PSCommandPath", "MyInvocation", "ExecutionContext", "StackTrace" };
"PSDefaultParameterValues", "Error", "PSScriptRoot", "PSCommandPath", "MyInvocation", "ExecutionContext", "StackTrace" };

/// <summary>
/// Lists the variables exported by this module.
Expand Down

This file was deleted.

Expand Up @@ -71,10 +71,6 @@ internal sealed partial class SessionStateInternal
/// If the provider threw an exception or returned null.
/// </exception>
///
/// <exception cref="SessionStateOverflowException">
/// If creating the drive will overflow the MaximumDriveCount limit.
/// </exception>
///
internal PSDriveInfo NewDrive(PSDriveInfo drive, string scopeID)
{
if (drive == null)
Expand Down Expand Up @@ -160,10 +156,6 @@ internal PSDriveInfo NewDrive(PSDriveInfo drive, string scopeID)
/// If the provider threw an exception or returned null.
/// </exception>
///
/// <exception cref="SessionStateOverflowException">
/// If creating the drive will overflow the MaximumDriveCount limit.
/// </exception>
///
internal void NewDrive(PSDriveInfo drive, string scopeID, CmdletProviderContext context)
{
if (drive == null)
Expand Down