This website works better with JavaScript.
Home
Explore
Help
Sign In
jan
/
mustache.js
mirror of
https://github.com/janl/mustache.js
Watch
1
Star
0
Fork
0
Code
Issues
0
Releases
46
Wiki
Activity
Browse Source
Bugfix for view context cache picking methods from Object.prototype instead of the view.
Fixes
#442
tags/v2.1.0
Phillip Johnsen
11 years ago
parent
e31a89a239
commit
e801e842a7
4 changed files
with
7 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-1
mustache.js
+4
-0
test/_files/avoids_obj_prototype_in_view_cache.js
+1
-0
test/_files/avoids_obj_prototype_in_view_cache.mustache
+1
-0
test/_files/avoids_obj_prototype_in_view_cache.txt
+ 1
- 1
mustache.js
View File
@@ -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;
+ 4
- 0
test/_files/avoids_obj_prototype_in_view_cache.js
View File
@@ -0,0 +1,4 @@
({
valueOf: 'Avoids methods',
watch: 'in Object.prototype'
})
+ 1
- 0
test/_files/avoids_obj_prototype_in_view_cache.mustache
View File
@@ -0,0 +1 @@
{{valueOf}} {{watch}}
+ 1
- 0
test/_files/avoids_obj_prototype_in_view_cache.txt
View File
@@ -0,0 +1 @@
Avoids methods in Object.prototype
Write
Preview
Loading…
Cancel
Save