From 32164a41c96812915a939bccbda846d73ddfac21 Mon Sep 17 00:00:00 2001 From: Robert Krimen Date: Mon, 3 Jun 2013 18:31:30 -0700 Subject: [PATCH] Fix Date built-in attribute defaults (true, false, true) --- date_test.go | 5 +++++ global.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/date_test.go b/date_test.go index 73a2a01..22107e4 100644 --- a/date_test.go +++ b/date_test.go @@ -94,6 +94,11 @@ func TestDate(t *testing.T) { // Date() test(`typeof Date()`, "string") test(`typeof Date(2006, 1, 2)`, "string") + + test(` + abc = Object.getOwnPropertyDescriptor(Date, "parse"); + [ abc.value === Date.parse, abc.writable, abc.enumerable, abc.configurable ]; + `, "true,true,false,true") } func TestDate_parse(t *testing.T) { diff --git a/global.go b/global.go index f9632ad..b94130f 100644 --- a/global.go +++ b/global.go @@ -662,7 +662,7 @@ func newContext() *_runtime { ) self.Global.Date.write( - _propertyMode(0), + _propertyMode(0101), "parse", builtinDate_parse, "UTC", builtinDate_UTC, )