docs: public static Object sync(Context cx, Scriptable thisObj, Object[] args,
              Function funObj) {
          if (args.length == 1 && args[0] instanceof Function) {
              return new Synchronizer((Function)args[0]);
          } else {
              throw Context.reportRuntimeError("wrong argument(s) for sync");
          }
      }