소스 검색

LibJS: Don't repeat attributes in {Date,Symbol}Constructor

Linus Groh 4 년 전
부모
커밋
8d1e6e9175
2개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. 4 3
      Userland/Libraries/LibJS/Runtime/DateConstructor.cpp
  2. 3 2
      Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp

+ 4 - 3
Userland/Libraries/LibJS/Runtime/DateConstructor.cpp

@@ -134,9 +134,10 @@ void DateConstructor::initialize(GlobalObject& global_object)
 
     define_property(vm.names.length, Value(7), Attribute::Configurable);
 
-    define_native_function(vm.names.now, now, 0, Attribute::Writable | Attribute::Configurable);
-    define_native_function(vm.names.parse, parse, 1, Attribute::Writable | Attribute::Configurable);
-    define_native_function(vm.names.UTC, utc, 1, Attribute::Writable | Attribute::Configurable);
+    u8 attr = Attribute::Writable | Attribute::Configurable;
+    define_native_function(vm.names.now, now, 0, attr);
+    define_native_function(vm.names.parse, parse, 1, attr);
+    define_native_function(vm.names.UTC, utc, 1, attr);
 }
 
 DateConstructor::~DateConstructor()

+ 3 - 2
Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp

@@ -25,8 +25,9 @@ void SymbolConstructor::initialize(GlobalObject& global_object)
 
     define_property(vm.names.length, Value(0), Attribute::Configurable);
 
-    define_native_function(vm.names.for_, for_, 1, Attribute::Writable | Attribute::Configurable);
-    define_native_function(vm.names.keyFor, key_for, 1, Attribute::Writable | Attribute::Configurable);
+    u8 attr = Attribute::Writable | Attribute::Configurable;
+    define_native_function(vm.names.for_, for_, 1, attr);
+    define_native_function(vm.names.keyFor, key_for, 1, attr);
 
 #define __JS_ENUMERATE(SymbolName, snake_name) \
     define_property(vm.names.SymbolName, vm.well_known_symbol_##snake_name(), 0);