[Webkit-unassigned] [Bug 170174] New: ES2015 modules - Export default function hoisting

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 28 03:37:21 PDT 2017


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

            Bug ID: 170174
           Summary: ES2015 modules - Export default function hoisting
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: guybedford at gmail.com

The following circular reference case should work as export default can be used with function declarations that are hoisted, according to the rules of the HoistableDeclaration lookahead (https://tc39.github.io/ecma262/#prod-HoistableDeclaration).

Instead, Safari gives the following error: SyntaxError: Importing binding name 'a' is not found.

a.js:
```
import b from './b.js';

b();

export default function a () {
  console.log('a');
}
```

b.js:
```
import a from './a.js';

export default function b () {
  a();
}
```

Where a `<script type="module" src="a.js"></script>` is included in the page.

This can be verified to work in the named exports hoisting case by converting the example to use `export function a ()`, `import {a}`, etc.

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


More information about the webkit-unassigned mailing list