Please sign in to comment.
Merge pull request #6171 from rhuanjl:hoistExportedFunctions This PR enables function exports to be hoisted across modules as per https://tc39.es/ecma262/#sec-source-text-module-record-initialize-environment I believe this is the last significant bug in the module implementation (there remain two issues with not getting the right errors thrown but those don't impact correct code) This is done by following @guybedford's advice of converting module root functions into generator functions with a yield at the top after functions are defined they are then executed in two steps so that all functions are declared first. **Side effects of this change:** 1. The bottom line of the stack trace for errors thrown in modules `at module` which was in all module error stack traces has been removed - could probably revert this but saw no value to the line 2. Any loops in the module global will now NOT be eligible for jitting - as JitLoopBody is disabled in generator functions - this is probably fixable for modules with some special casing but not currently sure which conditions to edit @boingoing please could you take a look at this? fixes: #5236
- Loading branch information...
Showing with 149 additions and 25 deletions.