strict mode
Should fix usage with bundles including bunyan and using strict mode. Had to fix a surprise effect that 'window === this' is no longer true in strict mode: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode """That means, among other things, that in browsers it's no longer possible to reference the window object through this inside a strict mode function.""" Fixes #236, #231, and #223.
This commit is contained in:
parent
6baeb2c581
commit
27d60578a9
3 changed files with 9 additions and 5 deletions
2
AUTHORS
2
AUTHORS
|
@ -23,3 +23,5 @@ Martin Gausby (https://github.com/gausby)
|
||||||
Stéphan Kochen (https://github.com/stephank)
|
Stéphan Kochen (https://github.com/stephank)
|
||||||
Shakeel Mohamed (https://github.com/shakeelmohamed)
|
Shakeel Mohamed (https://github.com/shakeelmohamed)
|
||||||
Denis Izmaylov (https://github.com/DenisIzmaylov)
|
Denis Izmaylov (https://github.com/DenisIzmaylov)
|
||||||
|
Guillermo Grau Panea (https://github.com/guigrpa)
|
||||||
|
Mark LeMerise (https://github.com/MarkLeMerise)
|
||||||
|
|
|
@ -8,6 +8,7 @@ Known issues:
|
||||||
|
|
||||||
## bunyan 1.5.0 (not yet released)
|
## bunyan 1.5.0 (not yet released)
|
||||||
|
|
||||||
|
- [pull #236, issue #231, issue #223] Fix strict mode in the browser.
|
||||||
- [pull #282, issue #213] Fixes bunyan to work with webpack. By Denis Izmaylov.
|
- [pull #282, issue #213] Fixes bunyan to work with webpack. By Denis Izmaylov.
|
||||||
- [pull #294] Update to dtrace-provider 0.6 to fix with node 4.0 and io.js 3.0.
|
- [pull #294] Update to dtrace-provider 0.6 to fix with node 4.0 and io.js 3.0.
|
||||||
- Dropped support for 0.8 (can't install deps easily anymore for running
|
- Dropped support for 0.8 (can't install deps easily anymore for running
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
* vim: expandtab:ts=4:sw=4
|
* vim: expandtab:ts=4:sw=4
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var VERSION = '1.5.0';
|
var VERSION = '1.5.0';
|
||||||
|
|
||||||
// Bunyan log format version. This becomes the 'v' field on all log records.
|
// Bunyan log format version. This becomes the 'v' field on all log records.
|
||||||
|
@ -67,7 +69,7 @@ try {
|
||||||
|
|
||||||
// Are we in the browser (e.g. running via browserify)?
|
// Are we in the browser (e.g. running via browserify)?
|
||||||
var isBrowser = function () {
|
var isBrowser = function () {
|
||||||
return typeof (window) !== 'undefined' && this === window; }();
|
return typeof (window) !== 'undefined'; }();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
/* Use `+ ''` to hide this import from browserify. */
|
/* Use `+ ''` to hide this import from browserify. */
|
||||||
|
@ -1095,12 +1097,11 @@ function safeCycles() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* XXX
|
var RotatingFileStream = null;
|
||||||
*/
|
|
||||||
if (mv) {
|
if (mv) {
|
||||||
|
|
||||||
function RotatingFileStream(options) {
|
RotatingFileStream = function RotatingFileStream(options) {
|
||||||
this.path = options.path;
|
this.path = options.path;
|
||||||
this.stream = fs.createWriteStream(this.path,
|
this.stream = fs.createWriteStream(this.path,
|
||||||
{flags: 'a', encoding: 'utf8'});
|
{flags: 'a', encoding: 'utf8'});
|
||||||
|
|
Loading…
Reference in a new issue