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

Side by Side Diff: lib/compiler/implementation/js_backend/emitter.dart

Issue 10915122: Fix source locations for inlined and patched functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 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
« no previous file with comments | « lib/compiler/implementation/js/printer.dart ('k') | lib/compiler/implementation/leg.dart » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * A function element that represents a closure call. The signature is copied 6 * A function element that represents a closure call. The signature is copied
7 * from the given element. 7 * from the given element.
8 */ 8 */
9 class ClosureInvocationElement extends FunctionElement { 9 class ClosureInvocationElement extends FunctionElement {
10 ClosureInvocationElement(SourceString name, 10 ClosureInvocationElement(SourceString name,
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 // hack. 1295 // hack.
1296 compiler.reportDiagnostic( 1296 compiler.reportDiagnostic(
1297 null, sourceMap, new api.Diagnostic(-1, 'source map')); 1297 null, sourceMap, new api.Diagnostic(-1, 'source map'));
1298 } 1298 }
1299 }); 1299 });
1300 return compiler.assembledCode; 1300 return compiler.assembledCode;
1301 } 1301 }
1302 1302
1303 String buildSourceMap(CodeBuffer buffer, SourceFile compiledFile) { 1303 String buildSourceMap(CodeBuffer buffer, SourceFile compiledFile) {
1304 SourceMapBuilder sourceMapBuilder = new SourceMapBuilder(); 1304 SourceMapBuilder sourceMapBuilder = new SourceMapBuilder();
1305 buffer.forEachSourceLocation((Element element, Token token, int offset) { 1305 buffer.forEachSourceLocation(sourceMapBuilder.addMapping);
1306 if (element == null) {
1307 sourceMapBuilder.addMapping(null, null, null, offset);
1308 return;
1309 }
1310 SourceFile sourceFile = element.getCompilationUnit().script.file;
1311 String sourceName = null;
1312 if (token.kind === IDENTIFIER_TOKEN) {
1313 sourceName = token.slowToString();
1314 }
1315 sourceMapBuilder.addMapping(
1316 sourceFile, token.charOffset, sourceName, offset);
1317 });
1318 return sourceMapBuilder.build(compiledFile); 1306 return sourceMapBuilder.build(compiledFile);
1319 } 1307 }
1320 } 1308 }
1321 1309
1322 typedef void DefineMemberFunction(String invocationName, CodeBuffer definition); 1310 typedef void DefineMemberFunction(String invocationName, CodeBuffer definition);
OLDNEW
« no previous file with comments | « lib/compiler/implementation/js/printer.dart ('k') | lib/compiler/implementation/leg.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698