Skip to content

Commit 9d868a2

Browse files
nshahanathomas
authored andcommitted
[ddc] Fix incorrect source maps from JS templates
JS templates should always use their own source information. DDC was incorrectly caching and reusing templates with the same source information in various parts of the program. This lead to incorrect source maps and in some cases compiler crashes when the source map in a user application pointed to source location in the SDK. Change-Id: I11607e6f02b894ead1d350e9b3071173ba36a048 Fixes: #43589 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166122 Reviewed-by: Mark Zhou <[email protected]> Reviewed-by: Sigmund Cherem <[email protected]> Commit-Queue: Nicholas Shahan <[email protected]>
1 parent efd7536 commit 9d868a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/dev_compiler/lib/src/kernel/compiler.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5034,7 +5034,7 @@ class ProgramCompiler extends ComputeOnceConstantVisitor<js_ast.Expression>
50345034

50355035
assert(result is js_ast.Expression ||
50365036
result is js_ast.Statement && node.parent is ExpressionStatement);
5037-
return result;
5037+
return result.withSourceInformation(_nodeStart(node));
50385038
}
50395039

50405040
bool _isNull(Expression expr) =>

0 commit comments

Comments
 (0)