Rewrite js native functions to use new CallArgs api