Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fglock committed Oct 10, 2024
1 parent 01058e7 commit 2821bac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,7 @@ public static Class<?> createClassWithMethod(EmitterContext ctx, Node ast, boole
mv.visitMethodInsn(Opcodes.INVOKESTATIC,
"org/perlonjava/runtime/GlobalContext",
"setGlobalVariable",
"(Ljava/lang/String;Ljava/lang/String;)Lorg/perlonjava/runtime/RuntimeScalar;", false);
mv.visitInsn(Opcodes.POP); // throw away the RuntimeScalar result
"(Ljava/lang/String;Ljava/lang/String;)V", false);

// Restore the stack state to match the end of the try block if needed
// Return "undef"
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/perlonjava/runtime/GlobalContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public static RuntimeScalar getGlobalVariable(String key) {
return var;
}

public static RuntimeScalar setGlobalVariable(String key, String value) {
return getGlobalVariable(key).set(value);
public static void setGlobalVariable(String key, String value) {
getGlobalVariable(key).set(value);
}

public static boolean existsGlobalVariable(String key) {
Expand Down

0 comments on commit 2821bac

Please sign in to comment.