Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8134503 support ES6 parsing in Nashorn
  3. JDK-8156614

Lazy parsing of ES6 shorthand method syntax is broken

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • core-libs
    • b124
    • generic
    • generic

      D:\src\jdk9-dev\build\windows-x86_64-normal-server-release\images\jdk\bin>.\jjs
        --language=es6
      jjs> var obj = { foo() { print('hello') } }
      jjs> obj.foo()
      jdk.nashorn.internal.runtime.ParserException: <shell>:1:18 Expected ; but found
      {
      var obj = { foo() { print('hello') } }
                        ^

      The following is fine though:

      D:\src\jdk9-dev\build\windows-x86_64-normal-server-release\images\jdk\bin>.\jjs
        --language=es6 --lazy-compilation=false -ot=false
      jjs> var obj = { foo() { print('hello') } }
      jjs> obj.foo()
      hello

            hannesw Hannes Wallnoefer
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: