Commit 032a35ff authored by littledan's avatar littledan Committed by Commit bot

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}
parent 10f2c5c3
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment