Просмотр исходного кода

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 лет назад
Родитель
Сommit
853f9c36df
1 измененных файлов: 1 добавлений и 1 удалений
  1. +1
    -1
      mustache.js

+ 1
- 1
mustache.js Просмотреть файл

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


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


Загрузка…
Отмена
Сохранить