summaryrefslogtreecommitdiff
path: root/jstests/core/type6.js
blob: 8dbc1770cc378033c75e5926b8d5005c867f7efb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(function() {
"use strict";

// SERVER-20319 Min/MaxKey check type of singleton
//
// make sure swapping min/max key's prototype doesn't blow things up

assert.throws(function() {
    MinKey().__proto__.singleton = 1000;
    MinKey();
}, [], "make sure manipulating MinKey's proto is safe");

assert.throws(function() {
    MaxKey().__proto__.singleton = 1000;
    MaxKey();
}, [], "make sure manipulating MaxKey's proto is safe");
})();