| Index: test/intl/date-format/parse-MMMdy.js
|
| diff --git a/src/extensions/i18n/i18n-extension.h b/test/intl/date-format/parse-MMMdy.js
|
| similarity index 69%
|
| copy from src/extensions/i18n/i18n-extension.h
|
| copy to test/intl/date-format/parse-MMMdy.js
|
| index 050c336a67a21fd6cb32892e14215cac11971111..b2ed3bf0ca6086c53345907070bb290edc5d2de2 100644
|
| --- a/src/extensions/i18n/i18n-extension.h
|
| +++ b/test/intl/date-format/parse-MMMdy.js
|
| @@ -26,26 +26,24 @@
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| // limitations under the License.
|
|
|
| -#ifndef V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
|
| -#define V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
|
| +// Testing v8Parse method for date and time pattern.
|
| +// Month is represented as a short name.
|
|
|
| -#include "v8.h"
|
| +var dtf = new Intl.DateTimeFormat(['en'],
|
| + {year: 'numeric', month: 'short',
|
| + day: 'numeric'});
|
|
|
| -namespace v8_i18n {
|
| +// Make sure we have pattern we expect (may change in the future).
|
| +assertEquals('MMM d, y', dtf.resolved.pattern);
|
|
|
| -class Extension : public v8::Extension {
|
| - public:
|
| - Extension();
|
| +assertEquals('Sat May 04 1974 00:00:00 GMT-0007 (PDT)',
|
| + usePDT(String(dtf.v8Parse('May 4, 1974'))));
|
|
|
| - virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
|
| - v8::Handle<v8::String> name);
|
| +// Missing , in the pattern.
|
| +assertEquals(undefined, dtf.v8Parse('May 4 1974'));
|
|
|
| - static void Register();
|
| +// Extra "th" after 4 in the pattern.
|
| +assertEquals(undefined, dtf.v8Parse('May 4th, 1974'));
|
|
|
| - private:
|
| - static Extension* extension_;
|
| -};
|
| -
|
| -} // namespace v8_i18n
|
| -
|
| -#endif // V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
|
| +// Wrong pattern.
|
| +assertEquals(undefined, dtf.v8Parse('5/4/1974'));
|
|
|