Lazy parsing of ES6 shorthand method syntax is broken

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Fixed
    • Priority: P4
    • 9
    • Affects Version/s: 9
    • Component/s: 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

            Assignee:
            Hannes Wallnoefer
            Reporter:
            Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: