Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Typescript4j cannot compile the standard example #14

Open
dustpuppyNGTI opened this issue Feb 23, 2018 · 1 comment
Open

Typescript4j cannot compile the standard example #14

dustpuppyNGTI opened this issue Feb 23, 2018 · 1 comment

Comments

@dustpuppyNGTI
Copy link

dustpuppyNGTI commented Feb 23, 2018

On the example page (https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html) for typescript there is some simple code. This code cannot be compiled by typescript4j.

public class TypeScriptTest {
    private static final String code =
        "function greeter(person) {\n" +
        "    return \"Hello, \" + person;\n" +
        "}\n" +
        "var user = \"Jane User\";\n" +
        "document.body.innerHTML = greeter(user);\n";

    public static void main(final String... args) {
        final TypescriptCompiler typescript = new TypescriptCompiler();
        typescript.setEcmaScriptVersion(EcmaScriptVersion.ES5);
        typescript.compile(code);
    }
}

This results in the following error:

[  Envjs/1.6 (Rhino; U; Mac OS X x86_64 10.12.6; en-US; rv:1.7.0.rc2) Resig/20070309 PilotFish/1.2.13  ]
[main] ERROR com.mangofactory.typescript.TypescriptCompiler - Failed to initialize Typescript compiler
error on line 652: missing name after . operator
        Errors.abstract = function () {
org.mozilla.javascript.EvaluatorException: missing name after . operator (typescript-0.9.1.1.js#652)
	at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:109)
....
@orvitpng
Copy link

It seems that this is unmaintained, I wish that it was still, but sadly not.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants