Index: test/intl/date-format/format-test.js |
diff --git a/src/extensions/i18n/i18n-extension.h b/test/intl/date-format/format-test.js |
similarity index 78% |
copy from src/extensions/i18n/i18n-extension.h |
copy to test/intl/date-format/format-test.js |
index 050c336a67a21fd6cb32892e14215cac11971111..9b30384806b67726599179f618f2f38aae55eb69 100644 |
--- a/src/extensions/i18n/i18n-extension.h |
+++ b/test/intl/date-format/format-test.js |
@@ -26,26 +26,22 @@ |
// 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_ |
+// Test formatting method with specified date, invalid input. |
-#include "v8.h" |
+var dtf = new Intl.DateTimeFormat('en-US', {timeZone: 'UTC'}); |
-namespace v8_i18n { |
+var someDate = dtf.format(144313200000); |
+assertEquals('7/29/1974', someDate); |
-class Extension : public v8::Extension { |
- public: |
- Extension(); |
+var invalidValues = [NaN, Infinity, -Infinity]; |
+invalidValues.forEach(function(value) { |
+ var error; |
+ try { |
+ dtf.format(value); |
+ } catch (e) { |
+ error = e; |
+ } |
- virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction( |
- v8::Handle<v8::String> name); |
- |
- static void Register(); |
- |
- private: |
- static Extension* extension_; |
-}; |
- |
-} // namespace v8_i18n |
- |
-#endif // V8_EXTENSIONS_I18N_I18N_EXTENSION_H_ |
+ assertTrue(error !== undefined); |
+ assertEquals('RangeError', error.name); |
+}); |