mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibJS: Update spec steps / links for the RegExp.escape proposal
This proposal has reached stage 4 and been merged into the main ECMA-262
spec. See:
e2da759
This commit is contained in:
parent
2401764697
commit
adf6024805
Notes:
github-actions[bot]
2025-04-29 11:34:51 +00:00
Author: https://github.com/trflynn89
Commit: adf6024805
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4514
1 changed files with 4 additions and 4 deletions
|
@ -27,7 +27,7 @@ void RegExpConstructor::initialize(Realm& realm)
|
||||||
auto& vm = this->vm();
|
auto& vm = this->vm();
|
||||||
Base::initialize(realm);
|
Base::initialize(realm);
|
||||||
|
|
||||||
// 22.2.5.1 RegExp.prototype, https://tc39.es/ecma262/#sec-regexp.prototype
|
// 22.2.5.2 RegExp.prototype, https://tc39.es/ecma262/#sec-regexp.prototype
|
||||||
define_direct_property(vm.names.prototype, realm.intrinsics().regexp_prototype(), 0);
|
define_direct_property(vm.names.prototype, realm.intrinsics().regexp_prototype(), 0);
|
||||||
|
|
||||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||||
|
@ -147,7 +147,7 @@ ThrowCompletionOr<GC::Ref<Object>> RegExpConstructor::construct(FunctionObject&
|
||||||
return TRY(regexp_object->regexp_initialize(vm, pattern_value, flags_value));
|
return TRY(regexp_object->regexp_initialize(vm, pattern_value, flags_value));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 22.2.5.1.1 EncodeForRegExpEscape ( c ), https://tc39.es/proposal-regex-escaping/#sec-encodeforregexpescape
|
// 22.2.5.1.1 EncodeForRegExpEscape ( cp ), https://tc39.es/ecma262/#sec-encodeforregexpescape
|
||||||
static String encode_for_regexp_escape(u32 code_point)
|
static String encode_for_regexp_escape(u32 code_point)
|
||||||
{
|
{
|
||||||
// https://tc39.es/ecma262/#table-controlescape-code-point-values
|
// https://tc39.es/ecma262/#table-controlescape-code-point-values
|
||||||
|
@ -209,7 +209,7 @@ static String encode_for_regexp_escape(u32 code_point)
|
||||||
return String::from_code_point(code_point);
|
return String::from_code_point(code_point);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 22.2.5.1 RegExp.escape ( S ), https://tc39.es/proposal-regex-escaping/
|
// 22.2.5.1 RegExp.escape ( S ), https://tc39.es/ecma262/#sec-regexp.escape
|
||||||
JS_DEFINE_NATIVE_FUNCTION(RegExpConstructor::escape)
|
JS_DEFINE_NATIVE_FUNCTION(RegExpConstructor::escape)
|
||||||
{
|
{
|
||||||
auto string = vm.argument(0);
|
auto string = vm.argument(0);
|
||||||
|
@ -250,7 +250,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpConstructor::escape)
|
||||||
return JS::PrimitiveString::create(vm, MUST(escaped.to_string()));
|
return JS::PrimitiveString::create(vm, MUST(escaped.to_string()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 22.2.5.2 get RegExp [ @@species ], https://tc39.es/ecma262/#sec-get-regexp-@@species
|
// 22.2.5.3 get RegExp [ %Symbol.species% ], https://tc39.es/ecma262/#sec-get-regexp-@@species
|
||||||
JS_DEFINE_NATIVE_FUNCTION(RegExpConstructor::symbol_species_getter)
|
JS_DEFINE_NATIVE_FUNCTION(RegExpConstructor::symbol_species_getter)
|
||||||
{
|
{
|
||||||
// 1. Return the this value.
|
// 1. Return the this value.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue