Author: Stephan <step...@stzal.com>
Branch: 
Changeset: r276:15528e94cec6
Date: 2012-08-04 15:17 +0200
http://bitbucket.org/pypy/lang-js/changeset/15528e94cec6/

Log:    replace Date builtins with empty functions for now

diff --git a/js/builtins_date.py b/js/builtins_date.py
--- a/js/builtins_date.py
+++ b/js/builtins_date.py
@@ -23,60 +23,60 @@
     put_native_function(w_DatePrototype, u'valueOf', value_of)
     put_native_function(w_DatePrototype, u'getTime', get_time)
 
-    #put_native_function(w_DatePrototype, u'getFullYear', get_full_year)
-    #put_native_function(w_DatePrototype, u'getUTCFullYear', get_utc_full_year)
+    put_native_function(w_DatePrototype, u'getFullYear', get_full_year)
+    put_native_function(w_DatePrototype, u'getUTCFullYear', get_utc_full_year)
 
-    #put_native_function(w_DatePrototype, u'getMonth', get_month)
-    #put_native_function(w_DatePrototype, u'getUTCMonth', get_utc_month)
+    put_native_function(w_DatePrototype, u'getMonth', get_month)
+    put_native_function(w_DatePrototype, u'getUTCMonth', get_utc_month)
 
-    #put_native_function(w_DatePrototype, u'getDate', get_date)
-    #put_native_function(w_DatePrototype, u'getUTCDate', get_utc_date)
+    put_native_function(w_DatePrototype, u'getDate', get_date)
+    put_native_function(w_DatePrototype, u'getUTCDate', get_utc_date)
 
-    #put_native_function(w_DatePrototype, u'getDay', get_day)
-    #put_native_function(w_DatePrototype, u'getUTCDay', get_utc_day)
+    put_native_function(w_DatePrototype, u'getDay', get_day)
+    put_native_function(w_DatePrototype, u'getUTCDay', get_utc_day)
 
-    #put_native_function(w_DatePrototype, u'getHours', get_hours)
-    #put_native_function(w_DatePrototype, u'getUTCHours', get_utc_hours)
+    put_native_function(w_DatePrototype, u'getHours', get_hours)
+    put_native_function(w_DatePrototype, u'getUTCHours', get_utc_hours)
 
-    #put_native_function(w_DatePrototype, u'getMinutes', get_minutes)
-    #put_native_function(w_DatePrototype, u'getUTCMinutes', get_utc_minutes)
+    put_native_function(w_DatePrototype, u'getMinutes', get_minutes)
+    put_native_function(w_DatePrototype, u'getUTCMinutes', get_utc_minutes)
 
-    #put_native_function(w_DatePrototype, u'getSeconds', get_seconds)
-    #put_native_function(w_DatePrototype, u'getUTCSeconds', get_utc_seconds)
+    put_native_function(w_DatePrototype, u'getSeconds', get_seconds)
+    put_native_function(w_DatePrototype, u'getUTCSeconds', get_utc_seconds)
 
-    #put_native_function(w_DatePrototype, u'getMilliseconds', get_milliseconds)
-    #put_native_function(w_DatePrototype, u'getUTCMilliseconds', 
get_utc_milliseconds)
+    put_native_function(w_DatePrototype, u'getMilliseconds', get_milliseconds)
+    put_native_function(w_DatePrototype, u'getUTCMilliseconds', 
get_utc_milliseconds)
 
-    #put_native_function(w_DatePrototype, u'getTimezoneOffset', 
get_timezone_offset)
+    put_native_function(w_DatePrototype, u'getTimezoneOffset', 
get_timezone_offset)
 
-    #put_native_function(w_DatePrototype, u'setTime', set_time)
+    put_native_function(w_DatePrototype, u'setTime', set_time)
 
-    #put_native_function(w_DatePrototype, u'setMilliseconds', set_milliseconds)
-    #put_native_function(w_DatePrototype, u'setUTCMilliseconds', 
set_utc_milliseconds)
+    put_native_function(w_DatePrototype, u'setMilliseconds', set_milliseconds)
+    put_native_function(w_DatePrototype, u'setUTCMilliseconds', 
set_utc_milliseconds)
 
-    #put_native_function(w_DatePrototype, u'setSeconds', set_seconds)
-    #put_native_function(w_DatePrototype, u'setUTCSeconds', set_utc_seconds)
+    put_native_function(w_DatePrototype, u'setSeconds', set_seconds)
+    put_native_function(w_DatePrototype, u'setUTCSeconds', set_utc_seconds)
 
-    #put_native_function(w_DatePrototype, u'setMinutes', set_minutes)
-    #put_native_function(w_DatePrototype, u'setUTCMinutes', set_utc_minutes)
+    put_native_function(w_DatePrototype, u'setMinutes', set_minutes)
+    put_native_function(w_DatePrototype, u'setUTCMinutes', set_utc_minutes)
 
-    #put_native_function(w_DatePrototype, u'setHours', set_hours)
-    #put_native_function(w_DatePrototype, u'setUTCHours', set_utc_hours)
+    put_native_function(w_DatePrototype, u'setHours', set_hours)
+    put_native_function(w_DatePrototype, u'setUTCHours', set_utc_hours)
 
-    #put_native_function(w_DatePrototype, u'setDate', set_date)
-    #put_native_function(w_DatePrototype, u'setUTCDate', set_utc_date)
+    put_native_function(w_DatePrototype, u'setDate', set_date)
+    put_native_function(w_DatePrototype, u'setUTCDate', set_utc_date)
 
-    #put_native_function(w_DatePrototype, u'setMonth', set_month)
-    #put_native_function(w_DatePrototype, u'setUTCMonth', set_utc_month)
+    put_native_function(w_DatePrototype, u'setMonth', set_month)
+    put_native_function(w_DatePrototype, u'setUTCMonth', set_utc_month)
 
-    #put_native_function(w_DatePrototype, u'setFullYear', set_full_year)
-    #put_native_function(w_DatePrototype, u'setUTCFullYear', set_utc_full_year)
+    put_native_function(w_DatePrototype, u'setFullYear', set_full_year)
+    put_native_function(w_DatePrototype, u'setUTCFullYear', set_utc_full_year)
 
-    #put_native_function(w_DatePrototype, u'getYear', get_year)
-    #put_native_function(w_DatePrototype, u'setYear', set_year)
+    put_native_function(w_DatePrototype, u'getYear', get_year)
+    put_native_function(w_DatePrototype, u'setYear', set_year)
 
-    #put_native_function(w_DatePrototype, u'toUTCString', to_utc_string)
-    #put_native_function(w_DatePrototype, u'toGMTString', to_gmt_string)
+    put_native_function(w_DatePrototype, u'toUTCString', to_utc_string)
+    put_native_function(w_DatePrototype, u'toGMTString', to_gmt_string)
 
     # 15.9.3
     w_Date = W_DateConstructor()
@@ -109,114 +109,114 @@
 
 # 15.9.5.10
 @w_return
-def get_full_year(this, args):
-    d = w_date_to_datetime(this)
-    local = to_local(d)
-    return local.year
+def get_full_year(this, args): pass
+    #d = w_date_to_datetime(this)
+    #local = to_local(d)
+    #return local.year
 
 # 15.9.5.11
 @w_return
-def get_utc_full_year(this, args):
-    d = w_date_to_datetime(this)
-    return d.year
+def get_utc_full_year(this, args): pass
+    #d = w_date_to_datetime(this)
+    #return d.year
 
 # 15.9.5.12
 @w_return
-def get_month(this, args):
-    d = w_date_to_datetime(this)
-    local = to_local(d)
-    return local.month
+def get_month(this, args): pass
+    #d = w_date_to_datetime(this)
+    #local = to_local(d)
+    #return local.month
 
 # 15.9.5.13
 @w_return
-def get_utc_month(this, args):
-    d = w_date_to_datetime(this)
-    return d.day
+def get_utc_month(this, args): pass
+    #d = w_date_to_datetime(this)
+    #return d.day
 
 # 15.9.5.14
 @w_return
-def get_date(this, args):
-    d = w_date_to_datetime(this)
-    local = to_local(d)
-    return local.day
+def get_date(this, args): pass
+    #d = w_date_to_datetime(this)
+    #local = to_local(d)
+    #return local.day
 
 # 15.9.5.15
 @w_return
-def get_utc_date(this, args):
-    d = w_date_to_datetime(this)
-    return d.day
+def get_utc_date(this, args): pass
+    #d = w_date_to_datetime(this)
+    #return d.day
 
 # 15.9.5.16
 @w_return
-def get_day(this, args):
-    d = w_date_to_datetime(this)
-    local = to_local(d)
-    return local.weekday()
+def get_day(this, args): pass
+    #d = w_date_to_datetime(this)
+    #local = to_local(d)
+    #return local.weekday()
 
 # 15.9.5.17
 @w_return
-def get_utc_day(this, args):
-    d = w_date_to_datetime(this)
-    return d.weekday()
+def get_utc_day(this, args): pass
+    #d = w_date_to_datetime(this)
+    #return d.weekday()
 
 # 15.9.5.18
 @w_return
-def get_hours(this, args):
-    d = w_date_to_datetime(this)
-    local = to_local(d)
-    return local.hour
+def get_hours(this, args): pass
+    #d = w_date_to_datetime(this)
+    #local = to_local(d)
+    #return local.hour
 
 # 15.9.5.19
 @w_return
-def get_utc_hours(this, args):
-    d = w_date_to_datetime(this)
-    return d.hour
+def get_utc_hours(this, args): pass
+    #d = w_date_to_datetime(this)
+    #return d.hour
 
 # 15.9.5.20
 @w_return
-def get_minutes(this, args):
-    d = w_date_to_datetime(this)
-    local = to_local(d)
-    return local.minute
+def get_minutes(this, args): pass
+    #d = w_date_to_datetime(this)
+    #local = to_local(d)
+    #return local.minute
 
 # 15.9.5.21
 @w_return
-def get_utc_minutes(this, args):
-    d = w_date_to_datetime(this)
-    return d.minute
+def get_utc_minutes(this, args): pass
+    #d = w_date_to_datetime(this)
+    #return d.minute
 
 # 15.9.5.22
 @w_return
-def get_seconds(this, args):
-    d = w_date_to_datetime(this)
-    local = to_local(d)
-    return local.second
+def get_seconds(this, args): pass
+    #d = w_date_to_datetime(this)
+    #local = to_local(d)
+    #return local.second
 
 # 15.9.5.23
 @w_return
-def get_utc_seconds(this, args):
-    d = w_date_to_datetime(this)
-    return d.second
+def get_utc_seconds(this, args): pass
+    #d = w_date_to_datetime(this)
+    #return d.second
 
 # 15.9.5.24
 @w_return
-def get_milliseconds(this, args):
-    d = w_date_to_datetime(this)
-    local = to_local(d)
-    return local.microsecond / 1000
+def get_milliseconds(this, args): pass
+    #d = w_date_to_datetime(this)
+    #local = to_local(d)
+    #return local.microsecond / 1000
 
 # 15.9.5.25
 @w_return
-def get_utc_milliseconds(this, args):
-    d = w_date_to_datetime(this)
-    return d.microsecond / 1000
+def get_utc_milliseconds(this, args): pass
+    #d = w_date_to_datetime(this)
+    #return d.microsecond / 1000
 
 # 15.9.5.26
 @w_return
-def get_timezone_offset(this, args):
-    d = w_date_to_datetime(this)
-    offset = -1 * (d.utcoffset().total_seconds() / 60)
-    return offset
+def get_timezone_offset(this, args): pass
+    #d = w_date_to_datetime(this)
+    #offset = -1 * (d.utcoffset().total_seconds() / 60)
+    #return offset
 
 # 15.9.5.27
 @w_return
@@ -227,121 +227,121 @@
 
 # 15.9.5.28
 @w_return
-def set_milliseconds(this, args):
-    time_args = to_timeargs(args, 1)
-    return set_datetime(this, time_args)
+def set_milliseconds(this, args): pass
+    #time_args = to_timeargs(args, 1)
+    #return set_datetime(this, time_args)
 
 # 15.9.5.29
 @w_return
-def set_utc_milliseconds(this, args):
-    time_args = to_timeargs(args, 1)
-    return set_utc_datetime(this, time_args)
+def set_utc_milliseconds(this, args): pass
+    #time_args = to_timeargs(args, 1)
+    #return set_utc_datetime(this, time_args)
 
 # 15.9.5.30
 @w_return
-def set_seconds(this, args):
-    time_args = to_timeargs(args, 2)
-    return set_datetime(this, time_args)
+def set_seconds(this, args): pass
+    #time_args = to_timeargs(args, 2)
+    #return set_datetime(this, time_args)
 
 # 15.9.5.30
 @w_return
-def set_utc_seconds(this, args):
-    time_args = to_timeargs(args, 2)
-    return set_utc_datetime(this, time_args)
+def set_utc_seconds(this, args): pass
+    #time_args = to_timeargs(args, 2)
+    #return set_utc_datetime(this, time_args)
 
 # 15.9.5.32
 @w_return
-def set_minutes(this, args):
-    time_args = to_timeargs(args, 3)
-    return set_datetime(this, time_args)
+def set_minutes(this, args): pass
+    #time_args = to_timeargs(args, 3)
+    #return set_datetime(this, time_args)
 
 # 15.9.5.33
 @w_return
-def set_utc_minutes(this, args):
-    time_args = to_timeargs(args, 3)
-    return set_utc_datetime(this, time_args)
+def set_utc_minutes(this, args): pass
+    #time_args = to_timeargs(args, 3)
+    #return set_utc_datetime(this, time_args)
 
 # 15.9.5.34
 @w_return
-def set_hours(this, args):
-    time_args = to_timeargs(args, 4)
-    return set_datetime(this, time_args)
+def set_hours(this, args): pass
+    #time_args = to_timeargs(args, 4)
+    #return set_datetime(this, time_args)
 
 # 15.9.5.35
 @w_return
-def set_utc_hours(this, args):
-    time_args = to_timeargs(args, 4)
-    return set_utc_datetime(this, time_args)
+def set_utc_hours(this, args): pass
+    #time_args = to_timeargs(args, 4)
+    #return set_utc_datetime(this, time_args)
 
 # 15.9.5.36
 @w_return
-def set_date(this, args):
-    date_args = to_dateargs(args, 1)
-    return set_datetime(this, date_args)
+def set_date(this, args): pass
+    #date_args = to_dateargs(args, 1)
+    #return set_datetime(this, date_args)
 
 # 15.9.5.37
 @w_return
-def set_utc_date(this, args):
-    date_args = to_dateargs(args, 1)
-    return set_utc_datetime(this, date_args)
+def set_utc_date(this, args): pass
+    #date_args = to_dateargs(args, 1)
+    #return set_utc_datetime(this, date_args)
 
 # 15.9.5.38
 @w_return
-def set_month(this, args):
-    date_args = to_dateargs(args, 2)
-    return set_datetime(this, date_args)
+def set_month(this, args): pass
+    #date_args = to_dateargs(args, 2)
+    #return set_datetime(this, date_args)
 
 # 15.9.5.39
 @w_return
-def set_utc_month(this, args):
-    date_args = to_dateargs(args, 2)
-    return set_utc_datetime(this, date_args)
+def set_utc_month(this, args): pass
+    #date_args = to_dateargs(args, 2)
+    #return set_utc_datetime(this, date_args)
 
 # 15.9.5.38
 @w_return
-def set_full_year(this, args):
-    date_args = to_dateargs(args, 3)
-    return set_datetime(this, date_args)
+def set_full_year(this, args): pass
+    #date_args = to_dateargs(args, 3)
+    #return set_datetime(this, date_args)
 
 # 15.9.5.39
 @w_return
-def set_utc_full_year(this, args):
-    date_args = to_dateargs(args, 3)
-    return set_utc_datetime(this, date_args)
+def set_utc_full_year(this, args): pass
+    #date_args = to_dateargs(args, 3)
+    #return set_utc_datetime(this, date_args)
 
 # B.2.4
 @w_return
-def get_year(this, args):
-    d = w_date_to_datetime(this)
-    local = to_local(d)
-    y = local.year - 1900
-    return y
+def get_year(this, args): pass
+    #d = w_date_to_datetime(this)
+    #local = to_local(d)
+    #y = local.year - 1900
+    #return y
 
 # B.2.5
 @w_return
-def set_year(this, args):
-    arg0 = get_arg(args, 0)
-    year = arg0.ToInteger()
+def set_year(this, args): pass
+    #arg0 = get_arg(args, 0)
+    #year = arg0.ToInteger()
 
-    if isnan(year) or year < 0 or year > 99:
-        this.set_primitive_value(NAN)
-        return NAN
+    #if isnan(year) or year < 0 or year > 99:
+        #this.set_primitive_value(NAN)
+        #return NAN
 
-    y = year + 1900
+    #y = year + 1900
 
-    return set_datetime(this, [y])
+    #return set_datetime(this, [y])
 
 # 15.9.5.42
 @w_return
-def to_utc_string(this, args):
-    d = w_date_to_datetime(this)
-    s = d.strftime('%c %z')
-    return s
+def to_utc_string(this, args): pass
+    #d = w_date_to_datetime(this)
+    #s = d.strftime('%c %z')
+    #return s
 
 # B.2.6
 @w_return
-def to_gmt_string(this, args):
-    return to_utc_string(this, args)
+def to_gmt_string(this, args): pass
+    #return to_utc_string(this, args)
 
 # 15.9.4.2
 @w_return
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to