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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart

Issue 12330135: Make instance methods whose names collide with intercepted methods have the interceptor calling con… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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
Index: sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart (revision 19306)
+++ sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart (working copy)
@@ -484,7 +484,9 @@
emitIsChecks();
jsAst.Expression makeCallOnThis(String functionName) {
- return js.fun([], js.return_(js['$functionName(this)']));
+ // Because we know the function is intercepted, we need an extra
+ // parameter.
+ return js.fun(['_'], js.return_(js['$functionName(this)']));
}
// In order to have the toString method on every native class,
@@ -501,7 +503,9 @@
// Same as above, but for operator==.
String equalsName = backend.namer.publicInstanceMethodNameByArity(
const SourceString('=='), 1);
- addProperty(equalsName, js.fun(['a'],
+ // Because we know the function is intercepted, we need an extra
+ // parameter.
+ addProperty(equalsName, js.fun(['_', 'a'],
js.return_(js['this === a'])));
// If the native emitter has been asked to take care of the

Powered by Google App Engine
This is Rietveld 408576698