Просмотр исходного кода

Array.push returns pushed object

Sebastien Ros 12 лет назад
Родитель
Сommit
f19bdf555f

+ 1 - 1
Jint/Native/Array/ArrayConstructor.cs

@@ -44,7 +44,7 @@ namespace Jint.Native.Array
         private static object Push(ArrayInstance thisObject, object[] arguments)
         {
             thisObject.Push(arguments[0]);
-            return Undefined.Instance;
+            return arguments[0];
         }
 
         private static object Pop(ArrayInstance thisObject, object[] arguments)

+ 1 - 1
Jint/Runtime/Descriptors/PropertyDescriptor.cs

@@ -50,7 +50,7 @@
         /// <summary>
         /// Local implementation used to create a singleton representing 
         /// an undefined result of a PropertyDescriptor. This prevents the rest
-        /// of the code to return objects in order to be able to return
+        /// of the code to return 'object' in order to be able to return
         /// Undefined.Instance
         /// </summary>
         internal sealed class UndefinedPropertyDescriptor : PropertyDescriptor

+ 0 - 1
Jint/Runtime/Interop/ClrFunctionInstance.cs

@@ -24,7 +24,6 @@ namespace Jint.Runtime.Interop
             // initialize Return flag
             _engine.CurrentExecutionContext.Return = Undefined.Instance;
 
-
             return _func((T) thisObject, arguments);
         }
     }