This static verification is required by the Jsonnet specification, but Sjsonnet does not verify references until they are evaluated. Both of these expressions are accepted by Sjsonnet because the illegal references are never evaluated:
$ echo "local x = y; 1" | jsonnet -
STATIC ERROR: <stdin>:1:11: Unknown variable: y
$ echo "local x = self.y; 1" | jsonnet -
STATIC ERROR: <stdin>:1:11-15: Can't use self outside of an object.
This static verification is required by the Jsonnet specification, but Sjsonnet does not verify references until they are evaluated. Both of these expressions are accepted by Sjsonnet because the illegal references are never evaluated: