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

Side by Side Diff: mozilla-tests/ecma_3/Number/15.7.4.7-1.js

Issue 2865028: Update the mozilla tests to new version (as of 2010-06-29). (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mozilla-tests/ecma_3/Number/15.7.4.6-1.js ('k') | mozilla-tests/ecma_3/Object/8.6.2.6-002.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK ***** 2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * 4 *
5 * The contents of this file are subject to the Mozilla Public License Version 5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with 6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at 7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/ 8 * http://www.mozilla.org/MPL/
9 * 9 *
10 * Software distributed under the License is distributed on an "AS IS" basis, 10 * Software distributed under the License is distributed on an "AS IS" basis,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 var expect= ''; 60 var expect= '';
61 var expectedvalues = []; 61 var expectedvalues = [];
62 var testNum = 5.123456; 62 var testNum = 5.123456;
63 63
64 64
65 status = 'Section A of test: no error intended!'; 65 status = 'Section A of test: no error intended!';
66 actual = testNum.toPrecision(4); 66 actual = testNum.toPrecision(4);
67 expect = '5.123'; 67 expect = '5.123';
68 captureThis(); 68 captureThis();
69 69
70 status = 'Section B of test: Infinity.toPrecision() with out-of-range fractionDi gits';
71 actual = Number.POSITIVE_INFINITY.toPrecision(-3);
72 expect = 'Infinity';
73 captureThis();
74
75 status = 'Section C of test: -Infinity.toPrecision() with out-of-range fractionD igits';
76 actual = Number.NEGATIVE_INFINITY.toPrecision(-3);
77 expect = '-Infinity';
78 captureThis();
79
80 status = 'Section D of test: NaN.toPrecision() with out-of-range fractionDigits' ;
81 actual = Number.NaN.toPrecision(-3);
82 expect = 'NaN';
83 captureThis();
84
70 85
71 /////////////////////////// OOPS.... /////////////////////////////// 86 /////////////////////////// OOPS.... ///////////////////////////////
72 /************************************************************************* 87 /*************************************************************************
73 * 15.7.4.7 Number.prototype.toPrecision(precision) 88 * 15.7.4.7 Number.prototype.toPrecision(precision)
74 * 89 *
75 * An implementation is permitted to extend the behaviour of toPrecision 90 * An implementation is permitted to extend the behaviour of toPrecision
76 * for values of precision less than 1 or greater than 21. In this 91 * for values of precision less than 1 or greater than 21. In this
77 * case toPrecision would not necessarily throw RangeError for such values. 92 * case toPrecision would not necessarily throw RangeError for such values.
78 93
79 status = 'Section B of test: expect RangeError because precision < 1'; 94 status = 'Section B of test: expect RangeError because precision < 1';
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 return cnNoErrorCaught; 145 return cnNoErrorCaught;
131 } 146 }
132 147
133 148
134 function isRangeError(obj) 149 function isRangeError(obj)
135 { 150 {
136 if (obj instanceof RangeError) 151 if (obj instanceof RangeError)
137 return cnIsRangeError; 152 return cnIsRangeError;
138 return cnNotRangeError; 153 return cnNotRangeError;
139 } 154 }
OLDNEW
« no previous file with comments | « mozilla-tests/ecma_3/Number/15.7.4.6-1.js ('k') | mozilla-tests/ecma_3/Object/8.6.2.6-002.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698