Merge pull request #1827 from syranide/jsxstrict
JSXTransformer, stricter parsing of script type
This commit is contained in:
commit
db6e07e87d
|
@ -252,7 +252,7 @@ function loadScripts(scripts) {
|
|||
|
||||
scripts.forEach(function(script, i) {
|
||||
var options;
|
||||
if (script.type.indexOf('harmony=true') !== -1) {
|
||||
if (/;harmony=true(;|$)/.test(script.type)) {
|
||||
options = {
|
||||
harmony: true
|
||||
};
|
||||
|
@ -291,7 +291,7 @@ function runScripts() {
|
|||
// Array.prototype.slice cannot be used on NodeList on IE8
|
||||
var jsxScripts = [];
|
||||
for (var i = 0; i < scripts.length; i++) {
|
||||
if (scripts.item(i).type.indexOf('text/jsx') !== -1) {
|
||||
if (/^text\/jsx(;|$)/.test(scripts.item(i).type)) {
|
||||
jsxScripts.push(scripts.item(i));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue