Browse Source

Update UMD Shim to be resilient to HTMLElement global pollution

Please see https://github.com/umdjs/umd/pull/63 and https://github.com/umdjs/umd/issues/35 for more information, but
this change prevents an HTML element with an id of `exports` from causing the UMD shim to incorrectly detect the environment as node.
tags/v2.1.3
Mike Sherov 10 years ago
parent
commit
853f9c36df
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      mustache.js

+ 1
- 1
mustache.js View File

@@ -6,7 +6,7 @@
/*global define: false Mustache: true*/

(function defineMustache (global, factory) {
if (typeof exports === 'object' && exports) {
if (typeof exports === 'object' && exports && typeof exports.nodeName !== 'string') {
factory(exports); // CommonJS
} else if (typeof define === 'function' && define.amd) {
define(['exports'], factory); // AMD


Loading…
Cancel
Save