This needs to follow the WinJS.UI.processAll "async constructor" pattern to interop nicely in the "Views.Control" use case.
970490
function PageControl_ctor(element, options, complete, parentedPromise) {
                    var that = this;
                    this._disposed = false;
                    this.element = element = element || _Global.document.createElement("div");
                    _ElementUtilities.addClass(element, "win-disposable");
                    element.msSourceLocation = uri;
                    this.uri = uri;
                    this.selfhost = selfhost(uri);
                    element.winControl = this;
                    _ElementUtilities.addClass(element, "pagecontrol");

                    var profilerMarkIdentifier = " uri='" + uri + "'" + _BaseUtils._getProfilerMarkIdentifier(this.element);

                    _WriteProfilerMark("WinJS.UI.Pages:createPage" + profilerMarkIdentifier + ",StartTM");

                    var load = Promise.wrap().
                        then(function Pages_load() { return that.load(uri); });

                    var renderCalled = load.then(function Pages_init(loadResult) {
                        return Promise.join({
                            loadResult: loadResult,
                            initResult: that.init(element, options)
                        });
                    }).then(function Pages_render(result) {
                        return that.render(element, options, result.loadResult);
                    });

                    this.elementReady = renderCalled.then(function () { return element; });

                    this.renderComplete = renderCalled.
                        then(function Pages_process() {
                            return that.process(element, options);
                        }).then(function Pages_processed() {
                            return that.processed(element, options);
                        }).then(function () {
                            return that;
                        });

                    var callComplete = function () {
                        complete && complete(that);
                        _WriteProfilerMark("WinJS.UI.Pages:createPage" + profilerMarkIdentifier + ",StopTM");
                    };

                    // promises guarantee order, so this will be called prior to ready path below
                    //
                    this.renderComplete.then(callComplete, callComplete);

                    this.readyComplete = this.renderComplete.then(function () {
                        return parentedPromise;
                    }).then(function Pages_ready() {
                        that.ready(element, options);
                        return that;
                    }).then(
                        null,
                        function Pages_error(err) {
                            return that.error(err);
                        }
                    );
                }
302803
function fireViewportChangeEvent(viewport, eventRegistry, namespace) {
    var components = getComponentsInEventRegistry(eventRegistry, namespace);
    var handlerResults = [];
    components.forEach(function (component) {
        Object.keys(eventRegistry[component._componentName]).forEach(function (selector) {
            if (selector === "" || viewport === selector) {
                eventRegistry[component._componentName][selector].forEach(function (handlerOption) {
                    handlerResults.push(component[handlerOption.handlerName].call(component, { viewport: viewport }));
                });
            }
        });
    });
    handlerResults.forEach(function (handlerResults) { return function () {
        if (typeof handlerResults === "function") {
            handlerResults();
        }
    }; });
}
410196
function PropHandlers_syncChildrenWithBindingList(bindingListName) {
        return {
            preCtorInit: function syncChildrenWithBindingList_preCtorInit(element, options, data, displayName, propName, value) {
                var latest = processChildren(displayName, value, {});
                data[propName] = {
                    winjsChildComponents: latest.childComponents,
                    winjsChildComponentsMap: latest.childComponentsMap
                };

                options[bindingListName] = new WinJS.Binding.List(
                    latest.childComponents.map(function (winjsChildComponent) {
                        return winjsChildComponent.winControl;
                    })
                );
            },
            update: function syncChildrenWithBindingList_update(winjsComponent, propName, oldValue, newValue) {
                var data = winjsComponent.data[propName] || {};
                var oldChildComponents = data.winjsChildComponents || [];
                var oldChildComponentsMap = data.winjsChildComponentsMap || {};
                var latest = processChildren(winjsComponent.displayName, newValue, oldChildComponentsMap);

                var bindingList = winjsComponent.winControl[bindingListName];
                if (bindingList) {
                    applyEditsToBindingList(
                        bindingList,
                        diffArraysByKey(oldChildComponents, latest.childComponents)
                    );
                } else {
                    winjsComponent.winControl[bindingListName] = new WinJS.Binding.List(latest.childComponents.map(function (winjsChildComponent) {
                        return winjsChildComponent.winControl;
                    }));
                }

                winjsComponent.data[propName] = {
                    winjsChildComponents: latest.childComponents,
                    winjsChildComponentsMap: latest.childComponentsMap
                };
            },
            dispose: function syncChildrenWithBindingList_dispose(winjsComponent, propName) {
                var data = winjsComponent.data[propName] || {};
                var childComponents = data.winjsChildComponents || [];
                childComponents.forEach(function (winjsChildComponent) {
                    winjsChildComponent.dispose();
                });
            }
        }
    }
524901
function(viewId) {
            var that = this;
            var requirePath = this.convertViewIdToRequirePath(viewId);

            return system.defer(function(dfd) {
                system.acquire(requirePath).then(function(markup) {
                    var element = that.processMarkup(markup);
                    element.setAttribute('data-view', viewId);
                    dfd.resolve(element);
                }).fail(function(err){
                        that.createFallbackView(viewId, requirePath, err).then(function(element){
                            element.setAttribute('data-view', viewId);
                            dfd.resolve(element);
                        });
                    });
            }).promise();
        }
763846
function (arg) {
            var out = arg.out;
            var statement = arg.statement;

            // Add dependencies specified explicitly in the template declaration
            this._processDependencies(out);

            this._createBlocks(out);
            this._processInheritance(out);
            this._processScript(out);

            out.enterBlock("main");
            out.writeln("var Aria = require('ariatemplates/Aria');");
            out.leaveBlock();

            out.enterBlock("classDefinition");
            this._writeClassDefHeaders(out);
            this._writeConstructor(out);
            this._writeDestructor(out);
            out.leaveBlock();

            // main part of the processing (process the whole template):
            out.processContent(statement.content);

            if (out.errors) {
                out.$dispose();
                this.$callback(out.callback, {
                    classDef : null,
                    errors : out.errors
                });
                // in case of synchronous call, the following line prevents a second call of the callback
                // to report the error
                out.errors = false;
                return;
            }

            out.enterBlock("prototype");
            this._writeClassInit(out);
            this._writeInitTemplate(out);
            out.leaveBlock();

            out.enterBlock("classDefinition");
            this._writeDependencies(out);
            this._writeClassDefEnd(out);
            out.leaveBlock();

            out.enterBlock("main");
            out.writeDependencies();
            out.write(out.getBlockContent("classDefinition"));
            out.leaveBlock();

            out.tree.properties = {
                macros: out.macros,
                views: out.views,
                wlibs: out.wlibs
            };
            var res = null;
            res = out.getBlockContent("main");
            out.$dispose();
            this.$callback(out.callback, {
                classDef : res,
                logicalPath : Aria.getLogicalPath(out.templateParam.$classpath, Aria.ACCEPTED_TYPES[this._classType]),
                tree : out.tree,
                debug : out.debug
            });
        }
1102239
function DOMWalker_processNode(activeNode, idSet) {
    var doc = this._controller.window.document;
    var nodeToProcess = this._getNode(idSet);

    // Opens a new window/dialog through a menulist and runs DOMWalker.walk()
    // for it.
    // If the wanted window/dialog is already selected, just run this function
    // recursively for it's descendants.
    if (activeNode.localName == "menulist") {
      if (nodeToProcess.label != idSet.title) {
        var dropDown = new elementslib.Elem(nodeToProcess);
        this._controller.waitForElement(dropDown);

        this._controller.select(dropDown, null, idSet.title);

        this._controller.waitFor(function() {
          return nodeToProcess.label == idSet.title;
        }, "The menu item did not load in time: " + idSet.title);

        // If the target is a new modal/non-modal window, this.walk() has to be
        // started by the method opening that window. If not, we do it here.
        if (idSet.target == DOMWalker.WINDOW_CURRENT)
          this.walk(idSet.subContent, null, idSet.waitFunction);
      } else if (nodeToProcess.selected && idSet.subContent &&
                 idSet.subContent.length > 0) {
        this._prepareTargetWindows(idSet.subContent);
      }
    }

    // Opens a new prefpane using a provided windowHandler object
    // and runs DOMWalker.walk() for it.
    // If the wanted prefpane is already selected, just run this function
    // recursively for it's descendants.
    else if (activeNode.localName == "prefpane") {
      var windowHandler = idSet.windowHandler;

      if (windowHandler.paneId != idSet.id) {
        windowHandler.paneId = idSet.id;

        // Wait for the pane's content to load and to be fully displayed
        this._controller.waitFor(function() {
          return (nodeToProcess.loaded &&
                  (!mozmill.isMac ||
                   nodeToProcess.style.opacity == 1 ||
                   nodeToProcess.style.opacity == null));
        }, "The pane did not load in time: " + idSet.id);

        // If the target is a new modal/non-modal window, this.walk() has to be
        // started by the method opening that window. If not, we do it here.
        if (idSet.target == DOMWalker.WINDOW_CURRENT)
          this.walk(idSet.subContent, null, idSet.waitFunction);
      } else if (windowHandler.paneId == idSet.id && idSet.subContent &&
                 idSet.subContent.length > 0) {
        this._prepareTargetWindows(idSet.subContent);
      }
    }

    // Switches to another tab and runs DOMWalker.walk() for it.
    // If the wanted tabpanel is already selected, just run this function
    // recursively for it's descendants.
    else if (activeNode.localName == "tab") {
      if (nodeToProcess.selected != true) {
        this._controller.click(new elementslib.Elem(nodeToProcess));

        // If the target is a new modal/non-modal window, this.walk() has to be
        // started by the method opening that window. If not, we do it here.
        if (idSet.target == DOMWalker.WINDOW_CURRENT)
          this.walk(idSet.subContent, null, idSet.waitFunction);
      } else if (nodeToProcess.selected && idSet.subContent
                 && idSet.subContent.length > 0) {
        this._prepareTargetWindows(idSet.subContent);
      }
    }

    // Opens a new dialog/window by clicking on an object and runs
    // DOMWalker.walk() for it.
    else {
      this._controller.click(new elementslib.Elem(nodeToProcess));

      // If the target is a new modal/non-modal window, this.walk() has to be
      // started by the method opening that window. If not, we do it here.
      if (idSet.target == DOMWalker.WINDOW_CURRENT)
        this.walk(idSet.subContent, null, idSet.waitFunction);
    }
  }
357444
def as_view(cls, view_type, *init_args, **init_kwargs):
        
        global _method

        new_cls = type(
            cls.__name__ + '_' + _BridgeMixin.__name__ + '_restless',
            (_BridgeMixin, cls._request_handler_base_,),
            dict(
                __resource_cls__=cls,
                __resource_args__=init_args,
                __resource_kwargs__=init_kwargs,
                __resource_view_type__=view_type)
        )

        """
        Add required http-methods to the newly created class
        We need to scan through MRO to find what functions users declared,
        and then add corresponding http-methods used by Tornado.
        """
        bases = inspect.getmro(cls)
        bases = bases[0:bases.index(Resource)-1]
        for k, v in cls.http_methods[view_type].items():
            if any(v in base_cls.__dict__ for base_cls in bases):
                setattr(new_cls, k.lower(), _method)

        return new_cls
284021
private void initControlAndPostViewInit() throws Exception {
        Control.initSingletonWithView(getControlOverrides());

        final Control control = Control.getSingleton();
        final View view = View.getSingleton();

        EventQueue.invokeAndWait(new Runnable() {

            @Override
            public void run() {
                view.postInit();
                view.getMainFrame().setVisible(true);

                boolean createNewSession = true;
                if (getArgs().isEnabled(CommandLine.SESSION) && getArgs().isEnabled(CommandLine.NEW_SESSION)) {
                    view.showWarningDialog(
                            Constant.messages.getString(
                                    "start.gui.cmdline.invalid.session.options",
                                    CommandLine.SESSION,
                                    CommandLine.NEW_SESSION,
                                    Constant.getZapHome()));

                } else if (getArgs().isEnabled(CommandLine.SESSION)) {
                    Path sessionPath = SessionUtils.getSessionPath(getArgs().getArgument(CommandLine.SESSION));
                    if (!Files.exists(sessionPath)) {
                        view.showWarningDialog(
                                Constant.messages.getString("start.gui.cmdline.session.does.not.exist", Constant.getZapHome()));

                    } else {
                        createNewSession = !control.getMenuFileControl().openSession(sessionPath.toAbsolutePath().toString());
                    }

                } else if (getArgs().isEnabled(CommandLine.NEW_SESSION)) {
                    Path sessionPath = SessionUtils.getSessionPath(getArgs().getArgument(CommandLine.NEW_SESSION));
                    if (Files.exists(sessionPath)) {
                        view.showWarningDialog(
                                Constant.messages
                                        .getString("start.gui.cmdline.newsession.already.exist", Constant.getZapHome()));

                    } else {
                        createNewSession = !control.getMenuFileControl().newSession(sessionPath.toAbsolutePath().toString());
                    }
                }
                view.hideSplashScreen();

                if (createNewSession) {
                    try {
                        control.getMenuFileControl().newSession(false);
                    } catch (Exception e) {
                        logger.error(e.getMessage(), e);
                        View.getSingleton().showWarningDialog(Constant.messages.getString("menu.file.newSession.error"));
                    }
                }

            }
        });

        try {
            // Allow extensions to pick up command line args in GUI mode
            control.getExtensionLoader().hookCommandLineListener(getArgs());
            control.runCommandLine();

        } catch (final Exception e) {
            logger.error(e.getMessage(), e);
            EventQueue.invokeLater(new Runnable() {

                @Override
                public void run() {
                    view.showWarningDialog(e.getMessage());
                }
            });
        }
    }
1271999
function browser (winOptions) {
    winOptions = assign({ graceful: true }, winOptions)

    // Handle `browser-window` being passed as `parent`.
    if (winOptions.parent && winOptions.parent._native) {
      winOptions.parent = winOptions.parent._native
    }

    if (winOptions.graceful) winOptions.show = false

    // Create `BrowserWindow` backend.
    const window = new BrowserWindow(winOptions)

    if (winOptions.graceful) window.on('ready-to-show', function () { window.show() })

    // Method for loading urls or data.
    function load (source, options, callback = noop) {
      if (typeof options === 'function') callback = options, options = {}
      options = assign({type: null, encoding: 'base64'}, options)

      // Callback handler
      var contents = window.webContents
      eventcb(contents, 'did-finish-load', 'did-fail-load', callback)

      // Load source as data:
      if (options.type) {
        const data = Buffer.from(source).toString(options.encoding)
        return window.loadURL(`data:${options.type};${options.encoding},${data}`, options)
      }

      // Load source as URL:
      const protocol = url.parse(source).protocol
      if (!protocol) source = 'file://' + source
      return window.loadURL(source, options)
    }

    // Send IPC messages
    function send (...args) {
      return window.webContents.send(...args)
    }

    // Create a child window
    function subwindow (options) {
      return browser(assign({ parent: window }, options))
    }

    // Return methods
    return {load, send, subwindow, native: window}
  }
612097
function _process(templates, params, cb) {
    var _templates = _.extend(templates, {}), // process template copies, not the originals
      tasks = {};

    _.keys(_templates).forEach(function (key) {
      tasks[key] = function (cb) {
        _templates[key].process(params, function (data) {
          cb(null, data);
        });
      };
    });

    async.parallel(tasks, function (err, results) {
      cb(results);
    });
  }
869777
function (sClassName, oAppComponent, oView, oSelector, mSettings, bAsync) {
			var oExistingControl = this.bySelector(oSelector, oAppComponent);
			var fnCreateUndoOperation = function() {
				if (!oExistingControl) {
					var oCreatedControl = this.bySelector(oSelector, oAppComponent);
					RtaControlTreeModifier._saveUndoOperation("destroy", [oCreatedControl]);
				}
			}.bind(this);

			var vReturnValue = JsControlTreeModifier.createControl.apply(this, arguments);

			if (bAsync) {
				return vReturnValue.then(function(oReturnedControl) {
					fnCreateUndoOperation();
					return oReturnedControl;
				});
			}

			fnCreateUndoOperation();
			return vReturnValue;
		}
347675
function processItems ( items, values, guid, counter ) {
  	if ( counter === void 0 ) counter = 0;

  	return items.map( function ( item ) {
  		if ( item.type === TEXT ) {
  			return item.template;
  		}

  		if ( item.fragment ) {
  			if ( item.fragment.iterations ) {
  				return item.fragment.iterations.map( function ( fragment ) {
  					return processItems( fragment.items, values, guid, counter );
  				}).join( '' );
  			} else {
  				return processItems( item.fragment.items, values, guid, counter );
  			}
  		}

  		var placeholderId = "" + guid + "-" + (counter++);
  		var model = item.model || item.newModel;

  		values[ placeholderId ] = model ?
  			model.wrapper ?
  				model.wrapper.value :
  				model.get() :
  			undefined;

  		return '${' + placeholderId + '}';
  	}).join( '' );
  }
656541
function() {
			Construct.setup.apply(this, arguments);

			// When `Component.setup` function is ran for the first time, `Component` doesn't exist yet
			// which ensures that the following code is ran only in constructors that extend `Component`.
			if (Component) {
				var self = this;

				// Define a control using the `events` prototype property.
				if(this.prototype.events !== undefined && canReflect.size(this.prototype.events) !== 0) {
					this.Control = ComponentControl.extend(this.prototype.events);
				}

				//!steal-remove-start
				if (process.env.NODE_ENV !== 'production') {
					// If a constructor is assigned to the viewModel, give a warning
					if (this.prototype.viewModel && canReflect.isConstructorLike(this.prototype.viewModel)) {
						canDev.warn("can-component: Assigning a DefineMap or constructor type to the viewModel property may not be what you intended. Did you mean ViewModel instead? More info: https://canjs.com/doc/can-component.prototype.ViewModel.html");
					}
				}
				//!steal-remove-end

				// Look at viewModel, scope, and ViewModel properties and set one of:
				//  - this.viewModelHandler
				//  - this.ViewModel
				//  - this.viewModelInstance
				var protoViewModel = this.prototype.viewModel || this.prototype.scope;

				if(protoViewModel && this.prototype.ViewModel) {
					throw new Error("Cannot provide both a ViewModel and a viewModel property");
				}
				var vmName = string.capitalize( string.camelize(this.prototype.tag) )+"VM";
				if(this.prototype.ViewModel) {
					if(typeof this.prototype.ViewModel === "function") {
						this.ViewModel = this.prototype.ViewModel;
					} else {
						this.ViewModel = DefineMap.extend(vmName, {}, this.prototype.ViewModel);
					}
				} else {

					if(protoViewModel) {
						if(typeof protoViewModel === "function") {
							if(canReflect.isObservableLike(protoViewModel.prototype) && canReflect.isMapLike(protoViewModel.prototype)) {
								this.ViewModel = protoViewModel;
							} else {
								this.viewModelHandler = protoViewModel;
							}
						} else {
							if(canReflect.isObservableLike(protoViewModel) && canReflect.isMapLike(protoViewModel)) {
								//!steal-remove-start
								if (process.env.NODE_ENV !== 'production') {
									canLog.warn("can-component: "+this.prototype.tag+" is sharing a single map across all component instances");
								}
								//!steal-remove-end
								this.viewModelInstance = protoViewModel;
							} else {
								canLog.warn("can-component: "+this.prototype.tag+" is extending the viewModel into a can-simple-map");
								this.ViewModel = SimpleMap.extend(vmName,{},protoViewModel);
							}
						}
					} else {
						this.ViewModel = SimpleMap.extend(vmName,{},{});
					}
				}

				// Convert the template into a renderer function.
				if (this.prototype.template) {
					//!steal-remove-start
					if (process.env.NODE_ENV !== 'production') {
						canLog.warn('can-component.prototype.template: is deprecated and will be removed in a future release. Use can-component.prototype.view');
					}
					//!steal-remove-end
					this.view = this.prototype.template;
				}
				if (this.prototype.view) {
					this.view = this.prototype.view;
				}

				// default to stache if renderer is a string
				if (typeof this.view === "string") {
					var viewName = string.capitalize( string.camelize(this.prototype.tag) )+"View";
					this.view = stache(viewName, this.view);
				}

				// TODO: Remove in next release.
				this.renderer = this.view;

				var renderComponent = function(el, tagData) {
					// Check if a symbol already exists on the element; if it does, then
					// a new instance of the component has already been created
					if (el[createdByCanComponentSymbol] === undefined) {
						new self(el, tagData);
					}
				};

				//!steal-remove-start
				if (process.env.NODE_ENV !== 'production') {
					Object.defineProperty(renderComponent, "name",{
						value: "render <"+this.prototype.tag+">",
						configurable: true
					});
					renderComponent = queues.runAsTask(renderComponent, function(el, tagData) {
						return ["Rendering", el, "with",tagData.scope];
					});
				}
				//!steal-remove-end

				// Register this component to be created when its `tag` is found.
				viewCallbacks.tag(this.prototype.tag, renderComponent);
			}
		}
638638
function invokeInstall() {
    async.map(directories,
        function (elem, callback) {
            console.log('Current element', elem);
            removeAndInstall(elem, callback);
        },
        function (err, result) {
            if (err) {
                console.error('Something went wrong! node_modules might now be trashed, sorry.', err);
                process.exit(1);
            } else {
                const ellapsed = new Date().getTime() - start;
                console.log(`Install look good! took ${ellapsed}ms`);
                process.exit(0);
            }
        }
    );
}
925334
@Override
    public void sawOpcode(int seen) {
        boolean sawResource = false;
        try {
            stack.precomputation(this);

            if (seen == Const.INVOKEVIRTUAL) {
                sawResource = processInvokeVirtual();
            } else if (seen == Const.INVOKESPECIAL) {
                sawResource = processInvokeSpecial();
            }

        } finally {
            stack.sawOpcode(this, seen);
            if (sawResource && (stack.getStackDepth() > 0)) {
                OpcodeStack.Item item = stack.getStackItem(0);
                item.setUserValue(Boolean.TRUE);
            }
        }
    }
22598
function AsyncRoute(props) {
  props = merge(props, {
    viewPromise: loadViewModule,
    viewModule: props.view,
    view: undefined
  })
  return Route(props);
}
331004
function (format, view, data, helpers, callback, nodelist) {
		// if callback has expression prop its actually the nodelist
		if (callback !== undefined && typeof callback.expression === 'string') {
			nodelist = callback;
			callback = undefined;
		}
		
		// If helpers is a `function`, it is actually a callback.
		if (isFunction(helpers)) {
			callback = helpers;
			helpers = undefined;
		}

		// give templates the can namespace:
		helpers = Object.assign({ can: can }, helpers);

		// See if we got passed any deferreds.
		var deferreds = getDeferreds(data);
		var deferred, dataCopy, async, response;
		if (deferreds.length) {
			// Does data contain any deferreds?
			// The deferred that resolves into the rendered content...
			deferred = new Deferred();
			dataCopy = Object.assign({}, data);

			// Add the view request to the list of deferreds.
			deferreds.push(getRenderer(view, true));
			// Wait for the view and all deferreds to finish...
			Deferred.when.apply(can, deferreds)
				.then(function (resolved) {
					// Get all the resolved deferreds.
					var objs = makeArray(arguments),
						// Renderer is the last index of the data.
						renderer = objs.pop(),
						// The result of the template rendering with data.
						result;

					// Make data look like the resolved deferreds.
					if (isDeferred(data)) {
						dataCopy = usefulPart(resolved);
					} else {
						// Go through each prop in data again and
						// replace the defferreds with what they resolved to.
						for (var prop in data) {
							if (isDeferred(data[prop])) {
								dataCopy[prop] = usefulPart(objs.shift());
							}
						}
					}

					// Get the rendered result.
					result = can.view.renderTo(format, renderer, dataCopy, helpers, nodelist);

					// Resolve with the rendered view.
					deferred.resolve(result, dataCopy);

					// If there's a `callback`, call it back with the result.
					if (callback) {
						callback(result, dataCopy);
					}
				}, function () {
					deferred.reject.apply(deferred, arguments);
				});
			// Return the deferred...
			return deferred;
		} else {

			// If there's a `callback` function
			async = isFunction(callback);
			
			// get is called async but in
			// ff will be async so we need to temporarily reset
			deferred = Observation.ignore(getRenderer)(view, async);

			// If we are `async`...
			if (async) {
				// Return the deferred
				response = deferred;
				// And fire callback with the rendered result.
				deferred.then(function (renderer) {
					callback(data ? $view.renderTo(format, renderer, data, helpers, nodelist) : renderer);
				});
			} else {
				// if the deferred is resolved, call the cached renderer instead
				// this is because it's possible, with recursive deferreds to
				// need to render a view while its deferred is _resolving_.  A _resolving_ deferred
				// is a deferred that was just resolved and is calling back it's success callbacks.
				// If a new success handler is called while resoliving, it does not get fired by
				// jQuery's deferred system.  So instead of adding a new callback
				// we use the cached renderer.
				// We also add __view_id on the deferred so we can look up it's cached renderer.
				// In the future, we might simply store either a deferred or the cached result.
				if (deferred.state() === 'resolved' && deferred.__view_id) {
					var currentRenderer = $view.cachedRenderers[deferred.__view_id];
					var result =  data ? $view.renderTo(format, currentRenderer, data, helpers, nodelist) : currentRenderer;
					return result;
				} else {
					// Otherwise, the deferred is complete, so
					// set response to the result of the rendering.
					deferred.then(function (renderer) {
						response = data ? $view.renderTo(format, renderer, data, helpers, nodelist) : renderer;
					});
				}
			}

			return response;
		}
	}