removed ability to automatically register events by running imports code, part two for 304
This commit is contained in:
1 parent
7983917f71
commit
4271aa3a8e
2 files changed
+4
-1
No files matched your search
@@ -96,7 +96,7 @@ public class CarpetScriptHost extends ScriptHost
|
||||
public void addUserDefinedFunction(Context ctx, Module module, String funName, FunctionValue function)
|
||||
{
|
||||
super.addUserDefinedFunction(ctx, module, funName, function);
|
||||
// mcarpet
|
||||
if (ctx.host.main != module) return; // not dealing with automatic imports / exports /configs / apps from imports
|
||||
if (funName.startsWith("__")) // potential fishy activity
|
||||
{
|
||||
if (funName.startsWith("__on_")) // here we can make a determination if we want to only accept events from main module.
|
||||
|
||||
@@ -5,6 +5,7 @@ import carpet.script.Expression;
|
||||
import carpet.script.Fluff;
|
||||
import carpet.script.LazyValue;
|
||||
import carpet.script.Tokenizer;
|
||||
import carpet.script.bundled.Module;
|
||||
import carpet.script.exception.BreakStatement;
|
||||
import carpet.script.exception.ContinueStatement;
|
||||
import carpet.script.exception.ExitStatement;
|
||||
@@ -58,6 +59,8 @@ public class FunctionValue extends Value implements Fluff.ILazyFunction
|
||||
return name;
|
||||
}
|
||||
|
||||
public Module getModule() {return expression.module;}
|
||||
|
||||
@Override
|
||||
public String getPrettyString()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user