Merge pull request #1827 from syranide/jsxstrict

JSXTransformer, stricter parsing of script type
This commit is contained in:
Paul O’Shannessy 2014-07-30 21:39:37 -07:00
commit db6e07e87d
1 changed files with 2 additions and 2 deletions

View File

@ -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));
}
}