| 4618 | } |
| 4619 | |
| 4620 | bool String::is_valid_unicode_identifier() const { |
| 4621 | const char32_t *str = ptr(); |
| 4622 | int len = length(); |
| 4623 | |
| 4624 | if (len == 0) { |
| 4625 | return false; // Empty string. |
| 4626 | } |
| 4627 | |
| 4628 | if (!is_unicode_identifier_start(str[0])) { |
| 4629 | return false; |
| 4630 | } |
| 4631 | |
| 4632 | for (int i = 1; i < len; i++) { |
| 4633 | if (!is_unicode_identifier_continue(str[i])) { |
| 4634 | return false; |
| 4635 | } |
| 4636 | } |
| 4637 | return true; |
| 4638 | } |
| 4639 | |
| 4640 | bool String::is_valid_string() const { |
| 4641 | int l = length(); |
no test coverage detected