src/third_party/v8-3.25/src/i18n.js
/**
 * Returns options with at least default values in it.
 */
Returns options with at least default values in it.
Returns options with at least default values in it .
function toDateTimeOptions(options, required, defaults) {
  if (options === undefined) {
    options = null;
  } else {
    options = toObject(options);
  }
  options = $Object.apply(this, [options]);
  var needsDefault = true;
  if ((required === 'date' || required === 'any') &&
      (options.weekday !== undefined || options.year !== undefined ||
       options.month !== undefined || options.day !== undefined)) {
    needsDefault = false;
  }
  if ((required === 'time' || required === 'any') &&
      (options.hour !== undefined || options.minute !== undefined ||
       options.second !== undefined)) {
    needsDefault = false;
  }
  if (needsDefault && (defaults === 'date' || defaults === 'all')) {
    $Object.defineProperty(options, 'year', {value: 'numeric',
                                             writable: true,
                                             enumerable: true,
                                             configurable: true});
    $Object.defineProperty(options, 'month', {value: 'numeric',
                                              writable: true,
                                              enumerable: true,
                                              configurable: true});
    $Object.defineProperty(options, 'day', {value: 'numeric',
                                            writable: true,
                                            enumerable: true,
                                            configurable: true});
  }
  if (needsDefault && (defaults === 'time' || defaults === 'all')) {
    $Object.defineProperty(options, 'hour', {value: 'numeric',
                                             writable: true,
                                             enumerable: true,
                                             configurable: true});
    $Object.defineProperty(options, 'minute', {value: 'numeric',
                                               writable: true,
                                               enumerable: true,
                                               configurable: true});
    $Object.defineProperty(options, 'second', {value: 'numeric',
                                               writable: true,
                                               enumerable: true,
                                               configurable: true});
  }
  return options;
}
function toDateTimeOptions ( options , required , defaults ) { if ( options === undefined ) { options = null ; } else { options = toObject ( options ) ; } options = $Object . apply ( this , [ options ] ) ; var needsDefault = true ; if ( ( required === 'date' || required === 'any' ) && ( options . weekday !== undefined || options . year !== undefined || options . month !== undefined || options . day !== undefined ) ) { needsDefault = false ; } if ( ( required === 'time' || required === 'any' ) && ( options . hour !== undefined || options . minute !== undefined || options . second !== undefined ) ) { needsDefault = false ; } if ( needsDefault && ( defaults === 'date' || defaults === 'all' ) ) { $Object . defineProperty ( options , 'year' , { value : 'numeric' , writable : true , enumerable : true , configurable : true } ) ; $Object . defineProperty ( options , 'month' , { value : 'numeric' , writable : true , enumerable : true , configurable : true } ) ; $Object . defineProperty ( options , 'day' , { value : 'numeric' , writable : true , enumerable : true , configurable : true } ) ; } if ( needsDefault && ( defaults === 'time' || defaults === 'all' ) ) { $Object . defineProperty ( options , 'hour' , { value : 'numeric' , writable : true , enumerable : true , configurable : true } ) ; $Object . defineProperty ( options , 'minute' , { value : 'numeric' , writable : true , enumerable : true , configurable : true } ) ; $Object . defineProperty ( options , 'second' , { value : 'numeric' , writable : true , enumerable : true , configurable : true } ) ; } return options ; }
Returns options with at least default values in it.
Returns options with at least default values in it .