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

Unified Diff: lib/src/codegen/js_codegen.dart

Issue 1144303003: Use signature inheritance when method types are unchanged (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Remove empty signatures Created 5 years, 7 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 | « lib/runtime/dart/typed_data.js ('k') | test/browser/runtime_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_codegen.dart
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
index 1808bf3a1e50ad3dd4710dcfaa2d84b77efaee76..8b46f8c86225157c3f6678f58ddac5a59fbd8a83 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -592,6 +592,10 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
if (!(node.isSetter || node.isGetter || node.isAbstract)) {
var name = node.name.name;
var element = node.element;
+ var inheritedElement =
+ classElem.lookUpInheritedConcreteMethod(name, currentLibrary);
+ if (inheritedElement != null &&
+ inheritedElement.type == element.type) continue;
var unary = node.parameters.parameters.isEmpty;
var memberName = _emitMemberName(name,
type: cType, unary: unary, isStatic: node.isStatic);
@@ -620,9 +624,11 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
sigFields.add(aNames);
}
- var sig = new JS.ObjectInitializer(sigFields);
- var classExpr = new JS.Identifier(name);
- body.add(js.statement('dart.setSignature(#, #);', [classExpr, sig]));
+ if (!sigFields.isEmpty) {
+ var sig = new JS.ObjectInitializer(sigFields);
+ var classExpr = new JS.Identifier(name);
+ body.add(js.statement('dart.setSignature(#, #);', [classExpr, sig]));
+ }
}
return _statement(body);
« no previous file with comments | « lib/runtime/dart/typed_data.js ('k') | test/browser/runtime_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698