Bug 1129155 - Add console.mihai shortcut to evalWithDebugger. r=past, a=lsblakk
authorBrian Grinstead <bgrinstead@mozilla.com>
Wed, 11 Feb 2015 09:08:05 -0800
changeset 249799 74827b8f61ebeba3c6d0d543ef72aed59e84592a
parent 249798 b8478050a2ee6a62da840b8e4d4683c600141c1f
child 249800 69ce849146bfd00550183871a4d82661080615a5
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast, lsblakk
bugs1129155
milestone37.0a2
Bug 1129155 - Add console.mihai shortcut to evalWithDebugger. r=past, a=lsblakk
toolkit/devtools/server/actors/webconsole.js
--- a/toolkit/devtools/server/actors/webconsole.js
+++ b/toolkit/devtools/server/actors/webconsole.js
@@ -1054,21 +1054,27 @@ WebConsoleActor.prototype =
    *         evaluated.
    *         - result: the result of the evaluation.
    *         - helperResult: any result coming from a JSTerm helper function.
    *         - url: the url to evaluate the script as. Defaults to
    *         "debugger eval code".
    */
   evalWithDebugger: function WCA_evalWithDebugger(aString, aOptions = {})
   {
+    let trimmedString = aString.trim();
     // The help function needs to be easy to guess, so we make the () optional.
-    if (aString.trim() == "help" || aString.trim() == "?") {
+    if (trimmedString == "help" || trimmedString == "?") {
       aString = "help()";
     }
 
+    // Add easter egg for console.mihai().
+    if (trimmedString == "console.mihai()" || trimmedString == "console.mihai();") {
+      aString = "\"http://incompleteness.me/blog/2015/02/09/console-dot-mihai/\"";
+    }
+
     // Find the Debugger.Frame of the given FrameActor.
     let frame = null, frameActor = null;
     if (aOptions.frameActor) {
       frameActor = this.conn.getActor(aOptions.frameActor);
       if (frameActor) {
         frame = frameActor.frame;
       }
       else {