From 1c24770f8ca6dba227c4e1033fd43a48ccccbc7c Mon Sep 17 00:00:00 2001
From: Tim Mickel <tim.mickel@gmail.com>
Date: Thu, 30 Jun 2016 17:13:43 -0400
Subject: [PATCH] Remove debug calls from `execute`

---
 src/engine/execute.js | 25 +------------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/src/engine/execute.js b/src/engine/execute.js
index acff32585..188f0bf52 100644
--- a/src/engine/execute.js
+++ b/src/engine/execute.js
@@ -1,11 +1,5 @@
 var Thread = require('./thread');
 
-/**
- * If set, block calls, args, and return values will be logged to the console.
- * @const {boolean}
- */
-var DEBUG_BLOCK_CALLS = true;
-
 /**
  * Execute a block.
  * @param {!Sequencer} sequencer Which sequencer is executing.
@@ -66,11 +60,6 @@ var execute = function (sequencer, thread) {
     // (e.g., on return from a substack) gets fresh inputs.
     currentStackFrame.reported = {};
 
-    if (DEBUG_BLOCK_CALLS) {
-        console.groupCollapsed('Executing: ' + opcode);
-        console.log('with arguments: ', argValues);
-        console.log('and stack frame: ', currentStackFrame);
-    }
     var primitiveReportedValue = null;
     primitiveReportedValue = blockFunction(argValues, {
         yield: thread.yield.bind(thread),
@@ -98,29 +87,17 @@ var execute = function (sequencer, thread) {
         // Promise handlers
         primitiveReportedValue.then(function(resolvedValue) {
             // Promise resolved: the primitive reported a value.
-            if (DEBUG_BLOCK_CALLS) {
-                console.log('reporting value: ', resolvedValue);
-            }
             thread.pushReportedValue(resolvedValue);
             sequencer.proceedThread(thread);
         }, function(rejectionReason) {
             // Promise rejected: the primitive had some error.
             // Log it and proceed.
-            if (DEBUG_BLOCK_CALLS) {
-                console.warn('primitive rejected promise: ', rejectionReason);
-            }
+            console.warn('Primitive rejected promise: ', rejectionReason);
             sequencer.proceedThread(thread);
         });
     } else if (thread.status === Thread.STATUS_RUNNING) {
-        if (DEBUG_BLOCK_CALLS) {
-            console.log('reporting value: ', primitiveReportedValue);
-        }
         thread.pushReportedValue(primitiveReportedValue);
     }
-    if (DEBUG_BLOCK_CALLS) {
-        console.log('ending stack frame: ', currentStackFrame);
-        console.groupEnd();
-    }
 };
 
 module.exports = execute;