/
Closure.cs
37 lines (33 loc) · 1.39 KB
/
Closure.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
using System.Diagnostics;
namespace System.Runtime.CompilerServices
{
/// <summary>
/// This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
/// Represents the runtime state of a dynamically generated method.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), DebuggerStepThrough]
public sealed class Closure
{
/// <summary>
/// Represents the non-trivial constants and locally executable expressions that are referenced by a dynamically generated method.
/// </summary>
public readonly object[] Constants;
/// <summary>
/// Represents the hoisted local variables from the parent context.
/// </summary>
public readonly object[]? Locals;
/// <summary>
/// Creates an object to hold state of a dynamically generated method.
/// </summary>
/// <param name="constants">The constant values used by the method.</param>
/// <param name="locals">The hoisted local variables from the parent context.</param>
public Closure(object[] constants, object[]? locals)
{
Constants = constants;
Locals = locals;
}
}
}