Kaynağa Gözat

Remove `typeof obj === 'object'` constraint in prop lookup

Allows rendering properties of primitive types that are not objects, such as a string.
pull/618/head
David da Silva raymond.lam 9 yıl önce
ebeveyn
işleme
6382ec91e8
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. +1
    -1
      mustache.js

+ 1
- 1
mustache.js Dosyayı Görüntüle

@@ -42,7 +42,7 @@
* including its prototype, has a given property * including its prototype, has a given property
*/ */
function hasProperty (obj, propName) { function hasProperty (obj, propName) {
return obj != null && typeof obj === 'object' && (propName in obj);
return obj != null && (propName in obj);
} }


// Workaround for https://issues.apache.org/jira/browse/COUCHDB-577 // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577


Yükleniyor…
İptal
Kaydet