Skip to content

Commit

Permalink
Don't force sourcemaps on for JSXTransformer APIs
Browse files Browse the repository at this point in the history
In case somebody doesn't want sourcemaps (eg, react-rails) or r.js
  • Loading branch information
zpao committed Aug 16, 2014
1 parent d970dc4 commit d9a053d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions vendor/browser-transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ var supportsAccessors = Object.prototype.hasOwnProperty('__defineGetter__');
*/
function transformReact(source, options) {
// TODO: just use react-tools
options = options || {};
var visitorList;
if (options && options.harmony) {
if (options.harmony) {
visitorList = visitors.getAllVisitors();
} else {
visitorList = visitors.transformVisitors.react;
}

return transform(visitorList, source, {
sourceMap: supportsAccessors
sourceMap: supportsAccessors && options.sourceMap
});
}

Expand Down Expand Up @@ -250,11 +251,11 @@ function loadScripts(scripts) {
}

scripts.forEach(function(script, i) {
var options;
var options = {
sourceMap: true
};
if (/;harmony=true(;|$)/.test(script.type)) {
options = {
harmony: true
};
options.harmony = true
}

// script.async is always true for non-javascript script tags
Expand Down

0 comments on commit d9a053d

Please sign in to comment.