Skip to content

lua string instance methods#449

Merged
tomblind merged 1 commit intomasterfrom
string-instance-methods
Feb 24, 2019
Merged

lua string instance methods#449
tomblind merged 1 commit intomasterfrom
string-instance-methods

Conversation

@tomblind
Copy link
Copy Markdown
Collaborator

Currently, tstl doesn't allow lua's string methods to be declared and used:

interface String { upper(): string; }
print("foo".upper()); // error

This PR explicitly enables lua's builtin string methods.

case "reverse":
case "sub":
case "unpack":
case "upper":
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we allow upper to be redefined? TS already has toUpperCase() that should translate to this? Same for several others of these.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Personally, I'd like to be able to disable the es libs altogether and just use lua's in some circumstances.

@tomblind tomblind merged commit 2a8846a into master Feb 24, 2019
@tomblind tomblind deleted the string-instance-methods branch February 24, 2019 23:01
hazzard993 pushed a commit to hazzard993/TypescriptToLua that referenced this pull request Feb 26, 2019
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.

2 participants