Index: test/intl/general/mapped-locale.js |
diff --git a/src/extensions/i18n/i18n-extension.h b/test/intl/general/mapped-locale.js |
similarity index 61% |
copy from src/extensions/i18n/i18n-extension.h |
copy to test/intl/general/mapped-locale.js |
index 050c336a67a21fd6cb32892e14215cac11971111..0461d9d4e5f45e042281ed1b65405f8ea549d56d 100644 |
--- a/src/extensions/i18n/i18n-extension.h |
+++ b/test/intl/general/mapped-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_ |
+// Make sure that zh locales map properly, i.e. don't map zh-TW to zh. |
-#include "v8.h" |
+var nf = Intl.NumberFormat(['zh-TW'], {localeMatcher: 'lookup'}); |
+assertEquals('zh-TW', nf.resolvedOptions().locale); |
-namespace v8_i18n { |
+var nf = Intl.NumberFormat(['zh-Hant-TW'], {localeMatcher: 'lookup'}); |
+assertEquals('zh-Hant-TW', nf.resolvedOptions().locale); |
-class Extension : public v8::Extension { |
- public: |
- Extension(); |
+var nf = Intl.NumberFormat(['zh-Hant'], {localeMatcher: 'lookup'}); |
+assertEquals('zh-Hant', nf.resolvedOptions().locale); |
- virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction( |
- v8::Handle<v8::String> name); |
+nf = Intl.NumberFormat(['zh'], {localeMatcher: 'lookup'}); |
+assertEquals('zh', nf.resolvedOptions().locale); |
- static void Register(); |
+nf = Intl.NumberFormat(['zh-CN'], {localeMatcher: 'lookup'}); |
+assertEquals('zh-CN', nf.resolvedOptions().locale); |
- private: |
- static Extension* extension_; |
-}; |
+nf = Intl.NumberFormat(['zh-Hans-CN'], {localeMatcher: 'lookup'}); |
+assertEquals('zh-Hans-CN', nf.resolvedOptions().locale); |
-} // namespace v8_i18n |
+nf = Intl.NumberFormat(['zh-Hans'], {localeMatcher: 'lookup'}); |
+assertEquals('zh-Hans', nf.resolvedOptions().locale); |
-#endif // V8_EXTENSIONS_I18N_I18N_EXTENSION_H_ |
+nf = Intl.NumberFormat(['en-US'], {localeMatcher: 'lookup'}); |
+assertEquals('en-US', nf.resolvedOptions().locale); |