From 6a5a0353a4f11225eca14eb8102ca4d124eb49ac Mon Sep 17 00:00:00 2001 From: remy Date: Sun, 20 Mar 2011 13:43:50 +0000 Subject: [PATCH] Changed the internal console detection /not/ look for the string function name (since compressed functions don't match! Doh) - so we're using some object detection goodness. --- js/render/consoleContext.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/render/consoleContext.js b/js/render/consoleContext.js index feeaa6e1..e72ae7e6 100644 --- a/js/render/consoleContext.js +++ b/js/render/consoleContext.js @@ -15,7 +15,9 @@ ConsoleContext.prototype = { hijack: function (method, args) { var context = this.executable ? this.context() : this.context; var re = new RegExp('console\.' + method + '\\((.*?)\\)'); - if (!/renderLivePreview/.test(arguments.callee.caller.caller.toString()) && context) { + + // if the log was triggered via a jQuery.Event then it came from /within/ the preview + if (!(arguments.callee.caller.caller.arguments[0] instanceof jQuery.Event) && context) { context.eval('console.' + method + '(' + arguments.callee.caller.caller.arguments[0].toString().match(re)[1] + ')'); } else { this.original[method].apply(this.original, args);