Reviewers: rossberg,
Message:
rossberg, ptal.
adamk, fyi, this conflicts w/ your error handling changes, I can rebase
once you
land your CL.
Description:
[strong] Declaration-after-use errors.
We cannot yet detect use-before-declaration in general, because for that
we'd
need to analyze the context when compiling. But we can detect an error case
where we first see a use, then a declaration.
For this, I also added position & end position tracking (needed for error
messages) to Parser / Scope / Variable related classes, and unified error
handling in Parser & Scope.
Note: the position naming is completely inconsistent: start_position &
end_position, position & end_position, pos & end_pos, beg_pos & end_pos, to
name
a few. This doesn't fix all of it, but tries to unify towards
start_position &
end_position whenever possible w/ minimal changes.
BUG=
Please review this at https://codereview.chromium.org/943543002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+350, -143 lines):
M BUILD.gn
M src/ast.h
M src/ast.cc
M src/messages.js
M src/parser.h
M src/parser.cc
A src/pending-compilation-error-handler.h
A src/pending-compilation-error-handler.cc
M src/preparser.h
M src/scopes.h
M src/scopes.cc
M src/variables.h
M src/variables.cc
A test/mjsunit/strong/declaration-after-use.js
M tools/gyp/v8.gyp
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.