Browse Source

Preventing multiple descriptor evaluation

Fixes #246
Sébastien Ros 9 years ago
parent
commit
44afa32a47
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Jint/Native/Object/ObjectInstance.cs

+ 2 - 1
Jint/Native/Object/ObjectInstance.cs

@@ -69,7 +69,8 @@ namespace Jint.Native.Object
 
 
             if (desc.IsDataDescriptor())
             if (desc.IsDataDescriptor())
             {
             {
-                return desc.Value.HasValue ? desc.Value.Value : Undefined.Instance;
+                var val = desc.Value;
+                return val.HasValue ? val.Value : Undefined.Instance;
             }
             }
 
 
             var getter = desc.Get.HasValue ? desc.Get.Value : Undefined.Instance;
             var getter = desc.Get.HasValue ? desc.Get.Value : Undefined.Instance;