@samitouri / QOS-React-2 / commits / 0efe8ca362

JSXTransformer, stricter parsing of script type

Andreas Svensson committed Jul 13, 2014 at 23:51 UTC 0efe8ca36294c7416cc3260c1db3c03090a688b1
1 file changed +2 -2
vendor/browser-transforms.js
+2 -2
@@ -254,7 +254,7 @@ function loadScripts(scripts) {
254
255 scripts.forEach(function(script, i) {
256 var options;
257 - if (script.type.indexOf('harmony=true') !== -1) {
257 + if (/;harmony=true(;|$)/.test(script.type)) {
258 options = {
259 harmony: true
260 };
@@ -293,7 +293,7 @@ function runScripts() {
293 // Array.prototype.slice cannot be used on NodeList on IE8
294 var jsxScripts = [];
295 for (var i = 0; i < scripts.length; i++) {
296 - if (scripts.item(i).type.indexOf('text/jsx') !== -1) {
296 + if (/^text\/jsx(;|$)/.test(scripts.item(i).type)) {
297 jsxScripts.push(scripts.item(i));
298 }
299 }