| OLD | NEW |
| 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 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 // hack. | 1279 // hack. |
| 1280 compiler.reportDiagnostic( | 1280 compiler.reportDiagnostic( |
| 1281 null, sourceMap, new api.Diagnostic(-1, 'source map')); | 1281 null, sourceMap, new api.Diagnostic(-1, 'source map')); |
| 1282 } | 1282 } |
| 1283 }); | 1283 }); |
| 1284 return compiler.assembledCode; | 1284 return compiler.assembledCode; |
| 1285 } | 1285 } |
| 1286 | 1286 |
| 1287 String buildSourceMap(CodeBuffer buffer, SourceFile compiledFile) { | 1287 String buildSourceMap(CodeBuffer buffer, SourceFile compiledFile) { |
| 1288 SourceMapBuilder sourceMapBuilder = new SourceMapBuilder(); | 1288 SourceMapBuilder sourceMapBuilder = new SourceMapBuilder(); |
| 1289 buffer.forEachSourceLocation((Element element, Token token, int offset) { | 1289 buffer.forEachSourceLocation(sourceMapBuilder.addMapping); |
| 1290 if (element == null) { | |
| 1291 sourceMapBuilder.addMapping(null, null, null, offset); | |
| 1292 return; | |
| 1293 } | |
| 1294 SourceFile sourceFile = element.getCompilationUnit().script.file; | |
| 1295 String sourceName = null; | |
| 1296 if (token.kind === IDENTIFIER_TOKEN) { | |
| 1297 sourceName = token.slowToString(); | |
| 1298 } | |
| 1299 sourceMapBuilder.addMapping( | |
| 1300 sourceFile, token.charOffset, sourceName, offset); | |
| 1301 }); | |
| 1302 return sourceMapBuilder.build(compiledFile); | 1290 return sourceMapBuilder.build(compiledFile); |
| 1303 } | 1291 } |
| 1304 } | 1292 } |
| 1305 | 1293 |
| 1306 typedef void DefineMemberFunction(String invocationName, CodeBuffer definition); | 1294 typedef void DefineMemberFunction(String invocationName, CodeBuffer definition); |
| OLD | NEW |