-
-
Notifications
You must be signed in to change notification settings - Fork 185
Lualib as module #1213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lualib as module #1213
Changes from all commits
558b7b4
f4f7a92
6b9e7a8
8ce2350
2d6141f
9279d27
323bced
aceb355
db0e257
8d5283c
c5e3e9e
1132f16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,7 @@ | ||
| require("ts-node/register/transpile-only"); | ||
| const fs = require("fs"); | ||
| const path = require("path"); | ||
| const ts = require("typescript"); | ||
| const tstl = require("./src"); | ||
| const { loadLuaLibFeatures } = require("./src/LuaLib"); | ||
|
|
||
| const configFileName = path.resolve(__dirname, "src/lualib/tsconfig.json"); | ||
| const { diagnostics } = tstl.transpileProject(configFileName); | ||
| const { diagnostics } = tstl.transpileLuaLibProject(configFileName); | ||
| diagnostics.forEach(tstl.createDiagnosticReporter(true)); | ||
|
|
||
| const bundlePath = path.join(__dirname, "dist/lualib/lualib_bundle.lua"); | ||
| if (fs.existsSync(bundlePath)) { | ||
| fs.unlinkSync(bundlePath); | ||
| } | ||
|
|
||
| fs.writeFileSync(bundlePath, loadLuaLibFeatures(Object.values(tstl.LuaLibFeature), ts.sys)); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| function __TS__ArrayConcat(this: void, arr1: any[], ...args: any[]): any[] { | ||
| export function __TS__ArrayConcat(this: void, arr1: any[], ...args: any[]): any[] { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to make Array a class like set/map? EDIT: same applies to Object
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that might cause problems when interacting with existing lua code. Could be done in separate PR, see #262
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think it would be annoying for end users to have to mix Array and LuaArray, for example my game API returns lots of LuaArray
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of scope for this PR, this should be considered in a separate PR. |
||
| const out: any[] = []; | ||
| for (const val of arr1) { | ||
| out[out.length] = val; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.