@samitouri / QOS-React / commits / 6dc04b73a7

Assert that this is a script tag

Also, use a fixed string for the HTML since this is always a script tag.

Sebastian Markbage committed Nov 17, 2016 at 17:24 UTC 6dc04b73a738b93816560bb050d984328d053007
1 file changed +4 -2
src/renderers/dom/fiber/ReactDOMFiberComponent.js
+4 -2
@@ -540,8 +540,10 @@ var ReactDOMFiberComponent = {
540 // Create the script via .innerHTML so its "parser-inserted" flag is
541 // set to true and it does not execute
542 var div = ownerDocument.createElement('div');
543 - div.innerHTML = `<${tag}></${tag}>`;
544 - el = div.removeChild(div.firstChild);
543 + div.innerHTML = '<script></script>';
544 + // This is guaranteed to yield a script element.
545 + var firstChild = ((div.firstChild : any) : Element);
546 + el = div.removeChild(firstChild);
547 } else if (props.is) {
548 el = ownerDocument.createElement(tag, props.is);
549 } else {