diff options
Diffstat (limited to 'js/src/tests/test262/intl402/String/prototype/localeCompare/return-abrupt-this-value.js')
-rw-r--r-- | js/src/tests/test262/intl402/String/prototype/localeCompare/return-abrupt-this-value.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/String/prototype/localeCompare/return-abrupt-this-value.js b/js/src/tests/test262/intl402/String/prototype/localeCompare/return-abrupt-this-value.js new file mode 100644 index 0000000000..21de34a98d --- /dev/null +++ b/js/src/tests/test262/intl402/String/prototype/localeCompare/return-abrupt-this-value.js @@ -0,0 +1,20 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 13.1.1_1 +description: > + Tests that localeCompare rejects values that can't be coerced to + an object. +author: Norbert Lindenberg +---*/ + +var invalidValues = [undefined, null]; + +invalidValues.forEach(function (value) { + assert.throws(TypeError, function() { + var result = String.prototype.localeCompare.call(value, ""); + }, "String.prototype.localeCompare did not reject this = " + value + "."); +}); + +reportCompare(0, 0); |