From 96942d4f7fcad54dfc93f10e045694a4326cafc3 Mon Sep 17 00:00:00 2001
From: Jonas Jenwald <jonas.jenwald@gmail.com>
Date: Thu, 2 May 2019 17:37:05 +0200
Subject: [PATCH] Ensure that the `OperatorList` constructor actually
 initializes a `NullOptimizer` when intended (PR 9089 follow-up)

It appears that this has been broken ever since PR 9089, which also introduced this code, since the `QueueOptimizer`/`NullOptimizer` choice was made based on the still undefined `this.intent` property.

Furthermore, fixing this also uncovered the fact that the `NullOptimizer.reset` method was missing.
---
 src/core/operator_list.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/core/operator_list.js b/src/core/operator_list.js
index b5690843d..0e1d550f7 100644
--- a/src/core/operator_list.js
+++ b/src/core/operator_list.js
@@ -525,6 +525,8 @@ var NullOptimizer = (function NullOptimizerClosure() {
     },
 
     flush() { },
+
+    reset() { },
   };
 
   return NullOptimizer;
@@ -538,7 +540,7 @@ var OperatorList = (function OperatorListClosure() {
     this.messageHandler = messageHandler;
     this.fnArray = [];
     this.argsArray = [];
-    if (messageHandler && this.intent !== 'oplist') {
+    if (messageHandler && intent !== 'oplist') {
       this.optimizer = new QueueOptimizer(this);
     } else {
       this.optimizer = new NullOptimizer(this);