Skip to content

Commit

Permalink
Do not call Map/Set directly with iterables
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaswilburn committed Sep 5, 2018
1 parent 2a1e16d commit ac50344
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions key/key.js
Expand Up @@ -72,11 +72,13 @@ module.exports = function keyObservable(root, keyPath) {

// Register what this observable changes
symbolsToAssign["can.getWhatIChange"] = function getWhatIChange() {
var m = new Map();
var s = new Set();
s.add(lastKey);
m.set(lastParent, s);
return {
mutate: {
keyDependencies: new Map([
[lastParent, new Set([lastKey])]
])
keyDependencies: m
}
};
};
Expand Down
4 changes: 3 additions & 1 deletion resolver/resolver.js
Expand Up @@ -96,8 +96,10 @@ canReflect.assignMap(ResolverObservable.prototype, {

var contextHandler = handler.bind(this.context);
contextHandler[getChangesSymbol] = function getChangesDependencyRecord() {
var s = new Set();
s.add(resolverInstance);
return {
valueDependencies: new Set([ resolverInstance ])
valueDependencies: s
};
};

Expand Down

0 comments on commit ac50344

Please sign in to comment.