| 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'));
|
|
|