From 18be7fa917e2004b6a368ee38afe800014cb13bc Mon Sep 17 00:00:00 2001 From: guybedford Date: Mon, 28 Mar 2016 12:01:03 +0200 Subject: [PATCH] embed URL polyfill --- Makefile | 4 +++- lib/wrapper-end.js | 9 ++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index a02704c8..9cc3f49d 100755 --- a/Makefile +++ b/Makefile @@ -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 "})();" \ diff --git a/lib/wrapper-end.js b/lib/wrapper-end.js index 018128c0..3d1fcc4c 100644 --- a/lib/wrapper-end.js +++ b/lib/wrapper-end.js @@ -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') {