built-in variables can be used in outer scopes.
This commit is contained in:
1 parent
18edddcade
commit
dd2630579b
1 file changed
+4
-1
@@ -1,10 +1,13 @@
|
||||
package carpet.script.value;
|
||||
|
||||
import carpet.script.exception.InternalExpressionException;
|
||||
|
||||
public class GlobalValue extends Value
|
||||
{
|
||||
public GlobalValue(Value variable)
|
||||
{
|
||||
variable.assertAssignable();
|
||||
if (variable.boundVariable == null)
|
||||
throw new InternalExpressionException("You can only borrow variables from the outer scope");
|
||||
this.boundVariable = variable.boundVariable;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user