Avoid using require in source because browserify does a quick regexp match for \brequire\b before deciding whether to build an AST to get require calls.

This commit is contained in:
jdalton
2015-05-07 23:59:51 -07:00
parent 004aaed783
commit 172eca6081

View File

@@ -10509,7 +10509,7 @@
* use a third-party library like [_he_](https://mths.be/he). * use a third-party library like [_he_](https://mths.be/he).
* *
* Though the ">" character is escaped for symmetry, characters like * Though the ">" character is escaped for symmetry, characters like
* ">" and "/" don't require escaping in HTML and have no special meaning * ">" and "/" don't need escaping in HTML and have no special meaning
* unless they're part of a tag or unquoted attribute value. * unless they're part of a tag or unquoted attribute value.
* See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
* (under "semi-related fun fact") for more details. * (under "semi-related fun fact") for more details.
@@ -11524,9 +11524,6 @@
* }); * });
* } * }
* *
* // use `_.runInContext` to avoid conflicts (esp. in Node.js)
* var _ = require('lodash').runInContext();
*
* _.mixin({ 'vowels': vowels }); * _.mixin({ 'vowels': vowels });
* _.vowels('fred'); * _.vowels('fred');
* // => ['e'] * // => ['e']
@@ -12511,7 +12508,7 @@
if (moduleExports) { if (moduleExports) {
(freeModule.exports = _)._ = _; (freeModule.exports = _)._ = _;
} }
// Export for Narwhal or Rhino -require. // Export for Narwhal or Rhino with CommonJS.
else { else {
freeExports._ = _; freeExports._ = _;
} }