Skip to content

Commit

Permalink
es: throw UnsupportedErr if Func.callOn not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Giannini authored and Matthew Giannini committed Aug 22, 2024
1 parent 3813383 commit 9f0af73
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sys/es/fan/Func.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ class Func extends Obj {
if (f.__method) return f.__method.call(...args);
return f(...args);
}
static callOn(f, obj, args) { return f.__method.callOn(obj, args); }
static callOn(f, obj, args) {
if (f.__method) return f.__method.callOn(obj, args);
throw UnsupportedErr.make();
}
static callList(f, args) {
if (f.__method) return f.__method.callList(args);
return f.apply(null, args);
Expand Down

0 comments on commit 9f0af73

Please sign in to comment.