diff options
Diffstat (limited to 'js/src/tests/test262/intl402/PluralRules/prototype/bind.js')
-rw-r--r-- | js/src/tests/test262/intl402/PluralRules/prototype/bind.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/PluralRules/prototype/bind.js b/js/src/tests/test262/intl402/PluralRules/prototype/bind.js new file mode 100644 index 0000000000..9b5142866c --- /dev/null +++ b/js/src/tests/test262/intl402/PluralRules/prototype/bind.js @@ -0,0 +1,28 @@ +// Copyright 2016 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/*--- +esid: sec-properties-of-intl-pluralrules-prototype-object +description: > + Tests that Intl.PluralRules.prototype functions throw a TypeError if + called on a non-object value or an object that hasn't been + initialized as a PluralRules. +author: Zibi Braniecki +---*/ + +var functions = { + select: Intl.PluralRules.prototype.select, + resolvedOptions: Intl.PluralRules.prototype.resolvedOptions +}; +var invalidTargets = [undefined, null, true, 0, "PluralRules", [], {}]; + +Object.getOwnPropertyNames(functions).forEach(function (functionName) { + var f = functions[functionName]; + invalidTargets.forEach(function (target) { + assert.throws(TypeError, function () { + f.call(target); + }, "Calling " + functionName + " on " + target + " was not rejected."); + }); +}); + +reportCompare(0, 0); |