mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
LibJS: Add the String.prototype.trim{Left, Right} aliases
These are the same as trim{Start, End} respectively.
This commit is contained in:
parent
33eb9a6ddc
commit
de8d081ca4
2 changed files with 4 additions and 0 deletions
|
@ -256,6 +256,8 @@ namespace JS {
|
|||
P(trace) \
|
||||
P(trim) \
|
||||
P(trimEnd) \
|
||||
P(trimLeft) \
|
||||
P(trimRight) \
|
||||
P(trimStart) \
|
||||
P(trunc) \
|
||||
P(undefined) \
|
||||
|
|
|
@ -78,7 +78,9 @@ void StringPrototype::initialize(GlobalObject& global_object)
|
|||
define_native_function(vm.names.padEnd, pad_end, 1, attr);
|
||||
define_native_function(vm.names.trim, trim, 0, attr);
|
||||
define_native_function(vm.names.trimStart, trim_start, 0, attr);
|
||||
define_property(vm.names.trimLeft, get(vm.names.trimStart, {}, true), attr);
|
||||
define_native_function(vm.names.trimEnd, trim_end, 0, attr);
|
||||
define_property(vm.names.trimRight, get(vm.names.trimEnd, {}, true), attr);
|
||||
define_native_function(vm.names.concat, concat, 1, attr);
|
||||
define_native_function(vm.names.substr, substr, 2, attr);
|
||||
define_native_function(vm.names.substring, substring, 2, attr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue