Index: src/extensions/i18n/locale.h |
diff --git a/test/cctest/test-global-object.cc b/src/extensions/i18n/locale.h |
similarity index 60% |
copy from test/cctest/test-global-object.cc |
copy to src/extensions/i18n/locale.h |
index b124b2728dfe102fb9654c25ea0103e810c874f6..c39568e5d9d69104b8b4d3dbb35ca197a813c9a3 100644 |
--- a/test/cctest/test-global-object.cc |
+++ b/src/extensions/i18n/locale.h |
@@ -24,28 +24,33 @@ |
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+// limitations under the License. |
+#ifndef V8_EXTENSIONS_I18N_SRC_LOCALE_H_ |
+#define V8_EXTENSIONS_I18N_SRC_LOCALE_H_ |
+ |
+#include "unicode/uversion.h" |
#include "v8.h" |
-#include "cctest.h" |
- |
-using namespace v8; |
- |
-// This test fails if properties on the prototype of the global object appear |
-// as declared globals. |
-TEST(StrictUndeclaredGlobalVariable) { |
- HandleScope scope(Isolate::GetCurrent()); |
- v8::Local<v8::String> var_name = v8_str("x"); |
- LocalContext context; |
- v8::TryCatch try_catch; |
- v8::Local<v8::Script> script = v8_compile("\"use strict\"; x = 42;"); |
- v8::Handle<v8::Object> proto = v8::Object::New(); |
- v8::Handle<v8::Object> global = |
- context->Global()->GetPrototype().As<v8::Object>(); |
- proto->Set(var_name, v8_num(100)); |
- global->SetPrototype(proto); |
- script->Run(); |
- CHECK(try_catch.HasCaught()); |
- v8::String::Utf8Value exception(try_catch.Exception()); |
- CHECK_EQ("ReferenceError: x is not defined", *exception); |
-} |
+namespace v8_i18n { |
+ |
+// Canonicalizes the BCP47 language tag using BCP47 rules. |
+// Returns 'invalid-tag' in case input was not well formed. |
+void JSCanonicalizeLanguageTag(const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
+// Returns a list of available locales for collator, date or number formatter. |
+void JSAvailableLocalesOf(const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
+// Returns default ICU locale. |
+void JSGetDefaultICULocale(const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
+// Returns an array of objects, that have maximized and base names of inputs. |
+// Unicode extensions are dropped from both. |
+// Input: ['zh-TW-u-nu-thai', 'sr'] |
+// Output: [{maximized: 'zh-Hant-TW', base: 'zh-TW'}, |
+// {maximized: 'sr-Cyrl-RS', base: 'sr'}] |
+void JSGetLanguageTagVariants(const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
+} // namespace v8_i18n |
+ |
+#endif // V8_EXTENSIONS_I18N_LOCALE_H_ |