diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-02-02 16:25:40 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2020-02-02 16:25:40 +0000 |
| commit | 773dfeba460ddea9bc5de86bf59f4e442bff9df2 (patch) | |
| tree | eb587fb2c3e8cdce6a05da9a0e0e0223315d5713 | |
| parent | fix README (diff) | |
| download | alive-773dfeba460ddea9bc5de86bf59f4e442bff9df2.tar.gz alive-773dfeba460ddea9bc5de86bf59f4e442bff9df2.zip | |
fix crashes caused by code errors
| -rw-r--r-- | registry.moon | 6 | ||||
| -rw-r--r-- | scope.moon | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/registry.moon b/registry.moon index 2a751cc..7268f6d 100644 --- a/registry.moon +++ b/registry.moon @@ -96,8 +96,10 @@ class Registry update: (dt) => for typ, sexpr in @root\walk 'inout', false continue unless typ == 'Xpr' - -- continue unless sexpr.value and sexpr.value.update - continue unless sexpr\head!.type == 'opdef' + + head = sexpr\head! + continue unless head and head.type == 'opdef' + continue unless sexpr.value ok, err = xpcall sexpr.value.update, tb, sexpr.value, dt if not ok @@ -60,7 +60,7 @@ class Scope start, rest = key\match '^(.-)/(.*)' if not start - return @parent\get key + return @parent and @parent\get key scope = @get start assert scope and scope.type == 'scope', "cant find '#{prefix}#{start}' for '#{prefix}#{key}'" |
