From 23ec578a016d5d8b4e55553924d3d37d899854c8 Mon Sep 17 00:00:00 2001 From: mattco98 Date: Mon, 27 Apr 2020 23:05:02 -0700 Subject: LibJS: Implement correct attributes for (almost) all properties Added the ability to include a u8 attributes parameter with all of the various put methods in the Object class. They can be omitted, in which case it defaults to "Writable | Enumerable | Configurable", just like before this commit. All of the attribute values for each property were gathered from SpiderMonkey in the Firefox console. Some properties (e.g. all of the canvas element properties) have undefined property descriptors... not quite sure what that means. Those were left as the default specified above. --- Libraries/LibJS/Runtime/DateConstructor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Libraries/LibJS/Runtime/DateConstructor.cpp') diff --git a/Libraries/LibJS/Runtime/DateConstructor.cpp b/Libraries/LibJS/Runtime/DateConstructor.cpp index d2f09ff9f3..a9f573e6be 100644 --- a/Libraries/LibJS/Runtime/DateConstructor.cpp +++ b/Libraries/LibJS/Runtime/DateConstructor.cpp @@ -37,10 +37,10 @@ namespace JS { DateConstructor::DateConstructor() : NativeFunction("Date", *interpreter().global_object().function_prototype()) { - put("prototype", interpreter().global_object().date_prototype()); - put("length", Value(7)); + put("prototype", interpreter().global_object().date_prototype(), 0); + put("length", Value(7), Attribute::Configurable); - put_native_function("now", now); + put_native_function("now", now, 0, Attribute::Writable | Attribute::Configurable); } DateConstructor::~DateConstructor() -- cgit v1.2.3