embed URL polyfill

This commit is contained in:
guybedford 2016-03-28 12:01:03 +02:00
parent 9af28e625a
commit 18be7fa917
2 changed files with 5 additions and 8 deletions

View File

@ -72,6 +72,7 @@ dist/system.src.js: lib/*.js $(ESML)/*.js
( echo "$$BANNER"; \
cat \
lib/wrapper-start.js \
$(ESML)/url-polyfill.js \
$(ESML)/wrapper-start.js \
$(ESML)/loader.js \
$(ESML)/dynamic-only.js \
@ -107,6 +108,7 @@ dist/system-csp-production.src.js: lib/*.js $(ESML)/*.js
( echo "$$BANNER"; \
cat \
lib/wrapper-start.js \
$(ESML)/url-polyfill.js \
$(ESML)/wrapper-start.js \
$(ESML)/loader.js \
$(ESML)/dynamic-only.js \
@ -136,6 +138,7 @@ dist/system-csp-production.src.js: lib/*.js $(ESML)/*.js
dist/system-register-only.src.js: lib/*.js $(ESML)/*.js
( echo "$$BANNER"; \
cat \
$(ESML)/url-polyfill.js \
$(ESML)/wrapper-start.js \
$(ESML)/loader.js \
$(ESML)/dynamic-only.js \
@ -156,7 +159,6 @@ dist/system-polyfills.src.js: lib/*.js $(ESML)/*.js
echo "(function(define) {"; \
echo ""; \
cat \
$(ESML)/url-polyfill.js \
node_modules/when/es6-shim/Promise.js \
lib/polyfills-bootstrap.js; \
echo "})();" \

View File

@ -1,12 +1,7 @@
}
// auto-load Promise and URL polyfills if needed in the browser
try {
var hasURL = typeof URLPolyfill != 'undefined' || new URL('test:///').protocol == 'test:';
}
catch(e) {}
var doPolyfill = typeof Promise === 'undefined' || !hasURL;
// auto-load Promise polyfill if needed in the browser
var doPolyfill = typeof Promise === 'undefined';
// document.write
if (typeof document !== 'undefined') {