From d33682c7eab311092b5ad0b1bf79dc125fca6473 Mon Sep 17 00:00:00 2001 From: Getz Date: Fri, 7 Jul 2017 16:09:49 -0400 Subject: [PATCH 1/4] jsep undefined fix --- Source/ThirdParty/jsep.js | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/Source/ThirdParty/jsep.js b/Source/ThirdParty/jsep.js index 7c5886740f6f..4f2bd449a6ec 100644 --- a/Source/ThirdParty/jsep.js +++ b/Source/ThirdParty/jsep.js @@ -3,9 +3,6 @@ // http://jsep.from.so/ define(function() { - -/*global module: true, exports: true, console: true */ -(function (root) { 'use strict'; // Node Types // ---------- @@ -658,27 +655,5 @@ define(function() { return this; }; - // In desktop environments, have a way to restore the old value for `jsep` - if (typeof exports === 'undefined') { - var old_jsep = root.jsep; - // The star of the show! It's a function! - root.jsep = jsep; - // And a courteous function willing to move out of the way for other similarly-named objects! - jsep.noConflict = function() { - if(root.jsep === jsep) { - root.jsep = old_jsep; - } - return jsep; - }; - } else { - // In Node.JS environments - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = jsep; - } else { - exports.parse = jsep; - } - } -}(this)); - - return jsep.noConflict(); + return jsep; }); From c84e6fc275008c452c292283fe34b7d34b0cc824 Mon Sep 17 00:00:00 2001 From: Getz Date: Fri, 7 Jul 2017 16:32:11 -0400 Subject: [PATCH 2/4] Updated CHANGES.md --- CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 01510bdcf2f4..1bdbba6beb41 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,10 @@ Change Log ========== +### 1.36 - 2017-08-01 + +* Fixed a bug where jsep was undefined when using webpack [#5593](https://github.com/AnalyticalGraphicsInc/cesium/issues/5593) + ### 1.35 - 2017-07-05 * Breaking changes From 4002ae2faafd657a1239a0f743848bca9a42759e Mon Sep 17 00:00:00 2001 From: ggetz Date: Mon, 10 Jul 2017 12:26:29 -0400 Subject: [PATCH 3/4] Use noConflict jsep if it is defined --- Source/ThirdParty/jsep.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Source/ThirdParty/jsep.js b/Source/ThirdParty/jsep.js index 4f2bd449a6ec..2ba42bd1d12f 100644 --- a/Source/ThirdParty/jsep.js +++ b/Source/ThirdParty/jsep.js @@ -3,6 +3,9 @@ // http://jsep.from.so/ define(function() { + +/*global module: true, exports: true, console: true */ +(function (root) { 'use strict'; // Node Types // ---------- @@ -655,5 +658,31 @@ define(function() { return this; }; + // In desktop environments, have a way to restore the old value for `jsep` + if (typeof exports === 'undefined') { + var old_jsep = root.jsep; + // The star of the show! It's a function! + root.jsep = jsep; + // And a courteous function willing to move out of the way for other similarly-named objects! + jsep.noConflict = function() { + if(root.jsep === jsep) { + root.jsep = old_jsep; + } + return jsep; + }; + } else { + // In Node.JS environments + if (typeof module !== 'undefined' && module.exports) { + exports = module.exports = jsep; + } else { + exports.parse = jsep; + } + } +}(this)); + + if (typeof jsep.noConflict === 'function') { + return jsep.noConflict(); + } + return jsep; }); From 75aefd47345928ae7c670da8676b846b43c37348 Mon Sep 17 00:00:00 2001 From: ggetz Date: Mon, 10 Jul 2017 15:17:52 -0400 Subject: [PATCH 4/4] check for jsep being undefined --- Source/ThirdParty/jsep.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/ThirdParty/jsep.js b/Source/ThirdParty/jsep.js index 2ba42bd1d12f..c7a175a5657a 100644 --- a/Source/ThirdParty/jsep.js +++ b/Source/ThirdParty/jsep.js @@ -680,9 +680,8 @@ define(function() { } }(this)); - if (typeof jsep.noConflict === 'function') { + // `jsep` only exists when running in the browser + if (typeof jsep !== 'undefined') { return jsep.noConflict(); } - - return jsep; });