Skip to content

Commit

Permalink
Fix assertion.
Browse files Browse the repository at this point in the history
  • Loading branch information
woess committed May 9, 2023
1 parent 41510ec commit bdc8060
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -87,7 +87,8 @@ public static FunctionRootNode create(AbstractBodyNode body, FrameDescriptor fra
SourceSection sourceSection, ScriptOrModule activeScriptOrModule, TruffleString internalFunctionName) {
FunctionRootNode rootNode = new FunctionRootNode(body, frameDescriptor, functionData, sourceSection, activeScriptOrModule, internalFunctionName);
if (functionData.getContext().getContextOptions().isTestCloneUninitialized()) {
assert JSNodeUtil.hasExactlyOneRootBodyTag(body) : "Function does not have exactly one RootBodyTag";
// async/generator functions have the root body tag in the resumption root node.
assert JSNodeUtil.hasExactlyOneRootBodyTag(body) || rootNode.getFunctionData().isAsync() || rootNode.getFunctionData().isGenerator() : "Function does not have exactly one RootBodyTag";
return (FunctionRootNode) rootNode.cloneUninitialized();
} else {
return rootNode;
Expand Down

0 comments on commit bdc8060

Please sign in to comment.