Denna sida fungerar bättre med Javascript igång.
Startsida
Utforska
Hjälp
Logga in
jan
/
mustache.js
spegling av
https://github.com/janl/mustache.js
Bevaka
1
Stjärnmärk
0
Förgrening
0
Kod
Ärenden
0
Släpp
46
Wiki
Aktiviteter
Bläddra i källkod
Bugfix for view context cache picking methods from Object.prototype instead of the view.
Fixes
#442
tags/v2.1.0
Phillip Johnsen
11 år sedan
förälder
e31a89a239
incheckning
e801e842a7
4 ändrade filer
med
7 tillägg
och
1 borttagningar
Delad Vy
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
Visa fil
@@ -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
Visa fil
@@ -0,0 +1,4 @@
({
valueOf: 'Avoids methods',
watch: 'in Object.prototype'
})
+ 1
- 0
test/_files/avoids_obj_prototype_in_view_cache.mustache
Visa fil
@@ -0,0 +1 @@
{{valueOf}} {{watch}}
+ 1
- 0
test/_files/avoids_obj_prototype_in_view_cache.txt
Visa fil
@@ -0,0 +1 @@
Avoids methods in Object.prototype
Write
Förhandsgranska
Laddar…
Avbryt
Spara