[gh-215] Allowed System.Numerics.Complex.

This commit is contained in:
Andrey Shchekin 2017-11-19 22:33:14 +13:00
Родитель 8faca32b2c
Коммит 815b798a73
2 изменённых файлов: 59 добавлений и 1 удалений

Просмотреть файл

@ -4779,6 +4779,57 @@ System.Net
WebUtility: Denied
WriteStreamClosedEventArgs: Denied
WriteStreamClosedEventHandler: Denied
System.Numerics
BigInteger: Denied
Complex: Allowed
.ctor: Allowed
Abs: Allowed
Acos: Allowed
Add: Allowed
Asin: Allowed
Atan: Allowed
Conjugate: Allowed
Cos: Allowed
Cosh: Allowed
Divide: Allowed
Equals: Allowed
Exp: Allowed
FromPolarCoordinates: Allowed
get_Imaginary: Allowed
get_Magnitude: Allowed
get_Phase: Allowed
get_Real: Allowed
GetHashCode: Allowed
GetType: Allowed
Log: Allowed
Log10: Allowed
Multiply: Allowed
Negate: Allowed
op_Addition: Allowed
op_Division: Allowed
op_Equality: Allowed
op_Explicit: Allowed
op_Implicit: Allowed
op_Inequality: Allowed
op_Multiply: Allowed
op_Subtraction: Allowed
op_UnaryNegation: Allowed
Pow: Allowed
Reciprocal: Allowed
Sin: Allowed
Sinh: Allowed
Sqrt: Allowed
Subtract: Allowed
Tan: Allowed
Tanh: Allowed
ToString: Allowed
Matrix3x2: Denied
Matrix4x4: Denied
Plane: Denied
Quaternion: Denied
Vector2: Denied
Vector3: Denied
Vector4: Denied
System.Reflection
AmbiguousMatchException: Denied
Assembly: Denied

Просмотреть файл

@ -10,12 +10,13 @@ using Microsoft.FSharp.Collections;
using Microsoft.FSharp.Core;
using Microsoft.VisualBasic.CompilerServices;
using AshMind.Extensions;
using SharpLab.Runtime.Internal;
using Unbreakable;
using Unbreakable.Policy;
using Unbreakable.Policy.Rewriters;
using SharpLab.Runtime.Internal;
namespace SharpLab.Server.Execution.Internal {
using System.Numerics;
using static ApiAccess;
public static class ApiPolicySetup {
@ -36,6 +37,7 @@ namespace SharpLab.Server.Execution.Internal {
.Namespace("System.Reflection", Neutral, SetupSystemReflection)
.Namespace("System.Linq.Expressions", Neutral, SetupSystemLinqExpressions)
.Namespace("System.Net", Neutral, SetupSystemNet)
.Namespace("System.Numerics", Neutral, SetupSystemNumerics)
.Namespace("System.IO", Neutral,
// required by F#'s printf
n => n.Type(typeof(TextWriter), Neutral)
@ -145,6 +147,11 @@ namespace SharpLab.Server.Execution.Internal {
.Type(typeof(IPAddress), Allowed);
}
private static void SetupSystemNumerics(NamespacePolicy namespacePolicy) {
namespacePolicy
.Type(typeof(Complex), Allowed);
}
private static void SetupSystemReflection(NamespacePolicy namespacePolicy) {
ForEachTypeInNamespaceOf<MemberInfo>(type => {
if (type.IsEnum) {