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

Unified Diff: pkg/dev_compiler/lib/src/compiler/code_generator.dart

Issue 2977163002: Revert "fix #30138, synethic nodes causing crash generating source maps" (Closed)
Patch Set: Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/src/compiler/source_map_printer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/compiler/code_generator.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/code_generator.dart b/pkg/dev_compiler/lib/src/compiler/code_generator.dart
index 24674a4900bc4e269f9f3ae9a348ae363eef6e65..30a3ea6c827763181a91b982de7edeab77bf9edb 100644
--- a/pkg/dev_compiler/lib/src/compiler/code_generator.dart
+++ b/pkg/dev_compiler/lib/src/compiler/code_generator.dart
@@ -583,13 +583,14 @@ class CodeGenerator extends Object
// this is only to catch things that haven't been emitted yet.
//
// See _emitTypeDeclaration.
- _currentElements.add(unit.element);
- var isInternalSdk = isSdkInternalRuntime(currentLibrary);
+ var library = unit.element.library;
+ bool internalSdk = isSdkInternalRuntime(library);
+ _currentElements.add(library);
List<VariableDeclaration> fields;
for (var declaration in unit.declarations) {
if (declaration is TopLevelVariableDeclaration) {
inferNullableTypes(declaration);
- if (isInternalSdk && declaration.variables.isFinal) {
+ if (internalSdk && declaration.variables.isFinal) {
_emitInternalSdkFields(declaration.variables.variables);
} else {
(fields ??= []).addAll(declaration.variables.variables);
@@ -610,7 +611,7 @@ class CodeGenerator extends Object
inferNullableTypes(declaration);
var item = _visit(declaration);
- if (isInternalSdk && element is FunctionElement) {
+ if (internalSdk && element is FunctionElement) {
_internalSdkFunctions.add(item);
} else {
_moduleItems.add(item);
@@ -2364,9 +2365,7 @@ class CodeGenerator extends Object
fields.forEach((FieldElement e, JS.Expression initialValue) {
JS.Expression access =
_classProperties.virtualFields[e] ?? _declareMemberName(e.getter);
- body.add(initialValue
- .toAssignExpression(js.call('this.#', [access]))
- .toStatement());
+ body.add(js.statement('this.# = #;', [access, initialValue]));
});
return _statement(body);
@@ -2475,7 +2474,7 @@ class CodeGenerator extends Object
isGetter: node.isGetter,
isSetter: node.isSetter,
isStatic: node.isStatic),
- null, // don't annotate as this breaks stepping for one-line functions.
+ node,
node.element);
}
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/src/compiler/source_map_printer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698