X Tutup
Skip to content

Generalize class accessors transform#774

Merged
Perryvw merged 11 commits intoTypeScriptToLua:masterfrom
ark120202:generalize-class-accessors
Mar 12, 2020
Merged

Generalize class accessors transform#774
Perryvw merged 11 commits intoTypeScriptToLua:masterfrom
ark120202:generalize-class-accessors

Conversation

@ark120202
Copy link
Contributor

@ark120202 ark120202 commented Dec 19, 2019

Fixes #725

{ luaPattern: "setmetatable(Bar,", typeScriptPattern: "Foo {" },
{ luaPattern: "setmetatable(Bar.prototype,", typeScriptPattern: "Foo {" },
{ luaPattern: "__TS__ClassExtends(", typeScriptPattern: "extends" },
{ luaPattern: "Foo)", typeScriptPattern: "Foo {" },
Copy link
Member

Choose a reason for hiding this comment

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

This last pattern seems a bit strange to test. Could we instead test some other lua pattern we actually care about, otherwise just delete this. I doubt lua will ever throw an error on Foo)'s location anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed it to a function call, which should be a more important mapping

@ark120202 ark120202 marked this pull request as ready for review January 20, 2020 11:52
@Perryvw
Copy link
Member

Perryvw commented Jan 27, 2020

Can you add a 'Next release' section the changelog and add a point describing this PR?

@Perryvw Perryvw merged commit 1a1e369 into TypeScriptToLua:master Mar 12, 2020
@ark120202 ark120202 deleted the generalize-class-accessors branch March 16, 2020 14:18
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.

Inherited accessors break when base is type-erased

2 participants

X Tutup