Forráskód Böngészése

Using readonly fields when possible

Sebastien Ros 10 éve
szülő
commit
2d83c14024
3 módosított fájl, 8 hozzáadás és 8 törlés
  1. 4 4
      Jint/Native/JsValue.cs
  2. 2 2
      Jint/Native/Null.cs
  3. 2 2
      Jint/Native/Undefined.cs

+ 4 - 4
Jint/Native/JsValue.cs

@@ -21,10 +21,10 @@ namespace Jint.Native
     [DebuggerTypeProxy(typeof(JsValueDebugView))]
     public struct JsValue : IEquatable<JsValue>
     {
-        public static JsValue Undefined = new JsValue(Types.Undefined);
-        public static JsValue Null = new JsValue(Types.Null);
-        public static JsValue False = new JsValue(false);
-        public static JsValue True = new JsValue(true);
+        public readonly static JsValue Undefined = new JsValue(Types.Undefined);
+        public readonly static JsValue Null = new JsValue(Types.Null);
+        public readonly static JsValue False = new JsValue(false);
+        public readonly static JsValue True = new JsValue(true);
 
         public JsValue(bool value)
         {

+ 2 - 2
Jint/Native/Null.cs

@@ -2,7 +2,7 @@
 {
     public static class Null
     {
-        public static JsValue Instance = JsValue.Null;
-        public static string Text = "null";
+        public readonly static JsValue Instance = JsValue.Null;
+        public readonly static string Text = "null";
     }
 }

+ 2 - 2
Jint/Native/Undefined.cs

@@ -2,7 +2,7 @@
 {
     public static class Undefined
     {
-        public static JsValue Instance = JsValue.Undefined;
-        public static string Text = "undefined";
+        public readonly static JsValue Instance = JsValue.Undefined;
+        public readonly static string Text = "undefined";
     }
 }