Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: test/intl/date-format/format-test.js

Issue 148883002: Synchronize with r15594. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/intl/date-format/format-is-bound.js ('k') | test/intl/date-format/parse-MMMdy.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/intl/date-format/format-test.js
diff --git a/test/mjsunit/array-non-smi-length.js b/test/intl/date-format/format-test.js
similarity index 78%
copy from test/mjsunit/array-non-smi-length.js
copy to test/intl/date-format/format-test.js
index 23a25ee797bd68690ad2a7ce26a9135e23b486e2..9817c97ed975283f2313e7b1ece8a0b110365e84 100644
--- a/test/mjsunit/array-non-smi-length.js
+++ b/test/intl/date-format/format-test.js
@@ -25,22 +25,22 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --allow-natives-syntax
+// Test formatting method with specified date, invalid input.
-function TestNonSmiArrayLength() {
- function f(a) {
- return a.length+1;
- }
-
- var a = [];
- a.length = 0xFFFF;
- assertSame(0x10000, f(a));
- assertSame(0x10000, f(a));
+var dtf = new Intl.DateTimeFormat('en-US', {timeZone: 'UTC'});
- %OptimizeFunctionOnNextCall(f);
- a.length = 0xFFFFFFFF;
- assertSame(0x100000000, f(a));
-}
+var someDate = dtf.format(144313200000);
+assertEquals('7/29/1974', someDate);
-TestNonSmiArrayLength();
+var invalidValues = [NaN, Infinity, -Infinity];
+invalidValues.forEach(function(value) {
+ var error;
+ try {
+ dtf.format(value);
+ } catch (e) {
+ error = e;
+ }
+ assertTrue(error !== undefined);
+ assertEquals('RangeError', error.name);
+});
« no previous file with comments | « test/intl/date-format/format-is-bound.js ('k') | test/intl/date-format/parse-MMMdy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698