From a77308735f50fb1735bca82ffd0ffaf12a5c9f62 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Fri, 30 Mar 2018 19:11:11 +0200 Subject: Bug 1310078 - Implement valueAsNumber and valueAsDate for --- js/src/jsdate.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'js/src/jsdate.cpp') diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp index ccaeda2a3..00a8abf84 100755 --- a/js/src/jsdate.cpp +++ b/js/src/jsdate.cpp @@ -354,9 +354,21 @@ MakeDate(double day, double time) JS_PUBLIC_API(double) JS::MakeDate(double year, unsigned month, unsigned day) { + MOZ_ASSERT(month <= 11); + MOZ_ASSERT(day >= 1 && day <= 31); + return ::MakeDate(MakeDay(year, month, day), 0); } +JS_PUBLIC_API(double) +JS::MakeDate(double year, unsigned month, unsigned day, double time) +{ + MOZ_ASSERT(month <= 11); + MOZ_ASSERT(day >= 1 && day <= 31); + + return ::MakeDate(MakeDay(year, month, day), time); +} + JS_PUBLIC_API(double) JS::YearFromTime(double time) { -- cgit v1.2.3