Resolve all 46 low-severity architecture review findings
This commit is contained in:
@@ -61,6 +61,10 @@ public class SharedScriptService
|
||||
if (syntaxError != null)
|
||||
return Result<SharedScript>.Failure(syntaxError);
|
||||
|
||||
var compilation = new Validation.ScriptCompiler().TryCompile(code, name);
|
||||
if (compilation.IsFailure)
|
||||
return Result<SharedScript>.Failure(compilation.Error);
|
||||
|
||||
var script = new SharedScript(name, code)
|
||||
{
|
||||
ParameterDefinitions = parameterDefinitions,
|
||||
@@ -110,6 +114,10 @@ public class SharedScriptService
|
||||
if (syntaxError != null)
|
||||
return Result<SharedScript>.Failure(syntaxError);
|
||||
|
||||
var compilation = new Validation.ScriptCompiler().TryCompile(code, script.Name);
|
||||
if (compilation.IsFailure)
|
||||
return Result<SharedScript>.Failure(compilation.Error);
|
||||
|
||||
script.Code = code;
|
||||
script.ParameterDefinitions = parameterDefinitions;
|
||||
script.ReturnDefinition = returnDefinition;
|
||||
@@ -171,7 +179,7 @@ public class SharedScriptService
|
||||
/// comment-aware (see <see cref="Validation.CSharpDelimiterScanner"/>) so a
|
||||
/// delimiter inside a regular/verbatim/interpolated/raw string literal, a
|
||||
/// char literal, or a comment does not produce a false syntax error.
|
||||
/// Full Roslyn compilation would be added in a later phase when the scripting sandbox is available.
|
||||
/// Create and update additionally apply the cached Roslyn compile and trust gate.
|
||||
/// </summary>
|
||||
/// <param name="code">The C# code to validate.</param>
|
||||
/// <returns>An error message if validation fails; null if valid.</returns>
|
||||
|
||||
Reference in New Issue
Block a user