BindingFlags.Public needed here as Exception.HResult is now public in .NET 4.5. This...
[mono.git] / mcs / class / dlr / Runtime / Microsoft.Scripting.Core / Compiler / Closure.cs
1 /* ****************************************************************************
2  *
3  * Copyright (c) Microsoft Corporation. 
4  *
5  * This source code is subject to terms and conditions of the Apache License, Version 2.0. A 
6  * copy of the license can be found in the License.html file at the root of this distribution. If 
7  * you cannot locate the  Apache License, Version 2.0, please send an email to 
8  * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
9  * by the terms of the Apache License, Version 2.0.
10  *
11  * You must not remove this notice, or any other, from this software.
12  *
13  *
14  * ***************************************************************************/
15
16 using System.ComponentModel;
17 using System.Diagnostics;
18
19 namespace System.Runtime.CompilerServices {
20
21     /// <summary>
22     /// This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
23     /// Represents the runtime state of a dynamically generated method.
24     /// </summary>
25     [EditorBrowsable(EditorBrowsableState.Never), DebuggerStepThrough]
26     public sealed class Closure {
27         /// <summary>
28         /// Represents the non-trivial constants and locally executable expressions that are referenced by a dynamically generated method. 
29         /// </summary>
30         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")]
31         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
32         public readonly object[] Constants;
33
34         /// <summary>
35         /// Represents the hoisted local variables from the parent context. 
36         /// </summary>
37         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")]
38         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
39         public readonly object[] Locals;
40
41         /// <summary>
42         /// Creates an object to hold state of a dynamically generated method.
43         /// </summary>
44         /// <param name="constants">The constant values used by the method.</param>
45         /// <param name="locals">The hoisted local variables from the parent context.</param>
46         public Closure(object[] constants, object[] locals) {
47             Constants = constants;
48             Locals = locals;
49         }
50     }
51 }