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

Unified Diff: test/intl/date-format/parse-MMMdy.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-test.js ('k') | test/intl/date-format/parse-invalid-input.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/intl/date-format/parse-MMMdy.js
diff --git a/test/mjsunit/regress/regress-crbug-196583.js b/test/intl/date-format/parse-MMMdy.js
similarity index 68%
copy from test/mjsunit/regress/regress-crbug-196583.js
copy to test/intl/date-format/parse-MMMdy.js
index c486158e22e92d2f73fe3473d822a8f6136aed4b..7136527810e61b65b8ad50c7e8750a6be0fe1718 100644
--- a/test/mjsunit/regress/regress-crbug-196583.js
+++ b/test/intl/date-format/parse-MMMdy.js
@@ -25,28 +25,24 @@
// (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
+// Testing v8Parse method for date and time pattern.
+// Month is represented as a short name.
-var a = 1;
-a.__proto__.f = 1;
-a.__proto__.f = function() { return 1; }
+var dtf = new Intl.DateTimeFormat(['en'],
+ {year: 'numeric', month: 'short',
+ day: 'numeric'});
-// Create some polymorphism.
-function B() {}
-B.prototype = {f: function() { return 2; }};
-var b = new B();
-function C() {}
-C.prototype = {g: "foo", f: function() { return 3; }};
-var c = new C();
+// Make sure we have pattern we expect (may change in the future).
+assertEquals('MMM d, y', dtf.resolved.pattern);
-function crash(obj) {
- return obj.f();
-}
+assertEquals('Sat May 04 1974 00:00:00 GMT-0007 (PDT)',
+ usePDT(String(dtf.v8Parse('May 4, 1974'))));
-for (var i = 0; i < 2; i++) {
- crash(a);
- crash(b);
- crash(c);
-}
-%OptimizeFunctionOnNextCall(crash);
-assertEquals(1, crash(a));
+// Missing , in the pattern.
+assertEquals(undefined, dtf.v8Parse('May 4 1974'));
+
+// Extra "th" after 4 in the pattern.
+assertEquals(undefined, dtf.v8Parse('May 4th, 1974'));
+
+// Wrong pattern.
+assertEquals(undefined, dtf.v8Parse('5/4/1974'));
« no previous file with comments | « test/intl/date-format/format-test.js ('k') | test/intl/date-format/parse-invalid-input.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698