From 9af485a584e47fd503ed5c62b9f6482574715f1e Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 10 Oct 2016 03:50:11 +0200 Subject: Squashed 'thirdparty/systemjs/' content from commit 5ed69b6 git-subtree-dir: thirdparty/systemjs git-subtree-split: 5ed69b6344e8fc1cd43bf758350b2236f57e1499 --- lib/scriptLoader.js | 196 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 lib/scriptLoader.js (limited to 'lib/scriptLoader.js') diff --git a/lib/scriptLoader.js b/lib/scriptLoader.js new file mode 100644 index 000000000..8bd1d4b3e --- /dev/null +++ b/lib/scriptLoader.js @@ -0,0 +1,196 @@ +/* + * Script tag fetch + * + * When load.metadata.scriptLoad is true, we load via script tag injection. + */ +(function() { + + if (typeof document != 'undefined') + var head = document.getElementsByTagName('head')[0]; + + var curSystem; + var curRequire; + + // if doing worker executing, this is set to the load record being executed + var workerLoad = null; + + // interactive mode handling method courtesy RequireJS + var ieEvents = head && (function() { + var s = document.createElement('script'); + var isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]'; + return s.attachEvent && !(s.attachEvent.toString && s.attachEvent.toString().indexOf('[native code') < 0) && !isOpera; + })(); + + // IE interactive-only part + // we store loading scripts array as { script: