From 9194d66c7ba96bd371e23b4bb8ce034c1737344e Mon Sep 17 00:00:00 2001 From: Justin Meyer Date: Wed, 28 Nov 2018 09:29:28 -0600 Subject: [PATCH] cleans up unhelpful comments --- expressions/lookup.js | 1 - src/expression-helpers.js | 23 +++++------------------ 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/expressions/lookup.js b/expressions/lookup.js index 8d3cadb4..3913ed12 100644 --- a/expressions/lookup.js +++ b/expressions/lookup.js @@ -15,7 +15,6 @@ var Lookup = function(key, root, sourceText) { }; Lookup.prototype.value = function(scope, readOptions){ if (this.rootExpr) { - // TODO ... how to warn? return expressionHelpers.getObservableValue_fromDynamicKey_fromObservable(this.key, this.rootExpr.value(scope), scope, {}, {}); } else { return scope.computeData(this.key, assign({ diff --git a/src/expression-helpers.js b/src/expression-helpers.js index e70abdfe..7e0d348c 100644 --- a/src/expression-helpers.js +++ b/src/expression-helpers.js @@ -9,24 +9,6 @@ var makeComputeLike = require("can-view-scope/make-compute-like"); var SetterObservable = require("can-simple-observable/setter/setter"); // ## Helpers -// Helper for getting a bound compute in the scope. - -/* -function getObservableValue_fromKey(key, scope, readOptions) { - var data = scope.computeData(key, readOptions); - - // Observation.temporarilyBind(data); - - return data; -}*/ - -// TODO: I think this can be removed -/* -function computeHasDependencies(compute){ - return compute[canSymbol.for("can.valueHasDependencies")] ? - canReflect.valueHasDependencies(compute) : compute.computeInstance.hasDependencies; -} -*/ function getObservableValue_fromDynamicKey_fromObservable(key, root, helperOptions, readOptions) { // This needs to return something similar to a ScopeKeyData with intialValue and parentHasKey @@ -45,6 +27,11 @@ function getObservableValue_fromDynamicKey_fromObservable(key, root, helperOptio Observation.temporarilyBind(computeValue); computeValue.initialValue = canReflect.getValue(computeValue); computeValue.parentHasKey = parentHasKey; + // Todo: + // 1. We should warn here if `initialValue` is undefined. We can expose the warning function + // in can-view-scope and call it here. + // 2. We should make this lazy if possible. We can do that by making getter/setters for + // initialValue and parentHasKey (and possibly @@can.valueHasDependencies) return computeValue; }