richardhundt / shine

A Shiny Lua Dialect
Other
231 stars 18 forks source link

Fixed array.unshift #47

Closed mpeterv closed 10 years ago

mpeterv commented 10 years ago

Another fix.

Before:

$ shine
Shine 0.0.2 -- Copyright (C) 2013-2014 Richard Hundt.
shine> a = [1, 2, 3]
shine> a.unshift(4)
[string "core"]:0: attempt to perform arithmetic on global 'l' (a nil value)

After:

$ shine
Shine 0.0.2 -- Copyright (C) 2013-2014 Richard Hundt.
shine> a = [1, 2, 3]
shine> a.unshift(4)
shine> print(a)
[4,1,2,3]
richardhundt commented 10 years ago

Thanks again. Just a note, if uncomment this line: https://github.com/richardhundt/shine/blob/master/Makefile#L19

then the debug segments aren't stripped, so it makes the stack traces more meaningful