function _wrap(shim, original, name, spec, args) {
  // Assemble the spec's arguments.
  const specArgs = [shim, original, name]
  if (args && args.length) {
    specArgs.push.apply(specArgs, args)
  }

  // Apply the spec and see if it returned a wrapped version of the property.
  let wrapped = spec.wrapper.apply(null, specArgs)
  if (wrapped && wrapped !== original) {
    if (spec.matchArity && shim.isFunction(wrapped)) {
      wrapped = arity.fixArity(original, wrapped)
    }

    shim.assignOriginal(wrapped, original)

    if (shim._debug) {
      shim._wrapped.push(wrapped)
    }
  } else {
    wrapped = original
  }
  return wrapped
}
Executes the provided spec on the given object.

- `_wrap(shim, original, name, spec [, args])`

@private
@param {Shim} shim
 The shim that is executing the wrapping.
@param {*} original
 The object being wrapped.
@param {string} name
 A logical name for the item to be wrapped.
@param {WrapFunction} spec
 The spec for wrapping these items.
@param {Array.<*>} [args]
 Optional extra arguments to be sent to the spec when executing it.
@returns {Function} The return value from `spec` or the original value if it
 did not return anything.