Skip to content

Commit 284180b

Browse files
author
hartsantler
committed
function expressions are now the default function type (hoisted functions are not default anymore)
this breaks some of the regtests that were prototypes for auto async transform using functions like `sleep`.
1 parent c1a088b commit 284180b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pythonjs/pythonjs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, node):
2525
RuntimeError.__init__(self)
2626

2727
class JSGenerator(NodeVisitor): #, inline_function.Inliner):
28-
def __init__(self, requirejs=True, insert_runtime=True, webworker=False, function_expressions=False):
28+
def __init__(self, requirejs=True, insert_runtime=True, webworker=False, function_expressions=True):
2929
#writer = code_writer.Writer()
3030
#self.setup_inliner( writer )
3131
self._func_expressions = function_expressions
@@ -1266,7 +1266,7 @@ def generate_runtime():
12661266
]
12671267
return '\n'.join( lines )
12681268

1269-
def main(source, requirejs=True, insert_runtime=True, webworker=False, function_expressions=False):
1269+
def main(source, requirejs=True, insert_runtime=True, webworker=False, function_expressions=True):
12701270
head = []
12711271
tail = []
12721272
script = False

0 commit comments

Comments
 (0)