Browse Source

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 years ago
parent
commit
6382ec91e8
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      mustache.js

+ 1
- 1
mustache.js View File

@@ -42,7 +42,7 @@
* including its prototype, has a given property
*/
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


Loading…
Cancel
Save