1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +00:00

LibJS: Implement Function.prototype.bind()

This commit is contained in:
Jack Karamanian 2020-04-19 15:03:02 -05:00 committed by Andreas Kling
parent b3800829da
commit 1fa0c7304d
10 changed files with 317 additions and 6 deletions

View file

@ -114,9 +114,8 @@ Value CallExpression::execute(Interpreter& interpreter) const
auto& function = static_cast<Function&>(callee.as_object());
MarkedValueList arguments(interpreter.heap());
for (auto bound_argument : function.bound_arguments()) {
arguments.append(bound_argument);
}
arguments.values().append(function.bound_arguments());
for (size_t i = 0; i < m_arguments.size(); ++i) {
auto value = m_arguments[i].execute(interpreter);
if (interpreter.exception())