added __setter and __getter

This commit is contained in:
2020-12-06 14:11:33 -06:00
parent 005e2acd1e
commit d00b803e6f
5 changed files with 53 additions and 16 deletions

View File

@@ -44,6 +44,10 @@ CState *cosmoV_newState() {
state->iStrings[ISTRING_INDEX] = cosmoO_copyString(state, "__index", 7);
state->iStrings[ISTRING_NEWINDEX] = cosmoO_copyString(state, "__newindex", 10);
// getters/setters
state->iStrings[ISTRING_GETTER] = cosmoO_copyString(state, "__getter", 8);
state->iStrings[ISTRING_SETTER] = cosmoO_copyString(state, "__setter", 8);
return state;
}