diff options
Diffstat (limited to 'js/src/tests/test262/intl402/NumberFormat/significant-digits-options-get-sequence.js')
-rw-r--r-- | js/src/tests/test262/intl402/NumberFormat/significant-digits-options-get-sequence.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/NumberFormat/significant-digits-options-get-sequence.js b/js/src/tests/test262/intl402/NumberFormat/significant-digits-options-get-sequence.js new file mode 100644 index 0000000000..0602e55b9c --- /dev/null +++ b/js/src/tests/test262/intl402/NumberFormat/significant-digits-options-get-sequence.js @@ -0,0 +1,42 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 11.1.1_32 +description: > + Tests that the options minimumSignificantDigits and + maximumSignificantDigits are read in the right sequence. +author: Norbert Lindenberg +---*/ + +var minimumSignificantDigitsRead = false; +var maximumSignificantDigitsRead = false; + +function readMinimumSignificantDigits() { + assert.sameValue(minimumSignificantDigitsRead, false, + "minimumSignificantDigits getter already called"); + assert.sameValue(maximumSignificantDigitsRead, false, + "maximumSignificantDigits getter called before minimumSignificantDigits"); + minimumSignificantDigitsRead = true; + return 1; +} + +function readMaximumSignificantDigits() { + assert.sameValue(maximumSignificantDigitsRead, false, + "maximumSignificantDigits getter already called"); + maximumSignificantDigitsRead = true; + return 1; +} + +var options = {}; +Object.defineProperty(options, "minimumSignificantDigits", + { get: readMinimumSignificantDigits }); +Object.defineProperty(options, "maximumSignificantDigits", + { get: readMaximumSignificantDigits }); + +new Intl.NumberFormat("de", options); + +assert(minimumSignificantDigitsRead, "minimumSignificantDigits getter was called once"); +assert(maximumSignificantDigitsRead, "maximumSignificantDigits getter was called once"); + +reportCompare(0, 0); |