Author: Stephan <[email protected]>
Branch: 
Changeset: r218:31ebeb622c69
Date: 2012-05-22 19:03 +0200
http://bitbucket.org/pypy/lang-js/changeset/31ebeb622c69/

Log:    15.8.2.7

diff --git a/js/builtins_math.py b/js/builtins_math.py
--- a/js/builtins_math.py
+++ b/js/builtins_math.py
@@ -27,6 +27,7 @@
     put_native_function(w_Math, 'atan', js_atan, params = ['x'])
     put_native_function(w_Math, 'atan2', js_atan2, params = ['y', 'x'])
     put_native_function(w_Math, 'ceil', js_ceil, params = ['x'])
+    put_native_function(w_Math, 'cos', js_cos, params = ['x'])
 
 
     # 15.8.1
@@ -299,6 +300,16 @@
 
     return math.ceil(x)
 
+# 15.8.2.7
+def js_cos(this, args):
+    arg0 = get_arg(args, 0)
+    x = arg0.ToNumber()
+
+    if isnan(x) or isinf(x):
+        return NAN
+
+    return math.cos(x)
+
 import time
 from pypy.rlib import rrandom
 _random = rrandom.Random(int(time.time()))
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to