Browse Source

Passing the Global Object values tests

Sebastien Ros 11 years ago
parent
commit
fea15a9161

+ 1 - 0
Jint.Tests.Ecma/Ecma/15.1.1.1.cs

@@ -2,6 +2,7 @@ using Xunit;
 
 
 namespace Jint.Tests.Ecma
 namespace Jint.Tests.Ecma
 {
 {
+    [Trait("Category", "Pass")]
     public class Test_15_1_1_1 : EcmaTest
     public class Test_15_1_1_1 : EcmaTest
     {
     {
         [Fact]
         [Fact]

+ 1 - 0
Jint.Tests.Ecma/Ecma/15.1.1.2.cs

@@ -2,6 +2,7 @@ using Xunit;
 
 
 namespace Jint.Tests.Ecma
 namespace Jint.Tests.Ecma
 {
 {
+    [Trait("Category", "Pass")]
     public class Test_15_1_1_2 : EcmaTest
     public class Test_15_1_1_2 : EcmaTest
     {
     {
         [Fact]
         [Fact]

+ 1 - 0
Jint.Tests.Ecma/Ecma/15.1.1.3.cs

@@ -2,6 +2,7 @@ using Xunit;
 
 
 namespace Jint.Tests.Ecma
 namespace Jint.Tests.Ecma
 {
 {
+    [Trait("Category", "Pass")]
     public class Test_15_1_1_3 : EcmaTest
     public class Test_15_1_1_3 : EcmaTest
     {
     {
         [Fact]
         [Fact]

+ 1 - 0
Jint.Tests.Ecma/Ecma/15.1.2.1.cs

@@ -2,6 +2,7 @@ using Xunit;
 
 
 namespace Jint.Tests.Ecma
 namespace Jint.Tests.Ecma
 {
 {
+    [Trait("Category", "Pass")]
     public class Test_15_1_2_1 : EcmaTest
     public class Test_15_1_2_1 : EcmaTest
     {
     {
         [Fact]
         [Fact]

+ 7 - 0
Jint/Native/Function/EvalFunctionInstance.cs

@@ -11,6 +11,8 @@ namespace Jint.Native.Function
         public EvalFunctionInstance(Engine engine, string[] parameters, LexicalEnvironment scope, bool strict) : base(engine, parameters, scope, strict)
         public EvalFunctionInstance(Engine engine, string[] parameters, LexicalEnvironment scope, bool strict) : base(engine, parameters, scope, strict)
         {
         {
             _engine = engine;
             _engine = engine;
+            Prototype = Engine.Function.PrototypeObject;
+            FastAddProperty("length", 1, false, false, false);
         }
         }
 
 
         public override object Call(object thisObject, object[] arguments)
         public override object Call(object thisObject, object[] arguments)
@@ -20,6 +22,11 @@ namespace Jint.Native.Function
 
 
         public object Call(object thisObject, object[] arguments, bool directCall)
         public object Call(object thisObject, object[] arguments, bool directCall)
         {
         {
+            if (TypeConverter.GetType(arguments.At(0)) != Types.String)
+            {
+                return arguments.At(0);
+            }
+
             var code = TypeConverter.ToString(arguments.At(0));
             var code = TypeConverter.ToString(arguments.At(0));
 
 
             try
             try

+ 1 - 1
Jint/Native/Global/GlobalObject.cs

@@ -128,7 +128,7 @@ namespace Jint.Native.Global
             }
             }
 
 
             var n = TypeConverter.ToNumber(arguments[0]);
             var n = TypeConverter.ToNumber(arguments[0]);
-            if (n == double.NaN || n == double.PositiveInfinity || n == double.NegativeInfinity)
+            if (double.IsNaN(n) || double.IsInfinity(n))
             {
             {
                 return false;
                 return false;
             }
             }

+ 1 - 1
Jint/Runtime/StatementInterpreter.cs

@@ -513,7 +513,7 @@ namespace Jint.Runtime
                 }
                 }
             }
             }
 
 
-            return new Completion(Completion.Normal, lastIdentifier, null);
+            return new Completion(Completion.Normal, null, null);
         }
         }
 
 
         public Completion ExecuteBlockStatement(BlockStatement blockStatement)
         public Completion ExecuteBlockStatement(BlockStatement blockStatement)