goby-lang / goby

Goby - Yet another programming language written in Go
MIT License
3.49k stars 171 forks source link

Update the instance method `last()` on array objects to not panic when used with an empty array #854

Closed lara closed 4 years ago

lara commented 4 years ago
a = [2, 6, 3, 4]
a.last    # => 4
a.last(1) # => [4]
codecov[bot] commented 4 years ago

Codecov Report

Merging #854 into master will increase coverage by 0.03%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #854      +/-   ##
==========================================
+ Coverage   81.02%   81.06%   +0.03%     
==========================================
  Files          54       54              
  Lines        7496     7498       +2     
==========================================
+ Hits         6074     6078       +4     
+ Misses       1188     1187       -1     
+ Partials      234      233       -1     
Impacted Files Coverage Δ
vm/array.go 96.65% <100.00%> (+0.33%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8ab7178...2eaac9a. Read the comment docs.