Translate AST to Hydrogen missing position
This patch translates RelocInfo::kNoPosition to SourcePosition::Unknown() in constructing the Hydrogen graph from the parser's output. The translation is done to increase the flexibility of the parser to desugar more things that don't have natural locations. R=bmeurer@chromium.org BUG=v8:4377 LOG=N Review URL: https://codereview.chromium.org/1313443002 Cr-Commit-Position: refs/heads/master@{#30337}
This commit is contained in:
parent
10f2c5c33a
commit
032a35ffb6
@ -1889,6 +1889,9 @@ class HGraphBuilder {
|
||||
// the SourcePosition assuming that this position corresponds to the
|
||||
// same function as current position_.
|
||||
SourcePosition ScriptPositionToSourcePosition(int position) {
|
||||
if (position == RelocInfo::kNoPosition) {
|
||||
return SourcePosition::Unknown();
|
||||
}
|
||||
SourcePosition pos = position_;
|
||||
pos.set_position(position - start_position_);
|
||||
return pos;
|
||||
|
Loading…
Reference in New Issue
Block a user