Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: src/rewriter.cc

Issue 24076007: Unify handling of position info in AST, part 1 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« src/parser.cc ('K') | « src/parser.cc ('k') | src/scopes.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 if (processor.HasStackOverflow()) return false; 264 if (processor.HasStackOverflow()) return false;
265 265
266 if (processor.result_assigned()) { 266 if (processor.result_assigned()) {
267 ASSERT(function->end_position() != RelocInfo::kNoPosition); 267 ASSERT(function->end_position() != RelocInfo::kNoPosition);
268 // Set the position of the assignment statement one character past the 268 // Set the position of the assignment statement one character past the
269 // source code, such that it definitely is not in the source code range 269 // source code, such that it definitely is not in the source code range
270 // of an immediate inner scope. For example in 270 // of an immediate inner scope. For example in
271 // eval('with ({x:1}) x = 1'); 271 // eval('with ({x:1}) x = 1');
272 // the end position of the function generated for executing the eval code 272 // the end position of the function generated for executing the eval code
273 // coincides with the end of the with scope which is the position of '1'. 273 // coincides with the end of the with scope which is the position of '1'.
274 int position = function->end_position(); 274 int pos = function->end_position();
275 VariableProxy* result_proxy = processor.factory()->NewVariableProxy( 275 VariableProxy* result_proxy = processor.factory()->NewVariableProxy(
276 result->name(), false, result->interface(), position); 276 result->name(), false, result->interface(), pos);
277 result_proxy->BindTo(result); 277 result_proxy->BindTo(result);
278 Statement* result_statement = 278 Statement* result_statement =
279 processor.factory()->NewReturnStatement(result_proxy); 279 processor.factory()->NewReturnStatement(result_proxy, pos);
280 result_statement->set_statement_pos(position);
281 body->Add(result_statement, info->zone()); 280 body->Add(result_statement, info->zone());
282 } 281 }
283 } 282 }
284 283
285 return true; 284 return true;
286 } 285 }
287 286
288 287
289 } } // namespace v8::internal 288 } } // namespace v8::internal
OLDNEW
« src/parser.cc ('K') | « src/parser.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698