Skip to content

chore: sync with gopher-lua master #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 3, 2024
Merged

chore: sync with gopher-lua master #2

merged 12 commits into from
Jul 3, 2024

Conversation

reversearrow
Copy link

No description provided.

mzki and others added 12 commits August 12, 2023 17:20
In the C implementation of the Lua interpreter,
in the io.popen function the second argument can be nil:

Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio:

> x,y = io.popen("ls", nil)
> assert(x)
> assert(y == nil)
>

Gopher lua throws an exception:
bad argument #2 to popen (string expected, got nil)

Closes yuin#459
popen: support nil in second argument
regstry.Set* were very simple functions at the beginning of the project,
but recently not.

It seems inlining these functions make improvements better.
GopherLua is a relatively old project. Old Go runtime had  slow interface
type assertions, but now Go runtime better its performance.
…ocket

Re-add link to relocated gluasocket library
$ lua
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> file = "/tmp"
> fd, _, code = io.open(file, "r")
> _, _, ecode = fd:read(1)
> print(ecode)
21
>

gopher-lua throws an exception:
        read /tmp: is a directory
stack traceback:
        [G]: in function 'read'
        extra/wrapper.lua:17: in function 'exec'
        <string>:1: in main chunk
        [G]: ?

This patch results in behavior similar to the vanilla lua
implementation.

Closes yuin#455
iolib: fix different behavior in read function
@CLAassistant
Copy link

CLAassistant commented Jul 2, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 4 committers have signed the CLA.

❌ mzki
❌ yuin
❌ 0x501D
❌ drauschenbach
You have signed the CLA already but the status is still pending? Let us recheck it.

@reversearrow reversearrow self-assigned this Jul 2, 2024
@reversearrow reversearrow marked this pull request as ready for review July 2, 2024 20:10
@reversearrow reversearrow changed the title sync with gopher-lua master chore: sync with gopher-lua master Jul 2, 2024
@coveralls
Copy link

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9767317216

Details

  • 686 of 797 (86.07%) changed or added relevant lines in 6 files are covered.
  • 8 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.3%) to 89.623%

Changes Missing Coverage Covered Lines Changed/Added Lines %
value.go 14 16 87.5%
state.go 56 69 81.16%
vm.go 606 702 86.32%
Files with Coverage Reduction New Missed Lines %
state.go 8 83.73%
Totals Coverage Status
Change from base Build 6213532616: -0.3%
Covered Lines: 7756
Relevant Lines: 8654

💛 - Coveralls

@reversearrow reversearrow merged commit c3199cb into master Jul 3, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants