Remove "is function lazy" logic from Preparser + tiny error reporting refactoring.
It doesn't need to have this logic. ParseLazyFunctionLiteralBody is basically just ParseStatementList + log the function position. But PreParser doesn't need to have the "which functions to log" logic, since logging the function is always done exactly when Parser falls back to PreParser. (See PreParseLazyFunction.) So in the current state, PreParser would log several functions in a SingletonLogger, and only the last one would take effect (that's the one Parser also logs in SkipLazyFunctionBody). Also updated test-parsing/Regress928 to produce the preparse data the way we do now (i.e., not running the PreParser directly, but running the Parser). Error reporting: when PreParser finds an error, it doesn't need to ReportUnexpectedToken in PreParseLazyFunction, since it already has reported the error whenever it found it. BUG=v8:5515 Review-Url: https://codereview.chromium.org/2421833002 Cr-Commit-Position: refs/heads/master@{#40315}
Showing
Please
register
or
sign in
to comment