瀏覽代碼

Safe guarding eval code result from null values

Sebastien Ros 12 年之前
父節點
當前提交
ecea61f082
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Jint/Native/Function/EvalFunctionInstance.cs

+ 1 - 1
Jint/Native/Function/EvalFunctionInstance.cs

@@ -21,7 +21,7 @@ namespace Jint.Native.Function
 
             var parser = new JavascriptParser();
             var program = parser.Parse(code);
-            return _engine.ExecuteStatement(program).Value;
+            return _engine.ExecuteStatement(program).Value ?? Undefined.Instance;
         }
     }
 }