We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c6d4334 commit d42d295Copy full SHA for d42d295
Appraisals
@@ -9,3 +9,8 @@ end
9
appraise "rails-4.0" do
10
gem 'rails', '~> 4.0'
11
end
12
+
13
+appraise "rails-4.0-with-therubyracer" do
14
+ gem 'rails', '~> 4.0'
15
+ gem 'therubyracer', '0.12.0', :platform => :mri
16
+end
lib/react/jsx.rb
@@ -6,7 +6,11 @@ module React
6
module JSX
7
def self.context
8
# TODO: create React::Source::contents_for
- contents = File.read(React::Source.bundled_path_for('JSXTransformer.js'))
+ contents =
+ # If execjs uses therubyracer, there is no 'global'. Make sure
+ # we have it so JSX script can work properly.
+ 'var global = global || this;' +
+ File.read(React::Source.bundled_path_for('JSXTransformer.js'))
@context ||= ExecJS.compile(contents)
0 commit comments