docs: public static Object sync(Context cx, Scriptable thisObj, Object[] args,
                                Function funObj)
      {
          if (args.length >= 1 && args.length <= 2 && args[0] instanceof Function) {
              Object syncObject = null;
              if (args.length == 2 && args[1] != Undefined.instance) {
                  syncObject = args[1];
              }
              return new Synchronizer((Function)args[0], syncObject);
          }
          else {
              throw reportRuntimeError("msg.sync.args");
          }
      }