Skip to content

Commit

Permalink
JSXTransformer, stricter parsing of script type
Browse files Browse the repository at this point in the history
  • Loading branch information
syranide committed Jul 19, 2014
1 parent 0f9cec2 commit 0efe8ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vendor/browser-transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,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
};
Expand Down Expand Up @@ -293,7 +293,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));
}
}
Expand Down

0 comments on commit 0efe8ca

Please sign in to comment.