2016-12-02 20:32:04 +03:00
|
|
|
"use strict";
|
2016-08-06 00:41:01 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Create a writable property by tracking it with a private variable.
|
|
|
|
* We cannot make a normal property writeable on `exports` because
|
|
|
|
* the module system freezes it.
|
|
|
|
*/
|
|
|
|
function makeWritableFlag(exports, name) {
|
|
|
|
let flag = false;
|
|
|
|
Object.defineProperty(exports, name, {
|
2018-03-12 21:24:38 +03:00
|
|
|
get: function() {
|
2016-12-02 20:32:04 +03:00
|
|
|
return flag;
|
|
|
|
},
|
2018-03-12 21:24:38 +03:00
|
|
|
set: function(state) {
|
2016-12-02 20:32:04 +03:00
|
|
|
flag = state;
|
|
|
|
}
|
2016-08-06 00:41:01 +03:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
makeWritableFlag(exports, "wantLogging");
|
|
|
|
makeWritableFlag(exports, "wantVerbose");
|
|
|
|
|
|
|
|
// When the testing flag is set, various behaviors may be altered from
|
|
|
|
// production mode, typically to enable easier testing or enhanced
|
|
|
|
// debugging.
|
|
|
|
makeWritableFlag(exports, "testing");
|