From 4e631500ea7aaf946c151c32e3226fff3fed3574 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 16 Aug 2016 14:56:14 -0400 Subject: [PATCH] Don't overwrite L if it exists in export scope This makes the module.exports fix more inline with previous behavior. --- src/s2geometry.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/s2geometry.js b/src/s2geometry.js index dee2264..9eaf546 100644 --- a/src/s2geometry.js +++ b/src/s2geometry.js @@ -525,11 +525,15 @@ var L = (function () { // export to module.exports or window if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { module.exports.S2 = S2; - module.exports.L = L; + if (!module.exports.L) { + module.exports.L = L; + } } else { global.S2 = S2; - global.L = L; + if (!global.L) { + global.L = L; + } } })(this);