JohnEarnest/ok

.slice[1]

ngn opened this issue · 3 comments

ngn commented

ok/oK.js

Line 621 in 233c4bf

if (ds.t!=2) { return d; } env.put(ks(ds.v.slice[1]), true, d); return ds;

Square brackets look wrong there though the tests do cover that bit of code.

Wow, good catch! Must've been typing that function call while my brain was in K mode. I'm surprised that didn't cause overt issues.

It definitely doesn't have proper test coverage- you can just entirely elide env.put(ks(ds.v.slice[1]), true, d); and everything passes fine.

I'd need to spend some time wrapping my brain around this function to determine whether that fragment ought to be there at all.

As far as I can tell that code was vestigial. Removed it and simplified the surrounding routine.