Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
use more randon parentScope property name
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelw committed Feb 5, 2014
1 parent 6e25f86 commit d77ecb9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/polymer-expressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,13 +511,15 @@
mixedCaseEventTypes[e.toLowerCase()] = e;
});

var parentScopeName = '@' + Math.random().toString(36).slice(2);

// Single ident paths must bind directly to the appropriate scope object.
// I.e. Pushed values in two-bindings need to be assigned to the actual model
// object.
function findScope(model, prop) {
while (model.__parentScope &&
while (model[parentScopeName] &&
!Object.prototype.hasOwnProperty.call(model, prop)) {
model = model.__parentScope;
model = model[parentScopeName];
}

return model;
Expand Down Expand Up @@ -651,7 +653,7 @@
var scope = Object.create(parentScope);
scope[scopeName] = model;
scope[indexName] = undefined;
scope.__parentScope = parentScope;
scope[parentScopeName] = parentScope;
return scope;
};
}
Expand Down

0 comments on commit d77ecb9

Please sign in to comment.