Function with same body not reparsed after SyntaxError

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: 9
    • Component/s: core-libs
    • None
    • b63
    • generic
    • generic

        First time: parser throws SyntaxError
        jjs> Function("/a/r")
        <shell>:1 SyntaxError: <function>:1:4 Unsupported RegExp flag: r
        /a/r
            ^

        Second time: silently succeeds
        jjs> Function("/a/r")
        function () {
        /a/r
        }

        Third time also silently succeeds; trying to invoke it now throws the error during invocation:

        jjs> var x = Function("/a/r")
        jjs> x()
        <function>:2 SyntaxError: Unsupported RegExp flag: r

        This seems inconsistent.

              Assignee:
              Hannes Wallnoefer
              Reporter:
              Attila Szegedi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: