X Tutup
Skip to content

Add luaTarget: "universal"#873

Merged
Perryvw merged 7 commits intoTypeScriptToLua:masterfrom
ark120202:add-luatarget-universal
May 24, 2020
Merged

Add luaTarget: "universal"#873
Perryvw merged 7 commits intoTypeScriptToLua:masterfrom
ark120202:add-luatarget-universal

Conversation

@ark120202
Copy link
Contributor

Resolves #749

@ark120202 ark120202 marked this pull request as ready for review May 19, 2020 20:29
case LuaTarget.Universal:
case LuaTarget.Lua51:
context.diagnostics.push(unsupportedForTarget(node, "Bitwise operations", LuaTarget.Lua51));
context.diagnostics.push(unsupportedForTarget(node, "Bitwise operations", context.luaTarget));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the other messages you left the version mentioned in the diagnostic to be 5.1 (which also makes sense). We should probably be consistent with this though.


const expectMathAtan2: util.TapCallback = builder => expect(builder.getMainLuaCodeChunk()).toContain("math.atan2(");
const expectMathAtan: util.TapCallback = builder => expect(builder.getMainLuaCodeChunk()).toContain("math.atan(");
const expectTsMathAtan2: util.TapCallback = builder =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be nicer to call this expectLualibMathAtan2.

// TODO: Make some utils for testing other targets
const expectUnpack: util.TapCallback = builder => expect(builder.getMainLuaCodeChunk()).toMatch(/[^.]unpack\(/);
const expectTableUnpack: util.TapCallback = builder => expect(builder.getMainLuaCodeChunk()).toContain("table.unpack");
const expectTsUnpack: util.TapCallback = builder => expect(builder.getMainLuaCodeChunk()).toContain("__TS__Unpack");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we changed expectTsMathAtan2 to expectLualibMathAtan2, I would suggest also changing this one to expectLualibUnpack

@Perryvw Perryvw merged commit 912a230 into TypeScriptToLua:master May 24, 2020
@ark120202 ark120202 deleted the add-luatarget-universal branch May 24, 2020 14:02
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.

Add luaTarget: "universal"

2 participants

X Tutup