Skip to content

⚠️ Incorrect function compiling #382

@Keller18306

Description

@Keller18306

Describe the bug

Incorrect compiling the function with return LuaMultiReturn. Code breaks.

To Reproduce

mtasa.addCommandHandler('anime', () => {
    mtasa.outputChatBox('Nya!')
    const [width, height] = mtasa.guiGetScreenSize()
//code breaks executing
    mtasa.outputChatBox(`${width} - ${height}`)
})

Expected behavior

The code doesn't crash. And at compile time, unpack is not added

Screenshots

image

Desktop information

win11

NPM Version

{
  npm: '8.12.1',
  node: '16.15.1',
  v8: '9.4.146.24-node.21',
  uv: '1.43.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '93',
  nghttp2: '1.47.0',
  napi: '8',
  llhttp: '6.0.4',
  openssl: '1.1.1o+quic',
  cldr: '40.0',
  icu: '70.1',
  tz: '2021a3',
  unicode: '14.0',
  ngtcp2: '0.1.0-DEV',
  nghttp3: '0.1.0-DEV'
}

NPM Package versions

test@ C:\MTA Server\server\mods\deathmatch\resources\[ZombiePlague]
├── @typescript-eslint/[email protected]
├── @typescript-eslint/[email protected]
├── @typescript-to-lua/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Additional context

Without unpack code continue executing without problems

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions