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

Unified Diff: test/intl/number-format/check-digit-ranges.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/intl.status ('k') | test/intl/number-format/default-locale.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/intl/number-format/check-digit-ranges.js
diff --git a/src/extensions/i18n/number-format.h b/test/intl/number-format/check-digit-ranges.js
similarity index 54%
copy from src/extensions/i18n/number-format.h
copy to test/intl/number-format/check-digit-ranges.js
index d4dbc4d6f3be4f665ab034352c57077772050f18..322785cbf9b70dddc7700b1f54d99d3fbdf59ea8 100644
--- a/src/extensions/i18n/number-format.h
+++ b/test/intl/number-format/check-digit-ranges.js
@@ -24,46 +24,33 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// limitations under the License.
-#ifndef V8_EXTENSIONS_I18N_NUMBER_FORMAT_H_
-#define V8_EXTENSIONS_I18N_NUMBER_FORMAT_H_
+// Digit ranges are obeyed.
-#include "unicode/uversion.h"
-#include "v8.h"
+// Invalid ranges
+assertThrows('Intl.NumberFormat(undefined, {minimumIntegerDigits: 0})');
+assertThrows('Intl.NumberFormat(undefined, {minimumIntegerDigits: 22})');
+assertThrows('Intl.NumberFormat(undefined, {minimumIntegerDigits: null})');
+assertThrows('Intl.NumberFormat(undefined, {minimumIntegerDigits: Infinity})');
+assertThrows('Intl.NumberFormat(undefined, {minimumIntegerDigits: -Infinity})');
+assertThrows('Intl.NumberFormat(undefined, {minimumIntegerDigits: x})');
-namespace U_ICU_NAMESPACE {
-class DecimalFormat;
-}
+assertThrows('Intl.NumberFormat(undefined, {minimumFractionDigits: -1})');
+assertThrows('Intl.NumberFormat(undefined, {maximumFractionDigits: 21})');
-namespace v8_i18n {
+assertThrows('Intl.NumberFormat(undefined, {minimumSignificantDigits: 0})');
+assertThrows('Intl.NumberFormat(undefined, {maximumSignificantDigits: 22})');
+assertThrows('Intl.NumberFormat(undefined, ' +
+ '{minimumSignificantDigits: 5, maximumSignificantDigits: 2})');
-class NumberFormat {
- public:
- static void JSCreateNumberFormat(
- const v8::FunctionCallbackInfo<v8::Value>& args);
+// Valid ranges
+assertDoesNotThrow('Intl.NumberFormat(undefined, {minimumIntegerDigits: 1})');
+assertDoesNotThrow('Intl.NumberFormat(undefined, {minimumIntegerDigits: 21})');
- // Helper methods for various bindings.
+assertDoesNotThrow('Intl.NumberFormat(undefined, {minimumFractionDigits: 0})');
+assertDoesNotThrow('Intl.NumberFormat(undefined, {minimumFractionDigits: 20})');
- // Unpacks date format object from corresponding JavaScript object.
- static icu::DecimalFormat* UnpackNumberFormat(v8::Handle<v8::Object> obj);
-
- // Release memory we allocated for the NumberFormat once the JS object that
- // holds the pointer gets garbage collected.
- static void DeleteNumberFormat(v8::Isolate* isolate,
- v8::Persistent<v8::Object>* object,
- void* param);
-
- // Formats number and returns corresponding string.
- static void JSInternalFormat(const v8::FunctionCallbackInfo<v8::Value>& args);
-
- // Parses a string and returns a number.
- static void JSInternalParse(const v8::FunctionCallbackInfo<v8::Value>& args);
-
- private:
- NumberFormat();
-};
-
-} // namespace v8_i18n
-
-#endif // V8_EXTENSIONS_I18N_NUMBER_FORMAT_H_
+assertDoesNotThrow('Intl.NumberFormat(undefined, ' +
+ '{minimumSignificantDigits: 1})');
+assertDoesNotThrow('Intl.NumberFormat(undefined, ' +
+ '{maximumSignificantDigits: 21})');
« no previous file with comments | « test/intl/intl.status ('k') | test/intl/number-format/default-locale.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698