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

Unified Diff: pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart

Issue 1982413002: Fix "break" vs "continue" bug in js interop codegen that was the real source of missing js interop … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
index bf7905a85285ad400de0162984d42dc7f9d59d96..14e9e578a823e864843838f26bddddd938fd743f 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
@@ -323,9 +323,6 @@ class ProgramBuilder {
}
void _addJsInteropStubs(LibrariesMap librariesMap) {
- // TODO(26456): we should be using codegenWorld instead of resolverWorld
- // to determine what invocations could be live but codegenWorld has a bug
- // resulting in it missing some invocations.
if (_classes.containsKey(_compiler.coreClasses.objectClass)) {
var toStringInvocation = namer.invocationName(Selectors.toString_);
// TODO(jacobr): register toString as used so that it is always accessible
@@ -351,7 +348,7 @@ class ProgramBuilder {
if (!member.isInstanceMember) return;
if (member.isGetter || member.isField || member.isFunction) {
var selectors =
- _compiler.resolverWorld.getterInvocationsByName(member.name);
+ _compiler.codegenWorld.getterInvocationsByName(member.name);
if (selectors != null && !selectors.isEmpty) {
for (var selector in selectors.keys) {
var stubName = namer.invocationName(selector);
@@ -366,7 +363,7 @@ class ProgramBuilder {
if (member.isSetter || (member.isField && !member.isConst)) {
var selectors =
- _compiler.resolverWorld.setterInvocationsByName(member.name);
+ _compiler.codegenWorld.setterInvocationsByName(member.name);
if (selectors != null && !selectors.isEmpty) {
var stubName = namer.setterForElement(member);
if (stubNames.add(stubName.key)) {
@@ -422,7 +419,8 @@ class ProgramBuilder {
maxArgs = 32767;
}
var selectors =
- _compiler.resolverWorld.invocationsByName(member.name);
+ _compiler.codegenWorld.invocationsByName(member.name);
+
// Named arguments are not yet supported. In the future we
// may want to map named arguments to an object literal containing
// all named arguments.
@@ -431,11 +429,11 @@ class ProgramBuilder {
// Check whether the arity matches this member.
var argumentCount = selector.argumentCount;
// JS interop does not support named arguments.
- if (selector.namedArgumentCount > 0) break;
- if (argumentCount < minArgs) break;
- if (argumentCount > maxArgs) break;
+ if (selector.namedArgumentCount > 0) continue;
+ if (argumentCount < minArgs) continue;
+ if (argumentCount > maxArgs) continue;
var stubName = namer.invocationName(selector);
- if (!stubNames.add(stubName.key)) break;
+ if (!stubNames.add(stubName.key)) continue;
var parameters =
new List<String>.generate(argumentCount, (i) => 'p$i');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698