[@babel/standalone] Remove additional function context (#7094)
This commit is contained in:
@@ -244,14 +244,14 @@ registerPresets({
|
||||
|
||||
export const version = VERSION;
|
||||
|
||||
function onDOMContentLoaded() {
|
||||
transformScriptTags();
|
||||
}
|
||||
|
||||
// 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", onDOMContentLoaded, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,5 +266,5 @@ export function transformScriptTags(scriptTags) {
|
||||
* Disables automatic transformation of <script> tags with "text/babel" type.
|
||||
*/
|
||||
export function disableScriptTags() {
|
||||
window.removeEventListener("DOMContentLoaded", transformScriptTags);
|
||||
window.removeEventListener("DOMContentLoaded", onDOMContentLoaded);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user