From 377212290fd6f12cfbaa4f279ad5a861efb7c545 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 23 Jan 2015 00:19:30 +1100 Subject: [PATCH] `6to5/polyfill` can now only be required **once** --- lib/6to5/polyfill.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/6to5/polyfill.js b/lib/6to5/polyfill.js index 248d028a58..f9a0420916 100644 --- a/lib/6to5/polyfill.js +++ b/lib/6to5/polyfill.js @@ -1,4 +1,9 @@ "use strict"; +if (global._6to5Polyfill) { + throw new Error("only one instance of 6to5/polyfill is allowed"); +} +global._6to5Polyfill = true; + require("core-js/shim"); require("regenerator-6to5/runtime");