Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -47,16 +47,8 @@ namespace System.Web.Compilation
{
class AppResourcesAssemblyBuilder
{
#if NET_4_5
static string framework_version = "4.5";
static string profile_path = "net_4_5";
#elif NET_4_0
static string framework_version = "4.0";
static string profile_path = "net_4_0";
#else
static string framework_version = "2.0";
static string profile_path = "net_2_0";
#endif
CompilationSection config;
CompilerInfo ci;
CodeDomProvider _provider;
@@ -266,11 +258,7 @@ namespace System.Web.Compilation
info.FileName = monoPath;
return alPath + " ";
} else {
#if NET_4_0
info.FileName = "al";
#else
info.FileName = "al2";
#endif
return String.Empty;
}
}

View File

@@ -945,9 +945,7 @@ namespace System.Web.Compilation
case TagType.DataBinding:
case TagType.CodeRenderExpression:
case TagType.CodeRender:
#if NET_4_0
case TagType.CodeRenderEncode:
#endif
if (isApplication)
throw new ParseException (location, "Invalid content for application file.");
@@ -1450,9 +1448,7 @@ namespace System.Web.Compilation
return CodeConstructType.ExpressionSnippet;
case TagType.CodeRender:
#if NET_4_0
case TagType.CodeRenderEncode:
#endif
return CodeConstructType.CodeSnippet;
case TagType.DataBinding:
@@ -1485,10 +1481,8 @@ namespace System.Web.Compilation
b = new CodeRenderBuilder (code, true, location);
else if (tagtype == TagType.DataBinding)
b = new DataBindingBuilder (code, location);
#if NET_4_0
else if (tagtype == TagType.CodeRenderEncode)
b = new CodeRenderBuilder (code, true, location, true);
#endif
else
throw new HttpException ("Should never happen");
@@ -1593,11 +1587,9 @@ namespace System.Web.Compilation
case TagType.CodeRenderExpression:
builder.AppendSubBuilder (new CodeRenderBuilder (tagid, true, location));
break;
#if NET_4_0
case TagType.CodeRenderEncode:
builder.AppendSubBuilder (new CodeRenderBuilder (tagid, true, location, true));
break;
#endif
case TagType.DataBinding:
builder.AppendSubBuilder (new DataBindingBuilder (tagid, location));
break;

View File

@@ -597,14 +597,10 @@ namespace System.Web.Compilation
tokenizer.ExpectAttrValue = old;
bool varname;
bool databinding;
#if NET_4_0
bool codeRenderEncode;
#endif
varname = Eat ('=');
databinding = !varname && Eat ('#');
#if NET_4_0
codeRenderEncode = !databinding && !varname && Eat (':');
#endif
string odds = tokenizer.Odds;
tokenizer.Verbatim = true;
@@ -624,10 +620,8 @@ namespace System.Web.Compilation
tagtype = TagType.DataBinding;
else if (varname)
tagtype = TagType.CodeRenderExpression;
#if NET_4_0
else if (codeRenderEncode)
tagtype = TagType.CodeRenderEncode;
#endif
else
tagtype = TagType.CodeRender;
}

View File

@@ -47,9 +47,7 @@ using System.Web.Caching;
using System.Web.Configuration;
using System.Web.Hosting;
using System.Web.Util;
#if NET_4_0
using System.Runtime.Versioning;
#endif
namespace System.Web.Compilation
{
@@ -81,13 +79,11 @@ namespace System.Web.Compilation
static int buildCount;
static bool is_precompiled;
static bool allowReferencedAssembliesCaching;
#if NET_4_0
static List <Assembly> dynamicallyRegisteredAssemblies;
static bool? batchCompilationEnabled;
static FrameworkName targetFramework;
static bool preStartMethodsDone;
static bool preStartMethodsRunning;
#endif
//static bool updatable; unused
static Dictionary<string, PreCompilationData> precompiled;
@@ -112,7 +108,6 @@ namespace System.Web.Compilation
remove { events.RemoveHandler (buildManagerRemoveEntryEvent, value); }
}
#if NET_4_0
internal static bool CompilingTopLevelAssemblies {
get; set;
}
@@ -149,13 +144,10 @@ namespace System.Web.Compilation
return targetFramework;
}
}
#endif
internal static bool BatchMode {
get {
#if NET_4_0
if (batchCompilationEnabled != null)
return (bool)batchCompilationEnabled;
#endif
if (!hosted)
return false; // Fix for bug #380985
@@ -198,13 +190,11 @@ namespace System.Web.Compilation
if (is_precompiled)
is_precompiled = LoadPrecompilationInfo (precomp_name);
}
#if NET_4_0
internal static void AssertPreStartMethodsRunning ()
{
if (!BuildManager.PreStartMethodsRunning)
throw new InvalidOperationException ("This method must be called during the application's pre-start initialization stage.");
}
#endif
// Deal with precompiled sites deployed in a different virtual path
static void FixVirtualPaths ()
{
@@ -535,7 +525,6 @@ namespace System.Web.Compilation
codeDomProviders.Add (type, ret);
return ret;
}
#if NET_4_0
internal static void CallPreStartMethods ()
{
if (preStartMethodsDone)
@@ -698,7 +687,6 @@ namespace System.Web.Compilation
return new SimpleWebObjectFactory (type);
}
#endif
public static object CreateInstanceFromVirtualPath (string virtualPath, Type requiredBaseType)
{
return CreateInstanceFromVirtualPath (GetAbsoluteVirtualPath (virtualPath), requiredBaseType);
@@ -887,13 +875,11 @@ namespace System.Web.Compilation
{
return null; // null is ok here until we store the dependency set in the Cache.
}
#if NET_4_0
[MonoTODO ("Not implemented, always returns null")]
public static BuildDependencySet GetCachedBuildDependencySet (HttpContext context, string virtualPath, bool ensureIsUpToDate)
{
return null; // null is ok here until we store the dependency set in the Cache.
}
#endif
static BuildManagerCacheItem GetCachedItem (string vp)
{
try {
@@ -1104,11 +1090,9 @@ namespace System.Web.Compilation
foreach (string assLocation in WebConfigurationManager.ExtraAssemblies)
LoadAssembly (assLocation, configReferencedAssemblies);
#if NET_4_0
if (dynamicallyRegisteredAssemblies != null)
foreach (Assembly registeredAssembly in dynamicallyRegisteredAssemblies)
configReferencedAssemblies.Add (registeredAssembly);
#endif
// Precompiled sites unconditionally load all assemblies from bin/ (fix for
// bug #502016)
if (is_precompiled || addAssembliesInBin) {

View File

@@ -45,9 +45,7 @@ namespace System.Web.Compilation
{
public abstract class BuildProvider
{
#if NET_4_0
static Dictionary <string, Type> registeredBuildProviderTypes;
#endif
ArrayList ref_assemblies;
ICollection vpath_deps;
@@ -136,7 +134,6 @@ namespace System.Web.Compilation
// MS also throws a NullReferenceException here when not hosted.
return VirtualPathProvider.OpenFile (virtualPath);
}
#if NET_4_0
public static void RegisterBuildProvider (string extension, Type providerType)
{
if (String.IsNullOrEmpty (extension))
@@ -181,7 +178,6 @@ namespace System.Web.Compilation
return Activator.CreateInstance (type, null) as global::System.Web.Compilation.BuildProvider;
}
#endif
public virtual CompilerType CodeCompilerType {
get { return null; } // Documented to return null
}

View File

@@ -344,14 +344,12 @@ namespace System.Web.Compilation
CodeMethodInvokeExpression expr = new CodeMethodInvokeExpression (thisRef, "InitializeCulture");
method.Statements.Add (AddLinePragma (new CodeExpressionStatement (expr), directiveLocation));
}
#if NET_4_0
protected override void AddStatementsToInitMethodBottom (ControlBuilder builder, CodeMemberMethod method)
{
ILocation directiveLocation = pageParser.DirectiveLocation;
AssignPropertyWithExpression <string> (method, "MetaDescription", pageParser.MetaDescription, directiveLocation);
AssignPropertyWithExpression <string> (method, "MetaKeywords", pageParser.MetaKeywords, directiveLocation);
}
#endif
protected override void PrependStatementsToFrameworkInitialize (CodeMemberMethod method)
{
base.PrependStatementsToFrameworkInitialize (method);

View File

@@ -41,9 +41,7 @@ namespace System.Web.Compilation
CodeRender,
CodeRenderExpression,
Include,
#if NET_4_0
CodeRenderEncode
#endif
}
}

View File

@@ -452,7 +452,6 @@ namespace System.Web.Compilation
protected virtual void AddStatementsToInitMethodTop (ControlBuilder builder, CodeMemberMethod method)
{
#if NET_4_0
ClientIDMode? mode = parser.ClientIDMode;
if (mode.HasValue) {
var cimRef = new CodeTypeReferenceExpression (typeof (ClientIDMode));
@@ -464,7 +463,6 @@ namespace System.Web.Compilation
method.Statements.Add (assign);
}
#endif
}
protected virtual void AddStatementsToInitMethodBottom (ControlBuilder builder, CodeMemberMethod method)
@@ -1215,13 +1213,11 @@ namespace System.Web.Compilation
parms.Add (new CodeDelegateCreateExpression (
new CodeTypeReference (typeof (System.Web.UI.BuildMethod)),
thisRef, child.Method.Name));
#if NET_4_0
string value = pca.ProviderName;
if (!String.IsNullOrEmpty (value) && String.Compare (OutputCache.DEFAULT_PROVIDER_NAME, value, StringComparison.Ordinal) != 0)
parms.Add (new CodePrimitiveExpression (value));
else
parms.Add (new CodePrimitiveExpression (null));
#endif
methodStatements.Add (AddLinePragma (build, parent));
if (parent.HasAspCode)
AddRenderControl (parent);
@@ -1394,12 +1390,10 @@ namespace System.Web.Compilation
CodeExpression GetWrappedCodeExpression (CodeRenderBuilder cr)
{
var ret = new CodeSnippetExpression (cr.Code);
#if NET_4_0
if (cr.HtmlEncode) {
var encodeRef = new CodeMethodReferenceExpression (new CodeTypeReferenceExpression (typeof (HttpUtility)), "HtmlEncode");
return new CodeMethodInvokeExpression (encodeRef, new CodeExpression[] { ret });
} else
#endif
return ret;
}

View File

@@ -73,9 +73,7 @@ namespace System.Web.Compilation
AddPrimitiveArgument (arguments, parser.OutputCacheVaryByCustom);
AddPrimitiveArgument (arguments, parser.OutputCacheSqlDependency);
AddPrimitiveArgument (arguments, parser.OutputCacheShared);
#if NET_4_0
arguments.Add (new CodeAttributeArgument ("ProviderName", new CodePrimitiveExpression (parser.ProviderName)));
#endif
mainClass.CustomAttributes.Add (cad);
}