瀏覽代碼

pop lookup needs to use hasOwnProperty for non-objs

pull/618/head
raymond.lam 9 年之前
父節點
當前提交
81080456dd
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      mustache.js

+ 4
- 1
mustache.js 查看文件

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

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


Loading…
取消
儲存