summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/String/prototype/localeCompare/return-abrupt-this-value.js
blob: 21de34a98d6ae45eec8fa2e9f830aecce94ac74e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);