Closed PopGoesTheWza closed 5 years ago
In order to fully support globalThis
some polyfill or shim is likely required (though not exactly in the scope of ts2gas.
Concerning Improved support for read-only arrays and tuples
a TypeScript issue already exists which I'll follow-up
@grant current changes are OK from my point of view.
Typescript 3.4 new features are compatible with ts2gas with the following limitations:
globalThis
should require a polyfil or shim in order to work (polyfil and shims are not in the scope of ts2gas features I guess)readonly
type modifier in the form readonly string[]
cause the compiler to crash. This is a typescript issue and the fix is in upcoming 3.5 releaseI let you judge as to merge or not this PR
Reference issue #35
Typescript 3.4 introduces new features:
globalThis
package.json
needs be either"typescript": "^3.4.0"
or"typescript": "^3.*.*"
in
test.ts
the following test cases (checked if passed)testTypeScript_34x_highOrder
Higher order function type inferencetestTypeScript_34x_improvedReadonly
Improved support for read-only arrays and tuplestestTypeScript_34x_constContext
Const contexts for literal expressionstestTypeScript_34x_globalThis
globalThis
Detailed test cases input/output: