Skip to content

Commit bdc8060

Browse files
committed
Fix assertion.
1 parent 41510ec commit bdc8060

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/nodes/function/FunctionRootNode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ public static FunctionRootNode create(AbstractBodyNode body, FrameDescriptor fra
8787
SourceSection sourceSection, ScriptOrModule activeScriptOrModule, TruffleString internalFunctionName) {
8888
FunctionRootNode rootNode = new FunctionRootNode(body, frameDescriptor, functionData, sourceSection, activeScriptOrModule, internalFunctionName);
8989
if (functionData.getContext().getContextOptions().isTestCloneUninitialized()) {
90-
assert JSNodeUtil.hasExactlyOneRootBodyTag(body) : "Function does not have exactly one RootBodyTag";
90+
// async/generator functions have the root body tag in the resumption root node.
91+
assert JSNodeUtil.hasExactlyOneRootBodyTag(body) || rootNode.getFunctionData().isAsync() || rootNode.getFunctionData().isGenerator() : "Function does not have exactly one RootBodyTag";
9192
return (FunctionRootNode) rootNode.cloneUninitialized();
9293
} else {
9394
return rootNode;

0 commit comments

Comments
 (0)