diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/prototype/toLocaleString/primitive_this_value-strict.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Array/prototype/toLocaleString/primitive_this_value-strict.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/primitive_this_value-strict.js b/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/primitive_this_value-strict.js new file mode 100644 index 0000000000..4107ea1fcc --- /dev/null +++ b/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/primitive_this_value-strict.js @@ -0,0 +1,33 @@ +'use strict'; +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.tolocalestring +description: Array.prototype.toLocaleString called with primitive element +info: | + 22.1.3.26 Array.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] ) + + ... + 10. Else + a. Let R be ToString(Invoke(firstElement, "toLocaleString")). + b. ReturnIfAbrupt(R). + ... + 12. + ... + e. Else + i. Let R be ToString(Invoke(nextElement, "toLocaleString")). + ii. ReturnIfAbrupt(R). +es6id: 22.1.3.26 +flags: [onlyStrict] +---*/ + +var listSeparator = ["", ""].toLocaleString(); + +Boolean.prototype.toString = function() { + return typeof this; +}; + +assert.sameValue([true, false].toLocaleString(), ("boolean" + listSeparator + "boolean")); + +reportCompare(0, 0); |