Author: Stephan <[email protected]>
Branch:
Changeset: r80:f0624ff75f25
Date: 2011-05-18 18:11 +0200
http://bitbucket.org/pypy/lang-js/changeset/f0624ff75f25/
Log: added Date.prototype.getTime()
diff --git a/js/interpreter.py b/js/interpreter.py
--- a/js/interpreter.py
+++ b/js/interpreter.py
@@ -888,6 +888,7 @@
put_values(ctx, w_DatePrototype, {
'__proto__': w_DatePrototype,
'valueOf': get_value_of('Date')(ctx),
+ 'getTime': get_value_of('Date')(ctx)
})
w_Date.Put(ctx, 'prototype', w_DatePrototype, flags=allon)
diff --git a/js/test/test_interp.py b/js/test/test_interp.py
--- a/js/test/test_interp.py
+++ b/js/test/test_interp.py
@@ -862,3 +862,6 @@
yield assertv, "Math.min(1, 2);", 1
yield assertv, "Math.min(0, 2);", 0
yield assertv, "Math.min(-1, 1);", -1
+
+def test_date_get_time():
+ yield assertv, "var i = new Date(); i.valueOf() == i.getTime()", True
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit