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

Everywhere: Rename {Deprecated => Byte}String

This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
This commit is contained in:
Ali Mohammad Pur 2023-12-16 17:49:34 +03:30 committed by Ali Mohammad Pur
parent 38d62563b3
commit 5e1499d104
1615 changed files with 10257 additions and 10257 deletions

View file

@ -364,7 +364,7 @@ WebIDL::CallbackType* EventTarget::get_current_value_of_event_handler(FlyString
auto& event_handler = event_handler_iterator->value;
// 3. If eventHandler's value is an internal raw uncompiled handler, then:
if (event_handler->value.has<DeprecatedString>()) {
if (event_handler->value.has<ByteString>()) {
// 1. If eventTarget is an element, then let element be eventTarget, and document be element's node document.
// Otherwise, eventTarget is a Window object, let element be null, and document be eventTarget's associated Document.
JS::GCPtr<Element> element;
@ -387,7 +387,7 @@ WebIDL::CallbackType* EventTarget::get_current_value_of_event_handler(FlyString
return nullptr;
// 3. Let body be the uncompiled script body in eventHandler's value.
auto& body = event_handler->value.get<DeprecatedString>();
auto& body = event_handler->value.get<ByteString>();
// FIXME: 4. Let location be the location where the script body originated, as given by eventHandler's value.
@ -418,7 +418,7 @@ WebIDL::CallbackType* EventTarget::get_current_value_of_event_handler(FlyString
builder.appendff("function {}(event) {{\n{}\n}}", name, body);
}
auto source_text = builder.to_deprecated_string();
auto source_text = builder.to_byte_string();
auto parser = JS::Parser(JS::Lexer(source_text));
@ -486,7 +486,7 @@ WebIDL::CallbackType* EventTarget::get_current_value_of_event_handler(FlyString
// 6. Return scope. (NOTE: Not necessary)
auto function = JS::ECMAScriptFunctionObject::create(realm, name.to_deprecated_fly_string(), builder.to_deprecated_string(), program->body(), program->parameters(), program->function_length(), program->local_variables_names(), scope, nullptr, JS::FunctionKind::Normal, program->is_strict_mode(), program->might_need_arguments_object(), is_arrow_function);
auto function = JS::ECMAScriptFunctionObject::create(realm, name.to_deprecated_fly_string(), builder.to_byte_string(), program->body(), program->parameters(), program->function_length(), program->local_variables_names(), scope, nullptr, JS::FunctionKind::Normal, program->is_strict_mode(), program->might_need_arguments_object(), is_arrow_function);
// 10. Remove settings object's realm execution context from the JavaScript execution context stack.
VERIFY(vm.execution_context_stack().last() == &settings_object.realm_execution_context());
@ -747,7 +747,7 @@ void EventTarget::element_event_handler_attribute_changed(FlyString const& local
// NOTE: See the optimization comments in set_event_handler_attribute.
if (event_handler_iterator == handler_map.end()) {
auto new_event_handler = heap().allocate_without_realm<HTML::EventHandler>(value->to_deprecated_string());
auto new_event_handler = heap().allocate_without_realm<HTML::EventHandler>(value->to_byte_string());
// 6. Activate an event handler given eventTarget and name.
event_target->activate_event_handler(local_name, *new_event_handler);
@ -759,7 +759,7 @@ void EventTarget::element_event_handler_attribute_changed(FlyString const& local
auto& event_handler = event_handler_iterator->value;
// 6. Activate an event handler given eventTarget and name.
event_handler->value = value->to_deprecated_string();
event_handler->value = value->to_byte_string();
event_target->activate_event_handler(local_name, *event_handler);
}