File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
src/main/java/com/annimon/ownlang Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,15 @@ public Value access(Value value) {
43
43
return thisMap .get (value );
44
44
}
45
45
46
+ public void set (Value key , Value value ) {
47
+ final Value v = thisMap .get (key );
48
+ if (v == null ) {
49
+ throw new RuntimeException ("Unable to add new field "
50
+ + key .asString () + " to class " + className );
51
+ }
52
+ thisMap .set (key , value );
53
+ }
54
+
46
55
@ Override
47
56
public Object raw () {
48
57
return null ;
Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ public Value set(Value value) {
73
73
((MapValue ) container ).set (lastIndex , value );
74
74
return value ;
75
75
76
+ case Types .CLASS :
77
+ ((ClassInstanceValue ) container ).set (lastIndex , value );
78
+ return value ;
79
+
76
80
default :
77
81
throw new TypeException ("Array or map expected. Got " + container .type ());
78
82
}
You can’t perform that action at this time.
0 commit comments