diff --git a/package.json b/package.json index 6d9ddc2..8fa4a8b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "babel-standalone", - "version": "6.24.1", + "version": "6.24.2", "description": "Standalone build of Babel for use in non-Node.js environments. Similar to the (now deprecated) babel-browser", "main": "babel.js", "scripts": { diff --git a/src/index.js b/src/index.js index 1eee091..ce42d6d 100644 --- a/src/index.js +++ b/src/index.js @@ -257,7 +257,7 @@ export const version = VERSION; // Listen for load event if we're in a browser and then kick off finding and // running of scripts with "text/babel" type. if (typeof window !== 'undefined' && window && window.addEventListener) { - window.addEventListener('DOMContentLoaded', transformScriptTags, false); + window.addEventListener('DOMContentLoaded', () => transformScriptTags(), false); } /** @@ -274,4 +274,3 @@ export function transformScriptTags(scriptTags) { export function disableScriptTags() { window.removeEventListener('DOMContentLoaded', transformScriptTags); } - diff --git a/src/transformScriptTags.js b/src/transformScriptTags.js index cbdf88f..b227319 100644 --- a/src/transformScriptTags.js +++ b/src/transformScriptTags.js @@ -184,12 +184,9 @@ function loadScripts(transformFn, scripts) { * Run script tags with type="text/jsx". * @param {Array} scriptTags specify script tags to run, run all in the if not given */ -export function runScripts(transformFn, scriptTags) { - let scripts +export function runScripts(transformFn, scripts) { headEl = document.getElementsByTagName('head')[0]; - if(scriptTags) { - scripts = scriptTags - } else { + if (!scripts) { scripts = document.getElementsByTagName('script'); }