summaryrefslogtreecommitdiff
path: root/jstests/core/type6.js
blob: f8b29fe217d221b0845f23b8f9d25039c7fa80f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(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");
})();