function recordConstructor(ctor) {
  const recordedConstructor = recordFunction(ctor);
  recordedConstructor.prototype = ctor.prototype;

  // NOTE: This does not handle non-enumerable properties, should it?
  for (const x in ctor) {
    recordedConstructor[x] = ctor[x];
  }
  return recordedConstructor;
}
Same as {@link goog.testing.recordFunction} but the recorded function will
have the same prototype and static fields as the original one. It can be
used with constructors.

@param {!Function} ctor The function to wrap and record.
@return {!Function} The wrapped function.