mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #1827 from syranide/jsxstrict
JSXTransformer, stricter parsing of script type
This commit is contained in:
Vendored
+2
-2
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user