1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 14:15:07 +00:00

LibJS: Add some more items to CommonPropertyNames that I missed

This commit is contained in:
Andreas Kling 2020-10-14 00:03:58 +02:00
parent 2983215fb1
commit a1029738fd
4 changed files with 31 additions and 20 deletions

View file

@ -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" };

View file

@ -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()

View file

@ -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()

View file

@ -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()