diff --git a/Libraries/LibJS/Runtime/CommonPropertyNames.h b/Libraries/LibJS/Runtime/CommonPropertyNames.h index f13e0f84e5..b474726054 100644 --- a/Libraries/LibJS/Runtime/CommonPropertyNames.h +++ b/Libraries/LibJS/Runtime/CommonPropertyNames.h @@ -71,17 +71,24 @@ namespace JS { P(ceil) \ P(charAt) \ P(charCodeAt) \ + P(clear) \ P(clz32) \ P(concat) \ + P(configurable) \ P(console) \ P(construct) \ P(constructor) \ P(cos) \ + P(count) \ + P(countReset) \ + P(debug) \ P(defineProperty) \ P(deleteProperty) \ P(description) \ P(done) \ P(entries) \ + P(enumerable) \ + P(error) \ P(every) \ P(exp) \ P(expm1) \ @@ -120,6 +127,7 @@ namespace JS { P(hasOwnProperty) \ P(includes) \ P(indexOf) \ + P(info) \ P(is) \ P(isArray) \ P(isExtensible) \ @@ -132,12 +140,14 @@ namespace JS { P(keys) \ P(lastIndexOf) \ P(length) \ + P(log) \ P(log1p) \ P(map) \ P(max) \ P(message) \ P(min) \ P(name) \ + P(next) \ P(now) \ P(of) \ P(ownKeys) \ @@ -167,6 +177,7 @@ namespace JS { P(splice) \ P(sqrt) \ P(startsWith) \ + P(stringify) \ P(substring) \ P(tan) \ P(toDateString) \ @@ -179,6 +190,7 @@ namespace JS { P(toString) \ P(toTimeString) \ P(toUpperCase) \ + P(trace) \ P(trim) \ P(trimEnd) \ P(trimStart) \ @@ -187,11 +199,9 @@ namespace JS { P(unshift) \ P(value) \ P(valueOf) \ - P(enumerable) \ - P(configurable) \ - P(writable) \ - P(next) \ - P(values) + P(values) \ + P(warn) \ + P(writable) struct CommonPropertyNames { FlyString for_ { "for" }; diff --git a/Libraries/LibJS/Runtime/ConsoleObject.cpp b/Libraries/LibJS/Runtime/ConsoleObject.cpp index 49cf76491c..f87b29c0a1 100644 --- a/Libraries/LibJS/Runtime/ConsoleObject.cpp +++ b/Libraries/LibJS/Runtime/ConsoleObject.cpp @@ -41,16 +41,17 @@ ConsoleObject::ConsoleObject(GlobalObject& global_object) void ConsoleObject::initialize(GlobalObject& global_object) { + auto& vm = this->vm(); Object::initialize(global_object); - define_native_function("log", log); - define_native_function("debug", debug); - define_native_function("info", info); - define_native_function("warn", warn); - define_native_function("error", error); - define_native_function("trace", trace); - define_native_function("count", count); - define_native_function("countReset", count_reset); - define_native_function("clear", clear); + define_native_function(vm.names.log, log); + define_native_function(vm.names.debug, debug); + define_native_function(vm.names.info, info); + define_native_function(vm.names.warn, warn); + define_native_function(vm.names.error, error); + define_native_function(vm.names.trace, trace); + define_native_function(vm.names.count, count); + define_native_function(vm.names.countReset, count_reset); + define_native_function(vm.names.clear, clear); } ConsoleObject::~ConsoleObject() diff --git a/Libraries/LibJS/Runtime/JSONObject.cpp b/Libraries/LibJS/Runtime/JSONObject.cpp index 4b43007d3a..692b0b5566 100644 --- a/Libraries/LibJS/Runtime/JSONObject.cpp +++ b/Libraries/LibJS/Runtime/JSONObject.cpp @@ -44,12 +44,12 @@ JSONObject::JSONObject(GlobalObject& global_object) void JSONObject::initialize(GlobalObject& global_object) { + auto& vm = this->vm(); Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function("stringify", stringify, 3, attr); - define_native_function("parse", parse, 2, attr); - - define_property(global_object.vm().well_known_symbol_to_string_tag(), js_string(global_object.heap(), "JSON"), Attribute::Configurable); + define_native_function(vm.names.stringify, stringify, 3, attr); + define_native_function(vm.names.parse, parse, 2, attr); + define_property(vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "JSON"), Attribute::Configurable); } JSONObject::~JSONObject() diff --git a/Libraries/LibJS/Runtime/NumberPrototype.cpp b/Libraries/LibJS/Runtime/NumberPrototype.cpp index 3769fcae9f..78ac301606 100644 --- a/Libraries/LibJS/Runtime/NumberPrototype.cpp +++ b/Libraries/LibJS/Runtime/NumberPrototype.cpp @@ -50,9 +50,9 @@ NumberPrototype::NumberPrototype(GlobalObject& global_object) void NumberPrototype::initialize(GlobalObject& object) { + auto& vm = this->vm(); Object::initialize(object); - - define_native_function("toString", to_string, 1, Attribute::Configurable | Attribute::Writable); + define_native_function(vm.names.toString, to_string, 1, Attribute::Configurable | Attribute::Writable); } NumberPrototype::~NumberPrototype()