| 1 |
// This Source Code Form is subject to the terms of the Mozilla Public |
| 2 |
// License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 |
// file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 4 |
|
| 5 |
// https://bugzilla.mozilla.org/show_bug.cgi?id=728286 |
| 6 |
|
| 7 |
function assertSame(expected, actual) { |
| 8 |
if (expected !== actual) { |
| 9 |
throw "Expected '" + expected + "' but was '" + actual + "'"; |
| 10 |
} |
| 11 |
} |
| 12 |
|
| 13 |
var counter = 0; |
| 14 |
var object = {toString: function(){ counter++; return ""; }} |
| 15 |
|
| 16 |
assertSame(0, counter); |
| 17 |
[object, object].sort(); |
| 18 |
assertSame(2, counter); |
| 19 |
|
| 20 |
"success"; |