From 1895c7b8e0f75746a41f2792d0e43ebd0c2df874 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 9 Jun 2021 08:32:09 -0400 Subject: [PATCH] Updated Rhino --- build.gradle | 2 +- core/src/mindustry/mod/Scripts.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 85f4e052b6..950d2cda44 100644 --- a/build.gradle +++ b/build.gradle @@ -39,7 +39,7 @@ allprojects{ if(!project.hasProperty("versionType")) versionType = 'official' appName = 'Mindustry' steamworksVersion = '0b86023401880bb5e586bc404bedbaae9b1f1c94' - rhinoVersion = '099aed6c82f8094b3ba39a273b8d2ba7bdcc6443' + rhinoVersion = '55bf0dac1cfa7770672fd26112512c733ca9d5dc' loadVersionProps = { return new Properties().with{p -> p.load(file('../core/assets/version.properties').newReader()); return p } diff --git a/core/src/mindustry/mod/Scripts.java b/core/src/mindustry/mod/Scripts.java index 0517d99311..4f70c0c814 100644 --- a/core/src/mindustry/mod/Scripts.java +++ b/core/src/mindustry/mod/Scripts.java @@ -60,7 +60,7 @@ public class Scripts implements Disposable{ public String runConsole(String text){ try{ - Object o = context.evaluateString(scope, text, "console.js", 1, null); + Object o = context.evaluateString(scope, text, "console.js", 1); if(o instanceof NativeJavaObject n) o = n.unwrap(); if(o instanceof Undefined) o = "undefined"; return String.valueOf(o); @@ -172,11 +172,11 @@ public class Scripts implements Disposable{ try{ if(currentMod != null){ //inject script info into file - context.evaluateString(scope, "modName = \"" + currentMod.name + "\"\nscriptName = \"" + file + "\"", "initscript.js", 1, null); + context.evaluateString(scope, "modName = \"" + currentMod.name + "\"\nscriptName = \"" + file + "\"", "initscript.js", 1); } context.evaluateString(scope, wrap ? "(function(){'use strict';\n" + script + "\n})();" : script, - file, 0, null); + file, 0); return true; }catch(Throwable t){ if(currentMod != null){ @@ -224,7 +224,7 @@ public class Scripts implements Disposable{ if(!module.exists() || module.isDirectory()) return null; return new ModuleSource( new InputStreamReader(new ByteArrayInputStream((module.readString()).getBytes())), - null, new URI(moduleId), root.file().toURI(), validator); + new URI(moduleId), root.file().toURI(), validator); } } }