mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 10:09:14 +00:00
LibJS: Accept FlyStrings in the NativeFunction constructors
This makes the implicit run-time assertion in PropertyName::to_string() into an explicit compile-time requirement, removes a wasteful FlyString -> PropertyName -> FlyString construction from NativeFunction::create() and allows setting the function name to a null string for anonymous native functions.
This commit is contained in:
parent
16eb0803fc
commit
581f20e6f2
Notes:
sideshowbarker
2024-07-18 11:25:43 +09:00
Author: https://github.com/IdanHo
Commit: 581f20e6f2
Pull-request: https://github.com/SerenityOS/serenity/pull/8280
24 changed files with 28 additions and 28 deletions
|
@ -20,16 +20,16 @@ NativeFunction::NativeFunction(Object& prototype)
|
|||
{
|
||||
}
|
||||
|
||||
NativeFunction::NativeFunction(PropertyName const& name, Function<Value(VM&, GlobalObject&)> native_function, Object& prototype)
|
||||
NativeFunction::NativeFunction(FlyString name, Function<Value(VM&, GlobalObject&)> native_function, Object& prototype)
|
||||
: FunctionObject(prototype)
|
||||
, m_name(name.as_string())
|
||||
, m_name(move(name))
|
||||
, m_native_function(move(native_function))
|
||||
{
|
||||
}
|
||||
|
||||
NativeFunction::NativeFunction(PropertyName const& name, Object& prototype)
|
||||
NativeFunction::NativeFunction(FlyString name, Object& prototype)
|
||||
: FunctionObject(prototype)
|
||||
, m_name(name.as_string())
|
||||
, m_name(move(name))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue