deps/v8/src/js/i18n.js
function initializeBreakIterator(iterator, locales, options) {
  if (%IsInitializedIntlObject(iterator)) {
    throw MakeTypeError(kReinitializeIntl, "v8BreakIterator");
  }

  if (IS_UNDEFINED(options)) {
    options = {};
  }

  var getOption = getGetOption(options, 'breakiterator');

  var internalOptions = {};

  defineWEProperty(internalOptions, 'type', getOption(
    'type', 'string', ['character', 'word', 'sentence', 'line'], 'word'));

  var locale = resolveLocale('breakiterator', locales, options);
  var resolved = %object_define_properties({}, {
    requestedLocale: {value: locale.locale, writable: true},
    type: {value: internalOptions.type, writable: true},
    locale: {writable: true}
  });

  var internalIterator = %CreateBreakIterator(locale.locale,
                                              internalOptions,
                                              resolved);

  %MarkAsInitializedIntlObjectOfType(iterator, 'breakiterator',
                                     internalIterator);
  iterator[resolvedSymbol] = resolved;
  if (FLAG_intl_extra) {
    %object_define_property(iterator, 'resolved', resolvedAccessor);
  }

  return iterator;
}
function initializeBreakIterator(iterator, locales, options) {
  if (%IsInitializedIntlObject(iterator)) {
    throw MakeTypeError(kReinitializeIntl, "v8BreakIterator");
  }

  if (IS_UNDEFINED(options)) {
    options = {};
  }

  var getOption = getGetOption(options, 'breakiterator');

  var internalOptions = {};

  defineWEProperty(internalOptions, 'type', getOption(
    'type', 'string', ['character', 'word', 'sentence', 'line'], 'word'));

  var locale = resolveLocale('breakiterator', locales, options);
  var resolved = %object_define_properties({}, {
    requestedLocale: {value: locale.locale, writable: true},
    type: {value: internalOptions.type, writable: true},
    locale: {writable: true}
  });

  var internalIterator = %CreateBreakIterator(locale.locale,
                                              internalOptions,
                                              resolved);

  %MarkAsInitializedIntlObjectOfType(iterator, 'breakiterator',
                                     internalIterator);
  iterator[resolvedSymbol] = resolved;
  if (FLAG_intl_extra) {
    %object_define_property(iterator, 'resolved', resolvedAccessor);
  }

  return iterator;
}
function initializeBreakIterator ( iterator , locales , options ) { if ( % IsInitializedIntlObject ( iterator ) ) { throw MakeTypeError ( kReinitializeIntl , "v8BreakIterator" ) ; } if ( IS_UNDEFINED ( options ) ) { options = { } ; } var getOption = getGetOption ( options , 'breakiterator' ) ; var internalOptions = { } ; defineWEProperty ( internalOptions , 'type' , getOption ( 'type' , 'string' , [ 'character' , 'word' , 'sentence' , 'line' ] , 'word' ) ) ; var locale = resolveLocale ( 'breakiterator' , locales , options ) ; var resolved = % object_define_properties ( { } , { requestedLocale : { value : locale . locale , writable : true } , type : { value : internalOptions . type , writable : true } , locale : { writable : true } } ) ; var internalIterator = % CreateBreakIterator ( locale . locale , internalOptions , resolved ) ; % MarkAsInitializedIntlObjectOfType ( iterator , 'breakiterator' , internalIterator ) ; iterator [ resolvedSymbol ] = resolved ; if ( FLAG_intl_extra ) { % object_define_property ( iterator , 'resolved' , resolvedAccessor ) ; } return iterator ; }
Initializes the given object so it's a valid BreakIterator instance.
Useful for subclassing.
Initializes the given object so it s a valid BreakIterator instance . Useful for subclassing .