소스 검색

Bugfix for view context cache picking methods from Object.prototype instead of the view.

Fixes #442
tags/v2.1.0
Phillip Johnsen 11 년 전
부모
커밋
e801e842a7
4개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. +1
    -1
      mustache.js
  2. +4
    -0
      test/_files/avoids_obj_prototype_in_view_cache.js
  3. +1
    -0
      test/_files/avoids_obj_prototype_in_view_cache.mustache
  4. +1
    -0
      test/_files/avoids_obj_prototype_in_view_cache.txt

+ 1
- 1
mustache.js 파일 보기

@@ -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 파일 보기

@@ -0,0 +1,4 @@
({
valueOf: 'Avoids methods',
watch: 'in Object.prototype'
})

+ 1
- 0
test/_files/avoids_obj_prototype_in_view_cache.mustache 파일 보기

@@ -0,0 +1 @@
{{valueOf}} {{watch}}

+ 1
- 0
test/_files/avoids_obj_prototype_in_view_cache.txt 파일 보기

@@ -0,0 +1 @@
Avoids methods in Object.prototype

불러오는 중...
취소
저장