Skip to content

Commit 9fe6ec7

Browse files
committed
Merge pull request facebookarchive#17 from andreypopp/pin-pyexecjs
Fix for PyExecJS >= 1.0.5
2 parents 60916c0 + 1855619 commit 9fe6ec7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

react/jsx.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
class JSXTransformer(object):
2020

21+
JSX_TRANSFORMER_JS_EXPR = '(global.JSXTransformer || module.exports)'
22+
2123
def __init__(self):
2224
path = react.source.path_for('JSXTransformer.js')
2325
with open(path, 'rU') as f:
@@ -37,7 +39,8 @@ def transform_string(self, jsx, harmony=False, strip_types=False):
3739
"""
3840
opts = {'harmony': harmony, 'stripTypes': strip_types}
3941
try:
40-
result = self.context.call('JSXTransformer.transform', jsx, opts)
42+
result = self.context.call(
43+
'%s.transform' % self.JSX_TRANSFORMER_JS_EXPR, jsx, opts)
4144
except execjs.ProgramError as e:
4245
raise TransformError(e.message[7:])
4346
js = result['code']

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
'js/react/JSXTransformer.js',
3131
]},
3232
install_requires=[
33-
'PyExecJS >= 1.0.4',
33+
'PyExecJS >= 1.0.5',
3434
]
3535
)

0 commit comments

Comments
 (0)