Skip to content

Commit

Permalink
builtins/function: add apply
Browse files Browse the repository at this point in the history
test262: 50.89% (+0.12) | πŸ§ͺ 48381 | 🀠 24621 (+59) | ❌ 6888 (+12) | πŸ’€ 15328 (-71) | πŸ—οΈ 147 | πŸ’₯ 329 | ⏰ 132 | πŸ“ 936
  • Loading branch information
CanadaHonk committed Nov 9, 2024
1 parent 81a7461 commit be33779
Show file tree
Hide file tree
Showing 5 changed files with 370 additions and 358 deletions.
7 changes: 6 additions & 1 deletion compiler/builtins/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ export const __Function_prototype_toString = (_this: Function) => {
return out;
};

export const __Function_prototype_toLocaleString = (_this: Function) => __Function_prototype_toString(_this);
export const __Function_prototype_toLocaleString = (_this: Function) => __Function_prototype_toString(_this);

export const __Function_prototype_apply = (_this: Function, thisArg: any, argsArray: any) => {
argsArray = Array.from(argsArray ?? []);
return Reflect.apply(_this, thisArg, argsArray);
};
Loading

0 comments on commit be33779

Please sign in to comment.