From bd9dcf9643d69243de5aad7e0a184583e391db70 Mon Sep 17 00:00:00 2001 From: Rahul Date: Mon, 13 Oct 2014 13:44:33 +0200 Subject: [PATCH 1/2] Fix the typeof check Encountered this bug when I tried to update an app that was generating Blaze warnings about the deprecated old-style helper to a 0.9.4 RC. The problem is that the type of the string `'Log'` is being checked rather than the value of the `Log` variable, which obviously returns true, and then the code breaks on the `&& Log` check, which is undefined. --- packages/blaze/preamble.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/blaze/preamble.js b/packages/blaze/preamble.js index 8229c20f3a..74e565ef93 100644 --- a/packages/blaze/preamble.js +++ b/packages/blaze/preamble.js @@ -22,7 +22,7 @@ Blaze._escape = (function() { Blaze._warn = function (msg) { msg = 'Warning: ' + msg; - if ((typeof 'Log' !== 'undefined') && Log && Log.warn) + if ((typeof Log !== 'undefined') && Log && Log.warn) Log.warn(msg); // use Meteor's "logging" package else if ((typeof 'console' !== 'undefined') && console.log) console.log(msg); From 619faab29f419170f15d82a72a9e7501c69d079a Mon Sep 17 00:00:00 2001 From: Nick Martin Date: Mon, 13 Oct 2014 18:04:14 -0700 Subject: [PATCH 2/2] fix another typeof --- packages/blaze/preamble.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/blaze/preamble.js b/packages/blaze/preamble.js index 74e565ef93..1928c72359 100644 --- a/packages/blaze/preamble.js +++ b/packages/blaze/preamble.js @@ -24,6 +24,6 @@ Blaze._warn = function (msg) { if ((typeof Log !== 'undefined') && Log && Log.warn) Log.warn(msg); // use Meteor's "logging" package - else if ((typeof 'console' !== 'undefined') && console.log) + else if ((typeof console !== 'undefined') && console.log) console.log(msg); };