diff options
author | mattco98 <matthewcolsson@gmail.com> | 2020-04-27 23:05:02 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-28 09:29:50 +0200 |
commit | 23ec578a016d5d8b4e55553924d3d37d899854c8 (patch) | |
tree | ac0f63ca92b68205d47fe46b127717ecee3dfa33 /Libraries/LibJS/Runtime/DateConstructor.cpp | |
parent | c4d05049c478980e3087c4043ec36ec315ee0f71 (diff) | |
download | serenity-23ec578a016d5d8b4e55553924d3d37d899854c8.zip |
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.
Diffstat (limited to 'Libraries/LibJS/Runtime/DateConstructor.cpp')
-rw-r--r-- | Libraries/LibJS/Runtime/DateConstructor.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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() |