[Webkit-unassigned] [Bug 178216] New: ES6 Modules: Syntax, binding errors don't provide source file or line number

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 12 10:09:59 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=178216

            Bug ID: 178216
           Summary: ES6 Modules: Syntax, binding errors don't provide
                    source file or line number
           Product: WebKit
           Version: Safari 11
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: richardconnamacher at gmail.com

When an ES6 module (loaded via an import statement) contains a syntax error or error in resolving an "import" statement, the error message printed to the Console is unhelpful.

Specifically, it doesn't say which file or line number had the error, and the stack trace simply lists the native "promiseReactionJob".

// main.js:

    import {foo} from "./foo.js"

// foo.js:

    syntax error!
    export const foo = "Foo";

// Console message:

    SyntaxError: Unexpected identifier 'error'
      promiseReactionJob

In a traditional script, the syntax error would also indicate the source file (foo.js) and line number (1).

This also happens when an "import" is invalid, such as a missing binding:

// main.js:

    import {bar} from "./foo.js"

// foo.js:

    export const foo = "Foo";

// Console message:

    SyntaxError: Importing binding name 'bar' is not found.
      link
      linkAndEvaluateModule
      (anonymous function)
      promiseReactionJob

As well as if the URL can't be loaded:

// main.js

    import {foo} from "./missing.js";

// Console message:

    Failed to load resource: the requested URL was not found on the server     <url>/missing.js

(Would help if it also said which source file had the failed import statement.)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20171012/27c1abd1/attachment.html>


More information about the webkit-unassigned mailing list