summaryrefslogtreecommitdiff
path: root/jstests/core/type6.js
blob: 869592a798020ae880b8ddbc4a1e4d5c204399de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
 * SERVER-20319 Min/MaxKey check type of singleton
 *
 * Make sure swapping min/max key's prototype doesn't blow things up.
 *
 * @tags: [
 *  no_selinux,
 *  ]
 */

(function() {
"use strict";

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");
})();