Skip to content

Commit

Permalink
cleans up unhelpful comments
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbmeyer committed Nov 28, 2018
1 parent fbf4961 commit 9194d66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
1 change: 0 additions & 1 deletion expressions/lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
23 changes: 5 additions & 18 deletions src/expression-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

Expand Down

0 comments on commit 9194d66

Please sign in to comment.