Index: test/mjsunit/regress/supported-locales-of.js |
diff --git a/test/mjsunit/regress/supported-locales-of.js b/test/mjsunit/regress/supported-locales-of.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..04c99f2612b2ee84071e44ef78797382b9675d07 |
--- /dev/null |
+++ b/test/mjsunit/regress/supported-locales-of.js |
@@ -0,0 +1,31 @@ |
+// Copyright 2014 the V8 project authors. All rights reserved. |
Michael Starzinger
2014/04/29 20:20:28
nit: The name of the test-case is misleading as it
mvstanton
2014/04/30 07:15:59
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+function overflow() { |
+ return overflow() + 1; |
+} |
+Object.defineProperty = overflow; |
+assertDoesNotThrow(function() { Intl.Collator.supportedLocalesOf("en"); }); |
+ |
+var date = new Date(Date.UTC(2004, 12, 25, 3, 0, 0)); |
+var options = { |
+ weekday: "long", |
+ year: "numeric", |
+ month: "long", |
+ day: "numeric" |
+}; |
+ |
+ |
Michael Starzinger
2014/04/29 20:20:28
nit: Let's drop one of the two empty newlines.
mvstanton
2014/04/30 07:15:59
Done.
|
+Object.apply = overflow; |
+assertDoesNotThrow(function() { date.toLocaleDateString("de-DE", options); }); |
+ |
+var options_incomplete = {}; |
+assertDoesNotThrow(function() { |
+ date.toLocaleDateString("de-DE", options_incomplete); |
+}); |
+assertTrue(options_incomplete.hasOwnProperty("year")); |
+ |
+assertDoesNotThrow(function() { date.toLocaleDateString("de-DE", undefined); }); |
+assertDoesNotThrow(function() { date.toLocaleDateString("de-DE"); }); |
+assertThrows(function() { date.toLocaleDateString("de-DE", null); }, TypeError); |