Title: Number conversion bugs · Issue #1629 · TypeScriptToLua/TypeScriptToLua · GitHub
Open Graph Title: Number conversion bugs · Issue #1629 · TypeScriptToLua/TypeScriptToLua
X Title: Number conversion bugs · Issue #1629 · TypeScriptToLua/TypeScriptToLua
Description: This project is fantastic! Nevertheless, there are a few nuances that need to be fixed. One thing that troubles me is the number conversions. in example code below: const s = "12345" const n1 = +s const n2 = parseInt(s) if (isNaN(n2)) { ...
Open Graph Description: This project is fantastic! Nevertheless, there are a few nuances that need to be fixed. One thing that troubles me is the number conversions. in example code below: const s = "12345" const n1 = +s ...
X Description: This project is fantastic! Nevertheless, there are a few nuances that need to be fixed. One thing that troubles me is the number conversions. in example code below: const s = "12345" cons...
Opengraph URL: https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1629
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Number conversion bugs","articleBody":"This project is fantastic! Nevertheless, there are a few nuances that need to be fixed.\n\nOne thing that troubles me is the number conversions. in example code below:\n\n```\nconst s = \"12345\"\nconst n1 = +s\nconst n2 = parseInt(s)\nif (isNaN(n2)) {\n print(\"Impossible!\")\n}\n```\n\nTranspiled code below:\n```\ns = \"12345\"\nn1 = s\nn2 = __TS__ParseInt(s)\nif __TS__NumberIsNaN(__TS__Number(n2)) then\n print(\"Impossible!\")\nend\n```\n\nCode `const n1 = +s` is wrongly transpiled. It does nothing resulting the wrong type.\nisNaN always forces a Number() conversion on the operand, resulting in a performance penalty.\n","author":{"url":"https://github.com/LibertasIoT","@type":"Person","name":"LibertasIoT"},"datePublished":"2025-05-03T13:20:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1629/TypeScriptToLua/issues/1629"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:85c0bbba-f294-4815-4633-8bc99ee91f3b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B516:14965D:432471D:5BBBF12:6972E984 |
| html-safe-nonce | 733e8954a76c3d2fd2d1ed9e33e800e45374414d74075911c726e953d962f0b3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTE2OjE0OTY1RDo0MzI0NzFEOjVCQkJGMTI6Njk3MkU5ODQiLCJ2aXNpdG9yX2lkIjoiNTQzMzk0MDk0MzMyNjg2NTc5NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 198fa5cc12de689ea693c4b8ef9a56c58e361018800223d230b1fd67f5d36686 |
| hovercard-subject-tag | issue:3037406924 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TypeScriptToLua/TypeScriptToLua/1629/issue_layout |
| twitter:image | https://opengraph.githubassets.com/89c799349f223d4e0cb23ae62f03208f80262d0edf9fc103c473ad32fa082b8d/TypeScriptToLua/TypeScriptToLua/issues/1629 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/89c799349f223d4e0cb23ae62f03208f80262d0edf9fc103c473ad32fa082b8d/TypeScriptToLua/TypeScriptToLua/issues/1629 |
| og:image:alt | This project is fantastic! Nevertheless, there are a few nuances that need to be fixed. One thing that troubles me is the number conversions. in example code below: const s = "12345" const n1 = +s ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | LibertasIoT |
| hostname | github.com |
| expected-hostname | github.com |
| None | 824b30a290fe1f3775d1c3b755ace6ec71165752363f95d9255c1b87220040e4 |
| turbo-cache-control | no-preview |
| go-import | github.com/TypeScriptToLua/TypeScriptToLua git https://github.com/TypeScriptToLua/TypeScriptToLua.git |
| octolytics-dimension-user_id | 44121206 |
| octolytics-dimension-user_login | TypeScriptToLua |
| octolytics-dimension-repository_id | 115876595 |
| octolytics-dimension-repository_nwo | TypeScriptToLua/TypeScriptToLua |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 115876595 |
| octolytics-dimension-repository_network_root_nwo | TypeScriptToLua/TypeScriptToLua |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7ef892904a22cef6ce15e4347cbf70e4cbfdc883 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width