summaryrefslogtreecommitdiff
path: root/Libraries/LibJS
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2020-08-05 16:31:20 -0400
committerAndreas Kling <kling@serenityos.org>2020-08-05 22:33:42 +0200
commitce95628b7f96924e851d8cedac1d784547600cd3 (patch)
tree533dad9932cfc954ead3cfc776a27a9f7c4333f9 /Libraries/LibJS
parent19ac1f6368c91cc00a68717001ea4eae65567a47 (diff)
downloadserenity-ce95628b7f96924e851d8cedac1d784547600cd3.zip
Unicode: Try s/codepoint/code_point/g again
This time, without trailing 's'. Ran: git grep -l 'codepoint' | xargs sed -ie 's/codepoint/code_point/g
Diffstat (limited to 'Libraries/LibJS')
-rw-r--r--Libraries/LibJS/Parser.cpp2
-rw-r--r--Libraries/LibJS/Runtime/StringIteratorPrototype.cpp2
-rw-r--r--Libraries/LibJS/Runtime/StringPrototype.cpp8
-rw-r--r--Libraries/LibJS/Runtime/Value.cpp8
-rw-r--r--Libraries/LibJS/Token.cpp4
5 files changed, 12 insertions, 12 deletions
diff --git a/Libraries/LibJS/Parser.cpp b/Libraries/LibJS/Parser.cpp
index f06bab3572..8411503777 100644
--- a/Libraries/LibJS/Parser.cpp
+++ b/Libraries/LibJS/Parser.cpp
@@ -834,7 +834,7 @@ NonnullRefPtr<StringLiteral> Parser::parse_string_literal(Token token)
auto type = status == Token::StringValueStatus::MalformedUnicodeEscape ? "unicode" : "hexadecimal";
message = String::format("Malformed %s escape sequence", type);
} else if (status == Token::StringValueStatus::UnicodeEscapeOverflow) {
- message = "Unicode codepoint must not be greater than 0x10ffff in escape sequence";
+ message = "Unicode code_point must not be greater than 0x10ffff in escape sequence";
}
syntax_error(
diff --git a/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp b/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp
index 39acbb25d7..15b3f15716 100644
--- a/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp
+++ b/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp
@@ -69,7 +69,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringIteratorPrototype::next)
}
StringBuilder builder;
- builder.append_codepoint(*utf8_iterator);
+ builder.append_code_point(*utf8_iterator);
++utf8_iterator;
return create_iterator_result_object(global_object, js_string(interpreter, builder.to_string()), false);
diff --git a/Libraries/LibJS/Runtime/StringPrototype.cpp b/Libraries/LibJS/Runtime/StringPrototype.cpp
index 529438baab..1b00208d30 100644
--- a/Libraries/LibJS/Runtime/StringPrototype.cpp
+++ b/Libraries/LibJS/Runtime/StringPrototype.cpp
@@ -321,7 +321,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::substring)
if (interpreter.argument_count() == 0)
return js_string(interpreter, string);
- // FIXME: index_start and index_end should index a UTF-16 codepoint view of the string.
+ // FIXME: index_start and index_end should index a UTF-16 code_point view of the string.
auto string_length = string.length();
auto index_start = min(interpreter.argument(0).to_size_t(interpreter), string_length);
if (interpreter.exception())
@@ -358,7 +358,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::includes)
if (interpreter.exception())
return {};
- // FIXME: position should index a UTF-16 codepoint view of the string.
+ // FIXME: position should index a UTF-16 code_point view of the string.
size_t position = 0;
if (interpreter.argument_count() >= 2) {
position = interpreter.argument(1).to_size_t(interpreter);
@@ -385,7 +385,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::slice)
if (interpreter.argument_count() == 0)
return js_string(interpreter, string);
- // FIXME: index_start and index_end should index a UTF-16 codepoint view of the string.
+ // FIXME: index_start and index_end should index a UTF-16 code_point view of the string.
auto string_length = static_cast<i32>(string.length());
auto index_start = interpreter.argument(0).to_i32(interpreter);
if (interpreter.exception())
@@ -437,7 +437,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::last_index_of)
auto max_index = string.length() - search_string.length();
auto from_index = max_index;
if (interpreter.argument_count() >= 2) {
- // FIXME: from_index should index a UTF-16 codepoint view of the string.
+ // FIXME: from_index should index a UTF-16 code_point view of the string.
from_index = min(interpreter.argument(1).to_size_t(interpreter), max_index);
if (interpreter.exception())
return {};
diff --git a/Libraries/LibJS/Runtime/Value.cpp b/Libraries/LibJS/Runtime/Value.cpp
index 82eb484ad0..af52fe2e51 100644
--- a/Libraries/LibJS/Runtime/Value.cpp
+++ b/Libraries/LibJS/Runtime/Value.cpp
@@ -917,10 +917,10 @@ TriState abstract_relation(Interpreter& interpreter, bool left_first, Value lhs,
if (y_string.starts_with(x_string))
return TriState::True;
- Utf8View x_codepoints { x_string };
- Utf8View y_codepoints { y_string };
- for (auto k = x_codepoints.begin(), l = y_codepoints.begin();
- k != x_codepoints.end() && l != y_codepoints.end();
+ Utf8View x_code_points { x_string };
+ Utf8View y_code_points { y_string };
+ for (auto k = x_code_points.begin(), l = y_code_points.begin();
+ k != x_code_points.end() && l != y_code_points.end();
++k, ++l) {
if (*k != *l) {
if (*k < *l) {
diff --git a/Libraries/LibJS/Token.cpp b/Libraries/LibJS/Token.cpp
index 9ceedc094f..22ec42ce80 100644
--- a/Libraries/LibJS/Token.cpp
+++ b/Libraries/LibJS/Token.cpp
@@ -136,7 +136,7 @@ String Token::string_value(StringValueStatus& status) const
auto digit2 = m_value[++i];
if (!isxdigit(digit1) || !isxdigit(digit2))
return encoding_failure(StringValueStatus::MalformedHexEscape);
- builder.append_codepoint(hex2int(digit1) * 16 + hex2int(digit2));
+ builder.append_code_point(hex2int(digit1) * 16 + hex2int(digit2));
break;
}
case 'u': {
@@ -174,7 +174,7 @@ String Token::string_value(StringValueStatus& status) const
}
}
- builder.append_codepoint(code_point);
+ builder.append_code_point(code_point);
break;
}
default: