- Home /
Eval() System.NotSupportedException
I'm attempting to use eval() in a JavaScript script attached to an empty game object in my game, in the hope that I'll be able to play my game and make changes as I go along to speed up the refining process a bit (I know they won't be saved but at least I'll know what to do).
My script is pretty simple at the moment, I'm just testing it out. However, even this simple call gives me the error:
CompilationErrorsException: script(1,1): BCE0055: Boo.Lang.Compiler.CompilerError:Internal compiler error: Boo.Lang.Compiler.TypeSystem.BuiltinFunction. ---> System.NotSupportedException: Boo.Lang.Compiler.TypeSystem.BuiltinFunction
at Boo.Lang.Compiler.TypeSystem.EntityExtensions.DisplayName (IEntity entity) [0x00000] in <filename unknown>:0
at Boo.Lang.Compiler.CompilerErrorFactory.DisplayStringFor (System.Object o) [0x00000] in <filename unknown>:0
...(and more)
And my code is :
function OnGUI() {
GUI.BeginGroup(Rect(10, 10, 450, 150));
GUI.Box(Rect(0, 0, 450, 150), "Command Panel");
// code = GUI.TextField(Rect(10, 10, 430, 30), code);
GUI.EndGroup();
if (Input.GetKeyDown (KeyCode.Return)) {
eval('Debug.Log("Test");');
}
}
I've tried my best to research what's going wrong but I can't find any other cases of this problem using the eval() function; most are with internet services. I've seen that the error is said to be at script(1,1)
which makes me think that I've left something out at the start, but as soon as I remove the eval() function it's fine.
Any ideas?
Answer by gfoot · Mar 26, 2014 at 10:03 PM
Do you have #pragma strict turned on? If so, turn it off.
I removed it but haven't replaced it with anything else. Is there something else I should put there?
Wow turning off #pragma strict worked for me! I am going to research why this is, but thank you :D
Your answer
![](https://koobas.hobune.stream/wayback/20220613141244im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
What's wrong with eval()? 1 Answer
I need help with the eval() function of javascrit 1 Answer
Issue with OnTriggerEnter. 1 Answer
expecting (, found 'Update' and unexpected char: 0x200B. 2 Answers
Player not taking any damage 2 Answers