Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
1 // Copyright 2013 Mozilla Corporation. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /**
5 * @description Tests that the options minimumSignificantDigits and
6 * maximumSignificantDigits are read in the right sequence.
7 * @author Norbert Lindenberg
8 */
10 var read = 0;
12 function readMinimumSignificantDigits() {
13 ++read;
14 if (read === 1) {
15 return 0; // invalid value, but on first read that's OK
16 } else if (read === 3) {
17 return 1; // valid value
18 } else {
19 $ERROR("minimumSignificantDigits read out of sequence: " + read + ".");
20 }
21 }
23 function readMaximumSignificantDigits() {
24 ++read;
25 if (read === 2) {
26 return 0; // invalid value, but on first read that's OK
27 } else if (read === 4) {
28 return 1; // valid value
29 } else {
30 $ERROR("maximumSignificantDigits read out of sequence: " + read + ".");
31 }
32 }
34 var options = {};
35 Object.defineProperty(options, "minimumSignificantDigits",
36 { get: readMinimumSignificantDigits });
37 Object.defineProperty(options, "maximumSignificantDigits",
38 { get: readMaximumSignificantDigits });
40 new Intl.NumberFormat("de", options);
42 if (read !== 4) {
43 $ERROR("insuffient number of property reads: " + read + ".");
44 }