| Index: test/intl/collator/default-locale.js
|
| diff --git a/src/extensions/i18n/i18n-extension.h b/test/intl/collator/default-locale.js
|
| similarity index 65%
|
| copy from src/extensions/i18n/i18n-extension.h
|
| copy to test/intl/collator/default-locale.js
|
| index 050c336a67a21fd6cb32892e14215cac11971111..9edfae206799d482beb4e13e8b17ba35e90e0bb4 100644
|
| --- a/src/extensions/i18n/i18n-extension.h
|
| +++ b/test/intl/collator/default-locale.js
|
| @@ -26,26 +26,28 @@
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| // limitations under the License.
|
|
|
| -#ifndef V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
|
| -#define V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
|
| +// Constructing Collator with no locale arguments or with []
|
| +// creates one with default locale.
|
|
|
| -#include "v8.h"
|
| +var collator = new Intl.Collator([]);
|
|
|
| -namespace v8_i18n {
|
| +var options = collator.resolvedOptions();
|
|
|
| -class Extension : public v8::Extension {
|
| - public:
|
| - Extension();
|
| +// Check it's none of these first.
|
| +assertFalse(options.locale === 'und');
|
| +assertFalse(options.locale === '');
|
| +assertFalse(options.locale === undefined);
|
|
|
| - virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
|
| - v8::Handle<v8::String> name);
|
| +// Then check for equality.
|
| +assertEquals(options.locale, getDefaultLocale());
|
|
|
| - static void Register();
|
| +var collatorNone = new Intl.Collator();
|
| +assertEquals(options.locale, collatorNone.resolvedOptions().locale);
|
|
|
| - private:
|
| - static Extension* extension_;
|
| -};
|
| +// TODO(cira): remove support for {} to mean empty list.
|
| +var collatorBraket = new Intl.Collator({});
|
| +assertEquals(options.locale, collatorBraket.resolvedOptions().locale);
|
|
|
| -} // namespace v8_i18n
|
| -
|
| -#endif // V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
|
| +var collatorWithOptions = new Intl.Collator(undefined, {usage: 'search'});
|
| +assertEquals(getDefaultLocale() + '-u-co-search',
|
| + collatorWithOptions.resolvedOptions().locale);
|
|
|