Skip to content

Commit

Permalink
Merge pull request #461 from janl/fix/context-cache
Browse files Browse the repository at this point in the history
Bugfix for view context cache
  • Loading branch information
dasilvacontin committed Jun 4, 2015
2 parents e31a89a + e801e84 commit 15e7016
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mustache.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
var cache = this.cache;

var value;
if (name in cache) {
if (cache.hasOwnProperty(name)) {
value = cache[name];
} else {
var context = this, names, index, lookupHit = false;
Expand Down
4 changes: 4 additions & 0 deletions test/_files/avoids_obj_prototype_in_view_cache.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
({
valueOf: 'Avoids methods',
watch: 'in Object.prototype'
})
1 change: 1 addition & 0 deletions test/_files/avoids_obj_prototype_in_view_cache.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{valueOf}} {{watch}}
1 change: 1 addition & 0 deletions test/_files/avoids_obj_prototype_in_view_cache.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Avoids methods in Object.prototype

0 comments on commit 15e7016

Please sign in to comment.